void RPG_PlayerControllerState::PowerAttacking::OnProcessAnimationEvent(RPG_ControllerComponent *const controller, hkbEvent const& animationEvent)
{
  RPG_ControllerStateBase::OnProcessAnimationEvent(controller, animationEvent);

  RPG_Character *const character = controller->GetCharacter();

  if(character->GetIdForAnimationEvent(RPG_CharacterAnimationEvent::kPowerAttackEnd) == animationEvent.getId())
  {
    controller->SetState(RPG_ControllerStateId::kIdling);
  }
  else if(character->GetIdForAnimationEvent(RPG_CharacterAnimationEvent::kPowerAttackFire) == animationEvent.getId())
  {
    character->CreateCharacterEffect(FX_PowerAttack);

    // Do attack
    character->DoPowerAttack();
  }
}
void RPG_PlayerControllerState::MeleeAttacking::OnProcessAnimationEvent(RPG_ControllerComponent *controller, hkbEvent const& animationEvent)
{
  RPG_ControllerStateBase::OnProcessAnimationEvent(controller, animationEvent);

  RPG_Character *const character = controller->GetCharacter();

  if(character->GetIdForAnimationEvent(RPG_CharacterAnimationEvent::kMeleeAttackEnd) == animationEvent.getId())
  {
    controller->SetState(RPG_ControllerStateId::kIdling);
  }
  else if(character->GetIdForAnimationEvent(RPG_CharacterAnimationEvent::kMeleeAttackFire) == animationEvent.getId())
  {
    // Do attack
    character->DoMeleeAttack(vstatic_cast<RPG_DamageableEntity*>(controller->GetTarget()));
  }
}
void RPG_PlayerControllerState::RangedAttacking::OnProcessAnimationEvent(RPG_ControllerComponent *const controller, hkbEvent const& animationEvent)
{
  RPG_ControllerStateBase::OnProcessAnimationEvent(controller, animationEvent);

  RPG_Character *const character = controller->GetCharacter();

  if(character->GetIdForAnimationEvent(RPG_CharacterAnimationEvent::kRangedAttackEnd) == animationEvent.getId())
  {
    controller->SetState(RPG_ControllerStateId::kIdling);
  }
  else if(character->GetIdForAnimationEvent(RPG_CharacterAnimationEvent::kRangedAttackFire) == animationEvent.getId())
  {
    // Do attack
    character->PauseCharacterEffect(FX_RangedAttackChargeLoop);
    character->CreateCharacterEffect(FX_RangedAttackFire);

    character->DoRangedAttack(controller->GetTargetPoint());
  }
}
void RPG_AiControllerState::Challenging::OnProcessAnimationEvent(RPG_ControllerComponent *const controller, hkbEvent const& animationEvent)
{
  RPG_ControllerStateBase::OnProcessAnimationEvent(controller, animationEvent);

  if(controller->GetCharacter()->GetIdForAnimationEvent(RPG_CharacterAnimationEvent::kChallengeEnd) == animationEvent.getId())
  {
    controller->SetState(RPG_ControllerStateId::kIdling);
  }
}