class_name PlayerWeaponController extends Node # Value-only input/output; no parent, movement, HUD or game reference. func tick(cooldown: float, melee: float, reload_time: float, magazine: int, reserve: int, capacity: int, dt: float) -> Dictionary: var next_reload := maxf(0,reload_time-dt) if reload_time > 0 and next_reload <= 0: var need := mini(capacity-magazine,reserve) magazine += need reserve -= need return {"cooldown":maxf(0,cooldown-dt),"melee":maxf(0,melee-dt),"reload":next_reload,"magazine":magazine,"reserve":reserve}