Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update existing mods #654

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all 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
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ public static class SentakkiModHiddenStrings
private const string prefix = @"osu.Game.Rulesets.Sentakki.Resources.Localisation.Mods.SentakkiModHiddenStrings";

public static LocalisableString ModDescription => new TranslatableString(getKey(@"mod_description"), @"Notes fade out just before you hit them.");
public static LocalisableString VisibleRadius => new TranslatableString(getKey(@"visible_radius"), @"Visible radius");
public static LocalisableString VisibleRadiusDescription => new TranslatableString(getKey(@"visible_radius_description"), @"The visible radius of laned notes.");

private static string getKey(string key) => $"{prefix}:{key}";
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ public static class SentakkiModSpinStrings

public static LocalisableString RevolutionDurationDescription => new TranslatableString(getKey(@"revolution_duration_description"), @"The duration in seconds to complete a revolution.");

public static LocalisableString RevolutionDurationTooltip(int seconds)
=> new TranslatableString(getKey(@"entry_speed_tooltip"), @"{0}s", seconds);

private static string getKey(string key) => $"{prefix}:{key}";
}
}
1 change: 0 additions & 1 deletion osu.Game.Rulesets.Sentakki/Mods/SentakkiModDaycore.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,5 @@ namespace osu.Game.Rulesets.Sentakki.Mods
{
public class SentakkiModDaycore : ModDaycore
{
public override double ScoreMultiplier => 0.3;
}
}
1 change: 0 additions & 1 deletion osu.Game.Rulesets.Sentakki/Mods/SentakkiModDoubleTime.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,5 @@ namespace osu.Game.Rulesets.Sentakki.Mods
{
public class SentakkiModDoubleTime : ModDoubleTime
{
public override double ScoreMultiplier => 1.12;
}
}
1 change: 0 additions & 1 deletion osu.Game.Rulesets.Sentakki/Mods/SentakkiModHalfTime.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,5 @@ namespace osu.Game.Rulesets.Sentakki.Mods
{
public class SentakkiModHalfTime : ModHalfTime
{
public override double ScoreMultiplier => 0.3;
}
}
16 changes: 15 additions & 1 deletion osu.Game.Rulesets.Sentakki/Mods/SentakkiModHardRock.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,21 @@ namespace osu.Game.Rulesets.Sentakki.Mods
{
public class SentakkiModHardRock : ModHardRock, IApplicableToHitObject, IApplicableToDrawableHitObject
{
public override double ScoreMultiplier => 1;
public override double ScoreMultiplier
{
get
{
switch (JudgementMode.Value)
{
case SentakkiJudgementMode.Gati:
return 1.2;
case SentakkiJudgementMode.Maji:
return 1.1;
default:
return 1;
}
}
}

public override string ExtendedIconInformation => $"{(JudgementMode.Value == SentakkiJudgementMode.Normal ? string.Empty : JudgementMode.Value)}";

Expand Down
40 changes: 38 additions & 2 deletions osu.Game.Rulesets.Sentakki/Mods/SentakkiModHidden.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using System;
using System.Runtime.InteropServices;
using osu.Framework.Allocation;
using osu.Framework.Bindables;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Primitives;
Expand All @@ -9,13 +10,17 @@
using osu.Framework.Graphics.Shaders;
using osu.Framework.Graphics.Shaders.Types;
using osu.Framework.Localisation;
using osu.Game.Configuration;
using osu.Game.Graphics.OpenGL.Vertices;
using osu.Game.Graphics.UserInterface;
using osu.Game.Overlays.Settings;
using osu.Game.Rulesets.Mods;
using osu.Game.Rulesets.Objects.Drawables;
using osu.Game.Rulesets.Scoring;
using osu.Game.Rulesets.Sentakki.Localisation.Mods;
using osu.Game.Rulesets.Sentakki.Objects;
using osu.Game.Rulesets.Sentakki.Objects.Drawables;
using osu.Game.Rulesets.Sentakki.Objects.Drawables.Pieces;
using osu.Game.Rulesets.Sentakki.UI;
using osu.Game.Rulesets.UI;
using osuTK;
Expand All @@ -26,7 +31,24 @@ public partial class SentakkiModHidden : ModHidden, IApplicableToDrawableRuleset
{
public override LocalisableString Description => SentakkiModHiddenStrings.ModDescription;

public override double ScoreMultiplier => 1.06;
public override string ExtendedIconInformation => VisibleRadius.IsDefault ? string.Empty : $"{VisibleRadius.Value:P0}";

public override double ScoreMultiplier => 1 + (MathF.Pow(1 - VisibleRadius.Value, 2) * 0.2);

[SettingSource(
typeof(SentakkiModHiddenStrings),
nameof(SentakkiModHiddenStrings.VisibleRadius),
nameof(SentakkiModHiddenStrings.VisibleRadiusDescription),
SettingControlType = typeof(SettingsSlider<float, PercentageRoundedSliderBar>))]
public BindableFloat VisibleRadius { get; } = new BindableFloat
{
MinValue = 0f,
MaxValue = 1f,
Default = 0.6f,
Value = 0.6f,
Precision = 0.05f
};


public void ApplyToDrawableRuleset(DrawableRuleset<SentakkiHitObject> drawableRuleset)
{
Expand All @@ -36,10 +58,16 @@ public void ApplyToDrawableRuleset(DrawableRuleset<SentakkiHitObject> drawableRu
var lanedHitObjectArea = lanedPlayfield.LanedHitObjectArea;
var lanedNoteProxyContainer = lanedHitObjectArea.Child;

float noteVisiblePoint = SentakkiPlayfield.NOTESTARTDISTANCE - (NoteRingPiece.DRAWABLE_SIZE / 2f);
float totalVisibleDistance = SentakkiPlayfield.INTERSECTDISTANCE;

float visibilityStartPoint = noteVisiblePoint / totalVisibleDistance;
float visibleRatio = 1 - visibilityStartPoint;

lanedHitObjectArea.Remove(lanedNoteProxyContainer, false);
lanedHitObjectArea.Add(new PlayfieldMaskingContainer(lanedNoteProxyContainer)
{
CoverageRadius = 0.6f
CoverageRadius = visibilityStartPoint + (visibleRatio * VisibleRadius.Value)
});

lanedPlayfield.HitObjectLineRenderer.Hide();
Expand Down Expand Up @@ -76,6 +104,14 @@ protected override void ApplyNormalVisibilityState(DrawableHitObject hitObject,
}
}

private partial class PercentageRoundedSliderBar : RoundedSliderBar<float>
{
public PercentageRoundedSliderBar()
{
DisplayAsPercentage = true;
}
}

private partial class PlayfieldMaskingContainer : CircularContainer
{
private readonly PlayfieldMask cover;
Expand Down
1 change: 0 additions & 1 deletion osu.Game.Rulesets.Sentakki/Mods/SentakkiModNightcore.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,5 @@ namespace osu.Game.Rulesets.Sentakki.Mods
{
public class SentakkiModNightcore : ModNightcore<SentakkiHitObject>
{
public override double ScoreMultiplier => 1.12;
}
}
15 changes: 0 additions & 15 deletions osu.Game.Rulesets.Sentakki/Mods/SentakkiModNoFail.cs

This file was deleted.

20 changes: 17 additions & 3 deletions osu.Game.Rulesets.Sentakki/Mods/SentakkiModSpin.cs
Original file line number Diff line number Diff line change
@@ -1,26 +1,35 @@
using osu.Framework.Bindables;
using System;
using osu.Framework.Bindables;
using osu.Framework.Graphics.Sprites;
using osu.Framework.Localisation;
using osu.Game.Configuration;
using osu.Game.Graphics.UserInterface;
using osu.Game.Overlays.Settings;
using osu.Game.Rulesets.Mods;
using osu.Game.Rulesets.Sentakki.Localisation.Mods;
using osu.Game.Rulesets.Sentakki.UI;
using osu.Game.Rulesets.UI;

namespace osu.Game.Rulesets.Sentakki.Mods
{
public class SentakkiModSpin : Mod, IUpdatableByPlayfield
public partial class SentakkiModSpin : Mod, IUpdatableByPlayfield
{
public override string Name => "Spin";
public override LocalisableString Description => SentakkiModSpinStrings.ModDescription;

public override string ExtendedIconInformation => SentakkiModSpinStrings.RevolutionDurationTooltip(seconds: RevolutionDuration.Value).ToString();
public override string Acronym => "S";

public override IconUsage? Icon => FontAwesome.Solid.RedoAlt;
public override ModType Type => ModType.Fun;

public override double ScoreMultiplier => 1.00;

[SettingSource(typeof(SentakkiModSpinStrings), nameof(SentakkiModSpinStrings.RevolutionDuration), nameof(SentakkiModSpinStrings.RevolutionDurationDescription))]
[SettingSource(
typeof(SentakkiModSpinStrings),
nameof(SentakkiModSpinStrings.RevolutionDuration),
nameof(SentakkiModSpinStrings.RevolutionDurationDescription),
SettingControlType = typeof(SettingsSlider<int, RevolutionDurationSlider>))]
public BindableNumber<int> RevolutionDuration { get; } = new BindableNumber<int>
{
MinValue = 3,
Expand All @@ -35,5 +44,10 @@ public void Update(Playfield playfield)
if (playfield is SentakkiPlayfield)
playfield.Rotation = (float)(playfield.Time.Current / (RevolutionDuration.Value * 1000)) * 360f;
}

public partial class RevolutionDurationSlider : RoundedSliderBar<int>
{
public override LocalisableString TooltipText => SentakkiModSpinStrings.RevolutionDurationTooltip(Current.Value);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ namespace osu.Game.Rulesets.Sentakki.Objects.Drawables.Pieces
public partial class NoteRingPiece : CompositeDrawable
{
private const float base_circle_size = 75;
private const float drawable_size = base_circle_size + 30; // 30 units for shadow
public const float DRAWABLE_SIZE = base_circle_size + 30; // 30 units for shadow

public NoteRingPiece(bool hex = false)
{
Padding = new MarginPadding(-drawable_size / 2);
Padding = new MarginPadding(-DRAWABLE_SIZE / 2);
RelativeSizeAxes = Axes.Both;
Anchor = Anchor.Centre;
Origin = Anchor.Centre;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,4 +61,10 @@
<data name="mod_description" xml:space="preserve">
<value>Notes fade out just before you hit them.</value>
</data>
</root>
<data name="visible_radius" xml:space="preserve">
<value>Visible radius</value>
</data>
<data name="visible_radius_description" xml:space="preserve">
<value>The visible radius of laned notes.</value>
</data>
</root>
Original file line number Diff line number Diff line change
Expand Up @@ -67,4 +67,8 @@
<data name="revolution_duration_description" xml:space="preserve">
<value>The duration in seconds to complete a revolution.</value>
</data>
</root>
<data name="revolution_duration_tooltip" xml:space="preserve">
<value>{0}s</value>
<comment>This is used to show the exact value, along with the local seconds symbol</comment>
</data>
</root>
3 changes: 1 addition & 2 deletions osu.Game.Rulesets.Sentakki/SentakkiRuleset.cs
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@ public override IEnumerable<Mod> GetModsFor(ModType type)
{
new SentakkiModRelax(),
new MultiMod(new SentakkiModHalfTime(), new SentakkiModDaycore()),
new SentakkiModNoFail(),
};

case ModType.DifficultyIncrease:
Expand Down Expand Up @@ -123,7 +122,7 @@ public override IEnumerable<Mod> GetModsFor(ModType type)
};

default:
return Array.Empty<Mod>();
return [];
}
}

Expand Down
Loading