Skip to content

Commit

Permalink
Merge pull request #225 from minisbett/large-tick-misses-parameter
Browse files Browse the repository at this point in the history
Add `--large-tick-misses` and `--slider-tail-misses` parameters to simulate command
  • Loading branch information
smoogipoo authored Oct 22, 2024
2 parents 1d17138 + e235ae9 commit 73ea94e
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions PerformanceCalculator/Simulate/OsuSimulateCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,13 @@

using System;
using System.Collections.Generic;
using System.Linq;
using JetBrains.Annotations;
using McMaster.Extensions.CommandLineUtils;
using osu.Game.Beatmaps;
using osu.Game.Rulesets;
using osu.Game.Rulesets.Osu;
using osu.Game.Rulesets.Osu.Objects;
using osu.Game.Rulesets.Scoring;

namespace PerformanceCalculator.Simulate
Expand All @@ -31,6 +33,14 @@ public class OsuSimulateCommand : SimulateCommand
[Option(Template = "-C|--percent-combo <combo>", Description = "Percentage of beatmap maximum combo achieved. Alternative to combo option. Enter as decimal 0-100.")]
public override double PercentCombo { get; } = 100;

[UsedImplicitly]
[Option(Template = "-L|--large-tick-misses <misses>", Description = "Number of large tick misses. Defaults to 0.")]
private int largeTickMisses { get; }

[UsedImplicitly]
[Option(Template = "-S|--slider-tail-misses <misses>", Description = "Number of slider tail misses. Defaults to 0.")]
private int sliderTailMisses { get; }

public override Ruleset Ruleset => new OsuRuleset();

protected override int GetMaxCombo(IBeatmap beatmap) => beatmap.GetMaxCombo();
Expand Down Expand Up @@ -116,6 +126,8 @@ protected override Dictionary<HitResult, int> GenerateHitResults(double accuracy
{ HitResult.Great, countGreat },
{ HitResult.Ok, countGood ?? 0 },
{ HitResult.Meh, countMeh ?? 0 },
{ HitResult.LargeTickMiss, largeTickMisses },
{ HitResult.SliderTailHit, beatmap.HitObjects.Count(x => x is Slider) - sliderTailMisses },
{ HitResult.Miss, countMiss }
};
}
Expand Down

0 comments on commit 73ea94e

Please sign in to comment.