mirror of
https://github.com/RHeavenStudioPlus/HeavenStudioPlus.git
synced 2024-11-25 11:05:16 +00:00
Rhythm tweezers pass turn now works like working dough
This commit is contained in:
parent
6eac745eae
commit
0debf55391
1 changed files with 28 additions and 24 deletions
|
@ -37,8 +37,7 @@ namespace HeavenStudio.Games.Loaders
|
|||
},
|
||||
new GameAction("passTurn", "Pass Turn")
|
||||
{
|
||||
function = delegate { var e = eventCaller.currentEntity; RhythmTweezers.instance.PassTurn(e.beat); },
|
||||
preFunction = delegate { var e = eventCaller.currentEntity; RhythmTweezers.PrePassTurn(e.beat, e.length); }
|
||||
preFunction = delegate { var e = eventCaller.currentEntity; RhythmTweezers.PrePassTurn(e.beat); },
|
||||
},
|
||||
new GameAction("next vegetable", "Swap Vegetable")
|
||||
{
|
||||
|
@ -351,6 +350,10 @@ namespace HeavenStudio.Games
|
|||
public void PassTurn(double beat)
|
||||
{
|
||||
if (crHandlerInstance.queuedEvents.Count > 0)
|
||||
{
|
||||
BeatAction.New(instance.gameObject, new List<BeatAction.Action>()
|
||||
{
|
||||
new BeatAction.Action(beat - 1, delegate
|
||||
{
|
||||
hairsLeft = crHandlerInstance.queuedEvents.Count;
|
||||
foreach (var crEvent in crHandlerInstance.queuedEvents)
|
||||
|
@ -358,18 +361,17 @@ namespace HeavenStudio.Games
|
|||
if (crEvent.tag == "Hair")
|
||||
{
|
||||
Hair hairToInput = spawnedHairs.Find(x => x.createBeat == crEvent.beat);
|
||||
hairToInput.StartInput(beat + 1, crEvent.relativeBeat);
|
||||
hairToInput.StartInput(beat, crEvent.relativeBeat);
|
||||
}
|
||||
else if (crEvent.tag == "Long")
|
||||
{
|
||||
LongHair hairToInput = spawnedLongs.Find(x => x.createBeat == crEvent.beat);
|
||||
hairToInput.StartInput(beat + 1, crEvent.relativeBeat);
|
||||
hairToInput.StartInput(beat, crEvent.relativeBeat);
|
||||
}
|
||||
}
|
||||
crHandlerInstance.queuedEvents.Clear();
|
||||
BeatAction.New(instance.gameObject, new List<BeatAction.Action>()
|
||||
{
|
||||
new BeatAction.Action(beat + 1, delegate
|
||||
}),
|
||||
new BeatAction.Action(beat, delegate
|
||||
{
|
||||
if (crHandlerInstance.queuedEvents.Count > 0)
|
||||
{
|
||||
|
@ -379,12 +381,12 @@ namespace HeavenStudio.Games
|
|||
if (crEvent.tag == "Hair")
|
||||
{
|
||||
Hair hairToInput = spawnedHairs.Find(x => x.createBeat == crEvent.beat);
|
||||
hairToInput.StartInput(beat + 1, crEvent.relativeBeat);
|
||||
hairToInput.StartInput(beat, crEvent.relativeBeat);
|
||||
}
|
||||
else if (crEvent.tag == "Long")
|
||||
{
|
||||
LongHair hairToInput = spawnedLongs.Find(x => x.createBeat == crEvent.beat);
|
||||
hairToInput.StartInput(beat + 1, crEvent.relativeBeat);
|
||||
hairToInput.StartInput(beat, crEvent.relativeBeat);
|
||||
}
|
||||
}
|
||||
crHandlerInstance.queuedEvents.Clear();
|
||||
|
@ -394,22 +396,23 @@ namespace HeavenStudio.Games
|
|||
}
|
||||
}
|
||||
|
||||
public static void PrePassTurn(double beat, float length)
|
||||
public static void PrePassTurn(double beat)
|
||||
{
|
||||
if (GameManager.instance.currentGame == "rhythmTweezers")
|
||||
{
|
||||
instance.SetPassTurnValues(beat + length);
|
||||
instance.SetPassTurnValues(beat);
|
||||
instance.PassTurn(beat);
|
||||
}
|
||||
else
|
||||
{
|
||||
passedTurns.Add(beat + length);
|
||||
passedTurns.Add(beat);
|
||||
}
|
||||
}
|
||||
|
||||
private void SetPassTurnValues(double startBeat)
|
||||
{
|
||||
if (crHandlerInstance.intervalLength <= 0) return;
|
||||
passTurnBeat = startBeat - 1f;
|
||||
passTurnBeat = startBeat - 1;
|
||||
passTurnEndBeat = startBeat + crHandlerInstance.intervalLength;
|
||||
}
|
||||
|
||||
|
@ -512,6 +515,7 @@ namespace HeavenStudio.Games
|
|||
foreach (var turn in passedTurns)
|
||||
{
|
||||
SetPassTurnValues(turn);
|
||||
PassTurn(turn);
|
||||
}
|
||||
passedTurns.Clear();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue