Пример #1
0
    // Token: 0x06000FA7 RID: 4007 RVA: 0x0005F2AC File Offset: 0x0005D4AC
    public void BeginBash()
    {
        this.m_timeRemainingOfBashButtonPress = 0f;
        this.IsBashing = true;
        this.Target.OnEnterBash();
        Transform transform = this.TargetAsComponent.transform;

        Sound.Play((!this.Sein.PlayerAbilities.BashBuff.HasAbility) ? this.BashStartSound.GetSound(null) : this.UpgradedBashStartSound.GetSound(null), this.m_seinTransform.position, null);
        if (GameController.Instance)
        {
            GameController.Instance.SuspendGameplay();
        }
        if (UI.Cameras.Current != null)
        {
            SuspensionManager.GetSuspendables(this.m_bashSuspendables, UI.Cameras.Current.GameObject);
            SuspensionManager.Resume(this.m_bashSuspendables);
            this.m_bashSuspendables.Clear();
        }
        this.PlatformMovement.LocalSpeed = Vector2.zero;
        GameObject gameObject = (GameObject)InstantiateUtility.Instantiate(this.BashAttackGamePrefab);

        this.m_bashAttackGame = gameObject.GetComponent <BashAttackGame>();
        this.m_bashAttackGame.SendDirection(transform.position - this.PlatformMovement.Position);
        this.m_bashAttackGame.BashGameComplete  += this.BashGameComplete;
        this.m_bashAttackGame.transform.position = transform.position;
        Vector3 b = Vector3.ClampMagnitude(transform.position - this.PlatformMovement.Position, 2f);

        this.m_playerTargetPosition = transform.position - b;
        this.m_directionToTarget    = b.normalized;
        SeinBashAttack.OnBashBegin();
        this.Sein.PlatformBehaviour.Visuals.Animation.PlayLoop(this.BashChargeAnimation, 10, new Func <bool>(this.ShouldBashChargeAnimationKeepPlaying), false);
    }
Пример #2
0
        private static void HandleFrameRates()
        {
            if (HasFlag(tasState, TASState.Enable) && !HasFlag(tasState, TASState.FrameStep) && !HasFlag(tasState, TASState.Record))
            {
                float rsX = XboxControllerInput.GetAxis(XboxControllerInput.Axis.RightStickX);
                if (!HasFlag(tasStateNext, TASState.ChangeSpeed))
                {
                    tasStateNext |= TASState.ChangeSpeed;
                }
                else if (!MoonInput.GetKey(UnityEngine.KeyCode.T) && !MoonInput.GetKey(UnityEngine.KeyCode.R) && !MoonInput.GetKey(UnityEngine.KeyCode.F) /*&&
                                                                                                                                                           * !(XInputDotNetPure.GamePad.GetState(PlayerIndex.One).Buttons.Guide == ButtonState.Pressed)*/)
                {
                    tasStateNext &= ~TASState.ChangeSpeed;
                }

                if (MoonInput.GetKey(UnityEngine.KeyCode.T))
                {
                    currentSpeed = 0.65f;
                    if (isSuspended)
                    {
                        SuspensionManager.ResumeExcluding(suspendables);
                        suspendables.Clear();
                        slowDownFromKB = false;
                        isSuspended    = false;
                    }
                }
                else if (MoonInput.GetKey(UnityEngine.KeyCode.R))
                {
                    currentSpeed = -0.75f;
                    if (isSuspended)
                    {
                        SuspensionManager.ResumeExcluding(suspendables);
                        suspendables.Clear();
                        slowDownFromKB = false;
                        isSuspended    = false;
                    }
                }
                else if (MoonInput.GetKey(UnityEngine.KeyCode.G))
                {
                    currentSpeed = 0;
                    if (isSuspended)
                    {
                        SuspensionManager.ResumeExcluding(suspendables);
                        suspendables.Clear();
                        slowDownFromKB = false;
                        isSuspended    = false;
                    }
                }
                else if ((MoonInput.GetKey(UnityEngine.KeyCode.F)) /*|| (XInputDotNetPure.GamePad.GetState(PlayerIndex.One).Buttons.Guide == ButtonState.Pressed)*/)
                {
                    slowDownFromKB = true;
                }

                if (slowDownFromKB)
                {
                    if (isSuspended)
                    {
                        SuspensionManager.ResumeExcluding(suspendables);
                        suspendables.Clear();
                    }
                    else
                    {
                        SuspensionManager.GetSuspendables(suspendables, Game.UI.Cameras.Current.GameObject);
                        SuspensionManager.SuspendExcluding(suspendables);
                        slowDownFromKB = false;
                    }
                    isSuspended = !isSuspended;
                }

                if (!isSuspended)
                {
                    if (currentSpeed != 0)
                    {
                        rsX += currentSpeed;
                    }

                    if (rsX <= -1.2)
                    {
                        SetFrameRate(1);
                    }
                    else if (rsX <= -1.1)
                    {
                        SetFrameRate(2);
                    }
                    else if (rsX <= -1.0)
                    {
                        SetFrameRate(3);
                    }
                    else if (rsX <= -0.9)
                    {
                        SetFrameRate(4);
                    }
                    else if (rsX <= -0.8)
                    {
                        SetFrameRate(6);
                    }
                    else if (rsX <= -0.7)
                    {
                        SetFrameRate(12);
                    }
                    else if (rsX <= -0.6)
                    {
                        SetFrameRate(16);
                    }
                    else if (rsX <= -0.5)
                    {
                        SetFrameRate(20);
                    }
                    else if (rsX <= -0.4)
                    {
                        SetFrameRate(28);
                    }
                    else if (rsX <= -0.3)
                    {
                        SetFrameRate(36);
                    }
                    else if (rsX <= -0.2)
                    {
                        SetFrameRate(44);
                    }
                    else if (rsX <= 0.2)
                    {
                        SetFrameRate();
                    }
                    else if (rsX <= 0.3)
                    {
                        SetFrameRate(75);
                    }
                    else if (rsX <= 0.4)
                    {
                        SetFrameRate(90);
                    }
                    else if (rsX <= 0.5)
                    {
                        SetFrameRate(105);
                    }
                    else if (rsX <= 0.6)
                    {
                        SetFrameRate(120);
                    }
                    else if (rsX <= 0.7)
                    {
                        SetFrameRate(135);
                    }
                    else if (rsX <= 0.8)
                    {
                        SetFrameRate(150);
                    }
                    else if (rsX <= 0.9)
                    {
                        SetFrameRate(165);
                    }
                    else
                    {
                        SetFrameRate(180);
                    }
                }
            }
            else
            {
                SetFrameRate();
            }
        }