Difference between revisions of "Monster hp"

From Kolmafia
Jump to navigation Jump to search
imported>StDoodle
m
imported>Zarqon
(better reflect mafia's handling; remove a RFI)
Line 23: Line 23:
 
p1desc={{Pspan|check_me}} is the (optional) monster to get the HP of|
 
p1desc={{Pspan|check_me}} is the (optional) monster to get the HP of|
 
}}|
 
}}|
function_description=Returns the HP of the specified monster {{pspan|check_me}}. If {{pspan|check_me}} is not specified, it defaults to the last monster you encountered. This function adjusts for know effects (such as monster level modifications).</p>
+
function_description=Returns the HP of the specified monster {{pspan|check_me}}. If {{pspan|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.</p>
<p>This function can be used from within an [[In-combat Consulting]] script to help determine your fight strategy. When used this way, it isn't necessary to specify a monster, as the function will default to the one currently being fought. It will update the information returned each time it is called, to the best of KoLmafia's knowledge.|
+
<p>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().|
  
 
needscode=yes|
 
needscode=yes|
Line 32: Line 32:
 
special=When not logged in, this function returns 0 if no monster is specified.|
 
special=When not logged in, this function returns 0 if no monster is specified.|
 
}}
 
}}
{{RFI|Is the information about the self-updating nature of the return value correct?|Is the not-logged-in value correct?}}
+
{{RFI|Is the not-logged-in value correct?}}

Revision as of 05:36, 17 April 2010

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().

See Also

monster_attack() | monster_defense() | monster_element()

More Information

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

Special

When not logged in, this function returns 0 if no monster is specified.


Attention KoLmafia Experts!

We need your help; some details of this function's operation are unknown or unclear.

The following specific question has been raised:

  • Is the not-logged-in value correct?