diff --git a/Assets/Scripts/Games/AnimalAcrobat/AnimalAcrobat.cs b/Assets/Scripts/Games/AnimalAcrobat/AnimalAcrobat.cs index e14e8b5b9..8532166ef 100644 --- a/Assets/Scripts/Games/AnimalAcrobat/AnimalAcrobat.cs +++ b/Assets/Scripts/Games/AnimalAcrobat/AnimalAcrobat.cs @@ -112,6 +112,8 @@ namespace HeavenStudio.Games private double _jumpBeat = double.MaxValue; + public bool MonkeyMissed = false; + public static AnimalAcrobat instance; private void Awake() diff --git a/Assets/Scripts/Games/AnimalAcrobat/GiraffeInput.cs b/Assets/Scripts/Games/AnimalAcrobat/GiraffeInput.cs index 01c2cdc90..99b5496ce 100644 --- a/Assets/Scripts/Games/AnimalAcrobat/GiraffeInput.cs +++ b/Assets/Scripts/Games/AnimalAcrobat/GiraffeInput.cs @@ -14,6 +14,8 @@ namespace HeavenStudio.Games.Scripts_AnimalAcrobat private Sound _drumRollSound; + private PlayerActionEvent _releaseAction; + private void Awake() { _game = AnimalAcrobat.instance; @@ -28,8 +30,8 @@ namespace HeavenStudio.Games.Scripts_AnimalAcrobat public void Init(double beat, bool beforeGiraffe) { - _game.ScheduleInput(beat - 1, 1, InputType.STANDARD_DOWN, beforeGiraffe ? JustHoldGiraffe : JustHold, Empty, Empty); - _game.ScheduleInput(beat, 4, InputType.STANDARD_UP, JustRelease, Empty, Empty); + _game.ScheduleInput(beat - 1, 1, InputType.STANDARD_DOWN, beforeGiraffe ? JustHoldGiraffe : JustHold, Miss, Empty); + _releaseAction = _game.ScheduleInput(beat, 4, InputType.STANDARD_UP, JustRelease, Miss, Empty); _monkey.gameObject.SetActive(false); MultiSound.Play(new MultiSound.Sound[] @@ -107,6 +109,15 @@ namespace HeavenStudio.Games.Scripts_AnimalAcrobat }); } + private void Miss(PlayerActionEvent caller) + { + if (_game.MonkeyMissed) return; + SoundByte.PlayOneShotGame("animalAcrobat/miss"); + _releaseAction?.Disable(); + _releaseAction?.QueueDeletion(); + _game.MonkeyMissed = true; + } + private void Empty(PlayerActionEvent caller) { } } } diff --git a/Assets/Scripts/Games/AnimalAcrobat/ObstacleInput.cs b/Assets/Scripts/Games/AnimalAcrobat/ObstacleInput.cs index fe2d22b66..2f9dec014 100644 --- a/Assets/Scripts/Games/AnimalAcrobat/ObstacleInput.cs +++ b/Assets/Scripts/Games/AnimalAcrobat/ObstacleInput.cs @@ -14,6 +14,8 @@ namespace HeavenStudio.Games.Scripts_AnimalAcrobat private AnimalAcrobat _game; + private PlayerActionEvent _releaseAction; + private void Awake() { _game = AnimalAcrobat.instance; @@ -23,8 +25,8 @@ namespace HeavenStudio.Games.Scripts_AnimalAcrobat public void Init(double beat, bool beforeGiraffe) { - _game.ScheduleInput(beat - 1, 1, InputType.STANDARD_DOWN, beforeGiraffe ? JustHoldGiraffe : JustHold, Empty, Empty); - _game.ScheduleInput(beat, _holdLength, InputType.STANDARD_UP, JustRelease, Empty, Empty); + _game.ScheduleInput(beat - 1, 1, InputType.STANDARD_DOWN, beforeGiraffe ? JustHoldGiraffe : JustHold, Miss, Empty); + _releaseAction = _game.ScheduleInput(beat, _holdLength, InputType.STANDARD_UP, JustRelease, Miss, Empty); _monkey.gameObject.SetActive(false); MultiSound.Play(new MultiSound.Sound[] @@ -77,6 +79,15 @@ namespace HeavenStudio.Games.Scripts_AnimalAcrobat _game.PlayerJump(caller.startBeat + caller.timer, false); } + private void Miss(PlayerActionEvent caller) + { + if (_game.MonkeyMissed) return; + SoundByte.PlayOneShotGame("animalAcrobat/miss"); + _releaseAction?.Disable(); + _releaseAction?.QueueDeletion(); + _game.MonkeyMissed = true; + } + private void Empty(PlayerActionEvent caller) { } } }