From 3797cd88dfd7d37ab3c8f0118f34bb2962c2ae3b Mon Sep 17 00:00:00 2001 From: dolorous Date: Sun, 25 May 2008 19:05:13 +0000 Subject: Rearrange the order of a few functions. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5242 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/religion.cc | 83 ++++++++++++++++++++++---------------------- 1 file changed, 42 insertions(+), 41 deletions(-) (limited to 'crawl-ref/source/religion.cc') diff --git a/crawl-ref/source/religion.cc b/crawl-ref/source/religion.cc index 4b44211074..871dd819a4 100644 --- a/crawl-ref/source/religion.cc +++ b/crawl-ref/source/religion.cc @@ -103,6 +103,7 @@ enum piety_gain_t PIETY_NONE, PIETY_SOME, PIETY_LOTS, NUM_PIETY_GAIN }; + static const char *_Sacrifice_Messages[NUM_GODS][NUM_PIETY_GAIN] = { // No god @@ -380,6 +381,40 @@ static bool _make_god_gifts_hostile(bool level_only = true); static void _print_sacrifice_message(god_type, const item_def &, piety_gain_t, bool = false); +///////////////////////////////////////////////////////////////////// +// god_conduct_trigger + +god_conduct_trigger::god_conduct_trigger( + conduct_type c, int pg, bool kn, const monsters *vict) + : conduct(c), pgain(pg), known(kn), enabled(true), victim(NULL) +{ + if (vict) + { + victim.reset(new monsters); + *(victim.get()) = *vict; + } +} + +void god_conduct_trigger::set(conduct_type c, int pg, bool kn, + const monsters *vict) +{ + conduct = c; + pgain = pg; + known = kn; + victim.reset(NULL); + if (vict) + { + victim.reset(new monsters); + *victim.get() = *vict; + } +} + +god_conduct_trigger::~god_conduct_trigger() +{ + if (enabled && conduct != NUM_CONDUCTS) + did_god_conduct(conduct, pgain, known, victim.get()); +} + bool is_evil_god(god_type god) { return @@ -398,19 +433,19 @@ bool is_good_god(god_type god) god == GOD_ELYVILON; } -bool is_priest_god(god_type god) +bool is_chaotic_god(god_type god) { return - god == GOD_ZIN || - god == GOD_YREDELEMNUL || - god == GOD_BEOGH; + god == GOD_MAKHLEB || + god == GOD_XOM; } -bool is_chaotic_god(god_type god) +bool is_priest_god(god_type god) { return - god == GOD_MAKHLEB || - god == GOD_XOM; + god == GOD_ZIN || + god == GOD_YREDELEMNUL || + god == GOD_BEOGH; } void dec_penance(god_type god, int val) @@ -5411,37 +5446,3 @@ bool tso_unchivalric_attack_safe_monster(const actor *act) const mon_holy_type holiness = act->holiness(); return (holiness != MH_NATURAL && holiness != MH_HOLY); } - -///////////////////////////////////////////////////////////////////// -// god_conduct_trigger - -god_conduct_trigger::god_conduct_trigger( - conduct_type c, int pg, bool kn, const monsters *vict) - : conduct(c), pgain(pg), known(kn), enabled(true), victim(NULL) -{ - if (vict) - { - victim.reset(new monsters); - *(victim.get()) = *vict; - } -} - -void god_conduct_trigger::set(conduct_type c, int pg, bool kn, - const monsters *vict) -{ - conduct = c; - pgain = pg; - known = kn; - victim.reset(NULL); - if (vict) - { - victim.reset(new monsters); - *victim.get() = *vict; - } -} - -god_conduct_trigger::~god_conduct_trigger() -{ - if (enabled && conduct != NUM_CONDUCTS) - did_god_conduct(conduct, pgain, known, victim.get()); -} -- cgit v1.2.3-54-g00ecf