Update weapon mechanics

master
John Montagu, the 4th Earl of Sandvich 2024-10-18 15:01:54 -07:00
parent 767a9830e7
commit b5b3f86fb6
Signed by: sandvich
GPG Key ID: 9A39BE37E602B22D
5 changed files with 16 additions and 9 deletions

View File

@ -412,7 +412,6 @@ libraries = {
}
[node name="Hitbox" parent="." instance=ExtResource("9_qimey")]
priority = 5
IsDisabled = true
[node name="CollisionShape2D" parent="Hitbox" index="0"]

View File

@ -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

View File

@ -417,7 +417,6 @@ libraries = {
}
[node name="Hitbox" parent="." instance=ExtResource("3_up3ob")]
priority = 5
IsDisabled = true
[node name="CollisionShape2D" parent="Hitbox" index="0"]

View File

@ -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;
}
}

View File

@ -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<WeaponState> Enter(IState<WeaponState> prev)
{
//_timeLeft