Global refactor

This commit is contained in:
Rendo 2025-12-09 11:53:52 +05:00
commit 0589ca4e23
180 changed files with 249 additions and 401 deletions

View file

@ -1,23 +0,0 @@
extends WeaponState
@export var emptyable: bool
func enter() -> void:
machine.animation_player.play(with_morphems("idle"))
machine.player.get_node("PlayerInput").reload.connect(init_reload)
func exit() -> void:
machine.player.get_node("PlayerInput").reload.disconnect(init_reload)
func use_begin() -> void:
if machine.ammo > 0:
transition.emit("Shoot")
@rpc("authority","call_local","reliable")
func init_reload():
if machine.ammo == machine.max_ammo or machine.remaining_ammo <= 0:
return
transition.emit("Reload")
func with_morphems(animation):
return machine.animation_prefix + ((animation+"_empty") if emptyable and machine.ammo == 0 else animation)