2017-02-17 04:05:03 +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 System;
|
|
|
|
|
using osu.Game.Graphics;
|
2017-03-06 13:52:37 +08:00
|
|
|
|
using osu.Game.Screens.Play;
|
2017-02-17 04:05:03 +08:00
|
|
|
|
|
|
|
|
|
namespace osu.Game.Modes
|
|
|
|
|
{
|
2017-02-23 19:59:27 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// The base class for gameplay modifiers.
|
|
|
|
|
/// </summary>
|
2017-02-18 19:44:46 +08:00
|
|
|
|
public abstract class Mod
|
2017-02-17 04:05:03 +08:00
|
|
|
|
{
|
2017-02-23 19:57:58 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// The name of this mod.
|
|
|
|
|
/// </summary>
|
2017-03-06 17:28:30 +08:00
|
|
|
|
public abstract string Name { get; }
|
2017-02-23 19:57:58 +08:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// The icon of this mod.
|
|
|
|
|
/// </summary>
|
2017-03-06 17:28:30 +08:00
|
|
|
|
public virtual FontAwesome Icon => FontAwesome.fa_question;
|
2017-02-23 19:57:58 +08:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
2017-03-02 08:57:33 +08:00
|
|
|
|
/// The user readable description of this mod.
|
2017-02-23 19:57:58 +08:00
|
|
|
|
/// </summary>
|
2017-03-06 17:28:30 +08:00
|
|
|
|
public virtual string Description => string.Empty;
|
2017-02-23 19:57:58 +08:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
2017-03-02 08:57:33 +08:00
|
|
|
|
/// The score multiplier of this mod.
|
2017-02-23 19:57:58 +08:00
|
|
|
|
/// </summary>
|
2017-03-02 08:57:33 +08:00
|
|
|
|
public abstract double ScoreMultiplier { get; }
|
2017-02-23 19:57:58 +08:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
2017-03-02 08:57:33 +08:00
|
|
|
|
/// Returns if this mod is ranked.
|
2017-02-23 19:57:58 +08:00
|
|
|
|
/// </summary>
|
2017-03-06 17:28:30 +08:00
|
|
|
|
public virtual bool Ranked => false;
|
2017-02-23 19:57:58 +08:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
2017-03-02 08:57:33 +08:00
|
|
|
|
/// The mods this mod cannot be enabled with.
|
2017-02-23 19:57:58 +08:00
|
|
|
|
/// </summary>
|
2017-03-06 17:28:30 +08:00
|
|
|
|
public virtual Type[] IncompatibleMods => new Type[] { };
|
2017-03-06 13:52:37 +08:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Direct access to the Player before load has run.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="player"></param>
|
|
|
|
|
public virtual void PlayerLoading(Player player) { }
|
2017-02-18 19:44:46 +08:00
|
|
|
|
}
|
2017-02-17 04:05:03 +08:00
|
|
|
|
|
2017-03-02 13:07:28 +08:00
|
|
|
|
public class MultiMod : Mod
|
|
|
|
|
{
|
2017-03-06 17:28:30 +08:00
|
|
|
|
public override string Name => string.Empty;
|
|
|
|
|
public override string Description => string.Empty;
|
2017-03-02 13:07:28 +08:00
|
|
|
|
public override double ScoreMultiplier => 0.0;
|
|
|
|
|
|
|
|
|
|
public Mod[] Mods;
|
|
|
|
|
}
|
|
|
|
|
|
2017-03-02 08:57:33 +08:00
|
|
|
|
public abstract class ModNoFail : Mod
|
2017-02-17 04:05:03 +08:00
|
|
|
|
{
|
2017-03-06 17:28:30 +08:00
|
|
|
|
public override string Name => "NoFail";
|
2017-02-17 04:05:03 +08:00
|
|
|
|
public override FontAwesome Icon => FontAwesome.fa_osu_mod_nofail;
|
2017-03-06 17:28:30 +08:00
|
|
|
|
public override string Description => "You can't fail, no matter what.";
|
2017-03-02 08:57:33 +08:00
|
|
|
|
public override double ScoreMultiplier => 0.5;
|
|
|
|
|
public override bool Ranked => true;
|
2017-03-07 16:27:55 +08:00
|
|
|
|
public override Type[] IncompatibleMods => new[] { typeof(ModRelax), typeof(ModSuddenDeath), typeof(ModAutoplay) };
|
2017-02-17 04:05:03 +08:00
|
|
|
|
}
|
|
|
|
|
|
2017-03-02 08:57:33 +08:00
|
|
|
|
public abstract class ModEasy : Mod
|
2017-02-17 04:05:03 +08:00
|
|
|
|
{
|
2017-03-06 17:28:30 +08:00
|
|
|
|
public override string Name => "Easy";
|
2017-02-17 04:05:03 +08:00
|
|
|
|
public override FontAwesome Icon => FontAwesome.fa_osu_mod_easy;
|
2017-03-06 17:28:30 +08:00
|
|
|
|
public override string Description => "Reduces overall difficulty - larger circles, more forgiving HP drain, less accuracy required.";
|
2017-03-02 08:57:33 +08:00
|
|
|
|
public override double ScoreMultiplier => 0.5;
|
|
|
|
|
public override bool Ranked => true;
|
2017-03-07 08:16:47 +08:00
|
|
|
|
public override Type[] IncompatibleMods => new[] { typeof(ModHardRock) };
|
2017-02-17 04:05:03 +08:00
|
|
|
|
}
|
|
|
|
|
|
2017-03-02 08:57:33 +08:00
|
|
|
|
public abstract class ModHidden : Mod
|
2017-02-17 04:05:03 +08:00
|
|
|
|
{
|
2017-03-06 17:28:30 +08:00
|
|
|
|
public override string Name => "Hidden";
|
2017-02-17 04:05:03 +08:00
|
|
|
|
public override FontAwesome Icon => FontAwesome.fa_osu_mod_hidden;
|
2017-03-02 08:57:33 +08:00
|
|
|
|
public override bool Ranked => true;
|
2017-02-17 04:05:03 +08:00
|
|
|
|
}
|
|
|
|
|
|
2017-03-02 08:57:33 +08:00
|
|
|
|
public abstract class ModHardRock : Mod
|
2017-02-17 04:05:03 +08:00
|
|
|
|
{
|
2017-03-06 17:28:30 +08:00
|
|
|
|
public override string Name => "Hard Rock";
|
2017-02-17 04:05:03 +08:00
|
|
|
|
public override FontAwesome Icon => FontAwesome.fa_osu_mod_hardrock;
|
2017-03-06 17:28:30 +08:00
|
|
|
|
public override string Description => "Everything just got a bit harder...";
|
2017-03-06 17:16:21 +08:00
|
|
|
|
public override Type[] IncompatibleMods => new[] { typeof(ModEasy) };
|
2017-02-17 04:05:03 +08:00
|
|
|
|
}
|
|
|
|
|
|
2017-03-02 08:57:33 +08:00
|
|
|
|
public abstract class ModSuddenDeath : Mod
|
2017-02-17 04:05:03 +08:00
|
|
|
|
{
|
2017-03-06 17:28:30 +08:00
|
|
|
|
public override string Name => "Sudden Death";
|
2017-02-17 04:05:03 +08:00
|
|
|
|
public override FontAwesome Icon => FontAwesome.fa_osu_mod_suddendeath;
|
2017-03-06 17:28:30 +08:00
|
|
|
|
public override string Description => "Miss a note and fail.";
|
2017-03-02 08:57:33 +08:00
|
|
|
|
public override double ScoreMultiplier => 1;
|
|
|
|
|
public override bool Ranked => true;
|
2017-03-07 16:27:55 +08:00
|
|
|
|
public override Type[] IncompatibleMods => new[] { typeof(ModNoFail), typeof(ModRelax), typeof(ModAutoplay) };
|
2017-02-17 04:05:03 +08:00
|
|
|
|
}
|
|
|
|
|
|
2017-03-02 08:57:33 +08:00
|
|
|
|
public abstract class ModDoubleTime : Mod
|
2017-02-17 04:05:03 +08:00
|
|
|
|
{
|
2017-03-06 17:28:30 +08:00
|
|
|
|
public override string Name => "Double Time";
|
2017-02-17 04:05:03 +08:00
|
|
|
|
public override FontAwesome Icon => FontAwesome.fa_osu_mod_doubletime;
|
2017-03-06 17:28:30 +08:00
|
|
|
|
public override string Description => "Zoooooooooom";
|
2017-03-02 08:57:33 +08:00
|
|
|
|
public override bool Ranked => true;
|
2017-03-06 17:16:21 +08:00
|
|
|
|
public override Type[] IncompatibleMods => new[] { typeof(ModHalfTime) };
|
2017-02-17 04:05:03 +08:00
|
|
|
|
}
|
|
|
|
|
|
2017-03-02 08:57:33 +08:00
|
|
|
|
public abstract class ModRelax : Mod
|
2017-02-17 04:05:03 +08:00
|
|
|
|
{
|
2017-03-06 17:28:30 +08:00
|
|
|
|
public override string Name => "Relax";
|
2017-02-17 04:05:03 +08:00
|
|
|
|
public override FontAwesome Icon => FontAwesome.fa_osu_mod_relax;
|
2017-03-02 08:57:33 +08:00
|
|
|
|
public override double ScoreMultiplier => 0;
|
2017-03-07 16:27:55 +08:00
|
|
|
|
public override Type[] IncompatibleMods => new[] { typeof(ModAutoplay), typeof(ModNoFail), typeof(ModSuddenDeath) };
|
2017-02-17 04:05:03 +08:00
|
|
|
|
}
|
|
|
|
|
|
2017-03-02 08:57:33 +08:00
|
|
|
|
public abstract class ModHalfTime : Mod
|
2017-02-17 04:05:03 +08:00
|
|
|
|
{
|
2017-03-06 17:28:30 +08:00
|
|
|
|
public override string Name => "Half Time";
|
2017-02-17 04:05:03 +08:00
|
|
|
|
public override FontAwesome Icon => FontAwesome.fa_osu_mod_halftime;
|
2017-03-06 17:28:30 +08:00
|
|
|
|
public override string Description => "Less zoom";
|
2017-03-02 08:57:33 +08:00
|
|
|
|
public override bool Ranked => true;
|
2017-03-07 16:27:55 +08:00
|
|
|
|
public override Type[] IncompatibleMods => new[] { typeof(ModDoubleTime) };
|
2017-02-17 04:05:03 +08:00
|
|
|
|
}
|
|
|
|
|
|
2017-03-02 08:57:33 +08:00
|
|
|
|
public abstract class ModNightcore : ModDoubleTime
|
2017-02-17 04:05:03 +08:00
|
|
|
|
{
|
2017-03-06 17:28:30 +08:00
|
|
|
|
public override string Name => "Nightcore";
|
2017-02-17 04:05:03 +08:00
|
|
|
|
public override FontAwesome Icon => FontAwesome.fa_osu_mod_nightcore;
|
2017-03-06 17:28:30 +08:00
|
|
|
|
public override string Description => "uguuuuuuuu";
|
2017-02-17 04:05:03 +08:00
|
|
|
|
}
|
|
|
|
|
|
2017-03-02 08:57:33 +08:00
|
|
|
|
public abstract class ModFlashlight : Mod
|
2017-02-17 04:05:03 +08:00
|
|
|
|
{
|
2017-03-06 17:28:30 +08:00
|
|
|
|
public override string Name => "Flashlight";
|
2017-02-17 04:05:03 +08:00
|
|
|
|
public override FontAwesome Icon => FontAwesome.fa_osu_mod_flashlight;
|
2017-03-06 17:28:30 +08:00
|
|
|
|
public override string Description => "Restricted view area.";
|
2017-03-02 08:57:33 +08:00
|
|
|
|
public override bool Ranked => true;
|
2017-02-17 04:05:03 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public class ModAutoplay : Mod
|
|
|
|
|
{
|
2017-03-06 17:28:30 +08:00
|
|
|
|
public override string Name => "Autoplay";
|
2017-02-17 04:05:03 +08:00
|
|
|
|
public override FontAwesome Icon => FontAwesome.fa_osu_mod_auto;
|
2017-03-06 17:28:30 +08:00
|
|
|
|
public override string Description => "Watch a perfect automated play through the song";
|
2017-03-02 08:57:33 +08:00
|
|
|
|
public override double ScoreMultiplier => 0;
|
2017-03-07 16:27:55 +08:00
|
|
|
|
public override Type[] IncompatibleMods => new[] { typeof(ModRelax), typeof(ModSuddenDeath), typeof(ModNoFail) };
|
2017-03-06 13:52:37 +08:00
|
|
|
|
|
|
|
|
|
public override void PlayerLoading(Player player)
|
|
|
|
|
{
|
|
|
|
|
base.PlayerLoading(player);
|
|
|
|
|
player.ReplayInputHandler = Ruleset.GetRuleset(player.Beatmap.PlayMode).CreateAutoplayScore(player.Beatmap.Beatmap)?.Replay?.GetInputHandler();
|
|
|
|
|
}
|
2017-02-17 04:05:03 +08:00
|
|
|
|
}
|
|
|
|
|
|
2017-03-02 13:07:28 +08:00
|
|
|
|
public abstract class ModPerfect : ModSuddenDeath
|
2017-02-17 04:05:03 +08:00
|
|
|
|
{
|
2017-03-06 17:28:30 +08:00
|
|
|
|
public override string Name => "Perfect";
|
|
|
|
|
public override string Description => "SS or quit.";
|
2017-02-17 04:05:03 +08:00
|
|
|
|
}
|
|
|
|
|
|
2017-02-22 23:34:22 +08:00
|
|
|
|
public class ModCinema : ModAutoplay
|
2017-02-17 04:05:03 +08:00
|
|
|
|
{
|
2017-03-06 17:28:30 +08:00
|
|
|
|
public override string Name => "Cinema";
|
2017-02-17 04:05:03 +08:00
|
|
|
|
public override FontAwesome Icon => FontAwesome.fa_osu_mod_cinema;
|
|
|
|
|
}
|
|
|
|
|
|
2017-03-02 13:07:28 +08:00
|
|
|
|
public enum ModType
|
|
|
|
|
{
|
|
|
|
|
DifficultyReduction,
|
|
|
|
|
DifficultyIncrease,
|
|
|
|
|
Special,
|
|
|
|
|
}
|
2017-03-02 08:57:33 +08:00
|
|
|
|
}
|