const HeroTag &HeroTagAt(int index) const { assert(index >= 0 && index < NumHeroes()); return heroTags[index]; }
const geometry::Vector<int> &HeroTagPositionAt(int index) const { assert(index >= 0 && index < NumHeroes()); return heroTagPositions[index]; }
+ Capsule &GetCapsule() { return capsule; }
+
bool HasChosenAttackType() const { return ActiveHero().GetAttackChoice().GetType() != AttackChoice::UNDECIDED; }
bool AttackSelectionDone() const { return activeHero >= numHeroes; }
void SetRunaway() { ranAway = true; }
struct Order {
- Order(int index, bool isMonster)
- : index(index), isMonster(isMonster) { }
+ enum Performer {
+ HERO,
+ CAPSULE,
+ MONSTER,
+ };
+ Order(Performer by, int index = 0)
+ : index(index), by(by) { }
+ AttackChoice &GetAttackChoice(BattleState &) const;
+ common::Stats &GetStats(BattleState &) const;
+ bool IsHero() const { return by == HERO; }
+ bool IsCapsule() const { return by == CAPSULE; }
+ bool IsMonster() const { return by == MONSTER; }
int index;
- bool isMonster;
+ Performer by;
};
void CalculateAttackOrder();
private:
void LoadInventory();
- void DecideMonsterAttack(Monster &) const;
+ void DecideMonsterAttack(Monster &);
+ void DecideCapsuleAttack();
void CalculateDamage(const common::Stats &attackerStats, TargetSelection &targets) const;
Uint16 CalculateDamage(const common::Stats &attacker, const common::Stats &defender) const;