summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/mon-ench.cc
diff options
context:
space:
mode:
authorNicholas Feinberg <pleasingfung@gmail.com>2014-07-13 15:38:23 -0700
committerNicholas Feinberg <pleasingfung@gmail.com>2014-07-13 17:19:02 -0700
commitd22ebac678fa1c1d0a60048a72ba445e3ed190d1 (patch)
treea63ccd59b4bb01408be9fc5843c20f2f878e2cd2 /crawl-ref/source/mon-ench.cc
parent5562ea36cc1ba917da155a9dd93e6bf71d022771 (diff)
downloadcrawl-ref-d22ebac678fa1c1d0a60048a72ba445e3ed190d1.tar.gz
crawl-ref-d22ebac678fa1c1d0a60048a72ba445e3ed190d1.zip
Separate 'permanent' and 'temporary' monster hit dice
As part of a wider scheme to make draining temporary.
Diffstat (limited to 'crawl-ref/source/mon-ench.cc')
-rw-r--r--crawl-ref/source/mon-ench.cc9
1 files changed, 5 insertions, 4 deletions
diff --git a/crawl-ref/source/mon-ench.cc b/crawl-ref/source/mon-ench.cc
index 3b854da602..2f3f5d5da8 100644
--- a/crawl-ref/source/mon-ench.cc
+++ b/crawl-ref/source/mon-ench.cc
@@ -198,7 +198,7 @@ void monster::add_enchantment_effect(const mon_enchant &ench, bool quiet)
case ENCH_STONESKIN:
{
// player gets 2+earth/5
- const int ac_bonus = hit_dice / 2;
+ const int ac_bonus = get_hit_dice() / 2;
ac += ac_bonus;
// the monster may get drained or level up, we need to store the bonus
@@ -209,7 +209,7 @@ void monster::add_enchantment_effect(const mon_enchant &ench, bool quiet)
case ENCH_OZOCUBUS_ARMOUR:
{
// player gets 4+ice/3
- const int ac_bonus = 4 + hit_dice / 3;
+ const int ac_bonus = 4 + get_hit_dice() / 3;
ac += ac_bonus;
// the monster may get drained or level up, we need to store the bonus
@@ -1700,7 +1700,8 @@ void monster::apply_enchantment(const mon_enchant &me)
if (!(flags & MF_TAKING_STAIRS)
&& !(paralysed() || petrified() || petrifying() || asleep())
&& (type == MONS_SHAPESHIFTER
- || x_chance_in_y(1000 / (15 * max(1, hit_dice) / 5), 1000)))
+ || x_chance_in_y(1000 / (15 * max(1, get_hit_dice()) / 5),
+ 1000)))
{
monster_polymorph(this, RANDOM_MONSTER);
}
@@ -2191,7 +2192,7 @@ actor* mon_enchant::agent() const
int mon_enchant::modded_speed(const monster* mons, int hdplus) const
{
- return _mod_speed(mons->hit_dice + hdplus, mons->speed);
+ return _mod_speed(mons->get_hit_dice() + hdplus, mons->speed);
}
int mon_enchant::calc_duration(const monster* mons,