mirror of
https://github.com/osukey/osukey.git
synced 2025-04-30 19:27:25 +09:00
# Conflicts: # osu.Game.Rulesets.Catch/Beatmaps/CatchBeatmapConverter.cs # osu.Game.Rulesets.Catch/Objects/JuiceStream.cs # osu.Game.Rulesets.Osu/Beatmaps/OsuBeatmapConverter.cs # osu.Game/Rulesets/Objects/Legacy/Catch/ConvertHitObjectParser.cs # osu.Game/Rulesets/Objects/Legacy/Mania/ConvertHitObjectParser.cs # osu.Game/Rulesets/Objects/Legacy/Osu/ConvertHitObjectParser.cs # osu.Game/Rulesets/Objects/Legacy/Taiko/ConvertHitObjectParser.cs # osu.Game/Rulesets/Objects/SliderPath.cs
49 lines
1.8 KiB
C#
49 lines
1.8 KiB
C#
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
|
|
|
using osu.Game.Rulesets.Objects.Types;
|
|
using System.Collections.Generic;
|
|
using osu.Game.Audio;
|
|
using osu.Game.Beatmaps;
|
|
using osu.Game.Beatmaps.ControlPoints;
|
|
|
|
namespace osu.Game.Rulesets.Objects.Legacy
|
|
{
|
|
internal abstract class ConvertSlider : HitObject, IHasCurve, IHasLegacyLastTickOffset
|
|
{
|
|
/// <summary>
|
|
/// Scoring distance with a speed-adjusted beat length of 1 second.
|
|
/// </summary>
|
|
private const float base_scoring_distance = 100;
|
|
|
|
/// <summary>
|
|
/// <see cref="ConvertSlider"/>s don't need a curve since they're converted to ruleset-specific hitobjects.
|
|
/// </summary>
|
|
public SliderPath Path { get; set; }
|
|
|
|
public double Distance => Path.GetDistance();
|
|
|
|
public List<List<SampleInfo>> NodeSamples { get; set; }
|
|
public int RepeatCount { get; set; }
|
|
|
|
public double EndTime => StartTime + this.SpanCount() * Distance / Velocity;
|
|
public double Duration => EndTime - StartTime;
|
|
|
|
public double Velocity = 1;
|
|
|
|
protected override void ApplyDefaultsToSelf(ControlPointInfo controlPointInfo, BeatmapDifficulty difficulty)
|
|
{
|
|
base.ApplyDefaultsToSelf(controlPointInfo, difficulty);
|
|
|
|
TimingControlPoint timingPoint = controlPointInfo.TimingPointAt(StartTime);
|
|
DifficultyControlPoint difficultyPoint = controlPointInfo.DifficultyPointAt(StartTime);
|
|
|
|
double scoringDistance = base_scoring_distance * difficulty.SliderMultiplier * difficultyPoint.SpeedMultiplier;
|
|
|
|
Velocity = scoringDistance / timingPoint.BeatLength;
|
|
}
|
|
|
|
public double LegacyLastTickOffset => 36;
|
|
}
|
|
}
|