summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/mon-util.cc
diff options
context:
space:
mode:
authordolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573>2008-06-23 18:07:07 +0000
committerdolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573>2008-06-23 18:07:07 +0000
commit216ea74607c26d1706b43aa8fccb11e553a962e8 (patch)
tree075936bf53296061a9f5a9bf3e9abd6b69aad461 /crawl-ref/source/mon-util.cc
parentc4f8ee4f6aecbef73857e7fc9e3af5112c07412d (diff)
downloadcrawl-ref-216ea74607c26d1706b43aa8fccb11e553a962e8.tar.gz
crawl-ref-216ea74607c26d1706b43aa8fccb11e553a962e8.zip
Clean up monster pacifying a bit: don't allow it to work for stationary
monsters, or for monsters that aren't holy, natural, undead, or demonic. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@6085 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/mon-util.cc')
-rw-r--r--crawl-ref/source/mon-util.cc41
1 files changed, 17 insertions, 24 deletions
diff --git a/crawl-ref/source/mon-util.cc b/crawl-ref/source/mon-util.cc
index e564c45fc6..3c8140893a 100644
--- a/crawl-ref/source/mon-util.cc
+++ b/crawl-ref/source/mon-util.cc
@@ -374,8 +374,8 @@ static int _scan_mon_inv_randarts( const monsters *mon,
// Twisted Resurrection.
static bool _mons_your_abomination(const monsters *mon)
{
- if ( mon->type != MONS_ABOMINATION_SMALL
- && mon->type != MONS_ABOMINATION_LARGE )
+ if (mon->type != MONS_ABOMINATION_SMALL
+ && mon->type != MONS_ABOMINATION_LARGE)
{
return (false);
}
@@ -401,8 +401,8 @@ mon_holy_type mons_class_holiness(int mc)
bool mons_class_is_confusable(int mc)
{
return (smc->resist_magic < MAG_IMMUNE
- && mons_class_holiness(mc) != MH_PLANT
- && mons_class_holiness(mc) != MH_NONLIVING);
+ && mons_class_holiness(mc) != MH_NONLIVING
+ && mons_class_holiness(mc) != MH_PLANT);
}
bool mons_class_is_slowable(int mc)
@@ -425,13 +425,6 @@ bool mons_is_stationary(const monsters *mon)
return mons_class_is_stationary(mon->type);
}
-// Mimics can teleport, so they're not truly stationary.
-// XXX: There should be a more generic way to check for this!
-bool mons_is_truly_stationary(const monsters *mon)
-{
- return (mons_is_stationary(mon) && !mons_is_mimic(mon->type));
-}
-
bool mons_is_insubstantial(int mc)
{
return mons_class_flag(mc, M_INSUBSTANTIAL);
@@ -571,7 +564,7 @@ bool mons_is_demon(int mc)
// Not every demonic monster is a demon (hell hog, hell hound, etc.)
if (mons_class_holiness(mc) == MH_DEMONIC
- && (isdigit( show_char ) || show_char == '&'))
+ && (isdigit(show_char) || show_char == '&'))
{
return (true);
}
@@ -1005,9 +998,9 @@ int mons_res_elec( const monsters *mon )
return (u);
}
-bool mons_res_asphyx( const monsters *mon )
+bool mons_res_asphyx(const monsters *mon)
{
- const mon_holy_type holiness = mons_holiness( mon );
+ const mon_holy_type holiness = mons_holiness(mon);
return (mons_is_unholy(mon)
|| holiness == MH_NONLIVING
@@ -1180,7 +1173,7 @@ int mons_res_miasma( const monsters *mon )
int mons_res_negative_energy( const monsters *mon )
{
int mc = mon->type;
- const mon_holy_type holiness = mons_holiness( mon );
+ const mon_holy_type holiness = mons_holiness(mon);
if (mons_is_unholy(mon)
|| holiness == MH_NONLIVING
@@ -1223,31 +1216,31 @@ int mons_res_negative_energy( const monsters *mon )
return (u);
} // end mons_res_negative_energy()
-bool mons_is_holy( const monsters *mon )
+bool mons_is_holy(const monsters *mon)
{
- return (mons_holiness( mon ) == MH_HOLY);
+ return (mons_holiness(mon) == MH_HOLY);
}
-bool mons_is_evil( const monsters *mon )
+bool mons_is_evil(const monsters *mon)
{
- return (mons_class_flag( mon->type, M_EVIL ));
+ return (mons_class_flag(mon->type, M_EVIL));
}
-bool mons_is_unholy( const monsters *mon )
+bool mons_is_unholy(const monsters *mon)
{
- const mon_holy_type holiness = mons_holiness( mon );
+ const mon_holy_type holiness = mons_holiness(mon);
return (holiness == MH_UNDEAD || holiness == MH_DEMONIC);
}
-bool mons_is_evil_or_unholy( const monsters *mon )
+bool mons_is_evil_or_unholy(const monsters *mon)
{
return (mons_is_evil(mon) || mons_is_unholy(mon));
}
-bool mons_has_lifeforce( const monsters *mon )
+bool mons_has_lifeforce(const monsters *mon)
{
- const mon_holy_type holiness = mons_holiness( mon );
+ const mon_holy_type holiness = mons_holiness(mon);
return (holiness == MH_NATURAL || holiness == MH_PLANT);
}