item_stack_summary_minimum option. Artefacts and glowing/runed items get yellow and white, respectively. Also, the entire item list on the floor will be displayed if it fits onto the screen (and not if there are five or less items, as before.)
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1699 c06c8d41-db1a-0410-9941-cceddc491573
VNIAJEGE3PYE6F6EAMCQDWMAS52EQTKJUPAFXK7ARCITZ326WTTQC
DCBP5ZRHDECNNIN5JB57IOHNJTM3TFQTM3LRC46DUNQALKXYQKNQC
2WNUWTZNE66IUUTQ4NW3RN7P2MFUKBXPD265M5CTZCDKC56VQONQC
AXQJOPTECRU3ECV3ICDUR6SGBIOIZT5HIOSJ77MRLF5ECGOITMDQC
EOMCPVNQLX3IMLC46EAO67DPBH5KEG2FQTPBLGU62HIRWA3UQ7XQC
K2CS6TCX2NDVL2ASEHGP4J4K4IJ6FP3ANNKTSIWVG43HPYSBX6ZQC
5CNYJQGEILRX2TAYBWMVECJ6D4OPV2CD6YPDIERS2SR77Z4LTZPAC
77H4BWWPPGLM3PLZH4QTAJRXIZTSDVNCOKZE223I437FN2UJ34RQC
SGR2P5BGJIJHVSSQYQHWS4ORLVHQBZTDES3D4BFC6SVAQXSKENNQC
RPOZZWKG5GLPHVZZ7ZKMKS64ZMV2LDCQSARBJFJ6FZOTOKCQO7FAC
74LQ7JXVLAFSHLI7LCBKFX47CNTYSKGUQSXNX5FCIUIGCC2JTR3QC
CIPVRZGLOZHCERK6YPOBV3P2E4IAB4H6D5EHLRQE2O5E4P4VCBUAC
YCL3W2PFE6ILTGBFODCSXNPDIA46KVSZP2TI7HDMYAOEJT65RIEAC
YWYXUCZKGNIAWAUKUESIPFCAL5HZOKOEWHUEUW7X4DMAX2HG2FSAC
RREJL4WZKWFEMA62AC5G5UDTOXMW4UULIQXVA5RPFASPODMHQZ7AC
SDLKLUNFGVKDS55DDJZCBAVIB7NL3RRYPTACAY65SCUQKV6APFSAC
U4PJNTYRHCH5UT4JJWFDCLSZSAJW7DSWWNIJ2R464VQUZCFN3T6QC
V6REAY6RCAG2QQ4BO54GHYOVTNCYHTLERJCIZJPSANXFBINZOTXAC
XYJ5Y635KCRCTL2BFPP53NWQRK3NUHS6T3ARPIXV5A3CHWBW7VCQC
RVST2QHYJ757ZHK4AUJ5NGPDZ44AD6RVFVXYPKQIBJXZBDNUCHXQC
EHSY6DVGUMI6C67WKET3GDJVLWJWGYBYQONNDK5JVT7BCTHBEZVAC
// 2 - artifact, 1 - glowing/runed, 0 - mundane
static int item_name_specialness(const item_def& item)
{
// All jewellery is worth looking at.
// And we can always tell from the name if it's an artefact.
if (item.base_type == OBJ_JEWELLERY )
return ( is_artefact(item) ? 2 : 1 );
if (item.base_type != OBJ_WEAPONS && item.base_type != OBJ_ARMOUR &&
item.base_type != OBJ_MISSILES)
return 0;
if (item_type_known(item))
{
if ( is_artefact(item) )
return 2;
// XXX Unite with l_item_branded() in clua.cc
bool branded = false;
switch (item.base_type)
{
case OBJ_WEAPONS:
branded = get_weapon_brand(item) != SPWPN_NORMAL;
break;
case OBJ_ARMOUR:
branded = get_armour_ego_type(item) != SPARM_NORMAL;
break;
case OBJ_MISSILES:
branded = get_ammo_brand(item) != SPMSL_NORMAL;
break;
default:
break;
}
return ( branded ? 1 : 0 );
}
if ( item.base_type == OBJ_MISSILES )
return 0; // missiles don't get name descriptors
std::string itname = item.name(DESC_PLAIN, false, false, false);
lowercase(itname);
const bool item_runed = itname.find("runed ") != std::string::npos;
const bool heav_runed = itname.find("heavily ") != std::string::npos;
const bool item_glows = itname.find("glowing") != std::string::npos;
if ( item_glows || (item_runed && !heav_runed) )
return 1;
// You can tell artefacts, because they'll have a description which
// rules out anything else.
// XXX Fixedarts and unrandarts might upset the apple-cart, though.
if ( is_artefact(item) )
return 2;
return 0;
}
for ( int objl = igrd[you.x_pos][you.y_pos]; objl != NON_ITEM;
objl = mitm[objl].link )
{
if ( invisible_to_player(mitm[objl]) )
continue;
std::ostream& strm = msg::streams(MSGCH_FLOOR_ITEMS);
if (mitm[objl].base_type == OBJ_GOLD)
{
itoa(mitm[objl].quantity, temp_quant, 10);
strcpy(item_show[counter], temp_quant);
strcat(item_show[counter], " gold piece");
if (mitm[objl].quantity > 1)
strcat(item_show[counter], "s");
}
else
{
strcpy(item_show[counter], mitm[objl].name(DESC_NOCAP_A).c_str());
}
if (items.size() == 0)
{
if ( verbose )
strm << "There are no items here." << std::endl;
return;
mprf("You see here %s.", item_show[counter_max]); // remember 'an'.
counter++;
counter_max = 0; // to skip next part.
strm << "You see here " << items[0]->name(DESC_NOCAP_A)
<< '.' << std::endl;
return;
mpr("Things that are here:");
std::vector<unsigned short int> item_chars;
for ( unsigned int i = 0; i < items.size() && i < 50; ++i )
{
unsigned glyph_char;
unsigned short glyph_col;
get_item_glyph( items[i], &glyph_char, &glyph_col );
item_chars.push_back( glyph_char * 0x100 +
(10 - item_name_specialness(*(items[i]))) );
}
std::sort(item_chars.begin(), item_chars.end());
// this is before the strcpy because item_show start at 1, not 0.
counter++;
mpr(item_show[counter]);
const int specialness = 10 - (item_chars[i] % 0x100);
if ( specialness != cur_state )
{
switch ( specialness )
{
case 2: out_string += "<yellow>"; break; // artefact
case 1: out_string += "<white>"; break; // glowing/runed
case 0: out_string += "<darkgrey>"; break; // mundane
}
cur_state = specialness;
}
out_string += static_cast<unsigned char>(item_chars[i] / 0x100);
if (i + 1 < item_chars.size() &&
(item_chars[i] / 0x100) != (item_chars[i+1] / 0x100))
out_string += ' ';
mpr("There are several objects here.");
if ( !done_init_line )
strm << "Things that are here:" << std::endl;
for ( unsigned int i = 0; i < items.size(); ++i )
strm << items[i]->name(DESC_NOCAP_A) << std::endl;
}
else if ( !done_init_line )
strm << "There are many items here." << std::endl;
if ( items.size() > 5 )
item_stack_summary_minimum = 5
If you step over a stack with this number or more of items in it,
the first description line will contain a summary of all the
items in the stack (up to 50 items), in a format which looks
like this:
Items here: !! """ % ( )))))) [[[
Known artefacts will be coloured in yellow; glowing or runed
items will be in white.