From 6b01578aea5d2f44172181e9aacd65d068e21a58 Mon Sep 17 00:00:00 2001 From: dolorous Date: Thu, 19 Jun 2008 02:32:59 +0000 Subject: 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 --- crawl-ref/source/religion.cc | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) (limited to 'crawl-ref/source/religion.cc') 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()) { -- cgit v1.2.3-54-g00ecf