summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--crawl-ref/source/describe.cc4
-rw-r--r--crawl-ref/source/mon-util.cc13
-rw-r--r--crawl-ref/source/mon-util.h2
-rw-r--r--crawl-ref/source/monplace.cc3
4 files changed, 13 insertions, 9 deletions
diff --git a/crawl-ref/source/describe.cc b/crawl-ref/source/describe.cc
index cb8b69786a..96e01a2911 100644
--- a/crawl-ref/source/describe.cc
+++ b/crawl-ref/source/describe.cc
@@ -2683,7 +2683,9 @@ static std::string _monster_stat_description(const monsters& mon)
result << pronoun << " can sense the presence of invisible creatures.$";
// Unusual monster speed.
- const int speed = mons_class_speed(mon.type);
+ const int speed =
+ mons_is_zombified(&mon) ? mons_class_zombie_speed(mon.base_monster)
+ : mons_class_speed(mon.type);
if (speed != 10)
{
result << pronoun << " is ";
diff --git a/crawl-ref/source/mon-util.cc b/crawl-ref/source/mon-util.cc
index 411e34e7cc..51ff20096a 100644
--- a/crawl-ref/source/mon-util.cc
+++ b/crawl-ref/source/mon-util.cc
@@ -1569,13 +1569,16 @@ int exper_value(const monsters *monster)
{
long x_val = 0;
- // These three are the original arguments.
+ // These four are the original arguments.
const int mclass = monster->type;
+ const int zclass = monster->base_monster;
const int mHD = monster->hit_dice;
const int maxhp = monster->max_hit_points;
// These are some values we care about.
- const int speed = mons_speed(monster);
+ const int speed =
+ mons_is_zombified(monster) ? mons_class_zombie_speed(zclass)
+ : mons_class_speed(mclass);
const int modifier = _mons_exp_mod(mclass);
const int item_usage = mons_itemuse(monster);
@@ -2292,9 +2295,9 @@ int mons_class_speed(int mc)
return (smc->speed);
}
-int mons_speed(const monsters *mon)
+int mons_class_zombie_speed(int mc)
{
- return (mon->speed);
+ return (std::max(3, _base_speed(mc) - 2));
}
mon_intel_type mons_class_intel(int mc)
@@ -7469,7 +7472,7 @@ void monsters::fix_speed()
// Check speed and speed_increment sanity.
void monsters::check_speed()
{
- // FIXME: If speed is borked, recalculate. Need to figure out how
+ // FIXME: If speed is borked, recalculate. Need to figure out how
// speed is getting borked.
if (speed < 0 || speed > 130)
{
diff --git a/crawl-ref/source/mon-util.h b/crawl-ref/source/mon-util.h
index 913053930a..8ad2d0da56 100644
--- a/crawl-ref/source/mon-util.h
+++ b/crawl-ref/source/mon-util.h
@@ -625,7 +625,7 @@ int mons_weight(int mc);
* called from: monplace mon-util
* *********************************************************************** */
int mons_class_speed(int mc);
-int mons_speed(const monsters *mon);
+int mons_class_zombie_speed(int mc);
// last updated 12may2000 {dlb}
diff --git a/crawl-ref/source/monplace.cc b/crawl-ref/source/monplace.cc
index bcb58d2134..bdb50f3380 100644
--- a/crawl-ref/source/monplace.cc
+++ b/crawl-ref/source/monplace.cc
@@ -1387,8 +1387,7 @@ static void _define_zombie(int mid, monster_type ztype, monster_type cs,
menv[mid].ev -= 5;
menv[mid].ev = std::max(0, menv[mid].ev);
- menv[mid].speed -= 2;
- menv[mid].speed = std::max(3, menv[mid].speed);
+ menv[mid].speed = mons_class_zombie_speed(menv[mid].base_monster);
// Now override type with the required type.
if (cs == MONS_ZOMBIE_SMALL || cs == MONS_ZOMBIE_LARGE)