2019-01-24 08:43:03 +00:00
|
|
|
// 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.
|
2018-04-13 09:19:50 +00:00
|
|
|
|
2022-06-17 07:37:17 +00:00
|
|
|
#nullable disable
|
|
|
|
|
2017-04-21 08:33:20 +00:00
|
|
|
using System;
|
2021-01-31 16:19:07 +00:00
|
|
|
using System.Collections.Generic;
|
2019-03-27 10:29:27 +00:00
|
|
|
using osu.Framework.Graphics.Sprites;
|
2017-04-21 08:33:20 +00:00
|
|
|
using osu.Game.Beatmaps;
|
|
|
|
using osu.Game.Graphics;
|
2018-11-28 08:20:37 +00:00
|
|
|
using osu.Game.Replays;
|
2018-11-28 07:12:57 +00:00
|
|
|
using osu.Game.Scoring;
|
2018-04-13 09:19:50 +00:00
|
|
|
|
2017-04-21 08:33:20 +00:00
|
|
|
namespace osu.Game.Rulesets.Mods
|
|
|
|
{
|
2022-03-29 07:27:42 +00:00
|
|
|
public abstract class ModAutoplay : Mod, IApplicableFailOverride, ICreateReplayData
|
2017-04-21 08:33:20 +00:00
|
|
|
{
|
|
|
|
public override string Name => "Autoplay";
|
2018-11-30 08:16:00 +00:00
|
|
|
public override string Acronym => "AT";
|
2020-01-14 13:22:00 +00:00
|
|
|
public override IconUsage? Icon => OsuIcon.ModAuto;
|
2018-07-31 09:00:42 +00:00
|
|
|
public override ModType Type => ModType.Automation;
|
2018-03-14 03:07:03 +00:00
|
|
|
public override string Description => "Watch a perfect automated play through the song.";
|
2018-05-31 03:36:37 +00:00
|
|
|
public override double ScoreMultiplier => 1;
|
2019-09-18 16:45:42 +00:00
|
|
|
|
2020-05-12 11:08:35 +00:00
|
|
|
public bool PerformFail() => false;
|
|
|
|
|
2018-10-30 11:12:06 +00:00
|
|
|
public bool RestartOnFail => false;
|
2019-09-18 16:45:42 +00:00
|
|
|
|
2022-05-05 11:37:38 +00:00
|
|
|
public override bool UserPlayable => false;
|
|
|
|
public override bool ValidForMultiplayer => false;
|
|
|
|
public override bool ValidForMultiplayerAsFreeMod => false;
|
2021-06-09 05:17:01 +00:00
|
|
|
|
2022-03-29 14:25:05 +00:00
|
|
|
public override Type[] IncompatibleMods => new[] { typeof(ModCinema), typeof(ModRelax), typeof(ModFailCondition), typeof(ModNoFail) };
|
2019-03-07 09:30:31 +00:00
|
|
|
|
|
|
|
public override bool HasImplementation => GetType().GenericTypeArguments.Length == 0;
|
|
|
|
|
2022-03-31 02:33:26 +00:00
|
|
|
[Obsolete("Override CreateReplayData(IBeatmap, IReadOnlyList<Mod>) instead")] // Can be removed 20220929
|
2021-11-07 13:14:24 +00:00
|
|
|
public virtual Score CreateReplayScore(IBeatmap beatmap, IReadOnlyList<Mod> mods) => new Score { Replay = new Replay() };
|
2022-03-29 07:27:42 +00:00
|
|
|
|
|
|
|
public virtual ModReplayData CreateReplayData(IBeatmap beatmap, IReadOnlyList<Mod> mods)
|
|
|
|
{
|
|
|
|
#pragma warning disable CS0618
|
|
|
|
var replayScore = CreateReplayScore(beatmap, mods);
|
|
|
|
#pragma warning restore CS0618
|
|
|
|
|
2022-03-31 02:34:23 +00:00
|
|
|
return new ModReplayData(replayScore.Replay, new ModCreatedUser { Username = replayScore.ScoreInfo.User.Username });
|
2022-03-29 07:27:42 +00:00
|
|
|
}
|
2017-04-21 08:33:20 +00:00
|
|
|
}
|
2017-11-16 11:35:57 +00:00
|
|
|
}
|