-
-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathTouhosuRuleset.cs
More file actions
132 lines (109 loc) · 4.81 KB
/
Copy pathTouhosuRuleset.cs
File metadata and controls
132 lines (109 loc) · 4.81 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
using System.Collections.Generic;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Sprites;
using osu.Game.Beatmaps;
using osu.Game.Rulesets.Difficulty;
using osu.Game.Rulesets.Mods;
using osu.Game.Rulesets.Scoring;
using osu.Game.Rulesets.UI;
using System;
using osu.Framework.Graphics.Textures;
using osu.Framework.Input.Bindings;
using osu.Game.Rulesets.Touhosu.Scoring;
using osu.Game.Rulesets.Touhosu.Difficulty;
using osu.Game.Rulesets.Touhosu.Beatmaps;
using osu.Game.Rulesets.Touhosu.Mods;
using osu.Game.Rulesets.Touhosu.UI;
using osu.Game.Rulesets.Configuration;
using osu.Game.Configuration;
using osu.Game.Rulesets.Touhosu.Configuration;
using osu.Game.Overlays.Settings;
using osu.Game.Rulesets.Replays.Types;
using osu.Game.Rulesets.Touhosu.Replays;
using osu.Framework.Allocation;
using osu.Framework.Platform;
namespace osu.Game.Rulesets.Touhosu
{
public partial class TouhosuRuleset : Ruleset
{
private DrawableTouhosuRuleset ruleset;
public override IRulesetConfigManager CreateConfig(SettingsStore settings) => new TouhosuRulesetConfigManager(settings, RulesetInfo);
public override RulesetSettingsSubsection CreateSettings() => new TouhosuSettingsSubsection(this);
public override DrawableRuleset CreateDrawableRulesetWith(IBeatmap beatmap, IReadOnlyList<Mod> mods = null) => ruleset = new DrawableTouhosuRuleset(this, beatmap, mods);
public override HealthProcessor CreateHealthProcessor(double drainStartTime)
{
var hp = new TouhosuHealthProcessor();
ruleset.HealthProcessor = hp;
return hp;
}
public override IBeatmapConverter CreateBeatmapConverter(IBeatmap beatmap) => new TouhosuBeatmapConverter(beatmap, this);
public override IBeatmapProcessor CreateBeatmapProcessor(IBeatmap beatmap) => new BeatmapProcessor(beatmap);
public override IConvertibleReplayFrame CreateConvertibleReplayFrame() => new TouhosuReplayFrame();
public override IEnumerable<KeyBinding> GetDefaultKeyBindings(int variant = 0) => new[]
{
new KeyBinding(InputKey.Left, TouhosuAction.MoveLeft),
new KeyBinding(InputKey.Right, TouhosuAction.MoveRight),
new KeyBinding(InputKey.Up, TouhosuAction.MoveUp),
new KeyBinding(InputKey.Down, TouhosuAction.MoveDown),
new KeyBinding(InputKey.Z, TouhosuAction.Shoot),
new KeyBinding(InputKey.Shift, TouhosuAction.Focus),
};
public override IEnumerable<Mod> GetModsFor(ModType type)
{
switch (type)
{
case ModType.DifficultyReduction:
return new Mod[]
{
new TouhosuModEasy(),
new TouhosuModNoFail(),
new MultiMod(new TouhosuModHalfTime(), new TouhosuModDaycore())
};
case ModType.DifficultyIncrease:
return new Mod[]
{
new TouhosuModDamageMultiplier(),
new TouhosuModNoRegen(),
new TouhosuModSuddenDeath(),
new MultiMod(new TouhosuModDoubleTime(), new TouhosuModNightcore()),
new TouhosuModHidden()
};
case ModType.Automation:
return new Mod[]
{
new TouhosuModAutoplay(),
new TouhosuModRelax()
};
case ModType.Fun:
return new Mod[]
{
new MultiMod(new ModWindUp(), new ModWindDown()),
};
default:
return Array.Empty<Mod>();
}
}
public override string Description => "Touhosu";
public override string ShortName => "Touhosu";
public override string PlayingVerb => "Avoiding bullets";
public override Drawable CreateIcon() => new TouhosuIcon(this);
protected override IEnumerable<HitResult> GetValidHitResults() => new[]
{
HitResult.Perfect
};
public override DifficultyCalculator CreateDifficultyCalculator(IWorkingBeatmap beatmap) => new TouhosuDifficultyCalculator(RulesetInfo, beatmap);
private partial class TouhosuIcon : Sprite
{
private readonly TouhosuRuleset ruleset;
public TouhosuIcon(TouhosuRuleset ruleset)
{
this.ruleset = ruleset;
}
[BackgroundDependencyLoader]
private void load(GameHost host)
{
Texture = new TextureStore(host.Renderer, new TextureLoaderStore(ruleset.CreateResourceStore()), false).Get("Textures/logo");
}
}
}
}