Set RequiredHits at conversion time to remove HitMultiplier.

This commit is contained in:
smoogipooo 2017-04-03 15:02:21 +09:00
parent 6043c4787b
commit 774e15b89d
2 changed files with 5 additions and 19 deletions

View File

@ -10,6 +10,7 @@
using System;
using System.Collections.Generic;
using System.Linq;
using osu.Game.Database;
namespace osu.Game.Modes.Taiko.Beatmaps
{
@ -84,6 +85,8 @@ private IEnumerable<TaikoHitObject> convertHitObject(HitObject obj, Beatmap beat
}
else if (endTimeData != null)
{
double hitMultiplier = BeatmapDifficulty.DifficultyRange(beatmap.BeatmapInfo.Difficulty.OverallDifficulty, 3, 5, 7.5) * bash_convert_factor;
// We compute the end time manually to add in the Bash convert factor
yield return new Swell
{
@ -92,7 +95,7 @@ private IEnumerable<TaikoHitObject> convertHitObject(HitObject obj, Beatmap beat
IsStrong = strong,
EndTime = obj.StartTime + endTimeData.Duration,
HitMultiplier = bash_convert_factor
RequiredHits = (int)Math.Max(1, endTimeData.Duration / 1000 * hitMultiplier)
};
}
else

View File

@ -1,9 +1,6 @@
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using System;
using osu.Game.Beatmaps.Timing;
using osu.Game.Database;
using osu.Game.Modes.Objects.Types;
namespace osu.Game.Modes.Taiko.Objects
@ -14,23 +11,9 @@ public class Swell : TaikoHitObject, IHasEndTime
public double Duration => EndTime - StartTime;
/// <summary>
/// The multiplier for cases in which the number of required hits by a swell is not
/// dependent on solely the overall difficulty and the duration of the swell.
/// </summary>
public double HitMultiplier { get; set; } = 1;
/// <summary>
/// The number of hits required to complete the swell successfully.
/// </summary>
public int RequiredHits { get; protected set; } = 10;
public override void ApplyDefaults(TimingInfo timing, BeatmapDifficulty difficulty)
{
base.ApplyDefaults(timing, difficulty);
double baseHitMultiplier = BeatmapDifficulty.DifficultyRange(difficulty.OverallDifficulty, 3, 5, 7.5);
RequiredHits = (int)Math.Max(1, Duration / 1000f * baseHitMultiplier * HitMultiplier);
}
public int RequiredHits = 10;
}
}