Skip to content

Commit

Permalink
fix some wrong lane switch values
Browse files Browse the repository at this point in the history
  • Loading branch information
flustix committed Dec 14, 2024
1 parent 8febf71 commit cf841fd
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 12 deletions.
14 changes: 11 additions & 3 deletions fluXis.Game/Map/Structures/Events/LaneSwitchEvent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public class LaneSwitchEvent : IMapEvent, IHasDuration, IHasEasing
{
new[] { false, true, false, false }, // 1k
new[] { false, true, true, false }, // 2k
new[] { true, true, true, false } // 3k
new[] { true, true, false, true } // 3k
},
new[] // 5k
{
Expand All @@ -47,7 +47,7 @@ public class LaneSwitchEvent : IMapEvent, IHasDuration, IHasEasing
{
new[] { false, false, true, false, false, false }, // 1k
new[] { false, false, true, true, false, false }, // 2k
new[] { false, true, true, true, false, false }, // 3k
new[] { false, true, true, false, true, false }, // 3k
new[] { false, true, true, true, true, false }, // 4k
new[] { true, true, true, false, true, true } // 5k
},
Expand All @@ -64,7 +64,7 @@ public class LaneSwitchEvent : IMapEvent, IHasDuration, IHasEasing
{
new[] { false, false, false, true, false, false, false, false }, // 1k
new[] { false, false, true, false, false, true, false, false }, // 2k
new[] { false, false, true, true, true, false, false, false }, // 3k
new[] { false, false, true, true, false, true, false, false }, // 3k
new[] { false, true, true, false, false, true, true, false }, // 4k
new[] { false, true, true, true, false, true, true, false }, // 5k
new[] { true, true, true, false, false, true, true, true }, // 6k
Expand Down Expand Up @@ -170,4 +170,12 @@ public class LaneSwitchEvent : IMapEvent, IHasDuration, IHasEasing
new[] { true, true, true, true, true, false, true, true, true, true } // 9k
}
};

public static bool[] GetRow(int count, int keycount, bool newLayout)
{
var layout = newLayout ? SWITCH_VISIBILITY_V2 : SWITCH_VISIBILITY;

var m = layout[keycount - 2];
return m[count - 1];
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -82,22 +82,20 @@ private void update()
else
length = clock.TrackLength - Event.Time;

var layout = map.MapInfo.NewLaneSwitchLayout ? LaneSwitchEvent.SWITCH_VISIBILITY_V2 : LaneSwitchEvent.SWITCH_VISIBILITY;

bool[][] mode = layout[map.RealmMap.KeyCount - 2];
var visibility = LaneSwitchEvent.GetRow(Event.Count, map.RealmMap.KeyCount, map.MapInfo.NewLaneSwitchLayout);
StateChange[] states = new StateChange[map.RealmMap.KeyCount];

var current = Event.Count == map.RealmMap.KeyCount
? Enumerable.Repeat(true, map.RealmMap.KeyCount).ToArray()
: mode[Event.Count - 1];
: visibility;

var previousEvent = map.MapEvents.LaneSwitchEvents.LastOrDefault(e => e.Time < Event.Time);

if (previousEvent != null)
{
var prev = previousEvent.Count == map.RealmMap.KeyCount
? Enumerable.Repeat(true, map.RealmMap.KeyCount).ToArray()
: mode[previousEvent.Count - 1];
: visibility;

for (int i = 0; i < map.RealmMap.KeyCount; i++)
{
Expand Down
5 changes: 1 addition & 4 deletions fluXis.Game/Screens/Gameplay/Ruleset/LaneSwitchManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,6 @@ private IEnumerable<int> getWidths(LaneSwitchEvent ev)
if (ev.Count == keycount)
return Enumerable.Repeat(0, keycount).Select(_ => w);

var layout = newLayout ? LaneSwitchEvent.SWITCH_VISIBILITY_V2 : LaneSwitchEvent.SWITCH_VISIBILITY;

var mode = layout[keycount - 2];
return mode[ev.Count - 1].Select(l => l ? w : 0);
return LaneSwitchEvent.GetRow(ev.Count, keycount, newLayout).Select(l => l ? w : 0);
}
}

0 comments on commit cf841fd

Please sign in to comment.