コード例 #1
0
string CreatureAttributes::getDescription() const {
  if (!isSpecial)
    return "";
  string attack;
  if (attackEffect)
    attack = " It has a " + Effect::getName(*attackEffect) + " attack.";
  return adjectives(getSize(), isUndead(), notLiving) +
      (isHumanoid() ? " humanoid" : " beast") + (!isCorporal() ? " spirit" : "") +
      bodyDescription() + ". " + attack;
}
コード例 #2
0
double CreatureAttributes::getMinDamage(BodyPart part) const {
  map<BodyPart, double> damage {
    {BodyPart::WING, 0.3},
    {BodyPart::ARM, 0.6},
    {BodyPart::LEG, 0.8},
    {BodyPart::HEAD, 0.8},
    {BodyPart::TORSO, 1.5},
    {BodyPart::BACK, 1.5}};
  if (isUndead())
    return damage.at(part) / 2;
  else
    return damage.at(part);
}
コード例 #3
0
ファイル: army_troop.cpp プロジェクト: blchinezu/EZX-Projects
bool Army::Troop::isAffectedByMorale(void) const
{
    return !(isUndead() || isElemental());
}