Esempio n. 1
0
 void TypeOfSlowDown(PlayerStates state)
 {
     if (state.Equals(PlayerStates.Punch) || state.Equals(PlayerStates.Spin))
     {
         rigidbody.drag = 0f;
         return;
     }
 }
Esempio n. 2
0
    public void Dash()
    {
        if (dead || frozen || stunned || inCutscene || currentState.Equals(PlayerStates.SURF))
        {
            return;
        }

        if (dashCooldown)
        {
            earlyDashInput = true;
            Invoke("EndEarlyDashInput", missedInputCooldown);
            return;
        }

        /*
         * if (!grounded && airDashes < 1) {
         *      return;
         * }
         * airDashes--;
         */

        StartCombatStanceCooldown();
        CameraShaker.MedShake();
        anim.SetTrigger("Dash");
    }
Esempio n. 3
0
 private void OnTriggerEnter2D(Collider2D collision)
 {
     if (State.Equals(PlayerStates.cleanedFromOil))
     {
         DefaultAngularDragFactor = collision.gameObject.GetComponent <Rigidbody2D>().angularDrag;
         DefaultLinerDragFactor   = collision.gameObject.GetComponent <Rigidbody2D>().drag;
     }
     collision.gameObject.GetComponent <Rigidbody2D>().angularDrag = AngularDragFactor;
     collision.gameObject.GetComponent <Rigidbody2D>().drag        = LinerDragFactor;
     State = PlayerStates.stayOnOil;
     StartCoroutine(SetDefaultForPlayer(collision));
 }
Esempio n. 4
0
    public bool validateNewAction(PlayerActions newAction)
    {
        FSMState current = getCurrentState();

        PlayerStates newState = current.validateNewAction(newAction);

        if (newState.Equals(PlayerStates.NULL))
        {
            return(false);
        }
        else
        {
            currentState = newState;
            return(true);
        }
    }
Esempio n. 5
0
 bool ApplySlowDown() // If the player has an ingredient or is running it will update velocity
 {
     return(targetState.Equals(PlayerStates.Run) || targetState.Equals(PlayerStates.Ingredient) ? false : true);
 }
Esempio n. 6
0
 bool ApplyRotation() // If the player is in one of the states it will not update rotation
 {
     return(currentState.Equals(PlayerStates.Spin) ? true : false);
 }