summaryrefslogtreecommitdiffstats
path: root/crawl-ref
diff options
context:
space:
mode:
authordolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573>2009-04-18 17:14:21 +0000
committerdolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573>2009-04-18 17:14:21 +0000
commit568b2909750fda3861179187d6ce52bb48f05e6f (patch)
tree438f01183a156278dd826eecd1a07258487e0993 /crawl-ref
parent3275e9d0f89f2860f5e9dfd3ca2bf20e2d89d91a (diff)
downloadcrawl-ref-568b2909750fda3861179187d6ce52bb48f05e6f.tar.gz
crawl-ref-568b2909750fda3861179187d6ce52bb48f05e6f.zip
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
Diffstat (limited to 'crawl-ref')
-rw-r--r--crawl-ref/source/effects.cc27
-rw-r--r--crawl-ref/source/mon-util.cc9
2 files changed, 21 insertions, 15 deletions
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));