feat(mana): SpellEvaluator 主循环逐节点扣蓝 + 蓝空停施
This commit is contained in:
@@ -330,6 +330,9 @@ func execute_compiled(compiled: CompiledDeck, caster_id: int, spawn_pos: Vector2
|
|||||||
while deck.has_next() and ops_count < max_ops:
|
while deck.has_next() and ops_count < max_ops:
|
||||||
ops_count += 1
|
ops_count += 1
|
||||||
var node: SpellNode = deck.pop()
|
var node: SpellNode = deck.pop()
|
||||||
|
var mana_cost: float = float(node.meta.get("mana_cost", 0.0))
|
||||||
|
if mana_cost > 0.0 and not PlayerStats.spend_mana(mana_cost):
|
||||||
|
break # 蓝不足 → 停止本次施法(此节点不执行、剩余跳过)
|
||||||
match node.type:
|
match node.type:
|
||||||
SpellNode.SpellType.ACTION:
|
SpellNode.SpellType.ACTION:
|
||||||
_push_projectile(node, ctx, spawn_pos, -1)
|
_push_projectile(node, ctx, spawn_pos, -1)
|
||||||
|
|||||||
Reference in New Issue
Block a user