pull/3/head
John Montagu, the 4th Earl of Sandvich 2023-05-15 00:20:17 -07:00
parent 30f49baaf2
commit 69e53f78a9
Signed by: sandvich
GPG Key ID: 9A39BE37E602B22D
6 changed files with 100 additions and 3 deletions

Binary file not shown.

View File

@ -0,0 +1,8 @@
using Godot;
namespace SupaLidlGame.Entities
{
public abstract partial class Projectile : RigidBody2D
{
}
}

View File

@ -0,0 +1,10 @@
namespace SupaLidlGame.Items.Weapons
{
public partial class HitscanRanged : Ranged
{
public override void Attack()
{
}
}
}

View File

@ -0,0 +1,61 @@
using Godot;
namespace SupaLidlGame.Items.Weapons
{
public abstract partial class Ranged : Weapon
{
[Export]
public float AngleDeviation { get; set; }
[Export]
public float ChargeTime { get; set; }
public bool IsChargeable => ChargeTime > 0;
public double ChargeProgress { get; protected set; }
public bool IsCharging { get; protected set; }
public override void Use()
{
if (RemainingUseTime > 0)
{
return;
}
if (IsChargeable)
{
IsCharging = true;
}
else
{
Attack();
}
base.Use();
}
public override void Deuse()
{
if (IsChargeable && IsCharging)
{
Attack();
IsCharging = false;
}
base.Deuse();
}
public override void _Process(double delta)
{
if (IsCharging)
{
ChargeProgress += delta;
}
base._Process(delta);
}
public abstract void Attack();
}
}

View File

@ -30,6 +30,25 @@ namespace SupaLidlGame.Items.Weapons
public override bool IsParryable { get; protected set; } public override bool IsParryable { get; protected set; }
[Export]
public float AnticipationAngle { get; set; }
[Export]
public float OvershootAngle { get; set; }
[Export]
public float RecoveryAngle { get; set; }
[Export]
public float AnticipationDuration { get; set; }
[Export]
public float OvershootDuration { get; set; }
[Export]
public float RecoveryDuration { get; set; }
public override void Equip(Character character) public override void Equip(Character character)
{ {
Visible = true; Visible = true;

View File

@ -298,7 +298,6 @@ points = PackedVector2Array(-14.142, -14.142, 0, -20, 14.142, -14.142, 20, 0, 14
[node name="Sword" type="Node2D" node_paths=PackedStringArray("Hitbox", "AnimationPlayer", "ParryParticles")] [node name="Sword" type="Node2D" node_paths=PackedStringArray("Hitbox", "AnimationPlayer", "ParryParticles")]
y_sort_enabled = true y_sort_enabled = true
texture_filter = 3 texture_filter = 3
position = Vector2(2, 0)
script = ExtResource("1_mlo73") script = ExtResource("1_mlo73")
Hitbox = NodePath("Hitbox") Hitbox = NodePath("Hitbox")
AnimationPlayer = NodePath("AnimationPlayer") AnimationPlayer = NodePath("AnimationPlayer")
@ -319,11 +318,11 @@ gradient = SubResource("Gradient_2ablm")
Tracking = NodePath("../Node2D/Sprite2D") Tracking = NodePath("../Node2D/Sprite2D")
[node name="Node2D" type="Node2D" parent="Anchor"] [node name="Node2D" type="Node2D" parent="Anchor"]
position = Vector2(0, -4) rotation = -0.846485
[node name="Sprite2D" type="Sprite2D" parent="Anchor/Node2D"] [node name="Sprite2D" type="Sprite2D" parent="Anchor/Node2D"]
y_sort_enabled = true y_sort_enabled = true
position = Vector2(-1.19209e-07, -10) position = Vector2(0, -12)
texture = ExtResource("2_rnfo4") texture = ExtResource("2_rnfo4")
[node name="ParryParticles" type="CPUParticles2D" parent="Anchor/Node2D/Sprite2D"] [node name="ParryParticles" type="CPUParticles2D" parent="Anchor/Node2D/Sprite2D"]