Sites
This commit is contained in:
parent
bd16f01192
commit
6422ffb13c
13 changed files with 142 additions and 5 deletions
13
scripts/weapon_system/bomb/active_bomb.gd
Normal file
13
scripts/weapon_system/bomb/active_bomb.gd
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
extends Node3D
|
||||
|
||||
var plant: StringName
|
||||
|
||||
func _ready() -> void:
|
||||
if multiplayer.is_server():
|
||||
$Timer.timeout.connect(on_timeout)
|
||||
|
||||
func on_timeout():
|
||||
if multiplayer.is_server() == false:
|
||||
return
|
||||
|
||||
Session.kill_site(plant)
|
||||
1
scripts/weapon_system/bomb/active_bomb.gd.uid
Normal file
1
scripts/weapon_system/bomb/active_bomb.gd.uid
Normal file
|
|
@ -0,0 +1 @@
|
|||
uid://boftqgpgqf56g
|
||||
|
|
@ -8,5 +8,5 @@ func exit() -> void:
|
|||
pass
|
||||
|
||||
func state_input(event: InputEvent) -> void:
|
||||
if event.is_action("plr_bomb"):
|
||||
if event.is_action("plr_bomb") and Session.is_on_site():
|
||||
transition.emit("Plant")
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ func exit():
|
|||
func on_animation_finished(animation: StringName):
|
||||
if animation == machine.animation_prefix + "plant":
|
||||
|
||||
Session.spawn({"scene": active_bomb, "position": machine.player_camera.get_parent().global_position})
|
||||
Session.spawn({"scene": active_bomb, "position": machine.player_camera.get_parent().global_position,"plant": Session.get_site().name})
|
||||
|
||||
machine.ammo -= 1
|
||||
return_to_previous.emit()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue