From 568b2909750fda3861179187d6ce52bb48f05e6f Mon Sep 17 00:00:00 2001 From: dolorous Date: Sat, 18 Apr 2009 17:14:21 +0000 Subject: Fix [2769326]: Deep dwarf ghosts shouldn't regenerate. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@9629 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/effects.cc | 27 +++++++++++++++------------ crawl-ref/source/mon-util.cc | 9 ++++++--- 2 files changed, 21 insertions(+), 15 deletions(-) (limited to 'crawl-ref/source') diff --git a/crawl-ref/source/effects.cc b/crawl-ref/source/effects.cc index c13c762222..ef29b00b7b 100644 --- a/crawl-ref/source/effects.cc +++ b/crawl-ref/source/effects.cc @@ -3598,23 +3598,26 @@ void update_level(double elapsedTime) if (mon->flags & MF_JUST_SUMMONED) continue; - // XXX: Allow some spellcasting (like Healing and Teleport)? -- bwr + // XXX: Allow some spellcasting (like Healing and Teleport)? - bwr // const bool healthy = (mon->hit_points * 2 > mon->max_hit_points); // This is the monster healing code, moved here from tag.cc: - if (monster_descriptor(mon->type, MDSC_REGENERATES) - || mon->type == MONS_PLAYER_GHOST) + if (mons_can_regenerate(mon)) { - heal_monster(mon, turns, false); - } - else if (mons_can_regenerate(mon)) - { - // Set a lower ceiling of 0.1 on the regen rate. - const int regen_rate = - std::max(mons_natural_regen_rate(mon) * 2, 5); + if (monster_descriptor(mon->type, MDSC_REGENERATES) + || mon->type == MONS_PLAYER_GHOST) + { + heal_monster(mon, turns, false); + } + else + { + // Set a lower ceiling of 0.1 on the regen rate. + const int regen_rate = + std::max(mons_natural_regen_rate(mon) * 2, 5); - heal_monster(mon, div_rand_round(turns * regen_rate, 50), - false); + heal_monster(mon, div_rand_round(turns * regen_rate, 50), + false); + } } // Handle nets specially to remove the trapping property of the net. diff --git a/crawl-ref/source/mon-util.cc b/crawl-ref/source/mon-util.cc index 6322e90e50..23299ce6ff 100644 --- a/crawl-ref/source/mon-util.cc +++ b/crawl-ref/source/mon-util.cc @@ -927,6 +927,9 @@ bool mons_class_can_regenerate(int mc) bool mons_can_regenerate(const monsters *mon) { + if (mon->type == MONS_PLAYER_GHOST && mon->ghost->species == SP_DEEP_DWARF) + return (false); + return (mons_class_can_regenerate(mon->type)); } @@ -1648,15 +1651,15 @@ int exper_value(const monsters *monster) } // Let's look at regeneration. - if (monster_descriptor( mclass, MDSC_REGENERATES )) + if (monster_descriptor(mclass, MDSC_REGENERATES)) diff += 15; // Monsters at normal or fast speed with big melee damage. if (speed >= 10) { int max_melee = 0; - for (int i = 0; i < 4; i++) - max_melee += mons_damage( mclass, i ); + for (int i = 0; i < 4; ++i) + max_melee += mons_damage(mclass, i); if (max_melee > 30) diff += (max_melee / ((speed == 10) ? 2 : 1)); -- cgit v1.2.3-54-g00ecf