diff options
-rw-r--r-- | crawl-ref/source/fight.cc | 25 |
1 files changed, 16 insertions, 9 deletions
diff --git a/crawl-ref/source/fight.cc b/crawl-ref/source/fight.cc index dedc2c494a..b106f8c4f1 100644 --- a/crawl-ref/source/fight.cc +++ b/crawl-ref/source/fight.cc @@ -2058,15 +2058,6 @@ void melee_attack::drain_monster() def_name(DESC_NOCAP_THE).c_str()); } - if (one_chance_in(5)) - { - def->hit_dice--; - def->experience = 0; - } - - def->max_hit_points -= 2 + random2(3); - def->hurt(attacker, 2 + random2(3), BEAM_NEG, false); - special_damage = 1 + (random2(damage_done) / 2); attacker->god_conduct(DID_NECROMANCY, 2); } @@ -4553,6 +4544,10 @@ void melee_attack::mons_perform_attack_rounds() mons_set_weapon(attk); to_hit = mons_to_hit(); + const bool draining_attack = damage_brand == SPWPN_DRAINING + || (attk.flavour == AF_DRAIN_XP + && attacker != defender); + const bool chaos_attack = damage_brand == SPWPN_CHAOS || (attk.flavour == AF_CHAOS && attacker != defender); @@ -4661,6 +4656,18 @@ void melee_attack::mons_perform_attack_rounds() break; } + if (draining_attack && defender->atype() == ACT_MONSTER) + { + if (one_chance_in(5)) + { + def->hit_dice--; + def->experience = 0; + } + + def->max_hit_points -= 2 + random2(3); + def->hurt(attacker, 2 + random2(3), BEAM_NEG, false); + } + defender->hurt(attacker, damage_done + special_damage); if (!defender->alive()) |