1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-11 09:27:29 +08:00

Merge pull request #25328 from bdach/mod-cleanups-docs

Clean up mod usability flags
This commit is contained in:
Dean Herbert 2023-11-01 15:48:47 +09:00 committed by GitHub
commit 57d8b5ddc9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 51 additions and 9 deletions

View File

@ -107,12 +107,52 @@ namespace osu.Game.Rulesets.Mods
[JsonIgnore]
public virtual bool HasImplementation => this is IApplicableMod;
/// <summary>
/// Whether this mod can be played by a real human user.
/// Non-user-playable mods are not viable for single-player score submission.
/// </summary>
/// <example>
/// <list type="bullet">
/// <item><see cref="ModDoubleTime"/> is user-playable.</item>
/// <item><see cref="ModAutoplay"/> is not user-playable.</item>
/// </list>
/// </example>
[JsonIgnore]
public virtual bool UserPlayable => true;
/// <summary>
/// Whether this mod can be specified as a "required" mod in a multiplayer context.
/// </summary>
/// <example>
/// <list type="bullet">
/// <item><see cref="ModHardRock"/> is valid for multiplayer.</item>
/// <item>
/// <see cref="ModDoubleTime"/> is valid for multiplayer as long as it is a <b>required</b> mod,
/// as that ensures the same duration of gameplay for all users in the room.
/// </item>
/// <item>
/// <see cref="ModAdaptiveSpeed"/> is not valid for multiplayer, as it leads to varying
/// gameplay duration depending on how the users in the room play.
/// </item>
/// <item><see cref="ModAutoplay"/> is not valid for multiplayer.</item>
/// </list>
/// </example>
[JsonIgnore]
public virtual bool ValidForMultiplayer => true;
/// <summary>
/// Whether this mod can be specified as a "free" or "allowed" mod in a multiplayer context.
/// </summary>
/// <example>
/// <list type="bullet">
/// <item><see cref="ModHardRock"/> is valid for multiplayer as a free mod.</item>
/// <item>
/// <see cref="ModDoubleTime"/> is <b>not</b> valid for multiplayer as a free mod,
/// as it could to varying gameplay duration between users in the room depending on whether they picked it.
/// </item>
/// <item><see cref="ModAutoplay"/> is not valid for multiplayer as a free mod.</item>
/// </list>
/// </example>
[JsonIgnore]
public virtual bool ValidForMultiplayerAsFreeMod => true;

View File

@ -31,8 +31,8 @@ namespace osu.Game.Rulesets.Mods
public override double ScoreMultiplier => 0.5;
public override bool ValidForMultiplayer => false;
public override bool ValidForMultiplayerAsFreeMod => false;
public sealed override bool ValidForMultiplayer => false;
public sealed override bool ValidForMultiplayerAsFreeMod => false;
public override Type[] IncompatibleMods => new[] { typeof(ModRateAdjust), typeof(ModTimeRamp), typeof(ModAutoplay) };

View File

@ -20,9 +20,9 @@ namespace osu.Game.Rulesets.Mods
public override LocalisableString Description => "Watch a perfect automated play through the song.";
public override double ScoreMultiplier => 1;
public override bool UserPlayable => false;
public override bool ValidForMultiplayer => false;
public override bool ValidForMultiplayerAsFreeMod => false;
public sealed override bool UserPlayable => false;
public sealed override bool ValidForMultiplayer => false;
public sealed override bool ValidForMultiplayerAsFreeMod => false;
public override Type[] IncompatibleMods => new[] { typeof(ModCinema), typeof(ModRelax), typeof(ModAdaptiveSpeed) };

View File

@ -9,7 +9,7 @@ namespace osu.Game.Rulesets.Mods
{
public abstract class ModRateAdjust : Mod, IApplicableToRate
{
public override bool ValidForMultiplayerAsFreeMod => false;
public sealed override bool ValidForMultiplayerAsFreeMod => false;
public abstract BindableNumber<double> SpeedChange { get; }

View File

@ -9,7 +9,7 @@ namespace osu.Game.Rulesets.Mods
/// This mod is used strictly to mark osu!stable scores set with the "Score V2" mod active.
/// It should not be used in any real capacity going forward.
/// </remarks>
public class ModScoreV2 : Mod
public sealed class ModScoreV2 : Mod
{
public override string Name => "Score V2";
public override string Acronym => @"SV2";
@ -17,5 +17,7 @@ namespace osu.Game.Rulesets.Mods
public override LocalisableString Description => "Score set on earlier osu! versions with the V2 scoring algorithm active.";
public override double ScoreMultiplier => 1;
public override bool UserPlayable => false;
public override bool ValidForMultiplayer => false;
public override bool ValidForMultiplayerAsFreeMod => false;
}
}

View File

@ -30,7 +30,7 @@ namespace osu.Game.Rulesets.Mods
[SettingSource("Adjust pitch", "Should pitch be adjusted with speed")]
public abstract BindableBool AdjustPitch { get; }
public override bool ValidForMultiplayerAsFreeMod => false;
public sealed override bool ValidForMultiplayerAsFreeMod => false;
public override Type[] IncompatibleMods => new[] { typeof(ModRateAdjust), typeof(ModAdaptiveSpeed) };

View File

@ -5,7 +5,7 @@ using osu.Framework.Localisation;
namespace osu.Game.Rulesets.Mods
{
public class UnknownMod : Mod
public sealed class UnknownMod : Mod
{
/// <summary>
/// The acronym of the mod which could not be resolved.