bomb is now plantable
This commit is contained in:
parent
e2540d8417
commit
2c7903e95d
3 changed files with 10 additions and 11 deletions
|
|
@ -7,6 +7,6 @@ func enter() -> void:
|
|||
func exit() -> void:
|
||||
pass
|
||||
|
||||
func state_input(event: InputEvent) -> void:
|
||||
if event.is_action("plr_bomb") and Session.is_on_site():
|
||||
func use_begin() -> void:
|
||||
if Session.is_on_site(machine.player.player_id):
|
||||
transition.emit("Plant")
|
||||
|
|
|
|||
|
|
@ -17,14 +17,13 @@ func on_animation_finished(animation: StringName):
|
|||
return
|
||||
if animation == machine.animation_prefix + "plant":
|
||||
|
||||
Session.spawn({"scene": active_bomb, "position": machine.player_camera.get_parent().global_position,"plant": Session.get_site().name})
|
||||
Session.spawn({"scene": active_bomb, "position": machine.player_camera.get_parent().global_position,"plant": Session.get_site(machine.player.player_id).name})
|
||||
|
||||
machine.ammo -= 1
|
||||
return_to_previous.emit()
|
||||
|
||||
func state_input(event: InputEvent) -> void:
|
||||
func use_end() -> void:
|
||||
if is_multiplayer_authority() == false:
|
||||
return
|
||||
if event.is_action_released("plr_bomb"):
|
||||
transition.emit("Idle")
|
||||
machine.player.get_node("PlantAudio").multiplayer_stop()
|
||||
transition.emit("Idle")
|
||||
machine.player.get_node("PlantAudio").multiplayer_stop()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue