summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--crawl-ref/source/religion.cc83
-rw-r--r--crawl-ref/source/religion.h51
2 files changed, 67 insertions, 67 deletions
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());
-}
diff --git a/crawl-ref/source/religion.h b/crawl-ref/source/religion.h
index 1ca01f75f1..9d3f4d3486 100644
--- a/crawl-ref/source/religion.h
+++ b/crawl-ref/source/religion.h
@@ -29,6 +29,31 @@ enum harm_protection_type
NUM_HPTS
};
+// Calls did_god_conduct() when the object goes out of scope.
+struct god_conduct_trigger
+{
+ conduct_type conduct;
+ int pgain;
+ bool known;
+ bool enabled;
+ std::auto_ptr<monsters> victim;
+
+ god_conduct_trigger(conduct_type c = NUM_CONDUCTS,
+ int pg = 0,
+ bool kn = true,
+ const monsters *vict = NULL);
+
+ void set(conduct_type c = NUM_CONDUCTS,
+ int pg = 0,
+ bool kn = true,
+ const monsters *vict = NULL);
+
+ ~god_conduct_trigger();
+};
+
+bool is_evil_god(god_type god);
+bool is_good_god(god_type god);
+bool is_chaotic_god(god_type god);
bool is_priest_god(god_type god);
void simple_god_message( const char *event, god_type which_deity = GOD_NO_GOD );
int piety_breakpoint(int i);
@@ -83,30 +108,4 @@ bool bless_follower(monsters *follower = NULL,
bool god_hates_attacking_friend(god_type god, const actor *fr);
-bool is_evil_god(god_type god);
-bool is_good_god(god_type god);
-bool is_chaotic_god(god_type god);
-
-// Calls did_god_conduct when the object goes out of scope.
-struct god_conduct_trigger
-{
- conduct_type conduct;
- int pgain;
- bool known;
- bool enabled;
- std::auto_ptr<monsters> victim;
-
- god_conduct_trigger(conduct_type c = NUM_CONDUCTS,
- int pg = 0,
- bool kn = true,
- const monsters *vict = NULL);
-
- void set(conduct_type c = NUM_CONDUCTS,
- int pg = 0,
- bool kn = true,
- const monsters *vict = NULL);
-
- ~god_conduct_trigger();
-};
-
#endif