Tons of cleanup in TONS OF MINIGAMES!!! (#270)

* Tons of stuff...

* Drumming practice improvements

* Easing for drumming practice

* Converted TOTC to prefunction

* Split scratch o into two

* Forthington voice lines can now be played outside of air rally

* Rhythm Rally Improvements

* Air rally sound improvements

* Spawn blocks rework

* BTS ds small tweaks

* Tap Trial fixes

* More tweaks to tap trial

* Final minor tweaks
This commit is contained in:
Rapandrasmus
2023-02-14 17:31:51 +01:00
committed by GitHub
parent df11239b04
commit fe19ddc767
203 changed files with 6749 additions and 11718 deletions

View File

@ -12,7 +12,7 @@ namespace HeavenStudio.Games.Loaders
public static class AgbTapLoader
{
public static Minigame AddGame(EventCaller eventCaller) {
return new Minigame("tapTrial", "Tap Trial \n<color=#eb5454>[WIP]</color>", "93ffb3", false, false, new List<GameAction>()
return new Minigame("tapTrial", "Tap Trial", "93ffb3", false, false, new List<GameAction>()
{
new GameAction("bop", "Bop")
{
@ -20,7 +20,7 @@ namespace HeavenStudio.Games.Loaders
defaultLength = .5f,
parameters = new List<Param>()
{
new Param("toggle", true, "Bop", "Whether both will bop to the beat or not")
new Param("toggle", false, "Bop", "Whether both will bop to the beat or not")
}
},
new GameAction("tap", "Tap")
@ -61,23 +61,23 @@ namespace HeavenStudio.Games.Loaders
new GameAction("scroll event", "Scroll Background")
{
function = delegate { TapTrial.instance.scrollEvent(eventCaller.currentEntity["toggle"], eventCaller.currentEntity["toggle"]); },
function = delegate { TapTrial.instance.scrollEvent(eventCaller.currentEntity["toggle"], eventCaller.currentEntity["flash"]); },
defaultLength = .5f,
parameters = new List<Param>()
{
new Param("toggle", false, "Scroll FX", "Will scroll"),
new Param("toggle", false, "Flash FX", "Will flash to white"),
new Param("toggle", true, "Scroll FX", "Will scroll"),
new Param("flash", false, "Flash FX", "Will flash to white"),
}
},
new GameAction("giraffe events", "Giraffe Animations")
{
function = delegate { TapTrial.instance.giraffeEvent(eventCaller.currentEntity["toggle"], eventCaller.currentEntity["toggle"]); },
function = delegate { TapTrial.instance.giraffeEvent(eventCaller.currentEntity["instant"]); },
defaultLength = .5f,
parameters = new List<Param>()
{
new Param("toggle", false, "Enter", "Giraffe will enter the scene"),
new Param("toggle", false, "Exit", "Giraffe will exit the scene"),
new Param("toggle", true, "Enter?", "Giraffe will enter the scene"),
new Param("instant", false, "Instant", "Will the giraffe enter/exit instantly?")
}
}
});
@ -105,7 +105,7 @@ namespace HeavenStudio.Games
[SerializeField] SpriteRenderer flash;
[SerializeField] ScrollForTap scroll;
[SerializeField] GameObject giraffe;
bool goBop, isPrep;
bool goBop = true, isPrep;
float lastReportedBeat = 0f;
bool hasJumped, isFinalJump;
public float jumpStartTime = Single.MinValue;
@ -129,9 +129,9 @@ namespace HeavenStudio.Games
{
if (Conductor.instance.ReportBeat(ref lastReportedBeat))
{
monkeys[0].Play("Bop", 0, 0);
monkeys[1].Play("Bop", 0, 0);
player.anim.Play("Bop", 0, 0);
if (isPlaying(monkeys[0], "Idle")) monkeys[0].DoScaledAnimationAsync("Bop", 0.5f);
if (isPlaying(monkeys[1], "Idle")) monkeys[1].DoScaledAnimationAsync("Bop", 0.5f);
if (isPlaying(player.anim, "Idle")) player.anim.DoScaledAnimationAsync("Bop", 0.5f);
}
else if (Conductor.instance.songPositionInBeats < lastReportedBeat)
{
@ -166,40 +166,32 @@ namespace HeavenStudio.Games
//Jukebox.PlayOneShotGame("fanClub/landing_impact", pitch: UnityEngine.Random.Range(0.95f, 1f), volume: 1f / 4);
}
hasJumped = false;
}
if (PlayerInput.Pressed() && !IsExpectingInputNow())
{
player.anim.Play("Tap", 0, 0);
Jukebox.PlayOneShotGame("tapTrial/tonk");
if (PlayerInput.Pressed() && !IsExpectingInputNow())
{
player.anim.Play("Tap", 0, 0);
Jukebox.PlayOneShotGame("tapTrial/tonk");
}
}
}
public void Bop(bool isBopping)
{
if (isBopping)
{
goBop = true;
}
else
{
goBop = false;
}
goBop = isBopping;
}
public void Tap(float beat)
{
isPrep = true;
Jukebox.PlayOneShotGame("tapTrial/ook");
player.anim.Play("TapPrepare", 0, 0);
player.anim.DoScaledAnimationAsync("TapPrepare", 0.5f);
//Monkey Tap Prepare Anim
BeatAction.New(gameObject, new List<BeatAction.Action>()
{
new BeatAction.Action(beat, delegate { monkeys[0].Play("TapPrepare"); }),
new BeatAction.Action(beat, delegate { monkeys[1].Play("TapPrepare"); }),
new BeatAction.Action(beat + 1f, delegate { monkeys[0].Play("Tap"); particleEffectMonkeys(); }),
new BeatAction.Action(beat + 1f, delegate { monkeys[1].Play("Tap"); }),
new BeatAction.Action(beat, delegate { monkeys[0].DoScaledAnimationAsync("TapPrepare", 0.5f); }),
new BeatAction.Action(beat, delegate { monkeys[1].DoScaledAnimationAsync("TapPrepare", 0.5f); }),
new BeatAction.Action(beat + 1f, delegate { monkeys[0].DoScaledAnimationAsync("Tap", 0.6f); particleEffectMonkeys(); }),
new BeatAction.Action(beat + 1f, delegate { monkeys[1].DoScaledAnimationAsync("Tap", 0.6f); }),
});
//CreateTap(beat);
ScheduleInput(beat, 1f, InputType.STANDARD_DOWN, OnTap, OnTapMiss, OnEmpty);
@ -219,27 +211,29 @@ namespace HeavenStudio.Games
new MultiSound.Sound("tapTrial/ookook", beat + 0.5f)
});
player.anim.Play("DoubleTapPrepare", 0, 0);
player.anim.DoScaledAnimationAsync("DoubleTapPrepare", 0.5f);
BeatAction.New(gameObject, new List<BeatAction.Action>()
{
new BeatAction.Action(beat, delegate { monkeys[0].Play("DoubleTapPrepare", 0, 0); }),
new BeatAction.Action(beat + .5f, delegate { monkeys[0].Play("DoubleTapPrepare_2", 0, 0); }),
new BeatAction.Action(beat + 1f, delegate { monkeys[0].Play("DoubleTap", 0, 0); particleEffectMonkeys(); }),
new BeatAction.Action(beat + 1.5f, delegate { monkeys[0].Play("DoubleTap", 0, 0); particleEffectMonkeys(); }),
new BeatAction.Action(beat, delegate { monkeys[0].DoScaledAnimationAsync("DoubleTapPrepare", 0.5f); }),
new BeatAction.Action(beat + .5f, delegate { monkeys[0].DoScaledAnimationAsync("DoubleTapPrepare_2", 0.5f); }),
new BeatAction.Action(beat + 1f, delegate { monkeys[0].DoScaledAnimationAsync("DoubleTap", 0.6f); particleEffectMonkeys(); }),
new BeatAction.Action(beat + 1.5f, delegate { monkeys[0].DoScaledAnimationAsync("DoubleTap", 0.6f); particleEffectMonkeys(); }),
new BeatAction.Action(beat + 1.99f, delegate {monkeys[0].Play("Idle", 0, 0); }),
});
BeatAction.New(gameObject, new List<BeatAction.Action>()
{
new BeatAction.Action(beat, delegate { monkeys[1].Play("DoubleTapPrepare", 0, 0); }),
new BeatAction.Action(beat + .5f, delegate { monkeys[1].Play("DoubleTapPrepare_2", 0, 0); }),
new BeatAction.Action(beat + 1f, delegate { monkeys[1].Play("DoubleTap", 0, 0); }),
new BeatAction.Action(beat + 1.5f, delegate { monkeys[1].Play("DoubleTap", 0, 0); }),
new BeatAction.Action(beat, delegate { monkeys[1].DoScaledAnimationAsync("DoubleTapPrepare", 0.5f); }),
new BeatAction.Action(beat + .5f, delegate { monkeys[1].DoScaledAnimationAsync("DoubleTapPrepare_2", 0.5f); }),
new BeatAction.Action(beat + 1f, delegate { monkeys[1].DoScaledAnimationAsync("DoubleTap", 0.6f); }),
new BeatAction.Action(beat + 1.5f, delegate { monkeys[1].DoScaledAnimationAsync("DoubleTap", 0.6f); }),
new BeatAction.Action(beat + 1.99f, delegate {monkeys[1].Play("Idle", 0, 0); }),
});
BeatAction.New(gameObject, new List<BeatAction.Action>()
{
new BeatAction.Action(beat + 4f, delegate { isPrep = false; })
new BeatAction.Action(beat + 1.99f, delegate { isPrep = false; })
});
ScheduleInput(beat, 1f, InputType.STANDARD_DOWN, OnDoubleTap, OnTapMiss, OnEmpty);
@ -358,17 +352,19 @@ namespace HeavenStudio.Games
});
}
public void giraffeEvent(bool enter, bool exit)
public void giraffeEvent(bool instant)
{
if (enter && !giraffeIsIn)
float animTime = 0;
if (instant) animTime = 1;
if (!giraffeIsIn)
{
giraffe.SetActive(true);
giraffe.GetComponent<Animator>().Play("Enter", 0, 0);
giraffe.GetComponent<Animator>().Play("Enter", 0, animTime);
giraffeIsIn = true;
}
else if (exit && giraffeIsIn)
else if (giraffeIsIn)
{
giraffe.GetComponent<Animator>().Play("Exit", 0, 0);
giraffe.GetComponent<Animator>().Play("Exit", 0, animTime);
giraffeIsIn = false;
}
}
@ -400,13 +396,13 @@ namespace HeavenStudio.Games
public void OnTap(PlayerActionEvent caller, float beat)
{
Jukebox.PlayOneShotGame("tapTrial/tap");
player.anim.Play("Tap", 0, 0);
player.anim.DoScaledAnimationAsync("Tap", 0.6f);
player_effects[0].GetComponent<ParticleSystem>().Play();
}
public void OnDoubleTap(PlayerActionEvent caller, float beat)
{
Jukebox.PlayOneShotGame("tapTrial/tap");
player.anim.Play("DoubleTap", 0, 0);
player.anim.DoScaledAnimationAsync("DoubleTap", 0.6f);
player_effects[1].GetComponent<ParticleSystem>().Play();
}
@ -493,6 +489,14 @@ namespace HeavenStudio.Games
}
#endregion
bool isPlaying(Animator anim, string stateName)
{
if (anim.GetCurrentAnimatorStateInfo(0).IsName(stateName) &&
anim.GetCurrentAnimatorStateInfo(0).normalizedTime < 1.0f)
return true;
else
return false;
}
//this is the orig way for input handling
//public void CreateTap(float beat, int type = 0)