Deploy and shooting brought back
This commit is contained in:
parent
c1548e5451
commit
b94e4cdf30
10 changed files with 25 additions and 15 deletions
|
|
@ -4,15 +4,10 @@ extends WeaponState
|
|||
|
||||
func enter() -> void:
|
||||
machine.animation_player.play(with_morphems("idle"))
|
||||
machine.player.get_node("PlayerInput").reload.connect(init_reload)
|
||||
|
||||
func exit() -> void:
|
||||
pass
|
||||
|
||||
func state_input(event: InputEvent) -> void:
|
||||
if not machine.is_multiplayer_authority() or Input.mouse_mode != Input.MouseMode.MOUSE_MODE_CAPTURED: return
|
||||
|
||||
if event.is_action_pressed("plr_reload"):
|
||||
init_reload.rpc()
|
||||
machine.player.get_node("PlayerInput").reload.disconnect(init_reload)
|
||||
|
||||
func use_begin() -> void:
|
||||
if machine.ammo > 0:
|
||||
|
|
|
|||
|
|
@ -31,7 +31,6 @@ func use_begin() -> void:
|
|||
func fire() -> void:
|
||||
if machine.ammo == 0 or fire_timer.time_left > 0:
|
||||
return
|
||||
machine.player.get_node("ShootAudio").multiplayer_play()
|
||||
machine.ammo -= 1
|
||||
bullets_shot += 1
|
||||
|
||||
|
|
@ -40,6 +39,7 @@ func fire() -> void:
|
|||
|
||||
if is_multiplayer_authority():
|
||||
Session.shoot(int(machine.player.name),damage,shoot_distance)
|
||||
machine.player.get_node("ShootAudio").multiplayer_play()
|
||||
|
||||
fire_timer.start()
|
||||
machine.player_camera.recoil(horizontal_curve.sample(bullets_shot),vertical_curve.sample(bullets_shot))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue