-
-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #487 from LumpBloom7/HR-maimai-judgement-mode
Implement maimai judgement modes in HardRock
- Loading branch information
Showing
29 changed files
with
382 additions
and
77 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
osu.Game.Rulesets.Sentakki/Judgements/SentakkiJudgementResult.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
using osu.Game.Rulesets.Judgements; | ||
using osu.Game.Rulesets.Objects; | ||
using osu.Game.Rulesets.Scoring; | ||
|
||
namespace osu.Game.Rulesets.Sentakki.Judgements; | ||
|
||
public class SentakkiJudgementResult : JudgementResult | ||
{ | ||
public SentakkiJudgementResult(HitObject hitObject, Judgement judgement) : base(hitObject, judgement) | ||
{ | ||
} | ||
|
||
public new HitResult Type | ||
{ | ||
get => base.Type; | ||
set | ||
{ | ||
Critical = value == HitResult.Perfect; | ||
base.Type = Critical ? HitResult.Great : value; | ||
} | ||
} | ||
|
||
public bool Critical { get; private set; } | ||
} |
17 changes: 17 additions & 0 deletions
17
osu.Game.Rulesets.Sentakki/Localisation/Mods/SentakkiModHardRockStrings.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
using osu.Framework.Localisation; | ||
|
||
namespace osu.Game.Rulesets.Sentakki.Localisation.Mods | ||
{ | ||
public static class SentakkiModHardRockStrings | ||
{ | ||
private const string prefix = @"osu.Game.Rulesets.Sentakki.Resources.Localisation.Mods.SentakkiModHardRockStrings"; | ||
|
||
public static LocalisableString JudgementMode => new TranslatableString(getKey(@"judgement_mode"), @"Judgement mode"); | ||
public static LocalisableString JudgementModeDescription => new TranslatableString(getKey(@"judgement_mode_description"), @"Judgement modes determine how strict the hitwindows are during gameplay."); | ||
|
||
public static LocalisableString MinimumResult => new TranslatableString(getKey(@"minimum_result"), @"Minimum hit result"); | ||
public static LocalisableString MinimumResultDescription => new TranslatableString(getKey(@"minimum_result_description"), @"The minimum HitResult that is accepted during gameplay. Anything below will be considered a miss."); | ||
|
||
private static string getKey(string key) => $"{prefix}:{key}"; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,50 @@ | ||
using System.ComponentModel; | ||
using osu.Framework.Bindables; | ||
using osu.Game.Beatmaps; | ||
using osu.Game.Configuration; | ||
using osu.Game.Rulesets.Mods; | ||
using osu.Game.Rulesets.Objects; | ||
using osu.Game.Rulesets.Scoring; | ||
using osu.Game.Rulesets.Sentakki.Localisation.Mods; | ||
using osu.Game.Rulesets.Sentakki.Scoring; | ||
|
||
namespace osu.Game.Rulesets.Sentakki.Mods | ||
{ | ||
public class SentakkiModHardRock : ModHardRock | ||
public class SentakkiModHardRock : ModHardRock, IApplicableToHitObject | ||
{ | ||
public override double ScoreMultiplier => 1.06; | ||
public override double ScoreMultiplier => 1; | ||
|
||
public override void ApplyToDifficulty(BeatmapDifficulty difficulty) | ||
{ | ||
difficulty.OverallDifficulty = 10f; | ||
// This is a no-op since we don't use beatmap difficulty | ||
// The only reason we still inherit from ModHardRock is to be able to use their localized strings | ||
} | ||
|
||
[SettingSource(typeof(SentakkiModHardRockStrings), nameof(SentakkiModHardRockStrings.JudgementMode), nameof(SentakkiModHardRockStrings.JudgementModeDescription))] | ||
public Bindable<SentakkiJudgementMode> judgementMode { get; } = new Bindable<SentakkiJudgementMode>(SentakkiJudgementMode.Maji); | ||
|
||
[SettingSource(typeof(SentakkiModHardRockStrings), nameof(SentakkiModHardRockStrings.MinimumResult), nameof(SentakkiModHardRockStrings.MinimumResultDescription))] | ||
public Bindable<SentakkiHitResult> minimumValidResult { get; } = new Bindable<SentakkiHitResult>(SentakkiHitResult.Good); | ||
|
||
public void ApplyToHitObject(HitObject hitObject) | ||
{ | ||
// Nested HitObjects should get the same treatment | ||
foreach (var nested in hitObject.NestedHitObjects) | ||
ApplyToHitObject(nested); | ||
|
||
if (hitObject.HitWindows is not SentakkiHitWindows shw) | ||
return; | ||
|
||
shw.MinimumHitResult = (HitResult)minimumValidResult.Value; | ||
shw.JudgementMode = judgementMode.Value; | ||
} | ||
|
||
public enum SentakkiHitResult | ||
{ | ||
Good = 3, | ||
Great = 4, | ||
Perfect = 5, | ||
[Description("Critical Perfect")] Critical = 6, | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,15 @@ | ||
using System; | ||
using System.Linq; | ||
using osu.Game.Rulesets.Mods; | ||
|
||
namespace osu.Game.Rulesets.Sentakki.Mods | ||
{ | ||
public class SentakkiModNoFail : ModNoFail | ||
{ | ||
public override Type[] IncompatibleMods => base.IncompatibleMods.Append(typeof(SentakkiModChallenge)).ToArray(); | ||
public override Type[] IncompatibleMods => new Type[]{ | ||
typeof(ModRelax), | ||
typeof(ModFailCondition), | ||
typeof(SentakkiModChallenge), | ||
typeof(ModAutoplay) | ||
}; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.