summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/religion.cc
diff options
context:
space:
mode:
authordolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573>2009-07-19 19:04:23 +0000
committerdolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573>2009-07-19 19:04:23 +0000
commit2817900512f1f92a5d8738723373ab378fd1d6e5 (patch)
treebe26e14a39ad8bafe9b5a63b48b01ebb8772d9c2 /crawl-ref/source/religion.cc
parentaf7b69fc5936d24c9ee0bbb5bc787cb194f7c26f (diff)
downloadcrawl-ref-2817900512f1f92a5d8738723373ab378fd1d6e5.tar.gz
crawl-ref-2817900512f1f92a5d8738723373ab378fd1d6e5.zip
Add yet more Jiyva-related cleanups. Make sure his altars are never
generated if the royal jelly is dead, you don't worship Jiyva, and you're not under penance from Jiyva; don't destroy Jiyva's altars if the royal jelly dies after you start worshipping him or go under penance from him; and clean up the alternate method for unlocking the Slime Pits. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@10332 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/religion.cc')
-rw-r--r--crawl-ref/source/religion.cc50
1 files changed, 27 insertions, 23 deletions
diff --git a/crawl-ref/source/religion.cc b/crawl-ref/source/religion.cc
index 644a8f02d8..44bc9ecdae 100644
--- a/crawl-ref/source/religion.cc
+++ b/crawl-ref/source/religion.cc
@@ -852,10 +852,16 @@ void dec_penance(god_type god, int val)
#endif
if (you.penance[god] <= val)
{
- simple_god_message(" seems mollified.", god);
- take_note(Note(NOTE_MOLLIFY_GOD, god));
you.penance[god] = 0;
+ simple_god_message(
+ make_stringf("seems mollified%s.",
+ god == GOD_JIYVA && jiyva_is_dead() ?
+ ", and vanishes" : "").c_str(),
+ god);
+
+ take_note(Note(NOTE_MOLLIFY_GOD, god));
+
// TSO's halo is once more available.
if (god == GOD_SHINING_ONE && you.religion == god
&& you.piety >= piety_breakpoint(0))
@@ -924,6 +930,12 @@ 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()
@@ -5194,6 +5206,9 @@ bool divine_retribution(god_type god)
{
ASSERT(god != GOD_NO_GOD);
+ if (god == GOD_JIYVA && jiyva_is_dead())
+ return (false);
+
// Good gods don't use divine retribution on their followers, and
// gods don't use divine retribution on followers of gods they don't
// hate.
@@ -7113,30 +7128,19 @@ void god_pitch(god_type which_god)
if (you.religion == GOD_LUGONU && you.worshipped[GOD_LUGONU] == 1)
gain_piety(20); // allow instant access to first power
- // Complimentary jelly upon joining.
- if (you.religion == GOD_JIYVA && !_has_jelly())
+ // Complimentary jelly upon joining for the first time.
+ if (you.religion == GOD_JIYVA && you.worshipped[GOD_JIYVA] == 1)
{
- monster_type mon = MONS_JELLY;
- mgen_data mg(mon, BEH_STRICT_NEUTRAL, 0, 0, you.pos(), MHITNOT, 0,
- GOD_JIYVA);
-
- _delayed_monster(mg);
- simple_god_message(" grants you a jelly!");
+ slime_vault_change(false);
- if (level_id::current() == level_id(BRANCH_SLIME_PITS, 6))
+ if (!_has_jelly())
{
- const level_id target(BRANCH_SLIME_PITS, 6);
- bool done = apply_to_level(target, true, slime_vault_to_floor);
- if (done)
- {
- if (silenced(you.pos()))
- {
- mpr("An unexplained breeze blows through the dungeon.",
- MSGCH_GOD);
- }
- else
- mpr("You hear the sound of toppling stones.", MSGCH_GOD);
- }
+ monster_type mon = MONS_JELLY;
+ mgen_data mg(mon, BEH_STRICT_NEUTRAL, 0, 0, you.pos(), MHITNOT, 0,
+ GOD_JIYVA);
+
+ _delayed_monster(mg);
+ simple_god_message(" grants you a jelly!");
}
}