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
|
|
|
|
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using osu.Framework.Extensions.IEnumerableExtensions;
|
|
|
|
|
using osu.Game.Rulesets.Mods;
|
2018-04-19 21:04:12 +08:00
|
|
|
|
using osu.Game.Rulesets.Objects;
|
2018-04-13 17:19:50 +08:00
|
|
|
|
using osu.Game.Rulesets.Osu.Objects;
|
|
|
|
|
using osu.Game.Rulesets.Osu.UI;
|
2018-11-20 15:51:59 +08:00
|
|
|
|
using osuTK;
|
2018-04-13 17:19:50 +08:00
|
|
|
|
|
|
|
|
|
namespace osu.Game.Rulesets.Osu.Mods
|
|
|
|
|
{
|
2018-04-19 21:04:12 +08:00
|
|
|
|
public class OsuModHardRock : ModHardRock, IApplicableToHitObject
|
2018-04-13 17:19:50 +08:00
|
|
|
|
{
|
|
|
|
|
public override double ScoreMultiplier => 1.06;
|
|
|
|
|
public override bool Ranked => true;
|
|
|
|
|
|
2018-04-19 21:04:12 +08:00
|
|
|
|
public void ApplyToHitObject(HitObject hitObject)
|
2018-04-13 17:19:50 +08:00
|
|
|
|
{
|
2018-04-19 21:04:12 +08:00
|
|
|
|
var osuObject = (OsuHitObject)hitObject;
|
|
|
|
|
|
|
|
|
|
osuObject.Position = new Vector2(osuObject.Position.X, OsuPlayfield.BASE_SIZE.Y - osuObject.Y);
|
2018-04-13 17:19:50 +08:00
|
|
|
|
|
|
|
|
|
var slider = hitObject as Slider;
|
|
|
|
|
if (slider == null)
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
slider.NestedHitObjects.OfType<SliderTick>().ForEach(h => h.Position = new Vector2(h.Position.X, OsuPlayfield.BASE_SIZE.Y - h.Position.Y));
|
|
|
|
|
slider.NestedHitObjects.OfType<RepeatPoint>().ForEach(h => h.Position = new Vector2(h.Position.X, OsuPlayfield.BASE_SIZE.Y - h.Position.Y));
|
|
|
|
|
|
2018-11-01 14:38:19 +08:00
|
|
|
|
var newControlPoints = new Vector2[slider.Path.ControlPoints.Length];
|
|
|
|
|
for (int i = 0; i < slider.Path.ControlPoints.Length; i++)
|
2018-11-12 15:20:38 +08:00
|
|
|
|
newControlPoints[i] = new Vector2(slider.Path.ControlPoints[i].X, -slider.Path.ControlPoints[i].Y);
|
2018-04-13 17:19:50 +08:00
|
|
|
|
|
2018-11-01 14:38:19 +08:00
|
|
|
|
slider.Path = new SliderPath(slider.Path.Type, newControlPoints, slider.Path.ExpectedDistance);
|
2018-04-13 17:19:50 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|