1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-16 01:33:21 +08:00
osu-lazer/osu.Game.Rulesets.Catch.Tests/Mods/TestSceneCatchModRelax.cs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

87 lines
2.6 KiB
C#
Raw Normal View History

2020-08-24 00:00:06 +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.
2022-06-17 15:37:17 +08:00
#nullable disable
2020-08-24 00:00:06 +08:00
using System.Collections.Generic;
using System.Linq;
using NUnit.Framework;
using osu.Framework.Testing;
using osu.Game.Beatmaps;
using osu.Game.Rulesets.Catch.Mods;
using osu.Game.Rulesets.Catch.Objects;
using osu.Game.Rulesets.Catch.UI;
using osu.Game.Rulesets.Objects;
2020-08-24 03:35:15 +08:00
using osu.Game.Rulesets.Objects.Types;
2020-08-24 00:00:06 +08:00
using osu.Game.Tests.Visual;
2020-08-24 03:35:15 +08:00
using osuTK;
2020-08-24 00:00:06 +08:00
namespace osu.Game.Rulesets.Catch.Tests.Mods
{
public class TestSceneCatchModRelax : ModTestScene
{
protected override Ruleset CreatePlayerRuleset() => new CatchRuleset();
[Test]
public void TestModRelax() => CreateModTest(new ModTestData
{
Mod = new CatchModRelax(),
Autoplay = false,
2020-08-24 03:35:15 +08:00
PassCondition = passCondition,
2020-08-24 00:00:06 +08:00
Beatmap = new Beatmap
{
HitObjects = new List<HitObject>
{
new Fruit
{
2020-08-24 03:35:15 +08:00
X = CatchPlayfield.CENTER_X,
StartTime = 0
},
new Fruit
{
X = 0,
StartTime = 1000
2020-08-24 03:35:15 +08:00
},
new Fruit
{
X = CatchPlayfield.WIDTH,
StartTime = 2000
2020-08-24 03:35:15 +08:00
},
new JuiceStream
{
X = CatchPlayfield.CENTER_X,
StartTime = 3000,
2020-08-24 03:52:50 +08:00
Path = new SliderPath(PathType.Linear, new[] { Vector2.Zero, Vector2.UnitY * 200 })
2020-08-24 00:00:06 +08:00
}
}
}
});
2020-08-24 03:35:15 +08:00
private bool passCondition()
{
var playfield = this.ChildrenOfType<CatchPlayfield>().Single();
switch (Player.ScoreProcessor.Combo.Value)
{
case 0:
InputManager.MoveMouseTo(playfield.ScreenSpaceDrawQuad.Centre);
break;
2020-08-24 03:52:50 +08:00
2020-08-24 03:35:15 +08:00
case 1:
InputManager.MoveMouseTo(playfield.ScreenSpaceDrawQuad.BottomLeft);
break;
2020-08-24 03:52:50 +08:00
2020-08-24 03:35:15 +08:00
case 2:
InputManager.MoveMouseTo(playfield.ScreenSpaceDrawQuad.BottomRight);
break;
2020-08-24 03:52:50 +08:00
2020-08-24 03:35:15 +08:00
case 3:
InputManager.MoveMouseTo(playfield.ScreenSpaceDrawQuad.Centre);
break;
}
return Player.ScoreProcessor.Combo.Value >= 6;
}
2020-08-24 00:00:06 +08:00
}
}