mirror of
https://github.com/ppy/osu.git
synced 2025-01-21 08:52:54 +08:00
Move scoring distance constant to a central/shared location
This commit is contained in:
parent
f92331531c
commit
f3ed71d336
@ -10,11 +10,6 @@ namespace osu.Game.Rulesets.Osu.Edit
|
|||||||
{
|
{
|
||||||
public class OsuDistanceSnapGrid : CircularDistanceSnapGrid
|
public class OsuDistanceSnapGrid : CircularDistanceSnapGrid
|
||||||
{
|
{
|
||||||
/// <summary>
|
|
||||||
/// Scoring distance with a speed-adjusted beat length of 1 second.
|
|
||||||
/// </summary>
|
|
||||||
private const float base_scoring_distance = 100;
|
|
||||||
|
|
||||||
public OsuDistanceSnapGrid(OsuHitObject hitObject)
|
public OsuDistanceSnapGrid(OsuHitObject hitObject)
|
||||||
: base(hitObject, hitObject.StackedEndPosition)
|
: base(hitObject, hitObject.StackedEndPosition)
|
||||||
{
|
{
|
||||||
@ -25,7 +20,7 @@ namespace osu.Game.Rulesets.Osu.Edit
|
|||||||
TimingControlPoint timingPoint = controlPointInfo.TimingPointAt(time);
|
TimingControlPoint timingPoint = controlPointInfo.TimingPointAt(time);
|
||||||
DifficultyControlPoint difficultyPoint = controlPointInfo.DifficultyPointAt(time);
|
DifficultyControlPoint difficultyPoint = controlPointInfo.DifficultyPointAt(time);
|
||||||
|
|
||||||
double scoringDistance = base_scoring_distance * difficulty.SliderMultiplier * difficultyPoint.SpeedMultiplier;
|
double scoringDistance = OsuHitObject.BASE_SCORING_DISTANCE * difficulty.SliderMultiplier * difficultyPoint.SpeedMultiplier;
|
||||||
|
|
||||||
return (float)(scoringDistance / timingPoint.BeatLength);
|
return (float)(scoringDistance / timingPoint.BeatLength);
|
||||||
}
|
}
|
||||||
|
@ -14,8 +14,16 @@ namespace osu.Game.Rulesets.Osu.Objects
|
|||||||
{
|
{
|
||||||
public abstract class OsuHitObject : HitObject, IHasComboInformation, IHasPosition
|
public abstract class OsuHitObject : HitObject, IHasComboInformation, IHasPosition
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// The radius of hit objects (ie. the radius of a <see cref="HitCircle"/>).
|
||||||
|
/// </summary>
|
||||||
public const float OBJECT_RADIUS = 64;
|
public const float OBJECT_RADIUS = 64;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Scoring distance with a speed-adjusted beat length of 1 second (ie. the speed slider balls move through their track).
|
||||||
|
/// </summary>
|
||||||
|
internal const float BASE_SCORING_DISTANCE = 100;
|
||||||
|
|
||||||
public double TimePreempt = 600;
|
public double TimePreempt = 600;
|
||||||
public double TimeFadeIn = 400;
|
public double TimeFadeIn = 400;
|
||||||
|
|
||||||
|
@ -19,11 +19,6 @@ namespace osu.Game.Rulesets.Osu.Objects
|
|||||||
{
|
{
|
||||||
public class Slider : OsuHitObject, IHasCurve
|
public class Slider : OsuHitObject, IHasCurve
|
||||||
{
|
{
|
||||||
/// <summary>
|
|
||||||
/// Scoring distance with a speed-adjusted beat length of 1 second.
|
|
||||||
/// </summary>
|
|
||||||
private const float base_scoring_distance = 100;
|
|
||||||
|
|
||||||
public double EndTime => StartTime + this.SpanCount() * Path.Distance / Velocity;
|
public double EndTime => StartTime + this.SpanCount() * Path.Distance / Velocity;
|
||||||
public double Duration => EndTime - StartTime;
|
public double Duration => EndTime - StartTime;
|
||||||
|
|
||||||
@ -123,7 +118,7 @@ namespace osu.Game.Rulesets.Osu.Objects
|
|||||||
TimingControlPoint timingPoint = controlPointInfo.TimingPointAt(StartTime);
|
TimingControlPoint timingPoint = controlPointInfo.TimingPointAt(StartTime);
|
||||||
DifficultyControlPoint difficultyPoint = controlPointInfo.DifficultyPointAt(StartTime);
|
DifficultyControlPoint difficultyPoint = controlPointInfo.DifficultyPointAt(StartTime);
|
||||||
|
|
||||||
double scoringDistance = base_scoring_distance * difficulty.SliderMultiplier * difficultyPoint.SpeedMultiplier;
|
double scoringDistance = BASE_SCORING_DISTANCE * difficulty.SliderMultiplier * difficultyPoint.SpeedMultiplier;
|
||||||
|
|
||||||
Velocity = scoringDistance / timingPoint.BeatLength;
|
Velocity = scoringDistance / timingPoint.BeatLength;
|
||||||
TickDistance = scoringDistance / difficulty.SliderTickRate * TickDistanceMultiplier;
|
TickDistance = scoringDistance / difficulty.SliderTickRate * TickDistanceMultiplier;
|
||||||
|
Loading…
Reference in New Issue
Block a user