X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fbattle%2Fstates%2FSelectIkari.cpp;h=7ccfdc481aefa411c44339c7da9bb5d3fe0f2c80;hb=00b557a47e47d9410730d47d436f6158a3fb79f5;hp=adeafb29fd7ca5ebfefe6825024e3867eb1aea5f;hpb=6d080d21d8055df9962296863b4c0954bc81410b;p=l2e.git diff --git a/src/battle/states/SelectIkari.cpp b/src/battle/states/SelectIkari.cpp index adeafb2..7ccfdc4 100644 --- a/src/battle/states/SelectIkari.cpp +++ b/src/battle/states/SelectIkari.cpp @@ -36,7 +36,9 @@ void SelectIkari::ExitState(Application &c, SDL_Surface *screen) { } void SelectIkari::ResumeState(Application &ctrl, SDL_Surface *screen) { - if (battle->ActiveHeroTargets().HasSelected()) { + if (battle->ActiveHeroAttackChoice().Selection().HasSelected()) { + battle->ActiveHeroAttackChoice().SetType(AttackChoice::IKARI); + battle->ActiveHeroAttackChoice().SetItem(battle->GetIkariMenu().Selected()); ctrl.PopState(); } } @@ -55,25 +57,25 @@ void SelectIkari::HandleEvents(const Input &input) { if (input.JustPressed(Input::ACTION_A)) { if (battle->GetIkariMenu().SelectedIsEnabled() && battle->GetIkariMenu().Selected()->HasIkari()) { const Ikari *ikari(battle->GetIkariMenu().Selected()->GetIkari()); - battle->ActiveHeroTargets().Reset(); + battle->ActiveHeroAttackChoice().Selection().Reset(); if (ikari->GetTargetingMode().TargetsAlly()) { - battle->ActiveHeroTargets().SelectHeroes(); + battle->ActiveHeroAttackChoice().Selection().SelectHeroes(); } else { - battle->ActiveHeroTargets().SelectEnemies(); + battle->ActiveHeroAttackChoice().Selection().SelectEnemies(); } if (ikari->GetTargetingMode().TargetsAll()) { - battle->SetAttackType(AttackChoice::MAGIC); + battle->ActiveHeroAttackChoice().SetType(AttackChoice::MAGIC); // TODO: remove item from inventory battle->ActiveHeroAttackChoice().SetItem(battle->GetIkariMenu().Selected()); battle->NextHero(); ctrl->PopState(); } else { if (ikari->GetTargetingMode().TargetsSingle()) { - battle->ActiveHeroTargets().SetSingle(); + battle->ActiveHeroAttackChoice().Selection().SetSingle(); } else { - battle->ActiveHeroTargets().SetMultiple(); + battle->ActiveHeroAttackChoice().Selection().SetMultiple(); } - ctrl->PushState(new SelectTarget(battle, parent, &battle->ActiveHeroTargets(), ikari->IsMagical() ? battle->Res().magicTargetCursor : battle->Res().weaponTargetCursor)); + ctrl->PushState(new SelectTarget(battle, parent, &battle->ActiveHeroAttackChoice().Selection(), ikari->IsMagical() ? battle->Res().magicTargetCursor : battle->Res().weaponTargetCursor)); } } } @@ -109,7 +111,7 @@ void SelectIkari::Render(SDL_Surface *screen) { void SelectIkari::RenderFrame(SDL_Surface *screen, const Vector &offset) { const Frame *frame(battle->Res().selectFrame); Point position(frame->BorderWidth(), frame->BorderHeight()); - int width(battle->BackgroundWidth() - 2 * frame->BorderWidth()); + int width(battle->Width() - 2 * frame->BorderWidth()); int height(battle->Res().normalFont->CharHeight() * 13); frame->Draw(screen, position + offset, width, height); }