+ break;
+ case AttackChoice::ITEM:
+ titleBarText = ac.GetItem()->Name();
+ moveAnimation.Clear();
+ break;
+ case AttackChoice::UNDECIDED:
+ titleBarText = "UNDECIDED";
+ moveAnimation.Clear();
+ break;
+ }
+ hero.SetAnimation(moveAnimation);
+ }
+
+ if (titleBarText) titleBarTimer = GraphicsTimers().StartCountdown(850);
+ if (moveAnimation.Valid()) moveAnimation.Start(*this);
+ if (targetAnimation.Valid()) {
+ targetAnimationTimer = GraphicsTimers().StartCountdown(150);
+ } else {
+ targetAnimationTimer.Clear();
+ }
+}
+
+void PerformAttacks::AddNumberAnimations(const TargetSelection &ts) {
+ if (ts.TargetsEnemies()) {
+ for (int i(0); i < battle->MaxMonsters(); ++i) {
+ if (ts.IsBad(i)) {
+ numberAnimation.push_back(NumberAnimation(ts.GetAmount(i), battle->Res().numberAnimationPrototype, battle->Res().bigNumberSprite));
+ numberPosition.push_back(
+ battle->MonsterPositions()[i]);
+ } else if (ts.IsGood(i)) {
+ numberAnimation.push_back(NumberAnimation(ts.GetAmount(i), battle->Res().numberAnimationPrototype, battle->Res().greenNumberSprite));
+ numberPosition.push_back(
+ battle->MonsterPositions()[i]);
+ }
+ }
+ } else {
+ for (int i(0); i < battle->NumHeroes(); ++i) {
+ if (ts.IsBad(i)) {
+ numberAnimation.push_back(NumberAnimation(ts.GetAmount(i), battle->Res().numberAnimationPrototype, battle->Res().bigNumberSprite));
+ numberPosition.push_back(
+ battle->HeroesPositions()[i]);
+ } else if (ts.IsGood(i)) {
+ numberAnimation.push_back(NumberAnimation(ts.GetAmount(i), battle->Res().numberAnimationPrototype, battle->Res().greenNumberSprite));
+ numberPosition.push_back(
+ battle->HeroesPositions()[i]);