Skip to content

Commit

Permalink
Fix broken sliders
Browse files Browse the repository at this point in the history
  • Loading branch information
EVAST9919 committed Feb 1, 2023
1 parent 90e82fb commit 82081eb
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions osu.Game.Rulesets.Touhosu/Extensions/ConversionExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,15 @@ public static IEnumerable<TouhosuHitObject> ConvertDefaultCircle(double startTim
=> generateExplosion(
startTime,
bullets_per_hitcircle,
toPlayfieldSpace(originalPosition) * new Vector2(1, 0.4f),
toPlayfieldSpace(originalPosition * new Vector2(1, 0.4f)),
hitcircle_angle_offset * indexInCurrentCombo);

public static IEnumerable<TouhosuHitObject> ConvertImpactCircle(double startTime, Vector2 originalPosition)
=> generatePolygonExplosion(
startTime,
4,
MathExtensions.GetRandomTimedBool(startTime) ? 3 : 4,
toPlayfieldSpace(originalPosition) * new Vector2(1, 0.4f),
toPlayfieldSpace(originalPosition * new Vector2(1, 0.4f)),
MathExtensions.GetRandomTimedAngleOffset(startTime));

public static IEnumerable<TouhosuHitObject> ConvertDefaultSlider(HitObject obj, Vector2 originalPosition, IBeatmap beatmap, IHasPathWithRepeats curve, double spanDuration)
Expand All @@ -61,7 +61,7 @@ public static IEnumerable<TouhosuHitObject> ConvertDefaultSlider(HitObject obj,
foreach (var e in SliderEventGenerator.Generate(obj.StartTime, spanDuration, velocity, tickDistance, curve.Path.Distance, curve.RepeatCount + 1, legacyLastTickOffset, new CancellationToken()))
{
var curvePosition = curve.CurvePositionAt(e.PathProgress / (curve.RepeatCount + 1)) + originalPosition;
var sliderEventPosition = toPlayfieldSpace(curvePosition) * new Vector2(1, 0.4f);
var sliderEventPosition = toPlayfieldSpace(curvePosition * new Vector2(1, 0.4f));

switch (e.Type)
{
Expand Down Expand Up @@ -96,7 +96,7 @@ public static IEnumerable<TouhosuHitObject> ConvertBuzzSlider(HitObject obj, Vec

var slider = SliderEventGenerator.Generate(obj.StartTime, spanDuration, velocity, tickDistance, curve.Path.Distance, curve.RepeatCount + 1, legacyLastTickOffset, new CancellationToken());

var sliderEventPosition = toPlayfieldSpace(originalPosition) * new Vector2(1, 0.4f);
var sliderEventPosition = toPlayfieldSpace(originalPosition * new Vector2(1, 0.4f));
var repeats = slider.Select(e => e.Type == SliderEventType.Repeat);

var repeatCount = repeats.Count();
Expand Down Expand Up @@ -137,7 +137,7 @@ public static IEnumerable<TouhosuHitObject> GenerateSliderBody(double startTime,
{
var progress = i / bodyCherriesCount;
var position = curve.CurvePositionAt(progress) + originalPosition;
position = toPlayfieldSpace(position) * new Vector2(1, 0.4f);
position = toPlayfieldSpace(position * new Vector2(1, 0.4f));

if (withinPlayfield(position))
{
Expand Down Expand Up @@ -245,7 +245,7 @@ private static Vector2 toPlayfieldSpace(Vector2 input)

private static bool withinPlayfield(Vector2 position)
{
return position.X > 0f && position.Y < TouhosuPlayfield.PLAYFIELD_SIZE.X && position.Y > 0f && position.Y < TouhosuPlayfield.PLAYFIELD_SIZE.Y;
return position.X > 0f && position.X < TouhosuPlayfield.PLAYFIELD_SIZE.X && position.Y > 0f && position.Y < TouhosuPlayfield.PLAYFIELD_SIZE.Y;
}
}
}

0 comments on commit 82081eb

Please sign in to comment.