change swords to not deal damage when parrying
parent
51682ef7ef
commit
c5e110f92d
|
@ -3,7 +3,12 @@ namespace SupaLidlGame.Items.Weapons;
|
|||
public interface IParryable
|
||||
{
|
||||
public bool IsParryable { get; }
|
||||
|
||||
public bool HasParried { get; }
|
||||
|
||||
public bool IsParried { get; }
|
||||
|
||||
public ulong ParryTimeOrigin { get; }
|
||||
|
||||
public void Stun();
|
||||
}
|
||||
|
|
|
@ -56,6 +56,8 @@ public partial class Sword : Weapon, IParryable
|
|||
[Export]
|
||||
public Node2D Anchor { get; set; }
|
||||
|
||||
public bool HasParried { get; protected set; }
|
||||
|
||||
public override bool IsParryable { get; protected set; }
|
||||
|
||||
public ulong ParryTimeOrigin { get; protected set; }
|
||||
|
@ -85,6 +87,7 @@ public partial class Sword : Weapon, IParryable
|
|||
/// </summary>
|
||||
public void EnableParry(ulong parryTimeOrigin)
|
||||
{
|
||||
HasParried = false;
|
||||
IsParried = false;
|
||||
IsParryable = true;
|
||||
ParryTimeOrigin = parryTimeOrigin;
|
||||
|
@ -95,6 +98,8 @@ public partial class Sword : Weapon, IParryable
|
|||
/// </summary>
|
||||
public void DisableParry()
|
||||
{
|
||||
HasParried = false;
|
||||
IsParried = false;
|
||||
IsParryable = false;
|
||||
}
|
||||
|
||||
|
@ -139,9 +144,9 @@ public partial class Sword : Weapon, IParryable
|
|||
public void Deattack()
|
||||
{
|
||||
IsAttacking = false;
|
||||
DisableParry();
|
||||
Hitbox.IsDisabled = true;
|
||||
ProcessHits();
|
||||
DisableParry();
|
||||
Hitbox.ResetIgnoreList();
|
||||
AnimationPlayer.SpeedScale = 1;
|
||||
}
|
||||
|
@ -182,7 +187,7 @@ public partial class Sword : Weapon, IParryable
|
|||
/// </summary>
|
||||
public void ProcessHits()
|
||||
{
|
||||
if (IsParried)
|
||||
if (IsParried || HasParried)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
@ -219,6 +224,10 @@ public partial class Sword : Weapon, IParryable
|
|||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
HasParried = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue