X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fbattle%2Fstates%2FPerformAttacks.cpp;h=43414eb89a60d86e7964ad2f63861da7818f5b8e;hb=10a8d3a83e7ad6815bc9f752922239ef32073a5e;hp=fac7cdf855aa42a4c8422f38e5ebd715afd52608;hpb=e1edc92c4fb834c8061118e89c0d7e239742b030;p=l2e.git diff --git a/src/battle/states/PerformAttacks.cpp b/src/battle/states/PerformAttacks.cpp index fac7cdf..43414eb 100644 --- a/src/battle/states/PerformAttacks.cpp +++ b/src/battle/states/PerformAttacks.cpp @@ -67,13 +67,20 @@ void PerformAttacks::HandleEvents(const Input &input) { battle->CalculateDamage(); - if (battle->CurrentAttack().isMonster) { + if (battle->CurrentAttack().IsMonster()) { Monster &monster(battle->MonsterAt(battle->CurrentAttack().index)); titleBarText = monster.Name(); targetAnimation = AnimationRunner(monster.MeleeAnimation()); moveAnimation = AnimationRunner(monster.AttackAnimation()); monster.SetAnimation(moveAnimation); AddNumberAnimations(battle->MonsterAt(battle->CurrentAttack().index).GetAttackChoice().Selection()); + } else if (battle->CurrentAttack().IsCapsule()) { + Capsule &capsule(battle->GetCapsule()); + titleBarText = capsule.Name(); + targetAnimation = AnimationRunner(capsule.MeleeAnimation()); + moveAnimation = AnimationRunner(capsule.AttackAnimation()); + capsule.SetAnimation(moveAnimation); + AddNumberAnimations(capsule.GetAttackChoice().Selection()); } else { Hero &hero(battle->HeroAt(battle->CurrentAttack().index)); const AttackChoice &ac(battle->HeroAt(battle->CurrentAttack().index).GetAttackChoice()); @@ -122,10 +129,12 @@ void PerformAttacks::HandleEvents(const Input &input) { if (titleBarText) titleBarTimer = GraphicsTimers().StartCountdown(850); if (moveAnimation.Valid()) { moveAnimation.Start(*this); - if (battle->CurrentAttack().isMonster) { + if (battle->CurrentAttack().IsMonster()) { battle->MonsterAt(battle->CurrentAttack().index).SetAnimation(moveAnimation); - } else { + } else if (battle->CurrentAttack().IsHero()) { battle->HeroAt(battle->CurrentAttack().index).SetAnimation(moveAnimation); + } else { + battle->GetCapsule().SetAnimation(moveAnimation); } } if (targetAnimation.Valid()) { @@ -195,7 +204,7 @@ bool PerformAttacks::HasAnimationsRunning() const { void PerformAttacks::ResetAnimation() { if (moveAnimation.Valid()) { moveAnimation.Clear(); - if (!battle->CurrentAttack().isMonster) { + if (!battle->CurrentAttack().IsMonster()) { battle->HeroAt(battle->CurrentAttack().index).GetAnimation().Clear(); } }