From 8b9565e1ff454e5f208714204421cdca9023672a Mon Sep 17 00:00:00 2001 From: Joywayer Date: Mon, 20 Jul 2026 16:42:20 +0800 Subject: [PATCH] =?UTF-8?q?fix(mana):=20LOOP=20=E4=BD=93=20/=20CIRCUIT=20?= =?UTF-8?q?=E5=88=86=E6=94=AF=E8=8A=82=E7=82=B9=E4=B9=9F=E6=89=A3=E8=93=9D?= =?UTF-8?q?=EF=BC=88=E5=A0=B5=E4=BD=8F=E5=85=8D=E8=93=9D=E9=87=8D=E5=A4=8D?= =?UTF-8?q?=E6=96=BD=E6=B3=95=E6=BC=8F=E6=B4=9E=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/domain/spell_system/spell_evaluator.gd | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/scripts/domain/spell_system/spell_evaluator.gd b/scripts/domain/spell_system/spell_evaluator.gd index 706b394..5cc10c2 100644 --- a/scripts/domain/spell_system/spell_evaluator.gd +++ b/scripts/domain/spell_system/spell_evaluator.gd @@ -563,6 +563,9 @@ func _run_logic_loop(node: SpellNode, ctx: SpellContext, spawn_pos: Vector2, ops_count += 1 if ops_count >= max_ops: return ops_count + var n_cost: float = float(n.meta.get("mana_cost", 0.0)) + if n_cost > 0.0 and not PlayerStats.spend_mana(n_cost): + return ops_count # 蓝不足 → 停止整个 LOOP match n.type: SpellNode.SpellType.ACTION: _push_projectile(n, ctx, spawn_pos, -1) @@ -591,6 +594,9 @@ func _run_branch_payload(payload_id: int, ctx: SpellContext, spawn_pos: Vector2) var b_rad: float = s.radius_mult var b_crit: float = s.crit_chance for node in nodes: + var node_cost: float = float(node.meta.get("mana_cost", 0.0)) + if node_cost > 0.0 and not PlayerStats.spend_mana(node_cost): + break # 蓝不足 → 停止本分支 match node.type: SpellNode.SpellType.ACTION: _push_projectile(node, ctx, spawn_pos, -1)