git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1376 c06c8d41-db1a-0410-9941-cceddc491573
VNHFP63ZLLZU3A3PLXP4BITX57DUIYDHFOHQYK3BOBHV3S64G26QC
2KTJHQUX2LTU2BCLS5YXVRRKMOYKKIZAPF2LBKORFGSHEN5IO3IAC
K2CS6TCX2NDVL2ASEHGP4J4K4IJ6FP3ANNKTSIWVG43HPYSBX6ZQC
RPOZZWKG5GLPHVZZ7ZKMKS64ZMV2LDCQSARBJFJ6FZOTOKCQO7FAC
CIPVRZGLOZHCERK6YPOBV3P2E4IAB4H6D5EHLRQE2O5E4P4VCBUAC
SDLKLUNFGVKDS55DDJZCBAVIB7NL3RRYPTACAY65SCUQKV6APFSAC
HDLNRHAMFVDM4QCZMY6COBYZ35ODPR5PONT4UE77UAZ7GEE2FLHQC
QVVC7AYGVA6U64PTNA7L27422NLMO327P22BQKXEVIMPZHIHO7MQC
6NTCURCJQA4PBNDD5VGFBQAF5QCZZPLWRDZTA65R3EOGMVA475IAC
TZ55IZNANEJO2WDTKYWVLY2W2VV6BR7WKIN7XLNISAMMFT6LG2WQC
3A3OAIFRFU3IHF6SDNDPCN3XYOFYIBYCEYJAXAFASCFDY76SMFXQC
case DESC_CAP_THE:
strncat(buff, "The ", ITEMNAME_SIZE );
break;
case DESC_NOCAP_THE:
strncat(buff, "the ", ITEMNAME_SIZE );
break;
case DESC_CAP_THE: buff << "The "; break;
case DESC_NOCAP_THE: buff << "the "; break;
case DESC_CAP_YOUR: buff << "Your "; break;
case DESC_NOCAP_YOUR: buff << "your "; break;
case DESC_NOCAP_ITS: buff << "its "; break;
case DESC_CAP_THE:
strncat(buff, "The ", ITEMNAME_SIZE );
break;
case DESC_NOCAP_THE:
strncat(buff, "the ", ITEMNAME_SIZE );
break;
case DESC_CAP_A:
strncat(buff, "A", ITEMNAME_SIZE );
case DESC_CAP_THE: buff << "The "; break;
case DESC_NOCAP_THE: buff << "the "; break;
case DESC_CAP_A: buff << (startvowel ? "An " : "A "); break;
if (is_vowel(itm_name[0]))
{
strncat(buff, "n", ITEMNAME_SIZE );
}
strncat(buff, " ", ITEMNAME_SIZE );
break; // A/An
case DESC_CAP_YOUR: buff << "Your "; break;
case DESC_NOCAP_YOUR: buff << "your "; break;
case DESC_NOCAP_ITS: buff << "its "; break;
if (is_vowel(itm_name[0]))
{
strncat(buff, "n", ITEMNAME_SIZE );
}
strncat(buff, " ", ITEMNAME_SIZE );
break; // a/an
case DESC_CAP_YOUR:
strncat(buff, "Your ", ITEMNAME_SIZE );
break;
case DESC_NOCAP_YOUR:
strncat(buff, "your ", ITEMNAME_SIZE );
break;
case DESC_NOCAP_ITS:
strncat(buff, "its ", ITEMNAME_SIZE );
break;
strncat(buff, "tried, ", 10);
strncat( buff, this->inscription.c_str(), ITEMNAME_SIZE );
strncat( buff, "}", 1 );
buff << "tried, ";
buff << this->inscription << "}";
static const char* fixed_artefact_name( const item_def& item, bool ident )
{
if (ident)
{
switch (item.special)
{
case SPWPN_SINGING_SWORD: return "Singing Sword";
case SPWPN_WRATH_OF_TROG: return "Wrath of Trog";
case SPWPN_SCYTHE_OF_CURSES: return "Scythe of Curses";
case SPWPN_MACE_OF_VARIABILITY: return "Mace of Variability";
case SPWPN_GLAIVE_OF_PRUNE: return "Glaive of Prune";
case SPWPN_SCEPTRE_OF_TORMENT: return "Sceptre of Torment";
case SPWPN_SWORD_OF_ZONGULDROK: return "Sword of Zonguldrok";
case SPWPN_SWORD_OF_CEREBOV: return "Sword of Cerebov";
case SPWPN_STAFF_OF_DISPATER: return "Staff of Dispater";
case SPWPN_SCEPTRE_OF_ASMODEUS: return "Sceptre of Asmodeus";
case SPWPN_SWORD_OF_POWER: return "Sword of Power";
case SPWPN_KNIFE_OF_ACCURACY: return "Knife of Accuracy";
case SPWPN_STAFF_OF_OLGREB: return "Staff of Olgreb";
case SPWPN_VAMPIRES_TOOTH: return "Vampire's Tooth";
case SPWPN_STAFF_OF_WUCAD_MU: return "Staff of Wucad Mu";
default: return "Brodale's Buggy Bola";
}
}
else
{
switch (item.special)
{
case SPWPN_SINGING_SWORD: return "golden long sword";
case SPWPN_WRATH_OF_TROG: return "bloodstained battleaxe";
case SPWPN_SCYTHE_OF_CURSES: return "warped scythe";
case SPWPN_MACE_OF_VARIABILITY: return "shimmering mace";
case SPWPN_GLAIVE_OF_PRUNE: return "purple glaive";
case SPWPN_SCEPTRE_OF_TORMENT: return "jeweled golden mace";
case SPWPN_SWORD_OF_ZONGULDROK: return "bone long sword";
case SPWPN_SWORD_OF_CEREBOV: return "great serpentine sword";
case SPWPN_STAFF_OF_DISPATER: return "golden staff";
case SPWPN_SCEPTRE_OF_ASMODEUS: return "ruby sceptre";
case SPWPN_SWORD_OF_POWER: return "chunky great sword";
case SPWPN_KNIFE_OF_ACCURACY: return "thin dagger";
case SPWPN_STAFF_OF_OLGREB: return "green glowing staff";
case SPWPN_VAMPIRES_TOOTH: return "ivory dagger";
case SPWPN_STAFF_OF_WUCAD_MU: return "ephemeral quarterstaff";
default: return "buggy bola";
}
}
}
static const char* armour_ego_name( special_armour_type sparm, bool terse )
{
if (!terse)
{
switch ( sparm )
{
case SPARM_RUNNING: return "running";
case SPARM_FIRE_RESISTANCE: return "fire resistance";
case SPARM_COLD_RESISTANCE: return "cold resistance";
case SPARM_POISON_RESISTANCE: return "poison resistance";
case SPARM_SEE_INVISIBLE: return "see invisible";
case SPARM_DARKNESS: return "darkness";
case SPARM_STRENGTH: return "strength";
case SPARM_DEXTERITY: return "dexterity";
case SPARM_INTELLIGENCE: return "intelligence";
case SPARM_PONDEROUSNESS: return "ponderousness";
case SPARM_LEVITATION: return "levitation";
case SPARM_MAGIC_RESISTANCE: return "magic resistance";
case SPARM_PROTECTION: return "protection";
case SPARM_STEALTH: return "stealth";
case SPARM_RESISTANCE: return "resistance";
case SPARM_POSITIVE_ENERGY: return "positive energy";
case SPARM_ARCHMAGI: return "the Archmagi";
case SPARM_PRESERVATION: return "preservation";
default: return "bugginess";
}
}
else
{
switch (sparm)
{
case SPARM_RUNNING: return " (run)";
case SPARM_FIRE_RESISTANCE: return " (R-fire)";
case SPARM_COLD_RESISTANCE: return " (R-cold)";
case SPARM_POISON_RESISTANCE: return " (R-poison)";
case SPARM_SEE_INVISIBLE: return " (see invis)";
case SPARM_DARKNESS: return " (darkness)";
case SPARM_STRENGTH: return " (str)";
case SPARM_DEXTERITY: return " (dex)";
case SPARM_INTELLIGENCE: return " (int)";
case SPARM_PONDEROUSNESS: return " (ponderous)";
case SPARM_LEVITATION: return " (levitate)";
case SPARM_MAGIC_RESISTANCE: return " (R-magic)";
case SPARM_PROTECTION: return " (protect)";
case SPARM_STEALTH: return " (stealth)";
case SPARM_RESISTANCE: return " (resist)";
case SPARM_POSITIVE_ENERGY: return " (R-neg)"; // ha ha
case SPARM_ARCHMAGI: return " (Archmagi)";
case SPARM_PRESERVATION: return " (preserve)";
default: return " (buggy)";
}
}
}
static const char* wand_type_name(int wandtype)
{
switch (static_cast<wand_type>(wandtype))
{
case WAND_FLAME: return "flame";
case WAND_FROST: return "frost";
case WAND_SLOWING: return "slowing";
case WAND_HASTING: return "hasting";
case WAND_MAGIC_DARTS: return "magic darts";
case WAND_HEALING: return "healing";
case WAND_PARALYSIS: return "paralysis";
case WAND_FIRE: return "fire";
case WAND_COLD: return "cold";
case WAND_CONFUSION: return "confusion";
case WAND_INVISIBILITY: return "invisibility";
case WAND_DIGGING: return "digging";
case WAND_FIREBALL: return "fireball";
case WAND_TELEPORTATION: return "teleportation";
case WAND_LIGHTNING: return "lightning";
case WAND_POLYMORPH_OTHER: return "polymorph other";
case WAND_ENSLAVEMENT: return "enslavement";
case WAND_DRAINING: return "draining";
case WAND_RANDOM_EFFECTS: return "random effects";
case WAND_DISINTEGRATION: return "disintegration";
default: return "bugginess";
}
}
static const char* wand_secondary_string(int s)
{
switch (s)
{
case 0: return "";
case 1: return "jeweled ";
case 2: return "curved ";
case 3: return "long ";
case 4: return "short ";
case 5: return "twisted ";
case 6: return "crooked ";
case 7: return "forked ";
case 8: return "shiny ";
case 9: return "blackened ";
case 10: return "tapered ";
case 11: return "glowing ";
case 12: return "worn ";
case 13: return "encrusted ";
case 14: return "runed ";
case 15: return "sharpened ";
default: return "buggily ";
}
}
static const char* wand_primary_string(int p)
{
switch (p)
{
case 0: return "iron";
case 1: return "brass";
case 2: return "bone";
case 3: return "wooden";
case 4: return "copper";
case 5: return "gold";
case 6: return "silver";
case 7: return "bronze";
case 8: return "ivory";
case 9: return "glass";
case 10: return "lead";
case 11: return "plastic";
default: return "buggy";
}
}
static const char* potion_type_name(int potiontype)
{
switch ( static_cast<potion_type>(potiontype) )
{
case POT_HEALING: return "healing";
case POT_HEAL_WOUNDS: return "heal wounds";
case POT_SPEED: return "speed";
case POT_MIGHT: return "might";
case POT_GAIN_STRENGTH: return "gain strength";
case POT_GAIN_DEXTERITY: return "gain dexterity";
case POT_GAIN_INTELLIGENCE: return "gain intelligence";
case POT_LEVITATION: return "levitation";
case POT_POISON: return "poison";
case POT_SLOWING: return "slowing";
case POT_PARALYSIS: return "paralysis";
case POT_CONFUSION: return "confusion";
case POT_INVISIBILITY: return "invisibility";
case POT_PORRIDGE: return "porridge";
case POT_DEGENERATION: return "degeneration";
case POT_DECAY: return "decay";
case POT_WATER: return "water";
case POT_EXPERIENCE: return "experience";
case POT_MAGIC: return "magic";
case POT_RESTORE_ABILITIES: return "restore abilities";
case POT_STRONG_POISON: return "strong poison";
case POT_BERSERK_RAGE: return "berserk rage";
case POT_CURE_MUTATION: return "cure mutation";
case POT_MUTATION: return "mutation";
default: return "bugginess";
}
}
static const char* scroll_type_name(int scrolltype)
{
switch ( static_cast<scroll_type>(scrolltype) )
{
case SCR_IDENTIFY: return "identify";
case SCR_TELEPORTATION: return "teleportation";
case SCR_FEAR: return "fear";
case SCR_NOISE: return "noise";
case SCR_REMOVE_CURSE: return "remove curse";
case SCR_DETECT_CURSE: return "detect curse";
case SCR_SUMMONING: return "summoning";
case SCR_ENCHANT_WEAPON_I: return "enchant weapon I";
case SCR_ENCHANT_ARMOUR: return "enchant armour";
case SCR_TORMENT: return "torment";
case SCR_RANDOM_USELESSNESS: return "random uselessness";
case SCR_CURSE_WEAPON: return "curse weapon";
case SCR_CURSE_ARMOUR: return "curse armour";
case SCR_IMMOLATION: return "immolation";
case SCR_BLINKING: return "blinking";
case SCR_PAPER: return "paper";
case SCR_MAGIC_MAPPING: return "magic mapping";
case SCR_FORGETFULNESS: return "forgetfulness";
case SCR_ACQUIREMENT: return "acquirement";
case SCR_ENCHANT_WEAPON_II: return "enchant weapon II";
case SCR_VORPALISE_WEAPON: return "vorpalise weapon";
case SCR_RECHARGING: return "recharging";
case SCR_ENCHANT_WEAPON_III: return "enchant weapon III";
default: return "bugginess";
}
}
static const char* jewellery_type_name(int jeweltype)
{
switch (static_cast<jewellery_type>(jeweltype))
{
case RING_REGENERATION: return "ring of regeneration";
case RING_PROTECTION: return "ring of protection";
case RING_PROTECTION_FROM_FIRE: return "ring of protection from fire";
case RING_POISON_RESISTANCE: return "ring of poison resistance";
case RING_PROTECTION_FROM_COLD: return "ring of protection from cold";
case RING_STRENGTH: return "ring of strength";
case RING_SLAYING: return "ring of slaying";
case RING_SEE_INVISIBLE: return "ring of see invisible";
case RING_INVISIBILITY: return "ring of invisibility";
case RING_HUNGER: return "ring of hunger";
case RING_TELEPORTATION: return "ring of teleportation";
case RING_EVASION: return "ring of evasion";
case RING_SUSTAIN_ABILITIES: return "ring of sustain abilities";
case RING_SUSTENANCE: return "ring of sustenance";
case RING_DEXTERITY: return "ring of dexterity";
case RING_INTELLIGENCE: return "ring of intelligence";
case RING_WIZARDRY: return "ring of wizardry";
case RING_MAGICAL_POWER: return "ring of magical power";
case RING_LEVITATION: return "ring of levitation";
case RING_LIFE_PROTECTION: return "ring of life protection";
case RING_PROTECTION_FROM_MAGIC: return "ring of protection from magic";
case RING_FIRE: return "ring of fire";
case RING_ICE: return "ring of ice";
case RING_TELEPORT_CONTROL: return "ring of teleport control";
case AMU_RAGE: return "amulet of rage";
case AMU_RESIST_SLOW: return "amulet of resist slowing";
case AMU_CLARITY: return "amulet of clarity";
case AMU_WARDING: return "amulet of warding";
case AMU_RESIST_CORROSION: return "amulet of resist corrosion";
case AMU_THE_GOURMAND: return "amulet of the gourmand";
case AMU_CONSERVATION: return "amulet of conservation";
case AMU_CONTROLLED_FLIGHT: return "amulet of controlled flight";
case AMU_INACCURACY: return "amulet of inaccuracy";
case AMU_RESIST_MUTATION: return "amulet of resist mutation";
default: return "buggy jewellery";
}
}
static const char* ring_secondary_string(int s)
{
switch (s)
{
case 1: return "encrusted ";
case 2: return "glowing ";
case 3: return "tubular ";
case 4: return "runed ";
case 5: return "blackened ";
case 6: return "scratched ";
case 7: return "small ";
case 8: return "large ";
case 9: return "twisted ";
case 10: return "shiny ";
case 11: return "notched ";
case 12: return "knobbly ";
default: return "";
}
}
static const char* ring_primary_string(int p)
{
switch (p)
{
case 0: return "wooden";
case 1: return "silver";
case 2: return "golden";
case 3: return "iron";
case 4: return "steel";
case 5: return "bronze";
case 6: return "brass";
case 7: return "copper";
case 8: return "granite";
case 9: return "ivory";
case 10: return "bone";
case 11: return "marble";
case 12: return "jade";
case 13: return "glass";
default: return "buggy";
}
}
static const char* amulet_secondary_string(int s)
{
switch (s)
{
case 0: return "dented ";
case 1: return "square ";
case 2: return "thick ";
case 3: return "thin ";
case 4: return "runed ";
case 5: return "blackened ";
case 6: return "glowing ";
case 7: return "small ";
case 8: return "large ";
case 9: return "twisted ";
case 10: return "tiny ";
case 11: return "triangular ";
case 12: return "lumpy ";
default: return "";
}
}
static const char* amulet_primary_string(int p)
{
switch (p)
{
case 0: return "zirconium";
case 1: return "sapphire";
case 2: return "golden";
case 3: return "emerald";
case 4: return "garnet";
case 5: return "bronze";
case 6: return "brass";
case 7: return "copper";
case 8: return "ruby";
case 9: return "ivory";
case 10: return "bone";
case 11: return "platinum";
case 12: return "jade";
case 13: return "plastic";
default: return "buggy";
}
}
static const char* rune_type_name(int p)
{
switch (static_cast<rune_type>(p))
{
case RUNE_DIS: return "iron";
case RUNE_GEHENNA: return "obsidian";
case RUNE_COCYTUS: return "icy";
case RUNE_TARTARUS: return "bone";
case RUNE_SLIME_PITS: return "slimy";
case RUNE_VAULTS: return "silver";
case RUNE_SNAKE_PIT: return "serpentine";
case RUNE_ELVEN_HALLS: return "elven";
case RUNE_TOMB: return "golden";
case RUNE_SWAMP: return "decaying";
case RUNE_ISLANDS: return "liquid";
// pandemonium and abyss runes:
case RUNE_DEMONIC: return "demonic";
case RUNE_ABYSSAL: return "abyssal";
// special pandemonium runes:
case RUNE_MNOLEG: return "glowing";
case RUNE_LOM_LOBON: return "magical";
case RUNE_CEREBOV: return "fiery";
case RUNE_GLOORX_VLOQ: return "dark";
default: return "buggy";
}
}
static const char* misc_type_name(int type, bool known)
{
if (known)
{
switch ( static_cast<misc_item_type>(type) )
{
case MISC_DECK_OF_POWER: return "deck of power";
case MISC_DECK_OF_SUMMONINGS: return "deck of summonings";
case MISC_DECK_OF_TRICKS: return "deck of tricks";
case MISC_DECK_OF_WONDERS: return "deck of wonders";
case MISC_CRYSTAL_BALL_OF_ENERGY: return "crystal ball of energy";
case MISC_CRYSTAL_BALL_OF_FIXATION: return "crystal ball of fixation";
case MISC_CRYSTAL_BALL_OF_SEEING: return "crystal ball of seeing";
case MISC_BOX_OF_BEASTS: return "box of beasts";
case MISC_EMPTY_EBONY_CASKET: return "empty ebony casket";
case MISC_AIR_ELEMENTAL_FAN: return "air elemental fan";
case MISC_LAMP_OF_FIRE: return "lamp of fire";
case MISC_LANTERN_OF_SHADOWS: return "lantern of shadows";
case MISC_HORN_OF_GERYON: return "horn of Geryon";
case MISC_DISC_OF_STORMS: return "disc of storms";
case MISC_STONE_OF_EARTH_ELEMENTALS:
return "stone of earth elementals";
case MISC_BOTTLED_EFREET: return "bottled efreet";
case MISC_PORTABLE_ALTAR_OF_NEMELEX:
return "portable altar of Nemelex";
case MISC_RUNE_OF_ZOT:
case NUM_MISCELLANY:
return "buggy miscellaneous item";
}
}
else
{
switch ( static_cast<misc_item_type>(type) )
{
case MISC_DECK_OF_POWER:
case MISC_DECK_OF_SUMMONINGS:
case MISC_DECK_OF_TRICKS:
case MISC_DECK_OF_WONDERS:
return "deck of cards";
case MISC_CRYSTAL_BALL_OF_ENERGY:
case MISC_CRYSTAL_BALL_OF_FIXATION:
case MISC_CRYSTAL_BALL_OF_SEEING:
return "crystal ball";
case MISC_BOX_OF_BEASTS:
case MISC_EMPTY_EBONY_CASKET:
return "small ebony casket";
case MISC_AIR_ELEMENTAL_FAN: return "gauzy fan";
case MISC_LAMP_OF_FIRE: return "blazing lamp";
case MISC_LANTERN_OF_SHADOWS: return "bone lantern";
case MISC_HORN_OF_GERYON: return "silver horn";
case MISC_DISC_OF_STORMS: return "grey disc";
case MISC_STONE_OF_EARTH_ELEMENTALS: return "nondescript stone";
case MISC_BOTTLED_EFREET: return "sealed bronze flask";
case MISC_PORTABLE_ALTAR_OF_NEMELEX:
return "portable altar of Nemelex";
case MISC_RUNE_OF_ZOT:
case NUM_MISCELLANY:
return "buggy miscellaneous item";
}
}
return "very buggy miscellaneous item";
}
static const char* book_secondary_string(int s)
{
switch (s)
{
case 0: return "";
case 1: return "chunky ";
case 2: return "thick ";
case 3: return "thin ";
case 4: return "wide ";
case 5: return "glowing ";
case 6: return "dog-eared ";
case 7: return "oblong ";
case 8: return "runed ";
case 9: return "";
case 10: return "";
case 11: return "";
default: return "buggily ";
}
}
static const char* book_primary_string(int p)
{
switch (p)
{
case 0: return "paperback ";
case 1: return "hardcover ";
case 2: return "leatherbound ";
case 3: return "metal-bound ";
case 4: return "papyrus ";
case 5: return "";
case 6: return "";
default: return "buggy ";
}
}
static const char* book_type_name(int booktype)
{
switch ( static_cast<book_type>(booktype) )
{
case BOOK_MINOR_MAGIC_I:
case BOOK_MINOR_MAGIC_II:
case BOOK_MINOR_MAGIC_III:
return "Minor Magic";
case BOOK_CONJURATIONS_I:
case BOOK_CONJURATIONS_II:
return "Conjurations";
case BOOK_FLAMES: return "Flames";
case BOOK_FROST: return "Frost";
case BOOK_SUMMONINGS: return "Summonings";
case BOOK_FIRE: return "Fire";
case BOOK_ICE: return "Ice";
case BOOK_SURVEYANCES: return "Surveyances";
case BOOK_SPATIAL_TRANSLOCATIONS: return "Spatial Translocations";
case BOOK_ENCHANTMENTS: return "Enchantments";
case BOOK_TEMPESTS: return "the Tempests";
case BOOK_DEATH: return "Death";
case BOOK_HINDERANCE: return "Hinderance";
case BOOK_CHANGES: return "Changes";
case BOOK_TRANSFIGURATIONS: return "Transfigurations";
case BOOK_PRACTICAL_MAGIC: return "Practical Magic";
case BOOK_WAR_CHANTS: return "War Chants";
case BOOK_CLOUDS: return "Clouds";
case BOOK_HEALING: return "Healing";
case BOOK_NECROMANCY: return "Necromancy";
case BOOK_CALLINGS: return "Callings";
case BOOK_CHARMS: return "Charms";
case BOOK_DEMONOLOGY: return "Demonology";
case BOOK_AIR: return "Air";
case BOOK_SKY: return "the Sky";
case BOOK_DIVINATIONS: return "Divinations";
case BOOK_WARP: return "the Warp";
case BOOK_ENVENOMATIONS: return "Envenomations";
case BOOK_ANNIHILATIONS: return "Annihilations";
case BOOK_UNLIFE: return "Unlife";
case BOOK_CONTROL: return "Control";
case BOOK_MUTATIONS: return "Morphology";
case BOOK_TUKIMA: return "Tukima";
case BOOK_GEOMANCY: return "Geomancy";
case BOOK_EARTH: return "the Earth";
case BOOK_WIZARDRY: return "Wizardry";
case BOOK_POWER: return "Power";
case BOOK_CANTRIPS: return "Cantrips";
case BOOK_PARTY_TRICKS: return "Party Tricks";
case BOOK_STALKING: return "Stalking";
default: return "Bugginess";
}
}
static const char* staff_primary_string(int p)
{
switch (p)
{
case 0: return "curved";
case 1: return "glowing";
case 2: return "thick";
case 3: return "thin";
case 4: return "long";
case 5: return "twisted";
case 6: return "jeweled";
case 7: return "runed";
case 8: return "smoking";
case 9: return "gnarled";
default: return "buggy";
}
}
static const char* staff_type_name(int stafftype)
{
switch (static_cast<stave_type>(stafftype))
{
// staves
case STAFF_WIZARDRY: return "wizardry";
case STAFF_POWER: return "power";
case STAFF_FIRE: return "fire";
case STAFF_COLD: return "cold";
case STAFF_POISON: return "poison";
case STAFF_ENERGY: return "energy";
case STAFF_DEATH: return "death";
case STAFF_CONJURATION: return "conjuration";
case STAFF_ENCHANTMENT: return "enchantment";
case STAFF_SMITING: return "smiting";
case STAFF_STRIKING: return "striking";
case STAFF_WARDING: return "warding";
case STAFF_DISCOVERY: return "discovery";
case STAFF_DEMONOLOGY: return "demonology";
case STAFF_AIR: return "air";
case STAFF_EARTH: return "earth";
case STAFF_SUMMONING: return "summoning";
// rods
case STAFF_SPELL_SUMMONING: return "summoning";
case STAFF_DESTRUCTION_I:
case STAFF_DESTRUCTION_II:
case STAFF_DESTRUCTION_III:
case STAFF_DESTRUCTION_IV:
return "destruction";
case STAFF_CHANNELING: return "channeling";
default: return "bugginess";
}
}
static const char* racial_description_string(const item_def& item, bool terse)
{
switch (get_equip_race( item ))
{
case ISFLAG_ORCISH:
return terse ? "orc " : "orcish ";
case ISFLAG_ELVEN:
return terse ? "elf " : "elven ";
case ISFLAG_DWARVEN:
return terse ? "dwarf " : "dwarven ";
default:
return "";
}
}
// gcc (and maybe the C standard) says that if you output
// 0, even with showpos set, you get 0, not +0. This is a workaround.
static void output_with_sign(std::ostream& os, int val)
{
if ( val >= 0 )
os << '+';
os << val;
}
strncat(buff, "cursed ", ITEMNAME_SIZE );
else if (Options.show_uncursed
&& !know_pluses)
{
strncat(buff, "uncursed ", ITEMNAME_SIZE );
}
buff << "cursed ";
else if (Options.show_uncursed && !know_pluses)
buff << "uncursed ";
if (it_plus >= 0)
strncat( buff, "+" , ITEMNAME_SIZE );
itoa( it_plus, tmp_quant, 10 );
strncat( buff, tmp_quant , ITEMNAME_SIZE );
if (it_plus != item_plus2 || !terse)
{
strncat( buff, "," , ITEMNAME_SIZE );
if (item_plus2 >= 0)
strncat(buff, "+", ITEMNAME_SIZE );
itoa( item_plus2, tmp_quant, 10 );
strncat( buff, tmp_quant , ITEMNAME_SIZE );
}
strncat( buff, " " , ITEMNAME_SIZE );
output_with_sign(buff, it_plus);
buff << ',';
output_with_sign(buff, item_plus2);
if (know_type)
{
strncat(buff,
(this->special == SPWPN_SINGING_SWORD) ? "Singing Sword" :
(this->special == SPWPN_WRATH_OF_TROG) ? "Wrath of Trog" :
(this->special == SPWPN_SCYTHE_OF_CURSES) ? "Scythe of Curses" :
(this->special == SPWPN_MACE_OF_VARIABILITY) ? "Mace of Variability" :
(this->special == SPWPN_GLAIVE_OF_PRUNE) ? "Glaive of Prune" :
(this->special == SPWPN_SCEPTRE_OF_TORMENT) ? "Sceptre of Torment" :
(this->special == SPWPN_SWORD_OF_ZONGULDROK) ? "Sword of Zonguldrok" :
(this->special == SPWPN_SWORD_OF_CEREBOV) ? "Sword of Cerebov" :
(this->special == SPWPN_STAFF_OF_DISPATER) ? "Staff of Dispater" :
(this->special == SPWPN_SCEPTRE_OF_ASMODEUS) ? "Sceptre of Asmodeus" :
(this->special == SPWPN_SWORD_OF_POWER) ? "Sword of Power" :
(this->special == SPWPN_KNIFE_OF_ACCURACY) ? "Knife of Accuracy" :
(this->special == SPWPN_STAFF_OF_OLGREB) ? "Staff of Olgreb" :
(this->special == SPWPN_VAMPIRES_TOOTH) ? "Vampire's Tooth" :
(this->special == SPWPN_STAFF_OF_WUCAD_MU) ? "Staff of Wucad Mu"
: "Brodale's Buggy Bola",
ITEMNAME_SIZE );
}
else
{
strncat(buff,
(this->special == SPWPN_SINGING_SWORD) ? "golden long sword" :
(this->special == SPWPN_WRATH_OF_TROG) ? "bloodstained battleaxe" :
(this->special == SPWPN_SCYTHE_OF_CURSES) ? "warped scythe" :
(this->special == SPWPN_MACE_OF_VARIABILITY) ? "shimmering mace" :
(this->special == SPWPN_GLAIVE_OF_PRUNE) ? "purple glaive" :
(this->special == SPWPN_SCEPTRE_OF_TORMENT) ? "jeweled golden mace" :
(this->special == SPWPN_SWORD_OF_ZONGULDROK) ? "bone long sword" :
(this->special == SPWPN_SWORD_OF_CEREBOV) ? "great serpentine sword" :
(this->special == SPWPN_STAFF_OF_DISPATER) ? "golden staff" :
(this->special == SPWPN_SCEPTRE_OF_ASMODEUS) ? "ruby sceptre" :
(this->special == SPWPN_SWORD_OF_POWER) ? "chunky great sword" :
(this->special == SPWPN_KNIFE_OF_ACCURACY) ? "thin dagger" :
(this->special == SPWPN_STAFF_OF_OLGREB) ? "green glowing staff" :
(this->special == SPWPN_VAMPIRES_TOOTH) ? "ivory dagger" :
(this->special == SPWPN_STAFF_OF_WUCAD_MU) ? "ephemeral quarterstaff"
: "buggy bola",
ITEMNAME_SIZE );
}
buff << fixed_artefact_name( *this, know_type );
switch (get_equip_race( *this ))
{
case ISFLAG_ORCISH:
strncat( buff, (terse) ? "orc " : "orcish ", ITEMNAME_SIZE );
break;
case ISFLAG_ELVEN:
strncat( buff, (terse) ? "elf " : "elven ", ITEMNAME_SIZE );
break;
case ISFLAG_DWARVEN:
strncat( buff, (terse) ? "dwarf " : "dwarven ", ITEMNAME_SIZE );
break;
}
int dwpn = get_equip_race( *this );
strncat(buff,
(dwpn == ISFLAG_ORCISH) ? ((terse) ? "orc " : "orcish ") :
(dwpn == ISFLAG_ELVEN) ? ((terse) ? "elf " : "elven ") :
(dwpn == ISFLAG_DWARVEN) ? ((terse) ? "dwarf " : "dwarven ")
: "buggy ",
ITEMNAME_SIZE);
case MI_STONE: buff << "stone"; break;
case MI_ARROW: buff << "arrow"; break;
case MI_BOLT: buff << "bolt"; break;
case MI_DART: buff << "dart"; break;
case MI_NEEDLE: buff << "needle"; break;
case MI_LARGE_ROCK: buff << "large rock" ; break;
default: buff << "hysterical raisin"; break;
strncat(buff, (item_typ == MI_STONE) ? "stone" :
(item_typ == MI_ARROW) ? "arrow" :
(item_typ == MI_BOLT) ? "bolt" :
(item_typ == MI_DART) ? "dart" :
(item_typ == MI_NEEDLE) ? "needle" :
(item_typ == MI_LARGE_ROCK) ? "large rock" :
"hysterical raisin", ITEMNAME_SIZE);
// this should probably be "" {dlb}
strncat( buff,
(brand == SPMSL_FLAME) ? ((terse) ? " (flame)" : " of flame") :
(brand == SPMSL_ICE) ? ((terse) ? " (ice)" : " of ice") :
(brand == SPMSL_NORMAL) ? "" :
(brand == SPMSL_POISONED) ? "" :
(brand == SPMSL_CURARE) ? "" :
" (buggy)", ITEMNAME_SIZE );
switch (brand)
{
case SPMSL_FLAME:
buff << ((terse) ? " (flame)" : " of flame");
break;
case SPMSL_ICE:
buff << ((terse) ? " (ice)" : " of ice");
break;
case SPMSL_NORMAL:
case SPMSL_POISONED:
case SPMSL_CURARE:
break;
default:
buff << " (buggy)";
}
strncat(buff, "cursed ", ITEMNAME_SIZE );
else if (Options.show_uncursed
&& !know_pluses)
{
strncat(buff, "uncursed ", ITEMNAME_SIZE );
}
buff << "cursed ";
else if (Options.show_uncursed && !know_pluses)
buff << "uncursed ";
switch (get_equip_race( *this ))
{
case ISFLAG_ELVEN:
strncat(buff, (terse) ? "elf " :"elven ", ITEMNAME_SIZE );
break;
case ISFLAG_DWARVEN:
strncat(buff, (terse) ? "dwarf " : "dwarven ", ITEMNAME_SIZE );
break;
case ISFLAG_ORCISH:
strncat(buff, (terse) ? "orc " : "orcish ", ITEMNAME_SIZE );
break;
} // end switch
strncat( buff, item_base_name(*this).c_str(), ITEMNAME_SIZE );
buff << racial_description_string(*this, terse);
strncat(buff, (sparm == SPARM_RUNNING) ? "running" :
(sparm == SPARM_FIRE_RESISTANCE) ? "fire resistance" :
(sparm == SPARM_COLD_RESISTANCE) ? "cold resistance" :
(sparm == SPARM_POISON_RESISTANCE) ? "poison resistance" :
(sparm == SPARM_SEE_INVISIBLE) ? "see invisible" :
(sparm == SPARM_DARKNESS) ? "darkness" :
(sparm == SPARM_STRENGTH) ? "strength" :
(sparm == SPARM_DEXTERITY) ? "dexterity" :
(sparm == SPARM_INTELLIGENCE) ? "intelligence" :
(sparm == SPARM_PONDEROUSNESS) ? "ponderousness" :
(sparm == SPARM_LEVITATION) ? "levitation" :
(sparm == SPARM_MAGIC_RESISTANCE) ? "magic resistance" :
(sparm == SPARM_PROTECTION) ? "protection" :
(sparm == SPARM_STEALTH) ? "stealth" :
(sparm == SPARM_RESISTANCE) ? "resistance" :
(sparm == SPARM_POSITIVE_ENERGY) ? "positive energy" :
(sparm == SPARM_ARCHMAGI) ? "the Archmagi" :
(sparm == SPARM_PRESERVATION) ? "preservation"
: "bugginess",
ITEMNAME_SIZE);
}
else
if (know_type && sparm != SPARM_NORMAL)
strncat(buff, (sparm == SPARM_RUNNING) ? " (run)" :
(sparm == SPARM_FIRE_RESISTANCE) ? " (R-fire)" :
(sparm == SPARM_COLD_RESISTANCE) ? " (R-cold)" :
(sparm == SPARM_POISON_RESISTANCE) ? " (R-poison)" :
(sparm == SPARM_SEE_INVISIBLE) ? " (see invis)" :
(sparm == SPARM_DARKNESS) ? " (darkness)" :
(sparm == SPARM_STRENGTH) ? " (str)" :
(sparm == SPARM_DEXTERITY) ? " (dex)" :
(sparm == SPARM_INTELLIGENCE) ? " (int)" :
(sparm == SPARM_PONDEROUSNESS) ? " (ponderous)" :
(sparm == SPARM_LEVITATION) ? " (levitate)" :
(sparm == SPARM_MAGIC_RESISTANCE) ? " (R-magic)" :
(sparm == SPARM_PROTECTION) ? " (protect)" :
(sparm == SPARM_STEALTH) ? " (stealth)" :
(sparm == SPARM_RESISTANCE) ? " (resist)" :
(sparm == SPARM_POSITIVE_ENERGY) ? " (R-neg)" : // ha ha
(sparm == SPARM_ARCHMAGI) ? " (Archmagi)" :
(sparm == SPARM_PRESERVATION) ? " (preserve)"
: " (buggy)",
ITEMNAME_SIZE);
if ( !terse )
buff << " of ";
buff << armour_ego_name(sparm, terse);
strncat(buff, "wand of ", ITEMNAME_SIZE );
strncat(buff, (item_typ == WAND_FLAME) ? "flame" :
(item_typ == WAND_FROST) ? "frost" :
(item_typ == WAND_SLOWING) ? "slowing" :
(item_typ == WAND_HASTING) ? "hasting" :
(item_typ == WAND_MAGIC_DARTS) ? "magic darts" :
(item_typ == WAND_HEALING) ? "healing" :
(item_typ == WAND_PARALYSIS) ? "paralysis" :
(item_typ == WAND_FIRE) ? "fire" :
(item_typ == WAND_COLD) ? "cold" :
(item_typ == WAND_CONFUSION) ? "confusion" :
(item_typ == WAND_INVISIBILITY) ? "invisibility" :
(item_typ == WAND_DIGGING) ? "digging" :
(item_typ == WAND_FIREBALL) ? "fireball" :
(item_typ == WAND_TELEPORTATION) ? "teleportation" :
(item_typ == WAND_LIGHTNING) ? "lightning" :
(item_typ == WAND_POLYMORPH_OTHER) ? "polymorph other" :
(item_typ == WAND_ENSLAVEMENT) ? "enslavement" :
(item_typ == WAND_DRAINING) ? "draining" :
(item_typ == WAND_RANDOM_EFFECTS) ? "random effects" :
(item_typ == WAND_DISINTEGRATION) ? "disintegration"
: "bugginess",
ITEMNAME_SIZE );
buff << "wand of " << wand_type_name(item_typ);
char primary = (this->special % 12);
char secondary = (this->special / 12);
strncat(buff,(secondary == 0) ? "" : // hope this works {dlb}
(secondary == 1) ? "jeweled" :
(secondary == 2) ? "curved" :
(secondary == 3) ? "long" :
(secondary == 4) ? "short" :
(secondary == 5) ? "twisted" :
(secondary == 6) ? "crooked" :
(secondary == 7) ? "forked" :
(secondary == 8) ? "shiny" :
(secondary == 9) ? "blackened" :
(secondary == 10) ? "tapered" :
(secondary == 11) ? "glowing" :
(secondary == 12) ? "worn" :
(secondary == 13) ? "encrusted" :
(secondary == 14) ? "runed" :
(secondary == 15) ? "sharpened" : "buggily", ITEMNAME_SIZE);
if (secondary != 0)
strncat(buff, " ", ITEMNAME_SIZE );
strncat(buff, (primary == 0) ? "iron" :
(primary == 1) ? "brass" :
(primary == 2) ? "bone" :
(primary == 3) ? "wooden" :
(primary == 4) ? "copper" :
(primary == 5) ? "gold" :
(primary == 6) ? "silver" :
(primary == 7) ? "bronze" :
(primary == 8) ? "ivory" :
(primary == 9) ? "glass" :
(primary == 10) ? "lead" :
(primary == 11) ? "plastic" : "buggy", ITEMNAME_SIZE);
strncat(buff, " wand", ITEMNAME_SIZE );
buff << wand_secondary_string(this->special / 12)
<< wand_primary_string(this->special % 12)
<< " wand";
{
strncat(buff, " (", ITEMNAME_SIZE );
itoa( it_plus, tmp_quant, 10 );
strncat(buff, tmp_quant, ITEMNAME_SIZE );
strncat(buff, ")", ITEMNAME_SIZE);
}
buff << " (" << it_plus << ")";
strncat(buff, "potion", ITEMNAME_SIZE );
strncat(buff, (this->quantity == 1) ? " " : "s ", ITEMNAME_SIZE);
strncat(buff, "of ", ITEMNAME_SIZE );
strncat(buff, (item_typ == POT_HEALING) ? "healing" :
(item_typ == POT_HEAL_WOUNDS) ? "heal wounds" :
(item_typ == POT_SPEED) ? "speed" :
(item_typ == POT_MIGHT) ? "might" :
(item_typ == POT_GAIN_STRENGTH) ? "gain strength" :
(item_typ == POT_GAIN_DEXTERITY) ? "gain dexterity" :
(item_typ == POT_GAIN_INTELLIGENCE) ? "gain intelligence" :
(item_typ == POT_LEVITATION) ? "levitation" :
(item_typ == POT_POISON) ? "poison" :
(item_typ == POT_SLOWING) ? "slowing" :
(item_typ == POT_PARALYSIS) ? "paralysis" :
(item_typ == POT_CONFUSION) ? "confusion" :
(item_typ == POT_INVISIBILITY) ? "invisibility" :
(item_typ == POT_PORRIDGE) ? "porridge" :
(item_typ == POT_DEGENERATION) ? "degeneration" :
(item_typ == POT_DECAY) ? "decay" :
(item_typ == POT_WATER) ? "water" :
(item_typ == POT_EXPERIENCE) ? "experience" :
(item_typ == POT_MAGIC) ? "magic" :
(item_typ == POT_RESTORE_ABILITIES) ? "restore abilities" :
(item_typ == POT_STRONG_POISON) ? "strong poison" :
(item_typ == POT_BERSERK_RAGE) ? "berserk rage" :
(item_typ == POT_CURE_MUTATION) ? "cure mutation" :
(item_typ == POT_MUTATION) ? "mutation" : "bugginess",
ITEMNAME_SIZE);
buff << "potion";
if ( this->quantity > 1 )
buff << "s";
buff << " of " << potion_type_name(item_typ);
strncat(buff, qualifier, ITEMNAME_SIZE - strlen(buff));
strncat(buff, clr, ITEMNAME_SIZE - strlen(buff));
strncat(buff, " potion", ITEMNAME_SIZE - strlen(buff) );
buff << qualifier << clr << " potion";
strncat(buff, "of ", ITEMNAME_SIZE );
strncat(buff, (item_typ == SCR_IDENTIFY) ? "identify" :
(item_typ == SCR_TELEPORTATION) ? "teleportation" :
(item_typ == SCR_FEAR) ? "fear" :
(item_typ == SCR_NOISE) ? "noise" :
(item_typ == SCR_REMOVE_CURSE) ? "remove curse" :
(item_typ == SCR_DETECT_CURSE) ? "detect curse" :
(item_typ == SCR_SUMMONING) ? "summoning" :
(item_typ == SCR_ENCHANT_WEAPON_I) ? "enchant weapon I" :
(item_typ == SCR_ENCHANT_ARMOUR) ? "enchant armour" :
(item_typ == SCR_TORMENT) ? "torment" :
(item_typ == SCR_RANDOM_USELESSNESS) ? "random uselessness" :
(item_typ == SCR_CURSE_WEAPON) ? "curse weapon" :
(item_typ == SCR_CURSE_ARMOUR) ? "curse armour" :
(item_typ == SCR_IMMOLATION) ? "immolation" :
(item_typ == SCR_BLINKING) ? "blinking" :
(item_typ == SCR_PAPER) ? "paper" :
(item_typ == SCR_MAGIC_MAPPING) ? "magic mapping" :
(item_typ == SCR_FORGETFULNESS) ? "forgetfulness" :
(item_typ == SCR_ACQUIREMENT) ? "acquirement" :
(item_typ == SCR_ENCHANT_WEAPON_II) ? "enchant weapon II" :
(item_typ == SCR_VORPALISE_WEAPON) ? "vorpalise weapon" :
(item_typ == SCR_RECHARGING) ? "recharging" :
//(item_typ == 23) ? "portal travel" :
(item_typ == SCR_ENCHANT_WEAPON_III) ? "enchant weapon III"
: "bugginess",
ITEMNAME_SIZE);
buff << "of " << scroll_type_name(item_typ);
// If the item is worn, its curse status is known,
// no need to belabour the obvious.
&& get_equip_slot( this ) == -1)
// If the item is worn, its curse status is known,
// no need to belabour the obvious.
&& get_equip_slot( this ) == -1)
if (know_pluses
&& (item_typ == RING_PROTECTION || item_typ == RING_STRENGTH
|| item_typ == RING_SLAYING || item_typ == RING_EVASION
|| item_typ == RING_DEXTERITY
|| item_typ == RING_INTELLIGENCE))
if (know_pluses && ring_has_pluses(*this))
switch (item_typ)
{
case RING_REGENERATION:
strncat(buff, "ring of regeneration", ITEMNAME_SIZE );
break;
case RING_PROTECTION:
strncat(buff, "ring of protection", ITEMNAME_SIZE );
break;
case RING_PROTECTION_FROM_FIRE:
strncat(buff, "ring of protection from fire", ITEMNAME_SIZE );
break;
case RING_POISON_RESISTANCE:
strncat(buff, "ring of poison resistance", ITEMNAME_SIZE );
break;
case RING_PROTECTION_FROM_COLD:
strncat(buff, "ring of protection from cold", ITEMNAME_SIZE );
break;
case RING_STRENGTH:
strncat(buff, "ring of strength", ITEMNAME_SIZE );
break;
case RING_SLAYING:
strncat(buff, "ring of slaying", ITEMNAME_SIZE );
break;
case RING_SEE_INVISIBLE:
strncat(buff, "ring of see invisible", ITEMNAME_SIZE );
break;
case RING_INVISIBILITY:
strncat(buff, "ring of invisibility", ITEMNAME_SIZE );
break;
case RING_HUNGER:
strncat(buff, "ring of hunger", ITEMNAME_SIZE );
break;
case RING_TELEPORTATION:
strncat(buff, "ring of teleportation", ITEMNAME_SIZE );
break;
case RING_EVASION:
strncat(buff, "ring of evasion", ITEMNAME_SIZE );
break;
case RING_SUSTAIN_ABILITIES:
strncat(buff, "ring of sustain abilities", ITEMNAME_SIZE );
break;
case RING_SUSTENANCE:
strncat(buff, "ring of sustenance", ITEMNAME_SIZE );
break;
case RING_DEXTERITY:
strncat(buff, "ring of dexterity", ITEMNAME_SIZE );
break;
case RING_INTELLIGENCE:
strncat(buff, "ring of intelligence", ITEMNAME_SIZE );
break;
case RING_WIZARDRY:
strncat(buff, "ring of wizardry", ITEMNAME_SIZE );
break;
case RING_MAGICAL_POWER:
strncat(buff, "ring of magical power", ITEMNAME_SIZE );
break;
case RING_LEVITATION:
strncat(buff, "ring of levitation", ITEMNAME_SIZE );
break;
case RING_LIFE_PROTECTION:
strncat(buff, "ring of life protection", ITEMNAME_SIZE );
break;
case RING_PROTECTION_FROM_MAGIC:
strncat(buff, "ring of protection from magic", ITEMNAME_SIZE );
break;
case RING_FIRE:
strncat(buff, "ring of fire", ITEMNAME_SIZE );
break;
case RING_ICE:
strncat(buff, "ring of ice", ITEMNAME_SIZE );
break;
case RING_TELEPORT_CONTROL:
strncat(buff, "ring of teleport control", ITEMNAME_SIZE );
break;
case AMU_RAGE:
strncat(buff, "amulet of rage", ITEMNAME_SIZE );
break;
case AMU_RESIST_SLOW:
strncat(buff, "amulet of resist slowing", ITEMNAME_SIZE );
break;
case AMU_CLARITY:
strncat(buff, "amulet of clarity", ITEMNAME_SIZE );
break;
case AMU_WARDING:
strncat(buff, "amulet of warding", ITEMNAME_SIZE );
break;
case AMU_RESIST_CORROSION:
strncat(buff, "amulet of resist corrosion", ITEMNAME_SIZE );
break;
case AMU_THE_GOURMAND:
strncat(buff, "amulet of the gourmand", ITEMNAME_SIZE );
break;
case AMU_CONSERVATION:
strncat(buff, "amulet of conservation", ITEMNAME_SIZE );
break;
case AMU_CONTROLLED_FLIGHT:
strncat(buff, "amulet of controlled flight", ITEMNAME_SIZE );
break;
case AMU_INACCURACY:
strncat(buff, "amulet of inaccuracy", ITEMNAME_SIZE );
break;
case AMU_RESIST_MUTATION:
strncat(buff, "amulet of resist mutation", ITEMNAME_SIZE );
break;
}
/* ? of imputed learning - 100% exp from tames/summoned kills */
break;
buff << jewellery_type_name(item_typ);
if (is_random_artefact( *this ))
{
strncat(buff, randart_ring_name(*this), ITEMNAME_SIZE);
break;
}
switch (this->special / 13) // secondary characteristic of ring
{
case 1:
strncat(buff, "encrusted ", ITEMNAME_SIZE );
break;
case 2:
strncat(buff, "glowing ", ITEMNAME_SIZE );
break;
case 3:
strncat(buff, "tubular ", ITEMNAME_SIZE );
break;
case 4:
strncat(buff, "runed ", ITEMNAME_SIZE );
break;
case 5:
strncat(buff, "blackened ", ITEMNAME_SIZE );
break;
case 6:
strncat(buff, "scratched ", ITEMNAME_SIZE );
break;
case 7:
strncat(buff, "small ", ITEMNAME_SIZE );
break;
case 8:
strncat(buff, "large ", ITEMNAME_SIZE );
break;
case 9:
strncat(buff, "twisted ", ITEMNAME_SIZE );
break;
case 10:
strncat(buff, "shiny ", ITEMNAME_SIZE );
break;
case 11:
strncat(buff, "notched ", ITEMNAME_SIZE );
break;
case 12:
strncat(buff, "knobbly ", ITEMNAME_SIZE );
break;
}
switch (this->special % 13)
{
case 0:
strncat(buff, "wooden ring", ITEMNAME_SIZE );
break;
case 1:
strncat(buff, "silver ring", ITEMNAME_SIZE );
break;
case 2:
strncat(buff, "golden ring", ITEMNAME_SIZE );
break;
case 3:
strncat(buff, "iron ring", ITEMNAME_SIZE );
break;
case 4:
strncat(buff, "steel ring", ITEMNAME_SIZE );
break;
case 5:
strncat(buff, "bronze ring", ITEMNAME_SIZE );
break;
case 6:
strncat(buff, "brass ring", ITEMNAME_SIZE );
break;
case 7:
strncat(buff, "copper ring", ITEMNAME_SIZE );
break;
case 8:
strncat(buff, "granite ring", ITEMNAME_SIZE );
break;
case 9:
strncat(buff, "ivory ring", ITEMNAME_SIZE );
break;
case 10:
strncat(buff, "bone ring", ITEMNAME_SIZE );
break;
case 11:
strncat(buff, "marble ring", ITEMNAME_SIZE );
break;
case 12:
strncat(buff, "jade ring", ITEMNAME_SIZE );
break;
case 13:
strncat(buff, "glass ring", ITEMNAME_SIZE );
break;
}
} // end of rings
else // ie is an amulet
buff << ring_secondary_string(this->special / 13)
<< ring_primary_string(this->special % 13)
<< " ring";
}
else // amulets
if (is_random_artefact( *this ))
{
strncat(buff, randart_ring_name(*this), ITEMNAME_SIZE);
break;
}
if (this->special > 13)
{
switch (this->special / 13) // secondary characteristic of amulet
{
case 0:
strncat(buff, "dented ", ITEMNAME_SIZE );
break;
case 1:
strncat(buff, "square ", ITEMNAME_SIZE );
break;
case 2:
strncat(buff, "thick ", ITEMNAME_SIZE );
break;
case 3:
strncat(buff, "thin ", ITEMNAME_SIZE );
break;
case 4:
strncat(buff, "runed ", ITEMNAME_SIZE );
break;
case 5:
strncat(buff, "blackened ", ITEMNAME_SIZE );
break;
case 6:
strncat(buff, "glowing ", ITEMNAME_SIZE );
break;
case 7:
strncat(buff, "small ", ITEMNAME_SIZE );
break;
case 8:
strncat(buff, "large ", ITEMNAME_SIZE );
break;
case 9:
strncat(buff, "twisted ", ITEMNAME_SIZE );
break;
case 10:
strncat(buff, "tiny ", ITEMNAME_SIZE );
break;
case 11:
strncat(buff, "triangular ", ITEMNAME_SIZE );
break;
case 12:
strncat(buff, "lumpy ", ITEMNAME_SIZE );
break;
}
}
switch (this->special % 13)
{
case 0:
strncat(buff, "zirconium amulet", ITEMNAME_SIZE );
break;
case 1:
strncat(buff, "sapphire amulet", ITEMNAME_SIZE );
break;
case 2:
strncat(buff, "golden amulet", ITEMNAME_SIZE );
break;
case 3:
strncat(buff, "emerald amulet", ITEMNAME_SIZE );
break;
case 4:
strncat(buff, "garnet amulet", ITEMNAME_SIZE );
break;
case 5:
strncat(buff, "bronze amulet", ITEMNAME_SIZE );
break;
case 6:
strncat(buff, "brass amulet", ITEMNAME_SIZE );
break;
case 7:
strncat(buff, "copper amulet", ITEMNAME_SIZE );
break;
case 8:
strncat(buff, "ruby amulet", ITEMNAME_SIZE );
break;
case 9:
strncat(buff, "ivory amulet", ITEMNAME_SIZE );
break;
case 10:
strncat(buff, "bone amulet", ITEMNAME_SIZE );
break;
case 11:
strncat(buff, "platinum amulet", ITEMNAME_SIZE );
break;
case 12:
strncat(buff, "jade amulet", ITEMNAME_SIZE );
break;
case 13:
strncat(buff, "plastic amulet", ITEMNAME_SIZE );
break;
}
} // end of amulets
buff << amulet_secondary_string(this->special / 13)
<< amulet_primary_string(this->special % 13)
<< " amulet";
}
case MISC_RUNE_OF_ZOT:
strncat(buff, (it_plus == RUNE_DIS) ? "iron" :
(it_plus == RUNE_GEHENNA) ? "obsidian" :
(it_plus == RUNE_COCYTUS) ? "icy" :
(it_plus == RUNE_TARTARUS) ? "bone" :
(it_plus == RUNE_SLIME_PITS) ? "slimy" :
(it_plus == RUNE_VAULTS) ? "silver" :
(it_plus == RUNE_SNAKE_PIT) ? "serpentine" :
(it_plus == RUNE_ELVEN_HALLS) ? "elven" :
(it_plus == RUNE_TOMB) ? "golden" :
(it_plus == RUNE_SWAMP) ? "decaying" :
(it_plus == RUNE_ISLANDS) ? "liquid" :
// pandemonium and abyss runes:
(it_plus == RUNE_DEMONIC) ? "demonic" :
(it_plus == RUNE_ABYSSAL) ? "abyssal" :
// special pandemonium runes:
(it_plus == RUNE_MNOLEG) ? "glowing" :
(it_plus == RUNE_LOM_LOBON) ? "magical" :
(it_plus == RUNE_CEREBOV) ? "fiery" :
(it_plus == RUNE_GLOORX_VLOQ) ? "dark"
: "buggy",
ITEMNAME_SIZE);
buff << rune_type_name(it_plus) << " rune";
strncat(buff, " of Zot", ITEMNAME_SIZE );
break;
case MISC_DECK_OF_POWER:
case MISC_DECK_OF_SUMMONINGS:
case MISC_DECK_OF_TRICKS:
case MISC_DECK_OF_WONDERS:
strncat(buff, "deck of ", ITEMNAME_SIZE );
strncat(buff, !know_type ? "cards" :
(item_typ == MISC_DECK_OF_WONDERS) ? "wonders" :
(item_typ == MISC_DECK_OF_SUMMONINGS) ? "summonings" :
(item_typ == MISC_DECK_OF_TRICKS) ? "tricks" :
(item_typ == MISC_DECK_OF_POWER) ? "power"
: "bugginess",
ITEMNAME_SIZE);
break;
case MISC_CRYSTAL_BALL_OF_ENERGY:
case MISC_CRYSTAL_BALL_OF_FIXATION:
case MISC_CRYSTAL_BALL_OF_SEEING:
strncat(buff, "crystal ball", ITEMNAME_SIZE );
if (know_type)
{
strncat(buff, " of ", ITEMNAME_SIZE );
strncat(buff,
(item_typ == MISC_CRYSTAL_BALL_OF_SEEING) ? "seeing" :
(item_typ == MISC_CRYSTAL_BALL_OF_ENERGY) ? "energy" :
(item_typ == MISC_CRYSTAL_BALL_OF_FIXATION) ? "fixation"
: "bugginess",
ITEMNAME_SIZE);
}
break;
case MISC_BOX_OF_BEASTS:
if (know_type)
strncat(buff, "box of beasts", ITEMNAME_SIZE );
else
strncat(buff, "small ebony casket", ITEMNAME_SIZE );
break;
case MISC_EMPTY_EBONY_CASKET:
if (know_type)
strncat(buff, "empty ebony casket", ITEMNAME_SIZE );
else
strncat(buff, "small ebony casket", ITEMNAME_SIZE );
break;
case MISC_AIR_ELEMENTAL_FAN:
if (know_type)
strncat(buff, "air elemental ", ITEMNAME_SIZE );
strncat(buff, "fan", ITEMNAME_SIZE );
break;
case MISC_LAMP_OF_FIRE:
strncat(buff, "lamp", ITEMNAME_SIZE );
if (know_type)
strncat(buff, " of fire", ITEMNAME_SIZE );
break;
case MISC_LANTERN_OF_SHADOWS:
if (!know_type)
strncat(buff, "bone ", ITEMNAME_SIZE );
strncat(buff, "lantern", ITEMNAME_SIZE );
if (know_type)
strncat(buff, " of shadows", ITEMNAME_SIZE );
break;
case MISC_HORN_OF_GERYON:
if (!know_type)
strncat(buff, "silver ", ITEMNAME_SIZE );
strncat(buff, "horn", ITEMNAME_SIZE );
if (know_type)
strncat(buff, " of Geryon", ITEMNAME_SIZE );
break;
case MISC_DISC_OF_STORMS:
if (!know_type)
strncat(buff, "grey ", ITEMNAME_SIZE );
strncat(buff, "disc", ITEMNAME_SIZE );
if (know_type)
strncat(buff, " of storms", ITEMNAME_SIZE );
break;
case MISC_STONE_OF_EARTH_ELEMENTALS:
if (!know_type)
strncat(buff, "nondescript ", ITEMNAME_SIZE );
strncat(buff, "stone", ITEMNAME_SIZE );
if (know_type)
strncat(buff, " of earth elementals", ITEMNAME_SIZE );
break;
case MISC_BOTTLED_EFREET:
strncat(buff, (!know_type)
? "sealed bronze flask" : "bottled efreet",
ITEMNAME_SIZE );
break;
case MISC_PORTABLE_ALTAR_OF_NEMELEX:
strncat(buff, "portable altar of Nemelex", ITEMNAME_SIZE );
break;
default:
strncat(buff, "buggy miscellaneous item", ITEMNAME_SIZE );
break;
buff << " of Zot";
}
else
{
buff << misc_type_name(item_typ, know_type);
char primary = (this->special / 10);
char secondary = (this->special % 10);
strncat(buff, (primary == 0) ? "" :
(primary == 1) ? "chunky " :
(primary == 2) ? "thick " :
(primary == 3) ? "thin " :
(primary == 4) ? "wide " :
(primary == 5) ? "glowing " :
(primary == 6) ? "dog-eared " :
(primary == 7) ? "oblong " :
(primary == 8) ? "runed " :
// these last three were single spaces {dlb}
(primary == 9) ? "" :
(primary == 10) ? "" : (primary == 11) ? "" : "buggily ",
ITEMNAME_SIZE);
strncat(buff, (secondary == 0) ? "paperback " :
(secondary == 1) ? "hardcover " :
(secondary == 2) ? "leatherbound " :
(secondary == 3) ? "metal-bound " :
(secondary == 4) ? "papyrus " :
// these two were single spaces, too {dlb}
(secondary == 5) ? "" :
(secondary == 6) ? "" : "buggy ", ITEMNAME_SIZE);
strncat(buff, "book", ITEMNAME_SIZE );
buff << book_secondary_string(this->special / 10)
<< book_primary_string(this->special % 10)
<< "book";
{
strncat(buff, "book of ", ITEMNAME_SIZE );
strncat(buff, (item_typ == BOOK_MINOR_MAGIC_I
|| item_typ == BOOK_MINOR_MAGIC_II
|| item_typ == BOOK_MINOR_MAGIC_III) ? "Minor Magic" :
(item_typ == BOOK_CONJURATIONS_I
|| item_typ == BOOK_CONJURATIONS_II) ? "Conjurations" :
(item_typ == BOOK_FLAMES) ? "Flames" :
(item_typ == BOOK_FROST) ? "Frost" :
(item_typ == BOOK_SUMMONINGS) ? "Summonings" :
(item_typ == BOOK_FIRE) ? "Fire" :
(item_typ == BOOK_ICE) ? "Ice" :
(item_typ == BOOK_SURVEYANCES) ? "Surveyances" :
(item_typ == BOOK_SPATIAL_TRANSLOCATIONS) ? "Spatial Translocations" :
(item_typ == BOOK_ENCHANTMENTS) ? "Enchantments" :
(item_typ == BOOK_TEMPESTS) ? "the Tempests" :
(item_typ == BOOK_DEATH) ? "Death" :
(item_typ == BOOK_HINDERANCE) ? "Hinderance" :
(item_typ == BOOK_CHANGES) ? "Changes" :
(item_typ == BOOK_TRANSFIGURATIONS) ? "Transfigurations" :
(item_typ == BOOK_PRACTICAL_MAGIC) ? "Practical Magic" :
(item_typ == BOOK_WAR_CHANTS) ? "War Chants" :
(item_typ == BOOK_CLOUDS) ? "Clouds" :
(item_typ == BOOK_HEALING) ? "Healing" :
(item_typ == BOOK_NECROMANCY) ? "Necromancy" :
(item_typ == BOOK_CALLINGS) ? "Callings" :
(item_typ == BOOK_CHARMS) ? "Charms" :
(item_typ == BOOK_DEMONOLOGY) ? "Demonology" :
(item_typ == BOOK_AIR) ? "Air" :
(item_typ == BOOK_SKY) ? "the Sky" :
(item_typ == BOOK_DIVINATIONS) ? "Divinations" :
(item_typ == BOOK_WARP) ? "the Warp" :
(item_typ == BOOK_ENVENOMATIONS) ? "Envenomations" :
(item_typ == BOOK_ANNIHILATIONS) ? "Annihilations" :
(item_typ == BOOK_UNLIFE) ? "Unlife" :
(item_typ == BOOK_CONTROL) ? "Control" :
(item_typ == BOOK_MUTATIONS) ? "Morphology" :
(item_typ == BOOK_TUKIMA) ? "Tukima" :
(item_typ == BOOK_GEOMANCY) ? "Geomancy" :
(item_typ == BOOK_EARTH) ? "the Earth" :
(item_typ == BOOK_WIZARDRY) ? "Wizardry" :
(item_typ == BOOK_POWER) ? "Power" :
(item_typ == BOOK_CANTRIPS) ? "Cantrips" :
(item_typ == BOOK_PARTY_TRICKS) ? "Party Tricks" :
(item_typ == BOOK_STALKING) ? "Stalking"
: "Bugginess",
ITEMNAME_SIZE );
}
buff << "book of " << book_type_name(item_typ);
strncat(buff, (this->special == 0) ? "curved" :
(this->special == 1) ? "glowing" :
(this->special == 2) ? "thick" :
(this->special == 3) ? "thin" :
(this->special == 4) ? "long" :
(this->special == 5) ? "twisted" :
(this->special == 6) ? "jeweled" :
(this->special == 7) ? "runed" :
(this->special == 8) ? "smoking" :
(this->special == 9) ? "gnarled" : // was "" {dlb}
(this->special == 10) ? "" :
(this->special == 11) ? "" :
(this->special == 12) ? "" :
(this->special == 13) ? "" :
(this->special == 14) ? "" :
(this->special == 15) ? "" :
(this->special == 16) ? "" :
(this->special == 17) ? "" :
(this->special == 18) ? "" :
(this->special == 19) ? "" :
(this->special == 20) ? "" :
(this->special == 21) ? "" :
(this->special == 22) ? "" :
(this->special == 23) ? "" :
(this->special == 24) ? "" :
(this->special == 25) ? "" :
(this->special == 26) ? "" :
(this->special == 27) ? "" :
(this->special == 28) ? "" :
(this->special == 29) ? "" : "buggy", ITEMNAME_SIZE);
strncat(buff, " ", ITEMNAME_SIZE );
}
strncat( buff, (item_is_rod( *this ) ? "rod" : "staff"), ITEMNAME_SIZE );
if (know_type)
buff << staff_primary_string(this->special) << " "
<< (item_is_rod( *this ) ? "rod" : "staff");
}
else
strncat(buff, (item_typ == STAFF_WIZARDRY) ? "wizardry" :
(item_typ == STAFF_POWER) ? "power" :
(item_typ == STAFF_FIRE) ? "fire" :
(item_typ == STAFF_COLD) ? "cold" :
(item_typ == STAFF_POISON) ? "poison" :
(item_typ == STAFF_ENERGY) ? "energy" :
(item_typ == STAFF_DEATH) ? "death" :
(item_typ == STAFF_CONJURATION) ? "conjuration" :
(item_typ == STAFF_ENCHANTMENT) ? "enchantment" :
(item_typ == STAFF_SMITING) ? "smiting" :
(item_typ == STAFF_STRIKING) ? "striking" :
(item_typ == STAFF_WARDING) ? "warding" :
(item_typ == STAFF_DISCOVERY) ? "discovery" :
(item_typ == STAFF_DEMONOLOGY) ? "demonology" :
(item_typ == STAFF_AIR) ? "air" :
(item_typ == STAFF_EARTH) ? "earth" :
(item_typ == STAFF_SUMMONING
|| item_typ == STAFF_SPELL_SUMMONING) ? "summoning" :
(item_typ == STAFF_DESTRUCTION_I
|| item_typ == STAFF_DESTRUCTION_II
|| item_typ == STAFF_DESTRUCTION_III
|| item_typ == STAFF_DESTRUCTION_IV) ? "destruction" :
(item_typ == STAFF_CHANNELING) ? "channeling"
: "bugginess", ITEMNAME_SIZE );
if (item_is_rod(*this))
{
buff << " (" << (this->plus / ROD_CHARGE_MULT)
<< "/" << (this->plus2 / ROD_CHARGE_MULT)
<< ")";
}
if (item_is_rod( *this )
&& know_type)
{
strncat( buff, " (", ITEMNAME_SIZE );
itoa( this->plus / ROD_CHARGE_MULT, tmp_quant, 10 );
strncat( buff, tmp_quant, ITEMNAME_SIZE );
strncat( buff, "/", ITEMNAME_SIZE );
itoa( this->plus2 / ROD_CHARGE_MULT, tmp_quant, 10 );
strncat( buff, tmp_quant, ITEMNAME_SIZE );
strncat( buff, ")", ITEMNAME_SIZE );
}
strncat(buff, "rotting ", ITEMNAME_SIZE );
moname( it_plus, true, DESC_PLAIN, tmp_buff );
strncat(buff, tmp_buff, ITEMNAME_SIZE );
strncat(buff, " ", ITEMNAME_SIZE );
strncat(buff, (item_typ == CORPSE_BODY) ? "corpse" :
(item_typ == CORPSE_SKELETON) ? "skeleton" : "corpse bug",
ITEMNAME_SIZE );
buff << "rotting ";
{
char tmp_buff[ITEMNAME_SIZE];
moname( it_plus, true, DESC_PLAIN, tmp_buff );
buff << tmp_buff << " ";
if (item_typ == CORPSE_BODY)
buff << "corpse";
else if (item_typ == CORPSE_SKELETON)
buff << "skeleton";
else
buff << "corpse bug";
}
char ugug[20];
strncat(buff, "bad item (cl:", ITEMNAME_SIZE );
itoa(this->base_type, ugug, 10);
strncat(buff, ugug, ITEMNAME_SIZE );
strncat(buff, ",ty:", ITEMNAME_SIZE );
itoa(item_typ, ugug, 10);
strncat(buff, ugug, ITEMNAME_SIZE );
strncat(buff, ",pl:", ITEMNAME_SIZE );
itoa(it_plus, ugug, 10);
strncat(buff, ugug, ITEMNAME_SIZE );
strncat(buff, ",pl2:", ITEMNAME_SIZE );
itoa(item_plus2, ugug, 10);
strncat(buff, ugug, ITEMNAME_SIZE );
strncat(buff, ",sp:", ITEMNAME_SIZE );
itoa(this->special, ugug, 10);
strncat(buff, ugug, ITEMNAME_SIZE );
strncat(buff, ",qu:", ITEMNAME_SIZE );
itoa(this->quantity, ugug, 10);
strncat(buff, ugug, ITEMNAME_SIZE );
strncat(buff, ")", ITEMNAME_SIZE );
buff << "bad item (cl:" << static_cast<int>(this->base_type)
<< ",ty:" << item_typ << ",pl:" << it_plus
<< ",pl2:" << item_plus2 << ",sp:" << this->special
<< ",qu:" << this->quantity << ")";