summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source
diff options
context:
space:
mode:
authordolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573>2008-03-19 02:35:59 +0000
committerdolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573>2008-03-19 02:35:59 +0000
commit383888c981a9c53edcce082a1d2ab53dc69659cb (patch)
tree2b294c4649392d2b8471a65bbce89567ffaaf136 /crawl-ref/source
parent4a6720babaa50b72d8ed6ca575c1219b3ebe09bd (diff)
downloadcrawl-ref-383888c981a9c53edcce082a1d2ab53dc69659cb.tar.gz
crawl-ref-383888c981a9c53edcce082a1d2ab53dc69659cb.zip
Add a few last Beogh-related cleanups. As part of this, move the check
for an orcish follower into its own function, so that it can eventually be used for blessing followers. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@3715 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source')
-rw-r--r--crawl-ref/source/beam.cc10
-rw-r--r--crawl-ref/source/monstuff.cc5
-rw-r--r--crawl-ref/source/religion.cc13
-rw-r--r--crawl-ref/source/religion.h2
-rw-r--r--crawl-ref/source/view.cc6
5 files changed, 18 insertions, 18 deletions
diff --git a/crawl-ref/source/beam.cc b/crawl-ref/source/beam.cc
index f93d3d8016..be7e5602c4 100644
--- a/crawl-ref/source/beam.cc
+++ b/crawl-ref/source/beam.cc
@@ -3779,8 +3779,8 @@ static int affect_monster(bolt &beam, monsters *mon)
did_god_conduct( DID_ATTACK_HOLY, mon->hit_dice, true, mon );
if (you.religion == GOD_BEOGH && mons_species(mon->type) == MONS_ORC
- && mon->behaviour == BEH_SLEEP && you.species == SP_HILL_ORC
- && !player_under_penance() && you.piety >= piety_breakpoint(2))
+ && mon->behaviour == BEH_SLEEP && !player_under_penance()
+ && you.piety >= piety_breakpoint(2) && mons_near(mon))
{
hit_woke_orc = true;
}
@@ -3949,9 +3949,9 @@ static int affect_monster(bolt &beam, monsters *mon)
}
if (you.religion == GOD_BEOGH && mons_species(mon->type) == MONS_ORC
- && mon->behaviour == BEH_SLEEP && you.species == SP_HILL_ORC
- && YOU_KILL(beam.thrower) && !player_under_penance()
- && you.piety >= piety_breakpoint(2))
+ && mon->behaviour == BEH_SLEEP && YOU_KILL(beam.thrower)
+ && !player_under_penance() && you.piety >= piety_breakpoint(2)
+ && mons_near(mon))
{
hit_woke_orc = true;
}
diff --git a/crawl-ref/source/monstuff.cc b/crawl-ref/source/monstuff.cc
index 493aeaa324..dd5cda81c7 100644
--- a/crawl-ref/source/monstuff.cc
+++ b/crawl-ref/source/monstuff.cc
@@ -482,11 +482,8 @@ static bool monster_avoided_death(monsters *monster, killer_type killer, int i)
else if (MON_KILL(killer))
{
monsters *mon = &menv[i];
- if (mons_species(mon->type) == MONS_ORC && mons_friendly(mon)
- && !one_chance_in(3))
- {
+ if (is_orcish_follower(mon) && !one_chance_in(3))
convert = true;
- }
}
}
diff --git a/crawl-ref/source/religion.cc b/crawl-ref/source/religion.cc
index 6514b62404..aa775b90cf 100644
--- a/crawl-ref/source/religion.cc
+++ b/crawl-ref/source/religion.cc
@@ -3040,9 +3040,7 @@ static bool orcish_followers_on_level_abandon_you()
for ( int i = 0; i < MAX_MONSTERS; ++i )
{
monsters *monster = &menv[i];
- if (monster->type != -1
- && mons_species(monster->type) == MONS_ORC
- && monster->attitude == ATT_FRIENDLY)
+ if (monster->type != -1 && is_orcish_follower(monster))
{
#ifdef DEBUG_DIAGNOSTICS
mprf(MSGCH_DIAGNOSTICS, "Abandoning: %s on level %d, branch %d",
@@ -3094,8 +3092,7 @@ static bool beogh_followers_abandon_you()
if ( targ_monst != NON_MONSTER )
{
monsters *monster = &menv[targ_monst];
- if (mons_species(monster->type) == MONS_ORC
- && monster->attitude == ATT_FRIENDLY)
+ if (is_orcish_follower(monster))
{
num_followers++;
@@ -3375,6 +3372,12 @@ void beogh_convert_orc(monsters *orc, bool emergency)
behaviour_event(orc, ME_ALERT, MHITNOT);
}
+bool is_orcish_follower(const monsters* mon)
+{
+ return (mons_species(mon->type) == MONS_ORC
+ && mon->attitude == ATT_FRIENDLY);
+}
+
void excommunication(god_type new_god)
{
const god_type old_god = you.religion;
diff --git a/crawl-ref/source/religion.h b/crawl-ref/source/religion.h
index 3444cb6446..eec54c139d 100644
--- a/crawl-ref/source/religion.h
+++ b/crawl-ref/source/religion.h
@@ -70,6 +70,8 @@ bool ely_destroy_weapons();
bool trog_burn_books();
bool tso_stab_safe_monster(const actor *act);
+bool is_orcish_follower(const monsters* mon);
+
bool god_hates_attacking_friend(god_type god, const actor *fr);
bool is_evil_god(god_type god);
diff --git a/crawl-ref/source/view.cc b/crawl-ref/source/view.cc
index 7604fcafce..4a3c4bfc38 100644
--- a/crawl-ref/source/view.cc
+++ b/crawl-ref/source/view.cc
@@ -840,11 +840,9 @@ void beogh_follower_convert(monsters *monster, bool orc_hit)
stop_running();
}
}
- else if (is_orc
- && !(you.religion == GOD_BEOGH)
- && monster->attitude == ATT_FRIENDLY
+ else if (you.religion != GOD_BEOGH
+ && is_orcish_follower(monster)
&& (monster->flags & MF_ATT_CHANGE_ATTEMPT)
- && (monster->flags & MF_GOD_GIFT)
&& mons_player_visible(monster) && !mons_is_sleeping(monster)
&& !mons_is_confused(monster) && !mons_is_paralysed(monster))
{ // reconversion if no longer Beogh