diff --git a/scenes/main/combat_test.gd b/scenes/main/combat_test.gd index ff68326..50e0e65 100644 --- a/scenes/main/combat_test.gd +++ b/scenes/main/combat_test.gd @@ -15,6 +15,8 @@ func _ready() -> void: # 装备法杯:wand_basic + spark_bolt var loadout: Dictionary = WandPreset.make_default_loadout() # 本场景绕过 CombatManager,故须自行注入法杖运算力份额(否则 cpu_limit=0 → MAX_OPS 退化) + # 顺序理由见 combat_manager._rebuild_wand:remove 必须先于 add(否则重复进入会累积), + # 而两者又必须都先于 equip_wand(equip_wand 里的 cpu_limit<=0 守卫读的就是注入结果) PlayerStats.remove_modifiers_from("core") PlayerStats.add_modifier("cpu_limit", "flat", float(loadout["core"].cpu_limit), "core") PlayerManager.equip_wand(loadout["core"], loadout["compiled"]) diff --git a/scripts/domain/player_manager.gd b/scripts/domain/player_manager.gd index 1fefc11..37c5259 100644 --- a/scripts/domain/player_manager.gd +++ b/scripts/domain/player_manager.gd @@ -93,7 +93,8 @@ func equip_wand(core: CoreDefinition, compiled: CompiledDeck) -> void: PlayerStats.mana_heat = 0.0 # 0 守卫:cpu_limit=0 → MAX_OPS 退化,法术近乎全静默。放在换杖处而非施法处——施法端 2 次/秒 # 会刷屏埋掉根因,且此处拿得到杖名。兜的是「新调用点忘了注入」与「cores.json 某杖配成 0」, - # 二者上游无任何报错(缺 attributes.json / attr_id 打错已分别由 player_stats.gd:173/191 报出) + # 二者上游无任何报错(缺 attributes.json / attr_id 打错已分别由 PlayerStats._load_attr_definitions + # 与 PlayerStats.add_modifier 报出) if PlayerStats.cpu_limit <= 0: push_error("PlayerManager: 装备「%s」后 cpu_limit=0,法术执行预算将退化为 40 步;检查该杖 cores.json 的 cpu_limit 与 source=\"core\" 加成注入" % (core.display_name if core else "—"))