diff --git a/Assets/Resources/Games/fanClub.prefab b/Assets/Resources/Games/fanClub.prefab index 97bc9cdb2..ac885e522 100644 --- a/Assets/Resources/Games/fanClub.prefab +++ b/Assets/Resources/Games/fanClub.prefab @@ -27064,7 +27064,7 @@ MonoBehaviour: pitch: 1 volume: 1 looping: 0 - offset: 0.055 + offset: 0.02 parameters: [] - name: arisa_iina_fast sequence: @@ -27083,7 +27083,7 @@ MonoBehaviour: pitch: 1 volume: 1 looping: 0 - offset: 0.055 + offset: 0.025 parameters: [] - name: crowd_big_ready sequence: @@ -27165,7 +27165,6 @@ MonoBehaviour: parameters: [] EligibleHits: [] scheduledInputs: [] - firstEnable: 0 StageAnimator: {fileID: 22498285944424125} Arisa: {fileID: 3728697055337045071} ArisaRootMotion: {fileID: 2223479141072930853} diff --git a/Assets/Resources/Sfx/games/fanClub/arisa_ii_fast_jp.wav b/Assets/Resources/Sfx/games/fanClub/arisa_ii_fast_jp.wav index 0da9ea350..0c5d5c6b7 100644 Binary files a/Assets/Resources/Sfx/games/fanClub/arisa_ii_fast_jp.wav and b/Assets/Resources/Sfx/games/fanClub/arisa_ii_fast_jp.wav differ diff --git a/Assets/Resources/Sfx/games/fanClub/arisa_ii_jp.wav b/Assets/Resources/Sfx/games/fanClub/arisa_ii_jp.wav index 752ca992c..c31136a10 100644 Binary files a/Assets/Resources/Sfx/games/fanClub/arisa_ii_jp.wav and b/Assets/Resources/Sfx/games/fanClub/arisa_ii_jp.wav differ diff --git a/Assets/Resources/Sfx/games/fanClub/arisa_in_jp.wav b/Assets/Resources/Sfx/games/fanClub/arisa_in_jp.wav index 015819768..a8db87da9 100644 Binary files a/Assets/Resources/Sfx/games/fanClub/arisa_in_jp.wav and b/Assets/Resources/Sfx/games/fanClub/arisa_in_jp.wav differ diff --git a/Assets/Resources/Sfx/games/fanClub/arisa_na_fast_jp.wav b/Assets/Resources/Sfx/games/fanClub/arisa_na_fast_jp.wav index 018782e03..d0812b27a 100644 Binary files a/Assets/Resources/Sfx/games/fanClub/arisa_na_fast_jp.wav and b/Assets/Resources/Sfx/games/fanClub/arisa_na_fast_jp.wav differ diff --git a/Assets/Resources/Sfx/games/fanClub/arisa_na_jp.wav b/Assets/Resources/Sfx/games/fanClub/arisa_na_jp.wav index f265330c9..e4781c5a2 100644 Binary files a/Assets/Resources/Sfx/games/fanClub/arisa_na_jp.wav and b/Assets/Resources/Sfx/games/fanClub/arisa_na_jp.wav differ diff --git a/Assets/Scripts/CircleCursor.cs b/Assets/Scripts/CircleCursor.cs index 2abfa9ba1..1f9af599c 100644 --- a/Assets/Scripts/CircleCursor.cs +++ b/Assets/Scripts/CircleCursor.cs @@ -37,7 +37,7 @@ namespace HeavenStudio { this.gameObject.transform.position = new Vector3(pos.x, pos.y, 0); - if (PlayerInput.GetIsAction(Minigame.InputAction_BasicPress, out _)) + if (PlayerInput.GetIsAction(Minigame.InputAction_BasicPress)) { Circle.transform.DOScale(0, 0.5f).SetEase(Ease.OutExpo); InnerCircle.SetActive(true); @@ -48,7 +48,7 @@ namespace HeavenStudio eyesTween.Kill(); eyesTween = Eyes.transform.DOLocalMoveY(0.15f, 0.15f).SetEase(Ease.OutExpo); } - else if (PlayerInput.GetIsAction(Minigame.InputAction_BasicRelease, out _)) + else if (PlayerInput.GetIsAction(Minigame.InputAction_BasicRelease)) { Circle.transform.DOScale(0.2f, 0.5f).SetEase(Ease.OutExpo); InnerCircle.SetActive(false); diff --git a/Assets/Scripts/Games/BlueBear/BlueBear.cs b/Assets/Scripts/Games/BlueBear/BlueBear.cs index 3f4fb0ed2..5d49d7bb6 100644 --- a/Assets/Scripts/Games/BlueBear/BlueBear.cs +++ b/Assets/Scripts/Games/BlueBear/BlueBear.cs @@ -160,11 +160,11 @@ namespace HeavenStudio.Games } public static PlayerInput.InputAction InputAction_Left = - new("BlueBearLeft", new int[] { IALeft, IALeft, IALeft }, + new("CtrBearLeft", new int[] { IALeft, IALeft, IALeft }, IA_PadLeft, IA_TouchLeft, IA_BatonLeft); public static PlayerInput.InputAction InputAction_Right = - new("BlueBearRight", new int[] { IARight, IARight, IARight }, + new("CtrBearRight", new int[] { IARight, IARight, IARight }, IA_PadRight, IA_TouchRight, IA_BatonRight); void OnDestroy() @@ -189,11 +189,11 @@ namespace HeavenStudio.Games { headAndBodyAnim.SetBool("ShouldOpenMouth", foodHolder.childCount != 0); - if (PlayerInput.GetIsAction(InputAction_Left, out _) && !IsExpectingInputNow(InputAction_Left.inputLockCategory)) + if (PlayerInput.GetIsAction(InputAction_Left) && !IsExpectingInputNow(InputAction_Left.inputLockCategory)) { Bite(true); } - else if (PlayerInput.GetIsAction(InputAction_Right, out _) && !IsExpectingInputNow(InputAction_Right.inputLockCategory)) + else if (PlayerInput.GetIsAction(InputAction_Right) && !IsExpectingInputNow(InputAction_Right.inputLockCategory)) { Bite(false); } diff --git a/Assets/Scripts/Games/BoardMeeting/BoardMeeting.cs b/Assets/Scripts/Games/BoardMeeting/BoardMeeting.cs index d117583bf..24c150a86 100644 --- a/Assets/Scripts/Games/BoardMeeting/BoardMeeting.cs +++ b/Assets/Scripts/Games/BoardMeeting/BoardMeeting.cs @@ -130,7 +130,7 @@ namespace HeavenStudio.Games { SingleBop(); } - if(PlayerInput.Pressed() && !IsExpectingInputNow(InputType.STANDARD_DOWN)) + if (PlayerInput.GetIsAction(InputAction_BasicPressing) && !IsExpectingInputNow(InputAction_BasicPress.inputLockCategory)) { if (executives[executiveCount - 1].spinning) { @@ -214,7 +214,7 @@ namespace HeavenStudio.Games }), new BeatAction.Action(beat + 2.5f, delegate { assistantCanBop = true; }) }); - ScheduleInput(beat, 2f, InputType.STANDARD_DOWN, JustAssistant, MissAssistant, Empty); + ScheduleInput(beat, 2f, InputAction_BasicPress, JustAssistant, MissAssistant, Empty); } public void Stop(double beat, float length) @@ -255,7 +255,7 @@ namespace HeavenStudio.Games } stops.Add(new BeatAction.Action(beat + length * executiveCount + 0.5f, delegate { executivesCanBop = true; })); BeatAction.New(instance, stops); - ScheduleInput(beat, length * (executiveCount - 1), InputType.STANDARD_DOWN, Just, Miss, Empty); + ScheduleInput(beat, length * (executiveCount - 1), InputAction_BasicPress, Just, Miss, Empty); } public void Prepare() diff --git a/Assets/Scripts/Games/BuiltToScaleDS/BuiltToScaleDS.cs b/Assets/Scripts/Games/BuiltToScaleDS/BuiltToScaleDS.cs index cc459b405..ec3832a24 100644 --- a/Assets/Scripts/Games/BuiltToScaleDS/BuiltToScaleDS.cs +++ b/Assets/Scripts/Games/BuiltToScaleDS/BuiltToScaleDS.cs @@ -290,7 +290,7 @@ namespace HeavenStudio.Games if (canShoot && lastShotOut) lastShotOut = false; - if (canShoot && !lastShotOut && PlayerInput.GetIsAction(InputAction_FlickPress, out _) && !IsExpectingInputNow(InputAction_FlickPress.inputLockCategory)) + if (canShoot && !lastShotOut && PlayerInput.GetIsAction(InputAction_FlickPress) && !IsExpectingInputNow(InputAction_FlickPress.inputLockCategory)) { lastShotOut = true; shootingThisFrame = true; @@ -306,11 +306,11 @@ namespace HeavenStudio.Games if (PlayerInput.PlayerHasControl() && PlayerInput.CurrentControlStyle is InputSystem.InputController.ControlStyles.Touch) { - if (PlayerInput.GetIsAction(InputAction_BasicPress, out _)) + if (PlayerInput.GetIsAction(InputAction_BasicPress)) { shooterAnim.Play("Windup", 0, 0); } - if (PlayerInput.GetIsAction(InputAction_BasicRelease, out _) && !shootingThisFrame) + if (PlayerInput.GetIsAction(InputAction_BasicRelease) && !shootingThisFrame) { shooterAnim.Play("WindDown", 0, 23 / 28f); } diff --git a/Assets/Scripts/Games/CatchyTune/CatchyTune.cs b/Assets/Scripts/Games/CatchyTune/CatchyTune.cs index 35060ba5c..14aa700b1 100644 --- a/Assets/Scripts/Games/CatchyTune/CatchyTune.cs +++ b/Assets/Scripts/Games/CatchyTune/CatchyTune.cs @@ -3,6 +3,7 @@ using HeavenStudio.Util; using System; using System.Collections.Generic; using UnityEngine; +using HeavenStudio.InputSystem; namespace HeavenStudio.Games.Loaders { @@ -55,10 +56,10 @@ namespace HeavenStudio.Games.Loaders }, } }, - new List() {"ctr", "normal"}, + new List() { "ctr", "normal" }, "ctrcatchy", "en", - new List(){} + new List() { } ); } } @@ -125,6 +126,61 @@ namespace HeavenStudio.Games public float endSmile; } + const int IALeft = 0; + const int IARight = 1; + protected static bool IA_PadLeft(out double dt) + { + return 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); + } + protected static bool IA_BatonLeft(out double dt) + { + return PlayerInput.GetBatonDown(InputController.ActionsBaton.West, out dt); + } + protected static bool IA_TouchLeft(out double dt) + { + bool want = PlayerInput.GetTouchDown(InputController.ActionsTouch.Left, out dt); + bool simul = false; + if (!want) + { + simul = PlayerInput.GetTouchDown(InputController.ActionsTouch.Right, out dt) + && instance.IsExpectingInputNow(InputAction_Left.inputLockCategory) + && instance.IsExpectingInputNow(InputAction_Right.inputLockCategory); + } + return want || simul; + } + + protected static bool IA_PadRight(out double dt) + { + return PlayerInput.GetPadDown(InputController.ActionsPad.East, out dt); + } + protected static bool IA_BatonRight(out double dt) + { + return PlayerInput.GetBatonDown(InputController.ActionsBaton.East, out dt); + } + protected static bool IA_TouchRight(out double dt) + { + bool want = PlayerInput.GetTouchDown(InputController.ActionsTouch.Right, out dt); + bool simul = false; + if (!want) + { + simul = PlayerInput.GetTouchDown(InputController.ActionsTouch.Left, out dt) + && instance.IsExpectingInputNow(InputAction_Left.inputLockCategory) + && instance.IsExpectingInputNow(InputAction_Right.inputLockCategory); + } + return want || simul; + } + + public static PlayerInput.InputAction InputAction_Left = + new("CtrStepLeft", new int[] { IALeft, IALeft, IALeft }, + IA_PadLeft, IA_TouchLeft, IA_BatonLeft); + + public static PlayerInput.InputAction InputAction_Right = + new("CtrStepRight", new int[] { IARight, IARight, IARight }, + IA_PadRight, IA_TouchRight, IA_BatonRight); + private void Awake() { instance = this; @@ -193,16 +249,13 @@ namespace HeavenStudio.Games } } - if (!IsExpectingInputNow()) + if (PlayerInput.GetIsAction(InputAction_Left) && !IsExpectingInputNow(InputAction_Left.inputLockCategory)) { - if (PlayerInput.GetAnyDirectionDown()) - { - catchWhiff(false); - } - if (PlayerInput.Pressed()) - { - catchWhiff(true); - } + catchWhiff(false); + } + if (PlayerInput.GetIsAction(InputAction_Right) && !IsExpectingInputNow(InputAction_Right.inputLockCategory)) + { + catchWhiff(true); } } } @@ -346,7 +399,7 @@ namespace HeavenStudio.Games double beat = Conductor.instance.songPositionInBeatsAsDouble; string fruitType = isPineapple ? "Pineapple" : "Orange"; - + if (side) { alalinAnim.Play("miss" + fruitType, 0, 0); @@ -382,7 +435,7 @@ namespace HeavenStudio.Games public void whiffAnim(bool side) { double beat = Conductor.instance.songPositionInBeatsAsDouble; - + if (side) { alalinAnim.Play("whiff", 0, 0); diff --git a/Assets/Scripts/Games/CatchyTune/Fruit.cs b/Assets/Scripts/Games/CatchyTune/Fruit.cs index 1de7dddb7..d6954051f 100644 --- a/Assets/Scripts/Games/CatchyTune/Fruit.cs +++ b/Assets/Scripts/Games/CatchyTune/Fruit.cs @@ -70,18 +70,17 @@ namespace HeavenStudio.Games.Scripts_CatchyTune soundText += "Orange"; } - game.ScheduleInput(startBeat, beatLength, side ? InputType.STANDARD_DOWN : InputType.DIRECTION_DOWN, + game.ScheduleInput(startBeat, beatLength, side ? CatchyTune.InputAction_Right : CatchyTune.InputAction_Left, CatchFruit, Miss, WayOff); } - // minenice: note - needs PlayerActionEvent implementation private void Update() { if (barelyStart > 0f) { anim.DoScaledAnimation("barely", barelyStart, isPineapple ? 2f : 1f); } - else + else { anim.DoScaledAnimation("fruit bounce", startBeat, beatLength + (isPineapple ? 4f : 2f)); } @@ -142,7 +141,7 @@ namespace HeavenStudio.Games.Scripts_CatchyTune { //near miss (barely) barelyStart = Conductor.instance.songPositionInBeatsAsDouble; - + game.catchBarely(side); // play near miss animation @@ -154,7 +153,7 @@ namespace HeavenStudio.Games.Scripts_CatchyTune }); } - else + else { SoundByte.PlayOneShotGame(soundText + "Catch"); game.catchSuccess(side, isPineapple, smile, startBeat + beatLength, endSmile); @@ -172,6 +171,6 @@ namespace HeavenStudio.Games.Scripts_CatchyTune }); } - private void WayOff(PlayerActionEvent caller) {} // whiffing is handled in the main loop + private void WayOff(PlayerActionEvent caller) { } // whiffing is handled in the main loop } } diff --git a/Assets/Scripts/Games/ClappyTrio/ClappyTrioPlayer.cs b/Assets/Scripts/Games/ClappyTrio/ClappyTrioPlayer.cs index 620f033d1..2aae03754 100644 --- a/Assets/Scripts/Games/ClappyTrio/ClappyTrioPlayer.cs +++ b/Assets/Scripts/Games/ClappyTrio/ClappyTrioPlayer.cs @@ -25,7 +25,7 @@ namespace HeavenStudio.Games.Scripts_ClappyTrio private void Update() { - if (PlayerInput.Pressed() && !game.IsExpectingInputNow(InputType.STANDARD_DOWN)) + if (PlayerInput.GetIsAction(ClappyTrio.InputAction_BasicPress) && !game.IsExpectingInputNow(ClappyTrio.InputAction_BasicPress.inputLockCategory)) { Clap(false); game.ScoreMiss(); @@ -37,7 +37,7 @@ namespace HeavenStudio.Games.Scripts_ClappyTrio lastClapBeat = startBeat; lastClapLength = length; - game.ScheduleInput(startBeat, length, InputType.STANDARD_DOWN, Just, Miss, Out); + game.ScheduleInput(startBeat, length, ClappyTrio.InputAction_BasicPress, Just, Miss, Out); } private void Just(PlayerActionEvent caller, float state) diff --git a/Assets/Scripts/Games/CoinToss/CoinToss.cs b/Assets/Scripts/Games/CoinToss/CoinToss.cs index 01d939f10..d4b697c55 100644 --- a/Assets/Scripts/Games/CoinToss/CoinToss.cs +++ b/Assets/Scripts/Games/CoinToss/CoinToss.cs @@ -161,7 +161,7 @@ namespace HeavenStudio.Games this.audienceReacting = audienceReacting; - coin = ScheduleInput(beat, 6f, InputType.STANDARD_DOWN, CatchSuccess, CatchMiss, CatchEmpty); + coin = ScheduleInput(beat, 6f, InputAction_BasicPress, CatchSuccess, CatchMiss, CatchEmpty); //coin.perfectOnly = true; } @@ -176,7 +176,7 @@ namespace HeavenStudio.Games isThrowing = true; this.audienceReacting = false; - coin = ScheduleInput(beat, 6f, InputType.STANDARD_DOWN, CatchSuccess, CatchMiss, CatchEmpty); + coin = ScheduleInput(beat, 6f, InputAction_BasicPress, CatchSuccess, CatchMiss, CatchEmpty); //coin.perfectOnly = true; } diff --git a/Assets/Scripts/Games/DrummingPractice/Drummer.cs b/Assets/Scripts/Games/DrummingPractice/Drummer.cs index 7b75bd483..98340b5c3 100644 --- a/Assets/Scripts/Games/DrummingPractice/Drummer.cs +++ b/Assets/Scripts/Games/DrummingPractice/Drummer.cs @@ -42,7 +42,7 @@ namespace HeavenStudio.Games.Scripts_DrummingPractice private void Update() { - if (player && PlayerInput.Pressed() && !DrummingPractice.instance.IsExpectingInputNow(InputType.STANDARD_DOWN)) + if (player && PlayerInput.GetIsAction(DrummingPractice.InputAction_BasicPress) && !DrummingPractice.instance.IsExpectingInputNow(DrummingPractice.InputAction_BasicPress.inputLockCategory)) { Hit(false, false); } diff --git a/Assets/Scripts/Games/DrummingPractice/DrummerHit.cs b/Assets/Scripts/Games/DrummingPractice/DrummerHit.cs index 6d1ed5aaa..b36eb5848 100644 --- a/Assets/Scripts/Games/DrummingPractice/DrummerHit.cs +++ b/Assets/Scripts/Games/DrummingPractice/DrummerHit.cs @@ -20,7 +20,7 @@ namespace HeavenStudio.Games.Scripts_DrummingPractice void Start() { - game.ScheduleInput(startBeat, 1f, InputType.STANDARD_DOWN, Just, Miss, Out); + game.ScheduleInput(startBeat, 1f, DrummingPractice.InputAction_BasicPress, Just, Miss, Out); BeatAction.New(game, new List() { diff --git a/Assets/Scripts/Games/FanClub/FanClub.cs b/Assets/Scripts/Games/FanClub/FanClub.cs index a90a23e45..d5ca21bad 100644 --- a/Assets/Scripts/Games/FanClub/FanClub.cs +++ b/Assets/Scripts/Games/FanClub/FanClub.cs @@ -226,6 +226,10 @@ namespace HeavenStudio.Games //game scene public static FanClub instance; + public static PlayerInput.InputAction InputAction_TouchRelease = + new("NtrIdolTouchRelease", new int[] { IAEmptyCat, IAReleaseCat, IAEmptyCat }, + IA_Empty, IA_TouchBasicRelease, IA_Empty); + const int FAN_COUNT = 12; const float RADIUS = 1.5f; private void Awake() diff --git a/Assets/Scripts/Games/FanClub/NtrIdolFan.cs b/Assets/Scripts/Games/FanClub/NtrIdolFan.cs index 9db84becb..13c054069 100644 --- a/Assets/Scripts/Games/FanClub/NtrIdolFan.cs +++ b/Assets/Scripts/Games/FanClub/NtrIdolFan.cs @@ -6,6 +6,7 @@ using Starpelly; using NaughtyBezierCurves; using HeavenStudio.Util; +using HeavenStudio.InputSystem; namespace HeavenStudio.Games.Scripts_FanClub { @@ -35,16 +36,16 @@ namespace HeavenStudio.Games.Scripts_FanClub switch (type) { case 0: - FanClub.instance.ScheduleInput(beat, 1f, InputType.STANDARD_DOWN, ClapJust, ClapThrough, Out); + FanClub.instance.ScheduleInput(beat, 1f, FanClub.InputAction_BasicPress, ClapJust, ClapThrough, Out); break; case 1: - FanClub.instance.ScheduleInput(beat, 1f, InputType.STANDARD_UP, JumpJust, JumpThrough, JumpOut); + FanClub.instance.ScheduleInput(beat, 1f, FanClub.InputAction_FlickRelease, JumpJust, JumpThrough, JumpOut); break; case 2: - FanClub.instance.ScheduleInput(beat, 1f, InputType.STANDARD_DOWN, ChargeClapJust, ClapThrough, Out); + FanClub.instance.ScheduleInput(beat, 1f, FanClub.InputAction_BasicPress, ChargeClapJust, ClapThrough, Out); break; default: - FanClub.instance.ScheduleInput(beat, 1f, InputType.STANDARD_DOWN, LongClapJust, ClapThrough, Out); + FanClub.instance.ScheduleInput(beat, 1f, FanClub.InputAction_BasicPress, LongClapJust, ClapThrough, Out); break; } } @@ -97,9 +98,9 @@ namespace HeavenStudio.Games.Scripts_FanClub if (player) { - if (PlayerInput.Pressed()) + if (PlayerInput.GetIsAction(FanClub.InputAction_BasicPress)) { - if (!FanClub.instance.IsExpectingInputNow(InputType.STANDARD_DOWN)) + if (!FanClub.instance.IsExpectingInputNow(FanClub.InputAction_BasicPress.inputLockCategory)) { if (FanClub.instance.JudgementPaused) { @@ -112,7 +113,7 @@ namespace HeavenStudio.Games.Scripts_FanClub } } } - if (PlayerInput.Pressing()) + if (PlayerInput.GetIsAction(FanClub.InputAction_BasicPressing)) { if (clappingStartTime != double.MinValue && cond.songPositionInBeatsAsDouble > clappingStartTime + 2f && !stopCharge) { @@ -121,9 +122,16 @@ namespace HeavenStudio.Games.Scripts_FanClub stopCharge = true; } } - if (PlayerInput.PressedUp()) + if (PlayerInput.GetIsAction(FanClub.InputAction_FlickRelease)) { - if (clappingStartTime != double.MinValue && cond.songPositionInBeatsAsDouble > clappingStartTime + 2f && stopCharge && !FanClub.instance.IsExpectingInputNow(InputType.STANDARD_UP)) + float nonTouchDelay = 2f; + if (PlayerInput.CurrentControlStyle == InputController.ControlStyles.Touch) + { + nonTouchDelay = 0f; + stopCharge = true; + } + if (clappingStartTime != double.MinValue && cond.songPositionInBeatsAsDouble > clappingStartTime + nonTouchDelay && stopCharge + && !FanClub.instance.IsExpectingInputNow(FanClub.InputAction_FlickRelease.inputLockCategory)) { if (FanClub.instance.JudgementPaused) { @@ -143,6 +151,14 @@ namespace HeavenStudio.Games.Scripts_FanClub clappingStartTime = double.MinValue; } } + if (PlayerInput.GetIsAction(FanClub.InputAction_TouchRelease)) + { + animator.speed = 1f; + animator.Play("FanFree", -1, 0); + stopBeat = false; + stopCharge = false; + clappingStartTime = double.MinValue; + } } float jumpPos = cond.GetPositionFromBeat(jumpStartTime, 1f); @@ -199,7 +215,7 @@ namespace HeavenStudio.Games.Scripts_FanClub BeatAction.New(this, new List() { new BeatAction.Action(cond.songPositionInBeatsAsDouble + 0.1f, delegate { - if (PlayerInput.Pressing() || autoplayRelease > 0f) + if (PlayerInput.GetIsAction(FanClub.InputAction_BasicPressing) || autoplayRelease > 0f) { animator.Play("FanClapCharge", -1, 0); stopCharge = true; diff --git a/Assets/Scripts/Games/Minigame.cs b/Assets/Scripts/Games/Minigame.cs index 1d36475d2..3f0e23b56 100644 --- a/Assets/Scripts/Games/Minigame.cs +++ b/Assets/Scripts/Games/Minigame.cs @@ -30,10 +30,11 @@ namespace HeavenStudio.Games } #region Premade Input Actions - const int IAEmptyCat = -1; - const int IAPressCat = 0; - const int IAReleaseCat = 1; - const int IAFlickCat = 2; + protected const int IAEmptyCat = -1; + protected const int IAPressCat = 0; + protected const int IAReleaseCat = 1; + protected const int IAPressingCat = 2; + protected const int IAFlickCat = 3; protected static bool IA_Empty(out double dt) { @@ -67,6 +68,22 @@ namespace HeavenStudio.Games return PlayerInput.GetBatonUp(InputController.ActionsBaton.Face, out dt); } + protected static bool IA_PadBasicPressing(out double dt) + { + dt = 0; + return PlayerInput.GetPad(InputController.ActionsPad.East); + } + protected static bool IA_TouchBasicPressing(out double dt) + { + dt = 0; + return PlayerInput.GetTouch(InputController.ActionsTouch.Tap); + } + protected static bool IA_BatonBasicPressing(out double dt) + { + dt = 0; + return PlayerInput.GetBaton(InputController.ActionsBaton.Face); + } + protected static bool IA_TouchFlick(out double dt) { return PlayerInput.GetFlick(out dt); @@ -76,14 +93,17 @@ namespace HeavenStudio.Games new("BasicPress", new int[] { IAPressCat, IAPressCat, IAPressCat }, IA_PadBasicPress, IA_TouchBasicPress, IA_BatonBasicPress); public static PlayerInput.InputAction InputAction_BasicRelease = - new("BasicPress", new int[] { IAReleaseCat, IAReleaseCat, IAReleaseCat }, + new("BasicRelease", new int[] { IAReleaseCat, IAReleaseCat, IAReleaseCat }, IA_PadBasicRelease, IA_TouchBasicRelease, IA_BatonBasicRelease); + public static PlayerInput.InputAction InputAction_BasicPressing = + new("BasicRelease", new int[] { IAReleaseCat, IAReleaseCat, IAReleaseCat }, + IA_PadBasicPressing, IA_TouchBasicPressing, IA_BatonBasicPressing); public static PlayerInput.InputAction InputAction_FlickPress = - new("BasicPress", new int[] { IAPressCat, IAFlickCat, IAPressCat }, + new("FlickPress", new int[] { IAPressCat, IAFlickCat, IAPressCat }, IA_PadBasicPress, IA_TouchFlick, IA_BatonBasicPress); public static PlayerInput.InputAction InputAction_FlickRelease = - new("BasicPress", new int[] { IAReleaseCat, IAFlickCat, IAReleaseCat }, + new("FlickRelease", new int[] { IAReleaseCat, IAFlickCat, IAReleaseCat }, IA_PadBasicRelease, IA_TouchFlick, IA_BatonBasicRelease); #endregion @@ -289,6 +309,7 @@ namespace HeavenStudio.Games { // ignore inputs that are for sequencing in autoplay if (toCompare.autoplayOnly) continue; + if (toCompare.InputAction == null) continue; if (closest == null) { diff --git a/Assets/Scripts/Games/PlayerActionEvent.cs b/Assets/Scripts/Games/PlayerActionEvent.cs index fa4847aa0..8e200373c 100644 --- a/Assets/Scripts/Games/PlayerActionEvent.cs +++ b/Assets/Scripts/Games/PlayerActionEvent.cs @@ -134,6 +134,10 @@ namespace HeavenStudio.Games normalizedTime -= dt; if (IsExpectingInputNow()) { + if (InputAction != null) + { + Debug.Log("Hit " + InputAction.name); + } double stateProg = ((normalizedTime - Minigame.JustEarlyTime()) / (Minigame.JustLateTime() - Minigame.JustEarlyTime()) - 0.5f) * 2; Hit(stateProg, normalizedTime); } @@ -146,7 +150,8 @@ namespace HeavenStudio.Games public void LateUpdate() { if (markForDeletion) { - CleanUp(); + allEvents.Remove(this); + OnDestroy(this); Destroy(this.gameObject); } foreach (PlayerActionEvent evt in allEvents) @@ -166,7 +171,7 @@ namespace HeavenStudio.Games if (toCompare.InputAction == null) continue; int catIdx = (int)PlayerInput.CurrentControlStyle; if (toCompare.InputAction != null - && toCompare.InputAction.inputLockCategory[catIdx] == InputAction.inputLockCategory[catIdx]) continue; + && toCompare.InputAction.inputLockCategory[catIdx] != InputAction.inputLockCategory[catIdx]) continue; } else { @@ -216,7 +221,6 @@ namespace HeavenStudio.Games } if (!enabled) return false; if (!isEligible) return false; - if (markForDeletion) return false; double normalizedBeat = GetNormalizedTime(); return normalizedBeat > Minigame.NgEarlyTime() && normalizedBeat < Minigame.NgLateTime(); @@ -353,8 +357,6 @@ namespace HeavenStudio.Games public void CleanUp() { if (markForDeletion) return; - allEvents.Remove(this); - OnDestroy(this); markForDeletion = true; } } diff --git a/Assets/Scripts/Games/SeeSaw/SeeSaw.cs b/Assets/Scripts/Games/SeeSaw/SeeSaw.cs index a1b67a8fd..311a4912e 100644 --- a/Assets/Scripts/Games/SeeSaw/SeeSaw.cs +++ b/Assets/Scripts/Games/SeeSaw/SeeSaw.cs @@ -483,7 +483,7 @@ namespace HeavenStudio.Games }); } - ScheduleInput(beat, 2f, InputType.STANDARD_DOWN, high ? JustLongHigh : JustLong, MissLong, Empty); + ScheduleInput(beat, 2f, InputAction_BasicPress, high ? JustLongHigh : JustLong, MissLong, Empty); if (currentJumpIndex < allJumpEvents.Count) { if (currentJumpIndex >= 0) @@ -542,7 +542,7 @@ namespace HeavenStudio.Games new MultiSound.Sound("seeSaw/otherVoiceLong2", beat + 1), }); } - ScheduleInput(beat, 2f, InputType.STANDARD_DOWN, high ? JustShortHigh : JustShort, MissShort, Empty); + ScheduleInput(beat, 2f, InputAction_BasicPress, high ? JustShortHigh : JustShort, MissShort, Empty); if (currentJumpIndex < allJumpEvents.Count) { if (currentJumpIndex >= 0) @@ -602,7 +602,7 @@ namespace HeavenStudio.Games new MultiSound.Sound("seeSaw/otherVoiceShort2", beat + 0.5f), }); } - ScheduleInput(beat, 1f, InputType.STANDARD_DOWN, high ? JustLongHigh : JustLong, MissLong, Empty); + ScheduleInput(beat, 1f, InputAction_BasicPress, high ? JustLongHigh : JustLong, MissLong, Empty); if (currentJumpIndex < allJumpEvents.Count) { if (currentJumpIndex >= 0) @@ -662,7 +662,7 @@ namespace HeavenStudio.Games new MultiSound.Sound("seeSaw/otherVoiceShort2", beat + 0.5f), }); } - ScheduleInput(beat, 1f, InputType.STANDARD_DOWN, high ? JustShortHigh : JustShort, MissShort, Empty); + ScheduleInput(beat, 1f, InputAction_BasicPress, high ? JustShortHigh : JustShort, MissShort, Empty); if (currentJumpIndex < allJumpEvents.Count) { if (currentJumpIndex >= 0) diff --git a/Assets/Scripts/Games/SneakySpirits/SneakySpirits.cs b/Assets/Scripts/Games/SneakySpirits/SneakySpirits.cs index a9196dd29..e7387a776 100644 --- a/Assets/Scripts/Games/SneakySpirits/SneakySpirits.cs +++ b/Assets/Scripts/Games/SneakySpirits/SneakySpirits.cs @@ -133,7 +133,7 @@ namespace HeavenStudio.Games var cond = Conductor.instance; if (cond.isPlaying && !cond.isPaused) { - if (PlayerInput.Pressed() && !IsExpectingInputNow(InputType.STANDARD_DOWN) && hasArrowLoaded) + if (PlayerInput.GetIsAction(InputAction_FlickPress, out _) && !IsExpectingInputNow(InputAction_FlickPress.inputLockCategory) && hasArrowLoaded) { WhiffArrow(cond.songPositionInBeatsAsDouble); } @@ -189,11 +189,11 @@ namespace HeavenStudio.Games { if (slowDown) { - ScheduleInput(beat, length * 7, InputType.STANDARD_DOWN, Just, Miss, Out); + ScheduleInput(beat, length * 7, InputAction_FlickPress, Just, Miss, Out); } else { - ScheduleInput(beat, length * 7, InputType.STANDARD_DOWN, JustNoSlowDown, Miss, Out); + ScheduleInput(beat, length * 7, InputAction_FlickPress, JustNoSlowDown, Miss, Out); } BeatAction.New(instance, new List() { diff --git a/Assets/Scripts/Games/Spaceball/SpaceballBall.cs b/Assets/Scripts/Games/Spaceball/SpaceballBall.cs index 15770cfc7..18bb2bf09 100644 --- a/Assets/Scripts/Games/Spaceball/SpaceballBall.cs +++ b/Assets/Scripts/Games/Spaceball/SpaceballBall.cs @@ -50,7 +50,7 @@ namespace HeavenStudio.Games.Scripts_Spaceball private void Start() { - Spaceball.instance.ScheduleInput(startBeat, high ? 2f : 1f, InputType.STANDARD_DOWN, Just, Miss, Out); + Spaceball.instance.ScheduleInput(startBeat, high ? 2f : 1f, Spaceball.InputAction_BasicPress, Just, Miss, Out); } private void Update() diff --git a/Assets/Scripts/Games/Spaceball/SpaceballPlayer.cs b/Assets/Scripts/Games/Spaceball/SpaceballPlayer.cs index 0732b4601..bf5eb8938 100644 --- a/Assets/Scripts/Games/Spaceball/SpaceballPlayer.cs +++ b/Assets/Scripts/Games/Spaceball/SpaceballPlayer.cs @@ -35,7 +35,7 @@ namespace HeavenStudio.Games.Scripts_Spaceball private void Update() { - if (PlayerInput.Pressed()) + if (PlayerInput.GetIsAction(Spaceball.InputAction_BasicPress, out _)) { Swing(null); } diff --git a/Assets/Scripts/InputSystem/ControllerTypes/InputMouse.cs b/Assets/Scripts/InputSystem/ControllerTypes/InputMouse.cs index a9f9972d5..1c12b2344 100644 --- a/Assets/Scripts/InputSystem/ControllerTypes/InputMouse.cs +++ b/Assets/Scripts/InputSystem/ControllerTypes/InputMouse.cs @@ -290,7 +290,8 @@ namespace HeavenStudio.InputSystem if (button < 0) return false; if (button is 0 or 1 or 2) { - bool bt = Input.GetKeyUp((KeyCode)currentBindings.Touch[1]) || Input.GetKeyUp((KeyCode)currentBindings.Touch[2]); + bool bt = (Input.GetKeyUp((KeyCode)currentBindings.Touch[1]) || Input.GetKeyUp((KeyCode)currentBindings.Touch[2])) + && !(Input.GetKey((KeyCode)currentBindings.Touch[1]) || Input.GetKey((KeyCode)currentBindings.Touch[2])); switch (button) { case 0: diff --git a/Assets/Scripts/InputSystem/PlayerInput.cs b/Assets/Scripts/InputSystem/PlayerInput.cs index 4974b1f52..acbdc03b2 100644 --- a/Assets/Scripts/InputSystem/PlayerInput.cs +++ b/Assets/Scripts/InputSystem/PlayerInput.cs @@ -231,6 +231,20 @@ namespace HeavenStudio return false; } + public static bool GetIsAction(InputAction action) + { + switch (CurrentControlStyle) + { + case InputController.ControlStyles.Pad: + return action.padAction(out _); + case InputController.ControlStyles.Touch: + return action.touchAction(out _); + case InputController.ControlStyles.Baton: + return action.batonAction(out _); + } + return false; + } + public static bool GetPadDown(InputController.ActionsPad ac, out double dt) { bool a = GetInputController(1).GetActionDown(InputController.ControlStyles.Pad, (int)ac, out dt);