From 40d722de0161f941d2332b8d054211c351c8c740 Mon Sep 17 00:00:00 2001 From: RaffyTaffy14 Date: Mon, 30 Jan 2023 20:57:53 -0500 Subject: [PATCH] End Pose Start Adds the End Pose cue's tweeting sound (took so long but felt so cool) --- .../Games/SumoBrothers/SumoBrothers.cs | 32 ++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) diff --git a/Assets/Scripts/Games/SumoBrothers/SumoBrothers.cs b/Assets/Scripts/Games/SumoBrothers/SumoBrothers.cs index 7c2c04cef..b4c6c7634 100644 --- a/Assets/Scripts/Games/SumoBrothers/SumoBrothers.cs +++ b/Assets/Scripts/Games/SumoBrothers/SumoBrothers.cs @@ -12,6 +12,12 @@ namespace HeavenStudio.Games.Loaders { return new Minigame("sumoBrothers", "Sumo Brothers \n[INITIALIZATION ONLY]", "0058CE", false, false, new List() { + new GameAction("endPose", "End Pose") + { + preFunction = delegate { var e = eventCaller.currentEntity; SumoBrothers.Pose(e.beat); }, + defaultLength = 5f + } + }); } } @@ -19,7 +25,7 @@ namespace HeavenStudio.Games.Loaders namespace HeavenStudio.Games { -// using Scripts_SumoBrothers; + // using Scripts_SumoBrothers; public class SumoBrothers : Minigame { // Start is called before the first frame update @@ -32,6 +38,30 @@ namespace HeavenStudio.Games void Update() { + } + + public static void Pose(float beat) + { + var cond = Conductor.instance; + var cueLength = 60 / cond.songBpm * 3; + var loopAmount = Math.Ceiling((cueLength - 0.208) / 0.395); + var beatsPerSecond = cond.songBpm / 60; + var soundBeatLength = beatsPerSecond * 0.395; + + print(cueLength + " and " + loopAmount); + + List sound = new List(); + sound.Add(new MultiSound.Sound("sumoBrothers/posesignalBegin", beat)); + + for (int i = 1; i <= loopAmount; i++) + { + sound.Add(new MultiSound.Sound("sumoBrothers/posesignalLoop", i * (float)soundBeatLength + beat - (float)soundBeatLength + ((float)beatsPerSecond * 0.208f))); + } + print(sound.ToArray()); + MultiSound.Play(sound.ToArray()); + + + } } }