mirror of
https://github.com/RHeavenStudioPlus/HeavenStudioPlus.git
synced 2024-11-22 09:35:11 +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")
|
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); },
|
||||||
preFunction = delegate { var e = eventCaller.currentEntity; RhythmTweezers.PrePassTurn(e.beat, e.length); }
|
|
||||||
},
|
},
|
||||||
new GameAction("next vegetable", "Swap Vegetable")
|
new GameAction("next vegetable", "Swap Vegetable")
|
||||||
{
|
{
|
||||||
|
@ -352,24 +351,27 @@ namespace HeavenStudio.Games
|
||||||
{
|
{
|
||||||
if (crHandlerInstance.queuedEvents.Count > 0)
|
if (crHandlerInstance.queuedEvents.Count > 0)
|
||||||
{
|
{
|
||||||
hairsLeft = crHandlerInstance.queuedEvents.Count;
|
|
||||||
foreach (var crEvent in crHandlerInstance.queuedEvents)
|
|
||||||
{
|
|
||||||
if (crEvent.tag == "Hair")
|
|
||||||
{
|
|
||||||
Hair hairToInput = spawnedHairs.Find(x => x.createBeat == crEvent.beat);
|
|
||||||
hairToInput.StartInput(beat + 1, crEvent.relativeBeat);
|
|
||||||
}
|
|
||||||
else if (crEvent.tag == "Long")
|
|
||||||
{
|
|
||||||
LongHair hairToInput = spawnedLongs.Find(x => x.createBeat == crEvent.beat);
|
|
||||||
hairToInput.StartInput(beat + 1, crEvent.relativeBeat);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
crHandlerInstance.queuedEvents.Clear();
|
|
||||||
BeatAction.New(instance.gameObject, new List<BeatAction.Action>()
|
BeatAction.New(instance.gameObject, new List<BeatAction.Action>()
|
||||||
{
|
{
|
||||||
new BeatAction.Action(beat + 1, delegate
|
new BeatAction.Action(beat - 1, delegate
|
||||||
|
{
|
||||||
|
hairsLeft = crHandlerInstance.queuedEvents.Count;
|
||||||
|
foreach (var crEvent in crHandlerInstance.queuedEvents)
|
||||||
|
{
|
||||||
|
if (crEvent.tag == "Hair")
|
||||||
|
{
|
||||||
|
Hair hairToInput = spawnedHairs.Find(x => x.createBeat == crEvent.beat);
|
||||||
|
hairToInput.StartInput(beat, crEvent.relativeBeat);
|
||||||
|
}
|
||||||
|
else if (crEvent.tag == "Long")
|
||||||
|
{
|
||||||
|
LongHair hairToInput = spawnedLongs.Find(x => x.createBeat == crEvent.beat);
|
||||||
|
hairToInput.StartInput(beat, crEvent.relativeBeat);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
crHandlerInstance.queuedEvents.Clear();
|
||||||
|
}),
|
||||||
|
new BeatAction.Action(beat, delegate
|
||||||
{
|
{
|
||||||
if (crHandlerInstance.queuedEvents.Count > 0)
|
if (crHandlerInstance.queuedEvents.Count > 0)
|
||||||
{
|
{
|
||||||
|
@ -379,12 +381,12 @@ namespace HeavenStudio.Games
|
||||||
if (crEvent.tag == "Hair")
|
if (crEvent.tag == "Hair")
|
||||||
{
|
{
|
||||||
Hair hairToInput = spawnedHairs.Find(x => x.createBeat == crEvent.beat);
|
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")
|
else if (crEvent.tag == "Long")
|
||||||
{
|
{
|
||||||
LongHair hairToInput = spawnedLongs.Find(x => x.createBeat == crEvent.beat);
|
LongHair hairToInput = spawnedLongs.Find(x => x.createBeat == crEvent.beat);
|
||||||
hairToInput.StartInput(beat + 1, crEvent.relativeBeat);
|
hairToInput.StartInput(beat, crEvent.relativeBeat);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
crHandlerInstance.queuedEvents.Clear();
|
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")
|
if (GameManager.instance.currentGame == "rhythmTweezers")
|
||||||
{
|
{
|
||||||
instance.SetPassTurnValues(beat + length);
|
instance.SetPassTurnValues(beat);
|
||||||
|
instance.PassTurn(beat);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
passedTurns.Add(beat + length);
|
passedTurns.Add(beat);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void SetPassTurnValues(double startBeat)
|
private void SetPassTurnValues(double startBeat)
|
||||||
{
|
{
|
||||||
if (crHandlerInstance.intervalLength <= 0) return;
|
if (crHandlerInstance.intervalLength <= 0) return;
|
||||||
passTurnBeat = startBeat - 1f;
|
passTurnBeat = startBeat - 1;
|
||||||
passTurnEndBeat = startBeat + crHandlerInstance.intervalLength;
|
passTurnEndBeat = startBeat + crHandlerInstance.intervalLength;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -512,6 +515,7 @@ namespace HeavenStudio.Games
|
||||||
foreach (var turn in passedTurns)
|
foreach (var turn in passedTurns)
|
||||||
{
|
{
|
||||||
SetPassTurnValues(turn);
|
SetPassTurnValues(turn);
|
||||||
|
PassTurn(turn);
|
||||||
}
|
}
|
||||||
passedTurns.Clear();
|
passedTurns.Clear();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue