Removed unnecessary JudgementResult casts

This commit is contained in:
Ivan Pavluk 2018-12-06 19:52:16 +07:00
parent 407f9d2e78
commit 394c038c33
2 changed files with 7 additions and 11 deletions

View File

@ -40,8 +40,7 @@ protected override void ApplyResult(JudgementResult result)
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;
}
}
}

View File

@ -43,17 +43,14 @@ protected override void ApplyResult(JudgementResult result)
{
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)