gd: broken weapon throw

This commit is contained in:
2025-06-06 23:21:56 +02:00
parent 579b523a37
commit c2a8b939e8
5 changed files with 72 additions and 16 deletions

View File

@ -186,8 +186,7 @@ delay_in_seconds = "0.0"
[node name="WeaponRoot" type="Node3D" parent="."]
[node name="WeaponSystem" parent="WeaponRoot" instance=ExtResource("29_wv70j")]
transform = Transform3D(1, 0, 0, 0, 0.953043, 0.302836, 0, -0.302836, 0.953043, 0.45268, 1.44035, -0.692528)
skeleton = NodePath("../..")
transform = Transform3D(1, 0, 0, 0, 0.984902, 0.173115, 0, -0.173115, 0.984902, 0.45268, 1.44035, -0.692528)
[connection signal="input_aim_canceled" from="InputController" to="." method="OnInputAimCanceled"]
[connection signal="input_aim_pressed" from="InputController" to="." method="OnInputAimPressed"]

View File

@ -119,7 +119,7 @@ public partial class PlayerController : CharacterBody3D
MoveSystem.Init(moveSystemParams);
StairsSystem.Init(stairsBelowRayCast3D, stairsAheadRayCast3D, cameraSmooth);
DashSystem.Init(HeadSystem, camera, TweenQueueSystem);
WeaponSystem.Init(HeadSystem, camera, TweenQueueSystem);
WeaponSystem.Init(HeadSystem, camera);
// RPG Stuff
HealthSystem.HealthSystemInitParams healthSystemParams = new HealthSystem.HealthSystemInitParams()
@ -154,7 +154,9 @@ public partial class PlayerController : CharacterBody3D
{
var (hasHit, location, collisionPoint, collisionNormal) = DashSystem.DashComputation;
var (endWithMantle, dashLocation, mantleLocation) = DashSystem.DashResolve;
var weaponThrowVector = dashLocation - Position;
WeaponSystem.ThrowWeapon(Position, dashLocation, hasHit, collisionPoint, collisionNormal);
DashSystem.CancelDash();
// RemoveChild(WeaponSystem);
}
public void OnInputMove(Vector3 value)
@ -194,6 +196,8 @@ public partial class PlayerController : CharacterBody3D
public void OnDashEnded()
{
_playerState.SendEvent("dash_ended");
// AddChild(WeaponSystem);
WeaponSystem.ResetWeapon();
}
public void OnInputJumpPressed()