mirror of
https://github.com/ppy/osu.git
synced 2025-02-05 11:42:55 +08:00
Remove mod multipliers
We decided that mods shouldn't be interacting with other mods. This can be added once we have the ability to have per-mod settings, as a difficulty setting local to blinds.
This commit is contained in:
parent
d3368df94d
commit
ef9d93ff6b
@ -1,7 +1,6 @@
|
|||||||
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
||||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||||
|
|
||||||
using System.Linq;
|
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
@ -35,10 +34,7 @@ namespace osu.Game.Rulesets.Osu.Mods
|
|||||||
|
|
||||||
public void ApplyToRulesetContainer(RulesetContainer<OsuHitObject> rulesetContainer)
|
public void ApplyToRulesetContainer(RulesetContainer<OsuHitObject> rulesetContainer)
|
||||||
{
|
{
|
||||||
bool hasEasy = rulesetContainer.Mods.Any(m => m is ModEasy);
|
rulesetContainer.Overlays.Add(blinds = new DrawableOsuBlinds(rulesetContainer.Playfield.HitObjectContainer, rulesetContainer.Beatmap));
|
||||||
bool hasHardrock = rulesetContainer.Mods.Any(m => m is ModHardRock);
|
|
||||||
|
|
||||||
rulesetContainer.Overlays.Add(blinds = new DrawableOsuBlinds(rulesetContainer.Playfield.HitObjectContainer, hasEasy, hasHardrock, rulesetContainer.Beatmap));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void ApplyToScoreProcessor(ScoreProcessor scoreProcessor)
|
public void ApplyToScoreProcessor(ScoreProcessor scoreProcessor)
|
||||||
@ -69,12 +65,7 @@ namespace osu.Game.Rulesets.Osu.Mods
|
|||||||
private readonly float targetBreakMultiplier = 0;
|
private readonly float targetBreakMultiplier = 0;
|
||||||
private readonly float easing = 1;
|
private readonly float easing = 1;
|
||||||
|
|
||||||
private const float black_depth = 10;
|
|
||||||
private const float bg_panel_depth = 8;
|
|
||||||
private const float fg_panel_depth = 4;
|
|
||||||
|
|
||||||
private readonly CompositeDrawable restrictTo;
|
private readonly CompositeDrawable restrictTo;
|
||||||
private readonly bool modEasy, modHardrock;
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// <para>
|
/// <para>
|
||||||
@ -89,13 +80,10 @@ namespace osu.Game.Rulesets.Osu.Mods
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
private const float leniency = 0.1f;
|
private const float leniency = 0.1f;
|
||||||
|
|
||||||
public DrawableOsuBlinds(CompositeDrawable restrictTo, bool hasEasy, bool hasHardrock, Beatmap<OsuHitObject> beatmap)
|
public DrawableOsuBlinds(CompositeDrawable restrictTo, Beatmap<OsuHitObject> beatmap)
|
||||||
{
|
{
|
||||||
this.restrictTo = restrictTo;
|
this.restrictTo = restrictTo;
|
||||||
this.beatmap = beatmap;
|
this.beatmap = beatmap;
|
||||||
|
|
||||||
modEasy = hasEasy;
|
|
||||||
modHardrock = hasHardrock;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
@ -111,9 +99,6 @@ namespace osu.Game.Rulesets.Osu.Mods
|
|||||||
Origin = Anchor.TopLeft,
|
Origin = Anchor.TopLeft,
|
||||||
Colour = Color4.Black,
|
Colour = Color4.Black,
|
||||||
RelativeSizeAxes = Axes.Y,
|
RelativeSizeAxes = Axes.Y,
|
||||||
Width = 0,
|
|
||||||
Height = 1,
|
|
||||||
Depth = black_depth
|
|
||||||
},
|
},
|
||||||
blackBoxRight = new Box
|
blackBoxRight = new Box
|
||||||
{
|
{
|
||||||
@ -121,60 +106,22 @@ namespace osu.Game.Rulesets.Osu.Mods
|
|||||||
Origin = Anchor.TopRight,
|
Origin = Anchor.TopRight,
|
||||||
Colour = Color4.Black,
|
Colour = Color4.Black,
|
||||||
RelativeSizeAxes = Axes.Y,
|
RelativeSizeAxes = Axes.Y,
|
||||||
Width = 0,
|
|
||||||
Height = 1,
|
|
||||||
Depth = black_depth
|
|
||||||
},
|
},
|
||||||
bgPanelLeft = new ModBlindsPanel
|
bgPanelLeft = new ModBlindsPanel
|
||||||
{
|
{
|
||||||
Origin = Anchor.TopRight,
|
Origin = Anchor.TopRight,
|
||||||
Colour = Color4.Gray,
|
Colour = Color4.Gray,
|
||||||
Depth = bg_panel_depth + 1
|
|
||||||
},
|
|
||||||
panelLeft = new ModBlindsPanel
|
|
||||||
{
|
|
||||||
Origin = Anchor.TopRight,
|
|
||||||
Depth = bg_panel_depth
|
|
||||||
},
|
|
||||||
bgPanelRight = new ModBlindsPanel
|
|
||||||
{
|
|
||||||
Origin = Anchor.TopLeft,
|
|
||||||
Colour = Color4.Gray,
|
|
||||||
Depth = fg_panel_depth + 1
|
|
||||||
},
|
|
||||||
panelRight = new ModBlindsPanel
|
|
||||||
{
|
|
||||||
Origin = Anchor.TopLeft,
|
|
||||||
Depth = fg_panel_depth
|
|
||||||
},
|
},
|
||||||
|
panelLeft = new ModBlindsPanel { Origin = Anchor.TopRight, },
|
||||||
|
bgPanelRight = new ModBlindsPanel { Colour = Color4.Gray },
|
||||||
|
panelRight = new ModBlindsPanel()
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
private float applyGap(float value)
|
private float calculateGap(float value) => MathHelper.Clamp(value, 0, target_clamp) * targetBreakMultiplier;
|
||||||
{
|
|
||||||
const float easy_multiplier = 0.95f;
|
|
||||||
const float hardrock_multiplier = 1.1f;
|
|
||||||
|
|
||||||
float multiplier = 1;
|
// lagrange polinominal for (0,0) (0.6,0.4) (1,1) should make a good curve
|
||||||
if (modEasy)
|
private static float applyAdjustmentCurve(float value) => 0.6f * value * value + 0.4f * value;
|
||||||
{
|
|
||||||
multiplier = easy_multiplier;
|
|
||||||
// TODO: include OD/CS
|
|
||||||
}
|
|
||||||
else if (modHardrock)
|
|
||||||
{
|
|
||||||
multiplier = hardrock_multiplier;
|
|
||||||
// TODO: include OD/CS
|
|
||||||
}
|
|
||||||
|
|
||||||
return MathHelper.Clamp(value * multiplier, 0, target_clamp) * targetBreakMultiplier;
|
|
||||||
}
|
|
||||||
|
|
||||||
private static float applyAdjustmentCurve(float value)
|
|
||||||
{
|
|
||||||
// lagrange polinominal for (0,0) (0.5,0.35) (1,1) should make a good curve
|
|
||||||
return 0.6f * value * value + 0.4f * value;
|
|
||||||
}
|
|
||||||
|
|
||||||
protected override void Update()
|
protected override void Update()
|
||||||
{
|
{
|
||||||
@ -186,7 +133,7 @@ namespace osu.Game.Rulesets.Osu.Mods
|
|||||||
start -= rawWidth * leniency * 0.5f;
|
start -= rawWidth * leniency * 0.5f;
|
||||||
end += rawWidth * leniency * 0.5f;
|
end += rawWidth * leniency * 0.5f;
|
||||||
|
|
||||||
float width = (end - start) * 0.5f * applyAdjustmentCurve(applyGap(easing));
|
float width = (end - start) * 0.5f * applyAdjustmentCurve(calculateGap(easing));
|
||||||
|
|
||||||
// different values in case the playfield ever moves from center to somewhere else.
|
// different values in case the playfield ever moves from center to somewhere else.
|
||||||
blackBoxLeft.Width = start + width;
|
blackBoxLeft.Width = start + width;
|
||||||
|
@ -209,7 +209,7 @@ namespace osu.Game.Rulesets.UI
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// The mods which are to be applied.
|
/// The mods which are to be applied.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public IEnumerable<Mod> Mods { get; protected set; }
|
protected IEnumerable<Mod> Mods;
|
||||||
|
|
||||||
/// <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.
|
||||||
|
Loading…
Reference in New Issue
Block a user