diff options
author | dolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573> | 2009-07-19 19:23:39 +0000 |
---|---|---|
committer | dolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573> | 2009-07-19 19:23:39 +0000 |
commit | 0cbc3be58fb17485301e3e0ddc48bd7eb3324408 (patch) | |
tree | 995a0faf4185c6ef86b8eb1a58668fc8e45c9cbb /crawl-ref/source/religion.cc | |
parent | a40e94b9235abcdde3361b72e061558083f95288 (diff) | |
download | crawl-ref-0cbc3be58fb17485301e3e0ddc48bd7eb3324408.tar.gz crawl-ref-0cbc3be58fb17485301e3e0ddc48bd7eb3324408.zip |
Handle one more case of Jiyva's altar removal.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@10335 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/religion.cc')
-rw-r--r-- | crawl-ref/source/religion.cc | 40 |
1 files changed, 32 insertions, 8 deletions
diff --git a/crawl-ref/source/religion.cc b/crawl-ref/source/religion.cc index 44bc9ecdae..bc202980e9 100644 --- a/crawl-ref/source/religion.cc +++ b/crawl-ref/source/religion.cc @@ -854,12 +854,16 @@ void dec_penance(god_type god, int val) { you.penance[god] = 0; + const bool dead_jiyva = (god == GOD_JIYVA && jiyva_is_dead()); + simple_god_message( make_stringf("seems mollified%s.", - god == GOD_JIYVA && jiyva_is_dead() ? - ", and vanishes" : "").c_str(), + dead_jiyva ? ", and vanishes" : "").c_str(), god); + if (dead_jiyva) + remove_all_jiyva_altars(); + take_note(Note(NOTE_MOLLIFY_GOD, god)); // TSO's halo is once more available. @@ -930,12 +934,6 @@ static bool _need_water_walking() && grd(you.pos()) == DNGN_DEEP_WATER); } -bool jiyva_is_dead() -{ - return (you.royal_jelly_dead - && you.religion != GOD_JIYVA && !you.penance[GOD_JIYVA]); -} - bool jiyva_grant_jelly(bool actual) { return (you.religion == GOD_JIYVA && !player_under_penance() @@ -962,6 +960,32 @@ bool jiyva_remove_bad_mutation() return (true); } +bool jiyva_is_dead() +{ + return (you.royal_jelly_dead + && you.religion != GOD_JIYVA && !you.penance[GOD_JIYVA]); +} + +static bool _remove_jiyva_altars() +{ + bool success = false; + for (rectangle_iterator ri(1); ri; ++ri) + { + if (grd(*ri) == DNGN_ALTAR_JIYVA) + { + grd(*ri) = DNGN_FLOOR; + success = true; + } + } + + return (success); +} + +bool remove_all_jiyva_altars() +{ + return (apply_to_all_dungeons(_remove_jiyva_altars)); +} + static void _inc_penance(god_type god, int val) { if (you.penance[god] == 0 && val > 0) |