1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 04:52:57 +08:00

Fixed taiko swell hp and scoring

This commit is contained in:
Ivan Pavluk 2018-11-29 22:05:13 +07:00
parent 35d57f74bf
commit 2ca9864301
10 changed files with 69 additions and 43 deletions

View File

@ -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;
}
}

View File

@ -1,21 +0,0 @@
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
// 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;
/// <summary>
/// Computes the numeric result value for the combo portion of the score.
/// </summary>
/// <param name="result">The result to compute the value for.</param>
/// <returns>The numeric result value.</returns>
protected override int NumericResultFor(HitResult result) => 0;
}
}

View File

@ -10,6 +10,11 @@ namespace osu.Game.Rulesets.Taiko.Judgements
{
public override HitResult MaxResult => HitResult.Great;
/// <summary>
/// Whether this <see cref="TaikoJudgement"/> should affect user's hitpoints.
/// </summary>
public virtual bool AffectsHP => true;
/// <summary>
/// Computes the numeric result value for the combo portion of the score.
/// </summary>

View File

@ -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;
}
}

View File

@ -0,0 +1,14 @@
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
// 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;
}
}

View File

@ -0,0 +1,25 @@
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
// 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;
}
}
}
}

View File

@ -6,11 +6,11 @@ using osu.Game.Rulesets.Scoring;
namespace osu.Game.Rulesets.Taiko.Objects.Drawables
{
public class DrawableSwellTick : DrawableTaikoHitObject
public class DrawableSwellTick : DrawableTaikoHitObject<SwellTick>
{
public override bool DisplayResult => false;
public DrawableSwellTick(TaikoHitObject hitObject)
public DrawableSwellTick(SwellTick hitObject)
: base(hitObject)
{
}

View File

@ -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; }

View File

@ -1,9 +1,13 @@
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
// 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();
}
}

View File

@ -80,26 +80,14 @@ namespace osu.Game.Rulesets.Taiko.Scoring
{
base.ApplyResult(result);
bool isRoll = false;
bool isStrong = false;
if (!((TaikoJudgement)result.Judgement).AffectsHP)
return;
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;
}