diff --git a/Assets/Sprites/railgun.ase b/Assets/Sprites/railgun.ase new file mode 100644 index 0000000..44f6ad0 Binary files /dev/null and b/Assets/Sprites/railgun.ase differ diff --git a/Entities/Projectile.cs b/Entities/Projectile.cs new file mode 100644 index 0000000..97c258f --- /dev/null +++ b/Entities/Projectile.cs @@ -0,0 +1,8 @@ +using Godot; + +namespace SupaLidlGame.Entities +{ + public abstract partial class Projectile : RigidBody2D + { + } +} diff --git a/Items/Weapons/HitscanRanged.cs b/Items/Weapons/HitscanRanged.cs new file mode 100644 index 0000000..ce5240d --- /dev/null +++ b/Items/Weapons/HitscanRanged.cs @@ -0,0 +1,10 @@ +namespace SupaLidlGame.Items.Weapons +{ + public partial class HitscanRanged : Ranged + { + public override void Attack() + { + + } + } +} diff --git a/Items/Weapons/Ranged.cs b/Items/Weapons/Ranged.cs new file mode 100644 index 0000000..b5e21f7 --- /dev/null +++ b/Items/Weapons/Ranged.cs @@ -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(); + } +} diff --git a/Items/Weapons/Sword.cs b/Items/Weapons/Sword.cs index 8a6bc0f..c399943 100644 --- a/Items/Weapons/Sword.cs +++ b/Items/Weapons/Sword.cs @@ -30,6 +30,25 @@ namespace SupaLidlGame.Items.Weapons 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) { Visible = true; diff --git a/Items/Weapons/Sword.tscn b/Items/Weapons/Sword.tscn index ba48772..d2c61e8 100644 --- a/Items/Weapons/Sword.tscn +++ b/Items/Weapons/Sword.tscn @@ -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")] y_sort_enabled = true texture_filter = 3 -position = Vector2(2, 0) script = ExtResource("1_mlo73") Hitbox = NodePath("Hitbox") AnimationPlayer = NodePath("AnimationPlayer") @@ -319,11 +318,11 @@ gradient = SubResource("Gradient_2ablm") Tracking = NodePath("../Node2D/Sprite2D") [node name="Node2D" type="Node2D" parent="Anchor"] -position = Vector2(0, -4) +rotation = -0.846485 [node name="Sprite2D" type="Sprite2D" parent="Anchor/Node2D"] y_sort_enabled = true -position = Vector2(-1.19209e-07, -10) +position = Vector2(0, -12) texture = ExtResource("2_rnfo4") [node name="ParryParticles" type="CPUParticles2D" parent="Anchor/Node2D/Sprite2D"]