mirror of
https://github.com/osukey/osukey.git
synced 2025-05-07 22:57:31 +09:00
Make hp work + cleanup
This commit is contained in:
parent
144e6012dc
commit
4edb17a88a
@ -26,12 +26,10 @@ namespace osu.Game.Rulesets.Catch.Scoring
|
|||||||
hpDrainRate = beatmap.BeatmapInfo.BaseDifficulty.DrainRate;
|
hpDrainRate = beatmap.BeatmapInfo.BaseDifficulty.DrainRate;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override double HpFactorFor(Judgement judgement, HitResult result)
|
protected override double HpFactorFor(JudgementResult result)
|
||||||
{
|
{
|
||||||
switch (result)
|
switch (result.Type)
|
||||||
{
|
{
|
||||||
case HitResult.Miss when judgement.IsBonus:
|
|
||||||
return 0;
|
|
||||||
case HitResult.Miss:
|
case HitResult.Miss:
|
||||||
return hpDrainRate;
|
return hpDrainRate;
|
||||||
default:
|
default:
|
||||||
|
@ -3,7 +3,6 @@
|
|||||||
|
|
||||||
using osu.Game.Beatmaps;
|
using osu.Game.Beatmaps;
|
||||||
using osu.Game.Rulesets.Judgements;
|
using osu.Game.Rulesets.Judgements;
|
||||||
using osu.Game.Rulesets.Mania.Judgements;
|
|
||||||
using osu.Game.Rulesets.Mania.Objects;
|
using osu.Game.Rulesets.Mania.Objects;
|
||||||
using osu.Game.Rulesets.Objects;
|
using osu.Game.Rulesets.Objects;
|
||||||
using osu.Game.Rulesets.Scoring;
|
using osu.Game.Rulesets.Scoring;
|
||||||
@ -28,36 +27,6 @@ namespace osu.Game.Rulesets.Mania.Scoring
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
private const double hp_multiplier_max = 1;
|
private const double hp_multiplier_max = 1;
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// The default BAD hit HP increase.
|
|
||||||
/// </summary>
|
|
||||||
private const double hp_increase_bad = 0.005;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// The default OK hit HP increase.
|
|
||||||
/// </summary>
|
|
||||||
private const double hp_increase_ok = 0.010;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// The default GOOD hit HP increase.
|
|
||||||
/// </summary>
|
|
||||||
private const double hp_increase_good = 0.035;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// The default tick hit HP increase.
|
|
||||||
/// </summary>
|
|
||||||
private const double hp_increase_tick = 0.040;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// The default GREAT hit HP increase.
|
|
||||||
/// </summary>
|
|
||||||
private const double hp_increase_great = 0.055;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// The default PERFECT hit HP increase.
|
|
||||||
/// </summary>
|
|
||||||
private const double hp_increase_perfect = 0.065;
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The MISS HP multiplier at OD = 0.
|
/// The MISS HP multiplier at OD = 0.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -73,11 +42,6 @@ namespace osu.Game.Rulesets.Mania.Scoring
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
private const double hp_multiplier_miss_max = 1;
|
private const double hp_multiplier_miss_max = 1;
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// The default MISS HP increase.
|
|
||||||
/// </summary>
|
|
||||||
private const double hp_increase_miss = -0.125;
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The MISS HP multiplier. This is multiplied to the miss hp increase.
|
/// The MISS HP multiplier. This is multiplied to the miss hp increase.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -88,10 +52,6 @@ namespace osu.Game.Rulesets.Mania.Scoring
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
private double hpMultiplier = 1;
|
private double hpMultiplier = 1;
|
||||||
|
|
||||||
public ManiaScoreProcessor()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
public ManiaScoreProcessor(DrawableRuleset<ManiaHitObject> drawableRuleset)
|
public ManiaScoreProcessor(DrawableRuleset<ManiaHitObject> drawableRuleset)
|
||||||
: base(drawableRuleset)
|
: base(drawableRuleset)
|
||||||
{
|
{
|
||||||
@ -122,8 +82,8 @@ namespace osu.Game.Rulesets.Mania.Scoring
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override double HpFactorFor(Judgement judgement, HitResult result)
|
protected override double HpFactorFor(JudgementResult result)
|
||||||
=> result == HitResult.Miss ? hpMissMultiplier : hpMultiplier;
|
=> result.Type == HitResult.Miss ? hpMissMultiplier : hpMultiplier;
|
||||||
|
|
||||||
public override HitWindows CreateHitWindows() => new ManiaHitWindows();
|
public override HitWindows CreateHitWindows() => new ManiaHitWindows();
|
||||||
}
|
}
|
||||||
|
@ -37,8 +37,6 @@ namespace osu.Game.Rulesets.Osu.Scoring
|
|||||||
comboResultCounts.Clear();
|
comboResultCounts.Clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
private const double harshness = 0.01;
|
|
||||||
|
|
||||||
protected override void ApplyResult(JudgementResult result)
|
protected override void ApplyResult(JudgementResult result)
|
||||||
{
|
{
|
||||||
base.ApplyResult(result);
|
base.ApplyResult(result);
|
||||||
@ -49,9 +47,9 @@ namespace osu.Game.Rulesets.Osu.Scoring
|
|||||||
comboResultCounts[osuResult.ComboType] = comboResultCounts.GetOrDefault(osuResult.ComboType) + 1;
|
comboResultCounts[osuResult.ComboType] = comboResultCounts.GetOrDefault(osuResult.ComboType) + 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override double HpFactorFor(Judgement judgement, HitResult result)
|
protected override double HpFactorFor(JudgementResult result)
|
||||||
{
|
{
|
||||||
switch (result)
|
switch (result.Type)
|
||||||
{
|
{
|
||||||
case HitResult.Great:
|
case HitResult.Great:
|
||||||
return 10.2 - hpDrainRate;
|
return 10.2 - hpDrainRate;
|
||||||
|
@ -46,8 +46,8 @@ namespace osu.Game.Rulesets.Taiko.Scoring
|
|||||||
hpMissMultiplier = BeatmapDifficulty.DifficultyRange(beatmap.BeatmapInfo.BaseDifficulty.DrainRate, 0.0018, 0.0075, 0.0120);
|
hpMissMultiplier = BeatmapDifficulty.DifficultyRange(beatmap.BeatmapInfo.BaseDifficulty.DrainRate, 0.0018, 0.0075, 0.0120);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override double HpFactorFor(Judgement judgement, HitResult result)
|
protected override double HpFactorFor(JudgementResult result)
|
||||||
=> result == HitResult.Miss ? hpMissMultiplier : hpMultiplier;
|
=> result.Type == HitResult.Miss ? hpMissMultiplier : hpMultiplier;
|
||||||
|
|
||||||
protected override void Reset(bool storeResults)
|
protected override void Reset(bool storeResults)
|
||||||
{
|
{
|
||||||
|
@ -37,6 +37,11 @@ namespace osu.Game.Rulesets.Judgements
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public int HighestComboAtJudgement { get; internal set; }
|
public int HighestComboAtJudgement { get; internal set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The health prior to this <see cref="JudgementResult"/> occurring.
|
||||||
|
/// </summary>
|
||||||
|
public double HealthAtJudgement { get; internal set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Whether a miss or hit occurred.
|
/// Whether a miss or hit occurred.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -206,9 +206,6 @@ namespace osu.Game.Rulesets.Scoring
|
|||||||
private double baseScore;
|
private double baseScore;
|
||||||
private double bonusScore;
|
private double bonusScore;
|
||||||
|
|
||||||
private double rollingHp;
|
|
||||||
private double rollingMaxHp;
|
|
||||||
|
|
||||||
protected ScoreProcessor()
|
protected ScoreProcessor()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
@ -304,6 +301,7 @@ namespace osu.Game.Rulesets.Scoring
|
|||||||
{
|
{
|
||||||
result.ComboAtJudgement = Combo.Value;
|
result.ComboAtJudgement = Combo.Value;
|
||||||
result.HighestComboAtJudgement = HighestCombo.Value;
|
result.HighestComboAtJudgement = HighestCombo.Value;
|
||||||
|
result.HealthAtJudgement = Health.Value;
|
||||||
|
|
||||||
JudgedHits++;
|
JudgedHits++;
|
||||||
|
|
||||||
@ -336,8 +334,7 @@ namespace osu.Game.Rulesets.Scoring
|
|||||||
rollingMaxBaseScore += result.Judgement.MaxNumericResult;
|
rollingMaxBaseScore += result.Judgement.MaxNumericResult;
|
||||||
}
|
}
|
||||||
|
|
||||||
rollingHp += HpFactorFor(result.Judgement, result.Type) * result.Judgement.HealthIncreaseFor(result);
|
Health.Value += HpFactorFor(result) * result.Judgement.HealthIncreaseFor(result);
|
||||||
rollingMaxHp += HpFactorFor(result.Judgement, result.Judgement.MaxResult) * result.Judgement.MaxHealthIncrease;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -349,6 +346,7 @@ namespace osu.Game.Rulesets.Scoring
|
|||||||
{
|
{
|
||||||
Combo.Value = result.ComboAtJudgement;
|
Combo.Value = result.ComboAtJudgement;
|
||||||
HighestCombo.Value = result.HighestComboAtJudgement;
|
HighestCombo.Value = result.HighestComboAtJudgement;
|
||||||
|
Health.Value = result.HealthAtJudgement;
|
||||||
|
|
||||||
JudgedHits--;
|
JudgedHits--;
|
||||||
|
|
||||||
@ -362,12 +360,9 @@ namespace osu.Game.Rulesets.Scoring
|
|||||||
baseScore -= result.Judgement.NumericResultFor(result);
|
baseScore -= result.Judgement.NumericResultFor(result);
|
||||||
rollingMaxBaseScore -= result.Judgement.MaxNumericResult;
|
rollingMaxBaseScore -= result.Judgement.MaxNumericResult;
|
||||||
}
|
}
|
||||||
|
|
||||||
rollingHp -= HpFactorFor(result.Judgement, result.Type) * result.Judgement.HealthIncreaseFor(result);
|
|
||||||
rollingMaxHp -= HpFactorFor(result.Judgement, result.Judgement.MaxResult) * result.Judgement.MaxHealthIncrease;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected virtual double HpFactorFor(Judgement judgement, HitResult result) => 1;
|
protected virtual double HpFactorFor(JudgementResult result) => 1;
|
||||||
|
|
||||||
private void updateScore()
|
private void updateScore()
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user