class_name GimmickGauges extends RefCounted ## Class gimmick gauge system. Server-authoritative. ## Each class has a unique gauge that drives their special mechanic: ## - Warden: Aegis (max 3) — built by taking damage / using defensives ## - Luminary: Lumen Charges (max 3) — built by healing allies ## - Blade: Momentum (max 5) — built by correct positional combo hits ## - Arcanist: Flux (max 3) — built by uninterupted combo hits var aegis_charges: int = 0 var aegis_max: int = 3 var lumen_charges: int = 0 var lumen_max: int = 3 var momentum: int = 0 var momentum_max: int = 5 var flux: int = 0 var flux_max: int = 3 ## --- AEGIS (Warden) --- ## Adds an Aegis charge. Returns true if a charge was added, false if at max. func add_aegis() -> bool: if aegis_charges >= aegis_max: return false aegis_charges += 1 return true ## Consumes all Aegis charges (used when the free ability triggers). ## Returns the number of charges consumed. func spend_aegis() -> int: var spent := aegis_charges aegis_charges = 0 return spent func is_aegis_full() -> bool: return aegis_charges >= aegis_max ## --- LUMEN CHARGES (Luminary) --- ## Adds a Lumen charge (called when a heal lands on an ally). ## Returns true if a charge was added, false if at max. func add_lumen() -> bool: if lumen_charges >= lumen_max: return false lumen_charges += 1 return true ## Consumes Lumen charges on Nova Burst (combo hit 3). ## Returns the number of charges consumed (0, 1, 2, or 3). func spend_lumen() -> int: var spent := lumen_charges lumen_charges = 0 return spent ## Returns the Nova Burst damage multiplier based on current charge count. ## 0 charges = 1.0x, 1 = 1.5x, 2 = 2.0x, 3 = 3.0x func get_nova_multiplier() -> float: match lumen_charges: 0: return 1.0 1: return 1.5 2: return 2.0 3: return 3.0 _: return 1.0 ## --- MOMENTUM (Blade) --- ## Adds Momentum (called on correct positional combo hit). ## Returns true if momentum was added, false if at max. func add_momentum() -> bool: if momentum >= momentum_max: return false momentum += 1 return true ## Resets Momentum to 0 (called when player takes damage). func reset_momentum() -> void: momentum = 0 ## Spends Momentum (used when the enhanced ability triggers at max). ## Returns true if momentum was at max and has been spent. func spend_momentum() -> bool: if momentum < momentum_max: return false momentum = 0 return true func is_momentum_full() -> bool: return momentum >= momentum_max ## --- FLUX (Arcanist) --- ## Adds Flux (called on uninterupted combo hit). ## Returns true if flux was added, false if at max. func add_flux() -> bool: if flux >= flux_max: return false flux += 1 return true ## Resets Flux to 0 (called when player takes damage). func reset_flux() -> void: flux = 0 ## Checks if the next Firebolt should be a Piercing Bolt. ## If true, consumes all flux and returns true. func try_piercing_bolt() -> bool: if flux < flux_max: return false flux = 0 return true func is_flux_full() -> bool: return flux >= flux_max ## --- GENERAL --- ## Resets all gauges (between fights). func reset_all() -> void: aegis_charges = 0 lumen_charges = 0 momentum = 0 flux = 0