From f36c8ec10a008e214fb7d11523a879bbb094051e Mon Sep 17 00:00:00 2001 From: Rapandrasmus <78219215+Rapandrasmus@users.noreply.github.com> Date: Mon, 26 Jun 2023 22:48:30 +0200 Subject: [PATCH] improved interaction between roll cue and platform heights --- Assets/Scripts/Games/NightWalkAgb/AgbNightWalk.cs | 4 +++- Assets/Scripts/Games/NightWalkAgb/AgbPlatform.cs | 6 ++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/Assets/Scripts/Games/NightWalkAgb/AgbNightWalk.cs b/Assets/Scripts/Games/NightWalkAgb/AgbNightWalk.cs index 67ee4c75b..6b43e0c5f 100644 --- a/Assets/Scripts/Games/NightWalkAgb/AgbNightWalk.cs +++ b/Assets/Scripts/Games/NightWalkAgb/AgbNightWalk.cs @@ -191,8 +191,11 @@ namespace HeavenStudio.Games { instance = this; List heightEvents = EventCaller.GetAllInGameManagerList("nightWalkAgb", new string[] { "height" }); + List rollEvents = EventCaller.GetAllInGameManagerList("nightWalkAgb", new string[] { "roll" }); + var validRollEvents = rollEvents.FindAll(x => IsValidRollCue(x)); foreach (var heightEvent in heightEvents) { + if (validRollEvents.Count > 0 && validRollEvents.Find(x => heightEvent.beat >= x.beat + 1 && heightEvent.beat < x.beat + 2) != null) continue; heightEntityEvents.Add(new HeightEvent() { beat = heightEvent.beat, @@ -219,7 +222,6 @@ namespace HeavenStudio.Games { fishBeats.Add(fishEvent.beat); } - List rollEvents = EventCaller.GetAllInGameManagerList("nightWalkAgb", new string[] { "roll" }); foreach (var rollEvent in rollEvents) { rollBeats.Add(rollEvent.beat); diff --git a/Assets/Scripts/Games/NightWalkAgb/AgbPlatform.cs b/Assets/Scripts/Games/NightWalkAgb/AgbPlatform.cs index 5c910a5e8..34448a1e5 100644 --- a/Assets/Scripts/Games/NightWalkAgb/AgbPlatform.cs +++ b/Assets/Scripts/Games/NightWalkAgb/AgbPlatform.cs @@ -50,8 +50,10 @@ namespace HeavenStudio.Games.Scripts_AgbNightWalk public void StartInput(double beat, double hitBeat) { if (game == null) game = AgbNightWalk.instance; + if (anim == null) anim = GetComponent(); + isRollPlatform = game.RollOnBeat(hitBeat); lastAdditionalHeightInUnits = game.FindHeightUnitsAtBeat(hitBeat); - additionalHeightInUnits = game.FindHeightUnitsAtBeat(hitBeat + 1); + additionalHeightInUnits = game.FindHeightUnitsAtBeat(hitBeat + (isRollPlatform ? 2 : 1)); additionalHeight = lastAdditionalHeightInUnits * handler.heightAmount; nextPlatformIsSameHeight = lastAdditionalHeightInUnits == additionalHeightInUnits; isFinalBlock = hitBeat == game.endBeat + 1; @@ -62,7 +64,7 @@ namespace HeavenStudio.Games.Scripts_AgbNightWalk isFish = game.FishOnBeat(endBeat); fish.gameObject.SetActive(isFish); isEndEvent = game.endBeat == endBeat; - isRollPlatform = game.RollOnBeat(endBeat); + rollPlatform.transform.parent.gameObject.SetActive(isRollPlatform); rollPlatformLong.SetActive(nextPlatformIsSameHeight && !isFinalBlock && !isEndEvent); if (isEndEvent)