]> git.localhorst.tv Git - l2e.git/commitdiff
postponed attack type decision to their respective states
authorDaniel Karbach <daniel.karbach@localhorst.tv>
Thu, 9 Aug 2012 12:54:58 +0000 (14:54 +0200)
committerDaniel Karbach <daniel.karbach@localhorst.tv>
Thu, 9 Aug 2012 12:54:58 +0000 (14:54 +0200)
src/battle/states/SelectAttackType.cpp
src/battle/states/SelectIkari.cpp
src/battle/states/SelectItem.cpp
src/battle/states/SelectSpell.cpp

index 5e687b670622ec25f4b870cacfe00fa15a34e3cb..786277d764900f036dbfffca578d3eacfd0db114 100644 (file)
@@ -65,10 +65,10 @@ void SelectAttackType::HandleInput(const Input &input) {
        }
 
        if (input.JustPressed(Input::ACTION_A)) {
-               battle->SetAttackType(battle->GetAttackTypeMenu().Selected());
                switch (battle->GetAttackTypeMenu().Selected()) {
                        case AttackChoice::SWORD:
                                // TODO: switch to target select
+                               battle->SetAttackType(AttackChoice::SWORD);
                                battle->NextHero();
                                break;
                        case AttackChoice::MAGIC:
@@ -77,6 +77,7 @@ void SelectAttackType::HandleInput(const Input &input) {
                                }
                                break;
                        case AttackChoice::DEFEND:
+                               battle->SetAttackType(AttackChoice::DEFEND);
                                battle->NextHero();
                                break;
                        case AttackChoice::IKARI:
index 3c11164ffcb8ede50fdba1c53c9661cb89c79734..85b61c79d24443dc02be1396e07e7c81b39e06cc 100644 (file)
@@ -49,6 +49,7 @@ void SelectIkari::HandleInput(const Input &input) {
        if (input.JustPressed(Input::ACTION_A)) {
                // TODO: switch to target select
                if (battle->GetIkariMenu().SelectedIsEnabled()) {
+                       battle->SetAttackType(AttackChoice::IKARI);
                        battle->NextHero();
                        ctrl->PopState();
                }
index 0bdd4b10c3adfba9fe4216e5a8b9e6cc1d582628..4f6c7af1eb049b4b6d0492132a823a4f0b0a22e4 100644 (file)
@@ -49,6 +49,7 @@ void SelectItem::HandleInput(const Input &input) {
        if (input.JustPressed(Input::ACTION_A)) {
                // TODO: switch to target select
                if (battle->GetItemMenu().SelectedIsEnabled()) {
+                       battle->SetAttackType(AttackChoice::ITEM);
                        battle->NextHero();
                        ctrl->PopState();
                }
index f50e05947a2b819d2085c5eda80363da68b65f85..db5bb45981c723727758a85968c9f8cfe947c01d 100644 (file)
@@ -50,6 +50,7 @@ void SelectSpell::HandleInput(const Input &input) {
        if (input.JustPressed(Input::ACTION_A)) {
                // TODO: switch to target select
                if (battle->GetSpellMenu().SelectedIsEnabled()) {
+                       battle->SetAttackType(AttackChoice::MAGIC);
                        battle->NextHero();
                        ctrl->PopState();
                }