mirror of
https://github.com/ppy/osu.git
synced 2025-01-15 06:42:56 +08:00
Merge pull request #8256 from smoogipoo/expose-catcher-width
Expose half catcher width to movement skill
This commit is contained in:
commit
17b0b3df35
@ -23,6 +23,8 @@ namespace osu.Game.Rulesets.Catch.Difficulty
|
|||||||
|
|
||||||
protected override int SectionLength => 750;
|
protected override int SectionLength => 750;
|
||||||
|
|
||||||
|
private float halfCatcherWidth;
|
||||||
|
|
||||||
public CatchDifficultyCalculator(Ruleset ruleset, WorkingBeatmap beatmap)
|
public CatchDifficultyCalculator(Ruleset ruleset, WorkingBeatmap beatmap)
|
||||||
: base(ruleset, beatmap)
|
: base(ruleset, beatmap)
|
||||||
{
|
{
|
||||||
@ -48,14 +50,6 @@ namespace osu.Game.Rulesets.Catch.Difficulty
|
|||||||
|
|
||||||
protected override IEnumerable<DifficultyHitObject> CreateDifficultyHitObjects(IBeatmap beatmap, double clockRate)
|
protected override IEnumerable<DifficultyHitObject> CreateDifficultyHitObjects(IBeatmap beatmap, double clockRate)
|
||||||
{
|
{
|
||||||
float halfCatchWidth;
|
|
||||||
|
|
||||||
using (var catcher = new CatcherArea.Catcher(beatmap.BeatmapInfo.BaseDifficulty))
|
|
||||||
{
|
|
||||||
halfCatchWidth = catcher.CatchWidth * 0.5f;
|
|
||||||
halfCatchWidth *= 0.8f; // We're only using 80% of the catcher's width to simulate imperfect gameplay.
|
|
||||||
}
|
|
||||||
|
|
||||||
CatchHitObject lastObject = null;
|
CatchHitObject lastObject = null;
|
||||||
|
|
||||||
// In 2B beatmaps, it is possible that a normal Fruit is placed in the middle of a JuiceStream.
|
// In 2B beatmaps, it is possible that a normal Fruit is placed in the middle of a JuiceStream.
|
||||||
@ -69,16 +63,25 @@ namespace osu.Game.Rulesets.Catch.Difficulty
|
|||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (lastObject != null)
|
if (lastObject != null)
|
||||||
yield return new CatchDifficultyHitObject(hitObject, lastObject, clockRate, halfCatchWidth);
|
yield return new CatchDifficultyHitObject(hitObject, lastObject, clockRate, halfCatcherWidth);
|
||||||
|
|
||||||
lastObject = hitObject;
|
lastObject = hitObject;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override Skill[] CreateSkills(IBeatmap beatmap) => new Skill[]
|
protected override Skill[] CreateSkills(IBeatmap beatmap)
|
||||||
{
|
{
|
||||||
new Movement(),
|
using (var catcher = new CatcherArea.Catcher(beatmap.BeatmapInfo.BaseDifficulty))
|
||||||
|
{
|
||||||
|
halfCatcherWidth = catcher.CatchWidth * 0.5f;
|
||||||
|
halfCatcherWidth *= 0.8f; // We're only using 80% of the catcher's width to simulate imperfect gameplay.
|
||||||
|
}
|
||||||
|
|
||||||
|
return new Skill[]
|
||||||
|
{
|
||||||
|
new Movement(halfCatcherWidth),
|
||||||
};
|
};
|
||||||
|
}
|
||||||
|
|
||||||
protected override Mod[] DifficultyAdjustmentMods => new Mod[]
|
protected override Mod[] DifficultyAdjustmentMods => new Mod[]
|
||||||
{
|
{
|
||||||
|
@ -20,9 +20,16 @@ namespace osu.Game.Rulesets.Catch.Difficulty.Skills
|
|||||||
|
|
||||||
protected override double DecayWeight => 0.94;
|
protected override double DecayWeight => 0.94;
|
||||||
|
|
||||||
|
protected readonly float HalfCatcherWidth;
|
||||||
|
|
||||||
private float? lastPlayerPosition;
|
private float? lastPlayerPosition;
|
||||||
private float lastDistanceMoved;
|
private float lastDistanceMoved;
|
||||||
|
|
||||||
|
public Movement(float halfCatcherWidth)
|
||||||
|
{
|
||||||
|
HalfCatcherWidth = halfCatcherWidth;
|
||||||
|
}
|
||||||
|
|
||||||
protected override double StrainValueOf(DifficultyHitObject current)
|
protected override double StrainValueOf(DifficultyHitObject current)
|
||||||
{
|
{
|
||||||
var catchCurrent = (CatchDifficultyHitObject)current;
|
var catchCurrent = (CatchDifficultyHitObject)current;
|
||||||
|
Loading…
Reference in New Issue
Block a user