feat(attr): 接线 MAX_OPS/移速/施法间隔;法杖 cpu_limit 以加成来源接入

MAX_OPS 由硬编码 40×5 改为读生效 cpu_limit——cores.json 里逐法杖配置的
3/5/6/8 自此生效,法杖间恢复运算力区分度。玩家基准取 0,故小木法杖仍为
5 → 200 步,现有平衡零改动。

法杖份额走 add_modifier 而非调用点相加:否则 hard(50) 只钳制玩家那一份,
法杖份额加在钳制之后可使总值越界。换杖时先 remove_modifiers_from("core")
再 add,防止累积。

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
2026-07-31 11:35:24 +08:00
co-authored by Claude Opus 5
parent 69ddcddba6
commit a3bb778715
3 changed files with 12 additions and 4 deletions
@@ -329,7 +329,13 @@ func execute_compiled(compiled: CompiledDeck, caster_id: int, spawn_pos: Vector2
var heat_mult: float = 1.0 + PlayerStats.mana_heat
var deck: SpellDeck = compiled.make_runtime_deck()
var ops_count: int = 0
var max_ops: int = MAX_OPS_PER_CPU * 5
# 生效 cpu_limit 已含法杖份额(combat_manager 以 source="core" 的加成接入)
# 0 守卫:cpu_limit=0 意味着所有法术执行零步、全局静默失效。此处是该故障唯一可观测处,
# 能同时兜住上游两种失败(attributes.json 缺失 → 裸字段停在 0add_modifier 的 attr_id 打错 →
# "core" 份额没注入),而根因处的报错够不到这两种。
if PlayerStats.cpu_limit <= 0:
push_error("SpellEvaluator: PlayerStats.cpu_limit=%d,法术将无法执行;检查 attributes.json 与 _rebuild_wand 的 core 加成注入" % PlayerStats.cpu_limit)
var max_ops: int = MAX_OPS_PER_CPU * maxi(PlayerStats.cpu_limit, 1)
var actions_remaining: int = 1 # 初始为 1,由 multicast_count 加成
while deck.has_next() and ops_count < max_ops:
ops_count += 1