From 5ccceb153fe6b49419cc90fa959bf41f2f55bba1 Mon Sep 17 00:00:00 2001 From: Rapandrasmus <78219215+Rapandrasmus@users.noreply.github.com> Date: Thu, 26 Jan 2023 22:47:13 +0100 Subject: [PATCH] Event redesign --- Assets/Scripts/Games/Ringside/Ringside.cs | 120 +++++++++++++++------- 1 file changed, 85 insertions(+), 35 deletions(-) diff --git a/Assets/Scripts/Games/Ringside/Ringside.cs b/Assets/Scripts/Games/Ringside/Ringside.cs index 92c3672a5..75bc87e12 100644 --- a/Assets/Scripts/Games/Ringside/Ringside.cs +++ b/Assets/Scripts/Games/Ringside/Ringside.cs @@ -12,26 +12,29 @@ namespace HeavenStudio.Games.Loaders { return new Minigame("ringside", "Ringside \n[INITIALIZATION ONLY]", "WUTRU3", false, false, new List() { - new GameAction("wubbaDubba", "Wubba Dubba Dubba") + new GameAction("question", "Question") { - function = delegate {var e = eventCaller.currentEntity; Ringside.instance.Question(e.beat); }, - defaultLength = 1.25f - }, - new GameAction("thatTrue", "That True?") - { - function = delegate {var e = eventCaller.currentEntity; Ringside.instance.ThatTrue(e.beat); }, - defaultLength = 0.75f - }, - new GameAction("wubbaDubbaAlt", "Wub Dubba Dubba") - { - function = delegate {var e = eventCaller.currentEntity; Ringside.instance.QuestionAlt(e.beat); }, - defaultLength = 1.25f + function = delegate {var e = eventCaller.currentEntity; Ringside.instance.Question(e.beat, e["alt"]); }, + parameters = new List() + { + new Param("alt", false, "Alt", "Whether the alt voice line should be used or not.") + }, + defaultLength = 4f }, new GameAction("woahYouGoBigGuy", "Woah You Go Big Guy!") { function = delegate {var e = eventCaller.currentEntity; Ringside.instance.BigGuy(e.beat); }, defaultLength = 4f }, + new GameAction("poseForTheFans", "Pose For The Fans!") + { + function = delegate {var e = eventCaller.currentEntity; Ringside.PoseForTheFans(e.beat, e["and"]); }, + parameters = new List() + { + new Param("and", false, "And", "Whether the And voice line should be said or not.") + }, + defaultLength = 4f + }, }); } } @@ -63,35 +66,38 @@ namespace HeavenStudio.Games { if (PlayerInput.Pressed() && !IsExpectingInputNow(InputType.STANDARD_DOWN)) { - wrestlerAnim.DoScaledAnimationAsync("Ye", 0.5f); + wrestlerAnim.Play("Ye", 0, 0); Jukebox.PlayOneShotGame($"ringside/ye{UnityEngine.Random.Range(1, 4)}"); } } } - public void Question(float beat) + public void Question(float beat, bool alt) { - MultiSound.Play(new MultiSound.Sound[] + if (alt) { - new MultiSound.Sound($"ringside/wubba{currentQuestion}-1", beat), - new MultiSound.Sound($"ringside/wubba{currentQuestion}-2", beat + 0.25f), - new MultiSound.Sound($"ringside/dubba{currentQuestion}-1", beat + 0.5f), - new MultiSound.Sound($"ringside/dubba{currentQuestion}-2", beat + 0.75f), - new MultiSound.Sound($"ringside/dubba{currentQuestion}-3", beat + 1f), - new MultiSound.Sound($"ringside/dubba{currentQuestion}-4", beat + 1.25f), - }, forcePlay: true); - } - - public void QuestionAlt(float beat) - { - MultiSound.Play(new MultiSound.Sound[] + MultiSound.Play(new MultiSound.Sound[] + { + new MultiSound.Sound($"ringside/wub{currentQuestion}", beat), + new MultiSound.Sound($"ringside/dubba{currentQuestion}-1", beat + 0.5f), + new MultiSound.Sound($"ringside/dubba{currentQuestion}-2", beat + 0.75f), + new MultiSound.Sound($"ringside/dubba{currentQuestion}-3", beat + 1f), + new MultiSound.Sound($"ringside/dubba{currentQuestion}-4", beat + 1.25f), + }, forcePlay: true); + } + else { - new MultiSound.Sound($"ringside/wub{currentQuestion}", beat), - new MultiSound.Sound($"ringside/dubba{currentQuestion}-1", beat + 0.5f), - new MultiSound.Sound($"ringside/dubba{currentQuestion}-2", beat + 0.75f), - new MultiSound.Sound($"ringside/dubba{currentQuestion}-3", beat + 1f), - new MultiSound.Sound($"ringside/dubba{currentQuestion}-4", beat + 1.25f), - }, forcePlay: true); + MultiSound.Play(new MultiSound.Sound[] + { + new MultiSound.Sound($"ringside/wubba{currentQuestion}-1", beat), + new MultiSound.Sound($"ringside/wubba{currentQuestion}-2", beat + 0.25f), + new MultiSound.Sound($"ringside/dubba{currentQuestion}-1", beat + 0.5f), + new MultiSound.Sound($"ringside/dubba{currentQuestion}-2", beat + 0.75f), + new MultiSound.Sound($"ringside/dubba{currentQuestion}-3", beat + 1f), + new MultiSound.Sound($"ringside/dubba{currentQuestion}-4", beat + 1.25f), + }, forcePlay: true); + } + ThatTrue(beat + 1.25f); } public void ThatTrue(float beat) @@ -137,6 +143,27 @@ namespace HeavenStudio.Games } } + public static void PoseForTheFans(float beat, bool and) + { + if (and) + { + MultiSound.Play(new MultiSound.Sound[] + { + new MultiSound.Sound("ringside/poseAnd", beat - 0.5f), + }, forcePlay: true); + } + if (GameManager.instance.currentGame != "ringside") return; + int poseLineRandom = UnityEngine.Random.Range(1, 3); + MultiSound.Play(new MultiSound.Sound[] + { + new MultiSound.Sound($"ringside/pose{poseLineRandom}", beat), + new MultiSound.Sound($"ringside/for{poseLineRandom}", beat + 0.5f), + new MultiSound.Sound($"ringside/the{poseLineRandom}", beat + 0.75f), + new MultiSound.Sound($"ringside/fans{poseLineRandom}", beat + 1f), + }, forcePlay: true); + Ringside.instance.ScheduleInput(beat, 2f, InputType.STANDARD_ALT_DOWN, Ringside.instance.JustPoseForTheFans, Ringside.instance.MissPose, Ringside.instance.Nothing); + } + public void JustQuestion(PlayerActionEvent caller, float state) { if (state >= 1f || state <= -1f) @@ -148,7 +175,7 @@ namespace HeavenStudio.Games public void SuccessQuestion() { - wrestlerAnim.DoScaledAnimationAsync("Ye", 0.5f); + wrestlerAnim.Play("Ye", 0, 0); Jukebox.PlayOneShotGame($"ringside/ye{UnityEngine.Random.Range(1, 4)}"); BeatAction.New(instance.gameObject, new List() { @@ -188,9 +215,32 @@ namespace HeavenStudio.Games }); } + public void JustPoseForTheFans(PlayerActionEvent caller, float state) + { + if (state >= 1f || state <= -1f) + { + return; + } + SuccessPoseForTheFans(); + } + + public void SuccessPoseForTheFans() + { + Jukebox.PlayOneShotGame($"ringside/yell{UnityEngine.Random.Range(1, 7)}"); + BeatAction.New(instance.gameObject, new List() + { + new BeatAction.Action(Conductor.instance.songPositionInBeats + 1f, delegate { Jukebox.PlayOneShotGame("ringside/poseCamera"); }), + }); + } + public void Miss(PlayerActionEvent caller) { + } + + public void MissPose(PlayerActionEvent caller) + { + } public void Nothing(PlayerActionEvent caller){}