Implement hit windows

This commit is contained in:
smoogipoo 2018-12-27 22:36:57 +09:00
parent 99ed009838
commit b64932f6db
4 changed files with 32 additions and 0 deletions

View File

@ -0,0 +1,23 @@
// 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.Objects;
using osu.Game.Rulesets.Scoring;
namespace osu.Game.Rulesets.Catch.Objects
{
public class CatchHitWindows : HitWindows
{
public override bool IsHitResultAllowed(HitResult result)
{
switch (result)
{
case HitResult.Perfect:
case HitResult.Miss:
return true;
}
return false;
}
}
}

View File

@ -5,6 +5,7 @@
using osu.Game.Beatmaps;
using osu.Game.Rulesets.Catch.Objects;
using osu.Game.Rulesets.Judgements;
using osu.Game.Rulesets.Objects;
using osu.Game.Rulesets.Scoring;
using osu.Game.Rulesets.UI;
@ -41,5 +42,7 @@ protected override void ApplyResult(JudgementResult result)
Health.Value += Math.Max(result.Judgement.HealthIncreaseFor(result) - hpDrainRate, 0) * harshness;
}
protected override HitWindows CreateHitWindows() => new CatchHitWindows();
}
}

View File

@ -5,6 +5,7 @@
using osu.Game.Rulesets.Judgements;
using osu.Game.Rulesets.Mania.Judgements;
using osu.Game.Rulesets.Mania.Objects;
using osu.Game.Rulesets.Objects;
using osu.Game.Rulesets.Scoring;
using osu.Game.Rulesets.UI;
@ -157,5 +158,7 @@ protected override void ApplyResult(JudgementResult result)
}
}
}
protected override HitWindows CreateHitWindows() => new ManiaHitWindows();
}
}

View File

@ -3,6 +3,7 @@
using osu.Game.Beatmaps;
using osu.Game.Rulesets.Judgements;
using osu.Game.Rulesets.Objects;
using osu.Game.Rulesets.Scoring;
using osu.Game.Rulesets.Taiko.Objects;
using osu.Game.Rulesets.UI;
@ -65,5 +66,7 @@ protected override void Reset(bool storeResults)
Health.Value = 0;
}
protected override HitWindows CreateHitWindows() => new TaikoHitWindows();
}
}