diff --git a/Assets/Scripts/Games/CheerReaders/CheerReaders.cs b/Assets/Scripts/Games/CheerReaders/CheerReaders.cs index 1b0aa5001..953531fe6 100644 --- a/Assets/Scripts/Games/CheerReaders/CheerReaders.cs +++ b/Assets/Scripts/Games/CheerReaders/CheerReaders.cs @@ -210,7 +210,7 @@ namespace HeavenStudio.Games new("RvlBookAltFinish", new int[] { IAAltUpCat, IAFlickCat, IAAltUpCat }, IA_PadAltRelease, IA_TouchFlick, IA_BatonAltRelease); public static PlayerInput.InputAction InputAction_TouchRelease = - new("NtrIdolTouchRelease", new int[] { IAEmptyCat, IAReleaseCat, IAEmptyCat }, + new("RvlBookTouchRelease", new int[] { IAEmptyCat, IAReleaseCat, IAEmptyCat }, IA_Empty, IA_TouchBasicRelease, IA_Empty); void OnDestroy() diff --git a/Assets/Scripts/Games/CheerReaders/RvlCharacter.cs b/Assets/Scripts/Games/CheerReaders/RvlCharacter.cs index d52b551a1..cfc98817c 100644 --- a/Assets/Scripts/Games/CheerReaders/RvlCharacter.cs +++ b/Assets/Scripts/Games/CheerReaders/RvlCharacter.cs @@ -149,7 +149,7 @@ namespace HeavenStudio.Games.Scripts_CheerReaders { posterBook.SetActive(false); canOpenBook = !hit; - isSpinning = hit; + isSpinning = false; if (bookIsWhite != game.shouldBeBlack && hit && player) { RepositionBook(); diff --git a/Assets/Scripts/Games/CropStomp/CropStomp.cs b/Assets/Scripts/Games/CropStomp/CropStomp.cs index 617205b74..3667ccdef 100644 --- a/Assets/Scripts/Games/CropStomp/CropStomp.cs +++ b/Assets/Scripts/Games/CropStomp/CropStomp.cs @@ -119,6 +119,10 @@ namespace HeavenStudio.Games public static CropStomp instance; + public static PlayerInput.InputAction InputAction_Flick = + new("NtrStompFlick", new int[] { IAEmptyCat, IAFlickCat, IAEmptyCat }, + IA_Empty, IA_TouchFlick, IA_Empty); + private void Awake() { instance = this;// Finding grass sprite width for grass scrolling. @@ -302,6 +306,15 @@ namespace HeavenStudio.Games } } + if (PlayerInput.GetIsAction(InputAction_BasicRelease) && !IsExpectingInputNow(InputAction_BasicRelease)) + { + bodyAnim.Play("Raise"); + } + if (PlayerInput.GetIsAction(InputAction_Flick) && !IsExpectingInputNow(InputAction_FlickRelease)) + { + bodyAnim.Play("Pick"); + } + if (cameraLocked) return; // Object scroll. @@ -331,13 +344,6 @@ namespace HeavenStudio.Games if (!isMarching) return; - if (PlayerInput.PressedUp()) - { - // Don't play raise animation if successfully flicked. - if (!isFlicking) - bodyAnim.Play("Raise"); - } - isFlicking = false; } diff --git a/Assets/Scripts/Games/CropStomp/Farmer.cs b/Assets/Scripts/Games/CropStomp/Farmer.cs index 9821588a8..cc2b33ca9 100644 --- a/Assets/Scripts/Games/CropStomp/Farmer.cs +++ b/Assets/Scripts/Games/CropStomp/Farmer.cs @@ -63,12 +63,12 @@ namespace HeavenStudio.Games.Scripts_CropStomp { if (GameManager.instance.currentGame == "cropStomp") { - stomp = game.ScheduleUserInput(nextStompBeat - 1f, 1f, InputType.STANDARD_DOWN, Just, Miss, Out); + stomp = game.ScheduleUserInput(nextStompBeat - 1f, 1f, CropStomp.InputAction_BasicPress, Just, Miss, Out); stomp.countsForAccuracy = false; } } - if (PlayerInput.Pressed() && !game.IsExpectingInputNow(InputType.STANDARD_DOWN)) + if (PlayerInput.GetIsAction(CropStomp.InputAction_BasicPress) && !game.IsExpectingInputNow(CropStomp.InputAction_BasicPress)) { game.bodyAnim.Play("Crouch", 0, 0); } @@ -125,7 +125,7 @@ namespace HeavenStudio.Games.Scripts_CropStomp // REMARK: does not count for performance nextStompBeat += 2f; stomp?.Disable(); - stomp = game.ScheduleUserInput(nextStompBeat - 1f, 1f, InputType.STANDARD_DOWN, Just, Miss, Out); + stomp = game.ScheduleUserInput(nextStompBeat - 1f, 1f, CropStomp.InputAction_BasicPress, Just, Miss, Out); stomp.countsForAccuracy = false; } @@ -148,7 +148,7 @@ namespace HeavenStudio.Games.Scripts_CropStomp } nextStompBeat += 2f; stomp?.Disable(); - stomp = game.ScheduleUserInput(nextStompBeat - 1f, 1f, InputType.STANDARD_DOWN, Just, Miss, Out); + stomp = game.ScheduleUserInput(nextStompBeat - 1f, 1f, CropStomp.InputAction_BasicPress, Just, Miss, Out); stomp.countsForAccuracy = false; } } diff --git a/Assets/Scripts/Games/CropStomp/Veggie.cs b/Assets/Scripts/Games/CropStomp/Veggie.cs index b0a8cb692..56d6a4784 100644 --- a/Assets/Scripts/Games/CropStomp/Veggie.cs +++ b/Assets/Scripts/Games/CropStomp/Veggie.cs @@ -40,7 +40,7 @@ namespace HeavenStudio.Games.Scripts_CropStomp game = CropStomp.instance; if (Conductor.instance.isPlaying) - game.ScheduleInput(targetBeat - 1, 1f, InputType.STANDARD_DOWN, StompJust, StompMiss, Out); + game.ScheduleInput(targetBeat - 1, 1f, CropStomp.InputAction_BasicPress, StompJust, StompMiss, Out); if (!isMole) { @@ -84,7 +84,7 @@ namespace HeavenStudio.Games.Scripts_CropStomp float airPosition = cond.GetPositionFromBeat(stompedBeat, landBeat - stompedBeat); veggieTrans.position = curve.GetPoint(Mathf.Clamp(airPosition, 0, 1)); - if (PlayerInput.PressedUp() && !game.IsExpectingInputNow(InputType.STANDARD_UP)) + if (PlayerInput.GetIsAction(CropStomp.InputAction_FlickRelease) && !game.IsExpectingInputNow(CropStomp.InputAction_FlickRelease)) { pickEligible = false; } @@ -230,7 +230,7 @@ namespace HeavenStudio.Games.Scripts_CropStomp spawnedHit.Play(); veggieState = 1; - game.ScheduleInput(targetBeat, isMole ? 0.5f : 1f, InputType.STANDARD_UP, PickJust, PickMiss, Out); + game.ScheduleInput(targetBeat, isMole ? 0.5f : 1f, CropStomp.InputAction_FlickRelease, PickJust, PickMiss, Out); targetBeat = targetBeat + (isMole ? 0.5f : 1f); stompedBeat = cond.songPositionInBeatsAsDouble; diff --git a/Assets/Scripts/Games/DogNinja/DogNinja.cs b/Assets/Scripts/Games/DogNinja/DogNinja.cs index 1d39b3ee2..48b119cec 100644 --- a/Assets/Scripts/Games/DogNinja/DogNinja.cs +++ b/Assets/Scripts/Games/DogNinja/DogNinja.cs @@ -1,5 +1,6 @@ using NaughtyBezierCurves; using HeavenStudio.Util; +using HeavenStudio.InputSystem; using System; using System.Collections.Generic; using UnityEngine; @@ -174,7 +175,27 @@ namespace HeavenStudio.Games TacoBell, //YaseiNoIkiG3M4, } - + + protected static bool IA_PadAny(out double dt) + { + return PlayerInput.GetPadDown(InputController.ActionsPad.East, out dt) + || PlayerInput.GetPadDown(InputController.ActionsPad.Up, out dt) + || PlayerInput.GetPadDown(InputController.ActionsPad.Down, out dt) + || PlayerInput.GetPadDown(InputController.ActionsPad.Left, out dt) + || PlayerInput.GetPadDown(InputController.ActionsPad.Right, out dt); + } + + public static PlayerInput.InputAction InputAction_Press = + new("NtrNinjaPress", new int[] { IAPressCat, IAFlickCat, IAPressCat }, + IA_PadAny, IA_TouchFlick, IA_BatonBasicPress); + public static PlayerInput.InputAction InputAction_TouchPress = + new("NtrNinjaTouchRelease", new int[] { IAEmptyCat, IAPressCat, IAEmptyCat }, + IA_Empty, IA_TouchBasicPress, IA_Empty); + public static PlayerInput.InputAction InputAction_TouchRelease = + new("NtrNinjaTouchRelease", new int[] { IAEmptyCat, IAReleaseCat, IAEmptyCat }, + IA_Empty, IA_TouchBasicRelease, IA_Empty); + + private void Awake() { instance = this; @@ -198,8 +219,19 @@ namespace HeavenStudio.Games DogAnim.DoScaledAnimationAsync("Prepare", 0.5f); DogAnim.SetBool("needPrepare", true); } - - if ((PlayerInput.Pressed() || PlayerInput.GetAnyDirectionDown()) && !IsExpectingInputNow(InputType.STANDARD_DOWN | InputType.DIRECTION_DOWN)) + + if (PlayerInput.GetIsAction(InputAction_TouchPress)) + { + DogAnim.SetBool("needPrepare", true); + DogAnim.DoScaledAnimationAsync("Prepare", 0.5f); + } + if (PlayerInput.GetIsAction(InputAction_TouchRelease) && !IsExpectingInputNow(InputAction_Press)) + { + DogAnim.SetBool("needPrepare", false); + DogAnim.DoScaledAnimationAsync("Bop", 0.5f); + } + + if (PlayerInput.GetIsAction(InputAction_Press) && !IsExpectingInputNow(InputAction_Press)) { System.Random rd = new System.Random(); string slice; @@ -219,8 +251,6 @@ namespace HeavenStudio.Games foreach (var obj in queuedThrows) { ThrowObject(obj.beat, obj.direction, obj.typeL, obj.typeR, obj.sfxNumL, obj.sfxNumR); } queuedThrows.Clear(); } - - //if () queuedThrows.Clear(); } private void LateUpdate() @@ -268,6 +298,7 @@ namespace HeavenStudio.Games sfxNumR = sfxNumR, }); + prepare = prepare && PlayerInput.CurrentControlStyle != InputController.ControlStyles.Touch; if (prepare) DogNinja.instance.DogAnim.SetBool("needPrepare", true); } @@ -318,6 +349,7 @@ namespace HeavenStudio.Games public void Prepare(double beat) { + if (PlayerInput.CurrentControlStyle == InputController.ControlStyles.Touch) return; if (!DogAnim.GetBool("needPrepare")) DogAnim.DoScaledAnimationAsync("Prepare", 0.5f); DogAnim.SetBool("needPrepare", true); } diff --git a/Assets/Scripts/Games/DogNinja/ThrowObject.cs b/Assets/Scripts/Games/DogNinja/ThrowObject.cs index b34a79d03..8aaf1151e 100644 --- a/Assets/Scripts/Games/DogNinja/ThrowObject.cs +++ b/Assets/Scripts/Games/DogNinja/ThrowObject.cs @@ -47,7 +47,7 @@ namespace HeavenStudio.Games.Scripts_DogNinja { barelyCurve = fromLeft ? BarelyRightCurve : BarelyLeftCurve; - game.ScheduleInput(startBeat, 1f, InputType.STANDARD_DOWN | InputType.DIRECTION_DOWN, Hit, Miss, Out); + game.ScheduleInput(startBeat, 1f, DogNinja.InputAction_Press, Hit, Miss, Out); } private void Update() @@ -84,7 +84,7 @@ namespace HeavenStudio.Games.Scripts_DogNinja { 0 => "Left", 1 => "Right", - 2 => "Both", + _ => "Both", }; DogAnim.DoScaledAnimationAsync(slice, 0.5f);