POT
POT
POT
Main menu

Download

Forum

SVN

Class: OTS_Monster

Source Location: /classes/OTS_Monster.php

Class OTS_Monster

Class Overview

Wrapper for monsters files DOMDocument.

Wrapper for monsters files DOMDocument. Note: as this class extends DOMDocument class and contains exacly file XML tree you can work on it as on normal DOM tree.

Located in /classes/OTS_Monster.php [line 40]

DOMDocument
   |
   --OTS_Monster
Author(s):
API Tags:
Property-read:  string $name: Monster name.
Property-read:  string $race: Monster race.
Property-read:  int $experience: Experience for killing monster.
Property-read:  int $speed: Monster speed.
Property-read:  int|bool $manaCost: Mana required (false if not possible).
Property-read:  int $health: Hit points.
Property-read:  array $flags: Flags.
Property-read:  array $voices: List of sounds.
Property-read:  array $items: List of possible loot.
Property-read:  array $immunities: List of immunities.
Property-read:  int $defense: Defense rate.
Property-read:  int $armor: Armor rate.
Property-read:  array $defenses: List of defenses.
Property-read:  array $attacks: List of attacks.

Information Tags:
Version:  0.1.3
Version:  0.0.6
Since:  0.0.6

Methods

[ Top ]
Inherited Properties, Constants, and Methods
Inherited Properties Inherited Methods Inherited Constants

Inherited From DOMDocument (Internal Class)

constructor __construct ( [$version = ], [$encoding = ] )
adoptNode ( $source )
appendChild ( $newChild )
C14N ( [$exclusive = ], [$with_comments = ], [$xpath = ], [$ns_prefixes = ] )
C14NFile ( $uri, [$exclusive = ], [$with_comments = ], [$xpath = ], [$ns_prefixes = ] )
cloneNode ( $deep )
compareDocumentPosition ( $other )
createAttribute ( $name )
createAttributeNS ( $namespaceURI, $qualifiedName )
createCDATASection ( $data )
createComment ( $data )
createDocumentFragment ( )
createElement ( $tagName, [$value = ] )
createElementNS ( $namespaceURI, $qualifiedName, [$value = ] )
createEntityReference ( $name )
createProcessingInstruction ( $target, $data )
createTextNode ( $data )
getElementById ( $elementId )
getElementsByTagName ( $tagName )
getElementsByTagNameNS ( $namespaceURI, $localName )
getFeature ( $feature, $version )
getNodePath ( )
getUserData ( $key )
hasAttributes ( )
hasChildNodes ( )
importNode ( $importedNode, $deep )
insertBefore ( $newChild, [$refChild = ] )
isDefaultNamespace ( $namespaceURI )
isEqualNode ( $arg )
isSameNode ( $other )
isSupported ( $feature, $version )
load ( $source, [$options = ] )
loadHTML ( $source )
loadHTMLFile ( $source )
loadXML ( $source, [$options = ] )
lookupNamespaceUri ( $prefix )
lookupPrefix ( $namespaceURI )
normalize ( )
normalizeDocument ( )
registerNodeClass ( $baseClass, $extendedClass )
relaxNGValidate ( $filename )
relaxNGValidateSource ( $source )
removeChild ( $oldChild )
renameNode ( $node, $namespaceURI, $qualifiedName )
replaceChild ( $newChild, $oldChild )
save ( $file )
saveHTML ( )
saveHTMLFile ( $file )
saveXML ( [$node = ] )
schemaValidate ( $filename )
schemaValidateSource ( $source )
setUserData ( $key, $data, $handler )
validate ( )
xinclude ( [$options = ] )

[ Top ]
Method Summary
int   getArmor()   Returns monster armor.
array   getAttacks()   Returns list of monster attacks.
int   getDefense()   Returns monster defense rate.
array   getDefenses()   Returns list of special defenses.
int   getExperience()   Returns amount of experience for killing this monster.
int|bool   getFlag()   Returns specified flag value.
array   getFlags()   Returns all monster flags (in format flagname => value).
int   getHealth()   Returns monster HP.
array   getImmunities()   Returns all monster immunities.
array   getItems()   Returns all possible loot.
array   getLoot()  
int|bool   getManaCost()   Returns amount of mana required to summon this monster.
string   getName()   Returns monster name.
string   getRace()   Returns monster race.
int   getSpeed()   Returns monster speed.
array   getVoices()   Returns voices that monster can sound.
bool   hasImmunity()   Checks if monster has given immunity.
mixed   __get()   Magic PHP5 method.
string   __toString()   Returns string representation of XML.

[ Top ]
Methods
getArmor  [line 339]

  int getArmor( )

Returns monster armor.

Returns monster armor.


API Tags:
Return:  Armor rate.
Access:  public

Information Tags:
Version:  0.0.6
Throws:  DOMException On DOM operation error.
Since:  0.0.6

[ Top ]
getAttacks  [line 382]

  array getAttacks( )

Returns list of monster attacks.

Returns list of monster attacks.


API Tags:
Return:  List of attafck effects.
Access:  public

Information Tags:
Version:  0.0.6
Throws:  DOMException On DOM operation error.
Since:  0.0.6

[ Top ]
getDefense  [line 320]

  int getDefense( )

Returns monster defense rate.

Returns monster defense rate.


API Tags:
Return:  Defense rate.
Access:  public

Information Tags:
Version:  0.0.6
Throws:  DOMException On DOM operation error.
Since:  0.0.6

[ Top ]
getDefenses  [line 358]

  array getDefenses( )

Returns list of special defenses.

Returns list of special defenses.


API Tags:
Return:  List of defense effects.
Access:  public

Information Tags:
Version:  0.0.6
Throws:  DOMException On DOM operation error.
Since:  0.0.6

[ Top ]
getExperience  [line 70]

  int getExperience( )

Returns amount of experience for killing this monster.

Returns amount of experience for killing this monster.


API Tags:
Return:  Experience points.
Access:  public

Information Tags:
Version:  0.0.6
Throws:  DOMException On DOM operation error.
Since:  0.0.6

[ Top ]
getFlag  [line 144]

  int|bool getFlag( string $flag  )

Returns specified flag value.

Returns specified flag value.

Parameters:
string   $flag:  Flag.

API Tags:
Return:  Flag value (false if not set).
Access:  public

Information Tags:
Version:  0.0.6
Throws:  DOMException On DOM operation error.
Since:  0.0.6

[ Top ]
getFlags  [line 122]

  array getFlags( )

Returns all monster flags (in format flagname => value).

Returns all monster flags (in format flagname => value).


API Tags:
Return:  Flags.
Access:  public

Information Tags:
Version:  0.0.6
Throws:  DOMException On DOM operation error.
Since:  0.0.6

[ Top ]
getHealth  [line 111]

  int getHealth( )

Returns monster HP.

Returns monster HP.


API Tags:
Return:  Hit points.
Access:  public

Information Tags:
Version:  0.0.6
Throws:  DOMException On DOM operation error.
Since:  0.0.6

[ Top ]
getImmunities  [line 261]

  array getImmunities( )

Returns all monster immunities.

Returns all monster immunities.


API Tags:
Return:  Immunities.
Access:  public

Information Tags:
Version:  0.0.6
Throws:  DOMException On DOM operation error.
Since:  0.0.6

[ Top ]
getItems  [line 227]

  array getItems( )

Returns all possible loot.

Returns all possible loot. In order to use this method you have to have global items list loaded.


API Tags:
Return:  List of item types.
Access:  public

Information Tags:
Version:  0.1.0
Version:  0.0.6
Throws:  DOMException On DOM operation error.
Throws:  E_OTS_NotLoaded When there is no items list available in global POT instance.
Since:  0.0.6
Since:  0.1.0

[ Top ]
getLoot  [line 189]

  array getLoot( )


API Tags:
Return:  List of item IDs.
Deprecated:  0.1.0 Use getItems().
Access:  public

Information Tags:
Version:  0.0.6
Since:  0.0.6

[ Top ]
getManaCost  [line 92]

  int|bool getManaCost( )

Returns amount of mana required to summon this monster.

Returns amount of mana required to summon this monster.


API Tags:
Return:  Mana required (false if not possible).
Access:  public

Information Tags:
Version:  0.0.6
Throws:  DOMException On DOM operation error.
Since:  0.0.6

[ Top ]
getName  [line 48]

  string getName( )

Returns monster name.

Returns monster name.


API Tags:
Return:  Name.
Access:  public

Information Tags:
Version:  0.0.6
Throws:  DOMException On DOM operation error.
Since:  0.0.6

[ Top ]
getRace  [line 59]

  string getRace( )

Returns monster race.

Returns monster race.


API Tags:
Return:  Race.
Access:  public

Information Tags:
Version:  0.0.6
Throws:  DOMException On DOM operation error.
Since:  0.0.6

[ Top ]
getSpeed  [line 81]

  int getSpeed( )

Returns monster speed.

Returns monster speed.


API Tags:
Return:  Speed.
Access:  public

Information Tags:
Version:  0.0.6
Throws:  DOMException On DOM operation error.
Since:  0.0.6

[ Top ]
getVoices  [line 166]

  array getVoices( )

Returns voices that monster can sound.

Returns voices that monster can sound.


API Tags:
Return:  List of voices.
Access:  public

Information Tags:
Version:  0.0.6
Throws:  DOMException On DOM operation error.
Since:  0.0.6

[ Top ]
hasImmunity  [line 293]

  bool hasImmunity( string $name  )

Checks if monster has given immunity.

Checks if monster has given immunity.

Parameters:
string   $name:  Immunity to check.

API Tags:
Return:  Immunity state.
Access:  public

Information Tags:
Version:  0.0.6
Throws:  DOMException On DOM operation error.
Since:  0.0.6

[ Top ]
__get  [line 410]

  mixed __get( string $name  )

Magic PHP5 method.

Magic PHP5 method.

Parameters:
string   $name:  Property name.

API Tags:
Return:  Property value.
Access:  public

Information Tags:
Version:  0.1.0
Version:  0.0.6
Throws:  DOMException On DOM operation error.
Throws:  OutOfBoundsException For non-supported properties.
Since:  0.0.6
Since:  0.1.0

[ Top ]
__toString  [line 472]

  string __toString( )

Returns string representation of XML.

Returns string representation of XML. If any display driver is currently loaded then it uses it's method. Otherwise just returns monster XML content.


API Tags:
Return:  String representation of object.
Access:  public

Information Tags:
Version:  0.1.3
Version:  0.0.6
Since:  0.0.6
Since:  0.1.0

[ Top ]