diff --git a/Assets/Scripts/Games/FanClub/FanClub.cs b/Assets/Scripts/Games/FanClub/FanClub.cs index 67d0a933..39b93986 100644 --- a/Assets/Scripts/Games/FanClub/FanClub.cs +++ b/Assets/Scripts/Games/FanClub/FanClub.cs @@ -1,6 +1,7 @@ using HeavenStudio.Util; using System.Collections; using System.Collections.Generic; +using System; using UnityEngine; using UnityEngine.Rendering; //don't ask @@ -51,6 +52,9 @@ namespace HeavenStudio.Games public GameEvent noSpecBop = new GameEvent(); private bool responseToggle = false; + private static float wantHais = Single.MinValue; + private static float wantKamone = Single.MinValue; + private static float wantBigReady = Single.MinValue; //game scene public static FanClub instance; @@ -107,6 +111,25 @@ namespace HeavenStudio.Games } } + public override void OnGameSwitch(float beat) + { + if (wantHais != Single.MinValue) + { + ContinueHais(wantHais); + wantHais = Single.MinValue; + } + if (wantKamone != Single.MinValue) + { + ContinueKamone(wantKamone); + wantKamone = Single.MinValue; + } + if (wantBigReady != Single.MinValue) + { + ContinueBigReady(wantBigReady); + wantBigReady = Single.MinValue; + } + } + private void Update() { if (Conductor.instance.ReportBeat(ref bop.lastReportedBeat, bop.startBeat % 1)) @@ -222,19 +245,20 @@ namespace HeavenStudio.Games } const float HAIS_LENGTH = 4.5f; - public void CallHai(float beat, int type = 0) + public void CallHai(float beat, bool noSound = false, int type = 0) { + if (!noSound) + MultiSound.Play(new MultiSound.Sound[] { + new MultiSound.Sound("fanClub/arisa_hai_1_jp", beat), + new MultiSound.Sound("fanClub/arisa_hai_2_jp", beat + 1f), + new MultiSound.Sound("fanClub/arisa_hai_3_jp", beat + 2f), + }); + + Prepare(beat + 3f); responseToggle = false; DisableBop(beat, 8f); DisableSpecBop(beat + 2.5f, 5f); - MultiSound.Play(new MultiSound.Sound[] { - new MultiSound.Sound("fanClub/arisa_hai_1_jp", beat), - new MultiSound.Sound("fanClub/arisa_hai_2_jp", beat + 1f), - new MultiSound.Sound("fanClub/arisa_hai_3_jp", beat + 2f), - }); - - Prepare(beat + 3f); Prepare(beat + 4f); Prepare(beat + 5f); Prepare(beat + 6f); @@ -260,8 +284,10 @@ namespace HeavenStudio.Games }); } - public static void WarnHai(float beat, int type = 0) + public static void WarnHai(float beat, bool noSound = false, int type = 0) { + wantHais = beat; + if (noSound) return; MultiSound.Play(new MultiSound.Sound[] { new MultiSound.Sound("fanClub/arisa_hai_1_jp", beat), new MultiSound.Sound("fanClub/arisa_hai_2_jp", beat + 1f), @@ -269,9 +295,21 @@ namespace HeavenStudio.Games }, forcePlay:true); } - const float CALL_LENGTH = 2.5f; - public void CallKamone(float beat, int type = 0, bool doJump = false) + public void ContinueHais(float beat, int type = 0) { + CallHai(beat, true, type); + } + + const float CALL_LENGTH = 2.5f; + public void CallKamone(float beat, bool noSound = false, int type = 0, bool doJump = false) + { + if (!noSound) + MultiSound.Play(new MultiSound.Sound[] { + new MultiSound.Sound("fanClub/arisa_ka_jp", beat), + new MultiSound.Sound("fanClub/arisa_mo_jp", beat + 0.5f), + new MultiSound.Sound("fanClub/arisa_ne_jp", beat + 1f), + }); + responseToggle = true; DisableBop(beat, doJump ? 6.25f : 5.25f); DisableSpecBop(beat + 0.5f, 6f); @@ -281,12 +319,6 @@ namespace HeavenStudio.Games Prepare(beat + 3f, 2); Prepare(beat + 4f, 1); - MultiSound.Play(new MultiSound.Sound[] { - new MultiSound.Sound("fanClub/arisa_ka_jp", beat), - new MultiSound.Sound("fanClub/arisa_mo_jp", beat + 0.5f), - new MultiSound.Sound("fanClub/arisa_ne_jp", beat + 1f), - }); - BeatAction.New(Arisa, new List() { new BeatAction.Action(beat, delegate { Arisa.GetComponent().Play("IdolCall0", -1, 0); }), @@ -317,8 +349,10 @@ namespace HeavenStudio.Games }); } - public static void WarnKamone(float beat, int type = 0) + public static void WarnKamone(float beat, bool noSound = false, int type = 0) { + wantKamone = beat; + if (noSound) return; MultiSound.Play(new MultiSound.Sound[] { new MultiSound.Sound("fanClub/arisa_ka_jp", beat), new MultiSound.Sound("fanClub/arisa_mo_jp", beat + 0.5f), @@ -326,13 +360,18 @@ namespace HeavenStudio.Games }, forcePlay:true); } - const float BIGCALL_LENGTH = 2.75f; - public void CallBigReady(float beat) + public void ContinueKamone(float beat, int type = 0, bool doJump = false) { + CallKamone(beat, true, type, doJump); + } + + const float BIGCALL_LENGTH = 2.75f; + public void CallBigReady(float beat, bool noSound = false) + { + if (!noSound) + Jukebox.PlayOneShotGame("fanClub/crowd_big_ready"); + DisableSpecBop(beat, 3.75f); - - Jukebox.PlayOneShotGame("fanClub/crowd_big_ready"); - Prepare(beat + 1.5f); Prepare(beat + 2f); @@ -346,11 +385,18 @@ namespace HeavenStudio.Games }); } - public static void WarnBigReady(float beat) + public static void WarnBigReady(float beat, bool noSound = false) { + wantBigReady = beat; + if (noSound) return; Jukebox.PlayOneShotGame("fanClub/crowd_big_ready"); } + public void ContinueBigReady(float beat) + { + CallBigReady(beat, true); + } + public void Prepare(float beat, int type = 0) { Player.AddHit(beat, type); diff --git a/Assets/Scripts/Games/FanClub/NtrIdolFan.cs b/Assets/Scripts/Games/FanClub/NtrIdolFan.cs index 64e3106c..a06e526b 100644 --- a/Assets/Scripts/Games/FanClub/NtrIdolFan.cs +++ b/Assets/Scripts/Games/FanClub/NtrIdolFan.cs @@ -22,7 +22,7 @@ namespace HeavenStudio.Games.Scripts_FanClub [Header("Properties")] [NonSerialized] public bool player = false; [NonSerialized] public bool hitValid = false; - public float jumpStartTime = -99f; + public float jumpStartTime = Single.MinValue; bool stopBeat = false; bool stopCharge = false; bool hasJumped = false; diff --git a/Assets/Scripts/Minigames.cs b/Assets/Scripts/Minigames.cs index 37d880e7..28702676 100644 --- a/Assets/Scripts/Minigames.cs +++ b/Assets/Scripts/Minigames.cs @@ -425,22 +425,33 @@ namespace HeavenStudio }), new Minigame("fanClub", "Fan Club \n[WIP]", "FDFD00", false, false, new List() { - // TODO: proper names new GameAction("bop", delegate { var e = eventCaller.currentEntity; FanClub.instance.Bop(e.beat, e.length, e.type); }, 0.5f, true, parameters: new List() { new Param("type", FanClub.IdolBopType.Both, "Bop target", "Who to make bop"), }), - new GameAction("yeah, yeah, yeah", delegate { var e = eventCaller.currentEntity; FanClub.instance.CallHai(e.beat); }, 8, false, - // TODO: pre-switch cues - inactiveFunction: delegate { FanClub.WarnHai(eventCaller.currentEntity.beat); }), - new GameAction("I suppose", delegate { var e = eventCaller.currentEntity; FanClub.instance.CallKamone(e.beat); }, 6, false, - // TODO: pre-switch cues - inactiveFunction: delegate { FanClub.WarnKamone(eventCaller.currentEntity.beat); }), - new GameAction("double clap", delegate { FanClub.instance.CallBigReady(eventCaller.currentEntity.beat); }, 4, false, - // TODO: pre-switch cues - inactiveFunction: delegate { FanClub.WarnBigReady(eventCaller.currentEntity.beat); }), - new GameAction("play idol animation", delegate { var e = eventCaller.currentEntity; FanClub.instance.PlayAnim(e.beat, e.length, e.type); }, 1f, true, parameters: new List() + new GameAction("yeah, yeah, yeah", delegate { var e = eventCaller.currentEntity; FanClub.instance.CallHai(e.beat, e.toggle); }, 8, false, parameters: new List() + { + new Param("toggle", false, "Disable call", "Disable the idol's call") + }, + inactiveFunction: delegate { var e = eventCaller.currentEntity; FanClub.WarnHai(e.beat, e.toggle);} + ), + + new GameAction("I suppose", delegate { var e = eventCaller.currentEntity; FanClub.instance.CallKamone(e.beat, e.toggle); }, 6, false, parameters: new List() + { + new Param("toggle", false, "Disable call", "Disable the idol's call") + }, + inactiveFunction: delegate { var e = eventCaller.currentEntity; FanClub.WarnKamone(e.beat, e.toggle);} + ), + + new GameAction("double clap", delegate { var e = eventCaller.currentEntity; FanClub.instance.CallBigReady(e.beat, e.toggle); }, 4, false, parameters: new List() + { + new Param("toggle", false, "Disable call", "Disable the call") + }, + inactiveFunction: delegate { var e = eventCaller.currentEntity; FanClub.WarnBigReady(e.beat, e.toggle); } + ), + + new GameAction("play idol animation", delegate { var e = eventCaller.currentEntity; FanClub.instance.PlayAnim(e.beat, e.length, e.type); }, 1, true, parameters: new List() { new Param("type", FanClub.IdolAnimations.Bop, "Animation", "Animation to play") }),