Refactor Part II

This commit is contained in:
Rendo 2025-12-09 21:02:29 +05:00
commit 3f99f1b8dd
56 changed files with 193 additions and 168 deletions

View file

@ -25,6 +25,7 @@ class_name WeaponSubStateMachine
remaining_ammo = 0
else:
remaining_ammo = value
ammo_updated.emit()
@export var speed_modifier: float = 1.0
@export var can_be_previous: bool = true
@ -52,6 +53,16 @@ func _ready() -> void:
child.machine = self
child.transition.connect(on_transition_required)
child.return_to_previous.connect(request_return.emit)
var parent = get_parent()
if parent is WeaponSystem:
system = parent
animation_player = system.animation_player
player_camera = system.camera
player = system.player
request_return.connect(system.return_to_previous)
ammo_depleted.connect(system.check_for_empty)
ammo_updated.connect(system.on_ammo_updated)
func enter() -> void:
super()