Defuse win
This commit is contained in:
parent
215598c63b
commit
8535dba9cd
10 changed files with 151 additions and 21 deletions
|
|
@ -1,8 +1,10 @@
|
|||
extends Node3D
|
||||
extends Interactible
|
||||
|
||||
var plant: StringName
|
||||
@onready var defuse_timer: Timer = $DefuseTimer
|
||||
|
||||
func _ready() -> void:
|
||||
super()
|
||||
if multiplayer.is_server():
|
||||
Session.bomb_timer.timeout.connect(on_timeout)
|
||||
Session.begin_bomb_stage()
|
||||
|
|
@ -12,3 +14,19 @@ func on_timeout():
|
|||
return
|
||||
|
||||
Session.kill_site(plant)
|
||||
|
||||
func on_defuse_timeout():
|
||||
Session.defuse_win()
|
||||
|
||||
func interaction_start(player_id: int):
|
||||
if Session.player_nodes[player_id].team != Session.TEAMS.DEFENCE:
|
||||
return
|
||||
super(player_id)
|
||||
defuse_timer.start()
|
||||
Session.player_nodes[player_id].passive.rpc_id(player_id)
|
||||
|
||||
func interaction_end():
|
||||
Session.player_nodes[interacted_id].depassive.rpc_id(interacted_id)
|
||||
|
||||
super()
|
||||
defuse_timer.stop()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue