mirror of
https://github.com/slawkens/myaac.git
synced 2025-10-17 19:23:27 +02:00
[UPDATE] Adding monster looks to db (#220)
* [UPDATE] Adding monster looks to db * small adjustments add into schema.sql + change position in table * add DEFAULT = '' --------- Co-authored-by: slawkens <slawkens@gmail.com>
This commit is contained in:
@@ -36,6 +36,7 @@
|
||||
* @property-read int $armor Armor rate.
|
||||
* @property-read array $defenses List of defenses.
|
||||
* @property-read array $attacks List of attacks.
|
||||
* @property-read array $look List of looks.
|
||||
*/
|
||||
class OTS_Monster extends DOMDocument
|
||||
{
|
||||
@@ -273,6 +274,30 @@ class OTS_Monster extends DOMDocument
|
||||
return $loot;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns look of the monster.
|
||||
*
|
||||
* @return array Look with all the attributes of the look.
|
||||
* @throws DOMException On DOM operation error.
|
||||
*/
|
||||
public function getLook()
|
||||
{
|
||||
$look = array();
|
||||
|
||||
$element = $this->documentElement->getElementsByTagName('look')->item(0);
|
||||
|
||||
$look['type'] = $element->getAttribute('type');
|
||||
$look['typeex'] = $element->getAttribute('typeex');
|
||||
$look['head'] = $element->getAttribute('head');
|
||||
$look['body'] = $element->getAttribute('body');
|
||||
$look['legs'] = $element->getAttribute('legs');
|
||||
$look['feet'] = $element->getAttribute('feet');
|
||||
$look['addons'] = $element->getAttribute('addons');
|
||||
$look['corpse'] = $element->getAttribute('corpse');
|
||||
|
||||
return $look;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns all monster summons.
|
||||
*
|
||||
@@ -560,6 +585,9 @@ class OTS_Monster extends DOMDocument
|
||||
case 'attacks':
|
||||
return $this->getAttacks();
|
||||
|
||||
case 'look':
|
||||
return $this->getLook();
|
||||
|
||||
default:
|
||||
throw new OutOfBoundsException();
|
||||
}
|
||||
|
Reference in New Issue
Block a user