From 94fdf7fa8d2b5d24bacb1cf1c1eaa7b82c555a79 Mon Sep 17 00:00:00 2001 From: Teuxml <85766646+Teuxml@users.noreply.github.com> Date: Tue, 7 Mar 2023 14:19:41 -0300 Subject: [PATCH] Trick on the class: Speech Bubble Toggle (#329) * Trick on the class Speech Bubble toggle * fixed tiny lil' bug --- Assets/Scripts/Games/TrickClass/TrickClass.cs | 20 ++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/Assets/Scripts/Games/TrickClass/TrickClass.cs b/Assets/Scripts/Games/TrickClass/TrickClass.cs index b800b79c..f9f14647 100644 --- a/Assets/Scripts/Games/TrickClass/TrickClass.cs +++ b/Assets/Scripts/Games/TrickClass/TrickClass.cs @@ -31,12 +31,17 @@ namespace HeavenStudio.Games.Loaders }, defaultLength = 3, }, + new GameAction("toggleBubble", "Toggle Speech Bubble") + { + function = delegate { TrickClass.instance.BubbleToggle(); }, + defaultLength = 1, + }, new GameAction("bop", "") { function = delegate { var e = eventCaller.currentEntity; TrickClass.instance.Bop(e.beat, e.length); }, resizable = true, hidden = true - }, + } }); } } @@ -86,6 +91,7 @@ namespace HeavenStudio.Games public float playerCanDodge = Single.MinValue; float playerBopStart = Single.MinValue; float girlBopStart = Single.MinValue; + bool showBubble = true; void OnDestroy() @@ -154,13 +160,20 @@ namespace HeavenStudio.Games bop.length = length; } - public static void PreTossObject(float beat, int type) + public void BubbleToggle() + { + instance.showBubble = !instance.showBubble; + } + + public static void PreTossObject(float beat, int type) { if (GameManager.instance.currentGame == "trickClass") { BeatAction.New(instance.gameObject, new List() { new BeatAction.Action(beat - 1, delegate + { + if (instance.showBubble == true) { switch (type) { @@ -171,7 +184,8 @@ namespace HeavenStudio.Games instance.warnAnim.Play("WarnPlane", 0, 0); break; } - }), + } + }), new BeatAction.Action(beat, delegate { instance.warnAnim.Play("NoPose", 0, 0);