Difference between revisions of "Monster hp"

From Kolmafia
Jump to navigation Jump to search
imported>Bale
(monster.raw_hp)
imported>Bale
(template)
Line 29: Line 29:
 
see_also={{SeeAlso|monster_attack|monster_defense|monster_initiative|monster_element}}|
 
see_also={{SeeAlso|monster_attack|monster_defense|monster_initiative|monster_element}}|
 
more_info=For the current discussion of what's being tracked in-combat for monster level adjustments, please see [http://kolmafia.us/showthread.php?3452 this thread].|
 
more_info=For the current discussion of what's being tracked in-combat for monster level adjustments, please see [http://kolmafia.us/showthread.php?3452 this thread].|
special=If no monster is specified and no monster has been fought in this session, this function returns 0. This is because mafia forgets the value of [[last_monster|last_monster()]] when it logs out.|
+
special=If no monster is specified and no monster has been fought in this session, this function returns 0. This is because mafia forgets the value of {{f|last_monster}} when it logs out.|
 
}}
 
}}
  
 
[[Category:Adventuring]][[Category:In-combat Consulting]]
 
[[Category:Adventuring]][[Category:In-combat Consulting]]

Revision as of 06:24, 8 November 2014

needs(code_samples);

Function Syntax

int monster_hp()

int monster_hp(monster check_me )

  • check_me is the (optional) monster to get the HP of

Returns the HP of the specified monster check_me. If check_me is not specified, it will return the HP of the current monster if you are in a fight (i.e. you're calling the function from an In-combat Consulting script), or the HP of the last monster you encountered otherwise. If you are in a fight, this will return the monster's current HP to the best of KoLmafia's knowledge.

The return value includes monster level modifications. This means that for monsters with unknown HP, the return value will initially be equivalent to monster_level_adjustment().

If you want to know the monster's raw HP without being modified by monster level adjustments, it is available through the monster.raw_hp proxy field.

See Also

monster_attack() | monster_defense() | monster_initiative() | monster_element()

More Information

For the current discussion of what's being tracked in-combat for monster level adjustments, please see this thread.

Special

If no monster is specified and no monster has been fought in this session, this function returns 0. This is because mafia forgets the value of last_monster() when it logs out.