+ break;
+ case AttackChoice::ITEM:
+ titleBarText = ac.GetItem()->Name();
+ moveAnimation = 0;
+ break;
+ case AttackChoice::UNDECIDED:
+ titleBarText = "UNDECIDED";
+ moveAnimation = 0;
+ break;
+ }
+ }
+
+ if (titleBarText) titleBarTimer = GraphicsTimers().StartCountdown(1500);
+ if (moveAnimation) moveAnimation->Start(*this);
+}
+
+void PerformAttacks::CheckNumberAnimation() {
+ if (moveAnimation && moveAnimation->Running()) return;
+ if (!moveAnimation || moveAnimation->JustFinished()) {
+ for (vector<NumberAnimation>::iterator i(numberAnimation.begin()), end(numberAnimation.end()); i != end; ++i) {
+ i->Start(*this);
+ }
+ } else {
+ for (vector<NumberAnimation>::iterator i(numberAnimation.begin()), end(numberAnimation.end()); i != end; ++i) {
+ i->CheckTimers(*this);
+ }
+ }
+}
+
+bool PerformAttacks::HasAnimationsRunning() const {
+ if (titleBarTimer.Running()) return true;
+ if (moveAnimation && moveAnimation->Running()) return true;
+ for (vector<NumberAnimation>::const_iterator i(numberAnimation.begin()), end(numberAnimation.end()); i != end; ++i) {
+ if (i->Running()) return true;
+ }
+ return false;
+}
+
+void PerformAttacks::ResetAnimation() {
+ if (moveAnimation) moveAnimation->Stop();
+ titleBarTimer.Clear();
+ numberAnimation.clear();
+ numberPosition.clear();
+}
+
+void PerformAttacks::AdvanceCursor() {
+ ++cursor;
+ while (cursor < int(order.size())) {
+ if (order[cursor].isMonster) {
+ if (battle->MonsterAt(order[cursor].index).Health() > 0) break;