summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/religion.cc
diff options
context:
space:
mode:
authordolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573>2008-06-19 02:32:59 +0000
committerdolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573>2008-06-19 02:32:59 +0000
commit6b01578aea5d2f44172181e9aacd65d068e21a58 (patch)
tree9113de232a208eba5b86e82b3874060203ffd118 /crawl-ref/source/religion.cc
parenta0946957cc584681cae95fa525b0a965893b1404 (diff)
downloadcrawl-ref-6b01578aea5d2f44172181e9aacd65d068e21a58.tar.gz
crawl-ref-6b01578aea5d2f44172181e9aacd65d068e21a58.zip
Add various god gift-related cleanups.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5966 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/religion.cc')
-rw-r--r--crawl-ref/source/religion.cc20
1 files changed, 15 insertions, 5 deletions
diff --git a/crawl-ref/source/religion.cc b/crawl-ref/source/religion.cc
index 31094974da..d26828f0f7 100644
--- a/crawl-ref/source/religion.cc
+++ b/crawl-ref/source/religion.cc
@@ -1069,6 +1069,16 @@ static void _give_nemelex_gift()
}
}
+void mons_make_god_gift(monsters *mon, god_type god)
+{
+ mon->god = god;
+}
+
+bool mons_is_god_gift(const monsters *mon, god_type god)
+{
+ return (mon->god == god);
+}
+
bool is_orcish_follower(const monsters* mon)
{
return (mon->alive() && mons_species(mon->type) == MONS_ORC
@@ -1320,7 +1330,7 @@ static bool _tso_blessing_friendliness(monsters* mon)
// become hostile later on, it won't count as a good kill.
mon->flags |= MF_CREATED_FRIENDLY;
- mon->god = GOD_SHINING_ONE;
+ mons_make_god_gift(mon, GOD_SHINING_ONE);
// If the monster is charmed, make it permanently friendly. Note
// that we have to delete the enchantment without removing the
@@ -2150,13 +2160,13 @@ void god_speaks( god_type god, const char *mesg )
bool did_god_conduct(conduct_type thing_done, int level, bool known,
const monsters *victim)
{
+ if (you.religion == GOD_NO_GOD || you.religion == GOD_XOM)
+ return (false);
+
bool ret = false;
int piety_change = 0;
int penance = 0;
- if (you.religion == GOD_NO_GOD || you.religion == GOD_XOM)
- return (false);
-
god_acting gdact;
switch (thing_done)
@@ -4659,7 +4669,7 @@ void beogh_convert_orc(monsters *orc, bool emergency,
// become hostile later on, it won't count as a good kill.
orc->flags |= MF_CREATED_FRIENDLY;
- orc->god = GOD_BEOGH;
+ mons_make_god_gift(orc, GOD_BEOGH);
if (orc->is_patrolling())
{