summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/mon-util.cc
diff options
context:
space:
mode:
authorj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2009-04-03 17:06:22 +0000
committerj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2009-04-03 17:06:22 +0000
commit2d1dc73ba81562198242670c328146d3f13695c6 (patch)
tree6526769c27f00c87d81ac2dd552c9e0bd1f7b7c0 /crawl-ref/source/mon-util.cc
parent20e25439cad6e0c97716e197bb2dceae731a9d24 (diff)
downloadcrawl-ref-2d1dc73ba81562198242670c328146d3f13695c6.tar.gz
crawl-ref-2d1dc73ba81562198242670c328146d3f13695c6.zip
* Allow fleeing monster to push past higher ranked monsters of the same
type. * Allow quivering of wielded missiles (stones for Sandblast etc.) and wielded weapons of returning if your throwing skill is > 0. * Add stairs/gates/shops to the 'V' command, mostly for the convenience of the easy travel feature. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@9574 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/mon-util.cc')
-rw-r--r--crawl-ref/source/mon-util.cc25
1 files changed, 14 insertions, 11 deletions
diff --git a/crawl-ref/source/mon-util.cc b/crawl-ref/source/mon-util.cc
index 1bd90804d2..982c671771 100644
--- a/crawl-ref/source/mon-util.cc
+++ b/crawl-ref/source/mon-util.cc
@@ -3393,7 +3393,7 @@ bool monster_shover(const monsters *m)
// Returns true if m1 and m2 are related, and m1 is higher up the totem pole
// than m2. The criteria for being related are somewhat loose, as you can see
// below.
-bool monster_senior(const monsters *m1, const monsters *m2)
+bool monster_senior(const monsters *m1, const monsters *m2, bool fleeing)
{
const monsterentry *me1 = get_monster_data(m1->type),
*me2 = get_monster_data(m2->type);
@@ -3406,12 +3406,12 @@ bool monster_senior(const monsters *m1, const monsters *m2)
// If both are demons, the smaller number is the nastier demon.
if (isdigit(mchar1) && isdigit(mchar2))
- return (mchar1 < mchar2);
+ return (fleeing || mchar1 < mchar2);
// &s are the evillest demons of all, well apart from Geryon, who really
// profits from *not* pushing past beasts.
if (mchar1 == '&' && isdigit(mchar2) && m1->type != MONS_GERYON)
- return (m1->hit_dice > m2->hit_dice);
+ return (fleeing || m1->hit_dice > m2->hit_dice);
// If they're the same holiness, monsters smart enough to use stairs can
// push past monsters too stupid to use stairs (so that e.g. non-zombified
@@ -3422,21 +3422,24 @@ bool monster_senior(const monsters *m1, const monsters *m2)
return (true);
}
- if (m1->type == MONS_QUEEN_BEE
- && (m2->type == MONS_KILLER_BEE
- || m2->type == MONS_KILLER_BEE_LARVA))
+ if (mons_genus(m1->type) == MONS_KILLER_BEE
+ && mons_genus(m2->type) == MONS_KILLER_BEE)
{
- return (true);
- }
+ if (fleeing)
+ return (true);
- if (m1->type == MONS_KILLER_BEE && m2->type == MONS_KILLER_BEE_LARVA)
- return (true);
+ if (m1->type == MONS_QUEEN_BEE && m2->type != MONS_QUEEN_BEE)
+ return (true);
+
+ if (m1->type == MONS_KILLER_BEE && m2->type == MONS_KILLER_BEE_LARVA)
+ return (true);
+ }
// Special-case gnolls, so they can't get past (hob)goblins.
if (m1->type == MONS_GNOLL && m2->type != MONS_GNOLL)
return (false);
- return (mchar1 == mchar2 && m1->hit_dice > m2->hit_dice);
+ return (mchar1 == mchar2 && (fleeing || m1->hit_dice > m2->hit_dice));
}