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

@ -17,7 +17,7 @@ namespace HeavenStudio.Games.Loaders
new GameAction("bop", "Bop")
{
function = delegate { var e = eventCaller.currentEntity; DrummingPractice.instance.SetBop(e.beat, e.length); },
defaultLength = 0.5f,
defaultLength = 1f,
resizable = true
},
new GameAction("drum", "Hit Drum")
@ -41,6 +41,17 @@ namespace HeavenStudio.Games.Loaders
new Param("toggle", false, "Set All to Player", "Sets all Miis to the Player's Mii")
}
},
new GameAction("move npc drummers", "NPC Drummers Enter or Exit")
{
function = delegate {var e = eventCaller.currentEntity; DrummingPractice.instance.NPCDrummersEnterOrExit(e.beat, e.length, e["exit"], e["ease"]); },
defaultLength = 4f,
resizable = true,
parameters = new List<Param>()
{
new Param("exit", false, "Exit?", "Should the NPC drummers exit or enter?"),
new Param("ease", EasingFunction.Ease.Linear, "Ease", "Which ease should the movement have?")
}
},
new GameAction("set background color", "Set Background Color")
{
function = delegate {var e = eventCaller.currentEntity; DrummingPractice.instance.SetBackgroundColor(e["colorA"], e["colorB"], e["colorC"]); },
@ -86,6 +97,14 @@ namespace HeavenStudio.Games
public Drummer leftDrummer;
public Drummer rightDrummer;
public GameObject hitPrefab;
[SerializeField] Animator NPCDrummers;
[Header("Variables")]
float movingLength;
float movingStartBeat;
bool isMoving;
string moveAnim;
EasingFunction.Ease lastEase;
public GameEvent bop = new GameEvent();
public int count = 0;
@ -109,14 +128,23 @@ namespace HeavenStudio.Games
private void Update()
{
if (Conductor.instance.ReportBeat(ref bop.lastReportedBeat, bop.startBeat % 1))
var cond = Conductor.instance;
if (cond.ReportBeat(ref bop.lastReportedBeat, bop.startBeat % 1))
{
if (Conductor.instance.songPositionInBeats >= bop.startBeat && Conductor.instance.songPositionInBeats < bop.startBeat + bop.length)
if (cond.songPositionInBeats >= bop.startBeat && Conductor.instance.songPositionInBeats < bop.startBeat + bop.length)
{
Bop();
}
}
if (isMoving && cond.isPlaying && !cond.isPaused)
{
float normalizedBeat = cond.GetPositionFromBeat(movingStartBeat, movingLength);
EasingFunction.Function func = EasingFunction.GetEasingFunction(lastEase);
float newPos = func(0f, 1f, normalizedBeat);
NPCDrummers.DoNormalizedAnimation(moveAnim, newPos);
}
foreach (SpriteRenderer streak in streaks)
{
Color col = streak.color;
@ -124,6 +152,19 @@ namespace HeavenStudio.Games
}
}
public void NPCDrummersEnterOrExit(float beat, float length, bool exit, int ease)
{
movingStartBeat = beat;
movingLength = length;
moveAnim = exit ? "NPCDrummersExit" : "NPCDrummersEnter";
isMoving = true;
lastEase = (EasingFunction.Ease)ease;
BeatAction.New(instance.gameObject, new List<BeatAction.Action>()
{
new BeatAction.Action(beat + length - 0.01f, delegate { isMoving = false; })
});
}
public void SetBop(float beat, float length)
{
bop.startBeat = beat;