From 0dae215181b014d074ce0b95ef5ec9bd1270ded8 Mon Sep 17 00:00:00 2001 From: Rapandrasmus <78219215+Rapandrasmus@users.noreply.github.com> Date: Fri, 23 Jun 2023 19:57:04 +0200 Subject: [PATCH] Tweaked landing pos --- Assets/Resources/Games/nightWalkAgb.prefab | 20 +++++++++++- .../Scripts/Games/NightWalkAgb/AgbPlayYan.cs | 31 +++++++++++++++++-- 2 files changed, 48 insertions(+), 3 deletions(-) diff --git a/Assets/Resources/Games/nightWalkAgb.prefab b/Assets/Resources/Games/nightWalkAgb.prefab index 3f89f7ae6..3420e59ae 100644 --- a/Assets/Resources/Games/nightWalkAgb.prefab +++ b/Assets/Resources/Games/nightWalkAgb.prefab @@ -708,7 +708,7 @@ MonoBehaviour: platformHandler: {fileID: 6715217060937385611} jumpPaths: - name: Jump - preview: 1 + preview: 0 anchor: {fileID: 0} positions: - tag: @@ -725,6 +725,24 @@ MonoBehaviour: duration: 0 useLastRealPos: 0 values: [] + - name: Whiff + preview: 1 + anchor: {fileID: 0} + positions: + - tag: + pos: {x: 0, y: 0, z: 0} + target: {fileID: 0} + height: 0.5 + duration: 0.5 + useLastRealPos: 0 + values: [] + - tag: + pos: {x: 0, y: 0, z: 0} + target: {fileID: 0} + height: 0 + duration: 0 + useLastRealPos: 0 + values: [] --- !u!1 &4465275889429203320 GameObject: m_ObjectHideFlags: 0 diff --git a/Assets/Scripts/Games/NightWalkAgb/AgbPlayYan.cs b/Assets/Scripts/Games/NightWalkAgb/AgbPlayYan.cs index 440a9b161..faa79b108 100644 --- a/Assets/Scripts/Games/NightWalkAgb/AgbPlayYan.cs +++ b/Assets/Scripts/Games/NightWalkAgb/AgbPlayYan.cs @@ -14,13 +14,15 @@ namespace HeavenStudio.Games.Scripts_AgbNightWalk Walking, Jumping, Shocked, - Falling + Falling, + Whiffing } private JumpingState jumpingState; private AgbNightWalk game; private double jumpBeat; [SerializeField] private List balloons = new List(); private Path jumpPath; + private Path whiffPath; private Animator anim; private float fallStartY; private double playYanFallBeat; @@ -29,6 +31,7 @@ namespace HeavenStudio.Games.Scripts_AgbNightWalk { game = AgbNightWalk.instance; jumpPath = game.GetPath("Jump"); + whiffPath = game.GetPath("Whiff"); anim = GetComponent(); foreach (var balloon in balloons) { @@ -46,13 +49,19 @@ namespace HeavenStudio.Games.Scripts_AgbNightWalk case JumpingState.Jumping: Vector3 pos = GetPathPositionFromBeat(jumpPath, Math.Min(jumpBeat + 1, cond.songPositionInBeatsAsDouble), jumpBeat); transform.localPosition = pos; - float normalizedBeat = cond.GetPositionFromBeat(jumpBeat, 1); + float normalizedBeat = cond.GetPositionFromBeat(jumpBeat, jumpPath.positions[0].duration); if (normalizedBeat >= 1f) { Walk(); } break; case JumpingState.Walking: + transform.localPosition = Vector3.zero; + if (PlayerInput.Pressed() && !game.IsExpectingInputNow(InputType.STANDARD_DOWN)) + { + Whiff(cond.songPositionInBeatsAsDouble); + } + break; case JumpingState.Flying: transform.localPosition = Vector3.zero; break; @@ -64,6 +73,15 @@ namespace HeavenStudio.Games.Scripts_AgbNightWalk float newPlayYanY = func(fallStartY, -12, normalizedFallBeat); transform.localPosition = new Vector3(0, newPlayYanY); break; + case JumpingState.Whiffing: + Vector3 pos2 = GetPathPositionFromBeat(whiffPath, Math.Min(jumpBeat + 0.5, cond.songPositionInBeatsAsDouble), jumpBeat); + transform.localPosition = pos2; + float normalizedBeat2 = cond.GetPositionFromBeat(jumpBeat, 0.5); + if (normalizedBeat2 >= 1f) + { + Walk(); + } + break; } } } @@ -90,6 +108,15 @@ namespace HeavenStudio.Games.Scripts_AgbNightWalk jumpingState = JumpingState.Jumping; jumpBeat = beat; anim.Play("Jump", 0, 0); + jumpPath.positions[0].duration = 1 - (float)Conductor.instance.SecsToBeats(Minigame.earlyTime, Conductor.instance.GetBpmAtBeat(jumpBeat)); + Update(); + } + + public void Whiff(double beat) + { + jumpingState = JumpingState.Whiffing; + jumpBeat = beat; + anim.Play("Jump", 0, 0); Update(); }