mirror of
https://github.com/osukey/osukey.git
synced 2025-08-05 23:53:51 +09:00
Invert if
This commit is contained in:
@ -245,30 +245,29 @@ namespace osu.Game.Rulesets.Catch.UI
|
|||||||
catchObjectPosition >= catcherPosition - halfCatchWidth &&
|
catchObjectPosition >= catcherPosition - halfCatchWidth &&
|
||||||
catchObjectPosition <= catcherPosition + halfCatchWidth;
|
catchObjectPosition <= catcherPosition + halfCatchWidth;
|
||||||
|
|
||||||
// droplet doesn't affect the catcher state
|
|
||||||
if (!(fruit is TinyDroplet))
|
|
||||||
{
|
|
||||||
if (validCatch && fruit.HyperDash)
|
|
||||||
{
|
|
||||||
var target = fruit.HyperDashTarget;
|
|
||||||
var timeDifference = target.StartTime - fruit.StartTime;
|
|
||||||
double positionDifference = target.X - catcherPosition;
|
|
||||||
var velocity = positionDifference / Math.Max(1.0, timeDifference - 1000.0 / 60.0);
|
|
||||||
|
|
||||||
SetHyperDashState(Math.Abs(velocity), target.X);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
SetHyperDashState();
|
|
||||||
|
|
||||||
if (validCatch)
|
|
||||||
updateState(fruit.Kiai ? CatcherAnimationState.Kiai : CatcherAnimationState.Idle);
|
|
||||||
else if (!(fruit is Banana))
|
|
||||||
updateState(CatcherAnimationState.Fail);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (validCatch)
|
if (validCatch)
|
||||||
placeCaughtObject(fruit);
|
placeCaughtObject(fruit);
|
||||||
|
|
||||||
|
// droplet doesn't affect the catcher state
|
||||||
|
if (fruit is TinyDroplet) return validCatch;
|
||||||
|
|
||||||
|
if (validCatch && fruit.HyperDash)
|
||||||
|
{
|
||||||
|
var target = fruit.HyperDashTarget;
|
||||||
|
var timeDifference = target.StartTime - fruit.StartTime;
|
||||||
|
double positionDifference = target.X - catcherPosition;
|
||||||
|
var velocity = positionDifference / Math.Max(1.0, timeDifference - 1000.0 / 60.0);
|
||||||
|
|
||||||
|
SetHyperDashState(Math.Abs(velocity), target.X);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
SetHyperDashState();
|
||||||
|
|
||||||
|
if (validCatch)
|
||||||
|
updateState(fruit.Kiai ? CatcherAnimationState.Kiai : CatcherAnimationState.Idle);
|
||||||
|
else if (!(fruit is Banana))
|
||||||
|
updateState(CatcherAnimationState.Fail);
|
||||||
|
|
||||||
return validCatch;
|
return validCatch;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user