From b5b3f86fb6995f759f3906288c2b8dacde5c9806 Mon Sep 17 00:00:00 2001 From: HumanoidSandvichDispenser Date: Fri, 18 Oct 2024 15:01:54 -0700 Subject: [PATCH] Update weapon mechanics --- Items/Weapons/Pugio.tscn | 1 - Items/Weapons/Shotgun.tscn | 10 +++++----- Items/Weapons/Sword.tscn | 1 - State/Weapon/RangedChargeState.cs | 3 ++- State/Weapon/RangedFireState.cs | 10 +++++++++- 5 files changed, 16 insertions(+), 9 deletions(-) diff --git a/Items/Weapons/Pugio.tscn b/Items/Weapons/Pugio.tscn index b82c959..8212014 100644 --- a/Items/Weapons/Pugio.tscn +++ b/Items/Weapons/Pugio.tscn @@ -412,7 +412,6 @@ libraries = { } [node name="Hitbox" parent="." instance=ExtResource("9_qimey")] -priority = 5 IsDisabled = true [node name="CollisionShape2D" parent="Hitbox" index="0"] diff --git a/Items/Weapons/Shotgun.tscn b/Items/Weapons/Shotgun.tscn index a7beaf0..363ebe5 100644 --- a/Items/Weapons/Shotgun.tscn +++ b/Items/Weapons/Shotgun.tscn @@ -65,9 +65,9 @@ tracks/0/path = NodePath("Anchor:position") tracks/0/interp = 1 tracks/0/loop_wrap = true tracks/0/keys = { -"times": PackedFloat32Array(0, 0.5), +"times": PackedFloat32Array(0, 0.2), "transitions": PackedFloat32Array(1, 1), -"update": 1, +"update": 0, "values": [Vector2(-4, 0), Vector2(0, 0)] } tracks/1/type = "audio" @@ -92,10 +92,10 @@ tracks/2/path = NodePath("Anchor:rotation") tracks/2/interp = 1 tracks/2/loop_wrap = true tracks/2/keys = { -"times": PackedFloat32Array(0, 1, 1.5), -"transitions": PackedFloat32Array(1, 1, 1), +"times": PackedFloat32Array(0, 0.1, 1, 1.5), +"transitions": PackedFloat32Array(1, 1, 1, 1), "update": 0, -"values": [6.28319, 6.28319, 0.0] +"values": [6.19592, 6.28319, 6.28319, 0.0] } tracks/3/type = "audio" tracks/3/imported = false diff --git a/Items/Weapons/Sword.tscn b/Items/Weapons/Sword.tscn index 97397aa..0d00a77 100644 --- a/Items/Weapons/Sword.tscn +++ b/Items/Weapons/Sword.tscn @@ -417,7 +417,6 @@ libraries = { } [node name="Hitbox" parent="." instance=ExtResource("3_up3ob")] -priority = 5 IsDisabled = true [node name="CollisionShape2D" parent="Hitbox" index="0"] diff --git a/State/Weapon/RangedChargeState.cs b/State/Weapon/RangedChargeState.cs index 7101755..5c98378 100644 --- a/State/Weapon/RangedChargeState.cs +++ b/State/Weapon/RangedChargeState.cs @@ -56,7 +56,8 @@ public partial class RangedChargeState : WeaponState return IdleState; } - FireState.VelocityModifier = (float)(1 - progress); + FireState.VelocityModifier = (float)(1 - progress) * + FireState.InitialVelocityModifier; return FireState; } } diff --git a/State/Weapon/RangedFireState.cs b/State/Weapon/RangedFireState.cs index 188132b..72ff881 100644 --- a/State/Weapon/RangedFireState.cs +++ b/State/Weapon/RangedFireState.cs @@ -17,10 +17,18 @@ public partial class RangedFireState : WeaponState [Export] public string AnimationKey { get; set; } - public float VelocityModifier { get; set; } + public float VelocityModifier { get; set; } = 1; + + [Export] + public float InitialVelocityModifier { get; set; } = 1; private double _timeLeft = 0; + public override void _Ready() + { + VelocityModifier = InitialVelocityModifier; + } + public override IState Enter(IState prev) { //_timeLeft