summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source
diff options
context:
space:
mode:
authorVsevolod Kozlov <zaba@thorium.homeunix.org>2009-11-07 13:05:43 +0300
committerJude Brown <bookofjude@users.sourceforge.net>2009-11-07 20:09:50 +1000
commit7a869a2b8fa07f329376019d4846455ba7580939 (patch)
treeaf5b61881ef3c7fd37076aeeea8b05e9e49a18db /crawl-ref/source
parentcef3b8421938589dc991e0976123fc6bd437146b (diff)
downloadcrawl-ref-7a869a2b8fa07f329376019d4846455ba7580939.tar.gz
crawl-ref-7a869a2b8fa07f329376019d4846455ba7580939.zip
Replace mons_strict_neutral with monsters::strict_neutral.
Signed-off-by: Jude Brown <bookofjude@users.sourceforge.net>
Diffstat (limited to 'crawl-ref/source')
-rw-r--r--crawl-ref/source/mon-behv.cc2
-rw-r--r--crawl-ref/source/mon-util.cc9
-rw-r--r--crawl-ref/source/mon-util.h1
-rw-r--r--crawl-ref/source/monster.cc5
-rw-r--r--crawl-ref/source/monster.h1
-rw-r--r--crawl-ref/source/monstuff.h4
6 files changed, 11 insertions, 11 deletions
diff --git a/crawl-ref/source/mon-behv.cc b/crawl-ref/source/mon-behv.cc
index a5822cc401..671c8eec1e 100644
--- a/crawl-ref/source/mon-behv.cc
+++ b/crawl-ref/source/mon-behv.cc
@@ -1471,7 +1471,7 @@ void handle_behaviour(monsters *mon)
return;
}
- if (mons_strict_neutral(mon) && mons_is_slime(mon)
+ if (mon->strict_neutral() && mons_is_slime(mon)
&& you.religion == GOD_JIYVA)
{
_set_random_slime_target(mon);
diff --git a/crawl-ref/source/mon-util.cc b/crawl-ref/source/mon-util.cc
index 1baade33c6..8c5dcf5423 100644
--- a/crawl-ref/source/mon-util.cc
+++ b/crawl-ref/source/mon-util.cc
@@ -1974,11 +1974,6 @@ int mons_base_damage_brand(const monsters *m)
return (SPWPN_NORMAL);
}
-bool mons_strict_neutral(const monsters *m)
-{
- return (m->attitude == ATT_STRICT_NEUTRAL);
-}
-
bool mons_is_pacified(const monsters *m)
{
return (m->attitude == ATT_NEUTRAL && testbits(m->flags, MF_GOT_HALF_XP));
@@ -1986,7 +1981,7 @@ bool mons_is_pacified(const monsters *m)
bool mons_wont_attack(const monsters *m)
{
- return (m->friendly() || m->good_neutral() || mons_strict_neutral(m));
+ return (m->friendly() || m->good_neutral() || m->strict_neutral());
}
bool mons_att_wont_attack(mon_attitude_type fr)
@@ -2000,7 +1995,7 @@ mon_attitude_type mons_attitude(const monsters *m)
return ATT_FRIENDLY;
else if (m->good_neutral())
return ATT_GOOD_NEUTRAL;
- else if (mons_strict_neutral(m))
+ else if (m->strict_neutral())
return ATT_STRICT_NEUTRAL;
else if (m->neutral())
return ATT_NEUTRAL;
diff --git a/crawl-ref/source/mon-util.h b/crawl-ref/source/mon-util.h
index ef6d9aec1d..640d89ddc7 100644
--- a/crawl-ref/source/mon-util.h
+++ b/crawl-ref/source/mon-util.h
@@ -608,7 +608,6 @@ const char *mons_pronoun(monster_type mon_type, pronoun_type variant,
bool mons_aligned(int m1, int m2);
bool mons_atts_aligned(mon_attitude_type fr1, mon_attitude_type fr2);
-bool mons_strict_neutral(const monsters *m);
bool mons_is_pacified(const monsters *m);
bool mons_wont_attack(const monsters *m);
bool mons_att_wont_attack(mon_attitude_type fr);
diff --git a/crawl-ref/source/monster.cc b/crawl-ref/source/monster.cc
index 2178e35576..dda40f100a 100644
--- a/crawl-ref/source/monster.cc
+++ b/crawl-ref/source/monster.cc
@@ -2844,6 +2844,11 @@ bool monsters::good_neutral() const
return (attitude == ATT_GOOD_NEUTRAL);
}
+bool monsters::strict_neutral() const
+{
+ return (attitude == ATT_STRICT_NEUTRAL);
+}
+
int monsters::shield_bonus() const
{
const item_def *shld = const_cast<monsters*>(this)->shield();
diff --git a/crawl-ref/source/monster.h b/crawl-ref/source/monster.h
index ced398812b..16bdfe7afe 100644
--- a/crawl-ref/source/monster.h
+++ b/crawl-ref/source/monster.h
@@ -336,6 +336,7 @@ public:
bool friendly() const;
bool neutral() const;
bool good_neutral() const;
+ bool strict_neutral() const;
bool has_spells() const;
bool has_spell(spell_type spell) const;
diff --git a/crawl-ref/source/monstuff.h b/crawl-ref/source/monstuff.h
index 81fe96e6e3..2457ba9b5e 100644
--- a/crawl-ref/source/monstuff.h
+++ b/crawl-ref/source/monstuff.h
@@ -50,9 +50,9 @@ public:
#define SAME_ATTITUDE(x) (x->friendly() ? BEH_FRIENDLY : \
x->good_neutral() ? BEH_GOOD_NEUTRAL : \
- mons_strict_neutral(x) ? BEH_STRICT_NEUTRAL : \
+ x->strict_neutral() ? BEH_STRICT_NEUTRAL : \
x->neutral() ? BEH_NEUTRAL \
- : BEH_HOSTILE)
+ : BEH_HOSTILE)
#define MONST_INTERESTING(x) (x->flags & MF_INTERESTING)