}
battle->CalculateDamage();
+ const Battle::Order &attack = battle->CurrentAttack();
- if (battle->CurrentAttack().IsMonster()) {
- Monster &monster(battle->MonsterAt(battle->CurrentAttack().index));
+ if (attack.IsMonster()) {
+ Monster &monster(battle->MonsterAt(attack.index));
titleBarText = monster.Name();
targetAnimation = AnimationRunner(monster.MeleeAnimation());
moveAnimation = AnimationRunner(monster.AttackAnimation());
monster.SetAnimation(moveAnimation);
- AddNumberAnimations(battle->MonsterAt(battle->CurrentAttack().index).GetAttackChoice().Selection());
- } else if (battle->CurrentAttack().IsCapsule()) {
+ AddNumberAnimations(monster.GetAttackChoice().Selection());
+ } else if (attack.IsCapsule()) {
Capsule &capsule(battle->GetCapsule());
titleBarText = capsule.Name();
targetAnimation = AnimationRunner(capsule.MeleeAnimation());
capsule.SetAnimation(moveAnimation);
AddNumberAnimations(capsule.GetAttackChoice().Selection());
} else {
- Hero &hero(battle->HeroAt(battle->CurrentAttack().index));
- const AttackChoice &ac(battle->CurrentAttackAttackChoice());
+ Hero &hero(battle->HeroAt(attack.index));
+ const AttackChoice &ac(hero.GetAttackChoice());
switch (ac.GetType()) {
case AttackChoice::SWORD:
}
if (moveAnimation.Valid()) {
moveAnimation.Start(*this);
- if (battle->CurrentAttack().IsMonster()) {
- battle->MonsterAt(battle->CurrentAttack().index).SetAnimation(moveAnimation);
- } else if (battle->CurrentAttack().IsHero()) {
- battle->HeroAt(battle->CurrentAttack().index).SetAnimation(moveAnimation);
+ if (attack.IsMonster()) {
+ battle->MonsterAt(attack.index).SetAnimation(moveAnimation);
+ } else if (attack.IsHero()) {
+ battle->HeroAt(attack.index).SetAnimation(moveAnimation);
} else {
battle->GetCapsule().SetAnimation(moveAnimation);
}