2019-01-24 08:43:03 +00:00
|
|
|
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
|
|
|
|
// See the LICENCE file in the repository root for full licence text.
|
2018-04-13 09:19:50 +00:00
|
|
|
|
|
2020-11-27 05:34:12 +00:00
|
|
|
|
using System;
|
2021-03-06 14:06:16 +00:00
|
|
|
|
using System.Collections.Generic;
|
2018-09-19 16:30:25 +00:00
|
|
|
|
using System.Linq;
|
2016-11-14 08:23:33 +00:00
|
|
|
|
using osu.Framework.Allocation;
|
2016-09-02 10:58:57 +00:00
|
|
|
|
using osu.Framework.Graphics;
|
2018-09-19 16:30:25 +00:00
|
|
|
|
using osu.Framework.Graphics.Containers;
|
2017-03-21 06:09:54 +00:00
|
|
|
|
using osu.Game.Graphics;
|
2018-09-19 16:30:25 +00:00
|
|
|
|
using osu.Game.Rulesets.Objects.Drawables;
|
2017-09-06 08:02:13 +00:00
|
|
|
|
using osu.Game.Rulesets.Judgements;
|
2020-12-13 18:29:41 +00:00
|
|
|
|
using osu.Game.Rulesets.Objects;
|
2020-09-25 10:25:58 +00:00
|
|
|
|
using osu.Game.Rulesets.Scoring;
|
2018-03-07 10:14:42 +00:00
|
|
|
|
using osu.Game.Rulesets.UI;
|
2018-01-04 10:22:15 +00:00
|
|
|
|
using osu.Game.Rulesets.UI.Scrolling;
|
2018-09-19 16:30:25 +00:00
|
|
|
|
using osu.Game.Rulesets.Taiko.Objects.Drawables;
|
|
|
|
|
using osu.Game.Rulesets.Taiko.Judgements;
|
2020-03-23 03:08:15 +00:00
|
|
|
|
using osu.Game.Rulesets.Taiko.Objects;
|
2021-03-06 14:06:16 +00:00
|
|
|
|
using osu.Game.Rulesets.Taiko.Scoring;
|
2020-04-21 10:00:34 +00:00
|
|
|
|
using osu.Game.Skinning;
|
2018-04-13 09:19:50 +00:00
|
|
|
|
|
2017-04-18 07:05:58 +00:00
|
|
|
|
namespace osu.Game.Rulesets.Taiko.UI
|
2016-09-02 10:58:57 +00:00
|
|
|
|
{
|
2017-12-26 05:18:23 +00:00
|
|
|
|
public partial class TaikoPlayfield : ScrollingPlayfield
|
2016-09-02 10:58:57 +00:00
|
|
|
|
{
|
2017-03-21 06:09:54 +00:00
|
|
|
|
/// <summary>
|
2024-01-19 20:48:05 +00:00
|
|
|
|
/// Base height of a <see cref="TaikoPlayfield"/> when inside a <see cref="DrawableTaikoRuleset"/>.
|
2017-03-21 06:09:54 +00:00
|
|
|
|
/// </summary>
|
2024-01-19 20:48:05 +00:00
|
|
|
|
public const float BASE_HEIGHT = 200;
|
2018-04-13 09:19:50 +00:00
|
|
|
|
|
2024-01-19 20:26:35 +00:00
|
|
|
|
public const float INPUT_DRUM_WIDTH = 180f;
|
|
|
|
|
|
2023-10-17 07:54:59 +00:00
|
|
|
|
public Container UnderlayElements { get; private set; } = null!;
|
|
|
|
|
|
2024-01-15 11:49:00 +00:00
|
|
|
|
private Container<HitExplosion> hitExplosionContainer = null!;
|
|
|
|
|
private Container<KiaiHitExplosion> kiaiExplosionContainer = null!;
|
|
|
|
|
private JudgementContainer<DrawableTaikoJudgement> judgementContainer = null!;
|
|
|
|
|
private ScrollingHitObjectContainer drumRollHitContainer = null!;
|
|
|
|
|
internal Drawable HitTarget = null!;
|
2018-04-13 09:19:50 +00:00
|
|
|
|
|
2024-01-15 11:49:00 +00:00
|
|
|
|
private JudgementPooler<DrawableTaikoJudgement> judgementPooler = null!;
|
2021-03-14 14:51:38 +00:00
|
|
|
|
private readonly IDictionary<HitResult, HitExplosionPool> explosionPools = new Dictionary<HitResult, HitExplosionPool>();
|
2021-03-06 14:06:16 +00:00
|
|
|
|
|
2024-01-15 11:49:00 +00:00
|
|
|
|
private ProxyContainer topLevelHitContainer = null!;
|
|
|
|
|
private InputDrum inputDrum = null!;
|
2018-04-13 09:19:50 +00:00
|
|
|
|
|
2020-12-13 18:29:41 +00:00
|
|
|
|
/// <remarks>
|
|
|
|
|
/// <see cref="Playfield.AddNested"/> is purposefully not called on this to prevent i.e. being able to interact
|
|
|
|
|
/// with bar lines in the editor.
|
|
|
|
|
/// </remarks>
|
2024-01-15 11:49:00 +00:00
|
|
|
|
private BarLinePlayfield barLinePlayfield = null!;
|
2020-12-13 18:29:41 +00:00
|
|
|
|
|
2020-04-23 03:33:34 +00:00
|
|
|
|
[BackgroundDependencyLoader]
|
|
|
|
|
private void load(OsuColour colours)
|
2016-09-02 10:58:57 +00:00
|
|
|
|
{
|
2024-01-19 20:58:55 +00:00
|
|
|
|
const float hit_target_width = BASE_HEIGHT;
|
2024-01-19 21:28:26 +00:00
|
|
|
|
const float hit_target_offset = -24f;
|
2024-01-19 20:58:55 +00:00
|
|
|
|
|
2022-07-22 07:18:22 +00:00
|
|
|
|
inputDrum = new InputDrum
|
2022-04-13 01:38:07 +00:00
|
|
|
|
{
|
|
|
|
|
Anchor = Anchor.CentreLeft,
|
|
|
|
|
Origin = Anchor.CentreLeft,
|
|
|
|
|
RelativeSizeAxes = Axes.Y,
|
2024-01-19 20:26:35 +00:00
|
|
|
|
Width = INPUT_DRUM_WIDTH,
|
2022-04-13 01:38:07 +00:00
|
|
|
|
};
|
2022-04-05 23:37:51 +00:00
|
|
|
|
|
2020-04-25 05:47:20 +00:00
|
|
|
|
InternalChildren = new[]
|
2017-03-21 06:09:54 +00:00
|
|
|
|
{
|
2022-11-09 07:04:56 +00:00
|
|
|
|
new SkinnableDrawable(new TaikoSkinComponentLookup(TaikoSkinComponents.PlayfieldBackgroundRight), _ => new PlayfieldBackgroundRight()),
|
2022-04-13 01:38:07 +00:00
|
|
|
|
new Container
|
2022-04-05 23:37:51 +00:00
|
|
|
|
{
|
|
|
|
|
Name = "Left overlay",
|
2024-01-19 20:26:35 +00:00
|
|
|
|
RelativeSizeAxes = Axes.Y,
|
|
|
|
|
Width = INPUT_DRUM_WIDTH,
|
2022-04-05 23:37:51 +00:00
|
|
|
|
BorderColour = colours.Gray0,
|
2022-04-13 01:38:07 +00:00
|
|
|
|
Children = new[]
|
2022-04-05 23:37:51 +00:00
|
|
|
|
{
|
2022-11-09 07:04:56 +00:00
|
|
|
|
new SkinnableDrawable(new TaikoSkinComponentLookup(TaikoSkinComponents.PlayfieldBackgroundLeft), _ => new PlayfieldBackgroundLeft()),
|
2022-04-13 01:38:07 +00:00
|
|
|
|
inputDrum.CreateProxy(),
|
2022-04-05 23:37:51 +00:00
|
|
|
|
}
|
|
|
|
|
},
|
2024-01-19 20:58:55 +00:00
|
|
|
|
new SkinnableDrawable(new TaikoSkinComponentLookup(TaikoSkinComponents.Mascot), _ => Empty())
|
2022-04-05 23:37:51 +00:00
|
|
|
|
{
|
|
|
|
|
Origin = Anchor.BottomLeft,
|
|
|
|
|
Anchor = Anchor.TopLeft,
|
|
|
|
|
RelativePositionAxes = Axes.Y,
|
|
|
|
|
RelativeSizeAxes = Axes.None,
|
|
|
|
|
Y = 0.2f
|
|
|
|
|
},
|
2024-01-19 20:26:35 +00:00
|
|
|
|
new Container
|
2019-03-26 04:31:49 +00:00
|
|
|
|
{
|
|
|
|
|
Name = "Right area",
|
|
|
|
|
RelativeSizeAxes = Axes.Both,
|
2024-01-19 20:26:35 +00:00
|
|
|
|
Padding = new MarginPadding { Left = INPUT_DRUM_WIDTH },
|
2019-03-26 04:31:49 +00:00
|
|
|
|
Children = new Drawable[]
|
2017-08-02 22:46:19 +00:00
|
|
|
|
{
|
2019-03-26 04:31:49 +00:00
|
|
|
|
new Container
|
2017-03-21 06:09:54 +00:00
|
|
|
|
{
|
2024-01-19 20:58:55 +00:00
|
|
|
|
Name = "Elements behind hit objects",
|
|
|
|
|
RelativeSizeAxes = Axes.Y,
|
|
|
|
|
Width = hit_target_width,
|
2024-01-19 21:28:26 +00:00
|
|
|
|
X = hit_target_offset,
|
2020-04-21 10:00:34 +00:00
|
|
|
|
Children = new[]
|
2017-03-21 06:09:54 +00:00
|
|
|
|
{
|
2022-11-29 23:44:20 +00:00
|
|
|
|
new SkinnableDrawable(new TaikoSkinComponentLookup(TaikoSkinComponents.KiaiGlow), _ => Empty())
|
|
|
|
|
{
|
|
|
|
|
RelativeSizeAxes = Axes.Both,
|
|
|
|
|
},
|
2019-03-26 04:31:49 +00:00
|
|
|
|
hitExplosionContainer = new Container<HitExplosion>
|
|
|
|
|
{
|
|
|
|
|
RelativeSizeAxes = Axes.Both,
|
|
|
|
|
},
|
2022-11-09 07:04:56 +00:00
|
|
|
|
HitTarget = new SkinnableDrawable(new TaikoSkinComponentLookup(TaikoSkinComponents.HitTarget), _ => new TaikoHitTarget())
|
2017-03-21 06:09:54 +00:00
|
|
|
|
{
|
2019-03-26 04:31:49 +00:00
|
|
|
|
RelativeSizeAxes = Axes.Both,
|
2017-08-21 06:36:01 +00:00
|
|
|
|
}
|
2019-03-26 04:31:49 +00:00
|
|
|
|
}
|
|
|
|
|
},
|
2024-01-19 20:58:55 +00:00
|
|
|
|
new Container
|
2022-11-08 01:05:06 +00:00
|
|
|
|
{
|
|
|
|
|
Name = "Bar line content",
|
|
|
|
|
RelativeSizeAxes = Axes.Both,
|
2024-01-19 21:28:26 +00:00
|
|
|
|
Padding = new MarginPadding { Left = hit_target_width / 2 + hit_target_offset },
|
2023-10-17 07:54:59 +00:00
|
|
|
|
Children = new Drawable[]
|
|
|
|
|
{
|
|
|
|
|
UnderlayElements = new Container
|
|
|
|
|
{
|
|
|
|
|
RelativeSizeAxes = Axes.Both,
|
|
|
|
|
},
|
|
|
|
|
barLinePlayfield = new BarLinePlayfield(),
|
|
|
|
|
}
|
2022-11-08 01:05:06 +00:00
|
|
|
|
},
|
2024-01-19 20:58:55 +00:00
|
|
|
|
new Container
|
2019-03-26 04:31:49 +00:00
|
|
|
|
{
|
2022-04-05 23:37:51 +00:00
|
|
|
|
Name = "Masked hit objects content",
|
2019-03-26 04:31:49 +00:00
|
|
|
|
RelativeSizeAxes = Axes.Both,
|
2024-01-19 21:28:26 +00:00
|
|
|
|
Padding = new MarginPadding { Left = hit_target_width / 2 + hit_target_offset },
|
2022-04-05 23:37:51 +00:00
|
|
|
|
Masking = true,
|
2022-11-08 01:05:06 +00:00
|
|
|
|
Child = HitObjectContainer,
|
2022-04-05 23:37:51 +00:00
|
|
|
|
},
|
2024-01-19 20:58:55 +00:00
|
|
|
|
new Container
|
2022-04-05 23:37:51 +00:00
|
|
|
|
{
|
2024-01-19 20:58:55 +00:00
|
|
|
|
Name = "Overlay content",
|
2022-04-05 23:37:51 +00:00
|
|
|
|
RelativeSizeAxes = Axes.Both,
|
2024-01-19 21:28:26 +00:00
|
|
|
|
Padding = new MarginPadding { Left = hit_target_width / 2 + hit_target_offset },
|
2022-04-05 23:37:51 +00:00
|
|
|
|
Children = new Drawable[]
|
|
|
|
|
{
|
|
|
|
|
drumRollHitContainer = new DrumRollHitContainer(),
|
2020-04-23 03:33:34 +00:00
|
|
|
|
kiaiExplosionContainer = new Container<KiaiHitExplosion>
|
|
|
|
|
{
|
|
|
|
|
Name = "Kiai hit explosions",
|
2022-11-07 08:12:58 +00:00
|
|
|
|
Origin = Anchor.TopCentre,
|
2020-04-23 03:33:34 +00:00
|
|
|
|
RelativeSizeAxes = Axes.Both,
|
|
|
|
|
FillMode = FillMode.Fit,
|
|
|
|
|
},
|
|
|
|
|
judgementContainer = new JudgementContainer<DrawableTaikoJudgement>
|
|
|
|
|
{
|
|
|
|
|
Name = "Judgements",
|
2022-11-07 08:12:58 +00:00
|
|
|
|
Origin = Anchor.TopCentre,
|
|
|
|
|
RelativeSizeAxes = Axes.Both,
|
|
|
|
|
FillMode = FillMode.Fit,
|
2020-04-23 03:33:34 +00:00
|
|
|
|
},
|
|
|
|
|
}
|
2019-03-26 04:31:49 +00:00
|
|
|
|
},
|
|
|
|
|
}
|
|
|
|
|
},
|
2019-08-28 04:20:28 +00:00
|
|
|
|
topLevelHitContainer = new ProxyContainer
|
2019-03-26 04:31:49 +00:00
|
|
|
|
{
|
|
|
|
|
Name = "Top level hit objects",
|
|
|
|
|
RelativeSizeAxes = Axes.Both,
|
2020-04-22 13:19:29 +00:00
|
|
|
|
},
|
2020-04-27 10:43:51 +00:00
|
|
|
|
drumRollHitContainer.CreateProxy(),
|
2023-06-30 06:07:07 +00:00
|
|
|
|
new SkinnableDrawable(new TaikoSkinComponentLookup(TaikoSkinComponents.DrumSamplePlayer), _ => new DrumSamplePlayer())
|
|
|
|
|
{
|
|
|
|
|
RelativeSizeAxes = Axes.Both,
|
|
|
|
|
},
|
2022-04-13 01:38:07 +00:00
|
|
|
|
// this is added at the end of the hierarchy to receive input before taiko objects.
|
|
|
|
|
// but is proxied below everything to not cover visual effects such as hit explosions.
|
|
|
|
|
inputDrum,
|
2018-09-21 06:08:43 +00:00
|
|
|
|
};
|
2020-12-20 17:16:05 +00:00
|
|
|
|
|
|
|
|
|
RegisterPool<Hit, DrawableHit>(50);
|
|
|
|
|
RegisterPool<Hit.StrongNestedHit, DrawableHit.StrongNestedHit>(50);
|
|
|
|
|
|
|
|
|
|
RegisterPool<DrumRoll, DrawableDrumRoll>(5);
|
|
|
|
|
RegisterPool<DrumRoll.StrongNestedHit, DrawableDrumRoll.StrongNestedHit>(5);
|
|
|
|
|
|
|
|
|
|
RegisterPool<DrumRollTick, DrawableDrumRollTick>(100);
|
|
|
|
|
RegisterPool<DrumRollTick.StrongNestedHit, DrawableDrumRollTick.StrongNestedHit>(100);
|
|
|
|
|
|
|
|
|
|
RegisterPool<Swell, DrawableSwell>(5);
|
|
|
|
|
RegisterPool<SwellTick, DrawableSwellTick>(100);
|
2021-03-06 14:06:16 +00:00
|
|
|
|
|
|
|
|
|
var hitWindows = new TaikoHitWindows();
|
2021-03-14 14:51:38 +00:00
|
|
|
|
|
2024-01-15 11:49:00 +00:00
|
|
|
|
HitResult[] usableHitResults = Enum.GetValues<HitResult>().Where(r => hitWindows.IsHitResultAllowed(r)).ToArray();
|
2021-03-06 14:06:16 +00:00
|
|
|
|
|
2024-01-15 11:49:00 +00:00
|
|
|
|
AddInternal(judgementPooler = new JudgementPooler<DrawableTaikoJudgement>(usableHitResults));
|
|
|
|
|
|
|
|
|
|
foreach (var result in usableHitResults)
|
|
|
|
|
explosionPools.Add(result, new HitExplosionPool(result));
|
2021-03-14 14:51:38 +00:00
|
|
|
|
AddRangeInternal(explosionPools.Values);
|
2016-09-02 10:58:57 +00:00
|
|
|
|
}
|
2018-04-13 09:19:50 +00:00
|
|
|
|
|
2020-12-20 17:07:59 +00:00
|
|
|
|
protected override void LoadComplete()
|
|
|
|
|
{
|
|
|
|
|
base.LoadComplete();
|
|
|
|
|
NewResult += OnNewResult;
|
|
|
|
|
}
|
|
|
|
|
|
2020-12-20 17:11:29 +00:00
|
|
|
|
protected override void OnNewDrawableHitObject(DrawableHitObject drawableHitObject)
|
|
|
|
|
{
|
|
|
|
|
base.OnNewDrawableHitObject(drawableHitObject);
|
|
|
|
|
|
|
|
|
|
var taikoObject = (DrawableTaikoHitObject)drawableHitObject;
|
|
|
|
|
topLevelHitContainer.Add(taikoObject.CreateProxiedContent());
|
|
|
|
|
}
|
|
|
|
|
|
2020-12-13 18:29:41 +00:00
|
|
|
|
#region Pooling support
|
|
|
|
|
|
|
|
|
|
public override void Add(HitObject h)
|
|
|
|
|
{
|
|
|
|
|
switch (h)
|
|
|
|
|
{
|
|
|
|
|
case BarLine barLine:
|
|
|
|
|
barLinePlayfield.Add(barLine);
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case TaikoHitObject taikoHitObject:
|
|
|
|
|
base.Add(taikoHitObject);
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
default:
|
|
|
|
|
throw new ArgumentException($"Unsupported {nameof(HitObject)} type: {h.GetType()}");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override bool Remove(HitObject h)
|
|
|
|
|
{
|
|
|
|
|
switch (h)
|
|
|
|
|
{
|
|
|
|
|
case BarLine barLine:
|
|
|
|
|
return barLinePlayfield.Remove(barLine);
|
|
|
|
|
|
|
|
|
|
case TaikoHitObject taikoHitObject:
|
|
|
|
|
return base.Remove(taikoHitObject);
|
|
|
|
|
|
|
|
|
|
default:
|
|
|
|
|
throw new ArgumentException($"Unsupported {nameof(HitObject)} type: {h.GetType()}");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#region Non-pooling support
|
|
|
|
|
|
2017-09-12 09:19:28 +00:00
|
|
|
|
public override void Add(DrawableHitObject h)
|
2017-03-21 06:09:54 +00:00
|
|
|
|
{
|
2018-07-17 05:35:09 +00:00
|
|
|
|
switch (h)
|
|
|
|
|
{
|
2020-12-13 18:29:41 +00:00
|
|
|
|
case DrawableBarLine barLine:
|
|
|
|
|
barLinePlayfield.Add(barLine);
|
2018-07-17 05:35:09 +00:00
|
|
|
|
break;
|
2019-04-01 03:44:46 +00:00
|
|
|
|
|
2022-06-24 12:25:23 +00:00
|
|
|
|
case DrawableTaikoHitObject:
|
2020-11-27 05:34:12 +00:00
|
|
|
|
base.Add(h);
|
2018-07-17 05:35:09 +00:00
|
|
|
|
break;
|
2020-11-27 05:34:12 +00:00
|
|
|
|
|
|
|
|
|
default:
|
2020-12-13 18:29:41 +00:00
|
|
|
|
throw new ArgumentException($"Unsupported {nameof(DrawableHitObject)} type: {h.GetType()}");
|
2020-11-27 05:34:12 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override bool Remove(DrawableHitObject h)
|
|
|
|
|
{
|
|
|
|
|
switch (h)
|
|
|
|
|
{
|
2020-12-13 18:29:41 +00:00
|
|
|
|
case DrawableBarLine barLine:
|
|
|
|
|
return barLinePlayfield.Remove(barLine);
|
2020-11-27 05:34:12 +00:00
|
|
|
|
|
2022-06-24 12:25:23 +00:00
|
|
|
|
case DrawableTaikoHitObject:
|
2020-11-27 05:34:12 +00:00
|
|
|
|
return base.Remove(h);
|
|
|
|
|
|
|
|
|
|
default:
|
2020-12-13 18:29:41 +00:00
|
|
|
|
throw new ArgumentException($"Unsupported {nameof(DrawableHitObject)} type: {h.GetType()}");
|
2018-07-17 05:35:09 +00:00
|
|
|
|
}
|
2017-03-21 06:09:54 +00:00
|
|
|
|
}
|
2018-04-13 09:19:50 +00:00
|
|
|
|
|
2020-12-13 18:29:41 +00:00
|
|
|
|
#endregion
|
|
|
|
|
|
2018-08-06 01:54:16 +00:00
|
|
|
|
internal void OnNewResult(DrawableHitObject judgedObject, JudgementResult result)
|
2017-03-21 06:09:54 +00:00
|
|
|
|
{
|
2019-02-21 09:56:34 +00:00
|
|
|
|
if (!DisplayJudgements.Value)
|
2018-07-20 08:04:33 +00:00
|
|
|
|
return;
|
2018-08-06 02:31:46 +00:00
|
|
|
|
if (!judgedObject.DisplayResult)
|
2018-08-02 12:08:06 +00:00
|
|
|
|
return;
|
|
|
|
|
|
2018-08-03 07:46:03 +00:00
|
|
|
|
switch (result.Judgement)
|
2017-03-21 07:33:25 +00:00
|
|
|
|
{
|
2022-06-24 12:25:23 +00:00
|
|
|
|
case TaikoStrongJudgement:
|
2018-08-03 07:46:03 +00:00
|
|
|
|
if (result.IsHit)
|
2021-03-14 14:51:38 +00:00
|
|
|
|
hitExplosionContainer.Children.FirstOrDefault(e => e.JudgedObject == ((DrawableStrongNestedHit)judgedObject).ParentHitObject)?.VisualiseSecondHit(result);
|
2018-08-03 07:46:03 +00:00
|
|
|
|
break;
|
2019-04-01 03:44:46 +00:00
|
|
|
|
|
2022-06-24 12:25:23 +00:00
|
|
|
|
case TaikoDrumRollTickJudgement:
|
2020-04-27 03:23:53 +00:00
|
|
|
|
if (!result.IsHit)
|
2020-04-27 03:27:43 +00:00
|
|
|
|
break;
|
2020-04-27 03:23:53 +00:00
|
|
|
|
|
|
|
|
|
var drawableTick = (DrawableDrumRollTick)judgedObject;
|
|
|
|
|
|
|
|
|
|
addDrumRollHit(drawableTick);
|
2020-04-27 03:01:31 +00:00
|
|
|
|
break;
|
|
|
|
|
|
2018-08-03 07:46:03 +00:00
|
|
|
|
default:
|
2022-09-06 08:27:29 +00:00
|
|
|
|
if (!result.Type.IsScorable())
|
|
|
|
|
break;
|
|
|
|
|
|
2024-01-15 11:49:00 +00:00
|
|
|
|
var judgement = judgementPooler.Get(result.Type, j => j.Apply(result, judgedObject));
|
|
|
|
|
|
|
|
|
|
if (judgement == null)
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
judgementContainer.Add(judgement);
|
2018-04-13 09:19:50 +00:00
|
|
|
|
|
2020-04-27 13:22:32 +00:00
|
|
|
|
var type = (judgedObject.HitObject as Hit)?.Type ?? HitType.Centre;
|
2020-09-25 10:25:58 +00:00
|
|
|
|
addExplosion(judgedObject, result.Type, type);
|
2018-08-03 07:46:03 +00:00
|
|
|
|
break;
|
2017-04-03 01:20:20 +00:00
|
|
|
|
}
|
2020-04-22 13:19:29 +00:00
|
|
|
|
}
|
2019-08-28 04:20:28 +00:00
|
|
|
|
|
2020-04-27 07:48:17 +00:00
|
|
|
|
private void addDrumRollHit(DrawableDrumRollTick drawableTick) =>
|
|
|
|
|
drumRollHitContainer.Add(new DrawableFlyingHit(drawableTick));
|
2020-04-27 03:01:31 +00:00
|
|
|
|
|
2020-09-27 13:23:34 +00:00
|
|
|
|
private void addExplosion(DrawableHitObject drawableObject, HitResult result, HitType type)
|
2020-04-27 03:23:53 +00:00
|
|
|
|
{
|
2021-03-14 14:51:38 +00:00
|
|
|
|
hitExplosionContainer.Add(explosionPools[result]
|
|
|
|
|
.Get(explosion => explosion.Apply(drawableObject)));
|
2020-04-27 03:23:53 +00:00
|
|
|
|
if (drawableObject.HitObject.Kiai)
|
|
|
|
|
kiaiExplosionContainer.Add(new KiaiHitExplosion(drawableObject, type));
|
2020-09-27 13:23:34 +00:00
|
|
|
|
}
|
2020-04-27 03:23:53 +00:00
|
|
|
|
|
2020-04-26 23:40:57 +00:00
|
|
|
|
private partial class ProxyContainer : LifetimeManagementContainer
|
2020-04-22 13:19:29 +00:00
|
|
|
|
{
|
2022-06-07 09:35:10 +00:00
|
|
|
|
public void Add(Drawable proxy) => AddInternal(proxy);
|
|
|
|
|
|
2024-05-22 08:29:39 +00:00
|
|
|
|
public override bool UpdateSubTreeMasking()
|
2020-04-26 23:40:57 +00:00
|
|
|
|
{
|
2022-06-07 09:35:10 +00:00
|
|
|
|
// DrawableHitObject disables masking.
|
|
|
|
|
// Hitobject content is proxied and unproxied based on hit status and the IsMaskedAway value could get stuck because of this.
|
|
|
|
|
return false;
|
2020-04-26 23:40:57 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
2016-09-02 10:58:57 +00:00
|
|
|
|
}
|
2017-08-21 06:36:01 +00:00
|
|
|
|
}
|