mirror of
https://github.com/osukey/osukey.git
synced 2025-06-05 21:07:18 +09:00
Add judgements to catch
This commit is contained in:
parent
d5e42a8daa
commit
f486bcfee1
24
osu.Game.Rulesets.Catch/Judgements/CatchBananaJudgement.cs
Normal file
24
osu.Game.Rulesets.Catch/Judgements/CatchBananaJudgement.cs
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
// 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.Scoring;
|
||||||
|
|
||||||
|
namespace osu.Game.Rulesets.Catch.Judgements
|
||||||
|
{
|
||||||
|
public class CatchBananaJudgement : CatchJudgement
|
||||||
|
{
|
||||||
|
public override bool AffectsCombo => false;
|
||||||
|
|
||||||
|
protected override int NumericResultFor(HitResult result)
|
||||||
|
{
|
||||||
|
switch (result)
|
||||||
|
{
|
||||||
|
default:
|
||||||
|
return 0;
|
||||||
|
case HitResult.Perfect:
|
||||||
|
return 1100;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,20 @@
|
|||||||
|
// 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.Scoring;
|
||||||
|
|
||||||
|
namespace osu.Game.Rulesets.Catch.Judgements
|
||||||
|
{
|
||||||
|
public class CatchBananaShowerJudgement : CatchJudgement
|
||||||
|
{
|
||||||
|
public override bool AffectsCombo => false;
|
||||||
|
|
||||||
|
public CatchBananaShowerJudgement()
|
||||||
|
{
|
||||||
|
Result = HitResult.Perfect;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override int NumericResultFor(HitResult result) => 0;
|
||||||
|
}
|
||||||
|
}
|
22
osu.Game.Rulesets.Catch/Judgements/CatchDropletJudgement.cs
Normal file
22
osu.Game.Rulesets.Catch/Judgements/CatchDropletJudgement.cs
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
// 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.Scoring;
|
||||||
|
|
||||||
|
namespace osu.Game.Rulesets.Catch.Judgements
|
||||||
|
{
|
||||||
|
public class CatchDropletJudgement : CatchJudgement
|
||||||
|
{
|
||||||
|
protected override int NumericResultFor(HitResult result)
|
||||||
|
{
|
||||||
|
switch (result)
|
||||||
|
{
|
||||||
|
default:
|
||||||
|
return 0;
|
||||||
|
case HitResult.Perfect:
|
||||||
|
return 30;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -2,11 +2,28 @@
|
|||||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||||
|
|
||||||
using osu.Game.Rulesets.Judgements;
|
using osu.Game.Rulesets.Judgements;
|
||||||
|
using osu.Game.Rulesets.Scoring;
|
||||||
|
|
||||||
namespace osu.Game.Rulesets.Catch.Judgements
|
namespace osu.Game.Rulesets.Catch.Judgements
|
||||||
{
|
{
|
||||||
public class CatchJudgement : Judgement
|
public class CatchJudgement : Judgement
|
||||||
{
|
{
|
||||||
// todo: wangs
|
public override HitResult MaxResult => HitResult.Perfect;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The positional hit offset.
|
||||||
|
/// </summary>
|
||||||
|
public float PositionOffset;
|
||||||
|
|
||||||
|
protected override int NumericResultFor(HitResult result)
|
||||||
|
{
|
||||||
|
switch (result)
|
||||||
|
{
|
||||||
|
default:
|
||||||
|
return 0;
|
||||||
|
case HitResult.Perfect:
|
||||||
|
return 300;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,24 @@
|
|||||||
|
// 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.Scoring;
|
||||||
|
|
||||||
|
namespace osu.Game.Rulesets.Catch.Judgements
|
||||||
|
{
|
||||||
|
public class CatchTinyDropletJudgement : CatchJudgement
|
||||||
|
{
|
||||||
|
public override bool AffectsCombo => false;
|
||||||
|
|
||||||
|
protected override int NumericResultFor(HitResult result)
|
||||||
|
{
|
||||||
|
switch (result)
|
||||||
|
{
|
||||||
|
default:
|
||||||
|
return 0;
|
||||||
|
case HitResult.Perfect:
|
||||||
|
return 10;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
25
osu.Game.Rulesets.Catch/Objects/Drawable/DrawableBanana.cs
Normal file
25
osu.Game.Rulesets.Catch/Objects/Drawable/DrawableBanana.cs
Normal 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 OpenTK;
|
||||||
|
using osu.Game.Rulesets.Catch.Judgements;
|
||||||
|
using osu.Game.Rulesets.Scoring;
|
||||||
|
|
||||||
|
namespace osu.Game.Rulesets.Catch.Objects.Drawable
|
||||||
|
{
|
||||||
|
public class DrawableBanana : DrawableFruit
|
||||||
|
{
|
||||||
|
public DrawableBanana(BananaShower.Banana h)
|
||||||
|
: base(h)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void CheckForJudgements(bool userTriggered, double timeOffset)
|
||||||
|
{
|
||||||
|
if (CheckPosition == null) return;
|
||||||
|
|
||||||
|
if (timeOffset >= 0)
|
||||||
|
AddJudgement(new CatchBananaJudgement { Result = CheckPosition.Invoke(HitObject) ? HitResult.Perfect : HitResult.Miss });
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -5,7 +5,7 @@ using System;
|
|||||||
using System.Linq;
|
using System.Linq;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
using osu.Game.Rulesets.Judgements;
|
using osu.Game.Rulesets.Catch.Judgements;
|
||||||
using osu.Game.Rulesets.Objects.Drawables;
|
using osu.Game.Rulesets.Objects.Drawables;
|
||||||
using osu.Game.Rulesets.Scoring;
|
using osu.Game.Rulesets.Scoring;
|
||||||
|
|
||||||
@ -31,7 +31,7 @@ namespace osu.Game.Rulesets.Catch.Objects.Drawable
|
|||||||
protected override void CheckForJudgements(bool userTriggered, double timeOffset)
|
protected override void CheckForJudgements(bool userTriggered, double timeOffset)
|
||||||
{
|
{
|
||||||
if (timeOffset >= 0)
|
if (timeOffset >= 0)
|
||||||
AddJudgement(new Judgement { Result = NestedHitObjects.Cast<DrawableCatchHitObject>().Any(n => n.Judgements.Any(j => j.IsHit)) ? HitResult.Perfect : HitResult.Miss });
|
AddJudgement(new CatchBananaShowerJudgement());
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void AddNested(DrawableHitObject h)
|
protected override void AddNested(DrawableHitObject h)
|
||||||
|
@ -2,14 +2,14 @@
|
|||||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
|
using OpenTK;
|
||||||
|
using OpenTK.Graphics;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Game.Rulesets.Judgements;
|
using osu.Game.Rulesets.Catch.Judgements;
|
||||||
using osu.Game.Rulesets.Objects.Drawables;
|
using osu.Game.Rulesets.Objects.Drawables;
|
||||||
using osu.Game.Rulesets.Objects.Types;
|
using osu.Game.Rulesets.Objects.Types;
|
||||||
using OpenTK;
|
|
||||||
using osu.Game.Rulesets.Scoring;
|
using osu.Game.Rulesets.Scoring;
|
||||||
using osu.Game.Skinning;
|
using osu.Game.Skinning;
|
||||||
using OpenTK.Graphics;
|
|
||||||
|
|
||||||
namespace osu.Game.Rulesets.Catch.Objects.Drawable
|
namespace osu.Game.Rulesets.Catch.Objects.Drawable
|
||||||
{
|
{
|
||||||
@ -56,7 +56,7 @@ namespace osu.Game.Rulesets.Catch.Objects.Drawable
|
|||||||
if (CheckPosition == null) return;
|
if (CheckPosition == null) return;
|
||||||
|
|
||||||
if (timeOffset >= 0)
|
if (timeOffset >= 0)
|
||||||
AddJudgement(new Judgement { Result = CheckPosition.Invoke(HitObject) ? HitResult.Perfect : HitResult.Miss });
|
AddJudgement(new CatchJudgement { Result = CheckPosition.Invoke(HitObject) ? HitResult.Perfect : HitResult.Miss });
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void SkinChanged(ISkinSource skin, bool allowFallback)
|
protected override void SkinChanged(ISkinSource skin, bool allowFallback)
|
||||||
|
@ -6,6 +6,8 @@ using osu.Framework.Graphics;
|
|||||||
using osu.Game.Rulesets.Catch.Objects.Drawable.Pieces;
|
using osu.Game.Rulesets.Catch.Objects.Drawable.Pieces;
|
||||||
using OpenTK;
|
using OpenTK;
|
||||||
using OpenTK.Graphics;
|
using OpenTK.Graphics;
|
||||||
|
using osu.Game.Rulesets.Catch.Judgements;
|
||||||
|
using osu.Game.Rulesets.Scoring;
|
||||||
|
|
||||||
namespace osu.Game.Rulesets.Catch.Objects.Drawable
|
namespace osu.Game.Rulesets.Catch.Objects.Drawable
|
||||||
{
|
{
|
||||||
@ -21,6 +23,14 @@ namespace osu.Game.Rulesets.Catch.Objects.Drawable
|
|||||||
Masking = false;
|
Masking = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected override void CheckForJudgements(bool userTriggered, double timeOffset)
|
||||||
|
{
|
||||||
|
if (CheckPosition == null) return;
|
||||||
|
|
||||||
|
if (timeOffset >= 0)
|
||||||
|
AddJudgement(new CatchDropletJudgement { Result = CheckPosition.Invoke(HitObject) ? HitResult.Perfect : HitResult.Miss });
|
||||||
|
}
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private void load()
|
private void load()
|
||||||
{
|
{
|
||||||
|
@ -0,0 +1,26 @@
|
|||||||
|
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
||||||
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||||
|
|
||||||
|
using OpenTK;
|
||||||
|
using osu.Game.Rulesets.Catch.Judgements;
|
||||||
|
using osu.Game.Rulesets.Scoring;
|
||||||
|
|
||||||
|
namespace osu.Game.Rulesets.Catch.Objects.Drawable
|
||||||
|
{
|
||||||
|
public class DrawableTinyDroplet : DrawableDroplet
|
||||||
|
{
|
||||||
|
public DrawableTinyDroplet(Droplet h)
|
||||||
|
: base(h)
|
||||||
|
{
|
||||||
|
Size = new Vector2((float)CatchHitObject.OBJECT_RADIUS) / 8;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void CheckForJudgements(bool userTriggered, double timeOffset)
|
||||||
|
{
|
||||||
|
if (CheckPosition == null) return;
|
||||||
|
|
||||||
|
if (timeOffset >= 0)
|
||||||
|
AddJudgement(new CatchTinyDropletJudgement { Result = CheckPosition.Invoke(HitObject) ? HitResult.Perfect : HitResult.Miss });
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -24,13 +24,23 @@ namespace osu.Game.Rulesets.Catch.Scoring
|
|||||||
switch (obj)
|
switch (obj)
|
||||||
{
|
{
|
||||||
case JuiceStream stream:
|
case JuiceStream stream:
|
||||||
foreach (var _ in stream.NestedHitObjects.Cast<CatchHitObject>())
|
foreach (var nestedObject in stream.NestedHitObjects)
|
||||||
AddJudgement(new CatchJudgement { Result = HitResult.Perfect });
|
switch (nestedObject)
|
||||||
|
{
|
||||||
|
case TinyDroplet _:
|
||||||
|
AddJudgement(new CatchTinyDropletJudgement { Result = HitResult.Perfect });
|
||||||
|
break;
|
||||||
|
case Droplet _:
|
||||||
|
AddJudgement(new CatchDropletJudgement { Result = HitResult.Perfect });
|
||||||
|
break;
|
||||||
|
case Fruit _:
|
||||||
|
AddJudgement(new CatchJudgement { Result = HitResult.Perfect });
|
||||||
|
break;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case BananaShower shower:
|
case BananaShower shower:
|
||||||
foreach (var _ in shower.NestedHitObjects.Cast<CatchHitObject>())
|
foreach (var _ in shower.NestedHitObjects.Cast<CatchHitObject>())
|
||||||
AddJudgement(new CatchJudgement { Result = HitResult.Perfect });
|
AddJudgement(new CatchBananaJudgement { Result = HitResult.Perfect });
|
||||||
AddJudgement(new CatchJudgement { Result = HitResult.Perfect });
|
|
||||||
break;
|
break;
|
||||||
case Fruit _:
|
case Fruit _:
|
||||||
AddJudgement(new CatchJudgement { Result = HitResult.Perfect });
|
AddJudgement(new CatchJudgement { Result = HitResult.Perfect });
|
||||||
|
@ -38,14 +38,16 @@ namespace osu.Game.Rulesets.Catch.UI
|
|||||||
{
|
{
|
||||||
switch (h)
|
switch (h)
|
||||||
{
|
{
|
||||||
|
case BananaShower.Banana banana:
|
||||||
|
return new DrawableBanana(banana);
|
||||||
case Fruit fruit:
|
case Fruit fruit:
|
||||||
return new DrawableFruit(fruit);
|
return new DrawableFruit(fruit);
|
||||||
case JuiceStream stream:
|
case JuiceStream stream:
|
||||||
return new DrawableJuiceStream(stream, GetVisualRepresentation);
|
return new DrawableJuiceStream(stream, GetVisualRepresentation);
|
||||||
case BananaShower banana:
|
case BananaShower shower:
|
||||||
return new DrawableBananaShower(banana, GetVisualRepresentation);
|
return new DrawableBananaShower(shower, GetVisualRepresentation);
|
||||||
case TinyDroplet tiny:
|
case TinyDroplet tiny:
|
||||||
return new DrawableDroplet(tiny) { Scale = new Vector2(0.5f) };
|
return new DrawableTinyDroplet(tiny);
|
||||||
case Droplet droplet:
|
case Droplet droplet:
|
||||||
return new DrawableDroplet(droplet);
|
return new DrawableDroplet(droplet);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user