mirror of
https://github.com/ppy/osu.git
synced 2025-02-05 04:52:53 +08:00
Fixed approachCircle preempt
This commit is contained in:
parent
f67f6cc99c
commit
e1a8bfa135
@ -21,7 +21,7 @@ namespace osu.Game.Rulesets.Osu.Mods
|
|||||||
public override double ScoreMultiplier => 1;
|
public override double ScoreMultiplier => 1;
|
||||||
public override IconUsage? Icon { get; } = FontAwesome.Regular.Circle;
|
public override IconUsage? Icon { get; } = FontAwesome.Regular.Circle;
|
||||||
|
|
||||||
public override Type[] IncompatibleMods => new[] { typeof(IHidesApproachCircles) };
|
public override Type[] IncompatibleMods => new[] { typeof(IHidesApproachCircles), typeof(OsuModFreezeFrame) };
|
||||||
|
|
||||||
[SettingSource("Initial size", "Change the initial size of the approach circle, relative to hit circles.", 0)]
|
[SettingSource("Initial size", "Change the initial size of the approach circle, relative to hit circles.", 0)]
|
||||||
public BindableFloat Scale { get; } = new BindableFloat(4)
|
public BindableFloat Scale { get; } = new BindableFloat(4)
|
||||||
|
@ -1,17 +1,20 @@
|
|||||||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
||||||
// See the LICENCE file in the repository root for full licence text.
|
// See the LICENCE file in the repository root for full licence text.
|
||||||
|
|
||||||
|
using System;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Localisation;
|
using osu.Framework.Localisation;
|
||||||
using osu.Game.Beatmaps;
|
using osu.Game.Beatmaps;
|
||||||
using osu.Game.Rulesets.Mods;
|
using osu.Game.Rulesets.Mods;
|
||||||
|
using osu.Game.Rulesets.Objects.Drawables;
|
||||||
using osu.Game.Rulesets.Osu.Objects;
|
using osu.Game.Rulesets.Osu.Objects;
|
||||||
using osu.Game.Rulesets.Osu.UI;
|
using osu.Game.Rulesets.Osu.Objects.Drawables;
|
||||||
using osu.Game.Rulesets.UI;
|
|
||||||
|
|
||||||
namespace osu.Game.Rulesets.Osu.Mods
|
namespace osu.Game.Rulesets.Osu.Mods
|
||||||
{
|
{
|
||||||
public class OsuModFreezeFrame : Mod, IApplicableToBeatmap, IApplicableToDrawableRuleset<OsuHitObject>
|
public class OsuModFreezeFrame : Mod, IApplicableToDrawableHitObject, IApplicableToBeatmap
|
||||||
|
|
||||||
{
|
{
|
||||||
public override string Name => "Freeze Frame";
|
public override string Name => "Freeze Frame";
|
||||||
|
|
||||||
@ -21,16 +24,18 @@ namespace osu.Game.Rulesets.Osu.Mods
|
|||||||
|
|
||||||
public override LocalisableString Description => "Burn the notes into your memory.";
|
public override LocalisableString Description => "Burn the notes into your memory.";
|
||||||
|
|
||||||
|
//Alters the transforms of the approach circles, breaking the effects of these mods.
|
||||||
|
public override Type[] IncompatibleMods => new[] { typeof(OsuModApproachDifferent), /*typeof(OsuModHidden)*/ };
|
||||||
|
|
||||||
public override ModType Type => ModType.Fun;
|
public override ModType Type => ModType.Fun;
|
||||||
|
|
||||||
public void ApplyToDrawableRuleset(DrawableRuleset<OsuHitObject> drawableRuleset)
|
//mod breaks normal approach circle preempt
|
||||||
{
|
private double approachCircleTimePreempt;
|
||||||
(drawableRuleset.Playfield as OsuPlayfield)?.FollowPoints.Hide();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void ApplyToBeatmap(IBeatmap beatmap)
|
public void ApplyToBeatmap(IBeatmap beatmap)
|
||||||
{
|
{
|
||||||
double lastNewComboTime = 0;
|
double lastNewComboTime = 0;
|
||||||
|
approachCircleTimePreempt = beatmap.HitObjects.OfType<OsuHitObject>().FirstOrDefault()!.TimePreempt;
|
||||||
|
|
||||||
foreach (var obj in beatmap.HitObjects.OfType<OsuHitObject>())
|
foreach (var obj in beatmap.HitObjects.OfType<OsuHitObject>())
|
||||||
{
|
{
|
||||||
@ -58,5 +63,28 @@ namespace osu.Game.Rulesets.Osu.Mods
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void ApplyToDrawableHitObject(DrawableHitObject drawableObject)
|
||||||
|
{
|
||||||
|
drawableObject.ApplyCustomUpdateState += (drawableHitObject, _) =>
|
||||||
|
{
|
||||||
|
if (drawableHitObject is not DrawableHitCircle drawableHitCircle) return;
|
||||||
|
|
||||||
|
var hitCircle = drawableHitCircle.HitObject;
|
||||||
|
var approachCircle = drawableHitCircle.ApproachCircle;
|
||||||
|
|
||||||
|
approachCircle.ClearTransforms();
|
||||||
|
approachCircle.ScaleTo(4);
|
||||||
|
approachCircle.FadeTo(0);
|
||||||
|
|
||||||
|
using (drawableHitCircle.ApproachCircle.BeginAbsoluteSequence(hitCircle.StartTime - approachCircleTimePreempt))
|
||||||
|
{
|
||||||
|
//Redo ApproachCircle animation with correct startTime.
|
||||||
|
approachCircle.LifetimeStart = hitCircle.StartTime - approachCircleTimePreempt;
|
||||||
|
approachCircle.FadeTo(1, Math.Min(hitCircle.TimeFadeIn * 2, hitCircle.TimePreempt));
|
||||||
|
approachCircle.ScaleTo(1, approachCircleTimePreempt).Then().Expire();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -26,7 +26,7 @@ namespace osu.Game.Rulesets.Osu.Mods
|
|||||||
public override LocalisableString Description => @"Play with no approach circles and fading circles/sliders.";
|
public override LocalisableString Description => @"Play with no approach circles and fading circles/sliders.";
|
||||||
public override double ScoreMultiplier => UsesDefaultConfiguration ? 1.06 : 1;
|
public override double ScoreMultiplier => UsesDefaultConfiguration ? 1.06 : 1;
|
||||||
|
|
||||||
public override Type[] IncompatibleMods => new[] { typeof(IRequiresApproachCircles), typeof(OsuModSpinIn) };
|
public override Type[] IncompatibleMods => new[] { typeof(IRequiresApproachCircles), typeof(OsuModSpinIn), typeof(OsuModFreezeFrame) };
|
||||||
|
|
||||||
public const double FADE_IN_DURATION_MULTIPLIER = 0.4;
|
public const double FADE_IN_DURATION_MULTIPLIER = 0.4;
|
||||||
public const double FADE_OUT_DURATION_MULTIPLIER = 0.3;
|
public const double FADE_OUT_DURATION_MULTIPLIER = 0.3;
|
||||||
|
Loading…
Reference in New Issue
Block a user