Smoke effect and animations revamp
This commit is contained in:
parent
d752dd17dc
commit
4c3e35d1fc
20 changed files with 106 additions and 29 deletions
|
|
@ -3,14 +3,14 @@ extends WeaponState
|
|||
@export var emptyable: bool
|
||||
|
||||
func _enter() -> void:
|
||||
machine.animation_player.play(with_morphems("reload"))
|
||||
machine.play(with_morphems("reload"))
|
||||
machine.animation_player.animation_finished.connect(on_animation_finished)
|
||||
|
||||
func _exit() -> void:
|
||||
machine.animation_player.animation_finished.disconnect(on_animation_finished)
|
||||
|
||||
func on_animation_finished(animation):
|
||||
if animation == with_morphems("reload"):
|
||||
if animation == machine.animation_prefix + with_morphems("reload"):
|
||||
if machine.remaining_ammo > machine.max_ammo:
|
||||
machine.remaining_ammo -= machine.max_ammo-machine.ammo
|
||||
machine.ammo = machine.max_ammo
|
||||
|
|
@ -20,4 +20,4 @@ func on_animation_finished(animation):
|
|||
transition.emit("Idle")
|
||||
|
||||
func with_morphems(animation):
|
||||
return machine.animation_prefix + ((animation+"_empty") if emptyable and machine.ammo == 0 else animation)
|
||||
return ((animation+"_empty") if emptyable and machine.ammo == 0 else animation)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue