mirror of
https://github.com/ppy/osu.git
synced 2025-01-12 17:35:10 +08:00
Fix logic error, minor stamina changes
This commit is contained in:
parent
bfada36554
commit
07d3a7bd2e
@ -1,6 +1,7 @@
|
|||||||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
||||||
// See the LICENCE file in the repository root for full licence text.
|
// See the LICENCE file in the repository root for full licence text.
|
||||||
|
|
||||||
|
using System;
|
||||||
using osu.Game.Rulesets.Difficulty.Preprocessing;
|
using osu.Game.Rulesets.Difficulty.Preprocessing;
|
||||||
using osu.Game.Rulesets.Taiko.Difficulty.Preprocessing;
|
using osu.Game.Rulesets.Taiko.Difficulty.Preprocessing;
|
||||||
using osu.Game.Rulesets.Taiko.Objects;
|
using osu.Game.Rulesets.Taiko.Objects;
|
||||||
@ -15,7 +16,7 @@ namespace osu.Game.Rulesets.Taiko.Difficulty.Evaluators
|
|||||||
/// <param name="notePairDuration">The duration between the current and previous note hit using the same key.</param>
|
/// <param name="notePairDuration">The duration between the current and previous note hit using the same key.</param>
|
||||||
private static double speedBonus(double notePairDuration)
|
private static double speedBonus(double notePairDuration)
|
||||||
{
|
{
|
||||||
return 175 / (notePairDuration + 100);
|
return Math.Pow(0.4, notePairDuration / 1000);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -38,7 +39,8 @@ namespace osu.Game.Rulesets.Taiko.Difficulty.Evaluators
|
|||||||
return 0.0;
|
return 0.0;
|
||||||
}
|
}
|
||||||
|
|
||||||
double objectStrain = 0.5;
|
double objectStrain = 0;
|
||||||
|
// Console.WriteLine(speedBonus(taikoCurrent.StartTime - keyPrevious.StartTime));
|
||||||
objectStrain += speedBonus(taikoCurrent.StartTime - keyPrevious.StartTime);
|
objectStrain += speedBonus(taikoCurrent.StartTime - keyPrevious.StartTime);
|
||||||
return objectStrain;
|
return objectStrain;
|
||||||
}
|
}
|
||||||
|
@ -4,6 +4,7 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
using osu.Game.Beatmaps;
|
||||||
using osu.Game.Rulesets.Difficulty.Preprocessing;
|
using osu.Game.Rulesets.Difficulty.Preprocessing;
|
||||||
using osu.Game.Rulesets.Objects;
|
using osu.Game.Rulesets.Objects;
|
||||||
using osu.Game.Rulesets.Taiko.Objects;
|
using osu.Game.Rulesets.Taiko.Objects;
|
||||||
@ -15,13 +16,10 @@ namespace osu.Game.Rulesets.Taiko.Difficulty.Preprocessing
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public class TaikoDifficultyHitObject : DifficultyHitObject
|
public class TaikoDifficultyHitObject : DifficultyHitObject
|
||||||
{
|
{
|
||||||
// TODO: Review this - these was originally handled in TaikodifficultyCalculator.CreateDifficultyHitObjects, but
|
|
||||||
// it might be a good idea to encapsulate as much detail within the class as possible.
|
|
||||||
private static List<TaikoDifficultyHitObject> centreHitObjects = new List<TaikoDifficultyHitObject>();
|
|
||||||
private static List<TaikoDifficultyHitObject> rimHitObjects = new List<TaikoDifficultyHitObject>();
|
|
||||||
|
|
||||||
private readonly IReadOnlyList<TaikoDifficultyHitObject> monoDifficultyHitObjects;
|
private readonly IReadOnlyList<TaikoDifficultyHitObject> monoDifficultyHitObjects;
|
||||||
public readonly int MonoPosition;
|
public readonly int MonoPosition;
|
||||||
|
private readonly IReadOnlyList<TaikoDifficultyHitObject> noteObjects;
|
||||||
|
public readonly int NotePosition;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The rhythm required to hit this hit object.
|
/// The rhythm required to hit this hit object.
|
||||||
@ -46,12 +44,21 @@ namespace osu.Game.Rulesets.Taiko.Difficulty.Preprocessing
|
|||||||
/// <param name="lastObject">The gameplay <see cref="HitObject"/> preceding <paramref name="hitObject"/>.</param>
|
/// <param name="lastObject">The gameplay <see cref="HitObject"/> preceding <paramref name="hitObject"/>.</param>
|
||||||
/// <param name="lastLastObject">The gameplay <see cref="HitObject"/> preceding <paramref name="lastObject"/>.</param>
|
/// <param name="lastLastObject">The gameplay <see cref="HitObject"/> preceding <paramref name="lastObject"/>.</param>
|
||||||
/// <param name="clockRate">The rate of the gameplay clock. Modified by speed-changing mods.</param>
|
/// <param name="clockRate">The rate of the gameplay clock. Modified by speed-changing mods.</param>
|
||||||
/// <param name="objects">The list of <see cref="DifficultyHitObject"/>s in the current beatmap.</param>
|
/// <param name="objects">The list of all <see cref="DifficultyHitObject"/>s in the current beatmap.</param>
|
||||||
/// /// <param name="position">The position of this <see cref="DifficultyHitObject"/> in the <paramref name="objects"/> list.</param>
|
/// <param name="centreHitObjects">The list of centre (don) <see cref="DifficultyHitObject"/>s in the current beatmap.</param>
|
||||||
public TaikoDifficultyHitObject(HitObject hitObject, HitObject lastObject, HitObject lastLastObject, double clockRate, List<DifficultyHitObject> objects, int position)
|
/// <param name="rimHitObjects">The list of rim (kat) <see cref="DifficultyHitObject"/>s in the current beatmap.</param>
|
||||||
|
/// <param name="noteObjects">The list of <see cref="DifficultyHitObject"/>s that is a hit (i.e. not a slider or spinner) in the current beatmap.</param>
|
||||||
|
/// <param name="position">The position of this <see cref="DifficultyHitObject"/> in the <paramref name="objects"/> list.</param>
|
||||||
|
///
|
||||||
|
/// TODO: This argument list is getting long, we might want to refactor this into a static method that create
|
||||||
|
/// all <see cref="DifficultyHitObject"/>s from a <see cref="IBeatmap"/>.
|
||||||
|
public TaikoDifficultyHitObject(HitObject hitObject, HitObject lastObject, HitObject lastLastObject, double clockRate,
|
||||||
|
List<DifficultyHitObject> objects, List<TaikoDifficultyHitObject> centreHitObjects, List<TaikoDifficultyHitObject> rimHitObjects,
|
||||||
|
List<TaikoDifficultyHitObject> noteObjects, int position)
|
||||||
: base(hitObject, lastObject, clockRate, objects, position)
|
: base(hitObject, lastObject, clockRate, objects, position)
|
||||||
{
|
{
|
||||||
var currentHit = hitObject as Hit;
|
var currentHit = hitObject as Hit;
|
||||||
|
this.noteObjects = noteObjects;
|
||||||
|
|
||||||
Rhythm = getClosestRhythm(lastObject, lastLastObject, clockRate);
|
Rhythm = getClosestRhythm(lastObject, lastLastObject, clockRate);
|
||||||
HitType = currentHit?.Type;
|
HitType = currentHit?.Type;
|
||||||
@ -68,6 +75,8 @@ namespace osu.Game.Rulesets.Taiko.Difficulty.Preprocessing
|
|||||||
}
|
}
|
||||||
|
|
||||||
Colour = TaikoDifficultyHitObjectColour.GetInstanceFor(this);
|
Colour = TaikoDifficultyHitObjectColour.GetInstanceFor(this);
|
||||||
|
this.NotePosition = noteObjects.Count();
|
||||||
|
noteObjects.Add(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (HitType == Objects.HitType.Centre)
|
if (HitType == Objects.HitType.Centre)
|
||||||
@ -124,5 +133,9 @@ namespace osu.Game.Rulesets.Taiko.Difficulty.Preprocessing
|
|||||||
public TaikoDifficultyHitObject PreviousMono(int backwardsIndex) => monoDifficultyHitObjects.ElementAtOrDefault(MonoPosition - (backwardsIndex + 1));
|
public TaikoDifficultyHitObject PreviousMono(int backwardsIndex) => monoDifficultyHitObjects.ElementAtOrDefault(MonoPosition - (backwardsIndex + 1));
|
||||||
|
|
||||||
public TaikoDifficultyHitObject NextMono(int forwardsIndex) => monoDifficultyHitObjects.ElementAtOrDefault(MonoPosition + (forwardsIndex + 1));
|
public TaikoDifficultyHitObject NextMono(int forwardsIndex) => monoDifficultyHitObjects.ElementAtOrDefault(MonoPosition + (forwardsIndex + 1));
|
||||||
|
|
||||||
|
public TaikoDifficultyHitObject PreviousNote(int backwardsIndex) => noteObjects.ElementAtOrDefault(NotePosition - (backwardsIndex + 1));
|
||||||
|
|
||||||
|
public TaikoDifficultyHitObject NextNote(int forwardsIndex) => noteObjects.ElementAtOrDefault(NotePosition + (forwardsIndex + 1));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -18,8 +18,8 @@ namespace osu.Game.Rulesets.Taiko.Difficulty.Skills
|
|||||||
/// </remarks>
|
/// </remarks>
|
||||||
public class Stamina : StrainDecaySkill
|
public class Stamina : StrainDecaySkill
|
||||||
{
|
{
|
||||||
protected override double SkillMultiplier => 3.6;
|
protected override double SkillMultiplier => 1.2;
|
||||||
protected override double StrainDecayBase => 0;
|
protected override double StrainDecayBase => 0.4;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Creates a <see cref="Stamina"/> skill.
|
/// Creates a <see cref="Stamina"/> skill.
|
||||||
|
@ -21,8 +21,8 @@ namespace osu.Game.Rulesets.Taiko.Difficulty
|
|||||||
public class TaikoDifficultyCalculator : DifficultyCalculator
|
public class TaikoDifficultyCalculator : DifficultyCalculator
|
||||||
{
|
{
|
||||||
private const double rhythm_skill_multiplier = 0.017;
|
private const double rhythm_skill_multiplier = 0.017;
|
||||||
private const double colour_skill_multiplier = 0.028;
|
private const double colour_skill_multiplier = 0.027;
|
||||||
private const double stamina_skill_multiplier = 0.021;
|
private const double stamina_skill_multiplier = 0.017;
|
||||||
|
|
||||||
public TaikoDifficultyCalculator(IRulesetInfo ruleset, IWorkingBeatmap beatmap)
|
public TaikoDifficultyCalculator(IRulesetInfo ruleset, IWorkingBeatmap beatmap)
|
||||||
: base(ruleset, beatmap)
|
: base(ruleset, beatmap)
|
||||||
@ -47,13 +47,16 @@ namespace osu.Game.Rulesets.Taiko.Difficulty
|
|||||||
protected override IEnumerable<DifficultyHitObject> CreateDifficultyHitObjects(IBeatmap beatmap, double clockRate)
|
protected override IEnumerable<DifficultyHitObject> CreateDifficultyHitObjects(IBeatmap beatmap, double clockRate)
|
||||||
{
|
{
|
||||||
List<DifficultyHitObject> difficultyHitObject = new List<DifficultyHitObject>();
|
List<DifficultyHitObject> difficultyHitObject = new List<DifficultyHitObject>();
|
||||||
|
List<TaikoDifficultyHitObject> centreObjects = new List<TaikoDifficultyHitObject>();
|
||||||
|
List<TaikoDifficultyHitObject> rimObjects = new List<TaikoDifficultyHitObject>();
|
||||||
|
List<TaikoDifficultyHitObject> noteObjects = new List<TaikoDifficultyHitObject>();
|
||||||
|
|
||||||
for (int i = 2; i < beatmap.HitObjects.Count; i++)
|
for (int i = 2; i < beatmap.HitObjects.Count; i++)
|
||||||
{
|
{
|
||||||
difficultyHitObject.Add(
|
difficultyHitObject.Add(
|
||||||
new TaikoDifficultyHitObject(
|
new TaikoDifficultyHitObject(
|
||||||
beatmap.HitObjects[i], beatmap.HitObjects[i - 1], beatmap.HitObjects[i - 2], clockRate, difficultyHitObject, difficultyHitObject.Count
|
beatmap.HitObjects[i], beatmap.HitObjects[i - 1], beatmap.HitObjects[i - 2], clockRate, difficultyHitObject,
|
||||||
)
|
centreObjects, rimObjects, noteObjects, difficultyHitObject.Count)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user