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