示例#1
0
        /// <summary>
        /// Author: Denis, Ziqi
        /// Dash execution timer (how long the dash takes)
        /// Also triggers rumble.
        /// </summary>
        /// <returns></returns>
        IEnumerator DashExecution()
        {
            AnimatorController.SetBool("IsDashing", true);
            CombatManager.SetInvincible(true);

            if (PlayerMultiplayer.hasVibration == true)
            {
                Gamepad.current.SetMotorSpeeds(0f, 0.5f);
            }

            yield return(new WaitForSecondsRealtime(DashExecutionTime));

            IsDashing = false;
            CombatManager.SetInvincible(false);

            PlayerCombat.StopAttack();

            if (IsAirDashing == true)
            {
                AnimatorController.SetBool("IsAirDashing", true);
                IsAirDashing = false;
            }

            AnimatorController.SetBool("IsDashing", false);
            Gamepad.current.ResetHaptics();

            StartCoroutine(DashCooldown());
        }
示例#2
0
        /// <summary>
        /// Author: Denis
        /// Processes the RB(XB)/R1(PS4) button press and executes the ground pound
        /// </summary>
        /// <param name="Ctx"></param>
        private void RegisterGroundPound(InputAction.CallbackContext Ctx)
        {
            if (IsGroundPound == false && PlayerJump.IsGrounded == false && BlockInput == false &&
                PlayerKnockback.IsKnockback == false)
            {
                IsGroundPound = true;

                CombatManager.SetInvincible(true);

                AnimatorController.SetBool("IsGroundPound", true);
                StartCoroutine(AnimationTrigger("IsGroundPound"));

                StartCoroutine(GroundPoundExecution());
            }
        }
示例#3
0
        /// <summary>
        /// Author: Denis
        /// Checks for button press, if the button is released pre-emptively the action is cancelled.
        /// </summary>
        private void Charger()
        {
            if (Gamepad.current.buttonNorth.isPressed == false)
            {
                Vector3 V = (OtherPlayer.transform.position - transform.position);
                if (PullDashCharged == false || V.magnitude > MaxTriggerDistance)
                {
                    StopAllCoroutines();
                    Gamepad.current.ResetHaptics();
                    ChargingPullDash = false;

                    PhotonView.Get(PlayerVFX).RPC("UpdateBeamAndBegin", RpcTarget.All, false);
                }
                else
                {
                    PhotonView.Get(PlayerVFX).RPC("UpdateBeamAll", RpcTarget.All, false);

                    T   = OtherPlayerTarget.transform.position;
                    Dir = (OtherPlayerTarget.transform.position - transform.position);

                    ChargingPullDash = false;
                    IsPullDashing    = true;
                    DisableGravity   = true;

                    PlayerJump.HasSecondJump = true;
                    PlayerJump.HasJumped     = false;

                    AnimatorController.SetBool("IsPullDashing", true);
                    StartCoroutine(AnimationTrigger("IsPullDashing"));

                    CombatManager.SetInvincible(true);

                    //Time limit on the pull dash execution
                    StartCoroutine(PullDashTimer());
                }
            }
        }