i.e., when a surge (or anti-surge) is created or amplified by them, at most one unIDed ring is worn, and no unIDed staves are wielded. (Checking for armour is unnecessary because armour type-IDs on wearing.) Note that this makes it easier to find out what randart rings of fire and ice do. Also changed a bunch of unsigned char return values to ints.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1051 c06c8d41-db1a-0410-9941-cceddc491573
GSS3OCYMI4MYKACCGNLFA267VDH2U7G4QVVDLMOVAUHZTYQ3QJDAC
static bool surge_identify_boosters(int spell)
{
const unsigned int typeflags = spell_type(spell);
if ( (typeflags & SPTYP_FIRE) || (typeflags & SPTYP_ICE) )
{
// Must not be wielding an unIDed staff.
// Note that robes of the Archmagi identify on wearing,
// so that's less of an issue.
const item_def* wpn = player_weapon();
if ( wpn == NULL ||
wpn->base_type != OBJ_STAVES ||
item_ident(*wpn, ISFLAG_KNOW_PROPERTIES) )
{
int num_unknown = 0;
for ( int i = EQ_LEFT_RING; i <= EQ_RIGHT_RING; ++i )
{
if (you.equip[i] != -1 &&
!item_ident(you.inv[you.equip[i]], ISFLAG_KNOW_PROPERTIES))
++num_unknown;
}
// We can also identify cases with two unknown rings, both
// of fire (or both of ice)...let's skip it.
if ( num_unknown == 1 )
{
for ( int i = EQ_LEFT_RING; i <= EQ_RIGHT_RING; ++i )
{
if ( you.equip[i] != -1 )
{
item_def& ring = you.inv[you.equip[i]];
if (!item_ident(ring, ISFLAG_KNOW_PROPERTIES) &&
(ring.sub_type == RING_FIRE ||
ring.sub_type == RING_ICE))
{
set_ident_type( ring.base_type, ring.sub_type,
ID_KNOWN_TYPE );
set_ident_flags(ring, ISFLAG_KNOW_PROPERTIES);
mprf("You are wearing: %s",
item_name(ring, DESC_INVENTORY_EQUIP));
}
}
}
return true;
}
}
}
return false;
}
/* ***********************************************************************
* called from: spell - spells0
* *********************************************************************** */
unsigned char player_spec_air(void);
/* ***********************************************************************
* called from: spell - spells0
* *********************************************************************** */
unsigned char player_spec_cold(void);
/* ***********************************************************************
* called from: spell - spells0
* *********************************************************************** */
unsigned char player_spec_conj(void);
/* ***********************************************************************
* called from: it_use3 - spell - spells0
* *********************************************************************** */
unsigned char player_spec_death(void);
/* ***********************************************************************
* called from: spell - spells0
* *********************************************************************** */
unsigned char player_spec_earth(void);
/* ***********************************************************************
* called from: spell - spells0
* *********************************************************************** */
unsigned char player_spec_ench(void);
/* ***********************************************************************
* called from: spell - spells0
* *********************************************************************** */
unsigned char player_spec_fire(void);
int player_spec_air(void);
int player_spec_cold(void);
int player_spec_conj(void);
int player_spec_death(void);
int player_spec_earth(void);
int player_spec_ench(void);
int player_spec_fire(void);
int player_spec_holy(void);
int player_spec_poison(void);
int player_spec_summ(void);
* called from: spell - spells0
* *********************************************************************** */
unsigned char player_spec_holy(void);
/* ***********************************************************************
* called from: spell - spells0
* *********************************************************************** */
unsigned char player_spec_poison(void);
/* ***********************************************************************
* called from: spell - spells0
* *********************************************************************** */
unsigned char player_spec_summ(void);
/* ***********************************************************************