#include "PartyLayout.h"
#include "states/SelectMoveAction.h"
+#include "states/PerformAttacks.h"
#include "../app/Application.h"
#include "../app/Input.h"
#include "../common/Ikari.h"
monstersLayout->CalculatePositions(background->w, background->h, monsterPositions);
heroesLayout->CalculatePositions(background->w, background->h, heroesPositions);
for (vector<Hero>::size_type i(0), end(heroes.size()); i < end; ++i) {
- spellMenus.push_back(res->spellMenuPrototype);
+ spellMenus[i] = res->spellMenuPrototype;
LoadSpellMenu(i);
- ikariMenus.push_back(res->ikariMenuPrototype);
+ ikariMenus[i] = res->ikariMenuPrototype;
LoadIkariMenu(i);
heroTags[i] = HeroTag(this, i);
}
itemMenu.AddEmptyEntry();
}
}
+ ClearAllAttacks();
}
void BattleState::ExitState(Application &ctrl, SDL_Surface *screen) {
ctrl.PopState(); // quit the battle scene
return;
}
- // reset attack choices
- activeHero = -1;
- for (vector<Hero>::size_type i(0), end(heroes.size()); i < end; ++i) {
- attackChoices[i] = AttackChoice(this);
+ if (AttackSelectionDone()) {
+ ctrl.PushState(new PerformAttacks(this));
+ } else {
+ ctrl.PushState(new SelectMoveAction(this));
}
- ctrl.PushState(new SelectMoveAction(this));
}
void BattleState::PauseState(Application &ctrl, SDL_Surface *screen) {
}
+void BattleState::ClearAllAttacks() {
+ activeHero = -1;
+ for (vector<Hero>::size_type i(0), end(heroes.size()); i < end; ++i) {
+ attackChoices[i] = AttackChoice(this);
+ }
+}
+
+
void BattleState::HandleEvents(const Input &input) {
}