Trick on the class: Speech Bubble Toggle (#329)

* Trick on the class Speech Bubble toggle

* fixed tiny lil' bug
This commit is contained in:
Teuxml 2023-03-07 14:19:41 -03:00 committed by GitHub
parent db81702c22
commit f590bd8ff9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -31,12 +31,17 @@ namespace HeavenStudio.Games.Loaders
}, },
defaultLength = 3, defaultLength = 3,
}, },
new GameAction("toggleBubble", "Toggle Speech Bubble")
{
function = delegate { TrickClass.instance.BubbleToggle(); },
defaultLength = 1,
},
new GameAction("bop", "") new GameAction("bop", "")
{ {
function = delegate { var e = eventCaller.currentEntity; TrickClass.instance.Bop(e.beat, e.length); }, function = delegate { var e = eventCaller.currentEntity; TrickClass.instance.Bop(e.beat, e.length); },
resizable = true, resizable = true,
hidden = true hidden = true
}, }
}); });
} }
} }
@ -86,6 +91,7 @@ namespace HeavenStudio.Games
public float playerCanDodge = Single.MinValue; public float playerCanDodge = Single.MinValue;
float playerBopStart = Single.MinValue; float playerBopStart = Single.MinValue;
float girlBopStart = Single.MinValue; float girlBopStart = Single.MinValue;
bool showBubble = true;
void OnDestroy() void OnDestroy()
@ -154,13 +160,20 @@ namespace HeavenStudio.Games
bop.length = length; 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") if (GameManager.instance.currentGame == "trickClass")
{ {
BeatAction.New(instance.gameObject, new List<BeatAction.Action>() BeatAction.New(instance.gameObject, new List<BeatAction.Action>()
{ {
new BeatAction.Action(beat - 1, delegate new BeatAction.Action(beat - 1, delegate
{
if (instance.showBubble == true)
{ {
switch (type) switch (type)
{ {
@ -171,7 +184,8 @@ namespace HeavenStudio.Games
instance.warnAnim.Play("WarnPlane", 0, 0); instance.warnAnim.Play("WarnPlane", 0, 0);
break; break;
} }
}), }
}),
new BeatAction.Action(beat, delegate new BeatAction.Action(beat, delegate
{ {
instance.warnAnim.Play("NoPose", 0, 0); instance.warnAnim.Play("NoPose", 0, 0);