diff options
Diffstat (limited to 'crawl-ref/source/mon-util.cc')
-rw-r--r-- | crawl-ref/source/mon-util.cc | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/crawl-ref/source/mon-util.cc b/crawl-ref/source/mon-util.cc index cc6270add5..43da96b512 100644 --- a/crawl-ref/source/mon-util.cc +++ b/crawl-ref/source/mon-util.cc @@ -5788,37 +5788,33 @@ god_type monsters::deity() const return (god); } -void monsters::rot(actor *atk, int rotlevel, int immed_rot) +void monsters::rot(actor *agent, int amount, int immediate) { - if (res_rotting() > 0) + if (res_rotting() > 0 || amount <= 0) return; // Apply immediate damage because we can't handle rotting for // monsters yet. - const int damage = immed_rot; - if (damage > 0) + if (immediate > 0) { if (mons_near(this) && player_monster_visible(this)) { mprf("%s %s!", name(DESC_CAP_THE).c_str(), - rotlevel == 0 ? "looks less resilient" : "rots"); + amount > 0 ? "rots" : "looks less resilient"); } - hurt(atk, damage); + hurt(agent, immediate); if (alive()) { - max_hit_points -= immed_rot * 2; + max_hit_points -= immediate * 2; if (hit_points > max_hit_points) hit_points = max_hit_points; } } - if (rotlevel > 0) - { - add_ench(mon_enchant(ENCH_ROT, std::min(rotlevel, 4), - atk->kill_alignment())); - } + add_ench(mon_enchant(ENCH_ROT, std::min(amount, 4), + agent->kill_alignment())); } int monsters::hurt(const actor *agent, int amount, beam_type flavour, |