2017-03-15 12:32:47 +00:00
|
|
|
|
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
|
|
|
|
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
|
|
|
|
|
2017-04-18 07:05:58 +00:00
|
|
|
|
using osu.Game.Rulesets.Judgements;
|
2017-03-23 03:21:09 +00:00
|
|
|
|
using osu.Framework.Extensions;
|
2017-04-18 07:05:58 +00:00
|
|
|
|
using osu.Game.Rulesets.Objects.Drawables;
|
2017-03-15 09:55:38 +00:00
|
|
|
|
|
2017-04-18 07:05:58 +00:00
|
|
|
|
namespace osu.Game.Rulesets.Taiko.Judgements
|
2017-03-15 09:55:38 +00:00
|
|
|
|
{
|
2017-03-23 10:00:18 +00:00
|
|
|
|
public class TaikoJudgement : Judgement
|
2017-03-15 09:55:38 +00:00
|
|
|
|
{
|
2017-03-17 08:06:34 +00:00
|
|
|
|
/// <summary>
|
2017-03-24 00:50:18 +00:00
|
|
|
|
/// The maximum result.
|
2017-03-17 08:06:34 +00:00
|
|
|
|
/// </summary>
|
2017-03-21 12:38:39 +00:00
|
|
|
|
public const TaikoHitResult MAX_HIT_RESULT = TaikoHitResult.Great;
|
2017-03-17 08:06:34 +00:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
2017-03-24 00:50:18 +00:00
|
|
|
|
/// The result.
|
2017-03-17 08:06:34 +00:00
|
|
|
|
/// </summary>
|
2017-03-21 12:36:05 +00:00
|
|
|
|
public TaikoHitResult TaikoResult;
|
2017-03-17 08:06:34 +00:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
2017-03-24 00:50:18 +00:00
|
|
|
|
/// The result value for the combo portion of the score.
|
2017-03-17 08:06:34 +00:00
|
|
|
|
/// </summary>
|
2017-04-06 04:44:43 +00:00
|
|
|
|
public int ResultValueForScore => Result == HitResult.Miss ? 0 : NumericResultForScore(TaikoResult);
|
2017-03-29 09:16:26 +00:00
|
|
|
|
|
2017-03-17 08:06:34 +00:00
|
|
|
|
/// <summary>
|
2017-03-24 00:50:18 +00:00
|
|
|
|
/// The result value for the accuracy portion of the score.
|
2017-03-17 08:06:34 +00:00
|
|
|
|
/// </summary>
|
2017-04-06 04:44:43 +00:00
|
|
|
|
public int ResultValueForAccuracy => Result == HitResult.Miss ? 0 : NumericResultForAccuracy(TaikoResult);
|
2017-03-17 08:06:34 +00:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
2017-03-24 00:50:18 +00:00
|
|
|
|
/// The maximum result value for the combo portion of the score.
|
2017-03-17 08:06:34 +00:00
|
|
|
|
/// </summary>
|
2017-03-24 00:50:18 +00:00
|
|
|
|
public int MaxResultValueForScore => NumericResultForScore(MAX_HIT_RESULT);
|
2017-03-29 09:16:26 +00:00
|
|
|
|
|
2017-03-17 08:06:34 +00:00
|
|
|
|
/// <summary>
|
2017-03-24 00:50:18 +00:00
|
|
|
|
/// The maximum result value for the accuracy portion of the score.
|
2017-03-17 08:06:34 +00:00
|
|
|
|
/// </summary>
|
2017-03-24 00:50:18 +00:00
|
|
|
|
public int MaxResultValueForAccuracy => NumericResultForAccuracy(MAX_HIT_RESULT);
|
2017-03-17 08:06:34 +00:00
|
|
|
|
|
2017-03-24 00:50:18 +00:00
|
|
|
|
public override string ResultString => TaikoResult.GetDescription();
|
2017-03-23 03:21:09 +00:00
|
|
|
|
|
2017-03-24 00:50:18 +00:00
|
|
|
|
public override string MaxResultString => MAX_HIT_RESULT.GetDescription();
|
2017-03-23 03:21:09 +00:00
|
|
|
|
|
2017-03-17 08:06:34 +00:00
|
|
|
|
/// <summary>
|
2017-04-03 01:59:49 +00:00
|
|
|
|
/// Whether this Judgement has a secondary hit in the case of strong hits.
|
2017-03-17 08:06:34 +00:00
|
|
|
|
/// </summary>
|
2017-03-29 09:16:26 +00:00
|
|
|
|
public virtual bool SecondHit { get; set; }
|
2017-03-17 08:06:34 +00:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
2017-03-24 00:50:18 +00:00
|
|
|
|
/// Computes the numeric result value for the combo portion of the score.
|
2017-03-21 12:36:05 +00:00
|
|
|
|
/// For the accuracy portion of the score (including accuracy percentage), see <see cref="NumericResultForAccuracy(TaikoHitResult)"/>.
|
2017-03-17 08:06:34 +00:00
|
|
|
|
/// </summary>
|
2017-03-24 00:50:18 +00:00
|
|
|
|
/// <param name="result">The result to compute the value for.</param>
|
|
|
|
|
/// <returns>The numeric result value.</returns>
|
2017-03-21 12:36:05 +00:00
|
|
|
|
protected virtual int NumericResultForScore(TaikoHitResult result)
|
2017-03-17 08:06:34 +00:00
|
|
|
|
{
|
|
|
|
|
switch (result)
|
|
|
|
|
{
|
|
|
|
|
default:
|
|
|
|
|
return 0;
|
2017-03-21 12:36:05 +00:00
|
|
|
|
case TaikoHitResult.Good:
|
2017-03-17 08:06:34 +00:00
|
|
|
|
return 100;
|
2017-03-21 12:36:05 +00:00
|
|
|
|
case TaikoHitResult.Great:
|
2017-03-17 08:06:34 +00:00
|
|
|
|
return 300;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
2017-03-24 00:50:18 +00:00
|
|
|
|
/// Computes the numeric result value for the accuracy portion of the score.
|
2017-03-21 12:36:05 +00:00
|
|
|
|
/// For the combo portion of the score, see <see cref="NumericResultForScore(TaikoHitResult)"/>.
|
2017-03-17 08:06:34 +00:00
|
|
|
|
/// </summary>
|
2017-03-24 00:50:18 +00:00
|
|
|
|
/// <param name="result">The result to compute the value for.</param>
|
|
|
|
|
/// <returns>The numeric result value.</returns>
|
2017-03-21 12:36:05 +00:00
|
|
|
|
protected virtual int NumericResultForAccuracy(TaikoHitResult result)
|
2017-03-17 08:06:34 +00:00
|
|
|
|
{
|
|
|
|
|
switch (result)
|
|
|
|
|
{
|
|
|
|
|
default:
|
|
|
|
|
return 0;
|
2017-03-21 12:36:05 +00:00
|
|
|
|
case TaikoHitResult.Good:
|
2017-03-17 08:06:34 +00:00
|
|
|
|
return 150;
|
2017-03-21 12:36:05 +00:00
|
|
|
|
case TaikoHitResult.Great:
|
2017-03-17 08:06:34 +00:00
|
|
|
|
return 300;
|
|
|
|
|
}
|
|
|
|
|
}
|
2017-03-15 09:55:38 +00:00
|
|
|
|
}
|
|
|
|
|
}
|