summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/item_use.cc
diff options
context:
space:
mode:
authorj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2008-02-20 12:57:03 +0000
committerj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2008-02-20 12:57:03 +0000
commit727f4e1f12361fa326bcb16d15715a04b7a7568b (patch)
treee38d94e3d6614a764d8293460ba2c05b417ea036 /crawl-ref/source/item_use.cc
parente2efb14c85c324beb9cb34b62af0cc33b133a468 (diff)
downloadcrawl-ref-727f4e1f12361fa326bcb16d15715a04b7a7568b.tar.gz
crawl-ref-727f4e1f12361fa326bcb16d15715a04b7a7568b.zip
Apply Paul's =f inscription patch as well as a patch to make
crawl_options.txt more readable concerning inscriptions. (Not that that really is such an issue now there's extensive documentation in the manual, but it surely doesn't hurt.) Also fix some of the randart autoinscriptions. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@3447 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/item_use.cc')
-rw-r--r--crawl-ref/source/item_use.cc28
1 files changed, 23 insertions, 5 deletions
diff --git a/crawl-ref/source/item_use.cc b/crawl-ref/source/item_use.cc
index e0cbce7b0e..9566601153 100644
--- a/crawl-ref/source/item_use.cc
+++ b/crawl-ref/source/item_use.cc
@@ -1300,9 +1300,11 @@ static bool fire_item_matches(const item_def &item, unsigned fire_type)
return (false);
}
+static bool Hack_Ignore_F_Inscription = false; // only for "why can't I fire" feedback
static bool fire_item_okay(const item_def &item, unsigned flags)
{
return (fire_item_matches(item, flags)
+ && (Hack_Ignore_F_Inscription || strstr(item.inscription.c_str(), "=f") == 0)
&& you.equip[EQ_WEAPON] != item.link);
}
@@ -1336,6 +1338,9 @@ quiver_type get_quiver_type()
}
+// Search all items in pack for a fire_item_okay item.
+// If check_quiver, quiver item is checked first.
+// Then, check all items in the loop determined by start and forward
static int find_fire_item_matching(unsigned fire_type, int start,
bool forward, bool check_quiver)
{
@@ -1528,14 +1533,26 @@ void shoot_thing(void)
if (item == ENDOFPACK)
{
- unwind_var<int> festart(Options.fire_items_start, 0);
- if ((item = get_fire_item_index()) == ENDOFPACK)
+ // Tell the user why we might have skipped their missile
+ unwind_var<int> unwind_festart(Options.fire_items_start, 0);
+ unwind_var<bool> unwind_inscription(Hack_Ignore_F_Inscription, true);
+ const int skipped_item = get_fire_item_index();
+ if (skipped_item == ENDOFPACK)
+ {
mpr("No suitable missiles.");
- else
+ }
+ else if (skipped_item < unwind_festart.original_value())
+ {
mprf("No suitable missiles (fire_items_start = '%c', "
"ignoring item on '%c').",
- index_to_letter(festart.original_value()),
- index_to_letter(item));
+ index_to_letter(unwind_festart.original_value()),
+ index_to_letter(skipped_item));
+ }
+ else
+ {
+ mprf("No suitable missiles (ignoring '=f'-inscribed item on '%c').",
+ index_to_letter(skipped_item));
+ }
flush_input_buffer( FLUSH_ON_FAILURE );
return;
}
@@ -3408,6 +3425,7 @@ void inscribe_item()
you.inv[item_slot].inscription = std::string(buf);
you.wield_change = true;
+ you.quiver_change = true;
}
else
{