mirror of
https://github.com/RHeavenStudio/HeavenStudio.git
synced 2025-06-12 18:37:38 +02:00
Second PlayerActionEvent Pass (#206)
* fix crop stomp input scheduling bugs * update space soccer to use PlayerActionEvent * update spaceball to use PlayerActionEvent make PlayerActionEvents clean themselves up on game switch * update rhythm rally to use PlayerActionEvent * update rhythm tweezers to use PlayerActionEvent * update mahou tsukai to use PlayerActionEvent * reduce logging level
This commit is contained in:
@ -21,24 +21,12 @@ namespace HeavenStudio.Games.Scripts_RhythmTweezers
|
||||
tweezers = game.Tweezers;
|
||||
}
|
||||
|
||||
private void Start() {
|
||||
game.ScheduleInput(createBeat, game.tweezerBeatOffset + game.beatInterval, InputType.STANDARD_DOWN | InputType.DIRECTION_DOWN, Just, Miss, Out);
|
||||
}
|
||||
|
||||
private void Update()
|
||||
{
|
||||
if (plucked) return;
|
||||
|
||||
float stateBeat = Conductor.instance.GetPositionFromMargin(createBeat + game.tweezerBeatOffset + game.beatInterval, 1f);
|
||||
StateCheck(stateBeat);
|
||||
|
||||
if (PlayerInput.Pressed(true))
|
||||
{
|
||||
if (state.perfect)
|
||||
{
|
||||
Ace();
|
||||
}
|
||||
else if (state.notPerfect())
|
||||
{
|
||||
Miss();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void Ace()
|
||||
@ -48,16 +36,27 @@ namespace HeavenStudio.Games.Scripts_RhythmTweezers
|
||||
plucked = true;
|
||||
}
|
||||
|
||||
public void Miss()
|
||||
public void NearMiss()
|
||||
{
|
||||
tweezers.Pluck(false, this);
|
||||
tweezers.hitOnFrame++;
|
||||
plucked = true;
|
||||
}
|
||||
|
||||
public override void OnAce()
|
||||
private void Just(PlayerActionEvent caller, float state)
|
||||
{
|
||||
if (state >= 1f || state <= -1f) {
|
||||
NearMiss();
|
||||
return;
|
||||
}
|
||||
Ace();
|
||||
}
|
||||
|
||||
private void Miss(PlayerActionEvent caller)
|
||||
{
|
||||
// this is where perfect challenge breaks
|
||||
}
|
||||
|
||||
private void Out(PlayerActionEvent caller) {}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user