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
|
|
|
|
|
2022-06-17 07:37:17 +00:00
|
|
|
|
#nullable disable
|
|
|
|
|
|
2020-11-30 10:04:09 +00:00
|
|
|
|
using JetBrains.Annotations;
|
2017-10-10 07:34:01 +00:00
|
|
|
|
using osu.Framework.Allocation;
|
2020-02-19 08:55:40 +00:00
|
|
|
|
using osu.Framework.Graphics;
|
2020-12-07 03:35:24 +00:00
|
|
|
|
using osu.Game.Rulesets.Catch.Skinning.Default;
|
2020-02-19 04:27:15 +00:00
|
|
|
|
using osu.Game.Skinning;
|
2018-04-13 09:19:50 +00:00
|
|
|
|
|
2020-02-19 09:01:59 +00:00
|
|
|
|
namespace osu.Game.Rulesets.Catch.Objects.Drawables
|
2017-10-10 07:34:01 +00:00
|
|
|
|
{
|
2020-12-09 01:25:35 +00:00
|
|
|
|
public class DrawableDroplet : DrawablePalpableCatchHitObject
|
2017-10-10 07:34:01 +00:00
|
|
|
|
{
|
2020-11-30 10:04:09 +00:00
|
|
|
|
public DrawableDroplet()
|
|
|
|
|
: this(null)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public DrawableDroplet([CanBeNull] CatchHitObject h)
|
2017-10-10 07:34:01 +00:00
|
|
|
|
: base(h)
|
|
|
|
|
{
|
|
|
|
|
}
|
2018-04-13 09:19:50 +00:00
|
|
|
|
|
2017-10-10 07:34:01 +00:00
|
|
|
|
[BackgroundDependencyLoader]
|
|
|
|
|
private void load()
|
2020-11-27 02:40:38 +00:00
|
|
|
|
{
|
2020-12-10 10:42:01 +00:00
|
|
|
|
ScalingContainer.Child = new SkinnableDrawable(
|
2020-11-27 02:40:38 +00:00
|
|
|
|
new CatchSkinComponent(CatchSkinComponents.Droplet),
|
2020-12-10 10:42:01 +00:00
|
|
|
|
_ => new DropletPiece());
|
2020-02-19 06:16:19 +00:00
|
|
|
|
}
|
2020-02-19 08:55:40 +00:00
|
|
|
|
|
|
|
|
|
protected override void UpdateInitialTransforms()
|
|
|
|
|
{
|
|
|
|
|
base.UpdateInitialTransforms();
|
|
|
|
|
|
|
|
|
|
// roughly matches osu-stable
|
2020-12-02 07:54:18 +00:00
|
|
|
|
float startRotation = RandomSingle(1) * 20;
|
2020-02-19 08:55:40 +00:00
|
|
|
|
double duration = HitObject.TimePreempt + 2000;
|
|
|
|
|
|
2020-12-10 10:42:01 +00:00
|
|
|
|
ScalingContainer.RotateTo(startRotation).RotateTo(startRotation + 720, duration);
|
2020-02-19 08:55:40 +00:00
|
|
|
|
}
|
2017-10-10 07:34:01 +00:00
|
|
|
|
}
|
|
|
|
|
}
|