Damage numbers and knockback

This commit is contained in:
Twirpytherobot
2025-11-15 17:17:32 +00:00
parent 61446a0bcd
commit c7f946a9e2
8 changed files with 189 additions and 8 deletions
+14 -2
View File
@@ -80,10 +80,22 @@ func _find_and_damage_targets():
# If we're the server, apply damage directly
if multiplayer.is_server():
owner_character._server_apply_damage(hit_body.name, weapon_data.damage, attacker_id)
owner_character._server_apply_damage(
hit_body.name,
weapon_data.damage,
attacker_id,
weapon_data.knockback_force,
owner_character.global_position
)
else:
# Otherwise, request server to apply damage
owner_character.rpc_id(1, "_server_apply_damage", hit_body.name, weapon_data.damage, attacker_id)
owner_character.rpc_id(1, "_server_apply_damage",
hit_body.name,
weapon_data.damage,
attacker_id,
weapon_data.knockback_force,
owner_character.global_position
)
break # Only hit one target per attack
## Check if weapon can attack