Skip to content

Commit 3d3bb33

Browse files
committed
[F][UGC]UGC高度与C2S高度的换算
1 parent bef2f86 commit 3d3bb33

3 files changed

Lines changed: 5 additions & 5 deletions

File tree

generator/chu/C2sGenerator.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,11 +126,11 @@ private static bool IsSlideContinueSegments(ChuNote n) // Air Slide的前驱只
126126

127127
private static string FormatAsdAsc(ChuNote n, int m, int o, int durTicks, List<Alert> alerts)
128128
{
129-
return FormattableString.Invariant($"{n.Type}\t{m}\t{o}\t{n.Cell}\t{n.Width}\t{n.TargetNote}\t{n.Height:0.#}\t{durTicks}\t{n.EndCell}\t{n.EndWidth}\t{n.EndHeight:0.#}\t{AirColorTag(n, alerts)}");
129+
return FormattableString.Invariant($"{n.Type}\t{m}\t{o}\t{n.Cell}\t{n.Width}\t{n.TargetNote}\t{n.Height:F1}\t{durTicks}\t{n.EndCell}\t{n.EndWidth}\t{n.EndHeight:F1}\t{AirColorTag(n, alerts)}");
130130
}
131131

132132
private static string FormatAld(ChuNote n, int m, int o, int durTicks, List<Alert> alerts)
133133
{
134-
return FormattableString.Invariant($"ALD\t{m}\t{o}\t{n.Cell}\t{n.Width}\t{Utils.Tick(n.CrushInterval, RSL)}\t{n.Height:0.#}\t{durTicks}\t{n.EndCell}\t{n.EndWidth}\t{n.EndHeight:0.#}\t{AirCrushColorTag(n, alerts)}");
134+
return FormattableString.Invariant($"ALD\t{m}\t{o}\t{n.Cell}\t{n.Width}\t{Utils.Tick(n.CrushInterval, RSL)}\t{n.Height:F1}\t{durTicks}\t{n.EndCell}\t{n.EndWidth}\t{n.EndHeight:F1}\t{AirCrushColorTag(n, alerts)}");
135135
}
136136
}

generator/chu/UgcGenerator.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ private static bool IsSlideContinueSegments(ChuNote n) // Air Slide的前驱只
186186
=> (IsSlide(n) && IsSlide(n.Previous)) || (IsAirSlide(n) && IsAirSlide(n.Previous));
187187
private static char SlideFollowerMarker(string t) => t is "SLC" or "SXC" or "ASC" ? 'c' : 's';
188188

189-
private static string EncodeAirHeight(decimal value) => IToH36((int)Math.Round(C2U_Height(value) * 10)).PadLeft(2, '0');
189+
private static string EncodeAirHeight(decimal value) => IToH36(Math.Clamp((int)Math.Round(C2U_Height(value) * 10), 0, 1295)).PadLeft(2, '0');
190190

191191
private string AirColor(ChuNote n)
192192
{

utils/ChuUtils.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,8 @@ public static bool Try_C2U_AirColor(ChuNote n, out string color)
7474
public static readonly Dictionary<string, string> C2U_AirCrushColor = Utils.ReverseDict(U2C_AirCrushColor);
7575
public static readonly HashSet<string> C2sAllowedCrushColors = C2U_AirCrushColor.Keys.ToHashSet();
7676

77-
public static decimal U2C_Height(decimal input) => input / 1.6m;
78-
public static decimal C2U_Height(decimal input) => input * 1.6m;
77+
public static decimal U2C_Height(decimal input) => input / 2 + 1;
78+
public static decimal C2U_Height(decimal input) => (input - 1) * 2;
7979

8080
public static bool IsHold(string t) => t is "HLD" or "HXD";
8181
public static bool IsSlide(string t) => t is "SLD" or "SLC" or "SXD" or "SXC";

0 commit comments

Comments
 (0)