diff --git a/Assets/Scripts/Games/PajamaParty/CtrPillowMonkey.cs b/Assets/Scripts/Games/PajamaParty/CtrPillowMonkey.cs index 4f7820032..6f82b1c31 100644 --- a/Assets/Scripts/Games/PajamaParty/CtrPillowMonkey.cs +++ b/Assets/Scripts/Games/PajamaParty/CtrPillowMonkey.cs @@ -124,7 +124,7 @@ namespace HeavenStudio.Games.Scripts_PajamaParty Projectile.SetActive(true); } - public void ReadySleep(float beat) + public void ReadySleep(float beat, int action) { var cond = Conductor.instance; startThrowTime = Single.MinValue; @@ -161,7 +161,9 @@ namespace HeavenStudio.Games.Scripts_PajamaParty seq.Add(new BeatAction.Action( beat + 3f, delegate { anim.DoScaledAnimationAsync("MonkeyReadySleep"); })); seq.Add(new BeatAction.Action( beat + 4f, delegate { anim.DoScaledAnimationAsync("MonkeySleep02"); })); } - seq.Add(new BeatAction.Action( beat + 7f, delegate { anim.DoScaledAnimationAsync("MonkeyAwake"); })); + + if (action != (int) PajamaParty.SleepType.NoAwake) + seq.Add(new BeatAction.Action( beat + 7f, delegate { anim.DoScaledAnimationAsync("MonkeyAwake"); })); BeatAction.New(Monkey, seq); } diff --git a/Assets/Scripts/Games/PajamaParty/CtrPillowPlayer.cs b/Assets/Scripts/Games/PajamaParty/CtrPillowPlayer.cs index 90d676d37..08219c491 100644 --- a/Assets/Scripts/Games/PajamaParty/CtrPillowPlayer.cs +++ b/Assets/Scripts/Games/PajamaParty/CtrPillowPlayer.cs @@ -34,12 +34,14 @@ namespace HeavenStudio.Games.Scripts_PajamaParty bool throwType = true; bool hasThrown = false; bool throwNg = false; + bool longSleep = false; public bool canSleep = false; void Awake() { anim = Player.GetComponent(); + longSleep = false; } // Update is called once per frame @@ -306,7 +308,7 @@ namespace HeavenStudio.Games.Scripts_PajamaParty // // sleep cue - public void StartSleepSequence(float beat, bool alt) + public void StartSleepSequence(float beat, bool alt, int action) { if (hasJumped) { @@ -347,6 +349,11 @@ namespace HeavenStudio.Games.Scripts_PajamaParty Player.transform.localPosition = new Vector3(0, 0); Shadow.transform.localScale = new Vector3(1.65f, 1f, 1f); + if (action == (int) PajamaParty.SleepType.NoAwake) + { + longSleep = true; + } + BeatAction.New(Player, new List() { new BeatAction.Action( @@ -394,16 +401,20 @@ namespace HeavenStudio.Games.Scripts_PajamaParty Jukebox.PlayOneShotGame("pajamaParty/siesta4"); anim.DoScaledAnimationAsync("MakoSleepJust"); - BeatAction.New(Player, new List() + if (!longSleep) { - new BeatAction.Action( - caller.startBeat + 7f, - delegate { - anim.DoScaledAnimationAsync("MakoAwake"); - Jukebox.PlayOneShotGame("pajamaParty/siestaDone"); - } - ), - }); + BeatAction.New(Player, new List() + { + new BeatAction.Action( + caller.startBeat + 7f, + delegate { + anim.DoScaledAnimationAsync("MakoAwake"); + Jukebox.PlayOneShotGame("pajamaParty/siestaDone"); + } + ), + }); + } + longSleep = false; } } } diff --git a/Assets/Scripts/Games/PajamaParty/PajamaParty.cs b/Assets/Scripts/Games/PajamaParty/PajamaParty.cs index 370f42f40..39e73fde0 100644 --- a/Assets/Scripts/Games/PajamaParty/PajamaParty.cs +++ b/Assets/Scripts/Games/PajamaParty/PajamaParty.cs @@ -22,8 +22,9 @@ namespace HeavenStudio.Games.Loaders inactiveFunction: delegate {PajamaParty.WarnFiveJump(eventCaller.currentEntity.beat);} ), //idem - new GameAction("slumber", delegate {var e = eventCaller.currentEntity; PajamaParty.instance.DoSleepSequence(e.beat, e.toggle);}, 8f, false, parameters: new List() + new GameAction("slumber", delegate {var e = eventCaller.currentEntity; PajamaParty.instance.DoSleepSequence(e.beat, e.toggle, e.type);}, 8f, false, parameters: new List() { + new Param("type", PajamaParty.SleepType.Normal, "Sleep Type", "Type of sleep action to use"), new Param("toggle", false, "Alt. Animation", "Use an alternate animation for Mako") }, inactiveFunction: delegate {var e = eventCaller.currentEntity; PajamaParty.WarnSleepSequence(e.beat, e.toggle);} @@ -66,6 +67,12 @@ namespace HeavenStudio.Games static float WantThrowSequence = Single.MinValue; static float WantSleepSequence = Single.MinValue; static bool WantSleepType = false; + static int WantSleepAction = (int) PajamaParty.SleepType.Normal; + + public enum SleepType { + Normal, + NoAwake, + } void Awake() { @@ -128,7 +135,7 @@ namespace HeavenStudio.Games } if (WantSleepSequence != Single.MinValue) { - DoSleepSequence(WantSleepSequence, WantSleepType, false); + DoSleepSequence(WantSleepSequence, WantSleepType, WantSleepAction, false); WantSleepSequence = Single.MinValue; } } @@ -245,11 +252,11 @@ namespace HeavenStudio.Games }, forcePlay: force); } - public void DoSleepSequence(float beat, bool alt = false, bool doSound = true) + public void DoSleepSequence(float beat, bool alt = false, int action = (int) PajamaParty.SleepType.Normal, bool doSound = true) { var cond = Conductor.instance; - Mako.StartSleepSequence(beat, alt); - MonkeySleep(beat); + Mako.StartSleepSequence(beat, alt, action); + MonkeySleep(beat, action); if (doSound) MultiSound.Play(new MultiSound.Sound[] { new MultiSound.Sound("pajamaParty/siesta1", beat), @@ -330,13 +337,13 @@ namespace HeavenStudio.Games } } - public void MonkeySleep(float beat) + public void MonkeySleep(float beat, int action) { foreach (CtrPillowMonkey monkey in monkeys) { if (monkey != null) { - monkey.ReadySleep(beat); + monkey.ReadySleep(beat, action); } } }