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,
},
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,6 +160,11 @@ namespace HeavenStudio.Games
bop.length = length;
}
public void BubbleToggle()
{
instance.showBubble = !instance.showBubble;
}
public static void PreTossObject(float beat, int type)
{
if (GameManager.instance.currentGame == "trickClass")
@ -161,6 +172,8 @@ namespace HeavenStudio.Games
BeatAction.New(instance.gameObject, new List<BeatAction.Action>()
{
new BeatAction.Action(beat - 1, delegate
{
if (instance.showBubble == true)
{
switch (type)
{
@ -171,6 +184,7 @@ namespace HeavenStudio.Games
instance.warnAnim.Play("WarnPlane", 0, 0);
break;
}
}
}),
new BeatAction.Action(beat, delegate
{