summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source
diff options
context:
space:
mode:
authordolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573>2008-06-14 18:45:23 +0000
committerdolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573>2008-06-14 18:45:23 +0000
commitdac70786ba4b5bb25196a32b8973e359f2c96e3a (patch)
treeeab2776236849bddcb90c1cfb6c825d832763818 /crawl-ref/source
parent43a8fc267d6386d366c600b24e30ec6937aa0b0b (diff)
downloadcrawl-ref-dac70786ba4b5bb25196a32b8973e359f2c96e3a.tar.gz
crawl-ref-dac70786ba4b5bb25196a32b8973e359f2c96e3a.zip
Consolidate the checks for gods that give you permanent followers into a
function, and have it take the other good gods into account, since, if you switch from TSO to another good god, you keep all your non-daeva permanent followers. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5821 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source')
-rw-r--r--crawl-ref/source/acr.cc4
-rw-r--r--crawl-ref/source/misc.cc2
-rw-r--r--crawl-ref/source/monstuff.cc2
-rw-r--r--crawl-ref/source/religion.cc21
-rw-r--r--crawl-ref/source/religion.h1
5 files changed, 20 insertions, 10 deletions
diff --git a/crawl-ref/source/acr.cc b/crawl-ref/source/acr.cc
index d7384a03d0..3609636e6a 100644
--- a/crawl-ref/source/acr.cc
+++ b/crawl-ref/source/acr.cc
@@ -1952,7 +1952,7 @@ void process_command( command_type cmd )
case CMD_TOGGLE_FRIENDLY_PICKUP:
{
- if (you.religion != GOD_SHINING_ONE && you.religion != GOD_BEOGH)
+ if (!god_gives_permanent_followers(you.religion))
{
mpr("I'm sorry, your allies won't ever be able to pick up items.");
if (Options.tutorial_left)
@@ -4061,7 +4061,7 @@ static bool _initialise(void)
if (newc) // start a new game
{
you.friendly_pickup = FRIENDLY_PICKUP_NONE;
- if (you.religion == GOD_BEOGH || you.religion == GOD_SHINING_ONE)
+ if (god_gives_permanent_followers(you.religion))
you.friendly_pickup = Options.default_friendly_pickup;
// Mark items in inventory as of unknown origin.
diff --git a/crawl-ref/source/misc.cc b/crawl-ref/source/misc.cc
index f77d6cb54f..59f4ef04d8 100644
--- a/crawl-ref/source/misc.cc
+++ b/crawl-ref/source/misc.cc
@@ -2057,7 +2057,7 @@ void down_stairs( int old_level, dungeon_feature_type force_stair,
if (newlevel)
{
// When entering a new level, reset friendly_pickup to default.
- if (you.religion == GOD_BEOGH || you.religion == GOD_SHINING_ONE)
+ if (god_gives_permanent_followers(you.religion))
you.friendly_pickup = Options.default_friendly_pickup;
switch(you.level_type)
diff --git a/crawl-ref/source/monstuff.cc b/crawl-ref/source/monstuff.cc
index eee3987af6..c1ea5caf8c 100644
--- a/crawl-ref/source/monstuff.cc
+++ b/crawl-ref/source/monstuff.cc
@@ -409,7 +409,7 @@ static void _give_monster_experience( monsters *victim,
{
if (mon->gain_exp(experience))
{
- if (you.religion != GOD_SHINING_ONE && you.religion != GOD_BEOGH
+ if (!god_gives_permanent_followers(you.religion)
|| player_under_penance()
|| one_chance_in(3))
{
diff --git a/crawl-ref/source/religion.cc b/crawl-ref/source/religion.cc
index 4e230c8583..02cbf409ad 100644
--- a/crawl-ref/source/religion.cc
+++ b/crawl-ref/source/religion.cc
@@ -453,6 +453,15 @@ bool is_priest_god(god_type god)
|| god == GOD_BEOGH);
}
+bool god_gives_permanent_followers(god_type god)
+{
+ // Only TSO and Beogh do this, but if you switch from TSO to another
+ // good god, you keep your (non-daeva) permanent followers, so count
+ // the other good gods here as well.
+ return (is_good_god(god)
+ || god == GOD_BEOGH);
+}
+
void dec_penance(god_type god, int val)
{
if (you.penance[god] > 0)
@@ -5191,17 +5200,17 @@ void god_pitch(god_type which_god)
you.gift_timeout = 0;
}
- if (you.religion == GOD_BEOGH || you.religion == GOD_SHINING_ONE)
+ if (god_gives_permanent_followers(you.religion))
{
- // With these two, you can get permanent followers, so enable
- // ally pickup control.
+ // Enable ally pickup control for gods that give you permanent
+ // followers.
you.friendly_pickup = Options.default_friendly_pickup;
}
else
{
- // With other gods you can only get stupid (zombies!), summoned
- // or charmed allies, so pickup control makes no sense.
- // Sorry about that!
+ // With other gods, you can only get stupid (zombies!),
+ // summoned, or charmed allies, so pickup control makes no
+ // sense. Sorry about that!
you.friendly_pickup = FRIENDLY_PICKUP_NONE;
}
diff --git a/crawl-ref/source/religion.h b/crawl-ref/source/religion.h
index 6330f1f161..63aec2b5c9 100644
--- a/crawl-ref/source/religion.h
+++ b/crawl-ref/source/religion.h
@@ -56,6 +56,7 @@ bool is_good_god(god_type god);
bool is_chaotic_god(god_type god);
bool is_lawful_god(god_type god);
bool is_priest_god(god_type god);
+bool god_gives_permanent_followers(god_type god);
void simple_god_message(const char *event, god_type which_deity = you.religion);
int piety_breakpoint(int i);
std::string god_name(god_type which_god, bool long_name = false);