summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/fight.cc
diff options
context:
space:
mode:
authorVsevolod Kozlov <zaba@thorium.homeunix.org>2009-11-06 19:46:32 +0300
committerRobert Vollmert <rvollmert@gmx.net>2009-11-06 19:52:58 +0100
commitb4b8747ec41b3fa6543d7c51e02515b0cec1496f (patch)
treeefb1625c80d595b58b8bde933decd1dfc674ee04 /crawl-ref/source/fight.cc
parent22adbee6a63d3fb1ee05d0e6ff41e80e95b4afc7 (diff)
downloadcrawl-ref-b4b8747ec41b3fa6543d7c51e02515b0cec1496f.tar.gz
crawl-ref-b4b8747ec41b3fa6543d7c51e02515b0cec1496f.zip
Move mons_is_friendly to monsters::friendly.
Signed-off-by: Robert Vollmert <rvollmert@gmx.net>
Diffstat (limited to 'crawl-ref/source/fight.cc')
-rw-r--r--crawl-ref/source/fight.cc16
1 files changed, 8 insertions, 8 deletions
diff --git a/crawl-ref/source/fight.cc b/crawl-ref/source/fight.cc
index 524aabadd7..6f44616de8 100644
--- a/crawl-ref/source/fight.cc
+++ b/crawl-ref/source/fight.cc
@@ -696,7 +696,7 @@ bool melee_attack::attack()
if (is_sanctuary(attacker->pos()) || is_sanctuary(defender->pos()))
{
if (attacker->atype() == ACT_PLAYER
- || mons_friendly(attacker_as_monster()))
+ || attacker_as_monster()->friendly())
{
remove_sanctuary(true);
}
@@ -2450,7 +2450,7 @@ void melee_attack::chaos_affects_defender()
clone.mark_summoned(6, true, MON_SUMM_CLONE);
// Monsters being cloned is interesting.
- xom_is_stimulated(mons_friendly(&clone) ? 16 : 32);
+ xom_is_stimulated(clone.friendly() ? 16 : 32);
}
break;
}
@@ -2481,7 +2481,7 @@ void melee_attack::chaos_affects_defender()
monster_polymorph(defender_as_monster(), RANDOM_MONSTER);
// Xom loves it if this happens!
- const int friend_factor = mons_friendly(defender_as_monster()) ? 1 : 2;
+ const int friend_factor = defender_as_monster()->friendly() ? 1 : 2;
const int glow_factor =
(defender_as_monster()->has_ench(ENCH_SHAPESHIFTER) ? 1 : 2);
xom_is_stimulated( 64 * friend_factor * glow_factor );
@@ -2565,7 +2565,7 @@ void melee_attack::chaos_affects_defender()
: attacker_as_monster()->confused_by_you() ? KILL_YOU_CONF
: KILL_MON;
- if (beam.thrower == KILL_YOU || mons_friendly(attacker_as_monster()))
+ if (beam.thrower == KILL_YOU || attacker_as_monster()->friendly())
beam.attitude = ATT_FRIENDLY;
beam.beam_source = attacker->mindex();
@@ -4090,7 +4090,7 @@ bool melee_attack::mons_attack_mons()
{
// Friendly monsters should only violate sanctuary if explicitly
// ordered to do so by the player.
- if (mons_friendly(attacker_as_monster()))
+ if (attacker_as_monster()->friendly())
{
if (you.pet_target == MHITYOU || you.pet_target == MHITNOT)
{
@@ -4140,7 +4140,7 @@ bool melee_attack::mons_attack_mons()
// already, but not if sanctuary is in effect (pet target must be
// set explicitly by the player during sanctuary).
if (perceived_attack && attacker->alive()
- && mons_friendly(defender_as_monster())
+ && defender_as_monster()->friendly()
&& !crawl_state.arena
&& !mons_wont_attack(attacker_as_monster())
&& you.pet_target == MHITNOT
@@ -4541,7 +4541,7 @@ void melee_attack::mons_do_napalm()
else
{
napalm_monster(defender_as_monster(),
- mons_friendly(attacker_as_monster()) ?
+ attacker_as_monster()->friendly() ?
KC_FRIENDLY : KC_OTHER,
std::min(4, 1 + random2(attacker->get_experience_level())/2));
}
@@ -5049,7 +5049,7 @@ void melee_attack::mons_perform_attack_rounds()
bool end = true;
for (adjacent_iterator i(attacker->pos()); i; ++i)
{
- if (*i == you.pos() && !mons_friendly(attacker_as_monster()))
+ if (*i == you.pos() && !attacker_as_monster()->friendly())
{
attacker_as_monster()->foe = MHITYOU;
attacker_as_monster()->target = you.pos();