2019-01-24 16:43:03 +08:00
|
|
|
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
|
|
|
|
// See the LICENCE file in the repository root for full licence text.
|
2018-04-13 17:19:50 +08:00
|
|
|
|
|
2018-01-09 12:41:57 +08:00
|
|
|
|
using System;
|
2020-07-14 21:06:15 +08:00
|
|
|
|
using System.Linq;
|
2022-08-11 04:09:11 +08:00
|
|
|
|
using osu.Framework.Localisation;
|
2021-02-24 14:05:12 +08:00
|
|
|
|
using osu.Game.Rulesets.Mania.UI;
|
2022-12-20 07:31:28 +08:00
|
|
|
|
using osu.Framework.Bindables;
|
2024-02-06 22:47:20 +08:00
|
|
|
|
using osu.Game.Rulesets.Scoring;
|
2018-04-13 17:19:50 +08:00
|
|
|
|
|
2018-01-09 12:41:57 +08:00
|
|
|
|
namespace osu.Game.Rulesets.Mania.Mods
|
|
|
|
|
{
|
2021-02-24 12:39:15 +08:00
|
|
|
|
public class ManiaModHidden : ManiaModPlayfieldCover
|
2018-01-09 12:41:57 +08:00
|
|
|
|
{
|
2024-02-06 22:47:20 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// osu!stable is referenced to 480px.
|
|
|
|
|
/// </summary>
|
|
|
|
|
private const float playfield_height = 480;
|
2020-07-14 21:06:15 +08:00
|
|
|
|
|
2024-02-06 22:47:20 +08:00
|
|
|
|
private const float min_coverage = 160f / playfield_height;
|
|
|
|
|
private const float max_coverage = 400f / playfield_height;
|
|
|
|
|
private const float coverage_increase_per_combo = 0.5f / playfield_height;
|
2022-12-21 02:33:33 +08:00
|
|
|
|
|
2024-02-06 22:47:20 +08:00
|
|
|
|
public override LocalisableString Description => @"Keys fade out before you hit them!";
|
|
|
|
|
public override double ScoreMultiplier => 1;
|
2021-02-24 12:39:15 +08:00
|
|
|
|
public override Type[] IncompatibleMods => base.IncompatibleMods.Append(typeof(ManiaModFadeIn)).ToArray();
|
2021-02-24 14:05:12 +08:00
|
|
|
|
|
2024-02-06 22:47:20 +08:00
|
|
|
|
public override BindableNumber<float> Coverage { get; } = new BindableFloat(min_coverage);
|
2021-02-24 14:05:12 +08:00
|
|
|
|
protected override CoverExpandDirection ExpandDirection => CoverExpandDirection.AgainstScroll;
|
2024-02-06 22:47:20 +08:00
|
|
|
|
|
|
|
|
|
private readonly BindableInt combo = new BindableInt();
|
|
|
|
|
|
|
|
|
|
public override void ApplyToScoreProcessor(ScoreProcessor scoreProcessor)
|
|
|
|
|
{
|
|
|
|
|
base.ApplyToScoreProcessor(scoreProcessor);
|
|
|
|
|
|
|
|
|
|
combo.UnbindAll();
|
|
|
|
|
combo.BindTo(scoreProcessor.Combo);
|
|
|
|
|
combo.BindValueChanged(c => Coverage.Value = Math.Min(max_coverage, min_coverage + c.NewValue * coverage_increase_per_combo), true);
|
|
|
|
|
}
|
2018-01-09 12:41:57 +08:00
|
|
|
|
}
|
|
|
|
|
}
|