mirror of
https://github.com/ppy/osu.git
synced 2025-02-14 23:33:23 +08:00
Apply suggestions from the review
This commit is contained in:
parent
2bcb7aa83a
commit
24e50251ec
@ -16,8 +16,8 @@ namespace osu.Game.Rulesets.Catch.Mods
|
||||
{
|
||||
public override double ScoreMultiplier => UsesDefaultConfiguration ? 1.12 : 1;
|
||||
|
||||
[SettingSource("Flashlight size", "Multiplier applied to the default flashlight size.")]
|
||||
public override BindableFloat SizeMultiplier { get; } = new BindableFloat
|
||||
[SettingSource("Starting flashlight size", "Multiplier applied to the default flashlight size.")]
|
||||
public override BindableFloat StartingFlashlightSize { get; } = new BindableFloat
|
||||
{
|
||||
MinValue = 0.5f,
|
||||
MaxValue = 1.5f,
|
||||
|
@ -22,8 +22,8 @@ namespace osu.Game.Rulesets.Mania.Mods
|
||||
FinalFlashlightSize.Default = 1;
|
||||
}
|
||||
|
||||
[SettingSource("Flashlight size", "Multiplier applied to the default flashlight size.")]
|
||||
public override BindableFloat SizeMultiplier { get; } = new BindableFloat
|
||||
[SettingSource("Starting flashlight size", "Multiplier applied to the default flashlight size.")]
|
||||
public override BindableFloat StartingFlashlightSize { get; } = new BindableFloat
|
||||
{
|
||||
MinValue = 0.5f,
|
||||
MaxValue = 3f,
|
||||
|
@ -32,8 +32,8 @@ namespace osu.Game.Rulesets.Osu.Mods
|
||||
Precision = default_follow_delay,
|
||||
};
|
||||
|
||||
[SettingSource("Flashlight size", "Multiplier applied to the default flashlight size.")]
|
||||
public override BindableFloat SizeMultiplier { get; } = new BindableFloat
|
||||
[SettingSource("Starting flashlight size", "Multiplier applied to the default flashlight size.")]
|
||||
public override BindableFloat StartingFlashlightSize { get; } = new BindableFloat
|
||||
{
|
||||
MinValue = 0.5f,
|
||||
MaxValue = 2f,
|
||||
|
@ -17,8 +17,8 @@ namespace osu.Game.Rulesets.Taiko.Mods
|
||||
{
|
||||
public override double ScoreMultiplier => UsesDefaultConfiguration ? 1.12 : 1;
|
||||
|
||||
[SettingSource("Flashlight size", "Multiplier applied to the default flashlight size.")]
|
||||
public override BindableFloat SizeMultiplier { get; } = new BindableFloat
|
||||
[SettingSource("Starting flashlight size", "Multiplier applied to the default flashlight size.")]
|
||||
public override BindableFloat StartingFlashlightSize { get; } = new BindableFloat
|
||||
{
|
||||
MinValue = 0.5f,
|
||||
MaxValue = 1.5f,
|
||||
|
@ -200,7 +200,7 @@ namespace osu.Game.Tests.Visual.SongSelect
|
||||
new OsuModFlashlight
|
||||
{
|
||||
FollowDelay = { Value = 200 },
|
||||
SizeMultiplier = { Value = 5 },
|
||||
StartingFlashlightSize = { Value = 5 },
|
||||
},
|
||||
new OsuModDifficultyAdjust
|
||||
{
|
||||
|
@ -42,10 +42,10 @@ namespace osu.Game.Rulesets.Mods
|
||||
FinalFlashlightSize.DefaultChanged += _ => FinalFlashlightSize.SetDefault();
|
||||
}
|
||||
|
||||
[SettingSource("Flashlight size", "Multiplier applied to the default flashlight size.")]
|
||||
public abstract BindableFloat SizeMultiplier { get; }
|
||||
[SettingSource("Starting flashlight size", "Multiplier applied to the default flashlight size.")]
|
||||
public abstract BindableFloat StartingFlashlightSize { get; }
|
||||
|
||||
[SettingSource("Final flashlight size", "The final size multiplier that is reached when the flashlight changes size for the last time.")]
|
||||
[SettingSource("Final flashlight size", "Multiplier applied to the starting flashlight size after the max flashlight combo is reached.")]
|
||||
public BindableFloat FinalFlashlightSize { get; } = new BindableFloat(0.8f)
|
||||
{
|
||||
MinValue = 0.5f,
|
||||
@ -60,8 +60,8 @@ namespace osu.Game.Rulesets.Mods
|
||||
MaxValue = max_change_size_combo,
|
||||
};
|
||||
|
||||
[SettingSource("Change size times", "Changes how many times the flashlight size is changed before reaching the final flashlight size.")]
|
||||
public BindableInt MaxChangeSizeTimes { get; } = new BindableInt(2)
|
||||
[SettingSource("Amount of size changes", "The amount of times the flashlight size changes.")]
|
||||
public BindableInt SizeChangesAmount { get; } = new BindableInt(2)
|
||||
{
|
||||
MinValue = min_change_size_combo,
|
||||
MaxValue = max_change_size_combo,
|
||||
@ -133,23 +133,22 @@ namespace osu.Game.Rulesets.Mods
|
||||
private readonly float changeSizeDecreaseRatio;
|
||||
private readonly bool comboBasedSize;
|
||||
|
||||
private readonly int maxChangeSizeTimes;
|
||||
private readonly int sizeChangesAmount;
|
||||
private readonly float changeSizeCombo;
|
||||
|
||||
protected Flashlight(ModFlashlight modFlashlight)
|
||||
{
|
||||
changeSizeCombo = modFlashlight.ChangeSizeCombo.Value;
|
||||
maxChangeSizeTimes = modFlashlight.MaxChangeSizeTimes.Value;
|
||||
sizeChangesAmount = modFlashlight.SizeChangesAmount.Value;
|
||||
|
||||
appliedFlashlightSize = modFlashlight.DefaultFlashlightSize * modFlashlight.SizeMultiplier.Value;
|
||||
appliedFlashlightSize = modFlashlight.DefaultFlashlightSize * modFlashlight.StartingFlashlightSize.Value;
|
||||
|
||||
var finalFlashlightSizeBinding = modFlashlight.FinalFlashlightSize;
|
||||
float finalFlashlightSize = finalFlashlightSizeBinding.Value;
|
||||
float finalFlashlightSize = modFlashlight.FinalFlashlightSize.Value;
|
||||
|
||||
comboBasedSize = !Precision.AlmostEquals(finalFlashlightSize, 1);
|
||||
|
||||
if (comboBasedSize)
|
||||
changeSizeDecreaseRatio = (1 - finalFlashlightSize) / maxChangeSizeTimes;
|
||||
changeSizeDecreaseRatio = (1 - finalFlashlightSize) / sizeChangesAmount;
|
||||
}
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
@ -187,9 +186,9 @@ namespace osu.Game.Rulesets.Mods
|
||||
{
|
||||
if (!comboBasedSize) return appliedFlashlightSize;
|
||||
|
||||
float changeSizeComboReachedTimesLimited = MathF.Min(maxChangeSizeTimes, MathF.Floor(combo / changeSizeCombo));
|
||||
float sizeChangeCount = MathF.Min(sizeChangesAmount, MathF.Floor(combo / changeSizeCombo));
|
||||
|
||||
return appliedFlashlightSize * (1 - changeSizeComboReachedTimesLimited * changeSizeDecreaseRatio);
|
||||
return appliedFlashlightSize * (1 - sizeChangeCount * changeSizeDecreaseRatio);
|
||||
}
|
||||
|
||||
private Vector2 flashlightPosition;
|
||||
|
Loading…
Reference in New Issue
Block a user