Skip to content

Commit

Permalink
Add new mod
Browse files Browse the repository at this point in the history
  • Loading branch information
naoei committed Dec 28, 2019
1 parent dc27c0a commit 1d3bb49
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 0 deletions.
49 changes: 49 additions & 0 deletions tau/osu.Game.Rulesets.tau/Mods/TauModDifficultyAdjust.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
// Copyright (c) ppy Pty Ltd <[email protected]>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.

using osu.Framework.Bindables;
using osu.Game.Beatmaps;
using osu.Game.Configuration;
using osu.Game.Rulesets.Mods;

namespace osu.Game.Rulesets.Tau.Mods
{
public class TauModDifficultyAdjust : ModDifficultyAdjust
{
[SettingSource("Paddle Size", "Override a beatmap's set PS.")]
public BindableNumber<float> PaddleSize { get; } = new BindableFloat
{
Precision = 0.1f,
MinValue = 1,
MaxValue = 10,
Default = 5,
Value = 5,
};

[SettingSource("Approach Rate", "Override a beatmap's set AR.")]
public BindableNumber<float> ApproachRate { get; } = new BindableFloat
{
Precision = 0.1f,
MinValue = 1,
MaxValue = 10,
Default = 5,
Value = 5,
};

protected override void TransferSettings(BeatmapDifficulty difficulty)
{
base.TransferSettings(difficulty);

TransferSetting(PaddleSize, difficulty.CircleSize);
TransferSetting(ApproachRate, difficulty.ApproachRate);
}

protected override void ApplySettings(BeatmapDifficulty difficulty)
{
base.ApplySettings(difficulty);

difficulty.CircleSize = PaddleSize.Value;
difficulty.ApproachRate = ApproachRate.Value;
}
}
}
6 changes: 6 additions & 0 deletions tau/osu.Game.Rulesets.tau/tauRuleset.cs
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,12 @@ public override IEnumerable<Mod> GetModsFor(ModType type)
new TauModRelax(),
};

case ModType.Conversion:
return new Mod[]
{
new TauModDifficultyAdjust(),
};

case ModType.Fun:
return new Mod[]
{
Expand Down

0 comments on commit 1d3bb49

Please sign in to comment.