Пример #1
0
string Item::getApplyMsgFirstPerson(bool blind) const {
  switch (getClass()) {
    case ItemClass::SCROLL: return "read " + getAName(false, blind);
    case ItemClass::POTION: return "drink " + getAName(false, blind);
    case ItemClass::BOOK: return "read " + getAName(false, blind);
    case ItemClass::TOOL: return "apply " + getAName(false, blind);
    case ItemClass::FOOD: return "eat " + getAName(false, blind);
    default: FAIL << "Bad type for applying " << (int)getClass();
  }
  return "";
}
Пример #2
0
string Item::getApplyMsgThirdPerson(bool blind) const {
  if (attributes->applyMsgThirdPerson)
    return *attributes->applyMsgThirdPerson;
  switch (getClass()) {
    case ItemClass::SCROLL: return "reads " + getAName(false, blind);
    case ItemClass::POTION: return "drinks " + getAName(false, blind);
    case ItemClass::BOOK: return "reads " + getAName(false, blind);
    case ItemClass::TOOL: return "applies " + getAName(false, blind);
    case ItemClass::FOOD: return "eats " + getAName(false, blind);
    default: FAIL << "Bad type for applying " << (int)getClass();
  }
  return "";
}
Пример #3
0
string Item::getApplyMsgFirstPerson(const Creature* owner) const {
  if (attributes->applyMsgFirstPerson)
    return *attributes->applyMsgFirstPerson;
  switch (getClass()) {
    case ItemClass::SCROLL: return "read " + getAName(false, owner);
    case ItemClass::POTION: return "drink " + getAName(false, owner);
    case ItemClass::BOOK: return "read " + getAName(false, owner);
    case ItemClass::TOOL: return "apply " + getAName(false, owner);
    case ItemClass::FOOD: return "eat " + getAName(false, owner);
    default: FATAL << "Bad type for applying " << (int)getClass();
  }
  return "";
}
Пример #4
0
string Item::getApplyMsgThirdPerson() const {
    switch (getType()) {
    case ItemType::SCROLL:
        return "reads " + getAName();
    case ItemType::POTION:
        return "drinks " + getAName();
    case ItemType::BOOK:
        return "reads " + getAName();
    case ItemType::TOOL:
        return "applies " + getAName();
    case ItemType::FOOD:
        return "eats " + getAName();
    default:
        FAIL << "Bad type for applying " << (int)getType();
    }
    return "";
}