Skip to content

Commit 9de8d7f

Browse files
authored
Merge pull request #323 from Yoshis1000000/Mods-Invert
Added Invert Mod
2 parents 7f975dc + e1e57b2 commit 9de8d7f

5 files changed

Lines changed: 111 additions & 0 deletions

File tree

osu.Game.Rulesets.Hishigata/HishigataRuleset.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ public override IEnumerable<Mod> GetModsFor(ModType type)
6868
return new Mod[]
6969
{
7070
new HishigataModTrustworthy(),
71+
new HishigataModInvert(),
7172
};
7273

7374
case ModType.Fun:
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
using osu.Framework.Localisation;
2+
3+
namespace osu.Game.Rulesets.Hishigata.Localisation.Mods
4+
{
5+
public static class HishigataModInvertStrings
6+
{
7+
private const string prefix = @"osu.Game.Rulesets.Hishigata.Resources.Localisation.Mods.HishigataModInvertStrings";
8+
9+
/// <summary>
10+
/// "Regular notes and feigns are swapped."
11+
/// </summary>
12+
public static LocalisableString ModDescription => new TranslatableString(getKey(@"mod_description"), @"Regular notes and feigns are swapped.");
13+
14+
private static string getKey(string key) => $"{prefix}:{key}";
15+
}
16+
}
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
using System;
2+
using osu.Framework.Graphics.Sprites;
3+
using osu.Framework.Localisation;
4+
using osu.Game.Graphics;
5+
using osu.Game.Rulesets.Objects;
6+
using osu.Game.Rulesets.Hishigata.Localisation.Mods;
7+
using osu.Game.Rulesets.Mods;
8+
using osu.Game.Rulesets.Hishigata.Objects;
9+
10+
namespace osu.Game.Rulesets.Hishigata.Mods
11+
{
12+
public class HishigataModInvert : Mod, IApplicableToHitObject
13+
{
14+
public override string Name => "Invert";
15+
public override string Acronym => "IN";
16+
public override LocalisableString Description => HishigataModInvertStrings.ModDescription;
17+
public override double ScoreMultiplier => 1.0;
18+
public override ModType Type => ModType.Conversion;
19+
public override Type[] IncompatibleMods => new[] { typeof(HishigataModTrustworthy) };
20+
public override IconUsage? Icon => OsuIcon.ModInvert;
21+
22+
public void ApplyToHitObject(HitObject hitObject)
23+
{
24+
var hishigataHitObject = (HishigataHitObject)hitObject;
25+
if (hishigataHitObject is HishigataNote hishigataNote) hishigataNote.IsFeign = !hishigataNote.IsFeign;
26+
}
27+
}
28+
}

osu.Game.Rulesets.Hishigata/Mods/HishigataModTrustworthy.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
using System;
12
using osu.Framework.Graphics.Sprites;
23
using osu.Framework.Localisation;
34
using osu.Game.Beatmaps;
@@ -14,6 +15,7 @@ public class HishigataModTrustworthy : Mod, IApplicableToBeatmapConverter
1415
public override LocalisableString Description => HishigataModTrustworthyStrings.ModDescription;
1516
public override double ScoreMultiplier => 0.8;
1617
public override ModType Type => ModType.Conversion;
18+
public override Type[] IncompatibleMods => new[] { typeof(HishigataModInvert) };
1719
public override IconUsage? Icon => FontAwesome.Solid.Check;
1820

1921
public void ApplyToBeatmapConverter(IBeatmapConverter beatmapConverter)
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<root>
3+
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
4+
<xsd:import namespace="http://www.w3.org/XML/1998/namespace"/>
5+
<xsd:element name="root" msdata:IsDataSet="true">
6+
<xsd:complexType>
7+
<xsd:choice maxOccurs="unbounded">
8+
<xsd:element name="metadata">
9+
<xsd:complexType>
10+
<xsd:sequence>
11+
<xsd:element name="value" type="xsd:string" minOccurs="0"/>
12+
</xsd:sequence>
13+
<xsd:attribute name="name" use="required" type="xsd:string"/>
14+
<xsd:attribute name="type" type="xsd:string"/>
15+
<xsd:attribute name="mimetype" type="xsd:string"/>
16+
<xsd:attribute ref="xml:space"/>
17+
</xsd:complexType>
18+
</xsd:element>
19+
<xsd:element name="assembly">
20+
<xsd:complexType>
21+
<xsd:attribute name="alias" type="xsd:string"/>
22+
<xsd:attribute name="name" type="xsd:string"/>
23+
</xsd:complexType>
24+
</xsd:element>
25+
<xsd:element name="data">
26+
<xsd:complexType>
27+
<xsd:sequence>
28+
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1"/>
29+
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2"/>
30+
</xsd:sequence>
31+
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1"/>
32+
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3"/>
33+
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4"/>
34+
<xsd:attribute ref="xml:space"/>
35+
</xsd:complexType>
36+
</xsd:element>
37+
<xsd:element name="resheader">
38+
<xsd:complexType>
39+
<xsd:sequence>
40+
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1"/>
41+
</xsd:sequence>
42+
<xsd:attribute name="name" type="xsd:string" use="required"/>
43+
</xsd:complexType>
44+
</xsd:element>
45+
</xsd:choice>
46+
</xsd:complexType>
47+
</xsd:element>
48+
</xsd:schema>
49+
<resheader name="resmimetype">
50+
<value>text/microsoft-resx</value>
51+
</resheader>
52+
<resheader name="version">
53+
<value>2.0</value>
54+
</resheader>
55+
<resheader name="reader">
56+
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
57+
</resheader>
58+
<resheader name="writer">
59+
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
60+
</resheader>
61+
<data name="mod_description" xml:space="preserve">
62+
<value>Regular notes and feigns are swapped.</value>
63+
</data>
64+
</root>

0 commit comments

Comments
 (0)