summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/mon-util.cc
diff options
context:
space:
mode:
authordolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573>2009-03-09 07:31:05 +0000
committerdolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573>2009-03-09 07:31:05 +0000
commitb58a21bf335b11358befdec0a035da2706f8f9ae (patch)
tree183abf00e925c2c61584d70aeccb7be6f9dc39d4 /crawl-ref/source/mon-util.cc
parente0a29b1ce8b7f311412a0f5ee669f4ad036bf7c1 (diff)
downloadcrawl-ref-b58a21bf335b11358befdec0a035da2706f8f9ae.tar.gz
crawl-ref-b58a21bf335b11358befdec0a035da2706f8f9ae.zip
Add a few last monster speed cleanups.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@9388 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/mon-util.cc')
-rw-r--r--crawl-ref/source/mon-util.cc13
1 files changed, 8 insertions, 5 deletions
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)
{