mirror of
https://github.com/ppy/osu.git
synced 2025-03-13 00:47:19 +08:00
initial commit
This commit is contained in:
parent
d93ca3de23
commit
59a578b468
@ -6,27 +6,18 @@ using System.Linq;
|
||||
using osu.Game.Beatmaps;
|
||||
using osu.Game.Rulesets.Mania.Objects;
|
||||
using osu.Game.Rulesets.Mods;
|
||||
using osu.Framework.Graphics.Sprites;
|
||||
using System.Collections.Generic;
|
||||
using osu.Framework.Localisation;
|
||||
using osu.Game.Rulesets.Mania.Beatmaps;
|
||||
|
||||
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 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 void ApplyToBeatmap(IBeatmap beatmap)
|
||||
|
44
osu.Game.Rulesets.Osu/Mods/OsuModHoldOff.cs
Normal file
44
osu.Game.Rulesets.Osu/Mods/OsuModHoldOff.cs
Normal 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();
|
||||
}
|
||||
}
|
||||
}
|
@ -182,6 +182,7 @@ namespace osu.Game.Rulesets.Osu
|
||||
new OsuModClassic(),
|
||||
new OsuModRandom(),
|
||||
new OsuModMirror(),
|
||||
new OsuModHoldOff(),
|
||||
new MultiMod(new OsuModAlternate(), new OsuModSingleTap())
|
||||
};
|
||||
|
||||
|
18
osu.Game/Rulesets/Mods/ModHoldOff.cs
Normal file
18
osu.Game/Rulesets/Mods/ModHoldOff.cs
Normal 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;
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user