mirror of
https://github.com/RHeavenStudio/HeavenStudio.git
synced 2025-06-12 08:17:38 +02:00
Merge remote-tracking branch 'upstream/master' into MiscAdditions_4
This commit is contained in:
@ -74,11 +74,11 @@ namespace HeavenStudio.Games
|
||||
using Scripts_MeatGrinder;
|
||||
public class MeatGrinder : Minigame
|
||||
{
|
||||
static List<float> queuedInputs = new List<float>();
|
||||
static List<double> queuedInputs = new();
|
||||
static List<QueuedInterval> queuedIntervals = new List<QueuedInterval>();
|
||||
struct QueuedInterval
|
||||
{
|
||||
public float beat;
|
||||
public double beat;
|
||||
public float length;
|
||||
}
|
||||
|
||||
@ -91,11 +91,11 @@ namespace HeavenStudio.Games
|
||||
|
||||
[Header("Variables")]
|
||||
bool intervalStarted;
|
||||
float intervalStartBeat;
|
||||
double intervalStartBeat;
|
||||
bool bossBop = true;
|
||||
public float beatInterval = 4f;
|
||||
public bool bossAnnoyed = false;
|
||||
private float lastReportedBeat = 0f;
|
||||
private double lastReportedBeat = 0f;
|
||||
const string sfxName = "meatGrinder/";
|
||||
|
||||
public static MeatGrinder instance;
|
||||
@ -127,8 +127,8 @@ namespace HeavenStudio.Games
|
||||
if (PlayerInput.Pressed(true) && (!IsExpectingInputNow(InputType.STANDARD_DOWN) || !IsExpectingInputNow(InputType.DIRECTION_DOWN))) {
|
||||
TackAnim.DoScaledAnimationAsync("TackEmptyHit", 0.5f);
|
||||
TackAnim.SetBool("tackMeated", false);
|
||||
Jukebox.PlayOneShotGame(sfxName+"whiff");
|
||||
bossAnnoyed = false;
|
||||
SoundByte.PlayOneShotGame(sfxName+"whiff");
|
||||
if (bossAnnoyed) BossAnim.DoScaledAnimationAsync("Bop", 0.5f);
|
||||
}
|
||||
|
||||
if (bossAnnoyed) BossAnim.SetBool("bossAnnoyed", true);
|
||||
@ -150,7 +150,7 @@ namespace HeavenStudio.Games
|
||||
}
|
||||
}
|
||||
|
||||
public void Bop(float beat, float length, bool doesBop, bool autoBop)
|
||||
public void Bop(double beat, float length, bool doesBop, bool autoBop)
|
||||
{
|
||||
bossBop = autoBop;
|
||||
if (doesBop) {
|
||||
@ -166,7 +166,7 @@ namespace HeavenStudio.Games
|
||||
}
|
||||
}
|
||||
|
||||
public static void PreInterval(float beat, float length)
|
||||
public static void PreInterval(double beat, float length)
|
||||
{
|
||||
if (MeatGrinder.instance.intervalStarted || MeatGrinder.queuedIntervals.Count > 0) return;
|
||||
|
||||
@ -186,7 +186,7 @@ namespace HeavenStudio.Games
|
||||
}
|
||||
}
|
||||
|
||||
public void StartInterval(float beat, float length)
|
||||
public void StartInterval(double beat, float length)
|
||||
{
|
||||
if (MeatGrinder.instance.intervalStarted) return;
|
||||
|
||||
@ -199,9 +199,9 @@ namespace HeavenStudio.Games
|
||||
});
|
||||
}
|
||||
|
||||
public void MeatToss(float beat)
|
||||
public void MeatToss(double beat)
|
||||
{
|
||||
Jukebox.PlayOneShotGame(sfxName+"toss");
|
||||
SoundByte.PlayOneShotGame(sfxName+"toss");
|
||||
|
||||
MeatToss Meat = Instantiate(MeatBase, gameObject.transform).GetComponent<MeatToss>();
|
||||
Meat.startBeat = beat;
|
||||
@ -210,17 +210,17 @@ namespace HeavenStudio.Games
|
||||
Meat.meatType = "DarkMeat";
|
||||
}
|
||||
|
||||
public void MeatCall(float beat)
|
||||
public void MeatCall(double beat)
|
||||
{
|
||||
BossAnim.DoScaledAnimationAsync("BossCall", 0.5f);
|
||||
Jukebox.PlayOneShotGame(sfxName+"signal");
|
||||
SoundByte.PlayOneShotGame(sfxName+"signal");
|
||||
|
||||
StartInterval(beat, beatInterval);
|
||||
|
||||
queuedInputs.Add(beat - intervalStartBeat);
|
||||
}
|
||||
|
||||
public void PassTurn(float beat)
|
||||
public void PassTurn(double beat)
|
||||
{
|
||||
intervalStarted = false;
|
||||
foreach (var input in queuedInputs)
|
||||
|
Reference in New Issue
Block a user