Removed autoplay and HP drain
This commit is contained in:
HoLLy 2018-10-07 17:19:44 +02:00
Родитель 23036775ee
Коммит be1af5bac0
20 изменённых файлов: 74 добавлений и 88 удалений

2
osu

@ -1 +1 @@
Subproject commit 91af960200dfe3e975af7147207eceab1fba95e0
Subproject commit 9d518ff3ab2a5f50fd299a62eb802e11d56870ea

Просмотреть файл

@ -24,7 +24,7 @@ namespace osu.Game.Rulesets.HoLLy.Cytus
public CytusRuleset(RulesetInfo rulesetInfo = null) : base(rulesetInfo)
{
ResourceStore = new NamespacedResourceStore<byte[]>(new DllResourceStore("osu.Game.Rulesets.HoLLy.Cytus.dll"), "Resources");
TextureStore = new TextureStore(new RawTextureLoaderStore(new NamespacedResourceStore<byte[]>(ResourceStore, "Textures")));
TextureStore = new TextureStore(new TextureLoaderStore(new NamespacedResourceStore<byte[]>(ResourceStore, "Textures")));
}
public override IEnumerable<Mod> GetModsFor(ModType type) => new Mod[0];

Просмотреть файл

@ -1,4 +1,5 @@
using osu.Game.Rulesets.Objects;
using osu.Game.Rulesets.Judgements;
using osu.Game.Rulesets.Objects;
using osu.Game.Rulesets.Objects.Types;
namespace osu.Game.Rulesets.HoLLy.Cytus.Objects
@ -19,5 +20,6 @@ namespace osu.Game.Rulesets.HoLLy.Cytus.Objects
TimePreempt = 750;
}
public override Judgement CreateJudgement() => new Judgement();
}
}

Просмотреть файл

@ -1,6 +1,5 @@
using System.Linq;
using System;
using osu.Framework.Graphics;
using osu.Game.Rulesets.Judgements;
using osu.Game.Rulesets.Objects.Drawables;
using osu.Game.Rulesets.Scoring;
using OpenTK;
@ -25,13 +24,13 @@ namespace osu.Game.Rulesets.HoLLy.Cytus.Objects.Drawables
Y = y;
}
protected override void CheckForJudgements(bool userTriggered, double timeOffset)
protected override void CheckForResult(bool userTriggered, double timeOffset)
{
// TODO: use own judgement class, probably
// TODO: use own judgment class, probably
if (!userTriggered) {
if (!HitObject.HitWindows.CanBeHit(timeOffset))
AddJudgement(new Judgement { Result = HitResult.Miss });
ApplyResult(r => r.Type = HitResult.Miss);
return;
}
@ -39,7 +38,7 @@ namespace osu.Game.Rulesets.HoLLy.Cytus.Objects.Drawables
if (result == HitResult.None)
return;
AddJudgement(new Judgement { Result = result });
ApplyResult(r => r.Type = result);
}
protected override void UpdateState(ArmedState state)
@ -48,12 +47,14 @@ namespace osu.Game.Rulesets.HoLLy.Cytus.Objects.Drawables
ApplyTransformsAt(transformTime, true);
ClearTransformsAfter(transformTime, true);
using (BeginAbsoluteSequence(transformTime, true))
{
UpdatePreemptState();
using (BeginDelayedSequence(HitObject.TimePreempt + (Judgements.FirstOrDefault()?.TimeOffset ?? 0), true))
var judgementOffset = Math.Min(HitObject.HitWindows.HalfWindowFor(HitResult.Miss), Result?.TimeOffset ?? 0);
using (BeginDelayedSequence(HitObject.TimePreempt + judgementOffset, true))
UpdateCurrentState(state);
}
}

Просмотреть файл

@ -2,15 +2,17 @@
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Sprites;
using osu.Framework.Graphics.Textures;
using osu.Framework.Input.Events;
using osu.Game.Rulesets.Objects.Drawables;
using OpenTK;
using osu.Framework.Input;
namespace osu.Game.Rulesets.HoLLy.Cytus.Objects.Drawables
{
internal class CytusDrawableNote : CytusDrawableHitObject
{
private readonly Sprite _noteBase, _noteCenter;
public override bool HandlePositionalInput => true;
public CytusDrawableNote(CytusNote hitObject, float x, float y, TextureStore textures) : base(hitObject, x, y)
{
@ -38,7 +40,7 @@ namespace osu.Game.Rulesets.HoLLy.Cytus.Objects.Drawables
});
}
protected override bool OnMouseDown(InputState state, MouseDownEventArgs args) => UpdateJudgement(true);
protected override bool OnMouseDown(MouseDownEvent e) => UpdateResult(true);
protected override void UpdatePreemptState()
{

Просмотреть файл

@ -3,9 +3,10 @@ using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Sprites;
using osu.Framework.Graphics.Textures;
using osu.Framework.Input;
using osu.Framework.Input.Events;
using osu.Framework.Logging;
using osu.Game.Rulesets.Objects.Drawables;
using osu.Game.Rulesets.Scoring;
using OpenTK;
namespace osu.Game.Rulesets.HoLLy.Cytus.Objects.Drawables
@ -46,7 +47,7 @@ namespace osu.Game.Rulesets.HoLLy.Cytus.Objects.Drawables
Logger.Log($"{GetType().Name} rotation: {_noteCenter.Rotation}");
}
protected override bool OnMouseDown(InputState state, MouseDownEventArgs args) => UpdateJudgement(true);
protected override bool OnMouseDown(MouseDownEvent e) => UpdateResult(true);
protected override void UpdatePreemptState()
{

Просмотреть файл

@ -1,6 +1,5 @@
using osu.Framework.Graphics.Textures;
using osu.Framework.Input;
using osu.Game.Rulesets.Judgements;
using osu.Framework.Input.Events;
using osu.Game.Rulesets.Scoring;
using OpenTK.Input;
@ -13,7 +12,7 @@ namespace osu.Game.Rulesets.HoLLy.Cytus.Objects.Drawables
Size /= 1.5f;
}
protected override bool OnMouseDown(InputState state, MouseDownEventArgs args) => false;
protected override bool OnMouseDown(MouseDownEvent e) => false;
protected override void Update()
{
@ -24,9 +23,9 @@ namespace osu.Game.Rulesets.HoLLy.Cytus.Objects.Drawables
// Check if user is holding
if (IsHovered && Mouse.GetState().IsAnyButtonDown) // HACK: should check for IsHeldDown/IsPressed or something
// Great
AddJudgement(new Judgement { Result = HitResult.Perfect });
ApplyResult(r => r.Type = HitResult.Perfect);
else
AddJudgement(new Judgement { Result = HitResult.Miss });
ApplyResult(r => r.Type = HitResult.Miss);
}
}
}

Просмотреть файл

@ -1,6 +1,4 @@
using osu.Game.Beatmaps;
using osu.Game.Rulesets.HoLLy.Cytus.Objects;
using osu.Game.Rulesets.Judgements;
using osu.Game.Rulesets.HoLLy.Cytus.Objects;
using osu.Game.Rulesets.Scoring;
using osu.Game.Rulesets.UI;
@ -9,13 +7,6 @@ namespace osu.Game.Rulesets.HoLLy.Cytus.Scoring
internal class CytusScoreProcessor : ScoreProcessor<CytusHitObject>
{
protected CytusScoreProcessor() { }
public CytusScoreProcessor(RulesetContainer<CytusHitObject> rulesetContainer) : base(rulesetContainer) { }
protected override void SimulateAutoplay(Beatmap<CytusHitObject> beatmap)
{
foreach (CytusHitObject _ in beatmap.HitObjects)
AddJudgement(new Judgement {Result = HitResult.Perfect});
}
}
}

Просмотреть файл

@ -1,4 +1,4 @@
using osu.Framework.Audio.Track;
using osu.Framework.Audio.Track;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Shapes;
using osu.Game.Beatmaps.ControlPoints;
@ -11,7 +11,7 @@ namespace osu.Game.Rulesets.HoLLy.Cytus.UI.Drawables
private readonly int _beatsPerScan;
private int _beatIndex = -1;
public override bool HandleMouseInput => false;
public override bool HandlePositionalInput => false;
public CytusScanLine(int beatsPerScan)
{

Просмотреть файл

@ -36,7 +36,7 @@ namespace osu.Game.Rulesets.HoLLy.Hex.Graphics.Shapes
protected override void Blit(Action<TexturedVertex2D> vertexAction)
{
foreach(var t in ToPolygon(ScreenSpaceDrawQuad, _sides).Triangles)
Texture.DrawTriangle(t, DrawInfo.Colour);
Texture.DrawTriangle(t, DrawColourInfo.Colour);
}
}
}

Просмотреть файл

@ -25,7 +25,7 @@ namespace osu.Game.Rulesets.HoLLy.Hex
public HexRuleset(RulesetInfo f = null) : base(f)
{
ResourceStore = new NamespacedResourceStore<byte[]>(new DllResourceStore("osu.Game.Rulesets.HoLLy.Polygon.dll"), "Resources");
TextureStore = new TextureStore(new RawTextureLoaderStore(new NamespacedResourceStore<byte[]>(ResourceStore, "Textures")));
TextureStore = new TextureStore(new TextureLoaderStore(new NamespacedResourceStore<byte[]>(ResourceStore, "Textures")));
}
public override IEnumerable<Mod> GetModsFor(ModType type)
@ -44,12 +44,16 @@ namespace osu.Game.Rulesets.HoLLy.Hex
new MultiMod(new HexModDoubleTime(), new HexModNightcore()),
new MultiMod(new HexModHidden(), new HexModFadeIn()),
};
case ModType.Special:
case ModType.Conversion:
return new Mod[] {
new HexMultiModLaneCount(),
new HexModRelax(),
new HexModMaiMai(),
};
case ModType.Automation:
return new Mod[] {
new HexModRelax(),
};
case ModType.Fun: return new Mod[0];
default:
throw new ArgumentOutOfRangeException(nameof(type), type, null);
}

Просмотреть файл

@ -6,7 +6,7 @@ namespace osu.Game.Rulesets.HoLLy.Hex.Mods
internal class HexModMaiMai : Mod
{
/*
* If I ever implement mapping, this should be a togglable for maps
* If I ever implement mapping, this should be a toggleable for maps
*
* Changes:
* - invert direction of note lanes
@ -19,7 +19,7 @@ namespace osu.Game.Rulesets.HoLLy.Hex.Mods
public override string ShortenedName => "MM";
public override string Description => "Play a superior rhythm game";
public override double ScoreMultiplier => 0;
public override ModType Type => ModType.Special;
public override ModType Type => ModType.Conversion;
public override bool Ranked => true;
public override bool HasImplementation => false;
public override FontAwesome Icon => FontAwesome.fa_connectdevelop;

Просмотреть файл

@ -13,7 +13,7 @@ namespace osu.Game.Rulesets.HoLLy.Hex.Mods
public override string ShortenedName => "RX";
public override string Description => "You no longer have aim as much!";
public override double ScoreMultiplier => 0.0;
public override ModType Type => ModType.Special;
public override ModType Type => ModType.Automation;
public override bool Ranked => false;
public override bool HasImplementation => false;
}

Просмотреть файл

@ -30,7 +30,7 @@ namespace osu.Game.Rulesets.HoLLy.Hex.Mods
public override string Name => $"{_lanes.ToWords().Titleize()} {(_lanes == 1 ? "Lane" : "Lanes")}";
public override string ShortenedName => $"L{_lanes}";
public override double ScoreMultiplier => 0;
public override ModType Type => ModType.Special;
public override ModType Type => ModType.Conversion;
public override string Description => $"Play with {_lanes} lanes!";
public override bool Ranked => false;

Просмотреть файл

@ -2,7 +2,6 @@
using osu.Framework.Graphics.Containers;
using osu.Game.Rulesets.HoLLy.Hex.Graphics.Shapes;
using osu.Game.Rulesets.HoLLy.Hex.UI;
using osu.Game.Rulesets.Judgements;
using osu.Game.Rulesets.Objects.Drawables;
using osu.Game.Rulesets.Scoring;
using OpenTK;
@ -40,13 +39,13 @@ namespace osu.Game.Rulesets.HoLLy.Hex.Objects.Drawables
});
}
protected override void CheckForJudgements(bool userTriggered, double timeOffset)
protected override void CheckForResult(bool userTriggered, double timeOffset)
{
//at the moment the note is programmed, check if we're holding in the correct lane
// At the moment the note is programmed, check if we're holding in the correct lane
if (Time.Current >= HitObject.StartTime) {
AddJudgement(_lane.IsHovered
? new Judgement {Result = HitResult.Perfect}
: new Judgement {Result = HitResult.Miss});
ApplyResult(r => r.Type = _lane.IsHovered
? HitResult.Perfect
: HitResult.Miss);
}
}

Просмотреть файл

@ -1,4 +1,5 @@
using osu.Game.Rulesets.Objects;
using osu.Game.Rulesets.Judgements;
using osu.Game.Rulesets.Objects;
namespace osu.Game.Rulesets.HoLLy.Hex.Objects
{
@ -15,5 +16,7 @@ namespace osu.Game.Rulesets.HoLLy.Hex.Objects
StartTime = original.StartTime;
}
public override Judgement CreateJudgement() => new Judgement();
}
}

Просмотреть файл

@ -1,40 +1,12 @@
using osu.Game.Beatmaps;
using osu.Game.Rulesets.HoLLy.Hex.Objects;
using osu.Game.Rulesets.HoLLy.Hex.UI;
using osu.Game.Rulesets.Judgements;
using osu.Game.Rulesets.Scoring;
namespace osu.Game.Rulesets.HoLLy.Hex.Scoring
{
internal class HexScoreProcessor : ScoreProcessor<HexHitObject>
{
private float hpDrainRate;
public HexScoreProcessor() : base() { }
public HexScoreProcessor(HexRulesetContainer rulesetContainer) : base(rulesetContainer) { }
protected override void SimulateAutoplay(Beatmap<HexHitObject> beatmap)
{
hpDrainRate = beatmap.BeatmapInfo.BaseDifficulty.DrainRate;
foreach (HexHitObject _ in beatmap.HitObjects)
AddJudgement(new Judgement {Result = HitResult.Perfect});
}
protected override void OnNewJudgement(Judgement judgement)
{
base.OnNewJudgement(judgement);
switch (judgement.Result)
{
case HitResult.Perfect:
Health.Value += 1.0 / ((hpDrainRate + 2) * 2);
break;
case HitResult.Miss:
Health.Value -= 1.0 / (15f - hpDrainRate);
break;
}
}
}
}

Просмотреть файл

@ -3,6 +3,7 @@ using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Shapes;
using osu.Framework.Input;
using osu.Framework.Input.Events;
using osu.Game.Rulesets.HoLLy.Hex.Graphics.Shapes;
using osu.Game.Rulesets.Objects.Drawables;
using osu.Game.Rulesets.UI.Scrolling;
@ -23,8 +24,10 @@ namespace osu.Game.Rulesets.HoLLy.Hex.UI
private readonly Color4 _laneColor;
private readonly float _scaledHeight;
public HexLane(int index, int laneCount, bool biggerBase = false) : base(ScrollingDirection.Left)
public HexLane(int index, int laneCount, bool biggerBase = false)
{
Direction.Value = ScrollingDirection.Left;
_index = index;
_laneCount = laneCount;
_laneColor = Utils.GetAccentColor(index, laneCount);
@ -82,8 +85,8 @@ namespace osu.Game.Rulesets.HoLLy.Hex.UI
private class HexLaneBase : CircularContainer
{
private const double timeFadeIn = 200, timeFadeOut = 350;
private static readonly Color4 ColorIdle = Color4.DarkGray;
private const double TimeFadeIn = 200, TimeFadeOut = 350;
private static readonly Color4 colorIdle = Color4.DarkGray;
private readonly HexLane _parent;
private readonly Color4 _laneColor;
@ -96,22 +99,24 @@ namespace osu.Game.Rulesets.HoLLy.Hex.UI
Add(_poly = new Polygon(parent._laneCount) {
RelativeSizeAxes = Axes.Both,
Colour = ColorIdle,
Colour = colorIdle,
});
}
protected override bool OnHover(InputState state)
protected override bool OnHover(HoverEvent e)
{
_poly.FadeColour(_laneColor.Darken(0.325f), timeFadeIn, Easing.OutCubic);
_parent._lanePath.FadeEdgeEffectTo(1f, timeFadeIn, Easing.OutCubic);
_poly.FadeColour(_laneColor.Darken(0.325f), TimeFadeIn, Easing.OutCubic);
_parent._lanePath.FadeEdgeEffectTo(1f, TimeFadeIn, Easing.OutCubic);
return base.OnHover(state);
return base.OnHover(e);
}
protected override void OnHoverLost(InputState state)
protected override void OnHoverLost(HoverLostEvent e)
{
_poly.FadeColour(ColorIdle, timeFadeOut, Easing.OutCubic);
_parent._lanePath.FadeEdgeEffectTo(0f, timeFadeOut, Easing.OutCubic);
_poly.FadeColour(colorIdle, TimeFadeOut, Easing.OutCubic);
_parent._lanePath.FadeEdgeEffectTo(0f, TimeFadeOut, Easing.OutCubic);
base.OnHoverLost(e);
}
}
}

Просмотреть файл

@ -10,8 +10,10 @@ namespace osu.Game.Rulesets.HoLLy.Hex.UI
{
public readonly HexLane[] Lanes;
public HexPlayfield(int laneCount, bool biggerBase = false) : base(ScrollingDirection.Left)
public HexPlayfield(int laneCount, bool biggerBase = false)
{
Direction.Value = ScrollingDirection.Left;
Anchor = Anchor.Centre;
Origin = Anchor.TopLeft;

Просмотреть файл

@ -3,4 +3,9 @@
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/PredefinedNamingRules/=Constants/@EntryIndexedValue">&lt;Policy Inspect="True" Prefix="" Suffix="" Style="AaBb"&gt;&lt;ExtraRule Prefix="" Suffix="" Style="AA_BB" /&gt;&lt;/Policy&gt;</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/PredefinedNamingRules/=MethodPropertyEvent/@EntryIndexedValue">&lt;Policy Inspect="True" Prefix="" Suffix="" Style="AaBb"&gt;&lt;ExtraRule Prefix="" Suffix="" Style="aaBb" /&gt;&lt;/Policy&gt;</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/PredefinedNamingRules/=PrivateConstants/@EntryIndexedValue">&lt;Policy Inspect="True" Prefix="" Suffix="" Style="AaBb"&gt;&lt;ExtraRule Prefix="" Suffix="" Style="aa_bb" /&gt;&lt;/Policy&gt;</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/PredefinedNamingRules/=PrivateInstanceFields/@EntryIndexedValue">&lt;Policy Inspect="True" Prefix="_" Suffix="" Style="aaBb"&gt;&lt;ExtraRule Prefix="" Suffix="" Style="aaBb" /&gt;&lt;/Policy&gt;</s:String></wpf:ResourceDictionary>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/PredefinedNamingRules/=PrivateInstanceFields/@EntryIndexedValue">&lt;Policy Inspect="True" Prefix="_" Suffix="" Style="aaBb"&gt;&lt;ExtraRule Prefix="" Suffix="" Style="aaBb" /&gt;&lt;/Policy&gt;</s:String>
<s:Boolean x:Key="/Default/UserDictionary/Words/=Colour/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=Drawables/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=Playfield/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=ruleset/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=Rulesets/@EntryIndexedValue">True</s:Boolean></wpf:ResourceDictionary>