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>2007-09-10 15:05:31 +0000
committerj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2007-09-10 15:05:31 +0000
commit6e2e9d806ac731c0e421e7bfb4ab5497ea73730b (patch)
tree995001419eef650a033bdf544d61735a2cc10992 /crawl-ref/source/item_use.cc
parent9dc1f94fe89c3f426921ac5e32eb4cd79f8b73e2 (diff)
downloadcrawl-ref-6e2e9d806ac731c0e421e7bfb4ab5497ea73730b.tar.gz
crawl-ref-6e2e9d806ac731c0e421e7bfb4ab5497ea73730b.zip
Changed requirements for auto-identification of equipped
items, specifically jewellery and randarts. The goal of this change was to clear up the identification rules and apply them consistently. It was inspired by FR 1788698. * Like the ring of teleportation, =lev and "rage now only autoID if you do not wear/wield a randart with the same property. * Stat changes caused by randarts always give a message. * Other "obvious" changes give a message only if the randart has not been identified, to avoid message spam. (Obvious refers to attributes that would cause the item to be autoID'd if it were the appropriate sub type.) * Randarts do NOT autoID anymore just because you recognize the base type. On the whole, autoidentification becomes much rarer (thus both the scroll and the spell become more valuable). Yes, this might be too harsh. On the upside, the player is told about properties such as stat changes (including AC and EV) and all evokable abilities. We might even include information about items hindering or preventing spellcasting and teleportation, respectively, under the assumption that skilled spellcasters and chars with teleportitis or teleport control would notice. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@2067 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/item_use.cc')
-rw-r--r--crawl-ref/source/item_use.cc104
1 files changed, 84 insertions, 20 deletions
diff --git a/crawl-ref/source/item_use.cc b/crawl-ref/source/item_use.cc
index a16b8c6e88..5988e2c255 100644
--- a/crawl-ref/source/item_use.cc
+++ b/crawl-ref/source/item_use.cc
@@ -2239,6 +2239,12 @@ void jewellery_wear_effects(item_def &item)
{
item_type_id_state_type ident = ID_TRIED_TYPE;
+ // Randart jewellery shouldn't auto-ID just because the
+ // base type is known. Somehow the player should still
+ // be told, preferably by message. (jpeg)
+ const bool artefact = is_random_artefact( item );
+ const bool identified = fully_identified( item );
+
switch (item.sub_type)
{
case RING_FIRE:
@@ -2261,63 +2267,86 @@ void jewellery_wear_effects(item_def &item)
case RING_PROTECTION:
you.redraw_armour_class = 1;
if (item.plus != 0)
- ident = ID_KNOWN_TYPE;
+ {
+ if (!artefact)
+ ident = ID_KNOWN_TYPE;
+ else if (!identified)
+ {
+ mprf("You feel %s.", item.plus > 0?
+ "well-protected" : "more vulnerable");
+ }
+ }
break;
case RING_INVISIBILITY:
if (!you.duration[DUR_INVIS])
{
mpr("You become transparent for a moment.");
- ident = ID_KNOWN_TYPE;
+ if (!artefact)
+ ident = ID_KNOWN_TYPE;
}
break;
case RING_EVASION:
you.redraw_evasion = 1;
if (item.plus != 0)
- ident = ID_KNOWN_TYPE;
+ {
+ if (!artefact)
+ ident = ID_KNOWN_TYPE;
+ else if (!identified)
+ mprf("You feel %s.", item.plus > 0? "nimbler" : "more awkward");
+ }
break;
case RING_STRENGTH:
- modify_stat(STAT_STRENGTH, item.plus, true);
- if (item.plus != 0)
+ modify_stat(STAT_STRENGTH, item.plus, !artefact);
+ if (item.plus != 0 && !artefact)
ident = ID_KNOWN_TYPE;
break;
case RING_DEXTERITY:
- modify_stat(STAT_DEXTERITY, item.plus, true);
- if (item.plus != 0)
+ modify_stat(STAT_DEXTERITY, item.plus, !artefact);
+ if (item.plus != 0 && !artefact)
ident = ID_KNOWN_TYPE;
break;
case RING_INTELLIGENCE:
- modify_stat(STAT_INTELLIGENCE, item.plus, true);
- if (item.plus != 0)
+ modify_stat(STAT_INTELLIGENCE, item.plus, !artefact);
+ if (item.plus != 0 && !artefact)
ident = ID_KNOWN_TYPE;
break;
case RING_MAGICAL_POWER:
calc_mp();
- ident = ID_KNOWN_TYPE;
+ if (!artefact)
+ ident = ID_KNOWN_TYPE;
break;
case RING_LEVITATION:
- mpr("You feel buoyant.");
- ident = ID_KNOWN_TYPE;
+ if (!scan_randarts( RAP_LEVITATE ))
+ {
+ mpr("You feel buoyant.");
+ if (!artefact)
+ ident = ID_KNOWN_TYPE;
+ }
break;
case RING_TELEPORTATION:
if (!scan_randarts( RAP_CAN_TELEPORT ))
{
mpr("You feel slightly jumpy.");
- ident = ID_KNOWN_TYPE;
- break;
+ if (!artefact)
+ ident = ID_KNOWN_TYPE;
}
break;
case AMU_RAGE:
- mpr("You feel a brief urge to hack something to bits.");
- ident = ID_KNOWN_TYPE;
+ if (!scan_randarts( RAP_BERSERK ))
+ {
+ mpr("You feel a brief urge to hack something to bits.");
+ if (!artefact)
+ ident = ID_KNOWN_TYPE;
+ }
break;
case AMU_THE_GOURMAND:
@@ -2327,7 +2356,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
- if (is_random_artefact( item ))
+ if (artefact)
use_randart(item);
else
set_ident_type( item.base_type, item.sub_type, ident );
@@ -3852,21 +3881,56 @@ void use_randart(const item_def &item)
const bool alreadyknown = item_type_known(item);
const bool dangerous = player_in_a_dangerous_place();
+ const bool ident = fully_identified(item);
randart_properties_t proprt;
randart_wpn_properties( item, proprt );
+ // Give messages for stat changes, possibly only if !identified
if (proprt[RAP_AC])
+ {
you.redraw_armour_class = 1;
+ if (!ident)
+ {
+ mprf("You feel %s.", proprt[RAP_AC] > 0?
+ "well-protected" : "more vulnerable");
+ }
+ }
if (proprt[RAP_EVASION])
+ {
you.redraw_evasion = 1;
+ if (!ident)
+ {
+ mprf("You feel somewhat %s.", proprt[RAP_EVASION] > 0?
+ "nimbler" : "more awkward");
+ }
+ }
// modify ability scores
- modify_stat( STAT_STRENGTH, proprt[RAP_STRENGTH], true );
- modify_stat( STAT_INTELLIGENCE, proprt[RAP_INTELLIGENCE], true );
- modify_stat( STAT_DEXTERITY, proprt[RAP_DEXTERITY], true );
+ // output result even when identified (because of potential fatality)
+ modify_stat( STAT_STRENGTH, proprt[RAP_STRENGTH], false );
+ modify_stat( STAT_INTELLIGENCE, proprt[RAP_INTELLIGENCE], false );
+ modify_stat( STAT_DEXTERITY, proprt[RAP_DEXTERITY], false );
+
+ // For evokable stuff, check whether other equipped items yield
+ // the same ability. If not, give a message.
+ // Do NOT give all these messages if the randart is identified.
+ if (!ident)
+ {
+ if (proprt[RAP_LEVITATE] && !items_give_ability(item.link, RAP_LEVITATE))
+ mpr("You feel buoyant.");
+
+ if (proprt[RAP_INVISIBLE] && !you.duration[DUR_INVIS])
+ mpr("You become transparent for a moment.");
+
+ if (proprt[RAP_CAN_TELEPORT] && !items_give_ability(item.link, RAP_CAN_TELEPORT))
+ mpr("You feel slightly jumpy.");
+
+ if (proprt[RAP_BERSERK] && !items_give_ability(item.link, RAP_BERSERK))
+ mpr("You feel a brief urge to hack something to bits.");
+ }
if (proprt[RAP_NOISES])
you.special_wield = 50 + proprt[RAP_NOISES];