- if (titleBarText) {
- titleBarText = 0;
- ++cursor;
- if (cursor == battle->NumHeroes()) {
- cursor = 0;
- monsters = true;
- }
- } else {
- const AttackChoice &ac(battle->AttackChoiceAt(cursor));
- switch (ac.GetType()) {
- case AttackChoice::SWORD:
- titleBarText = battle->HeroAt(cursor).HasWeapon() ? battle->HeroAt(cursor).Weapon()->Name() : "Gauntlet";
- break;
- case AttackChoice::MAGIC:
- titleBarText = ac.GetSpell()->Name();
- break;
- case AttackChoice::DEFEND:
- titleBarText = "Defends.";
- break;
- case AttackChoice::IKARI:
- titleBarText = ac.GetItem()->HasIkari() ? ac.GetItem()->GetIkari()->Name() : "No Ikari?";
- break;
- case AttackChoice::ITEM:
- titleBarText = ac.GetItem()->Name();
- break;
- case AttackChoice::UNDECIDED:
- titleBarText = "WTF???";
- break;
- }
+ battle->HeroAt(battle->CurrentAttack().index).SetAnimation(moveAnimation);
+ }
+ }
+ if (targetAnimation.Valid()) {
+ targetAnimationTimer = GraphicsTimers().StartCountdown(150);
+ } else {
+ targetAnimationTimer.Clear();
+ }
+}
+
+void PerformAttacks::AddNumberAnimations(const TargetSelection &ts) {
+ if (ts.TargetsMonsters()) {
+ 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->MonsterAt(i).Position());
+ } else if (ts.IsGood(i)) {
+ numberAnimation.push_back(NumberAnimation(ts.GetAmount(i), battle->Res().numberAnimationPrototype, battle->Res().greenNumberSprite));
+ numberPosition.push_back(
+ battle->MonsterAt(i).Position());
+ }
+ }
+ } 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->HeroAt(i).Position());
+ } else if (ts.IsGood(i)) {
+ numberAnimation.push_back(NumberAnimation(ts.GetAmount(i), battle->Res().numberAnimationPrototype, battle->Res().greenNumberSprite));
+ numberPosition.push_back(
+ battle->HeroAt(i).Position());