2020-11-24 23:00:11 +00:00
|
|
|
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
2020-11-24 10:16:03 +00:00
|
|
|
|
// See the LICENCE file in the repository root for full licence text.
|
|
|
|
|
|
2021-06-22 08:33:32 +00:00
|
|
|
|
using Newtonsoft.Json;
|
2020-11-27 01:31:18 +00:00
|
|
|
|
using osu.Framework.Bindables;
|
2022-07-19 01:35:07 +00:00
|
|
|
|
using osu.Game.Rulesets.Objects;
|
2020-11-26 09:14:25 +00:00
|
|
|
|
using osu.Game.Rulesets.Objects.Types;
|
2021-05-05 04:17:27 +00:00
|
|
|
|
using osu.Game.Skinning;
|
2020-11-26 09:14:25 +00:00
|
|
|
|
using osuTK.Graphics;
|
|
|
|
|
|
2020-11-24 10:16:03 +00:00
|
|
|
|
namespace osu.Game.Rulesets.Catch.Objects
|
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Represents a single object that can be caught by the catcher.
|
2020-11-24 23:00:11 +00:00
|
|
|
|
/// This includes normal fruits, droplets, and bananas but excludes objects that act only as a container of nested hit objects.
|
2020-11-24 10:16:03 +00:00
|
|
|
|
/// </summary>
|
2020-11-26 09:14:25 +00:00
|
|
|
|
public abstract class PalpableCatchHitObject : CatchHitObject, IHasComboInformation
|
2020-11-24 10:16:03 +00:00
|
|
|
|
{
|
2020-11-24 10:57:37 +00:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Difference between the distance to the next object
|
|
|
|
|
/// and the distance that would have triggered a hyper dash.
|
|
|
|
|
/// A value close to 0 indicates a difficult jump (for difficulty calculation).
|
|
|
|
|
/// </summary>
|
|
|
|
|
public float DistanceToHyperDash { get; set; }
|
|
|
|
|
|
2022-07-19 01:35:07 +00:00
|
|
|
|
private HitObjectProperty<bool> hyperDash;
|
|
|
|
|
|
|
|
|
|
public Bindable<bool> HyperDashBindable => hyperDash.Bindable;
|
2020-11-27 01:31:18 +00:00
|
|
|
|
|
2020-11-24 10:57:37 +00:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Whether this fruit can initiate a hyperdash.
|
|
|
|
|
/// </summary>
|
2022-07-19 01:35:07 +00:00
|
|
|
|
public bool HyperDash => hyperDash.Value;
|
2020-11-27 01:31:18 +00:00
|
|
|
|
|
2023-01-15 07:23:45 +00:00
|
|
|
|
private CatchHitObject? hyperDashTarget;
|
2020-11-24 10:57:37 +00:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// The target fruit if we are to initiate a hyperdash.
|
|
|
|
|
/// </summary>
|
2021-06-22 08:33:32 +00:00
|
|
|
|
[JsonIgnore]
|
2023-01-15 07:23:45 +00:00
|
|
|
|
public CatchHitObject? HyperDashTarget
|
2020-11-27 01:31:18 +00:00
|
|
|
|
{
|
|
|
|
|
get => hyperDashTarget;
|
|
|
|
|
set
|
|
|
|
|
{
|
|
|
|
|
hyperDashTarget = value;
|
|
|
|
|
HyperDashBindable.Value = value != null;
|
|
|
|
|
}
|
|
|
|
|
}
|
2020-11-26 09:14:25 +00:00
|
|
|
|
|
2021-05-05 04:17:27 +00:00
|
|
|
|
Color4 IHasComboInformation.GetComboColour(ISkin skin) => IHasComboInformation.GetSkinComboColour(this, skin, IndexInBeatmap + 1);
|
2020-11-24 10:16:03 +00:00
|
|
|
|
}
|
|
|
|
|
}
|