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

key mod #27

Merged
merged 3 commits into from
Apr 8, 2021
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions osu.Game.Rulesets.Diva/Beatmaps/DivaBeatmapConverter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,12 @@ public class DivaBeatmapConverter : BeatmapConverter<DivaHitObject>
//every approach piece of a combo will come from one direction
//create patterns of same button

public int TargetButtons;

private DivaAction prevAction = DivaAction.Triangle;
private Vector2 prevObjectPos = Vector2.Zero;
//these variables were at the end of the class, such heresy had i done

private const float approach_piece_distance = 1200;

public DivaBeatmapConverter(IBeatmap beatmap, Ruleset ruleset)
Expand Down Expand Up @@ -99,9 +105,5 @@ private Vector2 GetApproachPieceOriginPos(Vector2 currentObjectPos)
return dir.Normalized() * approach_piece_distance;
}

public int TargetButtons;

private DivaAction prevAction = DivaAction.Triangle;
private Vector2 prevObjectPos = Vector2.Zero;
}
}
6 changes: 6 additions & 0 deletions osu.Game.Rulesets.Diva/DivaRuleset.cs
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,12 @@ public override IEnumerable<Mod> GetModsFor(ModType type)
return new Mod[]
{
new OsuModDifficultyAdjust(),
new MultiMod(
new DivaModKey1(),
new DivaModKey2(),
new DivaModKey3(),
new DivaModKey4()
),
};

default:
Expand Down
35 changes: 35 additions & 0 deletions osu.Game.Rulesets.Diva/Mods/DivaKeyMod.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
// Copyright (c) ppy Pty Ltd <[email protected]>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.

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 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 bool Ranked => true;

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

bc.TargetButtons = KeyCount;
}

public override Type[] IncompatibleMods => new[]
{
typeof(DivaModKey1),
typeof(DivaModKey2),
typeof(DivaModKey3),
typeof(DivaModKey4)
}.Except(new[] { GetType() }).ToArray();
}
}
13 changes: 13 additions & 0 deletions osu.Game.Rulesets.Diva/Mods/DivaModKey1.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
// Copyright (c) ppy Pty Ltd <[email protected]>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.

namespace osu.Game.Rulesets.Diva.Mods
{
public class DivaModKey1 : DivaKeyMod
{
public override int KeyCount => 1;
public override string Name => "One Button";
public override string Acronym => "1B";
public override string Description => @"Play with one button.";
}
}
13 changes: 13 additions & 0 deletions osu.Game.Rulesets.Diva/Mods/DivaModKey2.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
// Copyright (c) ppy Pty Ltd <[email protected]>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.

namespace osu.Game.Rulesets.Diva.Mods
{
public class DivaModKey2 : DivaKeyMod
{
public override int KeyCount => 2;
public override string Name => "Two Button";
public override string Acronym => "2B";
public override string Description => @"Play with two buttons.";
}
}
13 changes: 13 additions & 0 deletions osu.Game.Rulesets.Diva/Mods/DivaModKey3.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
// Copyright (c) ppy Pty Ltd <[email protected]>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.

namespace osu.Game.Rulesets.Diva.Mods
{
public class DivaModKey3 : DivaKeyMod
{
public override int KeyCount => 3;
public override string Name => "3 Button";
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should be "Three Button" for consistency

Actually make Button plural on all ModKey as well?

public override string Acronym => "3B";
public override string Description => @"Play with three buttons.";
}
}
13 changes: 13 additions & 0 deletions osu.Game.Rulesets.Diva/Mods/DivaModKey4.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
// Copyright (c) ppy Pty Ltd <[email protected]>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.

namespace osu.Game.Rulesets.Diva.Mods
{
public class DivaModKey4 : DivaKeyMod
{
public override int KeyCount => 4;
public override string Name => "Four Button";
public override string Acronym => "4B";
public override string Description => @"Play with four buttons.";
}
}