Exemple #1
0
string makeSentence(string s) {
  s = capitalFirst(s);
  if (s.size() > 1 && s[0] == '\"' && islower(s[1]))
    s[1] = toupper(s[1]);
  if (!hasSentenceEnding(s))
    s.append(".");
  return s;
}
Exemple #2
0
void advance(View* view, const Technology* tech) {
  string text;
  const vector<Technology*>& prerequisites = tech->getPrerequisites();
  const vector<Technology*>& allowed = tech->getAllowed();
  if (!prerequisites.empty())
    text += "Requires: " + combine(prerequisites) + "\n";
  if (!allowed.empty())
    text += "Allows research: " + combine(allowed) + "\n";
  const vector<SpellInfo>& spells = Collective::getSpellLearning(tech);
  if (!spells.empty())
    text += "Teaches spells: " + combine(spells) + "\n";
  const vector<PlayerControl::RoomInfo>& rooms = filter(PlayerControl::getRoomInfo(), 
      [tech] (const PlayerControl::RoomInfo& info) { return info.techId && Technology::get(*info.techId) == tech;});
  if (!rooms.empty())
    text += "Unlocks rooms: " + combine(rooms) + "\n";
  if (!tech->canResearch())
    text += " \nCan only be acquired by special means.";
  view->presentText(capitalFirst(tech->getName()), text);
}
Exemple #3
0
Item::Item(const ItemAttributes& attr) : Renderable(ViewObject(*attr.viewId, ViewLayer::ITEM, capitalFirst(*attr.name))),
    attributes(attr), fire(attr.burnTime), canEquipCache(!!attributes->equipmentSlot),
    classCache(*attributes->itemClass) {
  if (!attributes->prefixes.empty())
    modViewObject().setModifier(ViewObject::Modifier::AURA);
  modViewObject().setGenericId(getUniqueId().getGenericId());
}
Exemple #4
0
void skill(View* view, const Skill* skill) {
  view->presentText(capitalFirst(skill->getName()), skill->getHelpText());
}