Difference between revisions of "Expected damage"

From Kolmafia
Jump to navigation Jump to search
imported>MapleMario
imported>StDoodle
(No difference)

Revision as of 22:06, 2 March 2010

expected_damage(monster mon)
Estimates how much damage the specified monster will deal to you (given your current player status).

# scriptlet that determines whether it is safe to fight a certain monster
# (if they deal less than 20% of your hp each hit)
boolean safe_to_fight(monster mon)
{

  int expected_dmg = expected_damage(mon);
  int hp = my_maxhp();
  int hp_limit = hp * 0.2;

  if (expected_dmg < hp_limit) return true;
  return false;

}