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
|
|
|
|
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using osu.Framework.Extensions.IEnumerableExtensions;
|
|
|
|
|
using osu.Game.Rulesets.Mods;
|
2018-04-19 13:04:12 +00:00
|
|
|
|
using osu.Game.Rulesets.Objects;
|
2018-04-13 09:19:50 +00:00
|
|
|
|
using osu.Game.Rulesets.Osu.Objects;
|
|
|
|
|
using osu.Game.Rulesets.Osu.UI;
|
2018-11-20 07:51:59 +00:00
|
|
|
|
using osuTK;
|
2018-04-13 09:19:50 +00:00
|
|
|
|
|
|
|
|
|
namespace osu.Game.Rulesets.Osu.Mods
|
|
|
|
|
{
|
2018-04-19 13:04:12 +00:00
|
|
|
|
public class OsuModHardRock : ModHardRock, IApplicableToHitObject
|
2018-04-13 09:19:50 +00:00
|
|
|
|
{
|
|
|
|
|
public override double ScoreMultiplier => 1.06;
|
|
|
|
|
public override bool Ranked => true;
|
|
|
|
|
|
2018-04-19 13:04:12 +00:00
|
|
|
|
public void ApplyToHitObject(HitObject hitObject)
|
2018-04-13 09:19:50 +00:00
|
|
|
|
{
|
2018-04-19 13:04:12 +00:00
|
|
|
|
var osuObject = (OsuHitObject)hitObject;
|
|
|
|
|
|
|
|
|
|
osuObject.Position = new Vector2(osuObject.Position.X, OsuPlayfield.BASE_SIZE.Y - osuObject.Y);
|
2018-04-13 09:19:50 +00:00
|
|
|
|
|
2019-11-21 16:02:40 +00:00
|
|
|
|
if (!(hitObject is Slider slider))
|
|
|
|
|
return;
|
2018-04-13 09:19:50 +00:00
|
|
|
|
|
2019-11-21 16:02:40 +00:00
|
|
|
|
slider.NestedHitObjects.OfType<SliderTick>().ForEach(h => h.Position = new Vector2(h.Position.X, OsuPlayfield.BASE_SIZE.Y - h.Position.Y));
|
2020-03-19 05:42:02 +00:00
|
|
|
|
slider.NestedHitObjects.OfType<SliderRepeat>().ForEach(h => h.Position = new Vector2(h.Position.X, OsuPlayfield.BASE_SIZE.Y - h.Position.Y));
|
2018-04-13 09:19:50 +00:00
|
|
|
|
|
2020-05-11 04:03:59 +00:00
|
|
|
|
var controlPoints = slider.Path.ControlPoints.Select(p => new PathControlPoint(p.Position.Value, p.Type.Value)).ToArray();
|
|
|
|
|
foreach (var point in controlPoints)
|
2019-12-05 10:53:31 +00:00
|
|
|
|
point.Position.Value = new Vector2(point.Position.Value.X, -point.Position.Value.Y);
|
2020-05-11 04:03:59 +00:00
|
|
|
|
|
|
|
|
|
slider.Path = new SliderPath(controlPoints, slider.Path.ExpectedDistance.Value);
|
2018-04-13 09:19:50 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|