diff options
Diffstat (limited to 'crawl-ref/source')
-rw-r--r-- | crawl-ref/source/chardump.cc | 6 | ||||
-rw-r--r-- | crawl-ref/source/clua.cc | 2 | ||||
-rw-r--r-- | crawl-ref/source/delay.cc | 7 | ||||
-rw-r--r-- | crawl-ref/source/describe.cc | 24 | ||||
-rw-r--r-- | crawl-ref/source/fight.cc | 2 | ||||
-rw-r--r-- | crawl-ref/source/food.cc | 2 | ||||
-rw-r--r-- | crawl-ref/source/it_use3.cc | 3 | ||||
-rw-r--r-- | crawl-ref/source/item_use.cc | 2 | ||||
-rw-r--r-- | crawl-ref/source/itemname.cc | 66 | ||||
-rw-r--r-- | crawl-ref/source/itemprop.cc | 4 | ||||
-rw-r--r-- | crawl-ref/source/items.cc | 2 | ||||
-rw-r--r-- | crawl-ref/source/player.cc | 4 | ||||
-rw-r--r-- | crawl-ref/source/randart.cc | 14 | ||||
-rw-r--r-- | crawl-ref/source/shopping.cc | 20 | ||||
-rw-r--r-- | crawl-ref/source/spl-book.cc | 4 | ||||
-rw-r--r-- | crawl-ref/source/spl-cast.cc | 2 |
16 files changed, 84 insertions, 80 deletions
diff --git a/crawl-ref/source/chardump.cc b/crawl-ref/source/chardump.cc index 74a0799193..a9fbfed237 100644 --- a/crawl-ref/source/chardump.cc +++ b/crawl-ref/source/chardump.cc @@ -586,15 +586,17 @@ static bool dump_item_origin(const item_def &item, int value) return (true); if (fs(IODS_EGO_ARMOUR) && item.base_type == OBJ_ARMOUR - && item_ident( item, ISFLAG_KNOW_TYPE )) + && item_type_known( item )) { const int spec_ench = get_armour_ego_type( item ); return (spec_ench != SPARM_NORMAL); } if (fs(IODS_EGO_WEAPON) && item.base_type == OBJ_WEAPONS - && item_ident( item, ISFLAG_KNOW_TYPE )) + && item_type_known( item )) + { return (get_weapon_brand(item) != SPWPN_NORMAL); + } if (fs(IODS_JEWELLERY) && item.base_type == OBJ_JEWELLERY) return (true); diff --git a/crawl-ref/source/clua.cc b/crawl-ref/source/clua.cc index 20005febc9..be6a547d10 100644 --- a/crawl-ref/source/clua.cc +++ b/crawl-ref/source/clua.cc @@ -1297,7 +1297,7 @@ static int l_item_artifact(lua_State *ls) static int l_item_branded(lua_State *ls) { LUA_ITEM(item, 1); - if (!item || !is_valid_item(*item) || !item_ident(*item, ISFLAG_KNOW_TYPE)) + if (!item || !is_valid_item(*item) || !item_type_known(*item)) return (0); bool branded = false; diff --git a/crawl-ref/source/delay.cc b/crawl-ref/source/delay.cc index f48947e93f..f3c3b7f4f6 100644 --- a/crawl-ref/source/delay.cc +++ b/crawl-ref/source/delay.cc @@ -86,7 +86,14 @@ static void pop_delay() static void clear_pending_delays() { while (you.delay_queue.size() > 1) + { + const delay_queue_item delay = + you.delay_queue[you.delay_queue.size() - 1]; you.delay_queue.pop_back(); + + if (is_run_delay(delay.type) && you.running) + stop_running(); + } } void start_delay( int type, int turns, int parm1, int parm2 ) diff --git a/crawl-ref/source/describe.cc b/crawl-ref/source/describe.cc index dc5cf908c8..9896a07113 100644 --- a/crawl-ref/source/describe.cc +++ b/crawl-ref/source/describe.cc @@ -787,7 +787,7 @@ static std::string describe_weapon( const item_def &item, bool verbose) description += "$"; } - else if (item_ident( item, ISFLAG_KNOW_TYPE )) + else if (item_type_known(item)) { // We know it's an artefact type weapon, but not what it does. description += "$This weapon may have some hidden properties.$"; @@ -1064,7 +1064,7 @@ static std::string describe_weapon( const item_def &item, bool verbose) spec_ench = SPWPN_NORMAL; // special weapon descrip - if (spec_ench != SPWPN_NORMAL && item_ident( item, ISFLAG_KNOW_TYPE )) + if (spec_ench != SPWPN_NORMAL && item_type_known(item)) { description += "$"; @@ -1177,12 +1177,12 @@ static std::string describe_weapon( const item_def &item, bool verbose) if (description.length() == old_length) description += "$"; } - else if (item_ident( item, ISFLAG_KNOW_TYPE )) + else if (item_type_known(item)) { description += "$This weapon may have some hidden properties.$"; } } - else if (spec_ench != SPWPN_NORMAL && item_ident( item, ISFLAG_KNOW_TYPE )) + else if (spec_ench != SPWPN_NORMAL && item_type_known(item)) { description += "$"; } @@ -1350,7 +1350,7 @@ static std::string describe_ammo( const item_def &item ) break; } - if (item.special != 0 && item_ident( item, ISFLAG_KNOW_TYPE )) + if (item.special != 0 && item_type_known(item)) { switch (item.special) { @@ -1629,7 +1629,7 @@ static std::string describe_armour( const item_def &item, bool verbose ) int ego = get_armour_ego_type( item ); if (ego != SPARM_NORMAL - && item_ident( item, ISFLAG_KNOW_TYPE ) + && item_type_known(item) && verbose) { description += "$"; @@ -1711,7 +1711,7 @@ static std::string describe_armour( const item_def &item, bool verbose ) { if (item_ident( item, ISFLAG_KNOW_PROPERTIES )) randart_descpr( description, item ); - else if (item_ident( item, ISFLAG_KNOW_TYPE )) + else if (item_type_known(item)) description += "$This armour may have some hidden properties.$"; } else @@ -2502,7 +2502,7 @@ static std::string describe_jewellery( const item_def &item, bool verbose) else if ((!is_random_artefact( item ) && get_ident_type( OBJ_JEWELLERY, item.sub_type ) != ID_KNOWN_TYPE) || (is_random_artefact( item ) - && !item_ident( item, ISFLAG_KNOW_TYPE ))) + && !item_type_known(item))) { description += "A piece of jewellery."; } @@ -2812,7 +2812,7 @@ static std::string describe_jewellery( const item_def &item, bool verbose) { if (item_ident( item, ISFLAG_KNOW_PROPERTIES )) randart_descpr( description, item ); - else if (item_ident( item, ISFLAG_KNOW_TYPE )) + else if (item_type_known(item)) { if (item.sub_type >= AMU_RAGE) description += "$This amulet may have hidden properties.$"; @@ -2840,7 +2840,7 @@ static std::string describe_staff( const item_def &item ) description.reserve(200); - if (item_ident( item, ISFLAG_KNOW_TYPE )) + if (item_type_known(item)) { // NB: the leading space is here {dlb} description += "This " + std::string( item_is_staff( item ) ? "staff " @@ -2994,7 +2994,7 @@ static std::string describe_misc_item( const item_def &item ) description.reserve(100); - if (item_ident( item, ISFLAG_KNOW_TYPE )) + if (item_type_known(item)) { switch (item.sub_type) { @@ -3177,7 +3177,7 @@ bool is_dumpable_artifact( const item_def &item, bool verbose) ret = item_ident( item, ISFLAG_KNOW_PROPERTIES ); } else if (item.base_type == OBJ_ARMOUR - && (verbose && item_ident( item, ISFLAG_KNOW_TYPE ))) + && (verbose && item_type_known(item))) { const int spec_ench = get_armour_ego_type( item ); ret = (spec_ench >= SPARM_RUNNING && spec_ench <= SPARM_PRESERVATION); diff --git a/crawl-ref/source/fight.cc b/crawl-ref/source/fight.cc index 7e27f8c1f8..b145002e2c 100644 --- a/crawl-ref/source/fight.cc +++ b/crawl-ref/source/fight.cc @@ -1332,7 +1332,7 @@ bool you_attack(int monster_attacked, bool unarmed_attacks) { dec_mp(STAFF_COST); - if (!item_ident( you.inv[weapon], ISFLAG_KNOW_TYPE )) + if (!item_type_known(you.inv[weapon])) { set_ident_flags( you.inv[weapon], ISFLAG_KNOW_TYPE ); strcpy(info, "You are wielding "); diff --git a/crawl-ref/source/food.cc b/crawl-ref/source/food.cc index c0bb37db97..5d42367102 100644 --- a/crawl-ref/source/food.cc +++ b/crawl-ref/source/food.cc @@ -159,7 +159,7 @@ static bool find_butchering_implement() { && can_cut_meat( you.inv[i] ) && you.inv[i].base_type == OBJ_WEAPONS && item_known_uncursed(you.inv[i]) - && item_ident( you.inv[i], ISFLAG_KNOW_TYPE ) + && item_type_known(you.inv[i]) && get_weapon_brand(you.inv[i]) != SPWPN_DISTORTION && can_wield( &you.inv[i] )) { diff --git a/crawl-ref/source/it_use3.cc b/crawl-ref/source/it_use3.cc index 4e0011e262..1835726131 100644 --- a/crawl-ref/source/it_use3.cc +++ b/crawl-ref/source/it_use3.cc @@ -504,8 +504,7 @@ bool evoke_wielded( void ) pract = (one_chance_in(5) ? 1 : 0); did_work = true; - if (!item_ident( you.inv[you.equip[EQ_WEAPON]], - ISFLAG_KNOW_TYPE )) + if (!item_type_known( you.inv[you.equip[EQ_WEAPON]] )) { set_ident_flags( you.inv[you.equip[EQ_WEAPON]], ISFLAG_KNOW_TYPE ); diff --git a/crawl-ref/source/item_use.cc b/crawl-ref/source/item_use.cc index 2e5743a9ea..9b74887cd5 100644 --- a/crawl-ref/source/item_use.cc +++ b/crawl-ref/source/item_use.cc @@ -2509,7 +2509,7 @@ void zap_wand(void) return; } - if (item_ident( you.inv[item_slot], ISFLAG_KNOW_TYPE )) + if (item_type_known( you.inv[item_slot] )) { if (you.inv[item_slot].sub_type == WAND_HASTING || you.inv[item_slot].sub_type == WAND_HEALING diff --git a/crawl-ref/source/itemname.cc b/crawl-ref/source/itemname.cc index 6b54bce4ed..da661eb885 100644 --- a/crawl-ref/source/itemname.cc +++ b/crawl-ref/source/itemname.cc @@ -151,7 +151,7 @@ const char *item_name( const item_def &item, char descrip, descrip = DESC_PLAIN; if (item_clas == OBJ_ORBS - || (item_ident( item, ISFLAG_KNOW_TYPE ) + || (item_type_known( item ) && ((item_clas == OBJ_MISCELLANY && item_typ == MISC_HORN_OF_GERYON) || (is_fixed_artefact( item ) @@ -393,7 +393,7 @@ static const char *item_name_2( if (is_fixed_artefact( item )) { - if (item_ident( item, ISFLAG_KNOW_TYPE )) + if (item_type_known( item )) { strncat(buff, (item.special == SPWPN_SINGING_SWORD) ? "Singing Sword" : @@ -471,7 +471,7 @@ static const char *item_name_2( brand = get_weapon_brand( item ); - if (item_ident( item, ISFLAG_KNOW_TYPE ) && !terse) + if (item_type_known(item) && !terse) { if (brand == SPWPN_VAMPIRICISM) strncat(buff, "vampiric ", ITEMNAME_SIZE ); @@ -480,7 +480,7 @@ static const char *item_name_2( standard_name_weap( item_typ, tmp_buff ); strncat( buff, tmp_buff, ITEMNAME_SIZE ); - if (item_ident( item, ISFLAG_KNOW_TYPE )) + if (item_type_known( item )) { switch (brand) { @@ -625,7 +625,7 @@ static const char *item_name_2( if (it_quant > 1) strncat(buff, "s", ITEMNAME_SIZE ); - if (item_ident( item, ISFLAG_KNOW_TYPE )) + if (item_type_known( item )) { strncat( buff, (brand == SPMSL_FLAME) ? ((terse) ? " (flame)" : " of flame") : @@ -720,7 +720,7 @@ static const char *item_name_2( sparm = get_armour_ego_type( item ); - if (item_ident( item, ISFLAG_KNOW_TYPE ) && sparm != SPARM_NORMAL) + if (item_type_known(item) && sparm != SPARM_NORMAL) { if (!terse) { @@ -778,8 +778,7 @@ static const char *item_name_2( // compacted 15 Apr 2000 {dlb}: case OBJ_WANDS: - if (id[ IDTYPE_WANDS ][item_typ] == ID_KNOWN_TYPE - || item_ident( item, ISFLAG_KNOW_TYPE )) + if (item_type_known(item)) { strncat(buff, "wand of ", ITEMNAME_SIZE ); strncat(buff, (item_typ == WAND_FLAME) ? "flame" : @@ -860,8 +859,7 @@ static const char *item_name_2( // compacted 15 Apr 2000 {dlb}: case OBJ_POTIONS: - if (id[ IDTYPE_POTIONS ][item_typ] == ID_KNOWN_TYPE - || item_ident( item, ISFLAG_KNOW_TYPE )) + if (item_type_known(item)) { strncat(buff, "potion", ITEMNAME_SIZE ); strncat(buff, (it_quant == 1) ? " " : "s ", ITEMNAME_SIZE); @@ -1026,8 +1024,7 @@ static const char *item_name_2( strncat(buff, "scroll", ITEMNAME_SIZE ); strncat(buff, (it_quant == 1) ? " " : "s ", ITEMNAME_SIZE); - if (id[ IDTYPE_SCROLLS ][item_typ] == ID_KNOWN_TYPE - || item_ident( item, ISFLAG_KNOW_TYPE )) + if (item_type_known(item)) { strncat(buff, "of ", ITEMNAME_SIZE ); strncat(buff, (item_typ == SCR_IDENTIFY) ? "identify" : @@ -1099,8 +1096,7 @@ static const char *item_name_2( break; } - if (id[ IDTYPE_JEWELLERY ][item_typ] == ID_KNOWN_TYPE - || item_ident( item, ISFLAG_KNOW_TYPE )) + if (item_type_known(item)) { if (item_ident( item, ISFLAG_KNOW_PLUSES ) @@ -1470,7 +1466,7 @@ static const char *item_name_2( if (it_quant > 1) strncat(buff, "s", ITEMNAME_SIZE ); - if (item_ident( item, ISFLAG_KNOW_TYPE )) + if (item_type_known(item)) strncat(buff, " of Zot", ITEMNAME_SIZE ); break; @@ -1479,7 +1475,7 @@ static const char *item_name_2( case MISC_DECK_OF_TRICKS: case MISC_DECK_OF_WONDERS: strncat(buff, "deck of ", ITEMNAME_SIZE ); - strncat(buff, !item_ident( item, ISFLAG_KNOW_TYPE ) ? "cards" : + strncat(buff, !item_type_known(item) ? "cards" : (item_typ == MISC_DECK_OF_WONDERS) ? "wonders" : (item_typ == MISC_DECK_OF_SUMMONINGS) ? "summonings" : (item_typ == MISC_DECK_OF_TRICKS) ? "tricks" : @@ -1492,7 +1488,7 @@ static const char *item_name_2( case MISC_CRYSTAL_BALL_OF_FIXATION: case MISC_CRYSTAL_BALL_OF_SEEING: strncat(buff, "crystal ball", ITEMNAME_SIZE ); - if (item_ident( item, ISFLAG_KNOW_TYPE )) + if (item_type_known(item)) { strncat(buff, " of ", ITEMNAME_SIZE ); strncat(buff, @@ -1505,69 +1501,69 @@ static const char *item_name_2( break; case MISC_BOX_OF_BEASTS: - if (item_ident( item, ISFLAG_KNOW_TYPE )) + if (item_type_known(item)) strncat(buff, "box of beasts", ITEMNAME_SIZE ); else strncat(buff, "small ebony casket", ITEMNAME_SIZE ); break; case MISC_EMPTY_EBONY_CASKET: - if (item_ident( item, ISFLAG_KNOW_TYPE )) + if (item_type_known(item)) strncat(buff, "empty ebony casket", ITEMNAME_SIZE ); else strncat(buff, "small ebony casket", ITEMNAME_SIZE ); break; case MISC_AIR_ELEMENTAL_FAN: - if (item_ident( item, ISFLAG_KNOW_TYPE )) + if (item_type_known(item)) strncat(buff, "air elemental ", ITEMNAME_SIZE ); strncat(buff, "fan", ITEMNAME_SIZE ); break; case MISC_LAMP_OF_FIRE: strncat(buff, "lamp", ITEMNAME_SIZE ); - if (item_ident( item, ISFLAG_KNOW_TYPE )) + if (item_type_known(item)) strncat(buff, " of fire", ITEMNAME_SIZE ); break; case MISC_LANTERN_OF_SHADOWS: - if (!item_ident( item, ISFLAG_KNOW_TYPE )) + if (!item_type_known(item)) strncat(buff, "bone ", ITEMNAME_SIZE ); strncat(buff, "lantern", ITEMNAME_SIZE ); - if (item_ident( item, ISFLAG_KNOW_TYPE )) + if (item_type_known(item)) strncat(buff, " of shadows", ITEMNAME_SIZE ); break; case MISC_HORN_OF_GERYON: - if (!item_ident( item, ISFLAG_KNOW_TYPE )) + if (!item_type_known(item)) strncat(buff, "silver ", ITEMNAME_SIZE ); strncat(buff, "horn", ITEMNAME_SIZE ); - if (item_ident( item, ISFLAG_KNOW_TYPE )) + if (item_type_known(item)) strncat(buff, " of Geryon", ITEMNAME_SIZE ); break; case MISC_DISC_OF_STORMS: - if (!item_ident( item, ISFLAG_KNOW_TYPE )) + if (!item_type_known(item)) strncat(buff, "grey ", ITEMNAME_SIZE ); strncat(buff, "disc", ITEMNAME_SIZE ); - if (item_ident( item, ISFLAG_KNOW_TYPE )) + if (item_type_known(item)) strncat(buff, " of storms", ITEMNAME_SIZE ); break; case MISC_STONE_OF_EARTH_ELEMENTALS: - if (!item_ident( item, ISFLAG_KNOW_TYPE )) + if (!item_type_known(item)) strncat(buff, "nondescript ", ITEMNAME_SIZE ); strncat(buff, "stone", ITEMNAME_SIZE ); - if (item_ident( item, ISFLAG_KNOW_TYPE )) + if (item_type_known(item)) strncat(buff, " of earth elementals", ITEMNAME_SIZE ); break; case MISC_BOTTLED_EFREET: - strncat(buff, (!item_ident( item, ISFLAG_KNOW_TYPE )) + strncat(buff, (!item_type_known(item)) ? "sealed bronze flask" : "bottled efreet", ITEMNAME_SIZE ); break; @@ -1584,7 +1580,7 @@ static const char *item_name_2( // compacted 15 Apr 2000 {dlb}: case OBJ_BOOKS: - if (!item_ident( item, ISFLAG_KNOW_TYPE )) + if (!item_type_known(item)) { char primary = (item.special / 10); char secondary = (item.special % 10); @@ -1681,7 +1677,7 @@ static const char *item_name_2( // compacted 15 Apr 2000 {dlb}: case OBJ_STAVES: - if (!item_ident( item, ISFLAG_KNOW_TYPE )) + if (!item_type_known(item)) { strncat(buff, (item.special == 0) ? "curved" : (item.special == 1) ? "glowing" : @@ -1718,7 +1714,7 @@ static const char *item_name_2( strncat( buff, (item_is_rod( item ) ? "rod" : "staff"), ITEMNAME_SIZE ); - if (item_ident( item, ISFLAG_KNOW_TYPE )) + if (item_type_known(item)) { strncat(buff, " of ", ITEMNAME_SIZE ); @@ -1749,7 +1745,7 @@ static const char *item_name_2( } if (item_is_rod( item ) - && item_ident( item, ISFLAG_KNOW_TYPE )) + && item_type_known(item)) { strncat( buff, " (", ITEMNAME_SIZE ); itoa( item.plus / ROD_CHARGE_MULT, tmp_quant, 10 ); @@ -1822,7 +1818,7 @@ static const char *item_name_2( } // end of switch? // Disambiguation - if (!terse && item_ident(item, ISFLAG_KNOW_TYPE)) + if (!terse && item_type_known(item)) { #define name_append(x) strncat(buff, x, ITEMNAME_SIZE) switch (item_clas) diff --git a/crawl-ref/source/itemprop.cc b/crawl-ref/source/itemprop.cc index aa875d9757..34ce306f2a 100644 --- a/crawl-ref/source/itemprop.cc +++ b/crawl-ref/source/itemprop.cc @@ -1445,7 +1445,7 @@ int weapon_ev_bonus( const item_def &wpn, int skill, size_type body, int dex, ret = 2 + (dex / 5); // weapons of reaching are naturally a bit longer/flexier - if (!hide_hidden || item_ident( wpn, ISFLAG_KNOW_TYPE )) + if (!hide_hidden || item_type_known( wpn )) { if (get_weapon_brand( wpn ) == SPWPN_REACHING) ret += 1; @@ -1543,7 +1543,7 @@ bool check_weapon_shape( const item_def &item, bool quiet, bool check_id ) { const int brand = get_weapon_brand( item ); - if ((!check_id || item_ident( item, ISFLAG_KNOW_TYPE )) + if ((!check_id || item_type_known( item )) && ((item.base_type == OBJ_WEAPONS && item.sub_type == WPN_BLESSED_BLADE) || brand == SPWPN_HOLY_WRATH diff --git a/crawl-ref/source/items.cc b/crawl-ref/source/items.cc index ff8ed47ef2..391e279508 100644 --- a/crawl-ref/source/items.cc +++ b/crawl-ref/source/items.cc @@ -2653,7 +2653,7 @@ void handle_time( long time_delta ) // and an appropriate other spell skill... is 1/20 too fast? if (you.equip[EQ_WEAPON] != -1 && you.inv[you.equip[EQ_WEAPON]].base_type == OBJ_STAVES - && !item_ident( you.inv[you.equip[EQ_WEAPON]], ISFLAG_KNOW_TYPE ) + && !item_type_known( you.inv[you.equip[EQ_WEAPON]] ) && one_chance_in(20)) { int total_skill = you.skills[SK_SPELLCASTING]; diff --git a/crawl-ref/source/player.cc b/crawl-ref/source/player.cc index b7dc9e30a1..47aa9a8633 100644 --- a/crawl-ref/source/player.cc +++ b/crawl-ref/source/player.cc @@ -459,7 +459,7 @@ int player_equip( int slot, int sub_type, bool calc_unid ) && you.inv[you.equip[EQ_WEAPON]].base_type == OBJ_STAVES && you.inv[you.equip[EQ_WEAPON]].sub_type == sub_type && (calc_unid || - item_ident(you.inv[you.equip[EQ_WEAPON]], ISFLAG_KNOW_TYPE))) + item_type_known(you.inv[you.equip[EQ_WEAPON]]))) { ret++; } @@ -519,7 +519,7 @@ int player_equip( int slot, int sub_type, bool calc_unid ) if (you.equip[slot] != -1 && you.inv[you.equip[slot]].sub_type == sub_type && (calc_unid || - item_ident(you.inv[you.equip[slot]], ISFLAG_KNOW_TYPE))) + item_type_known(you.inv[you.equip[slot]]))) { ret++; } diff --git a/crawl-ref/source/randart.cc b/crawl-ref/source/randart.cc index e0cbe0381a..7a33cd310b 100644 --- a/crawl-ref/source/randart.cc +++ b/crawl-ref/source/randart.cc @@ -1230,7 +1230,7 @@ const char *randart_name( const item_def &item ) { struct unrandart_entry *unrand = seekunrandart( item ); - return (item_ident(item, ISFLAG_KNOW_TYPE) ? unrand->name + return (item_type_known(item) ? unrand->name : unrand->unid_name); } @@ -1247,7 +1247,7 @@ const char *randart_name( const item_def &item ) push_rng_state(); seed_rng( seed ); - if (!item_ident( item, ISFLAG_KNOW_TYPE )) + if (!item_type_known(item)) { switch (random5(21)) { @@ -1324,7 +1324,7 @@ const char *randart_armour_name( const item_def &item ) { struct unrandart_entry *unrand = seekunrandart( item ); - return (item_ident(item, ISFLAG_KNOW_TYPE) ? unrand->name + return (item_type_known(item) ? unrand->name : unrand->unid_name); } @@ -1344,7 +1344,7 @@ const char *randart_armour_name( const item_def &item ) push_rng_state(); seed_rng( seed ); - if (!item_ident( item, ISFLAG_KNOW_TYPE )) + if (!item_type_known(item)) { switch (random5(21)) { @@ -1421,8 +1421,8 @@ const char *randart_ring_name( const item_def &item ) { struct unrandart_entry *unrand = seekunrandart( item ); - return (item_ident(item, ISFLAG_KNOW_TYPE) ? unrand->name - : unrand->unid_name); + return (item_type_known(item) ? unrand->name + : unrand->unid_name); } char st_p[ITEMNAME_SIZE]; @@ -1440,7 +1440,7 @@ const char *randart_ring_name( const item_def &item ) push_rng_state(); seed_rng( seed ); - if (!item_ident( item, ISFLAG_KNOW_TYPE )) + if (!item_type_known(item)) { temp_rand = random5(21); diff --git a/crawl-ref/source/shopping.cc b/crawl-ref/source/shopping.cc index 0ce327dd15..d69444caee 100644 --- a/crawl-ref/source/shopping.cc +++ b/crawl-ref/source/shopping.cc @@ -786,7 +786,7 @@ unsigned int item_value( item_def item, id_arr id, bool ident ) break; } - if (item_ident( item, ISFLAG_KNOW_TYPE )) + if (item_type_known(item)) { switch (get_weapon_brand( item )) { @@ -896,12 +896,12 @@ unsigned int item_value( item_def item, id_arr id, bool ident ) if (is_random_artefact( item )) { - if (item_ident( item, ISFLAG_KNOW_TYPE )) + if (item_type_known(item)) valued += (7 * randart_value( item )); else valued += 50; } - else if (item_ident( item, ISFLAG_KNOW_TYPE ) + else if (item_type_known(item) && get_equip_desc(item) != 0) { valued += 20; @@ -1062,7 +1062,7 @@ unsigned int item_value( item_def item, id_arr id, bool ident ) break; } - if (item_ident( item, ISFLAG_KNOW_TYPE )) + if (item_type_known(item)) { const int sparm = get_armour_ego_type( item ); switch (sparm) @@ -1149,12 +1149,12 @@ unsigned int item_value( item_def item, id_arr id, bool ident ) if (is_random_artefact( item )) { - if (item_ident( item, ISFLAG_KNOW_TYPE )) + if (item_type_known(item)) valued += (7 * randart_value( item )); else valued += 50; } - else if (item_ident( item, ISFLAG_KNOW_TYPE ) + else if (item_type_known(item) && get_equip_desc(item) != 0) { valued += 20; @@ -1504,7 +1504,7 @@ unsigned int item_value( item_def item, id_arr id, bool ident ) if (is_random_artefact(item)) { - if (item_ident(item, ISFLAG_KNOW_TYPE)) + if (item_type_known(item)) { if (valued < 0) valued = randart_value( item ) - 5; @@ -1522,7 +1522,7 @@ unsigned int item_value( item_def item, id_arr id, bool ident ) break; case OBJ_MISCELLANY: - if (item_ident( item, ISFLAG_KNOW_TYPE )) + if (item_type_known(item)) { switch (item.sub_type) { @@ -1577,12 +1577,12 @@ unsigned int item_value( item_def item, id_arr id, bool ident ) //case 10: break; case OBJ_BOOKS: - valued = 150 + (item_ident( item, ISFLAG_KNOW_TYPE ) + valued = 150 + (item_type_known(item) ? book_rarity(item.sub_type) * 50 : 0); break; case OBJ_STAVES: - if (!item_ident( item, ISFLAG_KNOW_TYPE )) + if (!item_type_known(item)) valued = 120; else if (item.sub_type == STAFF_SMITING || item.sub_type == STAFF_STRIKING diff --git a/crawl-ref/source/spl-book.cc b/crawl-ref/source/spl-book.cc index a28d6c3387..98d08ee2fe 100644 --- a/crawl-ref/source/spl-book.cc +++ b/crawl-ref/source/spl-book.cc @@ -1396,7 +1396,7 @@ int count_staff_spells(const item_def &item, bool need_id) if (item.base_type != OBJ_STAVES) return (-1); - if (need_id && !item_ident( item, ISFLAG_KNOW_TYPE )) + if (need_id && !item_type_known(item)) return (0); const int stype = item.sub_type; @@ -1458,7 +1458,7 @@ int staff_spell( int staff ) return (-1); } - if (!item_ident( you.inv[staff], ISFLAG_KNOW_TYPE )) + if (!item_type_known(you.inv[staff])) { set_ident_flags( you.inv[staff], ISFLAG_KNOW_TYPE ); you.wield_change = true; diff --git a/crawl-ref/source/spl-cast.cc b/crawl-ref/source/spl-cast.cc index 2ab5141c45..887cba6fd1 100644 --- a/crawl-ref/source/spl-cast.cc +++ b/crawl-ref/source/spl-cast.cc @@ -695,7 +695,7 @@ void spellcasting_side_effects(int spc2, bool idonly = false) if (you.equip[EQ_WEAPON] != -1 && item_is_staff( you.inv[you.equip[EQ_WEAPON]] ) - && !item_ident( you.inv[you.equip[EQ_WEAPON]], ISFLAG_KNOW_TYPE )) + && !item_type_known( you.inv[you.equip[EQ_WEAPON]] )) { switch (you.inv[you.equip[EQ_WEAPON]].sub_type) { |