Skip to content
This repository has been archived by the owner on Jun 10, 2021. It is now read-only.

Commit

Permalink
Merge pull request #30 from Artemis-chan/doubles-toggle
Browse files Browse the repository at this point in the history
Implemented mod to disable double hit
  • Loading branch information
Thesola10 authored Apr 11, 2021
2 parents 52532bf + 04f122b commit 05662c4
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 2 deletions.
3 changes: 2 additions & 1 deletion osu.Game.Rulesets.Diva/Beatmaps/DivaBeatmapConverter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ public class DivaBeatmapConverter : BeatmapConverter<DivaHitObject>
//create patterns of same button

public int TargetButtons;
public bool AllowDoubles = true;

private DivaAction prevAction = DivaAction.Triangle;
private Vector2 prevObjectPos = Vector2.Zero;
Expand Down Expand Up @@ -61,7 +62,7 @@ protected override IEnumerable<DivaHitObject> ConvertHitObject(HitObject origina

//currently press presses are placed in place of sliders as placeholder, but arcade slider are better suited for these
//another option would be long sliders: arcade sliders, short sliders: doubles
if(original is IHasPathWithRepeats)
if(AllowDoubles && original is IHasPathWithRepeats)
{
yield return new DoublePressButton
{
Expand Down
1 change: 1 addition & 0 deletions osu.Game.Rulesets.Diva/DivaRuleset.cs
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ public override IEnumerable<Mod> GetModsFor(ModType type)
new DivaModKey3(),
new DivaModKey4()
),
new DivaModNoDoubles(),
};

default:
Expand Down
2 changes: 1 addition & 1 deletion osu.Game.Rulesets.Diva/Mods/DivaKeyMod.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public abstract class DivaKeyMod : Mod, IApplicableToBeatmapConverter
public override string Acronym => Name;
public abstract int KeyCount { get; }
public override ModType Type => ModType.Conversion;
public override double ScoreMultiplier => 1; // TODO: Implement the Diva key mod score multiplier
public override double ScoreMultiplier => 1;
public override bool Ranked => true;

public void ApplyToBeatmapConverter(IBeatmapConverter beatmapConverter)
Expand Down
24 changes: 24 additions & 0 deletions osu.Game.Rulesets.Diva/Mods/DivaModNoDoubles.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
using System;
using System.Linq;
using osu.Game.Beatmaps;
using osu.Game.Rulesets.Diva.Beatmaps;
using osu.Game.Rulesets.Mods;

namespace osu.Game.Rulesets.Diva.Mods
{
public class DivaModNoDoubles : Mod, IApplicableToBeatmapConverter
{
public override string Name => "No Doubles";
public override string Acronym => "ND";
public override ModType Type => ModType.Conversion;
public override double ScoreMultiplier => 0.667;
public override bool Ranked => true;

public void ApplyToBeatmapConverter(IBeatmapConverter beatmapConverter)
{
var bc = (DivaBeatmapConverter)beatmapConverter;

bc.AllowDoubles = false;
}
}
}

0 comments on commit 05662c4

Please sign in to comment.