X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fbattle%2Fstates%2FPerformAttacks.cpp;h=8550318d05cf83942cafb5619ea2a647869a98ce;hb=7263bddbde91d555decd58f043f6b43f54ba2b00;hp=6baa1dae0fe700d64d70bab13141d7d857179a0c;hpb=a01c2f05b5a6493d7fe097eb15e5337a095992ae;p=l2e.git diff --git a/src/battle/states/PerformAttacks.cpp b/src/battle/states/PerformAttacks.cpp index 6baa1da..8550318 100644 --- a/src/battle/states/PerformAttacks.cpp +++ b/src/battle/states/PerformAttacks.cpp @@ -39,6 +39,7 @@ void PerformAttacks::EnterState(Application &c, SDL_Surface *screen) { } void PerformAttacks::ExitState(Application &c, SDL_Surface *screen) { + battle->ClearAllAttacks(); ctrl = 0; } @@ -60,9 +61,9 @@ void PerformAttacks::HandleEvents(const Input &input) { CheckAnimations(); if (HasAnimationsRunning()) return; ResetAnimation(); + battle->ApplyDamage(); battle->NextAttack(); if (battle->AttacksFinished()) { - battle->ClearAllAttacks(); ctrl->PopState(); return; } @@ -70,9 +71,9 @@ void PerformAttacks::HandleEvents(const Input &input) { battle->CalculateDamage(); if (battle->CurrentAttack().isMonster) { - const Monster &monster(battle->MonsterAt(battle->CurrentAttack().index)); + Monster &monster(battle->MonsterAt(battle->CurrentAttack().index)); titleBarText = monster.Name(); - moveAnimation = 0; + moveAnimation = monster.AttackAnimation(); } else { Hero &hero(battle->HeroAt(battle->CurrentAttack().index)); const AttackChoice &ac(battle->AttackChoiceAt(battle->CurrentAttack().index));