public PlayerSuperGaugeSubComponent(PlayerInfoComponent infoComp) : base(infoComp.gameObject)
    {
        m_InfoComponent = infoComp;

        if (m_InfoComponent.GetPlayerSettings().SuperGaugeAlwaysFilled)
        {
            IncreaseGaugeValue(AttackConfig.Instance.m_SuperGaugeMaxValue);
        }
        else
        {
            IncreaseGaugeValue(GameManager.Instance.GetSubManager <RoundSubGameManager>(ESubManager.Round).GetPlayerSuperGaugeValue(m_InfoComponent.GetPlayerEnum()));
        }
        m_InfoComponent.GetPlayerSettings().OnSuperGaugeAlwaysFilledChanged += OnSuperGaugeAlwaysFilledChanged;
    }
Exemple #2
0
    // Update is called once per frame
    void Update()
    {
        if (IsPlayerTimeFrozen())
        {
            return;
        }

        UpdatePlayerSide();

        int playerIndex = m_InfoComponent.GetPlayerIndex();

        m_HorizontalMoveInput = 0f;
        m_JumpInput           = false;
        m_CrouchInput         = false;

        bool          isStatic      = m_InfoComponent.GetPlayerSettings().m_IsStatic;
        EPlayerStance defaultStance = m_InfoComponent.GetPlayerSettings().m_DefaultStance;

        if (m_MovementBlockedReason != EBlockedReason.TimeOver)
        {
            m_CrouchInput = (isStatic) ? defaultStance == EPlayerStance.Crouch : InputManager.GetCrouchInput(playerIndex);
        }

        if (!m_IsMovementBlocked)
        {
            if (!isStatic)
            {
                m_HorizontalMoveInput = InputManager.GetHorizontalMovement(playerIndex);
            }
            m_JumpInput = (isStatic) ? defaultStance == EPlayerStance.Jump : InputManager.GetJumpInput(playerIndex);

            if (IsStanding())
            {
                if (m_JumpInput && !m_JumpTakeOffRequested && !m_TriggerJumpImpulse && m_Controller.CanJump())
                {
                    ChronicleManager.AddChronicle(gameObject, EChronicleCategory.Movement, "Jump take off requested");

                    m_Animator.SetTrigger(K_ANIM_TAKE_OFF_TRIGGER);
                    m_AttackComponent.SetAttackBlockedByTakeOff(true);
                    m_JumpTakeOffRequested = true;
                    m_JumpTakeOffDirection = m_HorizontalMoveInput;
                }
            }
        }

        m_Animator.SetBool(K_ANIM_IS_CROUCHING_BOOL, m_CrouchInput);
        m_Animator.SetFloat(K_ANIM_SPEED_FLOAT, Mathf.Abs(m_HorizontalMoveInput));
    }
Exemple #3
0
    private bool IsBlockingAllAttacks()
    {
        // Can block all attack only in dummy mode => attack disabled
        PlayerSettings playerSettings = m_InfoComponent.GetPlayerSettings();

        if (playerSettings.m_IsBlockingAllAttacks && !playerSettings.m_AttackEnabled)
        {
            if (playerSettings.m_DefaultStance == EPlayerStance.Jump)
            {
                return(m_MovementComponent.IsJumping() == false);
            }
            else
            {
                return(true);
            }
        }

        return(false);
    }
Exemple #4
0
    public static void SetTriggerPointStatus(PlayerInfoComponent infoComponent, ETriggerPointStatus status)
    {
        if (status == ETriggerPointStatus.Inactive)
        {
            if (m_TriggerPointStatus[infoComponent.GetPlayerIndex()] == ETriggerPointStatus.Triggered)
            {
                infoComponent.ResetDefaultAndCurrentPalette();
            }

            if (infoComponent.GetPlayerSettings().TriggerPointAlwaysActive)
            {
                status = ETriggerPointStatus.Active;
            }
        }

        m_TriggerPointStatus[infoComponent.GetPlayerIndex()] = status;
        OnTriggerPointStatusChanged[infoComponent.GetPlayerIndex()]?.Invoke(status);
    }
 public override void OnDestroy()
 {
     base.OnDestroy();
     m_InfoComponent.GetPlayerSettings().OnSuperGaugeAlwaysFilledChanged -= OnSuperGaugeAlwaysFilledChanged;
     GamePauseMenuComponent.IsInPauseChanged -= FillSuperGaugeAfterPause;
 }