mirror of
https://github.com/ppy/osu.git
synced 2024-11-18 14:12:54 +08:00
42 lines
1.5 KiB
C#
42 lines
1.5 KiB
C#
// 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.
|
|
|
|
using System;
|
|
using System.Linq;
|
|
using osu.Game.Rulesets.Difficulty.Preprocessing;
|
|
using osu.Game.Rulesets.Mods;
|
|
using osu.Game.Rulesets.Osu.Difficulty.Evaluators;
|
|
using osu.Game.Rulesets.Osu.Mods;
|
|
|
|
namespace osu.Game.Rulesets.Osu.Difficulty.Skills
|
|
{
|
|
/// <summary>
|
|
/// Represents the skill required to memorise and hit every object in a map with the Flashlight mod enabled.
|
|
/// </summary>
|
|
public class Flashlight : OsuStrainSkill
|
|
{
|
|
public Flashlight(Mod[] mods)
|
|
: base(mods)
|
|
{
|
|
}
|
|
|
|
private double skillMultiplier => 0.05;
|
|
private double strainDecayBase => 0.15;
|
|
protected override double DecayWeight => 1.0;
|
|
|
|
private double currentStrain;
|
|
|
|
private double strainDecay(double ms) => Math.Pow(strainDecayBase, ms / 1000);
|
|
|
|
protected override double CalculateInitialStrain(double time, DifficultyHitObject current) => currentStrain * strainDecay(time - current.Previous(0).StartTime);
|
|
|
|
protected override double StrainValueAt(DifficultyHitObject current)
|
|
{
|
|
currentStrain *= strainDecay(current.DeltaTime);
|
|
currentStrain += currentStrain += FlashlightEvaluator.EvaluateDifficultyOf(current, Mods.Any(m => m is OsuModHidden)) * skillMultiplier;
|
|
|
|
return currentStrain;
|
|
}
|
|
}
|
|
}
|