summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source
diff options
context:
space:
mode:
Diffstat (limited to 'crawl-ref/source')
-rw-r--r--crawl-ref/source/acr.cc4
-rw-r--r--crawl-ref/source/religion.cc61
2 files changed, 38 insertions, 27 deletions
diff --git a/crawl-ref/source/acr.cc b/crawl-ref/source/acr.cc
index 74d14eb3e1..7e0da4b3a1 100644
--- a/crawl-ref/source/acr.cc
+++ b/crawl-ref/source/acr.cc
@@ -2517,6 +2517,7 @@ static void _decrement_durations()
// XXX: Mummies have an ability (albeit an expensive one) that
// can fix rotted HPs now... it's probably impossible for them
// to even start rotting right now, but that could be changed. -- bwr
+ // It's not normal biology, so Cheibriados won't help.
if (you.species == SP_MUMMY)
you.rotting = 0;
else if (x_chance_in_y(you.rotting, 20))
@@ -2535,7 +2536,8 @@ static void _decrement_durations()
// attacks somewhat less painful, but that seems wrong-headed {dlb}:
if (you.species == SP_GHOUL)
{
- if (one_chance_in(400))
+ if (one_chance_in((you.religion == GOD_CHEIBRIADOS && you.piety >
+ piety_breakpoint(0)) ? 600 : 400))
{
mpr("You feel your flesh rotting away.", MSGCH_WARN);
ouch(1, NON_MONSTER, KILLED_BY_ROTTING);
diff --git a/crawl-ref/source/religion.cc b/crawl-ref/source/religion.cc
index 1e0cd81bc5..011d363848 100644
--- a/crawl-ref/source/religion.cc
+++ b/crawl-ref/source/religion.cc
@@ -3628,6 +3628,37 @@ void disable_attack_conducts(god_conduct_trigger conduct[3])
conduct[i].enabled = false;
}
+static bool _abil_chg_message(const char *pmsg, const char *youcanmsg)
+{
+ int pos;
+
+ if (!*pmsg)
+ return false;
+
+ std::string pm = pmsg;
+ if ((pos = pm.find("biology")) != -1)
+ switch(you.is_undead)
+ {
+ case US_UNDEAD: // mummies -- time has no meaning!
+ return false;
+ case US_HUNGRY_DEAD: // ghouls
+ pm.replace(pos, 7, "decay");
+ break;
+ case US_SEMI_UNDEAD: // vampires
+ case US_ALIVE:
+ break;
+ }
+
+ if (isupper(pmsg[0]))
+ god_speaks(you.religion, pm.c_str());
+ else
+ {
+ god_speaks(you.religion,
+ make_stringf(youcanmsg, pmsg).c_str());
+ }
+ return true;
+}
+
static void _dock_piety(int piety_loss, int penance)
{
static long last_piety_lecture = -1L;
@@ -3754,19 +3785,9 @@ void gain_piety(int pgn)
// title.
redraw_skill(you.your_name, player_title());
- const char* pmsg = god_gain_power_messages[you.religion][i];
- const char first = pmsg[0];
-
- if (first)
+ if (_abil_chg_message(god_gain_power_messages[you.religion][i],
+ "You can now %s."))
{
- if (isupper(first))
- god_speaks(you.religion, pmsg);
- else
- {
- god_speaks(you.religion,
- make_stringf("You can now %s.", pmsg).c_str());
- }
-
learned_something_new(TUT_NEW_ABILITY_GOD);
}
@@ -3983,20 +4004,8 @@ void lose_piety(int pgn)
// title.
redraw_skill(you.your_name, player_title());
- const char* pmsg = god_lose_power_messages[you.religion][i];
- const char first = pmsg[0];
-
- if (first)
- {
- if (isupper(first))
- god_speaks(you.religion, pmsg);
- else
- {
- god_speaks(you.religion,
- make_stringf("You can no longer %s.",
- pmsg).c_str());
- }
- }
+ _abil_chg_message(god_lose_power_messages[you.religion][i],
+ "You can no longer %s.");
if (_need_water_walking() && !beogh_water_walk())
fall_into_a_pool(you.pos(), true, grd(you.pos()));