From 727f4e1f12361fa326bcb16d15715a04b7a7568b Mon Sep 17 00:00:00 2001 From: j-p-e-g Date: Wed, 20 Feb 2008 12:57:03 +0000 Subject: 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 --- crawl-ref/source/item_use.cc | 28 +++++++++++++++++++++++----- 1 file changed, 23 insertions(+), 5 deletions(-) (limited to 'crawl-ref/source/item_use.cc') 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 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 unwind_festart(Options.fire_items_start, 0); + unwind_var 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 { -- cgit v1.2.3-54-g00ecf