summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--crawl-ref/source/monstuff.cc22
-rw-r--r--crawl-ref/source/religion.cc6
-rw-r--r--crawl-ref/source/religion.h2
3 files changed, 21 insertions, 9 deletions
diff --git a/crawl-ref/source/monstuff.cc b/crawl-ref/source/monstuff.cc
index 7a6dd3ea75..d19d84e943 100644
--- a/crawl-ref/source/monstuff.cc
+++ b/crawl-ref/source/monstuff.cc
@@ -858,6 +858,14 @@ void monster_die(monsters *monster, killer_type killer, int i, bool silent)
&& (!player_under_penance() &&
random2(you.piety) >= piety_breakpoint(0))))
{
+ // For TSO, give health from killing evil, or randomly
+ // bless a follower.
+ if (you.religion == GOD_SHINING_ONE && one_chance_in(3)
+ && bless_follower())
+ {
+ break;
+ }
+
if (you.hp < you.hp_max)
{
mpr("You feel a little better.");
@@ -1000,8 +1008,6 @@ void monster_die(monsters *monster, killer_type killer, int i, bool silent)
}
}
- // Give a follower power from killing evil, or randomly
- // bless it.
if (you.religion == GOD_SHINING_ONE
&& mons_is_evil_or_unholy(monster)
&& (!player_under_penance()
@@ -1009,15 +1015,18 @@ void monster_die(monsters *monster, killer_type killer, int i, bool silent)
&& !invalid_monster_index(i))
{
monsters *mon = &menv[i];
- if (mon->alive() && mon->hit_points < mon->max_hit_points
- && !one_chance_in(3))
+
+ // Give a follower health from killing evil, or
+ // randomly bless it.
+ if (one_chance_in(3) && bless_follower())
+ break;
+
+ if (mon->alive() && mon->hit_points < mon->max_hit_points)
{
simple_monster_message(mon, " looks invigorated.");
heal_monster( mon, 1 + random2(monster->hit_dice / 4),
false );
}
- else
- bless_follower(mon);
}
// Randomly bless the follower who killed.
@@ -1029,6 +1038,7 @@ void monster_die(monsters *monster, killer_type killer, int i, bool silent)
&& !invalid_monster_index(i))
{
monsters *mon = &menv[i];
+
bless_follower(mon);
}
diff --git a/crawl-ref/source/religion.cc b/crawl-ref/source/religion.cc
index 94c7160d61..82c9c00e4a 100644
--- a/crawl-ref/source/religion.cc
+++ b/crawl-ref/source/religion.cc
@@ -979,7 +979,7 @@ static bool beogh_blessing_priesthood(monsters* mon)
// Bless the follower indicated in follower, if any. If there isn't
// one, bless a random follower within sight of the player.
-void bless_follower(monsters* follower,
+bool bless_follower(monsters* follower,
god_type god,
bool (*suitable)(const monsters* mon))
{
@@ -1030,7 +1030,7 @@ void bless_follower(monsters* follower,
}
}
- return;
+ return false;
}
mon = &menv[monster];
@@ -1164,6 +1164,8 @@ blessing_done:
snprintf(info, INFO_SIZE, " blesses %s with %s.", blessed.c_str(),
result.c_str());
simple_god_message(info);
+
+ return true;
}
static void do_god_gift(bool prayed_for)
diff --git a/crawl-ref/source/religion.h b/crawl-ref/source/religion.h
index df053ac3f0..7860cac099 100644
--- a/crawl-ref/source/religion.h
+++ b/crawl-ref/source/religion.h
@@ -74,7 +74,7 @@ bool tso_stab_safe_monster(const actor *act);
bool is_tso_follower(const monsters* mon);
bool is_orcish_follower(const monsters* mon);
bool is_follower(const monsters* mon);
-void bless_follower(monsters* follower = NULL,
+bool bless_follower(monsters* follower = NULL,
god_type god = you.religion,
bool (*suitable)(const monsters* mon) = is_follower);