void OnEndOfAttack(BaseEventParameters baseParams)
 {
     EndOfAttackEventParameters endOfAttackEvent = (EndOfAttackEventParameters)baseParams;
     if (m_AttackComponent.GetCurrentAttackLogic() == null || m_AttackComponent.CheckIsCurrentAttack(endOfAttackEvent.m_Attack))
     {
         m_CurrentAttack = null;
     }
 }
Exemple #2
0
    private bool CanBlockGrabAttack(PlayerBaseAttackLogic attackLogic)
    {
        // Can't blocked grab attack when stunned
        if (!m_StunInfoSC.IsStunned())
        {
            if (m_AttackComponent)
            {
                // Check if we are playing grab attack as well
                if (m_AttackComponent.GetCurrentAttackLogic() is PlayerGrabAttackLogic grabAttack)
                {
                    return(grabAttack.GetGrabPhase() == EGrabPhase.Startup);
                }
            }
        }

        return(false);
    }
Exemple #3
0
    void EndOfAttack(BaseEventParameters baseParams)
    {
        EndOfAttackEventParameters endOfAttackParams = (EndOfAttackEventParameters)baseParams;

        ChronicleManager.AddChronicle(gameObject, EChronicleCategory.Movement, "On end of attack : " + endOfAttackParams.m_Attack);
        if (m_IsMovementBlocked)
        {
            // We need to check m_AttackComponent.GetCurrentAttack().m_AnimationAttackName AND m_AttackComponent.GetCurrentAttackLogic().GetAnimationAttackName() because for ProjectileAttack,
            // it can happen that a different animation is triggered due to guard crush property, so the animation attack name is changed at runtime
            if (m_AttackComponent.GetCurrentAttack() == null ||
                m_AttackComponent.GetCurrentAttack().m_AnimationAttackName == endOfAttackParams.m_Attack ||
                m_AttackComponent.GetCurrentAttackLogic().GetAnimationAttackName() == endOfAttackParams.m_Attack.ToString())
            {
                SetMovementBlocked(false, EBlockedReason.EndAttack);
            }
        }
    }
    public virtual EHitNotificationType GetHitNotificationType(EAttackResult attackResult, bool isInBlockingStance, bool isCrouching, bool isFacingRight, PlayerAttackComponent victimAttackComponent)
    {
        if (victimAttackComponent.GetCurrentAttackLogic() != null)
        {
            EAttackState victimAttackState = victimAttackComponent.CurrentAttackState;
            if (victimAttackState == EAttackState.Startup || victimAttackState == EAttackState.Active)
            {
                return(EHitNotificationType.Counter);
            }
        }

        if (m_Attack.m_NeededStanceList.Contains(EPlayerStance.Jump) && m_MovementComponent.IsJumping())
        {
            if (m_CurrentCrossupCoroutine != null)
            {
                m_AttackComponent.StopCoroutine(m_CurrentCrossupCoroutine);
            }

            m_CurrentCrossupCoroutine = ValidateCrossup_Coroutine(victimAttackComponent.transform);
            m_AttackComponent.StartCoroutine(m_CurrentCrossupCoroutine);
        }

        return(EHitNotificationType.None);
    }
    private void HandleCollision(Collider2D collision)
    {
        if (m_Collider.isActiveAndEnabled)
        {
            if (collision.CompareTag(Utils.GetEnemyTag(gameObject)) && collision.gameObject != gameObject)
            {
#if UNITY_EDITOR || DEBUG_DISPLAY
                if (!collision.gameObject.GetComponent <PlayerGrabHurtBoxHandler>())
                {
                    KakutoDebug.LogError("GrabBox has collided with something else than GrabHurtBox !");
                }
#endif
                Utils.GetEnemyEventManager(gameObject).TriggerEvent(EPlayerEvent.GrabTry, new GrabTryEventParameters(m_PlayerAttackComponent.GetCurrentAttackLogic()));
            }
        }
    }