Skip to content

Commit 1d3bb49

Browse files
committed
Add new mod
1 parent dc27c0a commit 1d3bb49

File tree

2 files changed

+55
-0
lines changed

2 files changed

+55
-0
lines changed
+49
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
// Copyright (c) ppy Pty Ltd <[email protected]>. Licensed under the MIT Licence.
2+
// See the LICENCE file in the repository root for full licence text.
3+
4+
using osu.Framework.Bindables;
5+
using osu.Game.Beatmaps;
6+
using osu.Game.Configuration;
7+
using osu.Game.Rulesets.Mods;
8+
9+
namespace osu.Game.Rulesets.Tau.Mods
10+
{
11+
public class TauModDifficultyAdjust : ModDifficultyAdjust
12+
{
13+
[SettingSource("Paddle Size", "Override a beatmap's set PS.")]
14+
public BindableNumber<float> PaddleSize { get; } = new BindableFloat
15+
{
16+
Precision = 0.1f,
17+
MinValue = 1,
18+
MaxValue = 10,
19+
Default = 5,
20+
Value = 5,
21+
};
22+
23+
[SettingSource("Approach Rate", "Override a beatmap's set AR.")]
24+
public BindableNumber<float> ApproachRate { get; } = new BindableFloat
25+
{
26+
Precision = 0.1f,
27+
MinValue = 1,
28+
MaxValue = 10,
29+
Default = 5,
30+
Value = 5,
31+
};
32+
33+
protected override void TransferSettings(BeatmapDifficulty difficulty)
34+
{
35+
base.TransferSettings(difficulty);
36+
37+
TransferSetting(PaddleSize, difficulty.CircleSize);
38+
TransferSetting(ApproachRate, difficulty.ApproachRate);
39+
}
40+
41+
protected override void ApplySettings(BeatmapDifficulty difficulty)
42+
{
43+
base.ApplySettings(difficulty);
44+
45+
difficulty.CircleSize = PaddleSize.Value;
46+
difficulty.ApproachRate = ApproachRate.Value;
47+
}
48+
}
49+
}

Diff for: tau/osu.Game.Rulesets.tau/tauRuleset.cs

+6
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,12 @@ public override IEnumerable<Mod> GetModsFor(ModType type)
6565
new TauModRelax(),
6666
};
6767

68+
case ModType.Conversion:
69+
return new Mod[]
70+
{
71+
new TauModDifficultyAdjust(),
72+
};
73+
6874
case ModType.Fun:
6975
return new Mod[]
7076
{

0 commit comments

Comments
 (0)