Combined hidden with traceable as multi mod

This commit is contained in:
MaxOhn 2019-07-02 04:04:07 +02:00
parent d753f446e4
commit 4145173ac9
6 changed files with 44 additions and 42 deletions

View File

@ -17,7 +17,6 @@ namespace osu.Game.Rulesets.Osu.Mods
{
public override string Description => @"Play with no approach circles and fading circles/sliders.";
public override double ScoreMultiplier => 1.06;
public override Type[] IncompatibleMods => new[] { typeof(OsuModTraceable) };
private const double fade_in_duration_multiplier = 0.4;
private const double fade_out_duration_multiplier = 0.3;

View File

@ -11,15 +11,15 @@ using osu.Game.Rulesets.Osu.Objects.Drawables;
namespace osu.Game.Rulesets.Osu.Mods
{
internal class OsuModTraceable : OsuModHidden, IReadFromConfig, IApplicableToDrawableHitObjects
internal class OsuModTraceable : OsuModHidden
{
public override string Name => "Traceable";
public override string Acronym => "TC";
public override IconUsage Icon => FontAwesome.Brands.SnapchatGhost;
public override ModType Type => ModType.Fun;
public override ModType Type => ModType.DifficultyIncrease;
public override string Description => "Put your faith in the approach circles...";
public override double ScoreMultiplier => 1;
public override Type[] IncompatibleMods => new[] { typeof(OsuModHidden), typeof(OsuModGrow) };
public override Type[] IncompatibleMods => new[] { typeof(OsuModGrow) };
public override void ApplyToDrawableHitObjects(IEnumerable<DrawableHitObject> drawables)
{
@ -30,10 +30,12 @@ namespace osu.Game.Rulesets.Osu.Mods
case DrawableHitCircle _:
drawable.ApplyCustomUpdateState += ApplyTraceableState;
break;
case DrawableSlider slider:
slider.ApplyCustomUpdateState += ApplyHiddenState;
slider.HeadCircle.ApplyCustomUpdateState += ApplyTraceableState;
break;
default:
drawable.ApplyCustomUpdateState += ApplyHiddenState;
break;
@ -51,13 +53,13 @@ namespace osu.Game.Rulesets.Osu.Mods
// we only want to see the approach circle
using (circle.BeginAbsoluteSequence(h.StartTime - h.TimePreempt, true))
{
circle.circle.Hide(); // CirclePiece
circle.circle.AlwaysPresent = true;
circle.ring.Hide();
circle.flash.Hide();
circle.explode.Hide();
circle.number.Hide();
circle.glow.Hide();
circle.Circle.Hide(); // CirclePiece
circle.Circle.AlwaysPresent = true;
circle.Ring.Hide();
circle.Flash.Hide();
circle.Explode.Hide();
circle.Number.Hide();
circle.Glow.Hide();
circle.ApproachCircle.Show();
}
}

View File

@ -17,18 +17,18 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
public class DrawableHitCircle : DrawableOsuHitObject, IDrawableHitObjectWithProxiedApproach
{
public ApproachCircle ApproachCircle;
public readonly CirclePiece circle;
public readonly RingPiece ring;
public readonly FlashPiece flash;
public readonly ExplodePiece explode;
public readonly NumberPiece number;
public readonly GlowPiece glow;
public readonly CirclePiece Circle;
public readonly RingPiece Ring;
public readonly FlashPiece Flash;
public readonly ExplodePiece Explode;
public readonly NumberPiece Number;
public readonly GlowPiece Glow;
private readonly IBindable<Vector2> positionBindable = new Bindable<Vector2>();
private readonly IBindable<int> stackHeightBindable = new Bindable<int>();
private readonly IBindable<float> scaleBindable = new Bindable<float>();
public OsuAction? HitAction => circle.HitAction;
public OsuAction? HitAction => Circle.HitAction;
private readonly Container explodeContainer;
@ -55,8 +55,8 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
Anchor = Anchor.Centre,
Children = new Drawable[]
{
glow = new GlowPiece(),
circle = new CirclePiece
Glow = new GlowPiece(),
Circle = new CirclePiece
{
Hit = () =>
{
@ -67,13 +67,13 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
return true;
},
},
number = new NumberPiece
Number = new NumberPiece
{
Text = (HitObject.IndexInCurrentCombo + 1).ToString(),
},
ring = new RingPiece(),
flash = new FlashPiece(),
explode = new ExplodePiece(),
Ring = new RingPiece(),
Flash = new FlashPiece(),
Explode = new ExplodePiece(),
ApproachCircle = new ApproachCircle
{
Alpha = 0,
@ -85,7 +85,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
};
//may not be so correct
Size = circle.DrawSize;
Size = Circle.DrawSize;
}
[BackgroundDependencyLoader]
@ -106,9 +106,9 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
set
{
base.AccentColour = value;
explode.Colour = AccentColour;
glow.Colour = AccentColour;
circle.Colour = AccentColour;
Explode.Colour = AccentColour;
Glow.Colour = AccentColour;
Circle.Colour = AccentColour;
ApproachCircle.Colour = AccentColour;
}
}
@ -145,7 +145,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
protected override void UpdateCurrentState(ArmedState state)
{
glow.FadeOut(400);
Glow.FadeOut(400);
switch (state)
{
@ -154,7 +154,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
Expire(true);
circle.HitAction = null;
Circle.HitAction = null;
// override lifetime end as FadeIn may have been changed externally, causing out expiration to be too early.
LifetimeEnd = HitObject.StartTime + HitObject.HitWindows.HalfWindowFor(HitResult.Miss);
@ -170,18 +170,18 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
ApproachCircle.FadeOut(50);
const double flash_in = 40;
flash.FadeTo(0.8f, flash_in)
Flash.FadeTo(0.8f, flash_in)
.Then()
.FadeOut(100);
explode.FadeIn(flash_in);
Explode.FadeIn(flash_in);
using (BeginDelayedSequence(flash_in, true))
{
//after the flash, we can hide some elements that were behind it
ring.FadeOut();
circle.FadeOut();
number.FadeOut();
Ring.FadeOut();
Circle.FadeOut();
Number.FadeOut();
this.FadeOut(800);
explodeContainer.ScaleTo(1.5f, 400, Easing.OutQuad);

View File

@ -111,7 +111,7 @@ namespace osu.Game.Rulesets.Osu
new OsuModHardRock(),
new MultiMod(new OsuModSuddenDeath(), new OsuModPerfect()),
new MultiMod(new OsuModDoubleTime(), new OsuModNightcore()),
new OsuModHidden(),
new MultiMod(new OsuModHidden(), new OsuModTraceable()),
new MultiMod(new OsuModFlashlight(), new OsuModBlinds()),
};
@ -136,8 +136,6 @@ namespace osu.Game.Rulesets.Osu
new OsuModWiggle(),
new OsuModGrow(),
new MultiMod(new ModWindUp<OsuHitObject>(), new ModWindDown<OsuHitObject>()),
new OsuModTraceable(),
};
default:

View File

@ -85,7 +85,7 @@ namespace osu.Game.Tests.Visual.UserInterface
var assistMods = instance.GetModsFor(ModType.Automation);
var noFailMod = easierMods.FirstOrDefault(m => m is OsuModNoFail);
var hiddenMod = harderMods.FirstOrDefault(m => m is OsuModHidden);
var hiddenMod = harderMods.OfType<MultiMod>().FirstOrDefault(m => m.Mods.Any(a => a is OsuModHidden));
var doubleTimeMod = harderMods.OfType<MultiMod>().FirstOrDefault(m => m.Mods.Any(a => a is OsuModDoubleTime));
@ -96,10 +96,11 @@ namespace osu.Game.Tests.Visual.UserInterface
testSingleMod(noFailMod);
testMultiMod(doubleTimeMod);
testMultiMod(hiddenMod);
testIncompatibleMods(easy, hardRock);
testDeselectAll(easierMods.Where(m => !(m is MultiMod)));
testMultiplierTextColour(noFailMod, modSelect.LowMultiplierColour);
testMultiplierTextColour(hiddenMod, modSelect.HighMultiplierColour);
testMultiplierTextColour(hardRock, modSelect.HighMultiplierColour);
testUnimplementedMod(autoPilotMod);
}

View File

@ -112,13 +112,15 @@ namespace osu.Game.Overlays.Mods
if (selected == null) continue;
foreach (var type in modTypes)
if (type.IsInstanceOfType(selected) && !selected.GetType().IsSubclassOf(type))
{
if (type.IsInstanceOfType(selected))
{
if (immediate)
button.Deselect();
else
Scheduler.AddDelayed(button.Deselect, delay += 50);
}
}
}
}
@ -130,7 +132,7 @@ namespace osu.Game.Overlays.Mods
{
foreach (var button in buttons)
{
int i = Array.FindIndex(button.Mods, m => modTypes.Any(t => t.IsInstanceOfType(m) && !m.GetType().IsSubclassOf(t)));
int i = Array.FindIndex(button.Mods, m => modTypes.Any(t => t.IsInstanceOfType(m)));
if (i >= 0)
button.SelectAt(i);