From 52c9474c90ad68eaeaf4349d92f2513d922dab7a Mon Sep 17 00:00:00 2001 From: Rapandrasmus <78219215+Rapandrasmus@users.noreply.github.com> Date: Wed, 15 Feb 2023 22:40:20 +0100 Subject: [PATCH] Fixed working dough and lockstep earrape bugs and tambourine interval bugs (#281) * mr upbeat input fix + lockstep offbeat switch event seperation * Lockstep + MrUpbeat animation fixes * Fixes to lockstep, tambourine and wd --- Assets/Scripts/Games/Lockstep/Lockstep.cs | 9 +++------ Assets/Scripts/Games/Tambourine/Tambourine.cs | 8 +++----- Assets/Scripts/Games/WorkingDough/WorkingDough.cs | 2 ++ 3 files changed, 8 insertions(+), 11 deletions(-) diff --git a/Assets/Scripts/Games/Lockstep/Lockstep.cs b/Assets/Scripts/Games/Lockstep/Lockstep.cs index cd3fcc2d..36126799 100644 --- a/Assets/Scripts/Games/Lockstep/Lockstep.cs +++ b/Assets/Scripts/Games/Lockstep/Lockstep.cs @@ -127,10 +127,7 @@ namespace HeavenStudio.Games void OnDestroy() { - if (!Conductor.instance.isPlaying || Conductor.instance.isPaused) - { - if (queuedInputs.Count > 0) queuedInputs.Clear(); - } + if (queuedInputs.Count > 0) queuedInputs.Clear(); } public void Update() @@ -236,7 +233,7 @@ namespace HeavenStudio.Games { if (GameManager.instance.currentGame == "lockstep") { - for (int i = 0; i < length + 1; i++) + for (int i = 0; i < length; i++) { Lockstep.instance.ScheduleInput(beat - 1, 1 + i, InputType.STANDARD_DOWN, Lockstep.instance.Just, Lockstep.instance.Miss, Lockstep.instance.Nothing); BeatAction.New(instance.gameObject, new List() @@ -247,7 +244,7 @@ namespace HeavenStudio.Games } else { - for (int i = 0; i < length + 1; i++) + for (int i = 0; i < length; i++) { queuedInputs.Add(beat + i); } diff --git a/Assets/Scripts/Games/Tambourine/Tambourine.cs b/Assets/Scripts/Games/Tambourine/Tambourine.cs index 00eb265d..d94f8644 100644 --- a/Assets/Scripts/Games/Tambourine/Tambourine.cs +++ b/Assets/Scripts/Games/Tambourine/Tambourine.cs @@ -190,13 +190,9 @@ namespace HeavenStudio.Games { DesummonFrog(); sadFace.SetActive(false); - queuedInputs.Clear(); + //queuedInputs.Clear(); misses = 0; intervalStarted = true; - BeatAction.New(instance.gameObject, new List() - { - new BeatAction.Action(beat + interval, delegate { intervalStarted = false; }), - }); } } @@ -229,6 +225,7 @@ namespace HeavenStudio.Games monkeyAnimator.Play("MonkeyPassTurn", 0, 0); Jukebox.PlayOneShotGame($"tambourine/monkey/turnPass/{UnityEngine.Random.Range(1, 6)}"); happyFace.SetActive(true); + intervalStarted = false; BeatAction.New(instance.gameObject, new List() { new BeatAction.Action(beat + 0.3f, delegate { happyFace.SetActive(false); }) @@ -248,6 +245,7 @@ namespace HeavenStudio.Games new BeatAction.Action(beat + length + input.beatAwayFromStart, delegate { Bop(beat + length + input.beatAwayFromStart, (int)WhoBops.Monkey); }) }); } + queuedInputs.Clear(); } public void Bop(float beat, int whoBops) diff --git a/Assets/Scripts/Games/WorkingDough/WorkingDough.cs b/Assets/Scripts/Games/WorkingDough/WorkingDough.cs index c687700a..c803c031 100644 --- a/Assets/Scripts/Games/WorkingDough/WorkingDough.cs +++ b/Assets/Scripts/Games/WorkingDough/WorkingDough.cs @@ -630,6 +630,7 @@ namespace HeavenStudio.Games void JustSmall(PlayerActionEvent caller, float state) { + if (GameManager.instance.currentGame != "workingDough") return; float beat = caller.startBeat + caller.timer; if (currentBalls.Count > 0) { @@ -655,6 +656,7 @@ namespace HeavenStudio.Games void JustBig(PlayerActionEvent caller, float state) { + if (GameManager.instance.currentGame != "workingDough") return; float beat = caller.startBeat + caller.timer; if (currentBalls.Count > 0) {