string Item::getName(bool plural, bool blind) const { string suff; if (fire->isBurning()) suff.append(" (burning)"); if (getShopkeeper()) suff += " (" + toString(getPrice()) + (plural ? " zorkmids each)" : " zorkmids)"); if (blind) return getBlindName(plural); return getVisibleName(plural) + suff; }
string Item::getName(bool plural, const Creature* owner) const { PROFILE; string suff; if (fire->isBurning()) suff.append(" (burning)"); if (owner && getShopkeeper(owner)) suff += " (" + toString(getPrice()) + (plural ? " gold each)" : " gold)"); if (owner && owner->isAffected(LastingEffect::BLIND)) return getBlindName(plural); return getVisibleName(plural) + suff; }
string Item::getRealName(bool getPlural) const { if (!realName) return getVisibleName(getPlural); if (!getPlural) return *realName; else { if (realPlural) return *realPlural; else return *realName + "s"; } }
string Item::getName(bool plural, bool blind) const { string suff = uses > -1 && displayUses && inspected ? string(" (") + convertToString(uses) + " uses left)" : ""; if (fire.isBurning()) suff.append(" (burning)"); if (getShopkeeper()) suff += " (" + convertToString(getPrice()) + (plural ? " zorkmids each)" : " zorkmids)"); if (blind) return getBlindName(plural); if (isIdentified(*name)) return getRealName(plural) + suff; else return getVisibleName(plural) + suff; }
string Item::getShortName(const Creature* owner, bool plural) const { PROFILE; if (owner && owner->isAffected(LastingEffect::BLIND) && attributes->blindName) return getBlindName(plural); if (attributes->artifactName) return *attributes->artifactName + " " + getModifiers(true); string name; if (!attributes->prefixes.empty()) name = attributes->prefixes.back(); else if (attributes->shortName) { name = *attributes->shortName; appendWithSpace(name, getSuffix()); } else name = getVisibleName(plural); appendWithSpace(name, getModifiers(true)); return name; }