summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/monplace.cc
diff options
context:
space:
mode:
authorzelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573>2009-01-05 04:57:15 +0000
committerzelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573>2009-01-05 04:57:15 +0000
commit27bc7176af098086af8922e8a3d97ed9bc7193d0 (patch)
tree994ba1479b288e8386ff5a1917cffd4fa04d830d /crawl-ref/source/monplace.cc
parentdd28fe417e451795644b185c3870da2e410dc88e (diff)
downloadcrawl-ref-27bc7176af098086af8922e8a3d97ed9bc7193d0.tar.gz
crawl-ref-27bc7176af098086af8922e8a3d97ed9bc7193d0.zip
Determine if an orc is an unbeliever when it's generated, and use an orc's god
field to determine whether to use a believer speech or an unbeliever speech. This prevents orc priests from using unbeliever speech, and has the side benefit of preventing other orcs from flip-flopping on whether they believe. If a band leader is a priest then make all band members have the same god (so that Saint Roka won't have any unbelievers among his entourage). git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@8231 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/monplace.cc')
-rw-r--r--crawl-ref/source/monplace.cc14
1 files changed, 14 insertions, 0 deletions
diff --git a/crawl-ref/source/monplace.cc b/crawl-ref/source/monplace.cc
index e3b22e347e..02a943bc1a 100644
--- a/crawl-ref/source/monplace.cc
+++ b/crawl-ref/source/monplace.cc
@@ -929,6 +929,8 @@ int place_monster(mgen_data mg, bool force_pos)
if (band_size > 1)
menv[id].flags |= MF_BAND_MEMBER;
+ const bool priest = mons_class_flag(mon->type, M_PRIEST);
+
mgen_data band_template = mg;
// (5) For each band monster, loop call to place_monster_aux().
for (int i = 1; i < band_size; i++)
@@ -939,7 +941,13 @@ int place_monster(mgen_data mg, bool force_pos)
band_template.cls = band_monsters[i];
const int band_id = _place_monster_aux(band_template, false);
if (band_id != -1 && band_id != NON_MONSTER)
+ {
menv[band_id].flags |= MF_BAND_MEMBER;
+ // Priestly band leaders should have an entourage of the
+ // same religion.
+ if (priest)
+ menv[band_id].god = mon->god;
+ }
}
// Placement of first monster, at least, was a success.
@@ -1043,6 +1051,12 @@ static int _place_monster_aux(const mgen_data &mg,
break;
}
}
+ // 6 out of 7 non-priestly orcs are believers.
+ else if (mons_genus(mg.cls) == MONS_ORC)
+ {
+ if (x_chance_in_y(6, 7))
+ menv[id].god = GOD_BEOGH;
+ }
// Angels and Daevas belong to TSO
else if (mons_class_holiness(mg.cls) == MH_HOLY)
{