1
0
mirror of https://github.com/ppy/osu.git synced 2025-03-13 05:37:44 +08:00

initial commit

This commit is contained in:
Givikap120 2024-08-25 15:56:22 +03:00
parent d93ca3de23
commit 59a578b468
4 changed files with 64 additions and 10 deletions

View File

@ -6,27 +6,18 @@ using System.Linq;
using osu.Game.Beatmaps; using osu.Game.Beatmaps;
using osu.Game.Rulesets.Mania.Objects; using osu.Game.Rulesets.Mania.Objects;
using osu.Game.Rulesets.Mods; using osu.Game.Rulesets.Mods;
using osu.Framework.Graphics.Sprites;
using System.Collections.Generic; using System.Collections.Generic;
using osu.Framework.Localisation; using osu.Framework.Localisation;
using osu.Game.Rulesets.Mania.Beatmaps; using osu.Game.Rulesets.Mania.Beatmaps;
namespace osu.Game.Rulesets.Mania.Mods namespace osu.Game.Rulesets.Mania.Mods
{ {
public class ManiaModHoldOff : Mod, IApplicableAfterBeatmapConversion public class ManiaModHoldOff : ModHoldOff, IApplicableAfterBeatmapConversion
{ {
public override string Name => "Hold Off";
public override string Acronym => "HO";
public override double ScoreMultiplier => 0.9; public override double ScoreMultiplier => 0.9;
public override LocalisableString Description => @"Replaces all hold notes with normal notes."; public override LocalisableString Description => @"Replaces all hold notes with normal notes.";
public override IconUsage? Icon => FontAwesome.Solid.DotCircle;
public override ModType Type => ModType.Conversion;
public override Type[] IncompatibleMods => new[] { typeof(ManiaModInvert), typeof(ManiaModNoRelease) }; public override Type[] IncompatibleMods => new[] { typeof(ManiaModInvert), typeof(ManiaModNoRelease) };
public void ApplyToBeatmap(IBeatmap beatmap) public void ApplyToBeatmap(IBeatmap beatmap)

View File

@ -0,0 +1,44 @@
// 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.
using System;
using System.Linq;
using osu.Game.Beatmaps;
using osu.Game.Rulesets.Osu.Objects;
using osu.Game.Rulesets.Mods;
using System.Collections.Generic;
using osu.Framework.Localisation;
using osu.Game.Rulesets.Osu.Beatmaps;
using osu.Game.Rulesets.Objects.Types;
namespace osu.Game.Rulesets.Osu.Mods
{
public class OsuModHoldOff : ModHoldOff, IApplicableAfterBeatmapConversion
{
public override double ScoreMultiplier => 0.7;
public override LocalisableString Description => @"Replaces all sliders with circles.";
public override Type[] IncompatibleMods => new[] { typeof(OsuModStrictTracking) };
public void ApplyToBeatmap(IBeatmap beatmap)
{
var osuBeatmap = (OsuBeatmap)beatmap;
var newObjects = new List<OsuHitObject>();
foreach (var s in beatmap.HitObjects.OfType<Slider>())
{
newObjects.Add(new HitCircle
{
StartTime = s.StartTime,
Position = s.Position,
NewCombo = s.NewCombo,
Samples = s.GetNodeSamples(0)
});
}
osuBeatmap.HitObjects = osuBeatmap.HitObjects.Where(o => o is not Slider).Concat(newObjects).OrderBy(h => h.StartTime).ToList();
}
}
}

View File

@ -182,6 +182,7 @@ namespace osu.Game.Rulesets.Osu
new OsuModClassic(), new OsuModClassic(),
new OsuModRandom(), new OsuModRandom(),
new OsuModMirror(), new OsuModMirror(),
new OsuModHoldOff(),
new MultiMod(new OsuModAlternate(), new OsuModSingleTap()) new MultiMod(new OsuModAlternate(), new OsuModSingleTap())
}; };

View File

@ -0,0 +1,18 @@
// 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.
using osu.Framework.Graphics.Sprites;
namespace osu.Game.Rulesets.Mods
{
public abstract class ModHoldOff : Mod
{
public override string Name => "Hold Off";
public override string Acronym => "HO";
public override IconUsage? Icon => FontAwesome.Solid.DotCircle;
public override ModType Type => ModType.Conversion;
}
}