mirror of
https://github.com/ppy/osu.git
synced 2025-01-12 16:02:55 +08:00
Changed relative position to [0, 1]
This commit is contained in:
parent
b40af0848f
commit
82d9504cbf
@ -3,6 +3,7 @@
|
|||||||
|
|
||||||
using osu.Framework.MathUtils;
|
using osu.Framework.MathUtils;
|
||||||
using osu.Game.Rulesets.Catch.Objects;
|
using osu.Game.Rulesets.Catch.Objects;
|
||||||
|
using osu.Game.Rulesets.Catch.UI;
|
||||||
using osu.Game.Rulesets.Mods;
|
using osu.Game.Rulesets.Mods;
|
||||||
using System;
|
using System;
|
||||||
|
|
||||||
@ -18,8 +19,7 @@ namespace osu.Game.Rulesets.Catch.Mods
|
|||||||
|
|
||||||
public void ApplyToHitObject(CatchHitObject hitObject)
|
public void ApplyToHitObject(CatchHitObject hitObject)
|
||||||
{
|
{
|
||||||
// Code from Stable, we keep calculation on a scale of 0 to 512
|
float position = hitObject.X;
|
||||||
float position = hitObject.X * 512;
|
|
||||||
int startTime = (int)hitObject.StartTime;
|
int startTime = (int)hitObject.StartTime;
|
||||||
|
|
||||||
if (lastStartX == 0)
|
if (lastStartX == 0)
|
||||||
@ -43,11 +43,11 @@ namespace osu.Game.Rulesets.Catch.Mods
|
|||||||
{
|
{
|
||||||
bool right = RNG.NextBool();
|
bool right = RNG.NextBool();
|
||||||
|
|
||||||
float rand = Math.Min(20, (float)RNG.NextDouble(0, timeDiff / 4));
|
float rand = Math.Min(20, (float)RNG.NextDouble(0, timeDiff / 4d)) / CatchPlayfield.BASE_WIDTH;
|
||||||
|
|
||||||
if (right)
|
if (right)
|
||||||
{
|
{
|
||||||
if (position + rand <= 512)
|
if (position + rand <= 1)
|
||||||
position += rand;
|
position += rand;
|
||||||
else
|
else
|
||||||
position -= rand;
|
position -= rand;
|
||||||
@ -60,12 +60,12 @@ namespace osu.Game.Rulesets.Catch.Mods
|
|||||||
position += rand;
|
position += rand;
|
||||||
}
|
}
|
||||||
|
|
||||||
hitObject.X = position / 512;
|
hitObject.X = position;
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Math.Abs(diff) < timeDiff / 3)
|
if (Math.Abs(diff) < timeDiff / 3d)
|
||||||
{
|
{
|
||||||
if (diff > 0)
|
if (diff > 0)
|
||||||
{
|
{
|
||||||
@ -74,12 +74,12 @@ namespace osu.Game.Rulesets.Catch.Mods
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (position - diff < 512)
|
if (position - diff < 1)
|
||||||
position -= diff;
|
position -= diff;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
hitObject.X = position / 512;
|
hitObject.X = position;
|
||||||
|
|
||||||
lastStartX = position;
|
lastStartX = position;
|
||||||
lastStartTime = startTime;
|
lastStartTime = startTime;
|
||||||
|
Loading…
Reference in New Issue
Block a user