summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2008-08-01 12:11:33 +0000
committerj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2008-08-01 12:11:33 +0000
commiteed564f133ab31498240ee40fe190a33d1983aac (patch)
treebcde59952e8e963430d193e4a3be9f058d1fea32
parentc41c9b094a552b13d12d40241dc230ac9083bac2 (diff)
downloadcrawl-ref-eed564f133ab31498240ee40fe190a33d1983aac.tar.gz
crawl-ref-eed564f133ab31498240ee40fe190a33d1983aac.zip
Fix 2034581: menu colour leaking information on !blood and !mutation.
Fix 2034526: inscription with { not working git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/branches/stone_soup-0.4@6748 c06c8d41-db1a-0410-9941-cceddc491573
-rw-r--r--crawl-ref/source/describe.cc2
-rw-r--r--crawl-ref/source/item_use.cc5
-rw-r--r--crawl-ref/source/itemname.cc14
-rw-r--r--crawl-ref/source/religion.cc20
4 files changed, 27 insertions, 14 deletions
diff --git a/crawl-ref/source/describe.cc b/crawl-ref/source/describe.cc
index 67a31438d4..4af5e1c088 100644
--- a/crawl-ref/source/describe.cc
+++ b/crawl-ref/source/describe.cc
@@ -2127,7 +2127,7 @@ void inscribe_item(item_def &item, bool proper_prompt)
did_prompt = true;
}
- keyin = (did_prompt ? tolower(c_getch()) : 'y');
+ keyin = (did_prompt ? tolower(c_getch()) : 'i');
switch (keyin)
{
case 'c':
diff --git a/crawl-ref/source/item_use.cc b/crawl-ref/source/item_use.cc
index 0ddeac68ed..cafe9f8570 100644
--- a/crawl-ref/source/item_use.cc
+++ b/crawl-ref/source/item_use.cc
@@ -3586,17 +3586,16 @@ void zap_wand( int slot )
}
you.turn_is_over = true;
-} // end zap_wand()
+}
void prompt_inscribe_item()
{
- int item_slot;
if (inv_count() < 1)
{
mpr("You don't have anything to inscribe.");
return;
}
- item_slot = prompt_invent_item("Inscribe which item? ",
+ int item_slot = prompt_invent_item("Inscribe which item? ",
MT_INVLIST, OSEL_ANY );
if (prompt_failed(item_slot))
diff --git a/crawl-ref/source/itemname.cc b/crawl-ref/source/itemname.cc
index daff922b71..bbbbbd301a 100644
--- a/crawl-ref/source/itemname.cc
+++ b/crawl-ref/source/itemname.cc
@@ -2352,6 +2352,9 @@ bool is_dangerous_item(const item_def &item, bool temp)
switch (item.base_type)
{
case OBJ_SCROLLS:
+ if (!item_type_known(item))
+ return (false);
+
switch (item.sub_type)
{
case SCR_IMMOLATION:
@@ -2362,7 +2365,11 @@ bool is_dangerous_item(const item_def &item, bool temp)
default:
return (false);
}
+
case OBJ_POTIONS:
+ if (!item_type_known(item))
+ return (false);
+
switch (item.sub_type)
{
case POT_MUTATION:
@@ -2373,9 +2380,11 @@ bool is_dangerous_item(const item_def &item, bool temp)
default:
return (false);
}
+
case OBJ_BOOKS:
// The Tome of Destruction is certainly risky.
return (item.sub_type == BOOK_DESTRUCTION);
+
default:
return (false);
}
@@ -2611,8 +2620,11 @@ const std::string menu_colour_item_prefix(const item_def &item, bool temp)
break;
case OBJ_POTIONS:
- if (is_good_god(you.religion) && is_blood_potion(item))
+ if (is_good_god(you.religion) && item_type_known(item)
+ && is_blood_potion(item))
+ {
prefixes.push_back("evil_eating");
+ }
if (is_preferred_food(item))
prefixes.push_back("preferred");
break;
diff --git a/crawl-ref/source/religion.cc b/crawl-ref/source/religion.cc
index a1ecd1ab1f..2a666be9b3 100644
--- a/crawl-ref/source/religion.cc
+++ b/crawl-ref/source/religion.cc
@@ -3061,10 +3061,10 @@ bool god_dislikes_item_handling(const item_def &item)
if (you.religion == GOD_ZIN)
{
- if (((item.base_type == OBJ_POTIONS
- && item.sub_type == POT_MUTATION)
- || (item.base_type == OBJ_WANDS
- && item.sub_type == WAND_POLYMORPH_OTHER))
+ if ((item.base_type == OBJ_POTIONS
+ && item.sub_type == POT_MUTATION
+ || item.base_type == OBJ_WANDS
+ && item.sub_type == WAND_POLYMORPH_OTHER)
&& item_type_known(item))
{
return (true);
@@ -3079,21 +3079,23 @@ bool god_dislikes_item_handling(const item_def &item)
if (you.religion == GOD_SHINING_ONE)
{
+ if (!item_type_known(item))
+ return (false);
+
if (item.base_type == OBJ_WEAPONS)
{
const int item_brand = get_weapon_brand(item);
- if (item_brand == SPWPN_VENOM && item_type_known(item))
+ if (item_brand == SPWPN_VENOM)
return (true);
}
else if (item.base_type == OBJ_MISSILES)
{
const int item_brand = get_ammo_brand(item);
- if (item_type_known(item) &&
- (item_brand == SPMSL_POISONED
- || item_brand == SPMSL_POISONED_II
- || item_brand == SPMSL_CURARE))
+ if (item_brand == SPMSL_POISONED
+ || item_brand == SPMSL_POISONED_II
+ || item_brand == SPMSL_CURARE)
{
return (true);
}