bomb spawn im crying

This commit is contained in:
Rendo 2025-11-27 18:16:26 +05:00
commit 3302fcfc96
16 changed files with 148 additions and 15 deletions

View file

@ -0,0 +1,22 @@
extends Area3D
@export var weapon_spawner: MultiplayerSpawner
@export var weapon_system: WeaponSystem
func _ready() -> void:
if is_multiplayer_authority() == false: return
body_entered.connect(on_body_entered)
func on_body_entered(body: Node3D):
if body is DroppableWeapon:
if weapon_system.can_add(body.slot) == false:
return
var weapon = weapon_spawner.spawn({
"ammo": body.weapon.ammo,
"remaining_ammo": body.weapon.remaining_ammo,
"scene_file_path": body.weapon.scene_file_path,
"slot": body.slot
})
weapon_system.on_weapon_added(weapon)
body.queue_free()