2019-01-24 16:43:03 +08: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 17:19:50 +08:00
|
|
|
|
|
2020-11-30 18:04:09 +08:00
|
|
|
|
using JetBrains.Annotations;
|
2018-04-13 17:19:50 +08:00
|
|
|
|
using osu.Framework.Allocation;
|
2020-02-19 16:55:40 +08:00
|
|
|
|
using osu.Framework.Graphics;
|
|
|
|
|
using osu.Framework.Utils;
|
2020-11-26 13:26:38 +08:00
|
|
|
|
using osu.Game.Rulesets.Catch.Objects.Drawables.Pieces;
|
2020-02-19 12:27:15 +08:00
|
|
|
|
using osu.Game.Skinning;
|
2018-04-13 17:19:50 +08:00
|
|
|
|
|
2020-02-19 17:01:59 +08:00
|
|
|
|
namespace osu.Game.Rulesets.Catch.Objects.Drawables
|
2018-04-13 17:19:50 +08:00
|
|
|
|
{
|
2020-11-24 18:13:46 +08:00
|
|
|
|
public class DrawableDroplet : DrawablePalpableCatchHitObject
|
2018-04-13 17:19:50 +08:00
|
|
|
|
{
|
2018-06-15 14:44:47 +08:00
|
|
|
|
public override bool StaysOnPlate => false;
|
|
|
|
|
|
2020-11-30 18:04:09 +08:00
|
|
|
|
public DrawableDroplet()
|
|
|
|
|
: this(null)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public DrawableDroplet([CanBeNull] CatchHitObject h)
|
2018-04-13 17:19:50 +08:00
|
|
|
|
: base(h)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[BackgroundDependencyLoader]
|
|
|
|
|
private void load()
|
|
|
|
|
{
|
2020-11-27 10:40:38 +08:00
|
|
|
|
HyperDash.BindValueChanged(_ => updatePiece(), true);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void updatePiece()
|
|
|
|
|
{
|
|
|
|
|
ScaleContainer.Child = new SkinnableDrawable(
|
|
|
|
|
new CatchSkinComponent(CatchSkinComponents.Droplet),
|
|
|
|
|
_ => new DropletPiece
|
|
|
|
|
{
|
|
|
|
|
HyperDash = { BindTarget = HyperDash }
|
|
|
|
|
});
|
2020-02-19 14:16:19 +08:00
|
|
|
|
}
|
2020-02-19 16:55:40 +08:00
|
|
|
|
|
|
|
|
|
protected override void UpdateInitialTransforms()
|
|
|
|
|
{
|
|
|
|
|
base.UpdateInitialTransforms();
|
|
|
|
|
|
|
|
|
|
// roughly matches osu-stable
|
|
|
|
|
float startRotation = RNG.NextSingle() * 20;
|
|
|
|
|
double duration = HitObject.TimePreempt + 2000;
|
|
|
|
|
|
2020-03-10 18:30:31 +08:00
|
|
|
|
ScaleContainer.RotateTo(startRotation).RotateTo(startRotation + 720, duration);
|
2020-02-19 16:55:40 +08:00
|
|
|
|
}
|
2018-04-13 17:19:50 +08:00
|
|
|
|
}
|
|
|
|
|
}
|