From b47ffacdeb463955cb73745c03b76c5a784d142e Mon Sep 17 00:00:00 2001 From: blank3times <105398129+blank3times@users.noreply.github.com> Date: Sat, 10 Feb 2024 22:24:54 -0800 Subject: [PATCH] Faulty Whale Stole code from clappy trio sign, the sfx now changes based on whether we have a whale --- Assets/Scripts/Games/HoleInOne/HoleInOne.cs | 31 +++++++++++++++++++-- 1 file changed, 28 insertions(+), 3 deletions(-) diff --git a/Assets/Scripts/Games/HoleInOne/HoleInOne.cs b/Assets/Scripts/Games/HoleInOne/HoleInOne.cs index 91d0f06bd..4b2dfb227 100644 --- a/Assets/Scripts/Games/HoleInOne/HoleInOne.cs +++ b/Assets/Scripts/Games/HoleInOne/HoleInOne.cs @@ -37,7 +37,17 @@ namespace HeavenStudio.Games.Loaders { function = delegate { HoleInOne.instance.DoMonkey(eventCaller.currentEntity.beat); }, defaultLength = 3.0f, - } + }, + new GameAction("whale", "Whale") + { + function = delegate { var e = eventCaller.currentEntity; HoleInOne.instance.Whale(e.beat, e.length, e["ease"], e["appear"]); }, + parameters = new List() + { + new Param("appear", true, "Enter", "Toggle if the whale should enter or exit the scene."), + new Param("ease", Util.EasingFunction.Ease.Linear, "Ease", "Set the easing of the action.") + }, + resizable = true + }, }//, // new List() { "rvl", "normal" }, // "rvlgolf", "en", @@ -55,12 +65,18 @@ namespace HeavenStudio.Games { public Animator MonkeyAnim; + double whaleStartBeat; + float whaleLength; + Util.EasingFunction.Ease lastEase; + bool isWhale; + public static HoleInOne instance; void Awake() { HoleInOne.instance = this; SetupBopRegion("holeInOne", "bop", "toggle"); + isWhale = false; } public override void OnBeatPulse(double beat) @@ -95,6 +111,15 @@ namespace HeavenStudio.Games } } } + + public void Whale(double beat, float length, int ease, bool appear) + { + SoundByte.PlayOneShotGame("clappyTrio/sign"); + whaleStartBeat = beat; + whaleLength = length; + lastEase = (Util.EasingFunction.Ease)ease; + isWhale = appear; + } public void DoMandrill(double beat) { @@ -152,7 +177,7 @@ namespace HeavenStudio.Games MultiSound.Play(new MultiSound.Sound[] { new MultiSound.Sound("holeInOne/mandrill4", beat), - new MultiSound.Sound("holeInOne/hole" + randomSuccess, beat + 2f) + new MultiSound.Sound((isWhale) ? "holeInOne/whale" : ("holeInOne/hole" + randomSuccess), beat + 2f) }); MonkeyAnim.Play("MonkeySpin"); } @@ -184,7 +209,7 @@ namespace HeavenStudio.Games MultiSound.Play(new MultiSound.Sound[] { new MultiSound.Sound("holeInOne/monkey3", beat), - new MultiSound.Sound("holeInOne/hole" + randomSuccess, beat + 2f) + new MultiSound.Sound((isWhale) ? "holeInOne/whale" : ("holeInOne/hole" + randomSuccess), beat + 2f) }); MonkeyAnim.Play("MonkeySpin"); }