diff options
author | zelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573> | 2007-09-20 06:27:28 +0000 |
---|---|---|
committer | zelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573> | 2007-09-20 06:27:28 +0000 |
commit | 3f915978c1319badcafec4effb1a1f20635a197b (patch) | |
tree | 51081b057fc5267bbb78bdbdb5ccde2b7d34a98e /crawl-ref/source/religion.cc | |
parent | 826d3ffff46a67cbb812df9f279ab0b79f4e7e47 (diff) | |
download | crawl-ref-3f915978c1319badcafec4effb1a1f20635a197b.tar.gz crawl-ref-3f915978c1319badcafec4effb1a1f20635a197b.zip |
Inscribing an item with "=p" will, for Nemelexites, prevent just that item
from being sacrificed; "!p" still prevents an entire stack of items from
being sacrificed, and the prompt message for "!p" is now clearer on that.
Also, explictly marked stashes are never sacrificed by Nemelxites.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@2158 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/religion.cc')
-rw-r--r-- | crawl-ref/source/religion.cc | 32 |
1 files changed, 28 insertions, 4 deletions
diff --git a/crawl-ref/source/religion.cc b/crawl-ref/source/religion.cc index b3d48ea41b..76371d0065 100644 --- a/crawl-ref/source/religion.cc +++ b/crawl-ref/source/religion.cc @@ -67,6 +67,7 @@ #include "spl-book.h" #include "spl-cast.h" #include "spl-util.h" +#include "stash.h" #include "state.h" #include "stuff.h" #include "terrain.h" @@ -742,6 +743,13 @@ static bool is_risky_sacrifice(const item_def& item) static bool confirm_pray_sacrifice() { + if (Options.stash_tracking == STM_EXPLICIT + && is_stash(you.x_pos, you.y_pos)) + { + mpr("You can't sacrifice explictly marked stashes."); + return false; + } + for ( int i = igrd[you.x_pos][you.y_pos]; i != NON_ITEM; i = mitm[i].link ) { @@ -749,9 +757,9 @@ static bool confirm_pray_sacrifice() if ( is_risky_sacrifice(item) || has_warning_inscription(item, OPER_PRAY) ) { - std::string prompt = "Really sacrifice "; + std::string prompt = "Really sacrifice stack with "; prompt += item.name(DESC_NOCAP_A); - prompt += '?'; + prompt += " in it?"; if ( !yesno(prompt.c_str(), false, 'n') ) return false; } @@ -2837,8 +2845,10 @@ void offer_items() int i = igrd[you.x_pos][you.y_pos]; while (i != NON_ITEM) { - const int next = mitm[i].link; // in case we can't get it later. - const int value = item_value( mitm[i], true ); + item_def &item(mitm[i]); + const int next = item.link; // in case we can't get it later. + const int value = item_value( item, true ); + if (!god_likes_item(you.religion, mitm[i])) { @@ -2855,6 +2865,20 @@ void offer_items() switch (you.religion) { case GOD_NEMELEX_XOBEH: + if ( is_risky_sacrifice(item) || + item.inscription.find("=p") != std::string::npos) + { + std::string msg = "Really sacrifice "; + msg += item.name(DESC_NOCAP_A); + msg += "?"; + + if (!yesno(msg.c_str())) + { + i = next; + continue; + } + } + you.sacrifice_value[mitm[i].base_type] += value; if (you.attribute[ATTR_CARD_COUNTDOWN] && random2(800) < value) { |