-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into spinner-glow
- Loading branch information
Showing
60 changed files
with
1,126 additions
and
666 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
// 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.Collections.Generic; | ||
using System.Linq; | ||
using osu.Game.Beatmaps; | ||
using osu.Game.Rulesets.Catch.Objects; | ||
using osu.Game.Rulesets.Objects; | ||
using osu.Game.Rulesets.Scoring; | ||
|
||
namespace osu.Game.Rulesets.Catch.Scoring | ||
{ | ||
public partial class CatchHealthProcessor : LegacyDrainingHealthProcessor | ||
{ | ||
public CatchHealthProcessor(double drainStartTime) | ||
: base(drainStartTime) | ||
{ | ||
} | ||
|
||
protected override IEnumerable<HitObject> EnumerateTopLevelHitObjects() => EnumerateHitObjects(Beatmap).Where(h => h is Fruit || h is Droplet || h is Banana); | ||
|
||
protected override IEnumerable<HitObject> EnumerateNestedHitObjects(HitObject hitObject) => Enumerable.Empty<HitObject>(); | ||
|
||
protected override double GetHealthIncreaseFor(HitObject hitObject, HitResult result) | ||
{ | ||
double increase = 0; | ||
|
||
switch (result) | ||
{ | ||
case HitResult.SmallTickMiss: | ||
return 0; | ||
|
||
case HitResult.LargeTickMiss: | ||
case HitResult.Miss: | ||
return IBeatmapDifficultyInfo.DifficultyRange(Beatmap.Difficulty.DrainRate, -0.03, -0.125, -0.2); | ||
|
||
case HitResult.SmallTickHit: | ||
increase = 0.0015; | ||
break; | ||
|
||
case HitResult.LargeTickHit: | ||
increase = 0.015; | ||
break; | ||
|
||
case HitResult.Great: | ||
increase = 0.03; | ||
break; | ||
|
||
case HitResult.LargeBonus: | ||
increase = 0.0025; | ||
break; | ||
} | ||
|
||
return HpMultiplierNormal * increase; | ||
} | ||
} | ||
} |
93 changes: 93 additions & 0 deletions
93
osu.Game.Rulesets.Osu.Tests/TestSceneOsuHealthProcessor.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
// 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 NUnit.Framework; | ||
using osu.Game.Beatmaps; | ||
using osu.Game.Beatmaps.Timing; | ||
using osu.Game.Rulesets.Osu.Objects; | ||
using osu.Game.Rulesets.Osu.Scoring; | ||
|
||
namespace osu.Game.Rulesets.Osu.Tests | ||
{ | ||
[TestFixture] | ||
public class TestSceneOsuHealthProcessor | ||
{ | ||
[Test] | ||
public void TestNoBreak() | ||
{ | ||
OsuHealthProcessor hp = new OsuHealthProcessor(-1000); | ||
hp.ApplyBeatmap(new Beatmap<OsuHitObject> | ||
{ | ||
HitObjects = | ||
{ | ||
new HitCircle { StartTime = 0 }, | ||
new HitCircle { StartTime = 2000 } | ||
} | ||
}); | ||
|
||
Assert.That(hp.DrainRate, Is.EqualTo(1.4E-5).Within(0.1E-5)); | ||
} | ||
|
||
[Test] | ||
public void TestSingleBreak() | ||
{ | ||
OsuHealthProcessor hp = new OsuHealthProcessor(-1000); | ||
hp.ApplyBeatmap(new Beatmap<OsuHitObject> | ||
{ | ||
HitObjects = | ||
{ | ||
new HitCircle { StartTime = 0 }, | ||
new HitCircle { StartTime = 2000 } | ||
}, | ||
Breaks = | ||
{ | ||
new BreakPeriod(500, 1500) | ||
} | ||
}); | ||
|
||
Assert.That(hp.DrainRate, Is.EqualTo(4.3E-5).Within(0.1E-5)); | ||
} | ||
|
||
[Test] | ||
public void TestOverlappingBreak() | ||
{ | ||
OsuHealthProcessor hp = new OsuHealthProcessor(-1000); | ||
hp.ApplyBeatmap(new Beatmap<OsuHitObject> | ||
{ | ||
HitObjects = | ||
{ | ||
new HitCircle { StartTime = 0 }, | ||
new HitCircle { StartTime = 2000 } | ||
}, | ||
Breaks = | ||
{ | ||
new BreakPeriod(500, 1400), | ||
new BreakPeriod(750, 1500), | ||
} | ||
}); | ||
|
||
Assert.That(hp.DrainRate, Is.EqualTo(4.3E-5).Within(0.1E-5)); | ||
} | ||
|
||
[Test] | ||
public void TestSequentialBreak() | ||
{ | ||
OsuHealthProcessor hp = new OsuHealthProcessor(-1000); | ||
hp.ApplyBeatmap(new Beatmap<OsuHitObject> | ||
{ | ||
HitObjects = | ||
{ | ||
new HitCircle { StartTime = 0 }, | ||
new HitCircle { StartTime = 2000 } | ||
}, | ||
Breaks = | ||
{ | ||
new BreakPeriod(500, 1000), | ||
new BreakPeriod(1000, 1500), | ||
} | ||
}); | ||
|
||
Assert.That(hp.DrainRate, Is.EqualTo(4.3E-5).Within(0.1E-5)); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
215 changes: 0 additions & 215 deletions
215
osu.Game.Rulesets.Osu/Scoring/LegacyOsuHealthProcessor.cs
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.