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>2009-01-06 21:20:56 +0000
committerj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2009-01-06 21:20:56 +0000
commita2df2a7e984468efba235d355daa9d00ed54103f (patch)
tree2c8884c9881cb3672df74d73d25ff863389377ce /crawl-ref/source/item_use.cc
parentef970c20a9d2ecb98d5838d779c1790a449d0f33 (diff)
downloadcrawl-ref-a2df2a7e984468efba235d355daa9d00ed54103f.tar.gz
crawl-ref-a2df2a7e984468efba235d355daa9d00ed54103f.zip
Greatly improve eating interface, as suggested in FRs 1923273 and 2018733.
When you now press 'e' the following takes place: 1) If you can eat chunks, the game builds a list out of all chunks on the floor and in your inventory, sorted by age [1], and prompts you to eat them [2]. 2) If none are found, or you decline all of them you get prompted for non-chunk food items on the floor. 3) Prompt for non-chunk food in your inventory. 4) Open up the food menu of your inventory. Because of the way lua works, there's currently a problem that in the early stages (1-3) "q" (now also accepts Escape) will cause to skip ahead to the next stage rather than leaving the process entirely, which is of course less than optimal. I also added two new options [1] prefer_safe_chunks (defaults to true) which will offer clean chunks before contaminated ones, even if the latter happens to be older [2] easy_eat_chunks (defaults to false) which causes the prompting to be skipped for safe (i.e. clean) chunks, so you will automatically eat the oldest chunk that applies. This is ignored for undead characters. I also got rid of the outdated safechnk.lua and chnkdata.lua seeing how chunk effects are no longer spoily information. Added a new wizmode command: Ctrl-H, which allows you to set your character's hunger state. (Hopefully this will make Vampire testing easier.) Also fix 2488374: "Controlled Flight being named upon levitation even if its type is already known. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@8282 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/item_use.cc')
-rw-r--r--crawl-ref/source/item_use.cc53
1 files changed, 34 insertions, 19 deletions
diff --git a/crawl-ref/source/item_use.cc b/crawl-ref/source/item_use.cc
index 0e90ed318f..731d10567b 100644
--- a/crawl-ref/source/item_use.cc
+++ b/crawl-ref/source/item_use.cc
@@ -2786,33 +2786,45 @@ void jewellery_wear_effects(item_def &item)
break;
case RING_STRENGTH:
- modify_stat(STAT_STRENGTH, item.plus, false, item);
- if (item.plus != 0 && !artefact)
- ident = ID_KNOWN_TYPE;
- learn_pluses = true;
+ if (item.plus)
+ {
+ modify_stat(STAT_STRENGTH, item.plus, false, item);
+
+ if (artefact)
+ fake_rap = RAP_STRENGTH;
+ else
+ ident = ID_KNOWN_TYPE;
- if (Options.autoinscribe_randarts && is_random_artefact(item))
- add_autoinscription( item, randart_auto_inscription(item));
+ learn_pluses = true;
+ }
break;
case RING_DEXTERITY:
- modify_stat(STAT_DEXTERITY, item.plus, false, item);
- if (item.plus != 0 && !artefact)
- ident = ID_KNOWN_TYPE;
- learn_pluses = true;
+ if (item.plus)
+ {
+ modify_stat(STAT_DEXTERITY, item.plus, false, item);
+
+ if (artefact)
+ fake_rap = RAP_DEXTERITY;
+ else
+ ident = ID_KNOWN_TYPE;
- if (Options.autoinscribe_randarts && is_random_artefact(item))
- add_autoinscription( item, randart_auto_inscription(item));
+ learn_pluses = true;
+ }
break;
case RING_INTELLIGENCE:
- modify_stat(STAT_INTELLIGENCE, item.plus, false, item);
- if (item.plus != 0 && !artefact)
- ident = ID_KNOWN_TYPE;
- learn_pluses = true;
+ if (item.plus)
+ {
+ modify_stat(STAT_INTELLIGENCE, item.plus, false, item);
- if (Options.autoinscribe_randarts && is_random_artefact(item))
- add_autoinscription( item, randart_auto_inscription(item));
+ if (artefact)
+ fake_rap = RAP_INTELLIGENCE;
+ else
+ ident = ID_KNOWN_TYPE;
+
+ learn_pluses = true;
+ }
break;
case RING_MAGICAL_POWER:
@@ -2874,7 +2886,7 @@ void jewellery_wear_effects(item_def &item)
}
// Artefacts have completely different appearance than base types
- // so we don't allow them to make the base types known
+ // so we don't allow them to make the base types known.
if (artefact)
{
use_randart(item);
@@ -4814,6 +4826,9 @@ void use_randart(item_def &item, bool unmeld)
if (proprt[RAP_NOISES])
you.special_wield = SPWLD_NOISE;
+ if (!alreadyknown && Options.autoinscribe_randarts)
+ add_autoinscription(item, randart_auto_inscription(item));
+
if (!alreadyknown && dangerous)
{
// Xom loves it when you use an unknown random artefact and