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 | |
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
-rw-r--r-- | crawl-ref/source/monstuff.cc | 17 | ||||
-rw-r--r-- | crawl-ref/source/religion.cc | 40 | ||||
-rw-r--r-- | crawl-ref/source/religion.h | 3 |
3 files changed, 35 insertions, 25 deletions
diff --git a/crawl-ref/source/monstuff.cc b/crawl-ref/source/monstuff.cc index e4e2747aa7..9f5da46605 100644 --- a/crawl-ref/source/monstuff.cc +++ b/crawl-ref/source/monstuff.cc @@ -761,21 +761,6 @@ static bool _monster_avoided_death(monsters *monster, killer_type killer, int i) return (false); } -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); -} - static bool _slime_vault_in_los() { bool in_los = false; @@ -824,7 +809,7 @@ static bool _slime_vault_to_glass(bool silent) } } - apply_to_all_dungeons(_remove_jiyva_altars); + remove_all_jiyva_altars(); if (silenced(you.pos())) { 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) diff --git a/crawl-ref/source/religion.h b/crawl-ref/source/religion.h index 0527703c35..d107bdf8ee 100644 --- a/crawl-ref/source/religion.h +++ b/crawl-ref/source/religion.h @@ -103,9 +103,10 @@ bool divine_retribution(god_type god); bool zin_sustenance(bool actual = true); bool zin_remove_all_mutations(); bool yred_injury_mirror(bool actual = true); -bool jiyva_is_dead(); bool jiyva_grant_jelly(bool actual = true); bool jiyva_remove_bad_mutation(); +bool jiyva_is_dead(); +bool remove_all_jiyva_altars(); bool beogh_water_walk(); void good_god_holy_attitude_change(monsters *holy); void good_god_holy_fail_attitude_change(monsters *holy); |