diff --git a/osu.Game.Rulesets.Touhosu/Beatmaps/TouhosuBeatmapProcessor.cs b/osu.Game.Rulesets.Touhosu/Beatmaps/TouhosuBeatmapProcessor.cs deleted file mode 100644 index 71cedbc..0000000 --- a/osu.Game.Rulesets.Touhosu/Beatmaps/TouhosuBeatmapProcessor.cs +++ /dev/null @@ -1,12 +0,0 @@ -using osu.Game.Beatmaps; - -namespace osu.Game.Rulesets.Touhosu.Beatmaps -{ - public class TouhosuBeatmapProcessor : BeatmapProcessor - { - public TouhosuBeatmapProcessor(IBeatmap b) - : base(b) - { - } - } -} diff --git a/osu.Game.Rulesets.Touhosu/Extensions/ConversionExtensions.cs b/osu.Game.Rulesets.Touhosu/Extensions/ConversionExtensions.cs index cdc1bd8..0d2b4cf 100644 --- a/osu.Game.Rulesets.Touhosu/Extensions/ConversionExtensions.cs +++ b/osu.Game.Rulesets.Touhosu/Extensions/ConversionExtensions.cs @@ -63,6 +63,9 @@ public static IEnumerable ConvertDefaultSlider(HitObject obj, var curvePosition = curve.CurvePositionAt(e.PathProgress / (curve.RepeatCount + 1)) + originalPosition; var sliderEventPosition = toPlayfieldSpace(curvePosition * new Vector2(1, 0.4f)); + if (!withinPlayfield(sliderEventPosition)) + continue; + switch (e.Type) { case SliderEventType.Repeat: @@ -96,7 +99,7 @@ public static IEnumerable 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 buzzPosition = toPlayfieldSpace(originalPosition * new Vector2(1, 0.4f)); var repeats = slider.Select(e => e.Type == SliderEventType.Repeat); var repeatCount = repeats.Count(); @@ -114,23 +117,25 @@ public static IEnumerable ConvertBuzzSlider(HitObject obj, Vec switch (e.Type) { case SliderEventType.Head: - converted.AddRange(generateExplosion(e.Time, bullets_per_slider_reverse, sliderEventPosition)); + converted.AddRange(generateExplosion(e.Time, bullets_per_slider_reverse, buzzPosition)); break; case SliderEventType.Tail: - converted.AddRange(generateExplosion(e.Time, bullets_per_slider_reverse, sliderEventPosition, slider_angle_per_span * (repeatCount + 1))); + converted.AddRange(generateExplosion(e.Time, bullets_per_slider_reverse, buzzPosition, slider_angle_per_span * (repeatCount + 1))); break; } } for (int i = 0; i < totalRepeats; i++) - converted.AddRange(generateExplosion(obj.StartTime + (i + 1) * repeatDuration, bullets_per_slider_reverse, sliderEventPosition, slider_angle_per_span * (i + 1))); + converted.AddRange(generateExplosion(obj.StartTime + (i + 1) * repeatDuration, bullets_per_slider_reverse, buzzPosition, slider_angle_per_span * (i + 1))); return converted; } public static IEnumerable GenerateSliderBody(double startTime, IHasPathWithRepeats curve, Vector2 originalPosition) { + List bodyProjectiles = new List(); + var bodyCherriesCount = Math.Min(curve.Distance * (curve.RepeatCount + 1) / 10, max_visuals_per_slider_span * (curve.RepeatCount + 1)); for (int i = 0; i < bodyCherriesCount; i++) @@ -139,15 +144,26 @@ public static IEnumerable GenerateSliderBody(double startTime, var position = curve.CurvePositionAt(progress) + originalPosition; position = toPlayfieldSpace(position * new Vector2(1, 0.4f)); - if (withinPlayfield(position)) + if (!withinPlayfield(position)) + continue; + + bodyProjectiles.Add(new InstantProjectile { - yield return new InstantProjectile - { - StartTime = startTime + curve.Duration * progress, - Position = position - }; - } + StartTime = startTime + curve.Duration * progress, + Position = position + }); + } + + if (!bodyProjectiles.Any()) + { + bodyProjectiles.Add(new InstantProjectile + { + StartTime = startTime, + Position = new Vector2(-100) + }); } + + return bodyProjectiles; } public static IEnumerable ConvertSpinner(double startTime, IHasDuration endTime, double beatLength) @@ -186,29 +202,23 @@ public static IEnumerable ConvertSpinner(double startTime, IHa private static IEnumerable generateExplosion(double startTime, int bulletCount, Vector2 position, float angleOffset = 0, float angleRange = 360f) { - if (withinPlayfield(position)) + for (int i = 0; i < bulletCount; i++) { - for (int i = 0; i < bulletCount; i++) + yield return new AngeledProjectile { - yield return new AngeledProjectile - { - Angle = MathExtensions.BulletDistribution(bulletCount, angleRange, i, angleOffset), - StartTime = startTime, - Position = position, - }; - } + Angle = MathExtensions.BulletDistribution(bulletCount, angleRange, i, angleOffset), + StartTime = startTime, + Position = position, + }; } } private static IEnumerable generatePolygonExplosion(double startTime, int bullets_per_side, int verticesCount, Vector2 position, float angleOffset = 0) { - if (withinPlayfield(position)) + for (int i = 0; i < verticesCount; i++) { - for (int i = 0; i < verticesCount; i++) - { - foreach (var h in generatePolygonLine(startTime, bullets_per_side, verticesCount, position, i * (360f / verticesCount) + angleOffset)) - yield return h; - } + foreach (var h in generatePolygonLine(startTime, bullets_per_side, verticesCount, position, i * (360f / verticesCount) + angleOffset)) + yield return h; } } diff --git a/osu.Game.Rulesets.Touhosu/Objects/Drawables/DrawableProjectile.cs b/osu.Game.Rulesets.Touhosu/Objects/Drawables/DrawableProjectile.cs index 4bde563..b06d7e0 100644 --- a/osu.Game.Rulesets.Touhosu/Objects/Drawables/DrawableProjectile.cs +++ b/osu.Game.Rulesets.Touhosu/Objects/Drawables/DrawableProjectile.cs @@ -11,7 +11,7 @@ namespace osu.Game.Rulesets.Touhosu.Objects.Drawables { - public abstract class DrawableProjectile : DrawableTouhosuHitObject + public abstract partial class DrawableProjectile : DrawableTouhosuHitObject where T : Projectile { private const int hidden_distance = 70; @@ -20,7 +20,6 @@ public abstract class DrawableProjectile : DrawableTouhosuHitObject public bool IsGrazed = false; public readonly IBindable PositionBindable = new Bindable(); - public readonly Bindable IndexInBeatmap = new Bindable(); protected abstract bool CanHitPlayer { get; } @@ -121,7 +120,6 @@ protected override void OnApply() base.OnApply(); PositionBindable.BindTo(HitObject.PositionBindable); - IndexInBeatmap.BindTo(HitObject.IndexInBeatmapBindable); IsGrazed = false; } @@ -130,7 +128,6 @@ protected override void OnFree() base.OnFree(); PositionBindable.UnbindFrom(HitObject.PositionBindable); - IndexInBeatmap.UnbindFrom(HitObject.IndexInBeatmapBindable); } diff --git a/osu.Game.Rulesets.Touhosu/Objects/Projectile.cs b/osu.Game.Rulesets.Touhosu/Objects/Projectile.cs index 7067c05..1569160 100644 --- a/osu.Game.Rulesets.Touhosu/Objects/Projectile.cs +++ b/osu.Game.Rulesets.Touhosu/Objects/Projectile.cs @@ -7,14 +7,6 @@ public abstract class Projectile : TouhosuHitObject, IHasComboInformation { public double TimePreempt { get; set; } = 400; - public readonly Bindable IndexInBeatmapBindable = new Bindable(); - - public int IndexInBeatmap - { - get => IndexInBeatmapBindable.Value; - set => IndexInBeatmapBindable.Value = value; - } - public Bindable IndexInCurrentComboBindable { get; } = new Bindable(); public int IndexInCurrentCombo diff --git a/osu.Game.Rulesets.Touhosu/TouhosuRuleset.cs b/osu.Game.Rulesets.Touhosu/TouhosuRuleset.cs index a5875a4..0d0ef8c 100644 --- a/osu.Game.Rulesets.Touhosu/TouhosuRuleset.cs +++ b/osu.Game.Rulesets.Touhosu/TouhosuRuleset.cs @@ -44,7 +44,7 @@ public override HealthProcessor CreateHealthProcessor(double drainStartTime) public override IBeatmapConverter CreateBeatmapConverter(IBeatmap beatmap) => new TouhosuBeatmapConverter(beatmap, this); - public override IBeatmapProcessor CreateBeatmapProcessor(IBeatmap beatmap) => new TouhosuBeatmapProcessor(beatmap); + public override IBeatmapProcessor CreateBeatmapProcessor(IBeatmap beatmap) => new BeatmapProcessor(beatmap); public override IConvertibleReplayFrame CreateConvertibleReplayFrame() => new TouhosuReplayFrame(); @@ -112,7 +112,7 @@ protected override IEnumerable GetValidHitResults() => new[] public override DifficultyCalculator CreateDifficultyCalculator(IWorkingBeatmap beatmap) => new TouhosuDifficultyCalculator(RulesetInfo, beatmap); - private class TouhosuIcon : Sprite + private partial class TouhosuIcon : Sprite { private readonly TouhosuRuleset ruleset; diff --git a/osu.Game.Rulesets.Touhosu/osu.Game.Rulesets.Touhosu.csproj b/osu.Game.Rulesets.Touhosu/osu.Game.Rulesets.Touhosu.csproj index ffe9a45..ae498cb 100644 --- a/osu.Game.Rulesets.Touhosu/osu.Game.Rulesets.Touhosu.csproj +++ b/osu.Game.Rulesets.Touhosu/osu.Game.Rulesets.Touhosu.csproj @@ -11,6 +11,6 @@ - + \ No newline at end of file