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.
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
HFCPPPYI366EDKNBDGVNSAW76OGQA2NYTKLSP4LC3VYKHPLWFJ6QC
Z6XF4AIERIW4U4AR3HU2ILYFZ54IK4K4ORQ6JKCEWRO5LZODWDDAC
K2CS6TCX2NDVL2ASEHGP4J4K4IJ6FP3ANNKTSIWVG43HPYSBX6ZQC
SDLKLUNFGVKDS55DDJZCBAVIB7NL3RRYPTACAY65SCUQKV6APFSAC
XRZPPYWPWUOM4SFNI6BHKH2UKJQNLKOV6Y7XIEPEZXE5QYRT26PAC
RPOZZWKG5GLPHVZZ7ZKMKS64ZMV2LDCQSARBJFJ6FZOTOKCQO7FAC
KFULGQQOHWUTXOM3BXCCYPGGVGGY4Z6265XUFRCBPNLTZAEHJZSQC
// Checks each equip slot for an evokable item (jewellery or randart).
// Returns true if any of these has the same ability as the one handed in.
bool items_give_ability(const int slot, char abil)
{
for (int i = EQ_WEAPON; i < NUM_EQUIP; i++)
{
const int eq = you.equip[i];
if (eq == -1)
continue;
// skip item to compare with
if (eq == slot)
continue;
// only weapons give their effects when in our hands
if (i == EQ_WEAPON && you.inv[ eq ].base_type != OBJ_WEAPONS)
continue;
if (eq == EQ_LEFT_RING || eq == EQ_RIGHT_RING)
{
if (abil == RAP_LEVITATE && you.inv[eq].sub_type == RING_LEVITATION)
return (true);
if (abil == RAP_CAN_TELEPORT && you.inv[eq].sub_type == RING_TELEPORTATION)
return (true);
if (abil == RAP_INVISIBLE && you.inv[eq].sub_type == RING_INVISIBILITY)
return (true);
}
else if (eq == EQ_AMULET)
{
if (abil == RAP_BERSERK && you.inv[eq].sub_type == AMU_RAGE)
return (true);
}
// other items are not evokable
if (!is_random_artefact( you.inv[ eq ] ))
continue;
if (randart_wpn_property(you.inv[ eq ], abil))
return (true);
}
// none of the equipped items possesses this ability
return (false);
} // end scan_randarts()
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.");
}
// 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 );
// modify ability scores, always output messages
modify_stat( STAT_STRENGTH, -proprt[RAP_STRENGTH], false );
modify_stat( STAT_INTELLIGENCE, -proprt[RAP_INTELLIGENCE], false );
modify_stat( STAT_DEXTERITY, -proprt[RAP_DEXTERITY], false );