summaryrefslogtreecommitdiffstats
path: root/trunk/source/mon-util.cc
diff options
context:
space:
mode:
authordshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573>2006-08-02 12:54:15 +0000
committerdshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573>2006-08-02 12:54:15 +0000
commitd5e5340c3926d1cf97f6cba151ffaecb20bfb35f (patch)
treed1faf7d5b27df8f3c523a8dd33357804118e62b1 /trunk/source/mon-util.cc
parent7b2204d69f21d7075e4666ee032d7a129081bc4b (diff)
downloadcrawl-ref-d5e5340c3926d1cf97f6cba151ffaecb20bfb35f.tar.gz
crawl-ref-d5e5340c3926d1cf97f6cba151ffaecb20bfb35f.zip
Integrated travel patch as of 20060727
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@7 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'trunk/source/mon-util.cc')
-rw-r--r--trunk/source/mon-util.cc21
1 files changed, 21 insertions, 0 deletions
diff --git a/trunk/source/mon-util.cc b/trunk/source/mon-util.cc
index a94133f18e..4df429aab7 100644
--- a/trunk/source/mon-util.cc
+++ b/trunk/source/mon-util.cc
@@ -1297,6 +1297,27 @@ bool mons_friendly(struct monsters *m)
return (m->attitude == ATT_FRIENDLY || mons_has_ench(m, ENCH_CHARM));
}
+bool mons_is_stabbable(struct monsters *m)
+{
+ // Make sure oklob plants are never highlighted. That'll defeat the
+ // point of making them look like normal plants.
+ return (!mons_flag(m->type, M_NO_EXP_GAIN)
+ && m->type != MONS_OKLOB_PLANT
+ && !mons_friendly(m)
+ && m->behaviour == BEH_SLEEP);
+}
+
+bool mons_maybe_stabbable(struct monsters *m)
+{
+ return (!mons_flag(m->type, M_NO_EXP_GAIN)
+ && m->type != MONS_OKLOB_PLANT
+ && !mons_friendly(m)
+ && ((m->foe != MHITYOU && !testbits(m->flags, MF_BATTY))
+ || (mons_has_ench(m, ENCH_CONFUSION) &&
+ !mons_flag(m->type, M_CONFUSED))
+ || m->behaviour == BEH_FLEE));
+}
+
/* ******************************************************************
// In the name of England, I declare this function wasteful! {dlb}