Merge branch 'multiplayer-rework'
This commit is contained in:
commit
2c9ef1cfe1
38 changed files with 535 additions and 288 deletions
|
|
@ -40,10 +40,10 @@ func interaction_start(player_id: int):
|
|||
super(player_id)
|
||||
defuse_timer.start()
|
||||
$DefuseAudio.multiplayer_play()
|
||||
Session.player_nodes[player_id].passive.rpc_id(player_id)
|
||||
Session.player_nodes[player_id].passive()
|
||||
|
||||
func interaction_end():
|
||||
Session.player_nodes[interacted_id].depassive.rpc_id(interacted_id)
|
||||
Session.player_nodes[interacted_id].depassive()
|
||||
|
||||
super()
|
||||
defuse_timer.stop()
|
||||
|
|
|
|||
|
|
@ -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")
|
||||
|
|
|
|||
|
|
@ -3,8 +3,9 @@ extends WeaponState
|
|||
func enter():
|
||||
machine.animation_player.play(machine.animation_prefix+"plant")
|
||||
machine.animation_player.animation_finished.connect(on_animation_finished)
|
||||
machine.speed_modifier = 0.0
|
||||
machine.player.get_node("PlantAudio").multiplayer_play()
|
||||
if is_multiplayer_authority():
|
||||
machine.speed_modifier = 0.0
|
||||
machine.player.get_node("PlantAudio").multiplayer_play()
|
||||
|
||||
func exit():
|
||||
machine.animation_player.animation_finished.disconnect(on_animation_finished)
|
||||
|
|
@ -14,15 +15,13 @@ func on_animation_finished(animation: StringName):
|
|||
if is_multiplayer_authority() == false:
|
||||
return
|
||||
if animation == machine.animation_prefix + "plant":
|
||||
|
||||
Session.spawn({"type": "object","spawn_name": "active_bomb", "position": machine.player_camera.get_parent().global_position,"plant": Session.get_site().name})
|
||||
Session.spawn({"type": "object","spawn_name": "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