fix(attr): 修复调试场景因 cpu_limit 基准改为 0 而退化;记录 cast_delay_mod 快照时序

combat_test 绕过 CombatManager 直接 equip_wand,拿不到 _rebuild_wand 注入的
"core" 份额,导致 cpu_limit=0 触发守卫报错、MAX_OPS 由 200 退化为 40。
镜像 _rebuild_wand 的做法在该场景自行注入(先 remove 再 add),仅修本次弄坏
的部分;该场景整体绕过 CombatManager(如从不设 mana_leech)属既有分歧,不在
本次范围内。

_cast_interval 仅在 equip_wand 时快照,install_spell 只调 _rebuild_wand 不调
equip_wand,实际再同步点是每波开战的 _transition_to_battle。行为不改,加注释
记下时序,免得后续属性商店的实现者误以为购买即时生效。

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
2026-07-31 11:38:08 +08:00
co-authored by Claude Opus 5
parent a3bb778715
commit 6f11f4c402
2 changed files with 5 additions and 1 deletions
+3
View File
@@ -14,6 +14,9 @@ func _ready() -> void:
PlayerManager.set_player_node(_player_node)
# 装备法杯:wand_basic + spark_bolt
var loadout: Dictionary = WandPreset.make_default_loadout()
# 本场景绕过 CombatManager,故须自行注入法杖运算力份额(否则 cpu_limit=0 → MAX_OPS 退化)
PlayerStats.remove_modifiers_from("core")
PlayerStats.add_modifier("cpu_limit", "flat", float(loadout["core"].cpu_limit), "core")
PlayerManager.equip_wand(loadout["core"], loadout["compiled"])
_run_spawn()
+2 -1
View File
@@ -14,7 +14,8 @@ var _player_node: Node2D = null
var _equipped_core: CoreDefinition = null
var _equipped_compiled: CompiledDeck = null
var _cast_timer: float = 0.0
var _cast_interval: float = 0.5
var _cast_interval: float = 0.5 # equip_wand 时快照 core.cast_interval × cast_delay_mod
# 中途改 cast_delay_mod 要到下次 equip_wand(每波开战 _transition_to_battle)才生效
var _is_moving: bool = false
var _stationary_time: float = 0.0