Example #1
0
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;
}
Example #2
0
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;
}
Example #3
0
string Item::getShortName(bool blind, bool noSuffix) const {
  if (blind && attributes->blindName)
    return getBlindName(false);
  string name = getModifiers(true);
  if (attributes->shortName)
    name = *attributes->shortName + " " + name;
  if (getShopkeeper() && !noSuffix)
    name = name + " (unpaid)";
  if (fire->isBurning() && !noSuffix)
    name.append(" (burning)");
  return name;
}
Example #4
0
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;
}
Example #5
0
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;
}