From: Daniel Karbach Date: Thu, 9 Aug 2012 12:54:58 +0000 (+0200) Subject: postponed attack type decision to their respective states X-Git-Url: https://git.localhorst.tv/?a=commitdiff_plain;h=536a8c96ebfec2a2b34f680d3d0b97db8e66d599;p=l2e.git postponed attack type decision to their respective states --- diff --git a/src/battle/states/SelectAttackType.cpp b/src/battle/states/SelectAttackType.cpp index 5e687b6..786277d 100644 --- a/src/battle/states/SelectAttackType.cpp +++ b/src/battle/states/SelectAttackType.cpp @@ -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: diff --git a/src/battle/states/SelectIkari.cpp b/src/battle/states/SelectIkari.cpp index 3c11164..85b61c7 100644 --- a/src/battle/states/SelectIkari.cpp +++ b/src/battle/states/SelectIkari.cpp @@ -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(); } diff --git a/src/battle/states/SelectItem.cpp b/src/battle/states/SelectItem.cpp index 0bdd4b1..4f6c7af 100644 --- a/src/battle/states/SelectItem.cpp +++ b/src/battle/states/SelectItem.cpp @@ -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(); } diff --git a/src/battle/states/SelectSpell.cpp b/src/battle/states/SelectSpell.cpp index f50e059..db5bb45 100644 --- a/src/battle/states/SelectSpell.cpp +++ b/src/battle/states/SelectSpell.cpp @@ -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(); }