added a parry button and animation that lets player chose their enemy hit behaviour
This commit is contained in:
@@ -12,19 +12,16 @@ public partial class PlayerUi : Control
|
||||
public enum TargetState
|
||||
{
|
||||
NoTarget,
|
||||
TargetTooFar,
|
||||
TargetInRange,
|
||||
TargetDashThrough
|
||||
TargetWouldNotKill,
|
||||
TargetWouldKill
|
||||
}
|
||||
|
||||
public record TargetProperties(TargetState State, Vector2 Position);
|
||||
|
||||
[Export]
|
||||
public Color DashThroughColor { get; set; } = new Color("009c8f");
|
||||
public Color WouldKillColor { get; set; } = new Color("009c8f");
|
||||
[Export]
|
||||
public Color DashBlockedColor { get; set; } = new Color("fc001c");
|
||||
[Export]
|
||||
public Color DashOutOfRangeColor { get; set; } = new Color("ffffff");
|
||||
public Color WouldNotKillColor { get; set; } = new Color("fc001c");
|
||||
|
||||
public override void _Ready()
|
||||
{
|
||||
@@ -49,10 +46,9 @@ public partial class PlayerUi : Control
|
||||
|
||||
var modulation = state switch
|
||||
{
|
||||
TargetState.TargetTooFar => DashOutOfRangeColor,
|
||||
TargetState.TargetInRange => DashBlockedColor,
|
||||
TargetState.TargetDashThrough => DashThroughColor,
|
||||
_ => DashOutOfRangeColor
|
||||
TargetState.TargetWouldNotKill => WouldNotKillColor,
|
||||
TargetState.TargetWouldKill => WouldKillColor,
|
||||
_ => WouldNotKillColor
|
||||
};
|
||||
_enemyTarget.SetVisible(visible);
|
||||
_enemyTarget.SetPosition(position - _enemyTarget.Size / 2);
|
||||
|
||||
Reference in New Issue
Block a user