1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-28 20:32:55 +08:00

Freeze frame testing

This commit is contained in:
Mk-56spn 2022-09-08 00:05:48 +02:00
parent 91742859f1
commit 5a1b2f9a77
2 changed files with 56 additions and 32 deletions

View File

@ -1,61 +1,84 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence. using System;
// See the LICENCE file in the repository root for full licence text.
using System.Linq; using System.Linq;
using osu.Framework.Bindables; using osu.Framework.Bindables;
using osu.Framework.Graphics.Sprites; using osu.Framework.Graphics.Sprites;
using osu.Game.Beatmaps; using osu.Game.Beatmaps;
using osu.Game.Configuration; using osu.Game.Configuration;
using osu.Game.Rulesets.Mods; using osu.Game.Rulesets.Mods;
using osu.Game.Rulesets.Objects;
using osu.Game.Rulesets.Objects.Drawables; using osu.Game.Rulesets.Objects.Drawables;
using osu.Game.Rulesets.Osu.Objects; using osu.Game.Rulesets.Osu.Objects;
using osu.Game.Rulesets.Osu.Objects.Drawables;
using osu.Game.Rulesets.Osu.UI;
using osu.Game.Rulesets.UI;
using osuTK;
namespace osu.Game.Rulesets.Osu.Mods namespace osu.Game.Rulesets.Osu.Mods
{ {
public class OsuModFlash : ModWithVisibilityAdjustment, IApplicableAfterBeatmapConversion public class OsuModFlash : ModWithVisibilityAdjustment, IHidesApproachCircles, IApplicableToDrawableRuleset<OsuHitObject>
{ {
public override string Name => "Var AR Test"; public override string Name => "Freeze frame";
public override string Acronym => "TP";
public override string Acronym => "FF";
public override double ScoreMultiplier => 1;
public override string Description => "Burn the notes into your memory";
public override ModType Type => ModType.Fun; public override ModType Type => ModType.Fun;
public override IconUsage? Icon => FontAwesome.Regular.Sun;
public override string Description => @"how far will your reading stretch"; public override IconUsage? Icon => FontAwesome.Solid.Fire;
public override double ScoreMultiplier => 1.03;
public override Type[] IncompatibleMods => new[] { typeof(OsuModTarget), typeof(OsuModStrictTracking) };
[SettingSource("Beat divisor")]
public BindableFloat BeatDivisor { get; } = new BindableFloat(2)
{
MinValue = .25f,
MaxValue = 2,
Precision = .25F
};
public override void ApplyToBeatmap(IBeatmap beatmap) public override void ApplyToBeatmap(IBeatmap beatmap)
{ {
base.ApplyToBeatmap(beatmap); base.ApplyToBeatmap(beatmap);
double lastObjectEnd = beatmap.HitObjects.LastOrDefault()?.GetEndTime() ?? 0;
foreach (var obj in beatmap.HitObjects.OfType<OsuHitObject>()) foreach (var hitObject in beatmap.HitObjects.OfType<OsuHitObject>())
applyVariableAr(obj);
void applyVariableAr(OsuHitObject osuObject)
{ {
double percentageofmap = osuObject.StartTime / lastObjectEnd; hitObject.TimeFadeIn = hitObject.TimePreempt;
osuObject.TimePreempt = (percentageofmap * osuObject.TimePreempt) * ARadded.Value + osuObject.TimePreempt; var point = beatmap.ControlPointInfo.TimingPointAt(hitObject.StartTime);
foreach (var nested in osuObject.NestedHitObjects.OfType<OsuHitObject>()) hitObject.TimePreempt += hitObject.StartTime % (point.BeatLength / BeatDivisor.Value);
applyVariableAr(nested);
} }
} }
public void ApplyToDrawableRuleset(DrawableRuleset<OsuHitObject> drawableRuleset)
{
(drawableRuleset.Playfield as OsuPlayfield)?.FollowPoints.Hide();
}
protected override void ApplyIncreasedVisibilityState(DrawableHitObject hitObject, ArmedState state) protected override void ApplyIncreasedVisibilityState(DrawableHitObject hitObject, ArmedState state)
{ {
} }
protected override void ApplyNormalVisibilityState(DrawableHitObject hitObject, ArmedState state) protected override void ApplyNormalVisibilityState(DrawableHitObject hitObject, ArmedState state) => applyFrozenState(hitObject, state);
private void applyFrozenState(DrawableHitObject drawable, ArmedState state)
{ {
if (drawable is DrawableSpinner)
return;
var h = (OsuHitObject)drawable.HitObject;
switch (drawable)
{
case DrawableHitCircle circle:
using (circle.BeginAbsoluteSequence(h.StartTime - h.TimePreempt))
{
circle.ApproachCircle.Hide();
}
break;
}
} }
[SettingSource("Additional AR", "how much AR change to add")]
public BindableDouble ARadded { get; } = new BindableDouble(1)
{
Precision = 0.1f,
MinValue = 0,
MaxValue = 10,
};
/*[SettingSource("Additional Ar", "how much ar change to add")]
public BindableBool scaledown { get; } = new BindableBool();*/
} }
} }

View File

@ -198,7 +198,8 @@ namespace osu.Game.Rulesets.Osu
new OsuModMuted(), new OsuModMuted(),
new OsuModNoScope(), new OsuModNoScope(),
new MultiMod(new OsuModMagnetised(), new OsuModRepel()), new MultiMod(new OsuModMagnetised(), new OsuModRepel()),
new ModAdaptiveSpeed() new ModAdaptiveSpeed(),
new OsuModFlash()
}; };
case ModType.System: case ModType.System: