From 398099b4dc99bc699183bd3a3a854af0aacf18fe Mon Sep 17 00:00:00 2001 From: dolorous Date: Tue, 7 Oct 2008 19:20:57 +0000 Subject: Make Yred ignore prayers if his injury mirror is unavailable, and turn off prayer if it costs you enough piety to make itself unavailable. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@7175 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/religion.cc | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'crawl-ref/source/religion.cc') diff --git a/crawl-ref/source/religion.cc b/crawl-ref/source/religion.cc index 7fd860051f..d097267b68 100644 --- a/crawl-ref/source/religion.cc +++ b/crawl-ref/source/religion.cc @@ -2012,6 +2012,9 @@ static bool _god_accepts_prayer(god_type type) { switch(type) { + case GOD_YREDELEMNUL: + return (yred_injury_mirror(false)); + case GOD_VEHUMET: case GOD_XOM: case GOD_SHINING_ONE: @@ -2115,11 +2118,8 @@ void pray() you.duration[DUR_PRAYER] *= 2; } - if (!_god_accepts_prayer(you.religion) || you.religion == GOD_ZIN - || you.religion == GOD_NEMELEX_XOBEH) - { + if (you.religion == GOD_ZIN || you.religion == GOD_NEMELEX_XOBEH) you.duration[DUR_PRAYER] = 1; - } else if (you.religion == GOD_YREDELEMNUL || you.religion == GOD_ELYVILON) you.duration[DUR_PRAYER] = 20; @@ -3480,6 +3480,12 @@ void lose_piety(int pgn) } } + if (!_god_accepts_prayer(you.religion)) + { + mpr("Your prayer is over.", MSGCH_PRAY, you.religion); + you.duration[DUR_PRAYER] = 0; + } + if (you.piety > 0 && you.piety <= 5) learned_something_new(TUT_GOD_DISPLEASED); -- cgit v1.2.3-54-g00ecf