summaryrefslogtreecommitdiffstats
path: root/crawl-ref
diff options
context:
space:
mode:
authordolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573>2008-03-28 21:54:47 +0000
committerdolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573>2008-03-28 21:54:47 +0000
commit1a7b06f112da2a2846c4124cc5806de2df9db52f (patch)
tree7af0f3af24eb1355c11f9e1626a25420f84c5800 /crawl-ref
parentc2bcb250f260b339f3c9144775675ca81d72b3a6 (diff)
downloadcrawl-ref-1a7b06f112da2a2846c4124cc5806de2df9db52f.tar.gz
crawl-ref-1a7b06f112da2a2846c4124cc5806de2df9db52f.zip
Clean up blessings some more, properly indicating which blessings are
specific to Beogh. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@3919 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref')
-rw-r--r--crawl-ref/source/religion.cc116
1 files changed, 58 insertions, 58 deletions
diff --git a/crawl-ref/source/religion.cc b/crawl-ref/source/religion.cc
index 023d91f144..d08ee595fd 100644
--- a/crawl-ref/source/religion.cc
+++ b/crawl-ref/source/religion.cc
@@ -759,59 +759,6 @@ static void give_nemelex_gift()
}
}
-static bool blessing_reinforcement(void)
-{
- bool success = false;
-
- // Possible reinforcement.
- const monster_type followers[] = {
- MONS_ORC, MONS_ORC_WIZARD, MONS_ORC_PRIEST
- };
-
- int how_many = random2(4) + 1;
-
- for (int i = 0; i < how_many; ++i)
- {
- monster_type follower_type =
- followers[random2(ARRAYSIZE(followers))];
-
- int monster = create_monster(follower_type, 0, BEH_GOD_GIFT,
- you.x_pos, you.y_pos, you.pet_target,
- MONS_PROGRAM_BUG);
- if (monster != -1)
- {
- monsters *mon = &menv[monster];
-
- mon->flags |= MF_ATT_CHANGE_ATTEMPT;
-
- success = true;
- }
- }
-
- return success;
-}
-
-static bool blessing_priesthood(monsters* mon)
-{
- monster_type priest_type = MONS_PROGRAM_BUG;
-
- // Possible promotions.
- if (mon->type == MONS_ORC)
- priest_type = MONS_ORC_PRIEST;
-
- if (priest_type != MONS_PROGRAM_BUG)
- {
- // Turn an ordinary monster into a priestly monster, using a
- // function normally used when going up an experience level.
- // This is a hack, but there seems to be no better way for now.
- mon->upgrade_type(priest_type, true, true);
-
- return true;
- }
-
- return false;
-}
-
static bool blessing_wpn(monsters *mon)
{
// Pick a monster's weapon.
@@ -879,6 +826,59 @@ static bool blessing_healing(monsters *mon, bool extra)
return heal_monster(mon, mon->max_hit_points, extra);
}
+static bool beogh_blessing_reinforcement(void)
+{
+ bool success = false;
+
+ // Possible reinforcement.
+ const monster_type followers[] = {
+ MONS_ORC, MONS_ORC_WIZARD, MONS_ORC_PRIEST
+ };
+
+ int how_many = random2(4) + 1;
+
+ for (int i = 0; i < how_many; ++i)
+ {
+ monster_type follower_type =
+ followers[random2(ARRAYSIZE(followers))];
+
+ int monster = create_monster(follower_type, 0, BEH_GOD_GIFT,
+ you.x_pos, you.y_pos, you.pet_target,
+ MONS_PROGRAM_BUG);
+ if (monster != -1)
+ {
+ monsters *mon = &menv[monster];
+
+ mon->flags |= MF_ATT_CHANGE_ATTEMPT;
+
+ success = true;
+ }
+ }
+
+ return success;
+}
+
+static bool beogh_blessing_priesthood(monsters* mon)
+{
+ monster_type priest_type = MONS_PROGRAM_BUG;
+
+ // Possible promotions.
+ if (mon->type == MONS_ORC)
+ priest_type = MONS_ORC_PRIEST;
+
+ if (priest_type != MONS_PROGRAM_BUG)
+ {
+ // Turn an ordinary monster into a priestly monster, using a
+ // function normally used when going up an experience level.
+ // This is a hack, but there seems to be no better way for now.
+ mon->upgrade_type(priest_type, true, true);
+
+ return true;
+ }
+
+ return false;
+}
+
// Bless a follower within sight of the player.
void bless_follower(god_type god,
bool (*suitable)(const monsters* mon),
@@ -903,13 +903,13 @@ void bless_follower(god_type god,
// get out.
if (monster == NON_MONSTER)
{
- if (chance <= 4)
+ if (god == GOD_BEOGH && chance <= 4)
{
- bool reinforced = blessing_reinforcement();
+ bool reinforced = beogh_blessing_reinforcement();
if (!reinforced || coinflip())
{
- if (blessing_reinforcement())
+ if (beogh_blessing_reinforcement())
reinforced = true;
}
@@ -931,9 +931,9 @@ void bless_follower(god_type god,
: mon->name(DESC_NOCAP_A).c_str();
// Turn a monster into a priestly monster, if possible.
- if (chance == 0)
+ if (god == GOD_BEOGH && chance == 0)
{
- if (blessing_priesthood(mon))
+ if (beogh_blessing_priesthood(mon))
{
result = "priesthood";
goto blessing_done;