diff options
author | haranp <haranp@c06c8d41-db1a-0410-9941-cceddc491573> | 2007-05-15 17:02:30 +0000 |
---|---|---|
committer | haranp <haranp@c06c8d41-db1a-0410-9941-cceddc491573> | 2007-05-15 17:02:30 +0000 |
commit | 778880771386e5f111aca28d397c5d32f3e7dca0 (patch) | |
tree | 3103d6f05216f29849f36419ba0ae54fb4596a2e /crawl-ref/source/religion.cc | |
parent | 21a20c8edf221604f77decc0430145d13f305e5b (diff) | |
download | crawl-ref-778880771386e5f111aca28d397c5d32f3e7dca0.tar.gz crawl-ref-778880771386e5f111aca28d397c5d32f3e7dca0.zip |
Nemelexites now require confirmation before offering runes, orbs, or
objects marked with !p (or !*) on a non-altar square.
Nothing gets offered unless the player OKs everything, so inscribing
a couple of items in your stash with !p should be enough paranoia.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1476 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/religion.cc')
-rw-r--r-- | crawl-ref/source/religion.cc | 35 |
1 files changed, 33 insertions, 2 deletions
diff --git a/crawl-ref/source/religion.cc b/crawl-ref/source/religion.cc index a1d7f0ff31..8701400c2a 100644 --- a/crawl-ref/source/religion.cc +++ b/crawl-ref/source/religion.cc @@ -41,6 +41,7 @@ #include "describe.h" #include "effects.h" #include "food.h" +#include "invent.h" #include "it_use2.h" #include "itemname.h" #include "itemprop.h" @@ -599,6 +600,30 @@ static void do_god_gift() } // end of gift giving } +static bool is_risky_sacrifice(const item_def& item) +{ + return item.base_type == OBJ_ORBS || is_rune(item); +} + +static bool confirm_pray_sacrifice() +{ + for ( int i = igrd[you.x_pos][you.y_pos]; i != NON_ITEM; + i = mitm[i].link ) + { + const item_def& item = mitm[i]; + if ( is_risky_sacrifice(item) || + has_warning_inscription(item, OPER_PRAY) ) + { + std::string prompt = "Really sacrifice "; + prompt += item.name(DESC_NOCAP_A); + prompt += '?'; + if ( !yesno(prompt.c_str(), false, 'n') ) + return false; + } + } + return true; +} + std::string god_prayer_reaction() { std::string result; @@ -683,9 +708,15 @@ void pray() return; } + // Nemelexites can abort out now instead of offering something + // they don't want to lose + if ( you.religion == GOD_NEMELEX_XOBEH && altar_god == GOD_NO_GOD && + !confirm_pray_sacrifice() ) + return; + mprf(MSGCH_PRAY, "You offer a prayer to %s.", god_name(you.religion)); - // Nemelexites can offer everywhere + // ...otherwise, they offer what they're standing on if ( you.religion == GOD_NEMELEX_XOBEH && altar_god == GOD_NO_GOD ) offer_items(); @@ -2498,7 +2529,7 @@ void offer_items() { if (you.religion == GOD_NO_GOD) return; - + int i = igrd[you.x_pos][you.y_pos]; while (i != NON_ITEM) { |