1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 08:52:55 +08:00

only affect spinner, hitcircle and slider and nothing else.

This commit is contained in:
miterosan 2018-08-22 21:16:45 +02:00
parent d070a3e2d8
commit c374755cc8

View File

@ -22,13 +22,15 @@ namespace osu.Game.Rulesets.Osu.Mods
public override string Description => "Everything rotates. EVERYTHING."; public override string Description => "Everything rotates. EVERYTHING.";
public override double ScoreMultiplier => 1; public override double ScoreMultiplier => 1;
private readonly IReadOnlyList<Type> TargetHitObjectTypes = new List<Type>() {
typeof(HitCircle),
typeof(Slider),
typeof(Spinner),
};
public void ApplyToDrawableHitObjects(IEnumerable<DrawableHitObject> drawables) public void ApplyToDrawableHitObjects(IEnumerable<DrawableHitObject> drawables)
{ {
drawables.Where(drawable => ( drawables.ForEach(drawable =>
drawable is DrawableHitCircle ||
drawable is DrawableSlider ||
drawable is DrawableSpinner
)).ForEach(drawable =>
drawable.ApplyCustomUpdateState += drawableOnApplyCustomUpdateState drawable.ApplyCustomUpdateState += drawableOnApplyCustomUpdateState
); );
} }
@ -39,6 +41,9 @@ namespace osu.Game.Rulesets.Osu.Mods
{ {
var hitObject = (OsuHitObject) drawable.HitObject; var hitObject = (OsuHitObject) drawable.HitObject;
if (!TargetHitObjectTypes.Contains(hitObject.GetType()))
return;
float appear_distance = (float)hitObject.TimePreempt * 0.5f; float appear_distance = (float)hitObject.TimePreempt * 0.5f;
Vector2 originalPosition = drawable.Position; Vector2 originalPosition = drawable.Position;