Exemplo n.º 1
0
        public void RecordPlayer()
        {
            TASInput input = new TASInput(currentFrame);

            if (currentFrame == 0 && input == lastInput)
            {
                return;
            }
            else if (input != lastInput)
            {
                if (currentFrame == 0)
                {
                    fixedRandom = FixedRandom.FixedUpdateIndex;
                    File.AppendAllText(filePath, fixedRandom.ToString() + "\r\n");
                }
                lastInput.Frames = currentFrame - lastInput.Frames;
                if (lastInput.Frames != 0)
                {
                    File.AppendAllText(filePath, lastInput.ToString() + "\r\n");
                }
                //lastInput.UpdateInput();
                lastInput = input;
            }
            if (!GameController.FreezeFixedUpdate)
            {
                currentFrame++;
            }
            FixedRandom.SetFixedUpdateIndex(fixedRandom + currentFrame);
        }
Exemplo n.º 2
0
        public void RecordPlayer()
        {
            TASInput input = new TASInput(currentFrame);

            if (currentFrame == 0 && input == lastInput)
            {
                return;
            }
            else
            {
                if (!InstantLoadScenesController.Instance.IsLoading && !GameController.Instance.IsLoadingGame)
                {
                    if (input != lastInput)
                    {
                        if (currentFrame == 0)
                        {
                            fixedRandom = FixedRandom.FixedUpdateIndex;
                            File.AppendAllText(filePath, fixedRandom.ToString() + "\r\n");
                        }
                        lastInput.Frames = currentFrame - lastInput.Frames;
                        if (lastInput.Frames != 0)
                        {
                            File.AppendAllText(filePath, lastInput.ToString() + "\r\n");
                        }
                        lastInput = input;
                    }
                    currentFrame++;
                    FixedRandom.SetFixedUpdateIndex(fixedRandom + currentFrame);
                }
                gameFrame++;
            }
        }
Exemplo n.º 3
0
        public void PlaybackPlayer()
        {
            if (inputIndex < inputs.Count)
            {
                bool changed = false;
                if (!GameController.Instance.IsLoadingGame && !InstantLoadScenesController.Instance.IsLoading && !GameController.FreezeFixedUpdate)
                {
                    if (currentFrame == 0)
                    {
                        SeinUI.DebugHideUI = false;
                    }
                    changed = currentFrame == 0;
                    if (currentFrame >= frameToNext)
                    {
                        if (inputIndex + 1 >= inputs.Count)
                        {
                            inputIndex++;
                            return;
                        }
                        lastInput    = inputs[++inputIndex];
                        frameToNext += lastInput.Frames;
                        changed      = true;
                    }

                    currentFrame++;
                }
                FixedRandom.SetFixedUpdateIndex(fixedRandom + currentFrame);
                lastInput.UpdateInput(changed);
            }
        }
Exemplo n.º 4
0
        public void PlaybackPlayer()
        {
            if (inputIndex < inputs.Count)
            {
                bool    changed    = false;
                Vector2 currentPos = Characters.Sein == null ? Core.Scenes.Manager.CurrentCameraTargetPosition : new Vector2(Characters.Sein.Position.x, Characters.Sein.Position.y);
                if (!InstantLoadScenesController.Instance.IsLoading && (!GameController.Instance.IsLoadingGame || (lastInput != null && lastInput.Restore)) && !Core.Scenes.Manager.PositionInsideSceneStillLoading(currentPos))
                {
                    if (currentFrame == 0)
                    {
                        LastMouseX         = 0;
                        LastMouseY         = 0;
                        SeinUI.DebugHideUI = false;
                    }
                    changed = currentFrame == 0;

                    if (currentFrame >= frameToNext)
                    {
                        if (inputIndex + 1 >= inputs.Count)
                        {
                            inputIndex++;
                            return;
                        }
                        lastInput    = inputs[++inputIndex];
                        frameToNext += lastInput.Frames;
                        changed      = true;
                    }

                    currentFrame++;

                    if (lastInput.Random >= 0 && changed)
                    {
                        fixedRandom = lastInput.Random - currentFrame + 1;
                    }
                    FixedRandom.SetFixedUpdateIndex(fixedRandom + currentFrame);
                    lastInput.UpdateInput(changed);

                    if (lastInput.SkillTree >= 0)
                    {
                        SkillTreeAlpha = lastInput.SkillTree;
                    }

                    if (currentFrame >= frameToNext && inputIndex + 1 < inputs.Count)
                    {
                        TASInput nextInput = inputs[inputIndex + 1];
                        if (nextInput.Line > Break && Break > 0)
                        {
                            Break       = -Break;
                            FastForward = false;
                        }
                    }
                }
                if (inputs[inputIndex].SpamAction)
                {
                    Core.Input.ActionButtonA.Update(!Core.Input.ActionButtonA.IsPressed);
                    Core.Input.AnyStart.Update(!Core.Input.AnyStart.IsPressed);
                }
                gameFrame++;
            }
        }