depleted ammo destruction
This commit is contained in:
parent
7c7f68b6f5
commit
900502ec8a
12 changed files with 68 additions and 2068 deletions
|
|
@ -1,25 +0,0 @@
|
|||
extends WeaponState
|
||||
|
||||
const active_bomb: StringName = "uid://dtbpyfdawb02b"
|
||||
|
||||
func enter():
|
||||
machine.animation_player.play(machine.animation_prefix+"plant")
|
||||
machine.animation_player.animation_finished.connect(on_animation_finished)
|
||||
machine.speed_modifier = 0.0
|
||||
|
||||
func exit():
|
||||
machine.animation_player.animation_finished.disconnect(on_animation_finished)
|
||||
machine.speed_modifier = 1.0
|
||||
|
||||
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})
|
||||
|
||||
machine.ammo -= 1
|
||||
return_to_previous.emit()
|
||||
|
||||
func state_input(event: InputEvent) -> void:
|
||||
if event.is_action_released("plr_bomb"):
|
||||
|
||||
return_to_previous.emit()
|
||||
Loading…
Add table
Add a link
Reference in a new issue