1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-19 13:52:54 +08:00
osu-lazer/osu.Game.Rulesets.Mania/Mods/ManiaMod.cs

198 lines
6.1 KiB
C#
Raw Normal View History

2017-03-02 08:57:33 +08:00
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using osu.Game.Graphics;
2017-04-18 15:05:58 +08:00
using osu.Game.Rulesets.Mods;
using System;
2017-09-13 23:35:05 +08:00
using System.Linq;
using osu.Framework.Extensions.IEnumerableExtensions;
using osu.Framework.MathUtils;
using osu.Game.Beatmaps;
using osu.Game.Rulesets.Mania.Objects;
using osu.Game.Rulesets.Mania.Replays;
using osu.Game.Rulesets.Mania.UI;
using osu.Game.Rulesets.Scoring;
using osu.Game.Users;
using osu.Game.Rulesets.UI;
2017-03-02 08:57:33 +08:00
2017-04-18 15:05:58 +08:00
namespace osu.Game.Rulesets.Mania.Mods
2017-03-02 08:57:33 +08:00
{
public class ManiaModNoFail : ModNoFail
{
}
public class ManiaModEasy : ModEasy
{
}
public class ManiaModHidden : ModHidden
{
public override string Description => @"The notes fade out before you hit them!";
public override double ScoreMultiplier => 1.0;
public override Type[] IncompatibleMods => new[] { typeof(ModFlashlight) };
2017-03-02 08:57:33 +08:00
}
public class ManiaModHardRock : ModHardRock
{
public override double ScoreMultiplier => 1.0;
}
public class ManiaModSuddenDeath : ModSuddenDeath
{
}
2017-05-31 00:49:06 +08:00
public class ManiaModDaycore : ModDaycore
{
2017-05-31 01:27:10 +08:00
public override double ScoreMultiplier => 0.3;
2017-05-31 00:49:06 +08:00
}
2017-03-02 08:57:33 +08:00
public class ManiaModDoubleTime : ModDoubleTime
{
public override double ScoreMultiplier => 1.0;
}
public class ManiaModHalfTime : ModHalfTime
{
public override double ScoreMultiplier => 0.3;
}
public class ManiaModNightcore : ModNightcore
{
public override double ScoreMultiplier => 1.0;
}
public class ManiaModFlashlight : ModFlashlight
{
public override double ScoreMultiplier => 1.0;
public override Type[] IncompatibleMods => new[] { typeof(ModHidden) };
2017-03-02 08:57:33 +08:00
}
public class ManiaModPerfect : ModPerfect
{
}
2017-03-02 08:57:33 +08:00
public class ManiaModFadeIn : Mod
{
public override string Name => "FadeIn";
public override string ShortenedName => "FI";
2017-03-02 08:57:33 +08:00
public override FontAwesome Icon => FontAwesome.fa_osu_mod_hidden;
2017-05-03 02:36:55 +08:00
public override ModType Type => ModType.DifficultyIncrease;
2017-03-02 08:57:33 +08:00
public override double ScoreMultiplier => 1;
public override bool Ranked => true;
public override Type[] IncompatibleMods => new[] { typeof(ModFlashlight) };
2017-03-02 08:57:33 +08:00
}
2017-09-13 23:35:05 +08:00
public class ManiaModRandom : Mod, IApplicableMod<ManiaHitObject>
2017-03-02 08:57:33 +08:00
{
public override string Name => "Random";
public override string ShortenedName => "RD";
2017-09-14 18:04:05 +08:00
public override FontAwesome Icon => FontAwesome.fa_osu_dice;
2017-03-02 08:57:33 +08:00
public override string Description => @"Shuffle around the notes!";
public override double ScoreMultiplier => 1;
2017-09-14 08:32:10 +08:00
2017-09-13 23:35:05 +08:00
public void ApplyToRulesetContainer(RulesetContainer<ManiaHitObject> rulesetContainer)
{
int availableColumns = ((ManiaRulesetContainer)rulesetContainer).AvailableColumns;
2017-09-14 18:04:05 +08:00
2017-09-13 23:35:05 +08:00
var shuffledColumns = Enumerable.Range(0, availableColumns).OrderBy(item => RNG.Next()).ToList();
rulesetContainer.Objects.OfType<ManiaHitObject>().ForEach(h => h.Column = shuffledColumns[h.Column]);
}
2017-03-02 08:57:33 +08:00
}
public abstract class ManiaKeyMod : Mod
{
public override string ShortenedName => Name;
2017-03-02 08:57:33 +08:00
public abstract int KeyCount { get; }
public override double ScoreMultiplier => 1; // TODO: Implement the mania key mod score multiplier
public override bool Ranked => true;
}
public class ManiaModKey1 : ManiaKeyMod
{
public override int KeyCount => 1;
public override string Name => "1K";
2017-03-02 08:57:33 +08:00
}
public class ManiaModKey2 : ManiaKeyMod
{
public override int KeyCount => 2;
public override string Name => "2K";
2017-03-02 08:57:33 +08:00
}
public class ManiaModKey3 : ManiaKeyMod
{
public override int KeyCount => 3;
public override string Name => "3K";
2017-03-02 08:57:33 +08:00
}
public class ManiaModKey4 : ManiaKeyMod
{
public override int KeyCount => 4;
public override string Name => "4K";
2017-03-02 08:57:33 +08:00
}
public class ManiaModKey5 : ManiaKeyMod
{
public override int KeyCount => 5;
public override string Name => "5K";
2017-03-02 08:57:33 +08:00
}
public class ManiaModKey6 : ManiaKeyMod
{
public override int KeyCount => 6;
public override string Name => "6K";
2017-03-02 08:57:33 +08:00
}
public class ManiaModKey7 : ManiaKeyMod
{
public override int KeyCount => 7;
public override string Name => "7K";
2017-03-02 08:57:33 +08:00
}
public class ManiaModKey8 : ManiaKeyMod
{
public override int KeyCount => 8;
public override string Name => "8K";
2017-03-02 08:57:33 +08:00
}
public class ManiaModKey9 : ManiaKeyMod
{
public override int KeyCount => 9;
public override string Name => "9K";
2017-03-02 08:57:33 +08:00
}
public class ManiaModKeyCoop : Mod
{
public override string Name => "KeyCoop";
2017-08-14 04:37:39 +08:00
public override string ShortenedName => "2P";
2017-03-02 08:57:33 +08:00
public override string Description => @"Double the key amount, double the fun!";
public override double ScoreMultiplier => 1;
public override bool Ranked => true;
}
public class ManiaModAutoplay : ModAutoplay<ManiaHitObject>
{
private int availableColumns;
public override void ApplyToRulesetContainer(RulesetContainer<ManiaHitObject> rulesetContainer)
{
// Todo: This shouldn't be done, we should be getting a ManiaBeatmap which should store AvailableColumns
// But this is dependent on a _lot_ of refactoring
var maniaRulesetContainer = (ManiaRulesetContainer)rulesetContainer;
availableColumns = maniaRulesetContainer.AvailableColumns;
base.ApplyToRulesetContainer(rulesetContainer);
}
protected override Score CreateReplayScore(Beatmap<ManiaHitObject> beatmap) => new Score
{
User = new User { Username = "osu!topus!" },
Replay = new ManiaAutoGenerator(beatmap, availableColumns).Generate(),
};
}
2017-03-02 08:57:33 +08:00
}