summaryrefslogtreecommitdiffstats
path: root/crawl-ref
diff options
context:
space:
mode:
Diffstat (limited to 'crawl-ref')
-rw-r--r--crawl-ref/docs/crawl_manual.txt5
-rw-r--r--crawl-ref/docs/crawl_options.txt40
-rw-r--r--crawl-ref/init.txt1
-rw-r--r--crawl-ref/source/initfile.cc4
-rw-r--r--crawl-ref/source/item_use.cc22
-rw-r--r--crawl-ref/source/item_use.h3
6 files changed, 30 insertions, 45 deletions
diff --git a/crawl-ref/docs/crawl_manual.txt b/crawl-ref/docs/crawl_manual.txt
index ec1f512ea3..b3cbd7f214 100644
--- a/crawl-ref/docs/crawl_manual.txt
+++ b/crawl-ref/docs/crawl_manual.txt
@@ -2559,8 +2559,9 @@ description of the spell causing the enchantment will explain these.
6. INSCRIPTIONS
------------------------------------------------------------------------
-You can use the { command to manually inscribe items. Besides simply
-making comments about items, there are several further uses.
+You can use the { command to manually inscribe items. This adds a note
+in curly braces to the item description. Besides simply allowing you
+to make comments about items, there are several further uses.
Automatic inscriptions
----------------------
diff --git a/crawl-ref/docs/crawl_options.txt b/crawl-ref/docs/crawl_options.txt
index c5bb94c40e..ddbce031cb 100644
--- a/crawl-ref/docs/crawl_options.txt
+++ b/crawl-ref/docs/crawl_options.txt
@@ -1139,18 +1139,25 @@ fire_items_start = a
Sets the first inventory item to consider when selecting
missiles to fire. The default is a.
-fire_order = launcher, return,
+fire_order = inscribed, launcher, return
fire_order += javelin / dart / stone / rock / spear / net / handaxe / dagger
+fire_order += inscribed
Controls the order of items autoselected for firing. Items
should be separated by commas and items that appear first get
higher priority. You can use multiple fire_order lines - all
- lines but the first must use fire_order +=
+ lines but the first must use "fire_order +=".
Items in any position may be slash-separated to indicate that
these are of equal priority. If this is the case, the first item
in your inventory that fits one of these will be picked for
firing.
+ 'inscribed' refers to any item with the "+f" inscription. See
+ the "Inscriptions" section of the crawl manual for more information
+ about inscriptions.
+
+ the "Inscriptions"
+
'launcher' refers to firing the appropriate missile for the
wielded weapon (ie crossbow, bow, sling, blowgun). You'll almost
certainly want it first, as it'll be ignored when you're not
@@ -1219,33 +1226,8 @@ if the messages are too verbose.
4-m Inscriptions.
---------------------
-In Crawl, items can be manually inscribed with the '{' command. This
-adds a note in curly braces to the item inscription. Inscriptions
-that contain one or more of the following have functional effects:
-
- @w9 -- Typing 'w9' will wield this item. Any single digit will
- work, and the item may contain more than one shortcut.
- This also works with commands besides 'w'.
- @*9 -- Any action command followed by '9' will use this item.
- !w -- Wielding this item causes a prompt for confirmation.
- This also works with commands besides 'w'.
- !* -- Using this item with any command causes a prompt.
- !p -- Nemelex Xobeh worshippers will be prompted before
- sacrificing a stack of items containing an item with this
- inscription; if the answer is "no", the whole stack will be
- skipped, and none of the items sacrificed.
- =p -- Nemelex Xobeh worshippers will be prompted before
- sacrificing this particular item; if the answer is "no",
- then Crawl will go on to sacrifice further items in the
- stack.
- =g -- Item will be picked up automatically if autopickup is on.
- =k -- Item will be ignored in all listings on the ground.
- It can still be picked up if it's the only item on the
- ground.
- =f -- Item will be ignored by the firing prompt and quiver.
- It can still be fired/thrown using 't'.
- =s -- If stash tracking is explicit, then dropping this item will
- cause a stash to automatically be marked.
+See the "Inscriptions" section of the crawl manual for more information
+about inscriptions.
autoinscribe = <regex>:<inscription>
Any item whose description contains the regex will be
diff --git a/crawl-ref/init.txt b/crawl-ref/init.txt
index 2771713917..2417ea9c4e 100644
--- a/crawl-ref/init.txt
+++ b/crawl-ref/init.txt
@@ -250,6 +250,7 @@ message_colour = yellow:fails to return
# fire_items_start = a
# fire_order = launcher, return
# fire_order += javelin / dart / stone / rock / spear / net / handaxe / dagger
+# fire_order += inscribed
##### 4-l Channels ##############################
#
diff --git a/crawl-ref/source/initfile.cc b/crawl-ref/source/initfile.cc
index f7e9e6bb67..7a9273d079 100644
--- a/crawl-ref/source/initfile.cc
+++ b/crawl-ref/source/initfile.cc
@@ -315,6 +315,8 @@ static fire_type str_to_fire_types( const std::string &str )
return (FIRE_NET);
else if (str == "return" || str == "returning")
return (FIRE_RETURNING);
+ else if (str == "inscribed")
+ return (FIRE_INSCRIBED);
return (FIRE_NONE);
}
@@ -767,7 +769,7 @@ void game_options::reset_options()
// Clear fire_order and set up the defaults.
set_fire_order("launcher, return, "
"javelin / dart / stone / rock /"
- " spear / net / handaxe / dagger",
+ " spear / net / handaxe / dagger, inscribed",
false);
item_stack_summary_minimum = 5;
diff --git a/crawl-ref/source/item_use.cc b/crawl-ref/source/item_use.cc
index d13c85b591..984681dbe1 100644
--- a/crawl-ref/source/item_use.cc
+++ b/crawl-ref/source/item_use.cc
@@ -1199,7 +1199,8 @@ bool takeoff_armour(int item)
return true;
} // end takeoff_armour()
-static bool fire_item_matches(const item_def &item, unsigned fire_type)
+// Helper for _get_fire_order
+static bool _fire_item_matches(const item_def &item, unsigned fire_type)
{
if (!is_valid_item(item))
return (false);
@@ -1218,6 +1219,10 @@ static bool fire_item_matches(const item_def &item, unsigned fire_type)
return (false);
}
+ if (fire_type & FIRE_INSCRIBED)
+ if (item.inscription.find("+f", 0) != std::string::npos)
+ return true;
+
if (item.base_type == OBJ_MISSILES)
{
if ((fire_type & FIRE_DART) && item.sub_type == MI_DART)
@@ -1305,23 +1310,16 @@ static void _get_fire_order(std::vector<int>& fire_order)
strstr(item.inscription.c_str(), "=f"))
continue;
- unsigned int i_flags;
- for (i_flags=0; i_flags<Options.fire_order.size(); i_flags++)
+ for (unsigned int i_flags=0;
+ i_flags<Options.fire_order.size();
+ i_flags++)
{
- if (fire_item_matches(item, Options.fire_order[i_flags]))
+ if (_fire_item_matches(item, Options.fire_order[i_flags]))
{
fire_order.push_back( (i_flags<<16) | (i_inv & 0xffff) );
break;
}
}
- if (i_flags == Options.fire_order.size())
- {
- // Didn't match any flags -- last chance is the +f inscription
- if (strstr(item.inscription.c_str(), "+f"))
- {
- fire_order.push_back( (i_flags<<16) | (i_inv & 0xffff) );
- }
- }
}
std::sort(fire_order.begin(), fire_order.end());
diff --git a/crawl-ref/source/item_use.h b/crawl-ref/source/item_use.h
index 997f84b741..dcc08cb42e 100644
--- a/crawl-ref/source/item_use.h
+++ b/crawl-ref/source/item_use.h
@@ -39,7 +39,8 @@ enum fire_type
FIRE_CLUB = 0x0080,
FIRE_ROCK = 0x0100,
FIRE_NET = 0x0200,
- FIRE_RETURNING = 0x0400
+ FIRE_RETURNING = 0x0400,
+ FIRE_INSCRIBED = 0x0800 // Only used for _get_fire_order
};
struct bolt;