1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-14 15:57:24 +08:00

add wind up and wind down mods

This commit is contained in:
LeNitrous 2019-01-26 12:15:45 +08:00
parent 718136a892
commit c6e26a92ec
17 changed files with 176 additions and 3 deletions

View File

@ -99,6 +99,11 @@ namespace osu.Game.Rulesets.Catch
new MultiMod(new CatchModAutoplay(), new ModCinema()), new MultiMod(new CatchModAutoplay(), new ModCinema()),
new CatchModRelax(), new CatchModRelax(),
}; };
case ModType.Fun:
return new Mod[]
{
new MultiMod(new CatchModWindUp(), new CatchModWindDown())
};
default: default:
return new Mod[] { }; return new Mod[] { };
} }

View File

@ -0,0 +1,11 @@
using System;
using osu.Game.Rulesets.Mods;
using osu.Game.Rulesets.Catch.Objects;
namespace osu.Game.Rulesets.Catch.Mods
{
public class CatchModWindDown : ModWindDown<CatchHitObject>
{
}
}

View File

@ -0,0 +1,11 @@
using System;
using osu.Game.Rulesets.Mods;
using osu.Game.Rulesets.Catch.Objects;
namespace osu.Game.Rulesets.Catch.Mods
{
public class CatchModWindUp : ModWindUp<CatchHitObject>
{
}
}

View File

@ -145,6 +145,11 @@ namespace osu.Game.Rulesets.Mania
{ {
new MultiMod(new ManiaModAutoplay(), new ModCinema()), new MultiMod(new ManiaModAutoplay(), new ModCinema()),
}; };
case ModType.Fun:
return new Mod[]
{
new MultiMod(new ManiaModWindUp(), new ManiaModWindDown())
};
default: default:
return new Mod[] { }; return new Mod[] { };
} }

View File

@ -0,0 +1,11 @@
using System;
using osu.Game.Rulesets.Mods;
using osu.Game.Rulesets.Mania.Objects;
namespace osu.Game.Rulesets.Mania.Mods
{
public class ManiaModWindDown : ModWindDown<ManiaHitObject>
{
}
}

View File

@ -0,0 +1,11 @@
using System;
using osu.Game.Rulesets.Mods;
using osu.Game.Rulesets.Mania.Objects;
namespace osu.Game.Rulesets.Mania.Mods
{
public class ManiaModWindUp : ModWindUp<ManiaHitObject>
{
}
}

View File

@ -0,0 +1,11 @@
using System;
using osu.Game.Rulesets.Mods;
using osu.Game.Rulesets.Osu.Objects;
namespace osu.Game.Rulesets.Osu.Mods
{
public class OsuModWindDown : ModWindDown<OsuHitObject>
{
}
}

View File

@ -0,0 +1,11 @@
using System;
using osu.Game.Rulesets.Mods;
using osu.Game.Rulesets.Osu.Objects;
namespace osu.Game.Rulesets.Osu.Mods
{
public class OsuModWindUp : ModWindUp<OsuHitObject>
{
}
}

View File

@ -121,6 +121,7 @@ namespace osu.Game.Rulesets.Osu
return new Mod[] { return new Mod[] {
new OsuModTransform(), new OsuModTransform(),
new OsuModWiggle(), new OsuModWiggle(),
new MultiMod(new OsuModWindUp(), new OsuModWindDown())
}; };
default: default:
return new Mod[] { }; return new Mod[] { };

View File

@ -0,0 +1,11 @@
using System;
using osu.Game.Rulesets.Mods;
using osu.Game.Rulesets.Taiko.Objects;
namespace osu.Game.Rulesets.Taiko.Mods
{
public class TaikoModWindDown : ModWindDown<TaikoHitObject>
{
}
}

View File

@ -0,0 +1,11 @@
using System;
using osu.Game.Rulesets.Mods;
using osu.Game.Rulesets.Taiko.Objects;
namespace osu.Game.Rulesets.Taiko.Mods
{
public class TaikoModWindUp : ModWindUp<TaikoHitObject>
{
}
}

View File

@ -99,6 +99,11 @@ namespace osu.Game.Rulesets.Taiko
new MultiMod(new TaikoModAutoplay(), new ModCinema()), new MultiMod(new TaikoModAutoplay(), new ModCinema()),
new TaikoModRelax(), new TaikoModRelax(),
}; };
case ModType.Fun:
return new Mod[]
{
new MultiMod(new TaikoModWindUp(), new TaikoModWindDown())
};
default: default:
return new Mod[] { }; return new Mod[] { };
} }

View File

@ -15,7 +15,7 @@ namespace osu.Game.Rulesets.Mods
public override ModType Type => ModType.DifficultyIncrease; public override ModType Type => ModType.DifficultyIncrease;
public override string Description => "Zoooooooooom..."; public override string Description => "Zoooooooooom...";
public override bool Ranked => true; public override bool Ranked => true;
public override Type[] IncompatibleMods => new[] { typeof(ModHalfTime) }; public override Type[] IncompatibleMods => new[] { typeof(ModHalfTime), typeof(ModWindUp) };
public virtual void ApplyToClock(IAdjustableClock clock) public virtual void ApplyToClock(IAdjustableClock clock)
{ {

View File

@ -15,7 +15,7 @@ namespace osu.Game.Rulesets.Mods
public override ModType Type => ModType.DifficultyReduction; public override ModType Type => ModType.DifficultyReduction;
public override string Description => "Less zoom..."; public override string Description => "Less zoom...";
public override bool Ranked => true; public override bool Ranked => true;
public override Type[] IncompatibleMods => new[] { typeof(ModDoubleTime) }; public override Type[] IncompatibleMods => new[] { typeof(ModDoubleTime), typeof(ModWindUp) };
public virtual void ApplyToClock(IAdjustableClock clock) public virtual void ApplyToClock(IAdjustableClock clock)
{ {

View File

@ -0,0 +1,16 @@
using osu.Game.Graphics;
using osu.Game.Rulesets.Objects;
namespace osu.Game.Rulesets.Mods
{
public class ModWindDown<T> : ModWindUp<T>
where T : HitObject
{
public override string Name => "Wind Down";
public override string Acronym => "WD";
public override string Description => "Slow down.";
public override FontAwesome Icon => FontAwesome.fa_chevron_circle_down;
public override double AppendRate => -0.25;
}
}

View File

@ -0,0 +1,53 @@
using System;
using System.Collections.Generic;
using osu.Framework.Audio;
using osu.Framework.Audio.Track;
using osu.Framework.Configuration;
using osu.Framework.Timing;
using osu.Framework.Graphics;
using osu.Game.Beatmaps;
using osu.Game.Graphics;
using osu.Game.Rulesets.UI;
using osu.Game.Rulesets.Objects;
namespace osu.Game.Rulesets.Mods
{
public abstract class ModWindUp : Mod
{
public override string Name => "Wind Up";
public override string Acronym => "WU";
public override ModType Type => ModType.Fun;
public override FontAwesome Icon => FontAwesome.fa_chevron_circle_up;
public override string Description => "Crank it up!";
public override double ScoreMultiplier => 1;
public override Type[] IncompatibleMods => new[] { typeof(ModDoubleTime), typeof(ModHalfTime) };
public abstract double AppendRate { get; }
}
public class ModWindUp<T> : ModWindUp, IUpdatableByPlayfield, IApplicableToClock, IApplicableToRulesetContainer<T>
where T : HitObject
{
private Track Track;
private IAdjustableClock Clock;
private IHasPitchAdjust ClockAdjust;
public override double AppendRate => 0.5;
public virtual void ApplyToClock(IAdjustableClock clock)
{
Clock = clock;
ClockAdjust = clock as IHasPitchAdjust;
}
public virtual void ApplyToRulesetContainer(RulesetContainer<T> ruleset)
{
Track = ruleset.WorkingBeatmap.Track;
}
public virtual void Update(Playfield playfield)
{
double newRate = 1 + (AppendRate * (Track.CurrentTime / Track.Length));
Clock.Rate = newRate;
ClockAdjust.PitchAdjust = newRate;
}
}
}

View File

@ -215,7 +215,7 @@ namespace osu.Game.Rulesets.UI
/// <summary> /// <summary>
/// The <see cref="WorkingBeatmap"/> this <see cref="RulesetContainer{TObject}"/> was created with. /// The <see cref="WorkingBeatmap"/> this <see cref="RulesetContainer{TObject}"/> was created with.
/// </summary> /// </summary>
protected readonly WorkingBeatmap WorkingBeatmap; public readonly WorkingBeatmap WorkingBeatmap;
public override ScoreProcessor CreateScoreProcessor() => new ScoreProcessor<TObject>(this); public override ScoreProcessor CreateScoreProcessor() => new ScoreProcessor<TObject>(this);