Merge remote-tracking branch 'upstream/master' into MiscAdditions_4

This commit is contained in:
AstrlJelly
2023-06-10 16:01:44 -04:00
176 changed files with 4903 additions and 3019 deletions

View File

@ -34,7 +34,8 @@ namespace HeavenStudio.Games.Loaders
},
new GameAction("sigh", "Sigh")
{
function = delegate { Jukebox.PlayOneShot("games/forkLifter/sigh"); }
function = delegate { SoundByte.PlayOneShot("games/forkLifter/sigh"); }
},
new GameAction("color", "Background Color")
{
@ -147,12 +148,13 @@ namespace HeavenStudio.Games
instance = this;
}
public override void OnGameSwitch(float beat)
public override void OnGameSwitch(double beat)
{
base.OnGameSwitch(beat);
ForkLifterHand.CheckNextFlick();
}
public void Bop(float beat, float length, bool doesBop, bool autoBop)
{
playerInstance.shouldBop = (autoBop || doesBop);
@ -165,9 +167,9 @@ namespace HeavenStudio.Games
}
}
public void Flick(float beat, int type)
public void Flick(double beat, int type)
{
Jukebox.PlayOneShotGame("forkLifter/flick");
SoundByte.PlayOneShotGame("forkLifter/flick");
handAnim.Play("Hand_Flick", 0, 0);
ForkLifterHand.currentFlickIndex++;
GameObject fo = Instantiate(flickedObject);

View File

@ -4,6 +4,8 @@ using System.Linq;
using UnityEngine;
using HeavenStudio.Util;
using Jukebox;
using Jukebox.Legacy;
namespace HeavenStudio.Games.Scripts_ForkLifter
{
@ -13,17 +15,17 @@ namespace HeavenStudio.Games.Scripts_ForkLifter
public Sprite[] fastSprites;
private List<DynamicBeatmap.DynamicEntity> allFlickEntities = new List<DynamicBeatmap.DynamicEntity>();
private List<RiqEntity> allFlickEntities = new List<RiqEntity>();
public int currentFlickIndex;
private void Awake()
{
var flickEntities = EventCaller.GetAllInGameManagerList("forkLifter", new string[] { "flick" });
List<DynamicBeatmap.DynamicEntity> tempEvents = new List<DynamicBeatmap.DynamicEntity>();
List<RiqEntity> tempEvents = new List<RiqEntity>();
for (int i = 0; i < flickEntities.Count; i++)
{
if (flickEntities[i].beat >= Conductor.instance.songPositionInBeats)
if (flickEntities[i].beat >= Conductor.instance.songPositionInBeatsAsDouble)
{
tempEvents.Add(flickEntities[i]);
}
@ -63,7 +65,7 @@ namespace HeavenStudio.Games.Scripts_ForkLifter
public void Prepare()
{
Jukebox.PlayOneShotGame("forkLifter/flickPrepare");
SoundByte.PlayOneShotGame("forkLifter/flickPrepare");
GetComponent<Animator>().Play("Hand_Prepare", 0, 0);
}
}

View File

@ -75,17 +75,17 @@ namespace HeavenStudio.Games.Scripts_ForkLifter
{
if (topbun && middleburger && bottombun)
{
Jukebox.PlayOneShotGame("forkLifter/burger");
SoundByte.PlayOneShotGame("forkLifter/burger");
}
else
{
if (currentEarlyPeasOnFork > 0 || currentLatePeasOnFork > 0)
{
Jukebox.PlayOneShotGame($"forkLifter/cough_{Random.Range(1, 3)}");
SoundByte.PlayOneShotGame($"forkLifter/cough_{Random.Range(1, 3)}");
}
else
{
Jukebox.PlayOneShotGame("forkLifter/gulp");
SoundByte.PlayOneShotGame("forkLifter/gulp");
}
}
@ -121,7 +121,7 @@ namespace HeavenStudio.Games.Scripts_ForkLifter
if (p == null)
{
Jukebox.PlayOneShotGame("forkLifter/stabnohit");
SoundByte.PlayOneShotGame("forkLifter/stabnohit");
}
anim.Play("Player_Stab", 0, 0);

View File

@ -13,7 +13,7 @@ namespace HeavenStudio.Games.Scripts_ForkLifter
ForkLifter game;
private Animator anim;
public float startBeat;
public double startBeat;
public int type;
@ -25,8 +25,8 @@ namespace HeavenStudio.Games.Scripts_ForkLifter
// SCHEDULING zoom sound so it lines up with when it meets the fork.
var currentDspTime = AudioSettings.dspTime;
var cond = Conductor.instance;
var zoomStartTime = currentDspTime + (double)(cond.pitchedSecPerBeat * 2) - 0.317;
Jukebox.PlayOneShotScheduledGame("forkLifter/zoomFast", (double)zoomStartTime);
var zoomStartTime = currentDspTime + (cond.pitchedSecPerBeatAsDouble * 2) - 0.317;
SoundByte.PlayOneShotScheduledGame("forkLifter/zoomFast", zoomStartTime);
GetComponentInChildren<SpriteRenderer>().sprite = game.peaSprites[type];
@ -91,7 +91,7 @@ namespace HeavenStudio.Games.Scripts_ForkLifter
ForkLifterPlayer.instance.FastEffectHit(type);
Jukebox.PlayOneShotGame("forkLifter/stab");
SoundByte.PlayOneShotGame("forkLifter/stab");
ForkLifterPlayer.instance.currentPerfectPeasOnFork++;
@ -136,7 +136,7 @@ namespace HeavenStudio.Games.Scripts_ForkLifter
ForkLifterPlayer.instance.FastEffectHit(type);
Jukebox.PlayOneShot("miss");
SoundByte.PlayOneShot("miss");
ForkLifterPlayer.instance.currentEarlyPeasOnFork++;
@ -167,7 +167,7 @@ namespace HeavenStudio.Games.Scripts_ForkLifter
ForkLifterPlayer.instance.FastEffectHit(type);
Jukebox.PlayOneShot("miss");
SoundByte.PlayOneShot("miss");
ForkLifterPlayer.instance.currentLatePeasOnFork++;
Destroy(this.gameObject);
@ -198,7 +198,7 @@ namespace HeavenStudio.Games.Scripts_ForkLifter
private void Miss(PlayerActionEvent caller)
{
Jukebox.PlayOneShot("forkLifter/disappointed");
SoundByte.PlayOneShot("forkLifter/disappointed");
BeatAction.New(game.gameObject, new List<BeatAction.Action>()
{
new BeatAction.Action(startBeat+ 2.45f, delegate {