mirror of
https://github.com/ppy/osu.git
synced 2024-11-11 14:17:26 +08:00
Added OsuModDeflate class and adjusted OsuRuleset.cs
This commit is contained in:
parent
9b753bb429
commit
b72d44b1e8
44
osu.Game.Rulesets.Osu/Mods/OsuModDeflate.cs
Normal file
44
osu.Game.Rulesets.Osu/Mods/OsuModDeflate.cs
Normal file
@ -0,0 +1,44 @@
|
||||
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Game.Graphics;
|
||||
using osu.Game.Rulesets.Mods;
|
||||
using osu.Game.Rulesets.Objects.Drawables;
|
||||
using osu.Game.Rulesets.Osu.Objects.Drawables;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace osu.Game.Rulesets.Osu.Mods
|
||||
{
|
||||
public class OsuModDeflate : Mod, IApplicableToDrawableHitObjects
|
||||
{
|
||||
public override string Name => "Deflate";
|
||||
public override string ShortenedName => "DF";
|
||||
public override FontAwesome Icon => FontAwesome.fa_compress;
|
||||
public override ModType Type => ModType.Fun;
|
||||
public override string Description => "Become one with the approach circle...";
|
||||
public override double ScoreMultiplier => 1;
|
||||
|
||||
public void ApplyToDrawableHitObjects(IEnumerable<DrawableHitObject> drawables)
|
||||
{
|
||||
foreach (var drawable in drawables)
|
||||
drawable.ApplyCustomUpdateState += drawableOnApplyCustomUpdateState;
|
||||
}
|
||||
|
||||
protected void drawableOnApplyCustomUpdateState(DrawableHitObject drawable, ArmedState state)
|
||||
{
|
||||
if (!(drawable is DrawableHitCircle d))
|
||||
return;
|
||||
|
||||
d.ApproachCircle.Hide();
|
||||
var h = d.HitObject;
|
||||
|
||||
using (d.BeginAbsoluteSequence(h.StartTime - h.TimePreempt))
|
||||
{
|
||||
var origScale = d.Scale;
|
||||
d.ScaleTo(1.1f);
|
||||
d.ScaleTo(origScale, h.TimePreempt);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -117,6 +117,11 @@ namespace osu.Game.Rulesets.Osu
|
||||
new OsuModRelax(),
|
||||
new OsuModAutopilot(),
|
||||
};
|
||||
case ModType.Fun:
|
||||
return new Mod[]
|
||||
{
|
||||
new OsuModDeflate(),
|
||||
};
|
||||
default:
|
||||
return new Mod[] { };
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user