summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/religion.cc
diff options
context:
space:
mode:
authordolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573>2008-10-07 19:20:57 +0000
committerdolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573>2008-10-07 19:20:57 +0000
commit398099b4dc99bc699183bd3a3a854af0aacf18fe (patch)
tree4247982e660fb0653ad1898b213643a47f5829e0 /crawl-ref/source/religion.cc
parent051caae6e1b21c8872b7740c11807170717a7d14 (diff)
downloadcrawl-ref-398099b4dc99bc699183bd3a3a854af0aacf18fe.tar.gz
crawl-ref-398099b4dc99bc699183bd3a3a854af0aacf18fe.zip
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
Diffstat (limited to 'crawl-ref/source/religion.cc')
-rw-r--r--crawl-ref/source/religion.cc14
1 files changed, 10 insertions, 4 deletions
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);