From 36b458bdee3dedaee369a05222d22631b6212cb0 Mon Sep 17 00:00:00 2001 From: Ivan Pavluk Date: Thu, 29 Nov 2018 08:56:19 +0700 Subject: [PATCH 01/35] Fixed #3777 --- .../Judgements/TaikoDrumRollJudgement.cs | 11 ++++++++++ .../Objects/Drawables/DrawableHit.cs | 4 ++-- osu.Game.Rulesets.Taiko/Objects/DrumRoll.cs | 4 ++++ .../Scoring/TaikoScoreProcessor.cs | 22 ++++++++++++++++++- 4 files changed, 38 insertions(+), 3 deletions(-) create mode 100644 osu.Game.Rulesets.Taiko/Judgements/TaikoDrumRollJudgement.cs diff --git a/osu.Game.Rulesets.Taiko/Judgements/TaikoDrumRollJudgement.cs b/osu.Game.Rulesets.Taiko/Judgements/TaikoDrumRollJudgement.cs new file mode 100644 index 0000000000..b1ac49b939 --- /dev/null +++ b/osu.Game.Rulesets.Taiko/Judgements/TaikoDrumRollJudgement.cs @@ -0,0 +1,11 @@ +using osu.Game.Rulesets.Scoring; + +namespace osu.Game.Rulesets.Taiko.Judgements +{ + class TaikoDrumRollJudgement : TaikoJudgement + { + public override bool AffectsCombo => false; + + protected override int NumericResultFor(HitResult result) => 0; + } +} diff --git a/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableHit.cs b/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableHit.cs index 6f7264e23b..a1681b38f1 100644 --- a/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableHit.cs +++ b/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableHit.cs @@ -170,7 +170,7 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables ApplyResult(r => r.Type = HitResult.Miss); return; } - + if (!userTriggered) { if (timeOffset > second_hit_window) @@ -179,7 +179,7 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables } if (Math.Abs(MainObject.Result.TimeOffset - timeOffset) < second_hit_window) - ApplyResult(r => r.Type = HitResult.Great); + ApplyResult(r => r.Type = MainObject.Result.Type); } public override bool OnPressed(TaikoAction action) diff --git a/osu.Game.Rulesets.Taiko/Objects/DrumRoll.cs b/osu.Game.Rulesets.Taiko/Objects/DrumRoll.cs index 405ea85f0d..0dc460643a 100644 --- a/osu.Game.Rulesets.Taiko/Objects/DrumRoll.cs +++ b/osu.Game.Rulesets.Taiko/Objects/DrumRoll.cs @@ -5,11 +5,15 @@ using osu.Game.Rulesets.Objects.Types; using System; using osu.Game.Beatmaps; using osu.Game.Beatmaps.ControlPoints; +using osu.Game.Rulesets.Judgements; +using osu.Game.Rulesets.Taiko.Judgements; namespace osu.Game.Rulesets.Taiko.Objects { public class DrumRoll : TaikoHitObject, IHasEndTime { + public override Judgement CreateJudgement() => new TaikoDrumRollJudgement(); + /// /// Drum roll distance that results in a duration of 1 speed-adjusted beat length. /// diff --git a/osu.Game.Rulesets.Taiko/Scoring/TaikoScoreProcessor.cs b/osu.Game.Rulesets.Taiko/Scoring/TaikoScoreProcessor.cs index cf33141027..cf974a6223 100644 --- a/osu.Game.Rulesets.Taiko/Scoring/TaikoScoreProcessor.cs +++ b/osu.Game.Rulesets.Taiko/Scoring/TaikoScoreProcessor.cs @@ -80,7 +80,27 @@ namespace osu.Game.Rulesets.Taiko.Scoring { base.ApplyResult(result); - bool isTick = result.Judgement is TaikoDrumRollTickJudgement; + bool isTick = false; + bool isRoll = false; + bool isStrong = false; + + isTick = result.Judgement is TaikoDrumRollTickJudgement; + if (!isTick) + { + isRoll = result.Judgement is TaikoDrumRollJudgement; + if (!isRoll) + { + isStrong = result.Judgement is TaikoStrongJudgement; + } + } + + //Don't change HP based on drum roll fullness for compatibility + if (isRoll) + return; + + //If the object is strong, HP change is already handled in MainObject + if (isStrong) + return; // Apply HP changes switch (result.Type) From 17337e05a1f857ebc583f8aa589f9cdac90b411e Mon Sep 17 00:00:00 2001 From: Ivan Pavluk Date: Thu, 29 Nov 2018 09:06:40 +0700 Subject: [PATCH 02/35] Fixed whitespace --- osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableHit.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableHit.cs b/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableHit.cs index a1681b38f1..48731388cb 100644 --- a/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableHit.cs +++ b/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableHit.cs @@ -170,7 +170,7 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables ApplyResult(r => r.Type = HitResult.Miss); return; } - + if (!userTriggered) { if (timeOffset > second_hit_window) From 00a243f7f26e77e5987e8b798419f1fe0d4323ef Mon Sep 17 00:00:00 2001 From: Ivan Pavluk Date: Thu, 29 Nov 2018 09:19:41 +0700 Subject: [PATCH 03/35] Add license header --- .../Judgements/TaikoDrumRollJudgement.cs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/osu.Game.Rulesets.Taiko/Judgements/TaikoDrumRollJudgement.cs b/osu.Game.Rulesets.Taiko/Judgements/TaikoDrumRollJudgement.cs index b1ac49b939..48ccdb30e1 100644 --- a/osu.Game.Rulesets.Taiko/Judgements/TaikoDrumRollJudgement.cs +++ b/osu.Game.Rulesets.Taiko/Judgements/TaikoDrumRollJudgement.cs @@ -1,11 +1,14 @@ -using osu.Game.Rulesets.Scoring; +// Copyright (c) 2007-2018 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using osu.Game.Rulesets.Scoring; namespace osu.Game.Rulesets.Taiko.Judgements { class TaikoDrumRollJudgement : TaikoJudgement { public override bool AffectsCombo => false; - + protected override int NumericResultFor(HitResult result) => 0; } } From ce1e6d93e47947e85487395d076b7754b604713c Mon Sep 17 00:00:00 2001 From: Ivan Pavluk Date: Thu, 29 Nov 2018 09:45:57 +0700 Subject: [PATCH 04/35] Update TaikoScoreProcessor.cs --- osu.Game.Rulesets.Taiko/Scoring/TaikoScoreProcessor.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/osu.Game.Rulesets.Taiko/Scoring/TaikoScoreProcessor.cs b/osu.Game.Rulesets.Taiko/Scoring/TaikoScoreProcessor.cs index cf974a6223..a2a0251860 100644 --- a/osu.Game.Rulesets.Taiko/Scoring/TaikoScoreProcessor.cs +++ b/osu.Game.Rulesets.Taiko/Scoring/TaikoScoreProcessor.cs @@ -80,11 +80,10 @@ namespace osu.Game.Rulesets.Taiko.Scoring { base.ApplyResult(result); - bool isTick = false; bool isRoll = false; bool isStrong = false; + bool isTick = result.Judgement is TaikoDrumRollTickJudgement; - isTick = result.Judgement is TaikoDrumRollTickJudgement; if (!isTick) { isRoll = result.Judgement is TaikoDrumRollJudgement; From a378c5054428d00f0300d09ad2c92813f0a0dd90 Mon Sep 17 00:00:00 2001 From: Ivan Pavluk Date: Thu, 29 Nov 2018 09:47:12 +0700 Subject: [PATCH 05/35] Fix TaikoDrumRollJudgement visibilityy --- osu.Game.Rulesets.Taiko/Judgements/TaikoDrumRollJudgement.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game.Rulesets.Taiko/Judgements/TaikoDrumRollJudgement.cs b/osu.Game.Rulesets.Taiko/Judgements/TaikoDrumRollJudgement.cs index 48ccdb30e1..8ef98c6dac 100644 --- a/osu.Game.Rulesets.Taiko/Judgements/TaikoDrumRollJudgement.cs +++ b/osu.Game.Rulesets.Taiko/Judgements/TaikoDrumRollJudgement.cs @@ -5,7 +5,7 @@ using osu.Game.Rulesets.Scoring; namespace osu.Game.Rulesets.Taiko.Judgements { - class TaikoDrumRollJudgement : TaikoJudgement + public class TaikoDrumRollJudgement : TaikoJudgement { public override bool AffectsCombo => false; From 2ca9864301f1676ce36041d4b27ca6c90bcfe9a6 Mon Sep 17 00:00:00 2001 From: Ivan Pavluk Date: Thu, 29 Nov 2018 22:05:13 +0700 Subject: [PATCH 06/35] Fixed taiko swell hp and scoring --- .../Judgements/TaikoDrumRollJudgement.cs | 2 ++ .../TaikoIntermediateSwellJudgement.cs | 21 ------------- .../Judgements/TaikoJudgement.cs | 5 ++++ .../Judgements/TaikoStrongJudgement.cs | 3 ++ .../Judgements/TaikoSwellJudgement.cs | 14 +++++++++ .../Judgements/TaikoSwellTickJudgement.cs | 25 ++++++++++++++++ .../Objects/Drawables/DrawableSwellTick.cs | 4 +-- osu.Game.Rulesets.Taiko/Objects/Swell.cs | 4 +++ osu.Game.Rulesets.Taiko/Objects/SwellTick.cs | 4 +++ .../Scoring/TaikoScoreProcessor.cs | 30 +++++++------------ 10 files changed, 69 insertions(+), 43 deletions(-) delete mode 100644 osu.Game.Rulesets.Taiko/Judgements/TaikoIntermediateSwellJudgement.cs create mode 100644 osu.Game.Rulesets.Taiko/Judgements/TaikoSwellJudgement.cs create mode 100644 osu.Game.Rulesets.Taiko/Judgements/TaikoSwellTickJudgement.cs diff --git a/osu.Game.Rulesets.Taiko/Judgements/TaikoDrumRollJudgement.cs b/osu.Game.Rulesets.Taiko/Judgements/TaikoDrumRollJudgement.cs index 8ef98c6dac..4663d00bdc 100644 --- a/osu.Game.Rulesets.Taiko/Judgements/TaikoDrumRollJudgement.cs +++ b/osu.Game.Rulesets.Taiko/Judgements/TaikoDrumRollJudgement.cs @@ -9,6 +9,8 @@ namespace osu.Game.Rulesets.Taiko.Judgements { public override bool AffectsCombo => false; + public override bool AffectsHP => false; + protected override int NumericResultFor(HitResult result) => 0; } } diff --git a/osu.Game.Rulesets.Taiko/Judgements/TaikoIntermediateSwellJudgement.cs b/osu.Game.Rulesets.Taiko/Judgements/TaikoIntermediateSwellJudgement.cs deleted file mode 100644 index 81a1bd1344..0000000000 --- a/osu.Game.Rulesets.Taiko/Judgements/TaikoIntermediateSwellJudgement.cs +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (c) 2007-2018 ppy Pty Ltd . -// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE - -using osu.Game.Rulesets.Scoring; - -namespace osu.Game.Rulesets.Taiko.Judgements -{ - public class TaikoIntermediateSwellJudgement : TaikoJudgement - { - public override HitResult MaxResult => HitResult.Great; - - public override bool AffectsCombo => false; - - /// - /// Computes the numeric result value for the combo portion of the score. - /// - /// The result to compute the value for. - /// The numeric result value. - protected override int NumericResultFor(HitResult result) => 0; - } -} diff --git a/osu.Game.Rulesets.Taiko/Judgements/TaikoJudgement.cs b/osu.Game.Rulesets.Taiko/Judgements/TaikoJudgement.cs index 9b1f7a08b5..386495bf1b 100644 --- a/osu.Game.Rulesets.Taiko/Judgements/TaikoJudgement.cs +++ b/osu.Game.Rulesets.Taiko/Judgements/TaikoJudgement.cs @@ -10,6 +10,11 @@ namespace osu.Game.Rulesets.Taiko.Judgements { public override HitResult MaxResult => HitResult.Great; + /// + /// Whether this should affect user's hitpoints. + /// + public virtual bool AffectsHP => true; + /// /// Computes the numeric result value for the combo portion of the score. /// diff --git a/osu.Game.Rulesets.Taiko/Judgements/TaikoStrongJudgement.cs b/osu.Game.Rulesets.Taiko/Judgements/TaikoStrongJudgement.cs index ccfdeb5b0e..2665540d07 100644 --- a/osu.Game.Rulesets.Taiko/Judgements/TaikoStrongJudgement.cs +++ b/osu.Game.Rulesets.Taiko/Judgements/TaikoStrongJudgement.cs @@ -5,6 +5,9 @@ namespace osu.Game.Rulesets.Taiko.Judgements { public class TaikoStrongJudgement : TaikoJudgement { + // MainObject already changes the HP + public override bool AffectsHP => false; + public override bool AffectsCombo => false; } } diff --git a/osu.Game.Rulesets.Taiko/Judgements/TaikoSwellJudgement.cs b/osu.Game.Rulesets.Taiko/Judgements/TaikoSwellJudgement.cs new file mode 100644 index 0000000000..b913f5d730 --- /dev/null +++ b/osu.Game.Rulesets.Taiko/Judgements/TaikoSwellJudgement.cs @@ -0,0 +1,14 @@ +// Copyright (c) 2007-2018 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using osu.Game.Rulesets.Scoring; + +namespace osu.Game.Rulesets.Taiko.Judgements +{ + public class TaikoSwellJudgement : TaikoJudgement + { + public override bool AffectsCombo => false; + + protected override int NumericResultFor(HitResult result) => 0; + } +} diff --git a/osu.Game.Rulesets.Taiko/Judgements/TaikoSwellTickJudgement.cs b/osu.Game.Rulesets.Taiko/Judgements/TaikoSwellTickJudgement.cs new file mode 100644 index 0000000000..8dd03796ea --- /dev/null +++ b/osu.Game.Rulesets.Taiko/Judgements/TaikoSwellTickJudgement.cs @@ -0,0 +1,25 @@ +// Copyright (c) 2007-2018 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using osu.Game.Rulesets.Scoring; + +namespace osu.Game.Rulesets.Taiko.Judgements +{ + public class TaikoSwellTickJudgement : TaikoJudgement + { + public override bool AffectsCombo => false; + + public override bool AffectsHP => false; + + protected override int NumericResultFor(HitResult result) + { + switch (result) + { + default: + return 0; + case HitResult.Great: + return 300; + } + } + } +} diff --git a/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableSwellTick.cs b/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableSwellTick.cs index 36c468c6d6..0a73474cf3 100644 --- a/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableSwellTick.cs +++ b/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableSwellTick.cs @@ -6,11 +6,11 @@ using osu.Game.Rulesets.Scoring; namespace osu.Game.Rulesets.Taiko.Objects.Drawables { - public class DrawableSwellTick : DrawableTaikoHitObject + public class DrawableSwellTick : DrawableTaikoHitObject { public override bool DisplayResult => false; - public DrawableSwellTick(TaikoHitObject hitObject) + public DrawableSwellTick(SwellTick hitObject) : base(hitObject) { } diff --git a/osu.Game.Rulesets.Taiko/Objects/Swell.cs b/osu.Game.Rulesets.Taiko/Objects/Swell.cs index 702bf63bf5..67e2cae5eb 100644 --- a/osu.Game.Rulesets.Taiko/Objects/Swell.cs +++ b/osu.Game.Rulesets.Taiko/Objects/Swell.cs @@ -3,11 +3,15 @@ using System; using osu.Game.Rulesets.Objects.Types; +using osu.Game.Rulesets.Judgements; +using osu.Game.Rulesets.Taiko.Judgements; namespace osu.Game.Rulesets.Taiko.Objects { public class Swell : TaikoHitObject, IHasEndTime { + public override Judgement CreateJudgement() => new TaikoSwellJudgement(); + public double EndTime => StartTime + Duration; public double Duration { get; set; } diff --git a/osu.Game.Rulesets.Taiko/Objects/SwellTick.cs b/osu.Game.Rulesets.Taiko/Objects/SwellTick.cs index 49eb6d2a15..38f77fa1e7 100644 --- a/osu.Game.Rulesets.Taiko/Objects/SwellTick.cs +++ b/osu.Game.Rulesets.Taiko/Objects/SwellTick.cs @@ -1,9 +1,13 @@ // Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE +using osu.Game.Rulesets.Judgements; +using osu.Game.Rulesets.Taiko.Judgements; + namespace osu.Game.Rulesets.Taiko.Objects { public class SwellTick : TaikoHitObject { + public override Judgement CreateJudgement() => new TaikoSwellTickJudgement(); } } diff --git a/osu.Game.Rulesets.Taiko/Scoring/TaikoScoreProcessor.cs b/osu.Game.Rulesets.Taiko/Scoring/TaikoScoreProcessor.cs index a2a0251860..06d207695f 100644 --- a/osu.Game.Rulesets.Taiko/Scoring/TaikoScoreProcessor.cs +++ b/osu.Game.Rulesets.Taiko/Scoring/TaikoScoreProcessor.cs @@ -79,27 +79,15 @@ namespace osu.Game.Rulesets.Taiko.Scoring protected override void ApplyResult(JudgementResult result) { base.ApplyResult(result); + + if (!((TaikoJudgement)result.Judgement).AffectsHP) + return; - bool isRoll = false; - bool isStrong = false; + bool isSwell = false; bool isTick = result.Judgement is TaikoDrumRollTickJudgement; - if (!isTick) - { - isRoll = result.Judgement is TaikoDrumRollJudgement; - if (!isRoll) - { - isStrong = result.Judgement is TaikoStrongJudgement; - } - } - - //Don't change HP based on drum roll fullness for compatibility - if (isRoll) - return; - - //If the object is strong, HP change is already handled in MainObject - if (isStrong) - return; + if(!isTick) + isSwell = result.Judgement is TaikoSwellJudgement; // Apply HP changes switch (result.Type) @@ -110,12 +98,14 @@ namespace osu.Game.Rulesets.Taiko.Scoring Health.Value += hpIncreaseMiss; break; case HitResult.Good: - Health.Value += hpIncreaseGood; + // Swells shouldn't increase HP + if (!isSwell) + Health.Value += hpIncreaseGood; break; case HitResult.Great: if (isTick) Health.Value += hpIncreaseTick; - else + else if(!isSwell) Health.Value += hpIncreaseGreat; break; } From d30ab4f77cdc7a6b0e105438733dde02b0e1a613 Mon Sep 17 00:00:00 2001 From: Ivan Pavluk Date: Thu, 29 Nov 2018 22:12:01 +0700 Subject: [PATCH 07/35] fixed whitespace --- osu.Game.Rulesets.Taiko/Scoring/TaikoScoreProcessor.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game.Rulesets.Taiko/Scoring/TaikoScoreProcessor.cs b/osu.Game.Rulesets.Taiko/Scoring/TaikoScoreProcessor.cs index 06d207695f..7569edbdb7 100644 --- a/osu.Game.Rulesets.Taiko/Scoring/TaikoScoreProcessor.cs +++ b/osu.Game.Rulesets.Taiko/Scoring/TaikoScoreProcessor.cs @@ -79,7 +79,7 @@ namespace osu.Game.Rulesets.Taiko.Scoring protected override void ApplyResult(JudgementResult result) { base.ApplyResult(result); - + if (!((TaikoJudgement)result.Judgement).AffectsHP) return; From 13a166a6453714251c920513748cf88440627dc1 Mon Sep 17 00:00:00 2001 From: Ivan Pavluk Date: Thu, 29 Nov 2018 22:26:23 +0700 Subject: [PATCH 08/35] rename TaikoJudgement.AffectsHP to AffectsHp --- osu.Game.Rulesets.Taiko/Judgements/TaikoDrumRollJudgement.cs | 2 +- osu.Game.Rulesets.Taiko/Judgements/TaikoJudgement.cs | 2 +- osu.Game.Rulesets.Taiko/Judgements/TaikoStrongJudgement.cs | 2 +- osu.Game.Rulesets.Taiko/Judgements/TaikoSwellTickJudgement.cs | 2 +- osu.Game.Rulesets.Taiko/Scoring/TaikoScoreProcessor.cs | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/osu.Game.Rulesets.Taiko/Judgements/TaikoDrumRollJudgement.cs b/osu.Game.Rulesets.Taiko/Judgements/TaikoDrumRollJudgement.cs index 4663d00bdc..ca81b13053 100644 --- a/osu.Game.Rulesets.Taiko/Judgements/TaikoDrumRollJudgement.cs +++ b/osu.Game.Rulesets.Taiko/Judgements/TaikoDrumRollJudgement.cs @@ -9,7 +9,7 @@ namespace osu.Game.Rulesets.Taiko.Judgements { public override bool AffectsCombo => false; - public override bool AffectsHP => false; + public override bool AffectsHp => false; protected override int NumericResultFor(HitResult result) => 0; } diff --git a/osu.Game.Rulesets.Taiko/Judgements/TaikoJudgement.cs b/osu.Game.Rulesets.Taiko/Judgements/TaikoJudgement.cs index 386495bf1b..f4dd90e93b 100644 --- a/osu.Game.Rulesets.Taiko/Judgements/TaikoJudgement.cs +++ b/osu.Game.Rulesets.Taiko/Judgements/TaikoJudgement.cs @@ -13,7 +13,7 @@ namespace osu.Game.Rulesets.Taiko.Judgements /// /// Whether this should affect user's hitpoints. /// - public virtual bool AffectsHP => true; + public virtual bool AffectsHp => true; /// /// Computes the numeric result value for the combo portion of the score. diff --git a/osu.Game.Rulesets.Taiko/Judgements/TaikoStrongJudgement.cs b/osu.Game.Rulesets.Taiko/Judgements/TaikoStrongJudgement.cs index 2665540d07..67b113e795 100644 --- a/osu.Game.Rulesets.Taiko/Judgements/TaikoStrongJudgement.cs +++ b/osu.Game.Rulesets.Taiko/Judgements/TaikoStrongJudgement.cs @@ -6,7 +6,7 @@ namespace osu.Game.Rulesets.Taiko.Judgements public class TaikoStrongJudgement : TaikoJudgement { // MainObject already changes the HP - public override bool AffectsHP => false; + public override bool AffectsHp => false; public override bool AffectsCombo => false; } diff --git a/osu.Game.Rulesets.Taiko/Judgements/TaikoSwellTickJudgement.cs b/osu.Game.Rulesets.Taiko/Judgements/TaikoSwellTickJudgement.cs index 8dd03796ea..8a9a023c22 100644 --- a/osu.Game.Rulesets.Taiko/Judgements/TaikoSwellTickJudgement.cs +++ b/osu.Game.Rulesets.Taiko/Judgements/TaikoSwellTickJudgement.cs @@ -9,7 +9,7 @@ namespace osu.Game.Rulesets.Taiko.Judgements { public override bool AffectsCombo => false; - public override bool AffectsHP => false; + public override bool AffectsHp => false; protected override int NumericResultFor(HitResult result) { diff --git a/osu.Game.Rulesets.Taiko/Scoring/TaikoScoreProcessor.cs b/osu.Game.Rulesets.Taiko/Scoring/TaikoScoreProcessor.cs index 7569edbdb7..064a7d519b 100644 --- a/osu.Game.Rulesets.Taiko/Scoring/TaikoScoreProcessor.cs +++ b/osu.Game.Rulesets.Taiko/Scoring/TaikoScoreProcessor.cs @@ -80,7 +80,7 @@ namespace osu.Game.Rulesets.Taiko.Scoring { base.ApplyResult(result); - if (!((TaikoJudgement)result.Judgement).AffectsHP) + if (!((TaikoJudgement)result.Judgement).AffectsHp) return; bool isSwell = false; From 4184f1770939fe303d43ad2aa8a1f4d73744e986 Mon Sep 17 00:00:00 2001 From: Ivan Pavluk Date: Thu, 29 Nov 2018 23:12:02 +0700 Subject: [PATCH 09/35] ...Revert AffectsHP->AffectsHp, add HP abbrev --- osu.Game.Rulesets.Taiko/Judgements/TaikoDrumRollJudgement.cs | 2 +- osu.Game.Rulesets.Taiko/Judgements/TaikoJudgement.cs | 2 +- osu.Game.Rulesets.Taiko/Judgements/TaikoStrongJudgement.cs | 2 +- osu.Game.Rulesets.Taiko/Judgements/TaikoSwellTickJudgement.cs | 2 +- osu.Game.Rulesets.Taiko/Scoring/TaikoScoreProcessor.cs | 2 +- osu.sln.DotSettings | 1 + 6 files changed, 6 insertions(+), 5 deletions(-) diff --git a/osu.Game.Rulesets.Taiko/Judgements/TaikoDrumRollJudgement.cs b/osu.Game.Rulesets.Taiko/Judgements/TaikoDrumRollJudgement.cs index ca81b13053..4663d00bdc 100644 --- a/osu.Game.Rulesets.Taiko/Judgements/TaikoDrumRollJudgement.cs +++ b/osu.Game.Rulesets.Taiko/Judgements/TaikoDrumRollJudgement.cs @@ -9,7 +9,7 @@ namespace osu.Game.Rulesets.Taiko.Judgements { public override bool AffectsCombo => false; - public override bool AffectsHp => false; + public override bool AffectsHP => false; protected override int NumericResultFor(HitResult result) => 0; } diff --git a/osu.Game.Rulesets.Taiko/Judgements/TaikoJudgement.cs b/osu.Game.Rulesets.Taiko/Judgements/TaikoJudgement.cs index f4dd90e93b..386495bf1b 100644 --- a/osu.Game.Rulesets.Taiko/Judgements/TaikoJudgement.cs +++ b/osu.Game.Rulesets.Taiko/Judgements/TaikoJudgement.cs @@ -13,7 +13,7 @@ namespace osu.Game.Rulesets.Taiko.Judgements /// /// Whether this should affect user's hitpoints. /// - public virtual bool AffectsHp => true; + public virtual bool AffectsHP => true; /// /// Computes the numeric result value for the combo portion of the score. diff --git a/osu.Game.Rulesets.Taiko/Judgements/TaikoStrongJudgement.cs b/osu.Game.Rulesets.Taiko/Judgements/TaikoStrongJudgement.cs index 67b113e795..2665540d07 100644 --- a/osu.Game.Rulesets.Taiko/Judgements/TaikoStrongJudgement.cs +++ b/osu.Game.Rulesets.Taiko/Judgements/TaikoStrongJudgement.cs @@ -6,7 +6,7 @@ namespace osu.Game.Rulesets.Taiko.Judgements public class TaikoStrongJudgement : TaikoJudgement { // MainObject already changes the HP - public override bool AffectsHp => false; + public override bool AffectsHP => false; public override bool AffectsCombo => false; } diff --git a/osu.Game.Rulesets.Taiko/Judgements/TaikoSwellTickJudgement.cs b/osu.Game.Rulesets.Taiko/Judgements/TaikoSwellTickJudgement.cs index 8a9a023c22..8dd03796ea 100644 --- a/osu.Game.Rulesets.Taiko/Judgements/TaikoSwellTickJudgement.cs +++ b/osu.Game.Rulesets.Taiko/Judgements/TaikoSwellTickJudgement.cs @@ -9,7 +9,7 @@ namespace osu.Game.Rulesets.Taiko.Judgements { public override bool AffectsCombo => false; - public override bool AffectsHp => false; + public override bool AffectsHP => false; protected override int NumericResultFor(HitResult result) { diff --git a/osu.Game.Rulesets.Taiko/Scoring/TaikoScoreProcessor.cs b/osu.Game.Rulesets.Taiko/Scoring/TaikoScoreProcessor.cs index 064a7d519b..7569edbdb7 100644 --- a/osu.Game.Rulesets.Taiko/Scoring/TaikoScoreProcessor.cs +++ b/osu.Game.Rulesets.Taiko/Scoring/TaikoScoreProcessor.cs @@ -80,7 +80,7 @@ namespace osu.Game.Rulesets.Taiko.Scoring { base.ApplyResult(result); - if (!((TaikoJudgement)result.Judgement).AffectsHp) + if (!((TaikoJudgement)result.Judgement).AffectsHP) return; bool isSwell = false; diff --git a/osu.sln.DotSettings b/osu.sln.DotSettings index d6882282e6..38288bc912 100644 --- a/osu.sln.DotSettings +++ b/osu.sln.DotSettings @@ -200,6 +200,7 @@ GL GLSL HID + HP HUD ID IP From 6b07d4581a68f4f933f657e7186eb682eb52fad8 Mon Sep 17 00:00:00 2001 From: Ivan Pavluk Date: Fri, 30 Nov 2018 01:07:15 +0700 Subject: [PATCH 10/35] Fixed too strong HP drain --- osu.Game.Rulesets.Taiko/Scoring/TaikoScoreProcessor.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game.Rulesets.Taiko/Scoring/TaikoScoreProcessor.cs b/osu.Game.Rulesets.Taiko/Scoring/TaikoScoreProcessor.cs index 7569edbdb7..46706e5977 100644 --- a/osu.Game.Rulesets.Taiko/Scoring/TaikoScoreProcessor.cs +++ b/osu.Game.Rulesets.Taiko/Scoring/TaikoScoreProcessor.cs @@ -38,7 +38,7 @@ namespace osu.Game.Rulesets.Taiko.Scoring /// The maximum HP deducted for a . /// This occurs when HP Drain = 10. /// - private const double hp_miss_max = -0.12; + private const double hp_miss_max = -0.012; /// /// The HP awarded for a hit. From 743598a1acfe9fea9bd30aaab81d197eaa4b8192 Mon Sep 17 00:00:00 2001 From: Ivan Pavluk Date: Fri, 30 Nov 2018 01:33:04 +0700 Subject: [PATCH 11/35] Decrease taiko swell HP drain --- .../Scoring/TaikoScoreProcessor.cs | 25 ++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/osu.Game.Rulesets.Taiko/Scoring/TaikoScoreProcessor.cs b/osu.Game.Rulesets.Taiko/Scoring/TaikoScoreProcessor.cs index 46706e5977..b791d889ee 100644 --- a/osu.Game.Rulesets.Taiko/Scoring/TaikoScoreProcessor.cs +++ b/osu.Game.Rulesets.Taiko/Scoring/TaikoScoreProcessor.cs @@ -40,6 +40,25 @@ namespace osu.Game.Rulesets.Taiko.Scoring /// private const double hp_miss_max = -0.012; + + /// + /// The minimum HP deducted for a swell . + /// This occurs when HP Drain = 0. + /// + private const double swell_hp_miss_min = -0.0012; + + /// + /// The median HP deducted for a swell . + /// This occurs when HP Drain = 5. + /// + private const double swell_hp_miss_mid = -0.0045; + + /// + /// The maximum HP deducted for a swell . + /// This occurs when HP Drain = 10. + /// + private const double swell_hp_miss_max = -0.0084; + /// /// The HP awarded for a hit. /// @@ -58,6 +77,7 @@ namespace osu.Game.Rulesets.Taiko.Scoring private double hpIncreaseGreat; private double hpIncreaseGood; private double hpIncreaseMiss; + private double hpIncreaseMissSwell; public TaikoScoreProcessor(RulesetContainer rulesetContainer) : base(rulesetContainer) @@ -74,6 +94,7 @@ namespace osu.Game.Rulesets.Taiko.Scoring hpIncreaseGreat = hpMultiplierNormal * hp_hit_great; hpIncreaseGood = hpMultiplierNormal * hp_hit_good; hpIncreaseMiss = BeatmapDifficulty.DifficultyRange(beatmap.BeatmapInfo.BaseDifficulty.DrainRate, hp_miss_min, hp_miss_mid, hp_miss_max); + hpIncreaseMissSwell = BeatmapDifficulty.DifficultyRange(beatmap.BeatmapInfo.BaseDifficulty.DrainRate, swell_hp_miss_min, swell_hp_miss_mid, swell_hp_miss_max); } protected override void ApplyResult(JudgementResult result) @@ -94,7 +115,9 @@ namespace osu.Game.Rulesets.Taiko.Scoring { case HitResult.Miss: // Missing ticks shouldn't drop HP - if (!isTick) + if (isSwell) + Health.Value += hpIncreaseMissSwell; + else if (!isTick) Health.Value += hpIncreaseMiss; break; case HitResult.Good: From 7d692939fc63e78f4787b552ff2cebc437b1659f Mon Sep 17 00:00:00 2001 From: Ivan Pavluk Date: Tue, 4 Dec 2018 21:20:44 +0700 Subject: [PATCH 12/35] Fixed being able to miss taiko objects by hitting them too early Revamped taiko HP system --- .../Judgements/TaikoDrumRollJudgement.cs | 4 +- .../Judgements/TaikoDrumRollTickJudgement.cs | 11 ++++ .../Judgements/TaikoJudgement.cs | 34 +++++++++--- .../Judgements/TaikoStrongJudgement.cs | 4 +- .../Judgements/TaikoSwellJudgement.cs | 11 +++- .../Judgements/TaikoSwellTickJudgement.cs | 13 +---- .../Objects/Drawables/DrawableHit.cs | 2 +- .../Scoring/TaikoScoreProcessor.cs | 53 +++++-------------- osu.sln.DotSettings | 1 - 9 files changed, 70 insertions(+), 63 deletions(-) diff --git a/osu.Game.Rulesets.Taiko/Judgements/TaikoDrumRollJudgement.cs b/osu.Game.Rulesets.Taiko/Judgements/TaikoDrumRollJudgement.cs index 4663d00bdc..e1a630e6b7 100644 --- a/osu.Game.Rulesets.Taiko/Judgements/TaikoDrumRollJudgement.cs +++ b/osu.Game.Rulesets.Taiko/Judgements/TaikoDrumRollJudgement.cs @@ -9,8 +9,8 @@ namespace osu.Game.Rulesets.Taiko.Judgements { public override bool AffectsCombo => false; - public override bool AffectsHP => false; - protected override int NumericResultFor(HitResult result) => 0; + + protected override double HealthIncreaseFor(HitResult result) => 0; } } diff --git a/osu.Game.Rulesets.Taiko/Judgements/TaikoDrumRollTickJudgement.cs b/osu.Game.Rulesets.Taiko/Judgements/TaikoDrumRollTickJudgement.cs index 446dd0d11b..b2adf45bab 100644 --- a/osu.Game.Rulesets.Taiko/Judgements/TaikoDrumRollTickJudgement.cs +++ b/osu.Game.Rulesets.Taiko/Judgements/TaikoDrumRollTickJudgement.cs @@ -19,5 +19,16 @@ namespace osu.Game.Rulesets.Taiko.Judgements return 200; } } + + protected override double HealthIncreaseFor(HitResult result) + { + switch(result) + { + default: + return 0; + case HitResult.Great: + return 0.0000003; + } + } } } diff --git a/osu.Game.Rulesets.Taiko/Judgements/TaikoJudgement.cs b/osu.Game.Rulesets.Taiko/Judgements/TaikoJudgement.cs index 386495bf1b..f43227ecca 100644 --- a/osu.Game.Rulesets.Taiko/Judgements/TaikoJudgement.cs +++ b/osu.Game.Rulesets.Taiko/Judgements/TaikoJudgement.cs @@ -9,12 +9,7 @@ namespace osu.Game.Rulesets.Taiko.Judgements public class TaikoJudgement : Judgement { public override HitResult MaxResult => HitResult.Great; - - /// - /// Whether this should affect user's hitpoints. - /// - public virtual bool AffectsHP => true; - + /// /// Computes the numeric result value for the combo portion of the score. /// @@ -32,5 +27,32 @@ namespace osu.Game.Rulesets.Taiko.Judgements return 300; } } + + /// + /// Retrieves the numeric health increase of a . + /// + /// The to find the numeric health increase for. + /// The numeric health increase of . + protected virtual double HealthIncreaseFor(HitResult result) + { + switch (result) + { + default: + return 0; + case HitResult.Miss: + return -1.0; + case HitResult.Good: + return 1.1; + case HitResult.Great: + return 3.0; + } + } + + /// + /// Retrieves the numeric health increase of a . + /// + /// The to find the numeric health increase for. + /// The numeric health increase of . + public double HealthIncreaseFor(JudgementResult result) => HealthIncreaseFor(result.Type); } } diff --git a/osu.Game.Rulesets.Taiko/Judgements/TaikoStrongJudgement.cs b/osu.Game.Rulesets.Taiko/Judgements/TaikoStrongJudgement.cs index 2665540d07..81dfaf4cc3 100644 --- a/osu.Game.Rulesets.Taiko/Judgements/TaikoStrongJudgement.cs +++ b/osu.Game.Rulesets.Taiko/Judgements/TaikoStrongJudgement.cs @@ -1,12 +1,14 @@ // Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE +using osu.Game.Rulesets.Scoring; + namespace osu.Game.Rulesets.Taiko.Judgements { public class TaikoStrongJudgement : TaikoJudgement { // MainObject already changes the HP - public override bool AffectsHP => false; + protected override double HealthIncreaseFor(HitResult result) => 0; public override bool AffectsCombo => false; } diff --git a/osu.Game.Rulesets.Taiko/Judgements/TaikoSwellJudgement.cs b/osu.Game.Rulesets.Taiko/Judgements/TaikoSwellJudgement.cs index b913f5d730..ca89d4d0e5 100644 --- a/osu.Game.Rulesets.Taiko/Judgements/TaikoSwellJudgement.cs +++ b/osu.Game.Rulesets.Taiko/Judgements/TaikoSwellJudgement.cs @@ -9,6 +9,15 @@ namespace osu.Game.Rulesets.Taiko.Judgements { public override bool AffectsCombo => false; - protected override int NumericResultFor(HitResult result) => 0; + protected override double HealthIncreaseFor(HitResult result) + { + switch(result) + { + default: + return 0; + case HitResult.Miss: + return -0.65; + } + } } } diff --git a/osu.Game.Rulesets.Taiko/Judgements/TaikoSwellTickJudgement.cs b/osu.Game.Rulesets.Taiko/Judgements/TaikoSwellTickJudgement.cs index 8dd03796ea..448c16dad6 100644 --- a/osu.Game.Rulesets.Taiko/Judgements/TaikoSwellTickJudgement.cs +++ b/osu.Game.Rulesets.Taiko/Judgements/TaikoSwellTickJudgement.cs @@ -9,17 +9,8 @@ namespace osu.Game.Rulesets.Taiko.Judgements { public override bool AffectsCombo => false; - public override bool AffectsHP => false; + protected override int NumericResultFor(HitResult result) => 0; - protected override int NumericResultFor(HitResult result) - { - switch (result) - { - default: - return 0; - case HitResult.Great: - return 300; - } - } + protected override double HealthIncreaseFor(HitResult result) => 0; } } diff --git a/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableHit.cs b/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableHit.cs index 48731388cb..8c19e64de6 100644 --- a/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableHit.cs +++ b/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableHit.cs @@ -42,7 +42,7 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables } var result = HitObject.HitWindows.ResultFor(timeOffset); - if (result == HitResult.None) + if (result <= HitResult.Miss) return; if (!validActionPressed) diff --git a/osu.Game.Rulesets.Taiko/Scoring/TaikoScoreProcessor.cs b/osu.Game.Rulesets.Taiko/Scoring/TaikoScoreProcessor.cs index b791d889ee..50989cef7c 100644 --- a/osu.Game.Rulesets.Taiko/Scoring/TaikoScoreProcessor.cs +++ b/osu.Game.Rulesets.Taiko/Scoring/TaikoScoreProcessor.cs @@ -73,11 +73,8 @@ namespace osu.Game.Rulesets.Taiko.Scoring /// protected override bool DefaultFailCondition => JudgedHits == MaxHits && Health.Value <= 0.5; - private double hpIncreaseTick; - private double hpIncreaseGreat; - private double hpIncreaseGood; - private double hpIncreaseMiss; - private double hpIncreaseMissSwell; + private double hpMultiplier; + private double hpMissMultiplier; public TaikoScoreProcessor(RulesetContainer rulesetContainer) : base(rulesetContainer) @@ -88,49 +85,25 @@ namespace osu.Game.Rulesets.Taiko.Scoring { base.ApplyBeatmap(beatmap); - double hpMultiplierNormal = 1 / (hp_hit_great * beatmap.HitObjects.FindAll(o => o is Hit).Count * BeatmapDifficulty.DifficultyRange(beatmap.BeatmapInfo.BaseDifficulty.DrainRate, 0.5, 0.75, 0.98)); + hpMultiplier = 0.01 / (hp_hit_great * beatmap.HitObjects.FindAll(o => o is Hit).Count * BeatmapDifficulty.DifficultyRange(beatmap.BeatmapInfo.BaseDifficulty.DrainRate, 0.5, 0.75, 0.98)); - hpIncreaseTick = hp_hit_tick; - hpIncreaseGreat = hpMultiplierNormal * hp_hit_great; - hpIncreaseGood = hpMultiplierNormal * hp_hit_good; - hpIncreaseMiss = BeatmapDifficulty.DifficultyRange(beatmap.BeatmapInfo.BaseDifficulty.DrainRate, hp_miss_min, hp_miss_mid, hp_miss_max); - hpIncreaseMissSwell = BeatmapDifficulty.DifficultyRange(beatmap.BeatmapInfo.BaseDifficulty.DrainRate, swell_hp_miss_min, swell_hp_miss_mid, swell_hp_miss_max); + hpMissMultiplier = BeatmapDifficulty.DifficultyRange(beatmap.BeatmapInfo.BaseDifficulty.DrainRate, 0.0018, 0.0075, 0.0120); } protected override void ApplyResult(JudgementResult result) { base.ApplyResult(result); - if (!((TaikoJudgement)result.Judgement).AffectsHP) - return; - - bool isSwell = false; - bool isTick = result.Judgement is TaikoDrumRollTickJudgement; - - if(!isTick) - isSwell = result.Judgement is TaikoSwellJudgement; - - // Apply HP changes - switch (result.Type) + if (result.Judgement is TaikoJudgement taikoJudgement) { - case HitResult.Miss: - // Missing ticks shouldn't drop HP - if (isSwell) - Health.Value += hpIncreaseMissSwell; - else if (!isTick) - Health.Value += hpIncreaseMiss; - break; - case HitResult.Good: - // Swells shouldn't increase HP - if (!isSwell) - Health.Value += hpIncreaseGood; - break; - case HitResult.Great: - if (isTick) - Health.Value += hpIncreaseTick; - else if(!isSwell) - Health.Value += hpIncreaseGreat; - break; + double hpIncrease = taikoJudgement.HealthIncreaseFor(result); + + if (result.Type == HitResult.Miss) + hpIncrease *= hpMissMultiplier; + else + hpIncrease *= hpMultiplier; + + Health.Value += hpIncrease; } } diff --git a/osu.sln.DotSettings b/osu.sln.DotSettings index 38288bc912..d6882282e6 100644 --- a/osu.sln.DotSettings +++ b/osu.sln.DotSettings @@ -200,7 +200,6 @@ GL GLSL HID - HP HUD ID IP From 1975e11fcc8b075044c3f03f1fd3d2bf949136d2 Mon Sep 17 00:00:00 2001 From: Ivan Pavluk Date: Tue, 4 Dec 2018 21:28:36 +0700 Subject: [PATCH 13/35] Yet Another Whitespace Fix --- osu.Game.Rulesets.Taiko/Judgements/TaikoJudgement.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game.Rulesets.Taiko/Judgements/TaikoJudgement.cs b/osu.Game.Rulesets.Taiko/Judgements/TaikoJudgement.cs index f43227ecca..244a00ffb9 100644 --- a/osu.Game.Rulesets.Taiko/Judgements/TaikoJudgement.cs +++ b/osu.Game.Rulesets.Taiko/Judgements/TaikoJudgement.cs @@ -9,7 +9,7 @@ namespace osu.Game.Rulesets.Taiko.Judgements public class TaikoJudgement : Judgement { public override HitResult MaxResult => HitResult.Great; - + /// /// Computes the numeric result value for the combo portion of the score. /// From f2b806d3033509adedddaf57a130969297f299d3 Mon Sep 17 00:00:00 2001 From: Ivan Pavluk Date: Tue, 4 Dec 2018 21:36:43 +0700 Subject: [PATCH 14/35] Remove swell miss HP from TaikoScoreProcessor --- .../Scoring/TaikoScoreProcessor.cs | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/osu.Game.Rulesets.Taiko/Scoring/TaikoScoreProcessor.cs b/osu.Game.Rulesets.Taiko/Scoring/TaikoScoreProcessor.cs index 50989cef7c..40e7f3e12e 100644 --- a/osu.Game.Rulesets.Taiko/Scoring/TaikoScoreProcessor.cs +++ b/osu.Game.Rulesets.Taiko/Scoring/TaikoScoreProcessor.cs @@ -41,24 +41,6 @@ namespace osu.Game.Rulesets.Taiko.Scoring private const double hp_miss_max = -0.012; - /// - /// The minimum HP deducted for a swell . - /// This occurs when HP Drain = 0. - /// - private const double swell_hp_miss_min = -0.0012; - - /// - /// The median HP deducted for a swell . - /// This occurs when HP Drain = 5. - /// - private const double swell_hp_miss_mid = -0.0045; - - /// - /// The maximum HP deducted for a swell . - /// This occurs when HP Drain = 10. - /// - private const double swell_hp_miss_max = -0.0084; - /// /// The HP awarded for a hit. /// From 6c38db04eed786f67ffc1048073267c5351500d7 Mon Sep 17 00:00:00 2001 From: Ivan Pavluk Date: Tue, 4 Dec 2018 21:48:22 +0700 Subject: [PATCH 15/35] Fix switch statement order in taiko judgements --- .../Judgements/TaikoDrumRollTickJudgement.cs | 4 ++-- osu.Game.Rulesets.Taiko/Judgements/TaikoJudgement.cs | 4 ++-- osu.Game.Rulesets.Taiko/Judgements/TaikoSwellJudgement.cs | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/osu.Game.Rulesets.Taiko/Judgements/TaikoDrumRollTickJudgement.cs b/osu.Game.Rulesets.Taiko/Judgements/TaikoDrumRollTickJudgement.cs index b2adf45bab..0ccc66877c 100644 --- a/osu.Game.Rulesets.Taiko/Judgements/TaikoDrumRollTickJudgement.cs +++ b/osu.Game.Rulesets.Taiko/Judgements/TaikoDrumRollTickJudgement.cs @@ -24,10 +24,10 @@ namespace osu.Game.Rulesets.Taiko.Judgements { switch(result) { - default: - return 0; case HitResult.Great: return 0.0000003; + default: + return 0; } } } diff --git a/osu.Game.Rulesets.Taiko/Judgements/TaikoJudgement.cs b/osu.Game.Rulesets.Taiko/Judgements/TaikoJudgement.cs index 244a00ffb9..c3b603746b 100644 --- a/osu.Game.Rulesets.Taiko/Judgements/TaikoJudgement.cs +++ b/osu.Game.Rulesets.Taiko/Judgements/TaikoJudgement.cs @@ -19,12 +19,12 @@ namespace osu.Game.Rulesets.Taiko.Judgements { switch (result) { - default: - return 0; case HitResult.Good: return 100; case HitResult.Great: return 300; + default: + return 0; } } diff --git a/osu.Game.Rulesets.Taiko/Judgements/TaikoSwellJudgement.cs b/osu.Game.Rulesets.Taiko/Judgements/TaikoSwellJudgement.cs index ca89d4d0e5..7c525bba6c 100644 --- a/osu.Game.Rulesets.Taiko/Judgements/TaikoSwellJudgement.cs +++ b/osu.Game.Rulesets.Taiko/Judgements/TaikoSwellJudgement.cs @@ -13,10 +13,10 @@ namespace osu.Game.Rulesets.Taiko.Judgements { switch(result) { - default: - return 0; case HitResult.Miss: return -0.65; + default: + return 0; } } } From 6d7e71c003f6efb9fc79e740d9723b115f819d2a Mon Sep 17 00:00:00 2001 From: Ivan Pavluk Date: Wed, 5 Dec 2018 16:28:36 +0700 Subject: [PATCH 16/35] Fix switch stetement order 2 --- .../Judgements/TaikoDrumRollTickJudgement.cs | 4 ++-- osu.Game.Rulesets.Taiko/Judgements/TaikoJudgement.cs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/osu.Game.Rulesets.Taiko/Judgements/TaikoDrumRollTickJudgement.cs b/osu.Game.Rulesets.Taiko/Judgements/TaikoDrumRollTickJudgement.cs index 0ccc66877c..c2675a7fac 100644 --- a/osu.Game.Rulesets.Taiko/Judgements/TaikoDrumRollTickJudgement.cs +++ b/osu.Game.Rulesets.Taiko/Judgements/TaikoDrumRollTickJudgement.cs @@ -13,10 +13,10 @@ namespace osu.Game.Rulesets.Taiko.Judgements { switch (result) { - default: - return 0; case HitResult.Great: return 200; + default: + return 0; } } diff --git a/osu.Game.Rulesets.Taiko/Judgements/TaikoJudgement.cs b/osu.Game.Rulesets.Taiko/Judgements/TaikoJudgement.cs index c3b603746b..bbdc14c6d4 100644 --- a/osu.Game.Rulesets.Taiko/Judgements/TaikoJudgement.cs +++ b/osu.Game.Rulesets.Taiko/Judgements/TaikoJudgement.cs @@ -37,14 +37,14 @@ namespace osu.Game.Rulesets.Taiko.Judgements { switch (result) { - default: - return 0; case HitResult.Miss: return -1.0; case HitResult.Good: return 1.1; case HitResult.Great: return 3.0; + default: + return 0; } } From b5277de3f4e5dfeb16bb7806b9a3c6b2350ad58a Mon Sep 17 00:00:00 2001 From: Ivan Pavluk Date: Thu, 6 Dec 2018 14:08:32 +0700 Subject: [PATCH 17/35] Remove extra newline --- osu.Game.Rulesets.Taiko/Scoring/TaikoScoreProcessor.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/osu.Game.Rulesets.Taiko/Scoring/TaikoScoreProcessor.cs b/osu.Game.Rulesets.Taiko/Scoring/TaikoScoreProcessor.cs index 40e7f3e12e..84f87bf10c 100644 --- a/osu.Game.Rulesets.Taiko/Scoring/TaikoScoreProcessor.cs +++ b/osu.Game.Rulesets.Taiko/Scoring/TaikoScoreProcessor.cs @@ -40,7 +40,6 @@ namespace osu.Game.Rulesets.Taiko.Scoring /// private const double hp_miss_max = -0.012; - /// /// The HP awarded for a hit. /// From 1b6658f4eefac3454ff49a6c3f2007285ceacbe2 Mon Sep 17 00:00:00 2001 From: Ivan Pavluk Date: Thu, 6 Dec 2018 15:09:42 +0700 Subject: [PATCH 18/35] Move HealthIncreaseFor to Judgement --- .../Judgements/CatchBananaJudgement.cs | 2 +- .../Judgements/CatchDropletJudgement.cs | 2 +- .../Judgements/CatchJudgement.cs | 9 +-------- .../Judgements/CatchTinyDropletJudgement.cs | 2 +- .../Judgements/TaikoDrumRollJudgement.cs | 14 +++++++++++--- .../Judgements/TaikoDrumRollTickJudgement.cs | 2 +- .../Judgements/TaikoJudgement.cs | 19 +------------------ osu.Game.Rulesets.Taiko/Objects/DrumRoll.cs | 4 ++-- osu.Game.Rulesets.Taiko/Objects/Swell.cs | 4 ++-- osu.Game/Rulesets/Judgements/Judgement.cs | 14 ++++++++++++++ 10 files changed, 35 insertions(+), 37 deletions(-) diff --git a/osu.Game.Rulesets.Catch/Judgements/CatchBananaJudgement.cs b/osu.Game.Rulesets.Catch/Judgements/CatchBananaJudgement.cs index f38009263f..d89d987f95 100644 --- a/osu.Game.Rulesets.Catch/Judgements/CatchBananaJudgement.cs +++ b/osu.Game.Rulesets.Catch/Judgements/CatchBananaJudgement.cs @@ -21,7 +21,7 @@ namespace osu.Game.Rulesets.Catch.Judgements } } - protected override float HealthIncreaseFor(HitResult result) + protected override double HealthIncreaseFor(HitResult result) { switch (result) { diff --git a/osu.Game.Rulesets.Catch/Judgements/CatchDropletJudgement.cs b/osu.Game.Rulesets.Catch/Judgements/CatchDropletJudgement.cs index 0df2305339..1fbf1db7f7 100644 --- a/osu.Game.Rulesets.Catch/Judgements/CatchDropletJudgement.cs +++ b/osu.Game.Rulesets.Catch/Judgements/CatchDropletJudgement.cs @@ -18,7 +18,7 @@ namespace osu.Game.Rulesets.Catch.Judgements } } - protected override float HealthIncreaseFor(HitResult result) + protected override double HealthIncreaseFor(HitResult result) { switch (result) { diff --git a/osu.Game.Rulesets.Catch/Judgements/CatchJudgement.cs b/osu.Game.Rulesets.Catch/Judgements/CatchJudgement.cs index 8a51867899..30ba868f6e 100644 --- a/osu.Game.Rulesets.Catch/Judgements/CatchJudgement.cs +++ b/osu.Game.Rulesets.Catch/Judgements/CatchJudgement.cs @@ -27,7 +27,7 @@ namespace osu.Game.Rulesets.Catch.Judgements /// /// The to find the numeric health increase for. /// The numeric health increase of . - protected virtual float HealthIncreaseFor(HitResult result) + protected override double HealthIncreaseFor(HitResult result) { switch (result) { @@ -38,13 +38,6 @@ namespace osu.Game.Rulesets.Catch.Judgements } } - /// - /// Retrieves the numeric health increase of a . - /// - /// The to find the numeric health increase for. - /// The numeric health increase of . - public float HealthIncreaseFor(JudgementResult result) => HealthIncreaseFor(result.Type); - /// /// Whether fruit on the platter should explode or drop. /// Note that this is only checked if the owning object is also diff --git a/osu.Game.Rulesets.Catch/Judgements/CatchTinyDropletJudgement.cs b/osu.Game.Rulesets.Catch/Judgements/CatchTinyDropletJudgement.cs index 8b77351027..fc933020d3 100644 --- a/osu.Game.Rulesets.Catch/Judgements/CatchTinyDropletJudgement.cs +++ b/osu.Game.Rulesets.Catch/Judgements/CatchTinyDropletJudgement.cs @@ -20,7 +20,7 @@ namespace osu.Game.Rulesets.Catch.Judgements } } - protected override float HealthIncreaseFor(HitResult result) + protected override double HealthIncreaseFor(HitResult result) { switch (result) { diff --git a/osu.Game.Rulesets.Taiko/Judgements/TaikoDrumRollJudgement.cs b/osu.Game.Rulesets.Taiko/Judgements/TaikoDrumRollJudgement.cs index e1a630e6b7..b3a64cd579 100644 --- a/osu.Game.Rulesets.Taiko/Judgements/TaikoDrumRollJudgement.cs +++ b/osu.Game.Rulesets.Taiko/Judgements/TaikoDrumRollJudgement.cs @@ -9,8 +9,16 @@ namespace osu.Game.Rulesets.Taiko.Judgements { public override bool AffectsCombo => false; - protected override int NumericResultFor(HitResult result) => 0; - - protected override double HealthIncreaseFor(HitResult result) => 0; + protected override double HealthIncreaseFor(HitResult result) + { + //Drum rolls can be ignored with no health penalty + switch (result) + { + case HitResult.Miss: + return 0; + default: + return base.HealthIncreaseFor(result); + } + } } } diff --git a/osu.Game.Rulesets.Taiko/Judgements/TaikoDrumRollTickJudgement.cs b/osu.Game.Rulesets.Taiko/Judgements/TaikoDrumRollTickJudgement.cs index c2675a7fac..86b495ca08 100644 --- a/osu.Game.Rulesets.Taiko/Judgements/TaikoDrumRollTickJudgement.cs +++ b/osu.Game.Rulesets.Taiko/Judgements/TaikoDrumRollTickJudgement.cs @@ -25,7 +25,7 @@ namespace osu.Game.Rulesets.Taiko.Judgements switch(result) { case HitResult.Great: - return 0.0000003; + return 0.15; default: return 0; } diff --git a/osu.Game.Rulesets.Taiko/Judgements/TaikoJudgement.cs b/osu.Game.Rulesets.Taiko/Judgements/TaikoJudgement.cs index bbdc14c6d4..4f397cda09 100644 --- a/osu.Game.Rulesets.Taiko/Judgements/TaikoJudgement.cs +++ b/osu.Game.Rulesets.Taiko/Judgements/TaikoJudgement.cs @@ -10,11 +10,6 @@ namespace osu.Game.Rulesets.Taiko.Judgements { public override HitResult MaxResult => HitResult.Great; - /// - /// Computes the numeric result value for the combo portion of the score. - /// - /// The result to compute the value for. - /// The numeric result value. protected override int NumericResultFor(HitResult result) { switch (result) @@ -28,12 +23,7 @@ namespace osu.Game.Rulesets.Taiko.Judgements } } - /// - /// Retrieves the numeric health increase of a . - /// - /// The to find the numeric health increase for. - /// The numeric health increase of . - protected virtual double HealthIncreaseFor(HitResult result) + protected override double HealthIncreaseFor(HitResult result) { switch (result) { @@ -47,12 +37,5 @@ namespace osu.Game.Rulesets.Taiko.Judgements return 0; } } - - /// - /// Retrieves the numeric health increase of a . - /// - /// The to find the numeric health increase for. - /// The numeric health increase of . - public double HealthIncreaseFor(JudgementResult result) => HealthIncreaseFor(result.Type); } } diff --git a/osu.Game.Rulesets.Taiko/Objects/DrumRoll.cs b/osu.Game.Rulesets.Taiko/Objects/DrumRoll.cs index 0dc460643a..89d0512e9c 100644 --- a/osu.Game.Rulesets.Taiko/Objects/DrumRoll.cs +++ b/osu.Game.Rulesets.Taiko/Objects/DrumRoll.cs @@ -12,8 +12,6 @@ namespace osu.Game.Rulesets.Taiko.Objects { public class DrumRoll : TaikoHitObject, IHasEndTime { - public override Judgement CreateJudgement() => new TaikoDrumRollJudgement(); - /// /// Drum roll distance that results in a duration of 1 speed-adjusted beat length. /// @@ -85,5 +83,7 @@ namespace osu.Game.Rulesets.Taiko.Objects first = false; } } + + public override Judgement CreateJudgement() => new TaikoDrumRollJudgement(); } } diff --git a/osu.Game.Rulesets.Taiko/Objects/Swell.cs b/osu.Game.Rulesets.Taiko/Objects/Swell.cs index 67e2cae5eb..68433429c6 100644 --- a/osu.Game.Rulesets.Taiko/Objects/Swell.cs +++ b/osu.Game.Rulesets.Taiko/Objects/Swell.cs @@ -10,8 +10,6 @@ namespace osu.Game.Rulesets.Taiko.Objects { public class Swell : TaikoHitObject, IHasEndTime { - public override Judgement CreateJudgement() => new TaikoSwellJudgement(); - public double EndTime => StartTime + Duration; public double Duration { get; set; } @@ -30,5 +28,7 @@ namespace osu.Game.Rulesets.Taiko.Objects for (int i = 0; i < RequiredHits; i++) AddNested(new SwellTick()); } + + public override Judgement CreateJudgement() => new TaikoSwellJudgement(); } } diff --git a/osu.Game/Rulesets/Judgements/Judgement.cs b/osu.Game/Rulesets/Judgements/Judgement.cs index c679df5900..86a41a08ff 100644 --- a/osu.Game/Rulesets/Judgements/Judgement.cs +++ b/osu.Game/Rulesets/Judgements/Judgement.cs @@ -44,5 +44,19 @@ namespace osu.Game.Rulesets.Judgements /// The to find the numeric score representation for. /// The numeric score representation of . public int NumericResultFor(JudgementResult result) => NumericResultFor(result.Type); + + /// + /// Retrieves the numeric health increase of a . + /// + /// The to find the numeric health increase for. + /// The numeric health increase of . + protected virtual double HealthIncreaseFor(HitResult result) => 0; + + /// + /// Retrieves the numeric health increase of a . + /// + /// The to find the numeric health increase for. + /// The numeric health increase of . + public double HealthIncreaseFor(JudgementResult result) => HealthIncreaseFor(result.Type); } } From 8cae549541ee4f3d53c6cd1bdd7279c247844230 Mon Sep 17 00:00:00 2001 From: Ivan Pavluk Date: Thu, 6 Dec 2018 15:58:03 +0700 Subject: [PATCH 19/35] Remove unused TaikoScoreProcessor constants --- .../Scoring/TaikoScoreProcessor.cs | 32 ------------------- 1 file changed, 32 deletions(-) diff --git a/osu.Game.Rulesets.Taiko/Scoring/TaikoScoreProcessor.cs b/osu.Game.Rulesets.Taiko/Scoring/TaikoScoreProcessor.cs index 84f87bf10c..721d435780 100644 --- a/osu.Game.Rulesets.Taiko/Scoring/TaikoScoreProcessor.cs +++ b/osu.Game.Rulesets.Taiko/Scoring/TaikoScoreProcessor.cs @@ -17,38 +17,6 @@ namespace osu.Game.Rulesets.Taiko.Scoring /// private const double hp_hit_great = 0.03; - /// - /// The HP awarded for a hit. - /// - private const double hp_hit_good = 0.011; - - /// - /// The minimum HP deducted for a . - /// This occurs when HP Drain = 0. - /// - private const double hp_miss_min = -0.0018; - - /// - /// The median HP deducted for a . - /// This occurs when HP Drain = 5. - /// - private const double hp_miss_mid = -0.0075; - - /// - /// The maximum HP deducted for a . - /// This occurs when HP Drain = 10. - /// - private const double hp_miss_max = -0.012; - - /// - /// The HP awarded for a hit. - /// - /// hits award less HP as they're more spammable, although in hindsight - /// this probably awards too little HP and is kept at this value for now for compatibility. - /// - /// - private const double hp_hit_tick = 0.00000003; - /// /// Taiko fails at the end of the map if the player has not half-filled their HP bar. /// From cb2444e01cd34e16d4e196581bc99698a4208c17 Mon Sep 17 00:00:00 2001 From: Ivan Pavluk Date: Thu, 6 Dec 2018 19:04:54 +0700 Subject: [PATCH 20/35] Remove Meh from TaikoHitWindows --- .../Objects/ManiaHitWindows.cs | 5 +-- .../Objects/Drawables/DrawableHit.cs | 6 +-- .../Objects/TaikoHitWindows.cs | 19 +++++++-- osu.Game/Rulesets/Objects/HitWindows.cs | 42 ++++++++++--------- 4 files changed, 43 insertions(+), 29 deletions(-) diff --git a/osu.Game.Rulesets.Mania/Objects/ManiaHitWindows.cs b/osu.Game.Rulesets.Mania/Objects/ManiaHitWindows.cs index 063b626af1..ad0c04b4cc 100644 --- a/osu.Game.Rulesets.Mania/Objects/ManiaHitWindows.cs +++ b/osu.Game.Rulesets.Mania/Objects/ManiaHitWindows.cs @@ -20,11 +20,10 @@ namespace osu.Game.Rulesets.Mania.Objects { HitResult.Miss, (376, 346, 316) }, }; + public override bool IsHitResultAllowed(HitResult result) => true; + public override void SetDifficulty(double difficulty) { - AllowsPerfect = true; - AllowsOk = true; - Perfect = BeatmapDifficulty.DifficultyRange(difficulty, base_ranges[HitResult.Perfect]); Great = BeatmapDifficulty.DifficultyRange(difficulty, base_ranges[HitResult.Great]); Good = BeatmapDifficulty.DifficultyRange(difficulty, base_ranges[HitResult.Good]); diff --git a/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableHit.cs b/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableHit.cs index 8c19e64de6..d4f0360b40 100644 --- a/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableHit.cs +++ b/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableHit.cs @@ -42,7 +42,7 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables } var result = HitObject.HitWindows.ResultFor(timeOffset); - if (result <= HitResult.Miss) + if (result == HitResult.None) return; if (!validActionPressed) @@ -173,12 +173,12 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables if (!userTriggered) { - if (timeOffset > second_hit_window) + if (timeOffset - MainObject.Result.TimeOffset > second_hit_window) ApplyResult(r => r.Type = HitResult.Miss); return; } - if (Math.Abs(MainObject.Result.TimeOffset - timeOffset) < second_hit_window) + if (Math.Abs(timeOffset - MainObject.Result.TimeOffset) <= second_hit_window) ApplyResult(r => r.Type = MainObject.Result.Type); } diff --git a/osu.Game.Rulesets.Taiko/Objects/TaikoHitWindows.cs b/osu.Game.Rulesets.Taiko/Objects/TaikoHitWindows.cs index 289f084a45..722a327f45 100644 --- a/osu.Game.Rulesets.Taiko/Objects/TaikoHitWindows.cs +++ b/osu.Game.Rulesets.Taiko/Objects/TaikoHitWindows.cs @@ -14,15 +14,28 @@ namespace osu.Game.Rulesets.Taiko.Objects { { HitResult.Great, (100, 70, 40) }, { HitResult.Good, (240, 160, 100) }, - { HitResult.Meh, (270, 190, 140) }, - { HitResult.Miss, (400, 400, 400) }, + { HitResult.Miss, (270, 190, 140) }, }; + protected override double SuccessfulHitWindow => Good; + + public override bool IsHitResultAllowed(HitResult result) + { + switch (result) + { + case HitResult.Great: + case HitResult.Good: + case HitResult.Miss: + return true; + default: + return false; + } + } + public override void SetDifficulty(double difficulty) { Great = BeatmapDifficulty.DifficultyRange(difficulty, base_ranges[HitResult.Great]); Good = BeatmapDifficulty.DifficultyRange(difficulty, base_ranges[HitResult.Good]); - Meh = BeatmapDifficulty.DifficultyRange(difficulty, base_ranges[HitResult.Meh]); Miss = BeatmapDifficulty.DifficultyRange(difficulty, base_ranges[HitResult.Miss]); } } diff --git a/osu.Game/Rulesets/Objects/HitWindows.cs b/osu.Game/Rulesets/Objects/HitWindows.cs index 3717209860..621fb418eb 100644 --- a/osu.Game/Rulesets/Objects/HitWindows.cs +++ b/osu.Game/Rulesets/Objects/HitWindows.cs @@ -22,7 +22,6 @@ namespace osu.Game.Rulesets.Objects /// /// Hit window for a result. - /// The user can only achieve receive this result if is true. /// public double Perfect { get; protected set; } @@ -38,7 +37,6 @@ namespace osu.Game.Rulesets.Objects /// /// Hit window for an result. - /// The user can only achieve this result if is true. /// public double Ok { get; protected set; } @@ -53,14 +51,25 @@ namespace osu.Game.Rulesets.Objects public double Miss { get; protected set; } /// - /// Whether it's possible to achieve a result. + /// Hit window for a non- result. /// - public bool AllowsPerfect; + protected virtual double SuccessfulHitWindow => Meh; /// - /// Whether it's possible to achieve a result. + /// Whether it's possible to achieve this . /// - public bool AllowsOk; + /// The result. + public virtual bool IsHitResultAllowed(HitResult result) + { + switch(result) + { + case HitResult.Perfect: + case HitResult.Ok: + return false; + default: + return true; + } + } /// /// Sets hit windows with values that correspond to a difficulty parameter. @@ -85,18 +94,11 @@ namespace osu.Game.Rulesets.Objects { timeOffset = Math.Abs(timeOffset); - if (AllowsPerfect && timeOffset <= HalfWindowFor(HitResult.Perfect)) - return HitResult.Perfect; - if (timeOffset <= HalfWindowFor(HitResult.Great)) - return HitResult.Great; - if (timeOffset <= HalfWindowFor(HitResult.Good)) - return HitResult.Good; - if (AllowsOk && timeOffset <= HalfWindowFor(HitResult.Ok)) - return HitResult.Ok; - if (timeOffset <= HalfWindowFor(HitResult.Meh)) - return HitResult.Meh; - if (timeOffset <= HalfWindowFor(HitResult.Miss)) - return HitResult.Miss; + for(var result = HitResult.Perfect; result >= HitResult.Miss; --result) + { + if(IsHitResultAllowed(result) && timeOffset <= HalfWindowFor(result)) + return result; + } return HitResult.None; } @@ -130,10 +132,10 @@ namespace osu.Game.Rulesets.Objects /// /// Given a time offset, whether the can ever be hit in the future with a non- result. - /// This happens if is less than what is required for a result. + /// This happens if is less than what is required for a result. /// /// The time offset. /// Whether the can be hit at any point in the future from this time offset. - public bool CanBeHit(double timeOffset) => timeOffset <= HalfWindowFor(HitResult.Meh); + public bool CanBeHit(double timeOffset) => timeOffset <= SuccessfulHitWindow / 2; } } From aa79758db5250ff63b7b398260649aabefa62fb1 Mon Sep 17 00:00:00 2001 From: Ivan Pavluk Date: Thu, 6 Dec 2018 19:15:41 +0700 Subject: [PATCH 21/35] Remove unnecessary float literal --- osu.Game.Rulesets.Catch/Judgements/CatchJudgement.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game.Rulesets.Catch/Judgements/CatchJudgement.cs b/osu.Game.Rulesets.Catch/Judgements/CatchJudgement.cs index 30ba868f6e..a266dfa691 100644 --- a/osu.Game.Rulesets.Catch/Judgements/CatchJudgement.cs +++ b/osu.Game.Rulesets.Catch/Judgements/CatchJudgement.cs @@ -34,7 +34,7 @@ namespace osu.Game.Rulesets.Catch.Judgements default: return 0; case HitResult.Perfect: - return 10.2f; + return 10.2; } } From 407f9d2e78dcf29a784e623059c9a417595bd9c7 Mon Sep 17 00:00:00 2001 From: Ivan Pavluk Date: Thu, 6 Dec 2018 19:33:42 +0700 Subject: [PATCH 22/35] Comment cleanup --- osu.Game.Rulesets.Catch/Judgements/CatchJudgement.cs | 5 ----- osu.Game.Rulesets.Taiko/Judgements/TaikoDrumRollJudgement.cs | 2 +- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/osu.Game.Rulesets.Catch/Judgements/CatchJudgement.cs b/osu.Game.Rulesets.Catch/Judgements/CatchJudgement.cs index a266dfa691..b20bc43886 100644 --- a/osu.Game.Rulesets.Catch/Judgements/CatchJudgement.cs +++ b/osu.Game.Rulesets.Catch/Judgements/CatchJudgement.cs @@ -22,11 +22,6 @@ namespace osu.Game.Rulesets.Catch.Judgements } } - /// - /// Retrieves the numeric health increase of a . - /// - /// The to find the numeric health increase for. - /// The numeric health increase of . protected override double HealthIncreaseFor(HitResult result) { switch (result) diff --git a/osu.Game.Rulesets.Taiko/Judgements/TaikoDrumRollJudgement.cs b/osu.Game.Rulesets.Taiko/Judgements/TaikoDrumRollJudgement.cs index b3a64cd579..8c88d6d073 100644 --- a/osu.Game.Rulesets.Taiko/Judgements/TaikoDrumRollJudgement.cs +++ b/osu.Game.Rulesets.Taiko/Judgements/TaikoDrumRollJudgement.cs @@ -11,7 +11,7 @@ namespace osu.Game.Rulesets.Taiko.Judgements protected override double HealthIncreaseFor(HitResult result) { - //Drum rolls can be ignored with no health penalty + // Drum rolls can be ignored with no health penalty switch (result) { case HitResult.Miss: From 394c038c33b7120adca8d621c6ada2ec66309b1a Mon Sep 17 00:00:00 2001 From: Ivan Pavluk Date: Thu, 6 Dec 2018 19:52:16 +0700 Subject: [PATCH 23/35] Removed unnecessary JudgementResult casts --- .../Scoring/CatchScoreProcessor.cs | 3 +-- .../Scoring/TaikoScoreProcessor.cs | 15 ++++++--------- 2 files changed, 7 insertions(+), 11 deletions(-) diff --git a/osu.Game.Rulesets.Catch/Scoring/CatchScoreProcessor.cs b/osu.Game.Rulesets.Catch/Scoring/CatchScoreProcessor.cs index 403cedde8c..d33b2ae8d3 100644 --- a/osu.Game.Rulesets.Catch/Scoring/CatchScoreProcessor.cs +++ b/osu.Game.Rulesets.Catch/Scoring/CatchScoreProcessor.cs @@ -40,8 +40,7 @@ namespace osu.Game.Rulesets.Catch.Scoring return; } - if (result.Judgement is CatchJudgement catchJudgement) - Health.Value += Math.Max(catchJudgement.HealthIncreaseFor(result) - hpDrainRate, 0) * harshness; + Health.Value += Math.Max(result.Judgement.HealthIncreaseFor(result) - hpDrainRate, 0) * harshness; } } } diff --git a/osu.Game.Rulesets.Taiko/Scoring/TaikoScoreProcessor.cs b/osu.Game.Rulesets.Taiko/Scoring/TaikoScoreProcessor.cs index 721d435780..9233ab8eb7 100644 --- a/osu.Game.Rulesets.Taiko/Scoring/TaikoScoreProcessor.cs +++ b/osu.Game.Rulesets.Taiko/Scoring/TaikoScoreProcessor.cs @@ -43,17 +43,14 @@ namespace osu.Game.Rulesets.Taiko.Scoring { base.ApplyResult(result); - if (result.Judgement is TaikoJudgement taikoJudgement) - { - double hpIncrease = taikoJudgement.HealthIncreaseFor(result); + double hpIncrease = result.Judgement.HealthIncreaseFor(result); - if (result.Type == HitResult.Miss) - hpIncrease *= hpMissMultiplier; - else - hpIncrease *= hpMultiplier; + if (result.Type == HitResult.Miss) + hpIncrease *= hpMissMultiplier; + else + hpIncrease *= hpMultiplier; - Health.Value += hpIncrease; - } + Health.Value += hpIncrease; } protected override void Reset(bool storeResults) From 94f01b6678096c85630225acbcb60096c878fe05 Mon Sep 17 00:00:00 2001 From: Ivan Pavluk Date: Thu, 6 Dec 2018 20:05:03 +0700 Subject: [PATCH 24/35] Remove unused using directives --- osu.Game.Rulesets.Catch/Scoring/CatchScoreProcessor.cs | 1 - osu.Game.Rulesets.Taiko/Scoring/TaikoScoreProcessor.cs | 1 - 2 files changed, 2 deletions(-) diff --git a/osu.Game.Rulesets.Catch/Scoring/CatchScoreProcessor.cs b/osu.Game.Rulesets.Catch/Scoring/CatchScoreProcessor.cs index d33b2ae8d3..778d972b52 100644 --- a/osu.Game.Rulesets.Catch/Scoring/CatchScoreProcessor.cs +++ b/osu.Game.Rulesets.Catch/Scoring/CatchScoreProcessor.cs @@ -3,7 +3,6 @@ using System; using osu.Game.Beatmaps; -using osu.Game.Rulesets.Catch.Judgements; using osu.Game.Rulesets.Catch.Objects; using osu.Game.Rulesets.Judgements; using osu.Game.Rulesets.Scoring; diff --git a/osu.Game.Rulesets.Taiko/Scoring/TaikoScoreProcessor.cs b/osu.Game.Rulesets.Taiko/Scoring/TaikoScoreProcessor.cs index 9233ab8eb7..058d2b4beb 100644 --- a/osu.Game.Rulesets.Taiko/Scoring/TaikoScoreProcessor.cs +++ b/osu.Game.Rulesets.Taiko/Scoring/TaikoScoreProcessor.cs @@ -4,7 +4,6 @@ using osu.Game.Beatmaps; using osu.Game.Rulesets.Judgements; using osu.Game.Rulesets.Scoring; -using osu.Game.Rulesets.Taiko.Judgements; using osu.Game.Rulesets.Taiko.Objects; using osu.Game.Rulesets.UI; From 784a114eae0b117c2daacf2081ba4ebdf34c6379 Mon Sep 17 00:00:00 2001 From: Dan Balasescu <1329837+smoogipoo@users.noreply.github.com> Date: Sun, 9 Dec 2018 23:38:19 +0700 Subject: [PATCH 25/35] formatting fix Co-Authored-By: pavlukivan --- osu.Game/Rulesets/Objects/HitWindows.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Rulesets/Objects/HitWindows.cs b/osu.Game/Rulesets/Objects/HitWindows.cs index 621fb418eb..76d6579fc6 100644 --- a/osu.Game/Rulesets/Objects/HitWindows.cs +++ b/osu.Game/Rulesets/Objects/HitWindows.cs @@ -94,7 +94,7 @@ namespace osu.Game.Rulesets.Objects { timeOffset = Math.Abs(timeOffset); - for(var result = HitResult.Perfect; result >= HitResult.Miss; --result) + for (var result = HitResult.Perfect; result >= HitResult.Miss; --result) { if(IsHitResultAllowed(result) && timeOffset <= HalfWindowFor(result)) return result; From 77a544e475360e72446d97c9f7b5a74678eb3906 Mon Sep 17 00:00:00 2001 From: Dan Balasescu <1329837+smoogipoo@users.noreply.github.com> Date: Sun, 9 Dec 2018 23:38:29 +0700 Subject: [PATCH 26/35] formatting fix Co-Authored-By: pavlukivan --- osu.Game/Rulesets/Objects/HitWindows.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Rulesets/Objects/HitWindows.cs b/osu.Game/Rulesets/Objects/HitWindows.cs index 76d6579fc6..319bfdec65 100644 --- a/osu.Game/Rulesets/Objects/HitWindows.cs +++ b/osu.Game/Rulesets/Objects/HitWindows.cs @@ -96,7 +96,7 @@ namespace osu.Game.Rulesets.Objects for (var result = HitResult.Perfect; result >= HitResult.Miss; --result) { - if(IsHitResultAllowed(result) && timeOffset <= HalfWindowFor(result)) + if (IsHitResultAllowed(result) && timeOffset <= HalfWindowFor(result)) return result; } From 8457324044641bde7650f125f8fd018f508ec2a9 Mon Sep 17 00:00:00 2001 From: Ivan Pavluk Date: Mon, 10 Dec 2018 09:04:12 +0700 Subject: [PATCH 27/35] SuccessfulHitWindow->SuccessfulHitResult --- osu.Game.Rulesets.Taiko/Objects/TaikoHitWindows.cs | 2 +- .../Scoring/TaikoScoreProcessor.cs | 13 ++++++++++--- osu.Game/Rulesets/Objects/HitWindows.cs | 6 +++--- 3 files changed, 14 insertions(+), 7 deletions(-) diff --git a/osu.Game.Rulesets.Taiko/Objects/TaikoHitWindows.cs b/osu.Game.Rulesets.Taiko/Objects/TaikoHitWindows.cs index 722a327f45..2317d4cc90 100644 --- a/osu.Game.Rulesets.Taiko/Objects/TaikoHitWindows.cs +++ b/osu.Game.Rulesets.Taiko/Objects/TaikoHitWindows.cs @@ -17,7 +17,7 @@ namespace osu.Game.Rulesets.Taiko.Objects { HitResult.Miss, (270, 190, 140) }, }; - protected override double SuccessfulHitWindow => Good; + protected override HitResult SuccessfulHitResult => HitResult.Good; public override bool IsHitResultAllowed(HitResult result) { diff --git a/osu.Game.Rulesets.Taiko/Scoring/TaikoScoreProcessor.cs b/osu.Game.Rulesets.Taiko/Scoring/TaikoScoreProcessor.cs index 058d2b4beb..bd92905648 100644 --- a/osu.Game.Rulesets.Taiko/Scoring/TaikoScoreProcessor.cs +++ b/osu.Game.Rulesets.Taiko/Scoring/TaikoScoreProcessor.cs @@ -12,16 +12,23 @@ namespace osu.Game.Rulesets.Taiko.Scoring internal class TaikoScoreProcessor : ScoreProcessor { /// - /// The HP awarded by a hit. + /// A value used in calculating . /// - private const double hp_hit_great = 0.03; + private const double object_count_factor = 3; /// /// Taiko fails at the end of the map if the player has not half-filled their HP bar. /// protected override bool DefaultFailCondition => JudgedHits == MaxHits && Health.Value <= 0.5; + /// + /// HP multiplier for a successful . + /// private double hpMultiplier; + + /// + /// HP multiplier for a . + /// private double hpMissMultiplier; public TaikoScoreProcessor(RulesetContainer rulesetContainer) @@ -33,7 +40,7 @@ namespace osu.Game.Rulesets.Taiko.Scoring { base.ApplyBeatmap(beatmap); - hpMultiplier = 0.01 / (hp_hit_great * beatmap.HitObjects.FindAll(o => o is Hit).Count * BeatmapDifficulty.DifficultyRange(beatmap.BeatmapInfo.BaseDifficulty.DrainRate, 0.5, 0.75, 0.98)); + hpMultiplier = 1 / (object_count_factor * beatmap.HitObjects.FindAll(o => o is Hit).Count * BeatmapDifficulty.DifficultyRange(beatmap.BeatmapInfo.BaseDifficulty.DrainRate, 0.5, 0.75, 0.98)); hpMissMultiplier = BeatmapDifficulty.DifficultyRange(beatmap.BeatmapInfo.BaseDifficulty.DrainRate, 0.0018, 0.0075, 0.0120); } diff --git a/osu.Game/Rulesets/Objects/HitWindows.cs b/osu.Game/Rulesets/Objects/HitWindows.cs index 319bfdec65..dd114afb7b 100644 --- a/osu.Game/Rulesets/Objects/HitWindows.cs +++ b/osu.Game/Rulesets/Objects/HitWindows.cs @@ -51,9 +51,9 @@ namespace osu.Game.Rulesets.Objects public double Miss { get; protected set; } /// - /// Hit window for a non- result. + /// The with the largest hit window that produces a successful hit. /// - protected virtual double SuccessfulHitWindow => Meh; + protected virtual HitResult SuccessfulHitResult => HitResult.Meh; /// /// Whether it's possible to achieve this . @@ -136,6 +136,6 @@ namespace osu.Game.Rulesets.Objects /// /// The time offset. /// Whether the can be hit at any point in the future from this time offset. - public bool CanBeHit(double timeOffset) => timeOffset <= SuccessfulHitWindow / 2; + public bool CanBeHit(double timeOffset) => timeOffset <= HalfWindowFor(SuccessfulHitResult); } } From 839e177d2a6a6ab84446cdce32051595892c4115 Mon Sep 17 00:00:00 2001 From: Ivan Pavluk Date: Mon, 10 Dec 2018 04:59:35 +0000 Subject: [PATCH 28/35] Docstring change --- osu.Game.Rulesets.Taiko/Scoring/TaikoScoreProcessor.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game.Rulesets.Taiko/Scoring/TaikoScoreProcessor.cs b/osu.Game.Rulesets.Taiko/Scoring/TaikoScoreProcessor.cs index bd92905648..318efdbf3e 100644 --- a/osu.Game.Rulesets.Taiko/Scoring/TaikoScoreProcessor.cs +++ b/osu.Game.Rulesets.Taiko/Scoring/TaikoScoreProcessor.cs @@ -12,7 +12,7 @@ namespace osu.Game.Rulesets.Taiko.Scoring internal class TaikoScoreProcessor : ScoreProcessor { /// - /// A value used in calculating . + /// A value used for calculating . /// private const double object_count_factor = 3; From a2d1c2c096ccfbc56ceff2319164393dd4e2c149 Mon Sep 17 00:00:00 2001 From: Ivan Pavluk Date: Mon, 10 Dec 2018 05:05:03 +0000 Subject: [PATCH 29/35] Fix formatting --- osu.Game.Rulesets.Taiko/Judgements/TaikoSwellJudgement.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game.Rulesets.Taiko/Judgements/TaikoSwellJudgement.cs b/osu.Game.Rulesets.Taiko/Judgements/TaikoSwellJudgement.cs index 7c525bba6c..024e0e618f 100644 --- a/osu.Game.Rulesets.Taiko/Judgements/TaikoSwellJudgement.cs +++ b/osu.Game.Rulesets.Taiko/Judgements/TaikoSwellJudgement.cs @@ -11,7 +11,7 @@ namespace osu.Game.Rulesets.Taiko.Judgements protected override double HealthIncreaseFor(HitResult result) { - switch(result) + switch (result) { case HitResult.Miss: return -0.65; From a62b105fb539c9a52e4e09f3f937652cab4dbe8f Mon Sep 17 00:00:00 2001 From: Ivan Pavluk Date: Mon, 10 Dec 2018 05:06:18 +0000 Subject: [PATCH 30/35] Fix formatting --- osu.Game/Rulesets/Objects/HitWindows.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Rulesets/Objects/HitWindows.cs b/osu.Game/Rulesets/Objects/HitWindows.cs index dd114afb7b..e4d987e2dc 100644 --- a/osu.Game/Rulesets/Objects/HitWindows.cs +++ b/osu.Game/Rulesets/Objects/HitWindows.cs @@ -61,7 +61,7 @@ namespace osu.Game.Rulesets.Objects /// The result. public virtual bool IsHitResultAllowed(HitResult result) { - switch(result) + switch (result) { case HitResult.Perfect: case HitResult.Ok: From d86cbf66a9ad7c00824ad6cb5dd6b97b7e246dbc Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 12 Dec 2018 13:10:47 +0700 Subject: [PATCH 31/35] Update docstring Co-Authored-By: pavlukivan --- osu.Game/Rulesets/Objects/HitWindows.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/osu.Game/Rulesets/Objects/HitWindows.cs b/osu.Game/Rulesets/Objects/HitWindows.cs index e4d987e2dc..841452df55 100644 --- a/osu.Game/Rulesets/Objects/HitWindows.cs +++ b/osu.Game/Rulesets/Objects/HitWindows.cs @@ -58,7 +58,8 @@ namespace osu.Game.Rulesets.Objects /// /// Whether it's possible to achieve this . /// - /// The result. + /// The result type to check. + /// Whether the can be achieved. public virtual bool IsHitResultAllowed(HitResult result) { switch (result) From ffb91b4afcef7d668ffeb0e3d6d0d88d12274dfd Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 12 Dec 2018 13:11:03 +0700 Subject: [PATCH 32/35] Update docstring Co-Authored-By: pavlukivan --- osu.Game/Rulesets/Objects/HitWindows.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Rulesets/Objects/HitWindows.cs b/osu.Game/Rulesets/Objects/HitWindows.cs index 841452df55..c75e914d2d 100644 --- a/osu.Game/Rulesets/Objects/HitWindows.cs +++ b/osu.Game/Rulesets/Objects/HitWindows.cs @@ -56,7 +56,7 @@ namespace osu.Game.Rulesets.Objects protected virtual HitResult SuccessfulHitResult => HitResult.Meh; /// - /// Whether it's possible to achieve this . + /// Check whether it is possible to achieve the provided . /// /// The result type to check. /// Whether the can be achieved. From e49e2fda9e3fdd8488a70010e3bd36e3a2d045c2 Mon Sep 17 00:00:00 2001 From: Ivan Pavluk Date: Wed, 12 Dec 2018 13:24:58 +0700 Subject: [PATCH 33/35] Rename SuccessfulHitResult->LowestSuccessfulHitResult --- osu.Game.Rulesets.Taiko/Objects/TaikoHitWindows.cs | 2 +- osu.Game/Rulesets/Objects/HitWindows.cs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/osu.Game.Rulesets.Taiko/Objects/TaikoHitWindows.cs b/osu.Game.Rulesets.Taiko/Objects/TaikoHitWindows.cs index 2317d4cc90..2c207114da 100644 --- a/osu.Game.Rulesets.Taiko/Objects/TaikoHitWindows.cs +++ b/osu.Game.Rulesets.Taiko/Objects/TaikoHitWindows.cs @@ -17,7 +17,7 @@ namespace osu.Game.Rulesets.Taiko.Objects { HitResult.Miss, (270, 190, 140) }, }; - protected override HitResult SuccessfulHitResult => HitResult.Good; + protected override HitResult LowestSuccessfulHitResult => HitResult.Good; public override bool IsHitResultAllowed(HitResult result) { diff --git a/osu.Game/Rulesets/Objects/HitWindows.cs b/osu.Game/Rulesets/Objects/HitWindows.cs index c75e914d2d..cf8769a105 100644 --- a/osu.Game/Rulesets/Objects/HitWindows.cs +++ b/osu.Game/Rulesets/Objects/HitWindows.cs @@ -53,7 +53,7 @@ namespace osu.Game.Rulesets.Objects /// /// The with the largest hit window that produces a successful hit. /// - protected virtual HitResult SuccessfulHitResult => HitResult.Meh; + protected virtual HitResult LowestSuccessfulHitResult => HitResult.Meh; /// /// Check whether it is possible to achieve the provided . @@ -137,6 +137,6 @@ namespace osu.Game.Rulesets.Objects /// /// The time offset. /// Whether the can be hit at any point in the future from this time offset. - public bool CanBeHit(double timeOffset) => timeOffset <= HalfWindowFor(SuccessfulHitResult); + public bool CanBeHit(double timeOffset) => timeOffset <= HalfWindowFor(LowestSuccessfulHitResult); } } From 77e0d7ed8e3ecc799387c5d2096183ca5269ff88 Mon Sep 17 00:00:00 2001 From: Ivan Pavluk Date: Wed, 12 Dec 2018 07:57:37 +0000 Subject: [PATCH 34/35] Fix formatting --- .../Judgements/TaikoDrumRollTickJudgement.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game.Rulesets.Taiko/Judgements/TaikoDrumRollTickJudgement.cs b/osu.Game.Rulesets.Taiko/Judgements/TaikoDrumRollTickJudgement.cs index 86b495ca08..e11bdf225f 100644 --- a/osu.Game.Rulesets.Taiko/Judgements/TaikoDrumRollTickJudgement.cs +++ b/osu.Game.Rulesets.Taiko/Judgements/TaikoDrumRollTickJudgement.cs @@ -22,7 +22,7 @@ namespace osu.Game.Rulesets.Taiko.Judgements protected override double HealthIncreaseFor(HitResult result) { - switch(result) + switch (result) { case HitResult.Great: return 0.15; From 28b033bd993d19ff50462d0ce8dea2c06b71febd Mon Sep 17 00:00:00 2001 From: Ivan Pavluk Date: Wed, 12 Dec 2018 17:15:59 +0700 Subject: [PATCH 35/35] Autodetect LowestSuccessfulHitResult --- .../Objects/TaikoHitWindows.cs | 2 -- osu.Game/Rulesets/Objects/HitWindows.cs | 16 +++++++++++++--- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/osu.Game.Rulesets.Taiko/Objects/TaikoHitWindows.cs b/osu.Game.Rulesets.Taiko/Objects/TaikoHitWindows.cs index 2c207114da..9199e6f141 100644 --- a/osu.Game.Rulesets.Taiko/Objects/TaikoHitWindows.cs +++ b/osu.Game.Rulesets.Taiko/Objects/TaikoHitWindows.cs @@ -17,8 +17,6 @@ namespace osu.Game.Rulesets.Taiko.Objects { HitResult.Miss, (270, 190, 140) }, }; - protected override HitResult LowestSuccessfulHitResult => HitResult.Good; - public override bool IsHitResultAllowed(HitResult result) { switch (result) diff --git a/osu.Game/Rulesets/Objects/HitWindows.cs b/osu.Game/Rulesets/Objects/HitWindows.cs index cf8769a105..40fb98a997 100644 --- a/osu.Game/Rulesets/Objects/HitWindows.cs +++ b/osu.Game/Rulesets/Objects/HitWindows.cs @@ -51,9 +51,19 @@ namespace osu.Game.Rulesets.Objects public double Miss { get; protected set; } /// - /// The with the largest hit window that produces a successful hit. + /// Retrieves the with the largest hit window that produces a successful hit. /// - protected virtual HitResult LowestSuccessfulHitResult => HitResult.Meh; + /// The lowest allowed successful . + protected HitResult LowestSuccessfulHitResult() + { + for (var result = HitResult.Meh; result <= HitResult.Perfect; ++result) + { + if (IsHitResultAllowed(result)) + return result; + } + + return HitResult.None; + } /// /// Check whether it is possible to achieve the provided . @@ -137,6 +147,6 @@ namespace osu.Game.Rulesets.Objects /// /// The time offset. /// Whether the can be hit at any point in the future from this time offset. - public bool CanBeHit(double timeOffset) => timeOffset <= HalfWindowFor(LowestSuccessfulHitResult); + public bool CanBeHit(double timeOffset) => timeOffset <= HalfWindowFor(LowestSuccessfulHitResult()); } }