From cddab624a0e40381892524f21edf8b8d9c8c2c2e Mon Sep 17 00:00:00 2001 From: AstrlJelly Date: Sat, 8 Jun 2024 12:54:34 -0400 Subject: [PATCH] OKAY TIME TO SHIP IT --- .../Games/DressYourBest/DressYourBest.cs | 30 +++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-) diff --git a/Assets/Scripts/Games/DressYourBest/DressYourBest.cs b/Assets/Scripts/Games/DressYourBest/DressYourBest.cs index 87fc7d9a..119033ad 100644 --- a/Assets/Scripts/Games/DressYourBest/DressYourBest.cs +++ b/Assets/Scripts/Games/DressYourBest/DressYourBest.cs @@ -211,6 +211,18 @@ namespace HeavenStudio.Games private Faces girlFaceCurrent; private Faces monkeyFaceCurrent; + public static PlayerInput.InputAction InputAction_Press = + new("PcoDressPress", new int[] { IAPressCat, IAFlickCat, IAPressCat }, + IA_PadAny, IA_TouchBasicPress, IA_BatonBasicPress); + + 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); + } private void Awake() { @@ -223,7 +235,7 @@ namespace HeavenStudio.Games { bgSpriteRenderer.color = bgColorEase.GetColor(); - if (PlayerInput.GetIsAction(InputAction_BasicPress) && !IsExpectingInputNow(InputAction_BasicPress)) { + if (PlayerInput.GetIsAction(InputAction_Press) && !IsExpectingInputNow(InputAction_Press)) { ChangeEmotion(Characters.Girl, Faces.Sad); sewingAnim.DoScaledAnimationAsync("Miss", 0.5f); SoundByte.PlayOneShotGame("dressYourBest/whiff_hit"); @@ -232,6 +244,8 @@ namespace HeavenStudio.Games if (conductor.songPositionInBeatsAsDouble >= startIntervalEndBeat) { hasMissed = true; } + + ScoreMiss(); } } @@ -252,12 +266,14 @@ namespace HeavenStudio.Games { StoreAllCallEntities(); PersistPreviousEntities(beat); + DoInactiveStartInterval(beat, false); } public override void OnPlay(double beat) { StoreAllCallEntities(); PersistPreviousEntities(beat); + DoInactiveStartInterval(beat, true); } private void StoreAllCallEntities() @@ -287,6 +303,16 @@ namespace HeavenStudio.Games } } + private void DoInactiveStartInterval(double beat, bool fromPlay) + { + RiqEntity startIntervalEntity = gameManager.Beatmap.Entities.FindLast(e => (fromPlay ? e.beat : e.beat - 2) < beat && e.beat + e.length >= beat && e.datamodel == "dressYourBest/start interval"); + Debug.Log("startIntervalEntity.beat : " + (startIntervalEntity?.beat ?? -1)); + if (startIntervalEntity != null) { + RiqEntity e = startIntervalEntity; + QueueStartInterval(e.beat, e.length, e["autoPass"], e["autoReact"]); + } + } + private void SetLightFromState(LightState state) { ColorPair colorPair = lightStates[(int)state]; @@ -406,7 +432,7 @@ namespace HeavenStudio.Games foreach (RiqEntity call in neededCalls) { double relativeBeat = call.beat - startIntervalBeat; - _ = ScheduleInput(beat, relativeBeat + 1, InputAction_BasicPress, OnHit, OnMiss, null); + _ = ScheduleInput(beat, relativeBeat + 1, InputAction_Press, OnHit, OnMiss, null); } if (autoReact) { double reactBeat = (beat * 2) - startIntervalBeat + 1;