mirror of
https://github.com/ppy/osu.git
synced 2025-01-14 02:22:56 +08:00
Merge branch 'master' of git://github.com/ppy/osu into details
This commit is contained in:
commit
305bc9cff6
@ -1 +1 @@
|
||||
Subproject commit 2d8a6c1699ff1acd3915fc28e8906dabf1b145a3
|
||||
Subproject commit e67453159540f5008b5efadfbc12dfb3f4bee1f7
|
@ -38,7 +38,7 @@ namespace osu.Desktop.VisualTests.Tests
|
||||
Position = new Vector2(100, 100)
|
||||
});
|
||||
|
||||
Add(new CentreHitCircle(new AccentedCirclePiece()
|
||||
Add(new CentreHitCircle(new StrongCirclePiece()
|
||||
{
|
||||
KiaiMode = kiai
|
||||
})
|
||||
@ -54,7 +54,7 @@ namespace osu.Desktop.VisualTests.Tests
|
||||
Position = new Vector2(100, 300)
|
||||
});
|
||||
|
||||
Add(new RimHitCircle(new AccentedCirclePiece()
|
||||
Add(new RimHitCircle(new StrongCirclePiece()
|
||||
{
|
||||
KiaiMode = kiai
|
||||
})
|
||||
@ -70,7 +70,7 @@ namespace osu.Desktop.VisualTests.Tests
|
||||
Position = new Vector2(100, 500)
|
||||
});
|
||||
|
||||
Add(new SwellCircle(new AccentedCirclePiece()
|
||||
Add(new SwellCircle(new StrongCirclePiece()
|
||||
{
|
||||
KiaiMode = kiai
|
||||
})
|
||||
@ -87,7 +87,7 @@ namespace osu.Desktop.VisualTests.Tests
|
||||
Position = new Vector2(575, 100)
|
||||
});
|
||||
|
||||
Add(new DrumRollCircle(new AccentedCirclePiece()
|
||||
Add(new DrumRollCircle(new StrongCirclePiece()
|
||||
{
|
||||
KiaiMode = kiai
|
||||
})
|
||||
@ -99,8 +99,6 @@ namespace osu.Desktop.VisualTests.Tests
|
||||
|
||||
private class SwellCircle : BaseCircle
|
||||
{
|
||||
private const float symbol_size = TaikoHitObject.CIRCLE_RADIUS * 2f * 0.35f;
|
||||
|
||||
public SwellCircle(CirclePiece piece)
|
||||
: base(piece)
|
||||
{
|
||||
@ -108,7 +106,8 @@ namespace osu.Desktop.VisualTests.Tests
|
||||
{
|
||||
Anchor = Anchor.Centre,
|
||||
Origin = Anchor.Centre,
|
||||
TextSize = symbol_size,
|
||||
TextSize = SYMBOL_INNER_SIZE,
|
||||
Icon = FontAwesome.fa_asterisk,
|
||||
Shadow = false
|
||||
});
|
||||
}
|
||||
@ -136,8 +135,6 @@ namespace osu.Desktop.VisualTests.Tests
|
||||
|
||||
private class CentreHitCircle : BaseCircle
|
||||
{
|
||||
private const float symbol_size = TaikoHitObject.CIRCLE_RADIUS * 2f * 0.35f;
|
||||
|
||||
public CentreHitCircle(CirclePiece piece)
|
||||
: base(piece)
|
||||
{
|
||||
@ -145,7 +142,7 @@ namespace osu.Desktop.VisualTests.Tests
|
||||
{
|
||||
Anchor = Anchor.Centre,
|
||||
Origin = Anchor.Centre,
|
||||
Size = new Vector2(symbol_size),
|
||||
Size = new Vector2(SYMBOL_INNER_SIZE),
|
||||
Masking = true,
|
||||
Children = new[]
|
||||
{
|
||||
@ -166,8 +163,6 @@ namespace osu.Desktop.VisualTests.Tests
|
||||
|
||||
private class RimHitCircle : BaseCircle
|
||||
{
|
||||
private const float symbol_size = TaikoHitObject.CIRCLE_RADIUS * 2f * 0.45f;
|
||||
|
||||
public RimHitCircle(CirclePiece piece)
|
||||
: base(piece)
|
||||
{
|
||||
@ -175,8 +170,8 @@ namespace osu.Desktop.VisualTests.Tests
|
||||
{
|
||||
Anchor = Anchor.Centre,
|
||||
Origin = Anchor.Centre,
|
||||
Size = new Vector2(symbol_size),
|
||||
BorderThickness = 8,
|
||||
Size = new Vector2(SYMBOL_SIZE),
|
||||
BorderThickness = SYMBOL_BORDER,
|
||||
BorderColour = Color4.White,
|
||||
Masking = true,
|
||||
Children = new[]
|
||||
@ -200,6 +195,10 @@ namespace osu.Desktop.VisualTests.Tests
|
||||
|
||||
private abstract class BaseCircle : Container
|
||||
{
|
||||
protected const float SYMBOL_SIZE = TaikoHitObject.CIRCLE_RADIUS * 2f * 0.45f;
|
||||
protected const float SYMBOL_BORDER = 8;
|
||||
protected const float SYMBOL_INNER_SIZE = SYMBOL_SIZE - 2 * SYMBOL_BORDER;
|
||||
|
||||
protected readonly CirclePiece Piece;
|
||||
|
||||
protected BaseCircle(CirclePiece piece)
|
||||
|
@ -29,7 +29,7 @@ namespace osu.Game.Modes.Osu
|
||||
createAutoReplay();
|
||||
}
|
||||
|
||||
internal class LegacyReplayFrameComparer : IComparer<LegacyReplayFrame>
|
||||
private class LegacyReplayFrameComparer : IComparer<LegacyReplayFrame>
|
||||
{
|
||||
public int Compare(LegacyReplayFrame f1, LegacyReplayFrame f2)
|
||||
{
|
||||
|
@ -44,7 +44,7 @@ namespace osu.Game.Modes.Taiko.Beatmaps
|
||||
IHasRepeats repeatsData = original as IHasRepeats;
|
||||
IHasEndTime endTimeData = original as IHasEndTime;
|
||||
|
||||
bool accented = ((original.Sample?.Type ?? SampleType.None) & SampleType.Finish) > 0;
|
||||
bool strong = ((original.Sample?.Type ?? SampleType.None) & SampleType.Finish) > 0;
|
||||
|
||||
if (distanceData != null)
|
||||
{
|
||||
@ -52,7 +52,7 @@ namespace osu.Game.Modes.Taiko.Beatmaps
|
||||
{
|
||||
StartTime = original.StartTime,
|
||||
Sample = original.Sample,
|
||||
Accented = accented,
|
||||
IsStrong = strong,
|
||||
|
||||
Distance = distanceData.Distance * (repeatsData?.RepeatCount ?? 1)
|
||||
};
|
||||
@ -61,11 +61,11 @@ namespace osu.Game.Modes.Taiko.Beatmaps
|
||||
if (endTimeData != null)
|
||||
{
|
||||
// We compute the end time manually to add in the Bash convert factor
|
||||
return new Bash
|
||||
return new Swell
|
||||
{
|
||||
StartTime = original.StartTime,
|
||||
Sample = original.Sample,
|
||||
Accented = accented,
|
||||
IsStrong = strong,
|
||||
|
||||
EndTime = original.StartTime + endTimeData.Duration * bash_convert_factor
|
||||
};
|
||||
@ -75,7 +75,7 @@ namespace osu.Game.Modes.Taiko.Beatmaps
|
||||
{
|
||||
StartTime = original.StartTime,
|
||||
Sample = original.Sample,
|
||||
Accented = accented
|
||||
IsStrong = strong
|
||||
};
|
||||
}
|
||||
}
|
||||
|
57
osu.Game.Modes.Taiko/Objects/Drawable/DrawableDrumRoll.cs
Normal file
57
osu.Game.Modes.Taiko/Objects/Drawable/DrawableDrumRoll.cs
Normal file
@ -0,0 +1,57 @@
|
||||
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
|
||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||
|
||||
using osu.Game.Modes.Objects.Drawables;
|
||||
using osu.Game.Modes.Taiko.Judgements;
|
||||
using System.Linq;
|
||||
|
||||
namespace osu.Game.Modes.Taiko.Objects.Drawable
|
||||
{
|
||||
public class DrawableDrumRoll : DrawableTaikoHitObject
|
||||
{
|
||||
private readonly DrumRoll drumRoll;
|
||||
|
||||
public DrawableDrumRoll(DrumRoll drumRoll)
|
||||
: base(drumRoll)
|
||||
{
|
||||
this.drumRoll = drumRoll;
|
||||
|
||||
int tickIndex = 0;
|
||||
foreach (var tick in drumRoll.Ticks)
|
||||
{
|
||||
var newTick = new DrawableDrumRollTick(tick)
|
||||
{
|
||||
Depth = tickIndex,
|
||||
X = (float)((tick.StartTime - HitObject.StartTime) / drumRoll.Duration)
|
||||
};
|
||||
|
||||
AddNested(newTick);
|
||||
|
||||
tickIndex++;
|
||||
}
|
||||
}
|
||||
|
||||
protected override void UpdateState(ArmedState state)
|
||||
{
|
||||
}
|
||||
|
||||
protected override void CheckJudgement(bool userTriggered)
|
||||
{
|
||||
if (userTriggered)
|
||||
return;
|
||||
|
||||
if (Judgement.TimeOffset < 0)
|
||||
return;
|
||||
|
||||
int countHit = NestedHitObjects.Count(o => o.Judgement.Result == HitResult.Hit);
|
||||
|
||||
if (countHit > drumRoll.RequiredGoodHits)
|
||||
{
|
||||
Judgement.Result = HitResult.Hit;
|
||||
Judgement.TaikoResult = countHit >= drumRoll.RequiredGreatHits ? TaikoHitResult.Great : TaikoHitResult.Good;
|
||||
}
|
||||
else
|
||||
Judgement.Result = HitResult.Miss;
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,53 @@
|
||||
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
|
||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||
|
||||
using OpenTK.Input;
|
||||
using osu.Game.Modes.Taiko.Judgements;
|
||||
using System;
|
||||
using osu.Game.Modes.Objects.Drawables;
|
||||
|
||||
namespace osu.Game.Modes.Taiko.Objects.Drawable
|
||||
{
|
||||
public class DrawableDrumRollTick : DrawableTaikoHitObject
|
||||
{
|
||||
private readonly DrumRollTick tick;
|
||||
|
||||
public DrawableDrumRollTick(DrumRollTick tick)
|
||||
: base(tick)
|
||||
{
|
||||
this.tick = tick;
|
||||
}
|
||||
|
||||
protected override TaikoJudgement CreateJudgement() => new TaikoDrumRollTickJudgement();
|
||||
|
||||
protected override void CheckJudgement(bool userTriggered)
|
||||
{
|
||||
if (!userTriggered)
|
||||
{
|
||||
if (Judgement.TimeOffset > tick.HitWindow)
|
||||
Judgement.Result = HitResult.Miss;
|
||||
return;
|
||||
}
|
||||
|
||||
if (Math.Abs(Judgement.TimeOffset) < tick.HitWindow)
|
||||
{
|
||||
Judgement.Result = HitResult.Hit;
|
||||
Judgement.TaikoResult = TaikoHitResult.Great;
|
||||
}
|
||||
}
|
||||
|
||||
protected override void UpdateState(ArmedState state)
|
||||
{
|
||||
}
|
||||
|
||||
protected override void UpdateScrollPosition(double time)
|
||||
{
|
||||
// Drum roll ticks shouldn't move
|
||||
}
|
||||
|
||||
protected override bool HandleKeyPress(Key key)
|
||||
{
|
||||
return !Judgement.Result.HasValue && UpdateJudgement(true);
|
||||
}
|
||||
}
|
||||
}
|
67
osu.Game.Modes.Taiko/Objects/Drawable/DrawableHit.cs
Normal file
67
osu.Game.Modes.Taiko/Objects/Drawable/DrawableHit.cs
Normal file
@ -0,0 +1,67 @@
|
||||
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
|
||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||
|
||||
using OpenTK.Input;
|
||||
using osu.Game.Modes.Objects.Drawables;
|
||||
using osu.Game.Modes.Taiko.Judgements;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace osu.Game.Modes.Taiko.Objects.Drawable
|
||||
{
|
||||
public abstract class DrawableHit : DrawableTaikoHitObject
|
||||
{
|
||||
/// <summary>
|
||||
/// A list of keys which can result in hits for this HitObject.
|
||||
/// </summary>
|
||||
protected abstract List<Key> HitKeys { get; }
|
||||
|
||||
private readonly Hit hit;
|
||||
|
||||
/// <summary>
|
||||
/// Whether the last key pressed is a valid hit key.
|
||||
/// </summary>
|
||||
private bool validKeyPressed;
|
||||
|
||||
protected DrawableHit(Hit hit)
|
||||
: base(hit)
|
||||
{
|
||||
this.hit = hit;
|
||||
}
|
||||
|
||||
protected override void CheckJudgement(bool userTriggered)
|
||||
{
|
||||
if (!userTriggered)
|
||||
{
|
||||
if (Judgement.TimeOffset > hit.HitWindowGood)
|
||||
Judgement.Result = HitResult.Miss;
|
||||
return;
|
||||
}
|
||||
|
||||
double hitOffset = Math.Abs(Judgement.TimeOffset);
|
||||
|
||||
if (hitOffset > hit.HitWindowMiss)
|
||||
return;
|
||||
|
||||
if (!validKeyPressed)
|
||||
Judgement.Result = HitResult.Miss;
|
||||
else if (hitOffset < hit.HitWindowGood)
|
||||
{
|
||||
Judgement.Result = HitResult.Hit;
|
||||
Judgement.TaikoResult = hitOffset < hit.HitWindowGreat ? TaikoHitResult.Great : TaikoHitResult.Good;
|
||||
}
|
||||
else
|
||||
Judgement.Result = HitResult.Miss;
|
||||
}
|
||||
|
||||
protected override bool HandleKeyPress(Key key)
|
||||
{
|
||||
if (Judgement.Result.HasValue)
|
||||
return false;
|
||||
|
||||
validKeyPressed = HitKeys.Contains(key);
|
||||
|
||||
return UpdateJudgement(true);
|
||||
}
|
||||
}
|
||||
}
|
85
osu.Game.Modes.Taiko/Objects/Drawable/DrawableStrongHit.cs
Normal file
85
osu.Game.Modes.Taiko/Objects/Drawable/DrawableStrongHit.cs
Normal file
@ -0,0 +1,85 @@
|
||||
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
|
||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||
|
||||
using OpenTK.Input;
|
||||
using System;
|
||||
using System.Linq;
|
||||
using osu.Framework.Input;
|
||||
|
||||
namespace osu.Game.Modes.Taiko.Objects.Drawable
|
||||
{
|
||||
public abstract class DrawableStrongHit : DrawableHit
|
||||
{
|
||||
/// <summary>
|
||||
/// The lenience for the second key press.
|
||||
/// This does not adjust by map difficulty in ScoreV2 yet.
|
||||
/// </summary>
|
||||
private const double second_hit_window = 30;
|
||||
|
||||
private double firstHitTime;
|
||||
private bool firstKeyHeld;
|
||||
private Key firstHitKey;
|
||||
|
||||
protected DrawableStrongHit(Hit hit)
|
||||
: base(hit)
|
||||
{
|
||||
}
|
||||
|
||||
protected override void CheckJudgement(bool userTriggered)
|
||||
{
|
||||
if (!Judgement.Result.HasValue)
|
||||
{
|
||||
base.CheckJudgement(userTriggered);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!userTriggered)
|
||||
return;
|
||||
|
||||
// If we get here, we're assured that the key pressed is the correct secondary key
|
||||
|
||||
if (Math.Abs(firstHitTime - Time.Current) < second_hit_window)
|
||||
Judgement.SecondHit = true;
|
||||
}
|
||||
|
||||
protected override bool HandleKeyPress(Key key)
|
||||
{
|
||||
// Check if we've handled the first key
|
||||
if (!Judgement.Result.HasValue)
|
||||
{
|
||||
// First key hasn't been handled yet, attempt to handle it
|
||||
bool handled = base.HandleKeyPress(key);
|
||||
|
||||
if (handled)
|
||||
{
|
||||
firstHitTime = Time.Current;
|
||||
firstHitKey = key;
|
||||
}
|
||||
|
||||
return handled;
|
||||
}
|
||||
|
||||
// If we've already hit the second key, don't handle this object any further
|
||||
if (Judgement.SecondHit)
|
||||
return false;
|
||||
|
||||
// Don't handle represses of the first key
|
||||
if (firstHitKey == key)
|
||||
return false;
|
||||
|
||||
// Don't handle invalid hit key presses
|
||||
if (!HitKeys.Contains(key))
|
||||
return false;
|
||||
|
||||
// Assume the intention was to hit the strong hit with both keys only if the first key is still being held down
|
||||
return firstKeyHeld && UpdateJudgement(true);
|
||||
}
|
||||
|
||||
protected override bool OnKeyDown(InputState state, KeyDownEventArgs args)
|
||||
{
|
||||
firstKeyHeld = state.Keyboard.Keys.Contains(firstHitKey);
|
||||
|
||||
return base.OnKeyDown(state, args);
|
||||
}
|
||||
}
|
||||
}
|
75
osu.Game.Modes.Taiko/Objects/Drawable/DrawableSwell.cs
Normal file
75
osu.Game.Modes.Taiko/Objects/Drawable/DrawableSwell.cs
Normal file
@ -0,0 +1,75 @@
|
||||
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
|
||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||
|
||||
using OpenTK.Input;
|
||||
using osu.Game.Modes.Objects.Drawables;
|
||||
using osu.Game.Modes.Taiko.Judgements;
|
||||
using System;
|
||||
|
||||
namespace osu.Game.Modes.Taiko.Objects.Drawable
|
||||
{
|
||||
public class DrawableSwell : DrawableTaikoHitObject
|
||||
{
|
||||
/// <summary>
|
||||
/// The amount of times the user has hit this swell.
|
||||
/// </summary>
|
||||
private int userHits;
|
||||
|
||||
private readonly Swell swell;
|
||||
|
||||
public DrawableSwell(Swell swell)
|
||||
: base(swell)
|
||||
{
|
||||
this.swell = swell;
|
||||
}
|
||||
|
||||
protected override void CheckJudgement(bool userTriggered)
|
||||
{
|
||||
if (userTriggered)
|
||||
{
|
||||
if (Time.Current < HitObject.StartTime)
|
||||
return;
|
||||
|
||||
userHits++;
|
||||
|
||||
if (userHits == swell.RequiredHits)
|
||||
{
|
||||
Judgement.Result = HitResult.Hit;
|
||||
Judgement.TaikoResult = TaikoHitResult.Great;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (Judgement.TimeOffset < 0)
|
||||
return;
|
||||
|
||||
if (userHits > swell.RequiredHits / 2)
|
||||
{
|
||||
Judgement.Result = HitResult.Hit;
|
||||
Judgement.TaikoResult = TaikoHitResult.Good;
|
||||
}
|
||||
else
|
||||
Judgement.Result = HitResult.Miss;
|
||||
}
|
||||
}
|
||||
|
||||
protected override void UpdateState(ArmedState state)
|
||||
{
|
||||
}
|
||||
|
||||
protected override void UpdateScrollPosition(double time)
|
||||
{
|
||||
base.UpdateScrollPosition(Math.Min(time, HitObject.StartTime));
|
||||
}
|
||||
|
||||
protected override bool HandleKeyPress(Key key)
|
||||
{
|
||||
if (Judgement.Result.HasValue)
|
||||
return false;
|
||||
|
||||
UpdateJudgement(true);
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
@ -1,15 +1,23 @@
|
||||
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
|
||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||
|
||||
using OpenTK.Input;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Game.Modes.Objects.Drawables;
|
||||
using osu.Game.Modes.Taiko.Judgements;
|
||||
using osu.Game.Modes.Taiko.Objects.Drawable.Pieces;
|
||||
using System.Collections.Generic;
|
||||
using osu.Framework.Input;
|
||||
|
||||
namespace osu.Game.Modes.Taiko.Objects.Drawable
|
||||
{
|
||||
public abstract class DrawableTaikoHitObject : DrawableHitObject<TaikoHitObject, TaikoJudgement>
|
||||
{
|
||||
/// <summary>
|
||||
/// A list of keys which this hit object will accept. These are the standard Taiko keys for now.
|
||||
/// These should be moved to bindings later.
|
||||
/// </summary>
|
||||
private readonly List<Key> validKeys = new List<Key>(new[] { Key.D, Key.F, Key.J, Key.K });
|
||||
|
||||
protected DrawableTaikoHitObject(TaikoHitObject hitObject)
|
||||
: base(hitObject)
|
||||
{
|
||||
@ -17,11 +25,6 @@ namespace osu.Game.Modes.Taiko.Objects.Drawable
|
||||
Origin = Anchor.Centre;
|
||||
|
||||
RelativePositionAxes = Axes.X;
|
||||
|
||||
Children = new[]
|
||||
{
|
||||
CreateCircle()
|
||||
};
|
||||
}
|
||||
|
||||
protected override void LoadComplete()
|
||||
@ -49,6 +52,20 @@ namespace osu.Game.Modes.Taiko.Objects.Drawable
|
||||
UpdateScrollPosition(Time.Current);
|
||||
}
|
||||
|
||||
protected abstract CirclePiece CreateCircle();
|
||||
protected virtual bool HandleKeyPress(Key key) => false;
|
||||
|
||||
protected override bool OnKeyDown(InputState state, KeyDownEventArgs args)
|
||||
{
|
||||
// Make sure we don't handle held-down keys
|
||||
if (args.Repeat)
|
||||
return false;
|
||||
|
||||
// Check if we've pressed a valid taiko key
|
||||
if (!validKeys.Contains(args.Key))
|
||||
return false;
|
||||
|
||||
// Handle it!
|
||||
return HandleKeyPress(args.Key);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -20,6 +20,10 @@ namespace osu.Game.Modes.Taiko.Objects.Drawable.Pieces
|
||||
/// </summary>
|
||||
public class CirclePiece : Container
|
||||
{
|
||||
public const float SYMBOL_SIZE = TaikoHitObject.CIRCLE_RADIUS * 2f * 0.45f;
|
||||
public const float SYMBOL_BORDER = 8;
|
||||
public const float SYMBOL_INNER_SIZE = SYMBOL_SIZE - 2 * SYMBOL_BORDER;
|
||||
|
||||
private Color4 accentColour;
|
||||
/// <summary>
|
||||
/// The colour of the inner circle and outer glows.
|
||||
|
@ -6,20 +6,20 @@ using OpenTK;
|
||||
namespace osu.Game.Modes.Taiko.Objects.Drawable.Pieces
|
||||
{
|
||||
/// <summary>
|
||||
/// A type of circle piece which is drawn at a higher scale as an "accent".
|
||||
/// A type of circle piece which is drawn at a higher scale to represent a "strong" piece.
|
||||
/// </summary>
|
||||
public class AccentedCirclePiece : CirclePiece
|
||||
public class StrongCirclePiece : CirclePiece
|
||||
{
|
||||
/// <summary>
|
||||
/// The amount to scale up the base circle to show it as an "accented" piece.
|
||||
/// The amount to scale up the base circle to show it as a "strong" piece.
|
||||
/// </summary>
|
||||
private const float accent_scale = 1.5f;
|
||||
private const float strong_scale = 1.5f;
|
||||
|
||||
public AccentedCirclePiece()
|
||||
public StrongCirclePiece()
|
||||
{
|
||||
SymbolContainer.Scale = new Vector2(accent_scale);
|
||||
SymbolContainer.Scale = new Vector2(strong_scale);
|
||||
}
|
||||
|
||||
public override Vector2 Size => new Vector2(base.Size.X, base.Size.Y * accent_scale);
|
||||
public override Vector2 Size => new Vector2(base.Size.X, base.Size.Y * strong_scale);
|
||||
}
|
||||
}
|
@ -101,4 +101,4 @@ namespace osu.Game.Modes.Taiko.Objects
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -15,5 +15,10 @@ namespace osu.Game.Modes.Taiko.Objects
|
||||
/// <para>Half of this value is the hit window of the tick.</para>
|
||||
/// </summary>
|
||||
public double TickTimeDistance;
|
||||
|
||||
/// <summary>
|
||||
/// The time allowed to hit this tick.
|
||||
/// </summary>
|
||||
public double HitWindow => TickTimeDistance / 2;
|
||||
}
|
||||
}
|
@ -8,14 +8,14 @@ using osu.Game.Modes.Objects.Types;
|
||||
|
||||
namespace osu.Game.Modes.Taiko.Objects
|
||||
{
|
||||
public class Bash : TaikoHitObject, IHasEndTime
|
||||
public class Swell : TaikoHitObject, IHasEndTime
|
||||
{
|
||||
public double EndTime { get; set; }
|
||||
|
||||
public double Duration => EndTime - StartTime;
|
||||
|
||||
/// <summary>
|
||||
/// The number of hits required to complete the bash successfully.
|
||||
/// The number of hits required to complete the swell successfully.
|
||||
/// </summary>
|
||||
public int RequiredHits { get; protected set; }
|
||||
|
@ -20,10 +20,10 @@ namespace osu.Game.Modes.Taiko.Objects
|
||||
public double PreEmpt;
|
||||
|
||||
/// <summary>
|
||||
/// Whether this HitObject is accented.
|
||||
/// Accented hit objects give more points for hitting the hit object with both keys.
|
||||
/// Whether this HitObject is a "strong" type.
|
||||
/// Strong hit objects give more points for hitting the hit object with both keys.
|
||||
/// </summary>
|
||||
public bool Accented;
|
||||
public bool IsStrong;
|
||||
|
||||
/// <summary>
|
||||
/// Whether this HitObject is in Kiai time.
|
||||
|
@ -128,7 +128,7 @@ namespace osu.Game.Modes.Taiko.Scoring
|
||||
hpIncreaseGood = hpMultiplierNormal * hp_hit_good;
|
||||
hpIncreaseMiss = BeatmapDifficulty.DifficultyRange(beatmap.BeatmapInfo.Difficulty.DrainRate, hp_miss_min, hp_miss_mid, hp_miss_max);
|
||||
|
||||
var accentedHits = beatmap.HitObjects.FindAll(o => o is Hit && o.Accented);
|
||||
var accentedHits = beatmap.HitObjects.FindAll(o => o is Hit && o.IsStrong);
|
||||
|
||||
// This is a linear function that awards:
|
||||
// 10 times bonus points for hitting an accented hit object with both keys with 30 accented hit objects in the map
|
||||
@ -143,7 +143,7 @@ namespace osu.Game.Modes.Taiko.Scoring
|
||||
{
|
||||
Result = HitResult.Hit,
|
||||
TaikoResult = TaikoHitResult.Great,
|
||||
SecondHit = obj.Accented
|
||||
SecondHit = obj.IsStrong
|
||||
});
|
||||
}
|
||||
else if (obj is DrumRoll)
|
||||
@ -154,7 +154,7 @@ namespace osu.Game.Modes.Taiko.Scoring
|
||||
{
|
||||
Result = HitResult.Hit,
|
||||
TaikoResult = TaikoHitResult.Great,
|
||||
SecondHit = obj.Accented
|
||||
SecondHit = obj.IsStrong
|
||||
});
|
||||
}
|
||||
|
||||
@ -162,10 +162,10 @@ namespace osu.Game.Modes.Taiko.Scoring
|
||||
{
|
||||
Result = HitResult.Hit,
|
||||
TaikoResult = TaikoHitResult.Great,
|
||||
SecondHit = obj.Accented
|
||||
SecondHit = obj.IsStrong
|
||||
});
|
||||
}
|
||||
else if (obj is Bash)
|
||||
else if (obj is Swell)
|
||||
{
|
||||
AddJudgement(new TaikoJudgement
|
||||
{
|
||||
|
@ -139,7 +139,7 @@ namespace osu.Game.Modes.Taiko.UI
|
||||
{
|
||||
target.FadeTo(Math.Min(target.Alpha + 0.4f, 1), 40, EasingTypes.OutQuint);
|
||||
target.Delay(40);
|
||||
target.FadeOut(600, EasingTypes.OutQuint);
|
||||
target.FadeOut(1000, EasingTypes.OutQuint);
|
||||
}
|
||||
|
||||
return false;
|
||||
|
@ -26,6 +26,7 @@ namespace osu.Game.Modes.Taiko.UI
|
||||
|
||||
/// <summary>
|
||||
/// The play field height scale.
|
||||
/// This also uniformly scales the notes to match the new playfield height.
|
||||
/// </summary>
|
||||
public const float PLAYFIELD_SCALE = 0.65f;
|
||||
|
||||
@ -173,6 +174,7 @@ namespace osu.Game.Modes.Taiko.UI
|
||||
public override void Add(DrawableHitObject<TaikoHitObject, TaikoJudgement> h)
|
||||
{
|
||||
h.Depth = (float)h.HitObject.StartTime;
|
||||
h.Scale = new Vector2(PLAYFIELD_SCALE);
|
||||
|
||||
base.Add(h);
|
||||
}
|
||||
|
@ -52,15 +52,20 @@
|
||||
<Compile Include="Judgements\TaikoDrumRollTickJudgement.cs" />
|
||||
<Compile Include="Judgements\TaikoJudgement.cs" />
|
||||
<Compile Include="Judgements\TaikoHitResult.cs" />
|
||||
<Compile Include="Objects\Drawable\DrawableHit.cs" />
|
||||
<Compile Include="Objects\Drawable\DrawableStrongHit.cs" />
|
||||
<Compile Include="Objects\Drawable\DrawableDrumRoll.cs" />
|
||||
<Compile Include="Objects\Drawable\DrawableDrumRollTick.cs" />
|
||||
<Compile Include="Objects\Drawable\DrawableSwell.cs" />
|
||||
<Compile Include="Objects\Drawable\DrawableTaikoHitObject.cs" />
|
||||
<Compile Include="Objects\Bash.cs" />
|
||||
<Compile Include="Objects\Drawable\Pieces\AccentedCirclePiece.cs" />
|
||||
<Compile Include="Objects\Drawable\Pieces\StrongCirclePiece.cs" />
|
||||
<Compile Include="Objects\Drawable\Pieces\CirclePiece.cs" />
|
||||
<Compile Include="Objects\DrumRoll.cs" />
|
||||
<Compile Include="Objects\DrumRollTick.cs" />
|
||||
<Compile Include="Objects\Hit.cs" />
|
||||
<Compile Include="Objects\Drawable\Pieces\CirclePiece.cs" />
|
||||
<Compile Include="TaikoDifficultyCalculator.cs" />
|
||||
<Compile Include="Objects\Swell.cs" />
|
||||
<Compile Include="Objects\TaikoHitObject.cs" />
|
||||
<Compile Include="TaikoDifficultyCalculator.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="Scoring\TaikoScoreProcessor.cs" />
|
||||
<Compile Include="UI\HitTarget.cs" />
|
||||
@ -97,4 +102,4 @@
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
-->
|
||||
</Project>
|
||||
</Project>
|
||||
|
@ -101,7 +101,7 @@ namespace osu.Game.Database
|
||||
|
||||
using (var lzma = new LzmaStream(properties, replayInStream, compressedSize, outSize))
|
||||
using (var reader = new StreamReader(lzma))
|
||||
score.Replay = new LegacyReplay(reader);
|
||||
score.Replay = score.CreateLegacyReplayFrom(reader);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -20,9 +20,11 @@ namespace osu.Game.Graphics.Cursor
|
||||
{
|
||||
protected override Drawable CreateCursor() => new Cursor();
|
||||
|
||||
private bool dragging;
|
||||
|
||||
protected override bool OnMouseMove(InputState state)
|
||||
{
|
||||
if (state.Mouse.HasMainButtonPressed)
|
||||
if (dragging)
|
||||
{
|
||||
Vector2 offset = state.Mouse.Position - state.Mouse.PositionMouseDown ?? state.Mouse.Delta;
|
||||
float degrees = (float)MathHelper.RadiansToDegrees(Math.Atan2(-offset.X, offset.Y)) + 24.3f;
|
||||
@ -39,6 +41,12 @@ namespace osu.Game.Graphics.Cursor
|
||||
return base.OnMouseMove(state);
|
||||
}
|
||||
|
||||
protected override bool OnDragStart(InputState state)
|
||||
{
|
||||
dragging = true;
|
||||
return base.OnDragStart(state);
|
||||
}
|
||||
|
||||
protected override bool OnMouseDown(InputState state, MouseDownEventArgs args)
|
||||
{
|
||||
ActiveCursor.Scale = new Vector2(1);
|
||||
@ -53,6 +61,8 @@ namespace osu.Game.Graphics.Cursor
|
||||
{
|
||||
if (!state.Mouse.HasMainButtonPressed)
|
||||
{
|
||||
dragging = false;
|
||||
|
||||
((Cursor)ActiveCursor).AdditiveLayer.FadeOut(500, EasingTypes.OutQuint);
|
||||
ActiveCursor.RotateTo(0, 600 * (1 + Math.Abs(ActiveCursor.Rotation / 720)), EasingTypes.OutElasticHalf);
|
||||
ActiveCursor.ScaleTo(1, 500, EasingTypes.OutElastic);
|
||||
|
@ -46,13 +46,13 @@ namespace osu.Game.Modes
|
||||
}
|
||||
}
|
||||
|
||||
public override ReplayInputHandler GetInputHandler() => new LegacyReplayInputHandler(Frames);
|
||||
public override ReplayInputHandler CreateInputHandler() => new LegacyReplayInputHandler(Frames);
|
||||
|
||||
/// <summary>
|
||||
/// The ReplayHandler will take a replay and handle the propagation of updates to the input stack.
|
||||
/// It handles logic of any frames which *must* be executed.
|
||||
/// </summary>
|
||||
public class LegacyReplayInputHandler : ReplayInputHandler
|
||||
protected class LegacyReplayInputHandler : ReplayInputHandler
|
||||
{
|
||||
private readonly List<LegacyReplayFrame> replayContent;
|
||||
|
||||
@ -163,7 +163,7 @@ namespace osu.Game.Modes
|
||||
return currentTime = time;
|
||||
}
|
||||
|
||||
private class ReplayMouseState : MouseState
|
||||
protected class ReplayMouseState : MouseState
|
||||
{
|
||||
public ReplayMouseState(Vector2 position, IEnumerable<MouseButton> list)
|
||||
{
|
||||
@ -172,7 +172,7 @@ namespace osu.Game.Modes
|
||||
}
|
||||
}
|
||||
|
||||
private class ReplayKeyboardState : KeyboardState
|
||||
protected class ReplayKeyboardState : KeyboardState
|
||||
{
|
||||
public ReplayKeyboardState(List<Key> keys)
|
||||
{
|
||||
@ -182,7 +182,7 @@ namespace osu.Game.Modes
|
||||
}
|
||||
|
||||
[Flags]
|
||||
public enum LegacyButtonState
|
||||
protected enum LegacyButtonState
|
||||
{
|
||||
None = 0,
|
||||
Left1 = 1,
|
||||
@ -192,7 +192,7 @@ namespace osu.Game.Modes
|
||||
Smoke = 16
|
||||
}
|
||||
|
||||
public class LegacyReplayFrame
|
||||
protected class LegacyReplayFrame
|
||||
{
|
||||
public Vector2 Position => new Vector2(MouseX, MouseY);
|
||||
|
||||
|
@ -157,7 +157,7 @@ namespace osu.Game.Modes.Mods
|
||||
|
||||
public void Apply(HitRenderer<T> hitRenderer)
|
||||
{
|
||||
hitRenderer.InputManager.ReplayInputHandler = CreateReplayScore(hitRenderer.Beatmap)?.Replay?.GetInputHandler();
|
||||
hitRenderer.InputManager.ReplayInputHandler = CreateReplayScore(hitRenderer.Beatmap)?.Replay?.CreateInputHandler();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -7,6 +7,6 @@ namespace osu.Game.Modes
|
||||
{
|
||||
public abstract class Replay
|
||||
{
|
||||
public virtual ReplayInputHandler GetInputHandler() => null;
|
||||
public virtual ReplayInputHandler CreateInputHandler() => null;
|
||||
}
|
||||
}
|
@ -6,6 +6,7 @@ using Newtonsoft.Json;
|
||||
using osu.Game.Database;
|
||||
using osu.Game.Modes.Mods;
|
||||
using osu.Game.Users;
|
||||
using System.IO;
|
||||
|
||||
namespace osu.Game.Modes.Scoring
|
||||
{
|
||||
@ -43,6 +44,13 @@ namespace osu.Game.Modes.Scoring
|
||||
[JsonProperty(@"date")]
|
||||
public DateTime Date;
|
||||
|
||||
/// <summary>
|
||||
/// Creates a legacy replay which is read from a stream.
|
||||
/// </summary>
|
||||
/// <param name="reader">The stream reader.</param>
|
||||
/// <returns>The replay.</returns>
|
||||
public virtual Replay CreateLegacyReplayFrom(StreamReader reader) => new LegacyReplay(reader);
|
||||
|
||||
// [JsonProperty(@"count50")] 0,
|
||||
//[JsonProperty(@"count100")] 0,
|
||||
//[JsonProperty(@"count300")] 100,
|
||||
|
@ -126,7 +126,7 @@ namespace osu.Game
|
||||
|
||||
Beatmap.Value = BeatmapDatabase.GetWorkingBeatmap(s.Beatmap);
|
||||
|
||||
menu.Push(new PlayerLoader(new Player { ReplayInputHandler = s.Replay.GetInputHandler() }));
|
||||
menu.Push(new PlayerLoader(new Player { ReplayInputHandler = s.Replay.CreateInputHandler() }));
|
||||
}
|
||||
|
||||
protected override void LoadComplete()
|
||||
|
@ -13,14 +13,14 @@ namespace osu.Game.Screens.Select.Leaderboards
|
||||
{
|
||||
public class DrawableRank : Container
|
||||
{
|
||||
private readonly Sprite sprite;
|
||||
private readonly Sprite rankSprite;
|
||||
|
||||
public ScoreRank Rank { get; private set; }
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load(TextureStore textures)
|
||||
{
|
||||
sprite.Texture = textures.Get($@"Badges/ScoreRanks/{Rank.GetDescription()}");
|
||||
rankSprite.Texture = textures.Get($@"Grades/{Rank.GetDescription()}");
|
||||
}
|
||||
|
||||
public DrawableRank(ScoreRank rank)
|
||||
@ -29,10 +29,7 @@ namespace osu.Game.Screens.Select.Leaderboards
|
||||
|
||||
Children = new Drawable[]
|
||||
{
|
||||
sprite = new Sprite
|
||||
{
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
},
|
||||
rankSprite = new Sprite { FillMode = FillMode.Fill },
|
||||
};
|
||||
}
|
||||
}
|
||||
|
@ -160,7 +160,7 @@
|
||||
<Compile Include="Overlays\Notifications\ProgressCompletionNotification.cs" />
|
||||
<Compile Include="Overlays\Notifications\ProgressNotification.cs" />
|
||||
<Compile Include="Overlays\Notifications\SimpleNotification.cs" />
|
||||
<Compile Include="Overlays\Options\OptionDropDown.cs" />
|
||||
<Compile Include="Overlays\Options\OptionDropdown.cs" />
|
||||
<Compile Include="Overlays\Options\OptionLabel.cs" />
|
||||
<Compile Include="Graphics\UserInterface\OsuDropdown.cs" />
|
||||
<Compile Include="Overlays\Options\OptionsFooter.cs" />
|
||||
@ -322,7 +322,7 @@
|
||||
<Compile Include="Overlays\Options\OptionTextBox.cs" />
|
||||
<Compile Include="Overlays\Options\OptionSlider.cs" />
|
||||
<Compile Include="Configuration\ProgressBarType.cs" />
|
||||
<Compile Include="Overlays\Options\OptionEnumDropDown.cs" />
|
||||
<Compile Include="Overlays\Options\OptionEnumDropdown.cs" />
|
||||
<Compile Include="Configuration\RankingType.cs" />
|
||||
<Compile Include="Configuration\ScoreMeterType.cs" />
|
||||
<Compile Include="Configuration\ReleaseStream.cs" />
|
||||
@ -398,4 +398,4 @@
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
-->
|
||||
</Project>
|
||||
</Project>
|
||||
|
Loading…
Reference in New Issue
Block a user