1
0
mirror of https://github.com/ppy/osu.git synced 2026-05-22 06:29:54 +08:00

Remove not necessary variables

This commit is contained in:
o-dasher
2022-10-12 16:35:07 -04:00
Unverified
parent 79e0377638
commit f3435f9abc
+8 -14
View File
@@ -11,7 +11,6 @@ using osu.Framework.Graphics.Rendering.Vertices;
using osu.Framework.Graphics.Shaders;
using osu.Framework.Graphics.Sprites;
using osu.Framework.Localisation;
using osu.Framework.Utils;
using osu.Game.Configuration;
using osu.Game.Graphics;
using osu.Game.Graphics.OpenGL.Vertices;
@@ -138,24 +137,16 @@ namespace osu.Game.Rulesets.Mods
private readonly float appliedFlashlightSize;
private readonly float changeSizeDecreaseRatio;
private readonly bool comboBasedSize;
private readonly float sizeChangesAmount;
private readonly float maxSizeChanges;
private readonly float changeSizeCombo;
protected Flashlight(ModFlashlight modFlashlight)
{
changeSizeCombo = modFlashlight.ChangeSizeComboDivisor.Value;
sizeChangesAmount = modFlashlight.FinalChangeSizeCombo.Value / changeSizeCombo;
maxSizeChanges = modFlashlight.FinalChangeSizeCombo.Value / changeSizeCombo;
appliedFlashlightSize = modFlashlight.DefaultFlashlightSize * modFlashlight.StartingFlashlightSize.Value;
float finalFlashlightSize = modFlashlight.FinalFlashlightSize.Value;
comboBasedSize = !Precision.AlmostEquals(finalFlashlightSize, 1);
if (comboBasedSize)
changeSizeDecreaseRatio = (1 - finalFlashlightSize) / sizeChangesAmount;
changeSizeDecreaseRatio = (1 - modFlashlight.FinalFlashlightSize.Value) / maxSizeChanges;
}
[BackgroundDependencyLoader]
@@ -192,8 +183,11 @@ namespace osu.Game.Rulesets.Mods
if (isBreakTime.Value)
scale = 2.5f;
else if (comboBasedSize)
scale = 1 - MathF.Min(sizeChangesAmount, MathF.Floor(Combo.Value / changeSizeCombo) * changeSizeDecreaseRatio);
else
{
float sizeChangeCount = MathF.Min(maxSizeChanges, MathF.Floor(Combo.Value / changeSizeCombo));
scale -= sizeChangeCount * changeSizeDecreaseRatio;
}
return appliedFlashlightSize * scale;
}