From cf3aaff7bd1bf796f826d18f8a56c7a07d1359c6 Mon Sep 17 00:00:00 2001 From: Fabian Date: Sat, 17 Apr 2021 16:01:23 +0200 Subject: [PATCH] Add floating fruits mod --- osu.Game.Rulesets.Catch/CatchRuleset.cs | 3 ++- .../Mods/CatchModFloatingFruits.cs | 23 +++++++++++++++++++ osu.Game/Screens/Play/Player.cs | 2 +- 3 files changed, 26 insertions(+), 2 deletions(-) create mode 100644 osu.Game.Rulesets.Catch/Mods/CatchModFloatingFruits.cs diff --git a/osu.Game.Rulesets.Catch/CatchRuleset.cs b/osu.Game.Rulesets.Catch/CatchRuleset.cs index f4ddbd3021..6206815728 100644 --- a/osu.Game.Rulesets.Catch/CatchRuleset.cs +++ b/osu.Game.Rulesets.Catch/CatchRuleset.cs @@ -126,7 +126,8 @@ namespace osu.Game.Rulesets.Catch case ModType.Fun: return new Mod[] { - new MultiMod(new ModWindUp(), new ModWindDown()) + new MultiMod(new ModWindUp(), new ModWindDown()), + new CatchModFloatingFruits() }; default: diff --git a/osu.Game.Rulesets.Catch/Mods/CatchModFloatingFruits.cs b/osu.Game.Rulesets.Catch/Mods/CatchModFloatingFruits.cs new file mode 100644 index 0000000000..4e25739521 --- /dev/null +++ b/osu.Game.Rulesets.Catch/Mods/CatchModFloatingFruits.cs @@ -0,0 +1,23 @@ +using osu.Framework.Graphics; +using osu.Framework.Graphics.Sprites; +using osu.Game.Rulesets.Mods; +using osu.Game.Screens.Play; + +namespace osu.Game.Rulesets.Catch.Mods +{ + public class CatchModFloatingFruits : Mod, IApplicableToPlayer + { + public override string Name => "Floating Fruits"; + public override string Acronym => "FF"; + public override string Description => "The fruits are... floating?"; + public override double ScoreMultiplier => 1; + public override IconUsage? Icon => FontAwesome.Brands.Fly; + + public void ApplyToPlayer(Player player) + { + player.DrawableRuleset.Anchor = Anchor.Centre; + player.DrawableRuleset.Origin = Anchor.Centre; + player.DrawableRuleset.Scale = new osuTK.Vector2(1, -1); + } + } +} diff --git a/osu.Game/Screens/Play/Player.cs b/osu.Game/Screens/Play/Player.cs index dd3f58439b..59231a1c30 100644 --- a/osu.Game/Screens/Play/Player.cs +++ b/osu.Game/Screens/Play/Player.cs @@ -110,7 +110,7 @@ namespace osu.Game.Screens.Play protected HealthProcessor HealthProcessor { get; private set; } - protected DrawableRuleset DrawableRuleset { get; private set; } + public DrawableRuleset DrawableRuleset { get; set; } protected HUDOverlay HUDOverlay { get; private set; }