1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-26 18:52:55 +08:00

Working on better way to handle mods

This commit is contained in:
DrabWeb 2017-03-01 20:57:33 -04:00
parent c3a81127f2
commit bb12463ae4
18 changed files with 684 additions and 448 deletions

View File

@ -0,0 +1,59 @@
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
namespace osu.Game.Modes.Catch
{
public class CatchModNoFail : ModNoFail
{
}
public class CatchModEasy : ModEasy
{
}
public class CatchModHidden : ModHidden
{
public override string Description => @"Play with no approach circles and fading notes for a slight score advantage.";
public override double ScoreMultiplier => 1.06;
public override Mods[] DisablesMods => new Mods[] { };
}
public class CatchModHardRock : ModHardRock
{
public override double ScoreMultiplier => 1.12;
public override bool Ranked => true;
}
public class CatchModSuddenDeath : ModSuddenDeath
{
}
public class CatchModDoubleTime : ModDoubleTime
{
public override double ScoreMultiplier => 1.06;
}
public class CatchModRelax : ModRelax
{
public override string Description => @"Use the mouse to control the catcher.";
}
public class CatchModHalfTime : ModHalfTime
{
public override double ScoreMultiplier => 0.5;
}
public class CatchModNightcore : ModNightcore
{
public override double ScoreMultiplier => 1.06;
}
public class CatchModFlashlight : ModFlashlight
{
public override double ScoreMultiplier => 1.12;
public override Mods[] DisablesMods => new Mods[] { };
}
}

View File

@ -1,6 +1,7 @@
// 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.Collections.Generic;
using osu.Game.Graphics;
using osu.Game.Modes.Catch.UI;
using osu.Game.Modes.Objects;
@ -16,6 +17,20 @@ namespace osu.Game.Modes.Catch
public override HitRenderer CreateHitRendererWith(Beatmap beatmap) => new CatchHitRenderer { Beatmap = beatmap };
public override IEnumerable<Mod> AvailableMods => new Mod[]
{
new CatchModNoFail(),
new CatchModEasy(),
new CatchModHidden(),
new CatchModHardRock(),
new CatchModSuddenDeath(),
new CatchModDoubleTime(),
new CatchModRelax(),
new CatchModHalfTime(),
new CatchModNightcore(),
new CatchModFlashlight(),
};
protected override PlayMode PlayMode => PlayMode.Catch;
public override FontAwesome Icon => FontAwesome.fa_osu_fruits_o;

View File

@ -58,6 +58,7 @@
<Compile Include="UI\CatchHitRenderer.cs" />
<Compile Include="UI\CatchPlayfield.cs" />
<Compile Include="CatchRuleset.cs" />
<Compile Include="CatchMod.cs" />
</ItemGroup>
<ItemGroup>
<None Include="..\osu.licenseheader">

View File

@ -0,0 +1,150 @@
// 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;
namespace osu.Game.Modes.Mania
{
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 Mods[] DisablesMods => new Mods[] { Mods.Flashlight };
}
public class ManiaModHardRock : ModHardRock
{
public override double ScoreMultiplier => 1.0;
public override bool Ranked => false;
}
public class ManiaModSuddenDeath : ModSuddenDeath
{
}
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 Mods[] DisablesMods => new Mods[] { Mods.Hidden };
}
public class ManiaModFadeIn : Mod
{
public override Mods Name => Mods.FadeIn;
public override FontAwesome Icon => FontAwesome.fa_osu_mod_hidden;
public override string Description => @"";
public override double ScoreMultiplier => 1;
public override bool Ranked => true;
public override Mods[] DisablesMods => new Mods[] { Mods.Flashlight };
}
public class ManiaModRandom : Mod
{
public override Mods Name => Mods.Random;
public override FontAwesome Icon => FontAwesome.fa_close;
public override string Description => @"Shuffle around the notes!";
public override double ScoreMultiplier => 1;
public override bool Ranked => false;
public override Mods[] DisablesMods => new Mods[] { };
}
public abstract class ManiaKeyMod : Mod
{
public abstract int KeyCount { get; }
public override FontAwesome Icon => FontAwesome.fa_close; // TODO: Add proper key icons
public override string Description => @"";
public override double ScoreMultiplier => 1; // TODO: Implement the mania key mod score multiplier
public override bool Ranked => true;
public override Mods[] DisablesMods => new Mods[] { };
}
public class ManiaModKey1 : ManiaKeyMod
{
public override int KeyCount => 1;
public override Mods Name => Mods.Key1;
}
public class ManiaModKey2 : ManiaKeyMod
{
public override int KeyCount => 2;
public override Mods Name => Mods.Key2;
}
public class ManiaModKey3 : ManiaKeyMod
{
public override int KeyCount => 3;
public override Mods Name => Mods.Key3;
}
public class ManiaModKey4 : ManiaKeyMod
{
public override int KeyCount => 4;
public override Mods Name => Mods.Key4;
}
public class ManiaModKey5 : ManiaKeyMod
{
public override int KeyCount => 5;
public override Mods Name => Mods.Key5;
}
public class ManiaModKey6 : ManiaKeyMod
{
public override int KeyCount => 6;
public override Mods Name => Mods.Key6;
}
public class ManiaModKey7 : ManiaKeyMod
{
public override int KeyCount => 7;
public override Mods Name => Mods.Key7;
}
public class ManiaModKey8 : ManiaKeyMod
{
public override int KeyCount => 8;
public override Mods Name => Mods.Key8;
}
public class ManiaModKey9 : ManiaKeyMod
{
public override int KeyCount => 9;
public override Mods Name => Mods.Key9;
}
public class ManiaModKeyCoop : Mod
{
public override Mods Name => Mods.KeyCoop;
public override FontAwesome Icon => FontAwesome.fa_close;
public override string Description => @"Double the key amount, double the fun!";
public override double ScoreMultiplier => 1;
public override bool Ranked => true;
public override Mods[] DisablesMods => new Mods[] { };
}
}

View File

@ -1,6 +1,7 @@
// 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.Collections.Generic;
using osu.Game.Graphics;
using osu.Game.Modes.Mania.UI;
using osu.Game.Modes.Objects;
@ -16,6 +17,31 @@ namespace osu.Game.Modes.Mania
public override HitRenderer CreateHitRendererWith(Beatmap beatmap) => new ManiaHitRenderer { Beatmap = beatmap };
public override IEnumerable<Mod> AvailableMods => new Mod[]
{
new ManiaModNoFail(),
new ManiaModEasy(),
new ManiaModHidden(),
new ManiaModHardRock(),
new ManiaModSuddenDeath(),
new ManiaModDoubleTime(),
new ManiaModHalfTime(),
new ManiaModNightcore(),
new ManiaModFlashlight(),
new ManiaModFadeIn(),
new ManiaModRandom(),
new ManiaModKey1(),
new ManiaModKey2(),
new ManiaModKey3(),
new ManiaModKey4(),
new ManiaModKey5(),
new ManiaModKey6(),
new ManiaModKey7(),
new ManiaModKey8(),
new ManiaModKey9(),
new ManiaModKeyCoop(),
};
protected override PlayMode PlayMode => PlayMode.Mania;
public override FontAwesome Icon => FontAwesome.fa_osu_mania_o;

View File

@ -58,6 +58,7 @@
<Compile Include="UI\ManiaHitRenderer.cs" />
<Compile Include="UI\ManiaPlayfield.cs" />
<Compile Include="ManiaRuleset.cs" />
<Compile Include="ManiaMod.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\osu-framework\osu.Framework\osu.Framework.csproj">

View File

@ -0,0 +1,91 @@
// 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;
namespace osu.Game.Modes.Osu
{
public class OsuModNoFail : ModNoFail
{
}
public class OsuModEasy : ModEasy
{
}
public class OsuModHidden : ModHidden
{
public override string Description => @"Play with no approach circles and fading notes for a slight score advantage.";
public override double ScoreMultiplier => 1.06;
public override Mods[] DisablesMods => new Mods[] { };
}
public class OsuModHardRock : ModHardRock
{
public override double ScoreMultiplier => 1.06;
public override bool Ranked => true;
}
public class OsuModSuddenDeath : ModSuddenDeath
{
}
public class OsuModDoubleTime : ModDoubleTime
{
public override double ScoreMultiplier => 1.12;
}
public class OsuModRelax : ModRelax
{
public override string Description => "You don't need to click.\nGive your clicking/tapping finger a break from the heat of things.";
}
public class OsuModHalfTime : ModHalfTime
{
public override double ScoreMultiplier => 0.5;
}
public class OsuModNightcore : ModNightcore
{
public override double ScoreMultiplier => 1.12;
}
public class OsuModFlashlight : ModFlashlight
{
public override double ScoreMultiplier => 1.12;
public override Mods[] DisablesMods => new Mods[] { };
}
public class OsuModSpunOut : Mod
{
public override Mods Name => Mods.SpunOut;
public override FontAwesome Icon => FontAwesome.fa_osu_mod_spunout;
public override string Description => @"Spinners will be automatically completed";
public override double ScoreMultiplier => 0.9;
public override bool Ranked => true;
public override Mods[] DisablesMods => new Mods[] { Mods.Autoplay, Mods.Cinema, Mods.Autopilot };
}
public class OsuModAutopilot : Mod
{
public override Mods Name => Mods.Autopilot;
public override FontAwesome Icon => FontAwesome.fa_osu_mod_autopilot;
public override string Description => @"Automatic cursor movement - just follow the rhythm.";
public override double ScoreMultiplier => 0;
public override bool Ranked => false;
public override Mods[] DisablesMods => new Mods[] { Mods.SpunOut, Mods.Relax, Mods.SuddenDeath, Mods.Perfect, Mods.NoFail, Mods.Autoplay, Mods.Cinema };
}
public class OsuModTarget : Mod
{
public override Mods Name => Mods.Target;
public override FontAwesome Icon => FontAwesome.fa_osu_mod_target;
public override string Description => @"";
public override double ScoreMultiplier => 1;
public override bool Ranked => false;
public override Mods[] DisablesMods => new Mods[] { };
}
}

View File

@ -34,6 +34,23 @@ namespace osu.Game.Modes.Osu
}
};
public override IEnumerable<Mod> AvailableMods => new Mod[]
{
new OsuModNoFail(),
new OsuModEasy(),
new OsuModHidden(),
new OsuModHardRock(),
new OsuModSuddenDeath(),
new OsuModDoubleTime(),
new OsuModRelax(),
new OsuModHalfTime(),
new OsuModNightcore(),
new OsuModFlashlight(),
new OsuModSpunOut(),
new OsuModAutopilot(),
new OsuModTarget(),
};
public override FontAwesome Icon => FontAwesome.fa_osu_osu_o;
public override HitObjectParser CreateHitObjectParser() => new OsuHitObjectParser();

View File

@ -85,6 +85,7 @@
<Compile Include="Objects\Spinner.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="UI\OsuScoreOverlay.cs" />
<Compile Include="OsuMod.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\osu-framework\osu.Framework\osu.Framework.csproj">

View File

@ -0,0 +1,59 @@
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
namespace osu.Game.Modes.Taiko
{
public class TaikoModNoFail : ModNoFail
{
}
public class TaikoModEasy : ModEasy
{
}
public class TaikoModHidden : ModHidden
{
public override string Description => @"The notes fade out before you hit them!";
public override double ScoreMultiplier => 1.06;
public override Mods[] DisablesMods => new Mods[] { };
}
public class TaikoModHardRock : ModHardRock
{
public override double ScoreMultiplier => 1.06;
public override bool Ranked => true;
}
public class TaikoModSuddenDeath : ModSuddenDeath
{
}
public class TaikoModDoubleTime : ModDoubleTime
{
public override double ScoreMultiplier => 1.12;
}
public class TaikoModRelax : ModRelax
{
public override string Description => @"Relax! You will no longer get dizzyfied by ninja-like spinners, demanding drumrolls or unexpected katu's.";
}
public class TaikoModHalfTime : ModHalfTime
{
public override double ScoreMultiplier => 0.5;
}
public class TaikoModNightcore : ModNightcore
{
public override double ScoreMultiplier => 1.12;
}
public class TaikoModFlashlight : ModFlashlight
{
public override double ScoreMultiplier => 1.12;
public override Mods[] DisablesMods => new Mods[] { };
}
}

View File

@ -1,6 +1,7 @@
// 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.Collections.Generic;
using osu.Game.Graphics;
using osu.Game.Modes.Objects;
using osu.Game.Modes.Osu.UI;
@ -16,6 +17,20 @@ namespace osu.Game.Modes.Taiko
public override HitRenderer CreateHitRendererWith(Beatmap beatmap) => new TaikoHitRenderer { Beatmap = beatmap };
public override IEnumerable<Mod> AvailableMods => new Mod[]
{
new TaikoModNoFail(),
new TaikoModEasy(),
new TaikoModHidden(),
new TaikoModHardRock(),
new TaikoModSuddenDeath(),
new TaikoModDoubleTime(),
new TaikoModRelax(),
new TaikoModHalfTime(),
new TaikoModNightcore(),
new TaikoModFlashlight(),
};
protected override PlayMode PlayMode => PlayMode.Taiko;
public override FontAwesome Icon => FontAwesome.fa_osu_taiko_o;

View File

@ -56,6 +56,7 @@
<Compile Include="UI\TaikoHitRenderer.cs" />
<Compile Include="UI\TaikoPlayfield.cs" />
<Compile Include="TaikoRuleset.cs" />
<Compile Include="TaikoMod.cs" />
</ItemGroup>
<ItemGroup>
<None Include="..\osu.licenseheader">

View File

@ -23,285 +23,128 @@ namespace osu.Game.Modes
public abstract FontAwesome Icon { get; }
/// <summary>
/// The user readable description of this mod for the given <see cref="PlayMode"/>.
/// The user readable description of this mod.
/// </summary>
public virtual string Description(PlayMode mode) => @"";
public abstract string Description { get; }
/// <summary>
/// The score multiplier of this mod for the given <see cref="PlayMode"/>
/// The score multiplier of this mod.
/// </summary>
public abstract double ScoreMultiplier(PlayMode mode);
public abstract double ScoreMultiplier { get; }
/// <summary>
/// Returns if this mod is ranked in the given <see cref="PlayMode">
/// Returns if this mod is ranked.
/// </summary>
public abstract bool Ranked(PlayMode mode);
public abstract bool Ranked { get; }
/// <summary>
/// The mods this mod cannot be enabled with
/// The mods this mod cannot be enabled with.
/// </summary>
public abstract Mods[] DisablesMods(PlayMode mode);
public abstract Mods[] DisablesMods { get; }
}
public abstract class KeyMod : Mod
{
public abstract int KeyCount { get; }
public override FontAwesome Icon => FontAwesome.fa_close; // TODO: Add proper key icons
public override string Description(PlayMode mode) => @"";
public override double ScoreMultiplier(PlayMode mode) => 1; // TODO: Implement the mania key mod score multiplier
public override bool Ranked(PlayMode mode) => mode == PlayMode.Mania;
public override Mods[] DisablesMods(PlayMode mode) => new Mods[] {};
}
public class ModNoFail : Mod
public abstract class ModNoFail : Mod
{
public override Mods Name => Mods.NoFail;
public override FontAwesome Icon => FontAwesome.fa_osu_mod_nofail;
public override string Description(PlayMode mode) => @"You can't fail, no matter what.";
public override double ScoreMultiplier(PlayMode mode) => 0.5;
public override bool Ranked(PlayMode mode) => true;
public override Mods[] DisablesMods(PlayMode mode) => new Mods[] { Mods.Relax, Mods.Autopilot, Mods.SuddenDeath, Mods.Perfect };
public override string Description => @"You can't fail, no matter what.";
public override double ScoreMultiplier => 0.5;
public override bool Ranked => true;
public override Mods[] DisablesMods => new Mods[] { Mods.Relax, Mods.Autopilot, Mods.SuddenDeath, Mods.Perfect };
}
public class ModEasy : Mod
public abstract class ModEasy : Mod
{
public override Mods Name => Mods.Easy;
public override FontAwesome Icon => FontAwesome.fa_osu_mod_easy;
public override string Description(PlayMode mode) => @"Reduces overall difficulty - larger circles, more forgiving HP drain, less accuracy required.";
public override double ScoreMultiplier(PlayMode mode) => 0.5;
public override bool Ranked(PlayMode mode) => true;
public override Mods[] DisablesMods(PlayMode mode) => new Mods[] { Mods.HardRock };
public override string Description => @"Reduces overall difficulty - larger circles, more forgiving HP drain, less accuracy required.";
public override double ScoreMultiplier => 0.5;
public override bool Ranked => true;
public override Mods[] DisablesMods => new Mods[] { Mods.HardRock };
}
public class ModHidden : Mod
public abstract class ModHidden : Mod
{
public override Mods Name => Mods.Hidden;
public override FontAwesome Icon => FontAwesome.fa_osu_mod_hidden;
public override string Description(PlayMode mode)
{
switch (mode)
{
case PlayMode.Osu:
case PlayMode.Catch:
return @"Play with no approach circles and fading notes for a slight score advantage.";
case PlayMode.Taiko:
case PlayMode.Mania:
return @"The notes fade out before you hit them!";
default:
throw new NotSupportedException();
}
}
public override double ScoreMultiplier(PlayMode mode) => mode == PlayMode.Mania ? 1.0 : 1.06;
public override bool Ranked(PlayMode mode) => true;
public override Mods[] DisablesMods(PlayMode mode) => (mode == PlayMode.Mania) ? new Mods[] { Mods.Flashlight } : new Mods[] { };
public override bool Ranked => true;
}
public class ModHardRock : Mod
public abstract class ModHardRock : Mod
{
public override Mods Name => Mods.HardRock;
public override FontAwesome Icon => FontAwesome.fa_osu_mod_hardrock;
public override string Description(PlayMode mode) => @"Everything just got a bit harder...";
public override double ScoreMultiplier(PlayMode mode)
{
switch (mode)
{
case PlayMode.Osu:
case PlayMode.Taiko:
return 1.06;
case PlayMode.Catch:
return 1.12;
case PlayMode.Mania:
return 1.0;
default:
throw new NotSupportedException();
}
}
public override bool Ranked(PlayMode mode) => mode != PlayMode.Mania;
public override Mods[] DisablesMods(PlayMode mode) => new Mods[] { Mods.Easy };
public override string Description => @"Everything just got a bit harder...";
public override Mods[] DisablesMods => new Mods[] { Mods.Easy };
}
public class ModSuddenDeath : Mod
public abstract class ModSuddenDeath : Mod
{
public override Mods Name => Mods.SuddenDeath;
public override FontAwesome Icon => FontAwesome.fa_osu_mod_suddendeath;
public override string Description(PlayMode mode) => @"Miss a note and fail.";
public override double ScoreMultiplier(PlayMode mode) => 1;
public override bool Ranked(PlayMode mode) => true;
public override Mods[] DisablesMods(PlayMode mode) => new Mods[] { Mods.NoFail, Mods.Relax, Mods.Autopilot, Mods.Autoplay, Mods.Cinema };
public override string Description => @"Miss a note and fail.";
public override double ScoreMultiplier => 1;
public override bool Ranked => true;
public override Mods[] DisablesMods => new Mods[] { Mods.NoFail, Mods.Relax, Mods.Autopilot, Mods.Autoplay, Mods.Cinema };
}
public class ModDoubleTime : Mod
public abstract class ModDoubleTime : Mod
{
public override Mods Name => Mods.DoubleTime;
public override FontAwesome Icon => FontAwesome.fa_osu_mod_doubletime;
public override string Description(PlayMode mode) => @"Zoooooooooom";
public override double ScoreMultiplier(PlayMode mode)
{
switch (mode)
{
case PlayMode.Osu:
case PlayMode.Taiko:
return 1.12;
case PlayMode.Catch:
return 1.06;
case PlayMode.Mania:
return 1.0;
default:
throw new NotSupportedException();
}
}
public override bool Ranked(PlayMode mode) => true;
public override Mods[] DisablesMods(PlayMode mode) => new Mods[] { Mods.HalfTime };
public override string Description => @"Zoooooooooom";
public override bool Ranked => true;
public override Mods[] DisablesMods => new Mods[] { Mods.HalfTime };
}
public class ModRelax : Mod
public abstract class ModRelax : Mod
{
public override Mods Name => Mods.Relax;
public override FontAwesome Icon => FontAwesome.fa_osu_mod_relax;
public override string Description(PlayMode mode)
{
switch (mode)
{
case PlayMode.Osu:
return "You don't need to click.\nGive your clicking/tapping finger a break from the heat of things.";
case PlayMode.Taiko:
return @"Relax! You will no longer get dizzyfied by ninja-like spinners, demanding drumrolls or unexpected katu's.";
case PlayMode.Catch:
return @"Use the mouse to control the catcher.";
case PlayMode.Mania:
return @"Unsupported";
default:
throw new NotSupportedException();
}
}
public override double ScoreMultiplier(PlayMode mode) => 0;
public override bool Ranked(PlayMode mode) => false;
public override Mods[] DisablesMods(PlayMode mode) => new Mods[] { Mods.Autopilot, Mods.Autoplay, Mods.Cinema, Mods.NoFail, Mods.SuddenDeath, Mods.Perfect };
public override double ScoreMultiplier => 0;
public override bool Ranked => false;
public override Mods[] DisablesMods => new Mods[] { Mods.Autopilot, Mods.Autoplay, Mods.Cinema, Mods.NoFail, Mods.SuddenDeath, Mods.Perfect };
}
public class ModHalfTime : Mod
public abstract class ModHalfTime : Mod
{
public override Mods Name => Mods.HalfTime;
public override FontAwesome Icon => FontAwesome.fa_osu_mod_halftime;
public override string Description(PlayMode mode) => @"Less zoom";
public override double ScoreMultiplier(PlayMode mode) => mode == PlayMode.Mania ? 0.5 : 0.3;
public override bool Ranked(PlayMode mode) => true;
public override Mods[] DisablesMods(PlayMode mode) => new Mods[] { Mods.DoubleTime, Mods.Nightcore };
public override string Description => @"Less zoom";
public override bool Ranked => true;
public override Mods[] DisablesMods => new Mods[] { Mods.DoubleTime, Mods.Nightcore };
}
public class ModNightcore : ModDoubleTime
public abstract class ModNightcore : ModDoubleTime
{
public override Mods Name => Mods.Nightcore;
public override FontAwesome Icon => FontAwesome.fa_osu_mod_nightcore;
public override string Description(PlayMode mode) => @"uguuuuuuuu";
public override string Description => @"uguuuuuuuu";
}
public class ModFlashlight : Mod
public abstract class ModFlashlight : Mod
{
public override Mods Name => Mods.Flashlight;
public override FontAwesome Icon => FontAwesome.fa_osu_mod_flashlight;
public override string Description(PlayMode mode) => @"Restricted view area.";
public override double ScoreMultiplier(PlayMode mode) => mode == PlayMode.Mania ? 1.0 : 1.12;
public override bool Ranked(PlayMode mode) => true;
public override Mods[] DisablesMods(PlayMode mode) => (mode == PlayMode.Mania) ? new Mods[] { Mods.Hidden } : new Mods[] {};
public override string Description => @"Restricted view area.";
public override bool Ranked => true;
}
public class ModAutoplay : Mod
{
public override Mods Name => Mods.Autoplay;
public override FontAwesome Icon => FontAwesome.fa_osu_mod_auto;
public override string Description(PlayMode mode) => @"Watch a perfect automated play through the song";
public override double ScoreMultiplier(PlayMode mode) => 0;
public override bool Ranked(PlayMode mode) => false;
public override Mods[] DisablesMods(PlayMode mode) => new Mods[] { Mods.Relax, Mods.Autopilot, Mods.SpunOut, Mods.SuddenDeath, Mods.Perfect };
}
public class ModSpunOut : Mod
{
public override Mods Name => Mods.SpunOut;
public override FontAwesome Icon => FontAwesome.fa_osu_mod_spunout;
public override string Description(PlayMode mode) => @"Spinners will be automatically completed";
public override double ScoreMultiplier(PlayMode mode) => 0.9;
public override bool Ranked(PlayMode mode) => mode == PlayMode.Osu;
public override Mods[] DisablesMods(PlayMode mode) => new Mods[] { Mods.Autoplay, Mods.Cinema, Mods.Autopilot };
}
public class ModAutopilot : Mod
{
public override Mods Name => Mods.Autopilot;
public override FontAwesome Icon => FontAwesome.fa_osu_mod_autopilot;
public override string Description(PlayMode mode) => @"Automatic cursor movement - just follow the rhythm.";
public override double ScoreMultiplier(PlayMode mode) => 0;
public override bool Ranked(PlayMode mode) => false;
public override Mods[] DisablesMods(PlayMode mode) => new Mods[] { Mods.SpunOut, Mods.Relax, Mods.SuddenDeath, Mods.Perfect, Mods.NoFail, Mods.Autoplay, Mods.Cinema };
public override string Description => @"Watch a perfect automated play through the song";
public override double ScoreMultiplier => 0;
public override bool Ranked => false;
public override Mods[] DisablesMods => new Mods[] { Mods.Relax, Mods.Autopilot, Mods.SpunOut, Mods.SuddenDeath, Mods.Perfect };
}
public class ModPerfect : ModSuddenDeath
{
public override Mods Name => Mods.Perfect;
public override FontAwesome Icon => FontAwesome.fa_osu_mod_perfect;
public override string Description(PlayMode mode) => @"SS or quit.";
}
public class ModKey4 : KeyMod
{
public override int KeyCount => 4;
public override Mods Name => Mods.Key4;
}
public class ModKey5 : KeyMod
{
public override int KeyCount => 5;
public override Mods Name => Mods.Key5;
}
public class ModKey6 : KeyMod
{
public override int KeyCount => 6;
public override Mods Name => Mods.Key6;
}
public class ModKey7 : KeyMod
{
public override int KeyCount => 7;
public override Mods Name => Mods.Key7;
}
public class ModKey8 : KeyMod
{
public override int KeyCount => 8;
public override Mods Name => Mods.Key8;
}
public class ModFadeIn : Mod
{
public override Mods Name => Mods.FadeIn;
public override FontAwesome Icon => FontAwesome.fa_osu_mod_hidden;
public override double ScoreMultiplier(PlayMode mode) => 1;
public override bool Ranked(PlayMode mode) => mode == PlayMode.Mania;
public override Mods[] DisablesMods(PlayMode mode) => new Mods[] { Mods.Flashlight };
}
public class ModRandom : Mod
{
public override Mods Name => Mods.Random;
public override FontAwesome Icon => FontAwesome.fa_close;
public override string Description(PlayMode mode) => @"Shuffle around the notes!";
public override double ScoreMultiplier(PlayMode mode) => 1;
public override bool Ranked(PlayMode mode) => false;
public override Mods[] DisablesMods(PlayMode mode) => new Mods[] {};
public override string Description => @"SS or quit.";
}
public class ModCinema : ModAutoplay
@ -310,50 +153,6 @@ namespace osu.Game.Modes
public override FontAwesome Icon => FontAwesome.fa_osu_mod_cinema;
}
public class ModTarget : Mod
{
public override Mods Name => Mods.Target;
public override FontAwesome Icon => FontAwesome.fa_osu_mod_target;
public override double ScoreMultiplier(PlayMode mode) => 1;
public override bool Ranked(PlayMode mode) => mode == PlayMode.Osu;
public override Mods[] DisablesMods(PlayMode mode) => new Mods[] {};
}
public class ModKey9 : KeyMod
{
public override int KeyCount => 9;
public override Mods Name => Mods.Key9;
}
public class ModKeyCoop : Mod
{
public override Mods Name => Mods.KeyCoop;
public override FontAwesome Icon => FontAwesome.fa_close;
public override string Description(PlayMode mode) => @"Double the key amount, double the fun!";
public override double ScoreMultiplier(PlayMode mode) => 1;
public override bool Ranked(PlayMode mode) => mode == PlayMode.Mania;
public override Mods[] DisablesMods(PlayMode mode) => new Mods[] {};
}
public class ModKey1 : KeyMod
{
public override int KeyCount => 1;
public override Mods Name => Mods.Key1;
}
public class ModKey3 : KeyMod
{
public override int KeyCount => 3;
public override Mods Name => Mods.Key3;
}
public class ModKey2 : KeyMod
{
public override int KeyCount => 2;
public override Mods Name => Mods.Key2;
}
[Flags]
public enum Mods
{
@ -451,4 +250,4 @@ namespace osu.Game.Modes
FreeModAllowed = NoFail | Easy | Hidden | HardRock | SuddenDeath | Flashlight | FadeIn | Relax | Autopilot | SpunOut | KeyMod,
ScoreIncreaseMods = Hidden | HardRock | DoubleTime | Flashlight | FadeIn
}
}
}

View File

@ -26,6 +26,8 @@ namespace osu.Game.Modes
public virtual IEnumerable<BeatmapStatistic> GetBeatmapStatistics(WorkingBeatmap beatmap) => new BeatmapStatistic[] { };
public abstract IEnumerable<Mod> AvailableMods { get; }
public abstract ScoreProcessor CreateScoreProcessor(int hitObjectCount);
public abstract HitRenderer CreateHitRendererWith(Beatmap beatmap);

View File

@ -32,130 +32,129 @@ namespace osu.Game
public AssistedSection(PlayMode mode)
{
Header = @"Assisted";
//switch (mode)
//{
// case PlayMode.Osu:
// Buttons = new ModButton[]
// {
// RelaxButton = new ModButton
// {
// ToggleKey = Key.Z,
// Mods = new Mod[]
// {
// new ModRelax(),
// },
// },
// AutopilotButton = new ModButton
// {
// ToggleKey = Key.X,
// Mods = new Mod[]
// {
// new OsuModAutopilot(),
// },
// },
// TargetPracticeButton = new ModButton
// {
// ToggleKey = Key.C,
// Mods = new Mod[]
// {
// new OsuModTarget(),
// },
// },
// SpunOutButton = new ModButton
// {
// ToggleKey = Key.V,
// Mods = new Mod[]
// {
// new OsuModSpunOut(),
// },
// },
// AutoplayCinemaButton = new ModButton
// {
// ToggleKey = Key.B,
// Mods = new Mod[]
// {
// new ModAutoplay(),
// new ModCinema(),
// },
// },
// };
// break;
switch (mode)
{
case PlayMode.Osu:
Buttons = new ModButton[]
{
RelaxButton = new ModButton
{
ToggleKey = Key.Z,
Mods = new Mod[]
{
new ModRelax(),
},
},
AutopilotButton = new ModButton
{
ToggleKey = Key.X,
Mods = new Mod[]
{
new ModAutopilot(),
},
},
TargetPracticeButton = new ModButton
{
ToggleKey = Key.C,
Mods = new Mod[]
{
new ModTarget(),
},
},
SpunOutButton = new ModButton
{
ToggleKey = Key.V,
Mods = new Mod[]
{
new ModSpunOut(),
},
},
AutoplayCinemaButton = new ModButton
{
ToggleKey = Key.B,
Mods = new Mod[]
{
new ModAutoplay(),
new ModCinema(),
},
},
};
break;
// case PlayMode.Taiko:
// case PlayMode.Catch:
// Buttons = new ModButton[]
// {
// RelaxButton = new ModButton
// {
// ToggleKey = Key.Z,
// Mods = new Mod[]
// {
// new ModRelax(),
// },
// },
// AutoplayCinemaButton = new ModButton
// {
// ToggleKey = Key.X,
// Mods = new Mod[]
// {
// new ModAutoplay(),
// new ModCinema(),
// },
// },
// };
// break;
case PlayMode.Taiko:
case PlayMode.Catch:
Buttons = new ModButton[]
{
RelaxButton = new ModButton
{
ToggleKey = Key.Z,
Mods = new Mod[]
{
new ModRelax(),
},
},
AutoplayCinemaButton = new ModButton
{
ToggleKey = Key.X,
Mods = new Mod[]
{
new ModAutoplay(),
new ModCinema(),
},
},
};
break;
// case PlayMode.Mania:
// Buttons = new ModButton[]
// {
// KeyButton = new ModButton
// {
// ToggleKey = Key.Z,
// Mods = new Mod[]
// {
// new ManiaModKey4(),
// new ManiaModKey5(),
// new ManiaModKey6(),
// new ManiaModKey7(),
// new ManiaModKey8(),
// new ManiaModKey9(),
// new ManiaModKey1(),
// new ManiaModKey2(),
// new ManiaModKey3(),
// },
// },
// CoopButton = new ModButton
// {
// ToggleKey = Key.X,
// Mods = new Mod[]
// {
// new ManiaModKeyCoop(),
// },
// },
// RandomButton = new ModButton
// {
// ToggleKey = Key.C,
// Mods = new Mod[]
// {
// new ManiaModRandom(),
// },
// },
// AutoplayCinemaButton = new ModButton
// {
// ToggleKey = Key.V,
// Mods = new Mod[]
// {
// new ModAutoplay(),
// new ModCinema(),
// },
// },
// };
// break;
case PlayMode.Mania:
Buttons = new ModButton[]
{
KeyButton = new ModButton
{
ToggleKey = Key.Z,
Mods = new Mod[]
{
new ModKey4(),
new ModKey5(),
new ModKey6(),
new ModKey7(),
new ModKey8(),
new ModKey9(),
new ModKey1(),
new ModKey2(),
new ModKey3(),
},
},
CoopButton = new ModButton
{
ToggleKey = Key.X,
Mods = new Mod[]
{
new ModKeyCoop(),
},
},
RandomButton = new ModButton
{
ToggleKey = Key.C,
Mods = new Mod[]
{
new ModRandom(),
},
},
AutoplayCinemaButton = new ModButton
{
ToggleKey = Key.V,
Mods = new Mod[]
{
new ModAutoplay(),
new ModCinema(),
},
},
};
break;
default:
throw new NotSupportedException();
}
// default:
// throw new NotSupportedException();
//}
}
}
}

View File

@ -27,51 +27,51 @@ namespace osu.Game
public DifficultyIncreaseSection()
{
Header = @"Gameplay Difficulty Increase";
Buttons = new ModButton[]
{
new ModButton
{
ToggleKey = Key.A,
Mods = new Mod[]
{
new ModHardRock(),
},
},
new ModButton
{
ToggleKey = Key.S,
Mods = new Mod[]
{
new ModSuddenDeath(),
new ModPerfect(),
},
},
new ModButton
{
ToggleKey = Key.D,
Mods = new Mod[]
{
new ModDoubleTime(),
new ModNightcore(),
},
},
new ModButton
{
ToggleKey = Key.F,
Mods = new Mod[]
{
new ModHidden(),
},
},
new ModButton
{
ToggleKey = Key.G,
Mods = new Mod[]
{
new ModFlashlight(),
},
},
};
//Buttons = new ModButton[]
//{
// new ModButton
// {
// ToggleKey = Key.A,
// Mods = new Mod[]
// {
// new ModHardRock(),
// },
// },
// new ModButton
// {
// ToggleKey = Key.S,
// Mods = new Mod[]
// {
// new ModSuddenDeath(),
// new ModPerfect(),
// },
// },
// new ModButton
// {
// ToggleKey = Key.D,
// Mods = new Mod[]
// {
// new ModDoubleTime(),
// new ModNightcore(),
// },
// },
// new ModButton
// {
// ToggleKey = Key.F,
// Mods = new Mod[]
// {
// new ModHidden(),
// },
// },
// new ModButton
// {
// ToggleKey = Key.G,
// Mods = new Mod[]
// {
// new ModFlashlight(),
// },
// },
//};
}
}
}

View File

@ -25,33 +25,33 @@ namespace osu.Game
public DifficultyReductionSection()
{
Header = @"Gameplay Difficulty Reduction";
Buttons = new ModButton[]
{
new ModButton
{
ToggleKey = Key.Q,
Mods = new Mod[]
{
new ModEasy(),
},
},
new ModButton
{
ToggleKey = Key.W,
Mods = new Mod[]
{
new ModNoFail(),
},
},
new ModButton
{
ToggleKey = Key.E,
Mods = new Mod[]
{
new ModHalfTime(),
},
},
};
//Buttons = new ModButton[]
//{
// new ModButton
// {
// ToggleKey = Key.Q,
// Mods = new Mod[]
// {
// new ModEasy(),
// },
// },
// new ModButton
// {
// ToggleKey = Key.W,
// Mods = new Mod[]
// {
// new ModNoFail(),
// },
// },
// new ModButton
// {
// ToggleKey = Key.E,
// Mods = new Mod[]
// {
// new ModHalfTime(),
// },
// },
//};
}
}
}

View File

@ -131,7 +131,7 @@ namespace osu.Game.Overlays.Mods
{
if (selectedMod != null)
{
foreach (Modes.Mods disableMod in selectedMod.DisablesMods(ModMode))
foreach (Modes.Mods disableMod in selectedMod.DisablesMods)
{
DeselectMod(disableMod);
}
@ -143,11 +143,11 @@ namespace osu.Game.Overlays.Mods
foreach (Mod mod in SelectedMods.Value)
{
multiplier *= mod.ScoreMultiplier(ModMode);
multiplier *= mod.ScoreMultiplier;
if (ranked)
{
ranked = mod.Ranked(ModMode);
ranked = mod.Ranked;
}
}