iter42-卡1: gdstyle尾波清偿批——board_view五段拆分与构建器/装板域拆BoardInstaller/wr5改址,键1-4+9+10归绿
This commit is contained in:
1 parent
3b66d1a689
commit
66e6d0452a
15 files changed
+342
-1301
No files matched your search
@@ -308,13 +308,13 @@ fi
|
||||
# 可回放纯逻辑步骤流(同种子同输入逐位复现),await 会打断确定性——「模块归属」B1 行已写明
|
||||
# 「禁 await——切片 88 冒烟实证」。本闸为防回归防线(2026-10-24 人工 grep 盘面干净)。
|
||||
# 扫描面:B1 域文件集(与 architecture.md「模块归属」B1 行同口径)=battle_orchestrator.gd
|
||||
# + battle_fx_host.gd + reward_grant.gd 两拆件 + settlement/ 五段段类 + damage_controller.gd,共 9 文件,显式清单见 S8_FILES。
|
||||
# + battle_fx_host.gd + reward_grant.gd + board_installer.gd 三拆件 + settlement/ 五段段类 + damage_controller.gd,共 10 文件,显式清单见 S8_FILES。
|
||||
# 执行侧字面值豁免:脚本必须带字面值才能工作;文件集与架构文档冲突时以 B1 域文件集为准。
|
||||
# 判据:文件集内出现 await 关键字即红(词边界 \bawait\b,任何形态——await 信号/协程/
|
||||
# get_tree());排除注释行(行首 #/##)与字符串字面量(双引号包裹段内的 await 非代码),
|
||||
# 口径仿 S1/S2 的 grep 排除手法。
|
||||
# 自检:清单内文件缺位(路径写错/被改名)即判红——防扫面为空静默绿。
|
||||
S8_FILES="game/core/battle_orchestrator.gd game/core/battle_fx_host.gd game/core/reward_grant.gd game/core/settlement/aura_segment.gd game/core/settlement/combat_segment.gd game/core/settlement/decay_segment.gd game/core/settlement/grant_segment.gd game/core/settlement/verdict_segment.gd game/core/damage_controller.gd"
|
||||
S8_FILES="game/core/battle_orchestrator.gd game/core/battle_fx_host.gd game/core/reward_grant.gd game/core/board_installer.gd game/core/settlement/aura_segment.gd game/core/settlement/combat_segment.gd game/core/settlement/decay_segment.gd game/core/settlement/grant_segment.gd game/core/settlement/verdict_segment.gd game/core/damage_controller.gd"
|
||||
S8_MISS=0
|
||||
for f in $S8_FILES; do
|
||||
if [ ! -f "$f" ]; then
|
||||
@@ -356,7 +356,7 @@ fi
|
||||
# 自检:扫描面为空即判红(require_scan_face);B1 文件集与三族自家文件缺位即判红
|
||||
# (文件被改名=豁免名单失效,宁可红不可静默放行)。
|
||||
if require_scan_face "S7" "$DIR_CORE"; then
|
||||
S7_B1_SET="game/core/battle_orchestrator.gd game/core/battle_fx_host.gd game/core/reward_grant.gd game/core/settlement/aura_segment.gd game/core/settlement/combat_segment.gd game/core/settlement/decay_segment.gd game/core/settlement/grant_segment.gd game/core/settlement/verdict_segment.gd game/core/damage_controller.gd"
|
||||
S7_B1_SET="game/core/battle_orchestrator.gd game/core/battle_fx_host.gd game/core/reward_grant.gd game/core/board_installer.gd game/core/settlement/aura_segment.gd game/core/settlement/combat_segment.gd game/core/settlement/decay_segment.gd game/core/settlement/grant_segment.gd game/core/settlement/verdict_segment.gd game/core/damage_controller.gd"
|
||||
S7_MISS=0
|
||||
for f in $S7_B1_SET game/core/unit_container.gd game/core/status_container.gd game/core/reward_economy.gd; do
|
||||
if [ ! -f "$f" ]; then
|
||||
|
||||
@@ -251,6 +251,7 @@ func _init() -> void:
|
||||
_smoke_shop_graph()
|
||||
_smoke_multi_terminal_settlement()
|
||||
_smoke_shop_pool()
|
||||
_test_shop_node_entered_payload()
|
||||
_smoke_generated_coverage()
|
||||
quit(Kit.finish("level_shop_economy_test"))
|
||||
|
||||
@@ -1391,6 +1392,74 @@ func _smoke_shop_pool() -> void:
|
||||
Kit.check("终局池余量在域 [0,配额](%s)" % str(ps), ps_ok)
|
||||
|
||||
|
||||
# ---- 商店房 node_entered 载荷(尾波 V1——_enter_node pool/legacy 双发射路径归一后的行为保持断言)----
|
||||
|
||||
func _test_shop_node_entered_payload() -> void:
|
||||
print("--- 商店房 node_entered 载荷(pool 含 shelf:true+gp 现值/legacy 无 shelf 键)---")
|
||||
var autoplay = load("res://sim/level_autoplay.gd")
|
||||
# pool 态:载荷字典经信号闭包当场取样(字典为引用累积器——lambda 按值捕获标量的绕行惯例)
|
||||
var cap_pool := {"payload": {}, "gp": -1}
|
||||
var pool_ok := false
|
||||
for s in range(42, 92):
|
||||
var pr = load("res://core/adventure_runner.gd").new(_db, _fresh_rng(s))
|
||||
pr.set_hero_override(900, 400)
|
||||
if not pr.start_adventure(s, {"shop_mode": "pool"}):
|
||||
continue
|
||||
var rp = pr.runner()
|
||||
rp.node_entered.connect(func(node, payload):
|
||||
if String(node.get("type", "")) == "shop":
|
||||
cap_pool["payload"] = payload
|
||||
cap_pool["gp"] = int(rp.gp))
|
||||
if not _adv_drive_to_shop(pr, _adv_st(), autoplay):
|
||||
continue
|
||||
pool_ok = not (cap_pool["payload"] as Dictionary).is_empty()
|
||||
if pool_ok:
|
||||
break
|
||||
Kit.check("pool 态进店信号可达(seed 扫描 42–91)", pool_ok)
|
||||
Kit.check("pool 态 node_entered 载荷含 shelf:true〔尾波 V1〕", pool_ok and bool((cap_pool["payload"] as Dictionary).get("shelf", false)))
|
||||
Kit.check("pool 态载荷 gp = 进店钱包现值(%d)〔尾波 V1〕" % int(cap_pool["gp"]), pool_ok and int((cap_pool["payload"] as Dictionary).get("gp", -1)) == int(cap_pool["gp"]))
|
||||
# legacy 态:载荷无 shelf 键(两 payload 字典逐字保持的另一半——直构 LevelRunner 链)
|
||||
var cap_leg := {"payload": {}, "gp": -1}
|
||||
var leg_ok := false
|
||||
for s in range(42, 92):
|
||||
var lr = load("res://core/level_runner.gd").new(_db, _fresh_rng(s))
|
||||
lr.set_hero_override(900, 400)
|
||||
lr.start_level(2, s)
|
||||
lr.node_entered.connect(func(node, payload):
|
||||
if String(node.get("type", "")) == "shop":
|
||||
cap_leg["payload"] = payload
|
||||
cap_leg["gp"] = int(lr.gp))
|
||||
var st := _battle_st("normal")
|
||||
var guard := 60
|
||||
while String(lr.level_result) == "" and String(lr.current_node().get("type", "")) != "shop" and guard > 0:
|
||||
guard -= 1
|
||||
if lr.awaiting_choice():
|
||||
var ids: Array = lr.next_candidate_ids()
|
||||
ids.sort()
|
||||
lr.pick_next_node(int(ids[0]))
|
||||
continue
|
||||
var t := String(lr.current_node().get("type", ""))
|
||||
if t == "reward" or t == "rest":
|
||||
lr.continue_after_node()
|
||||
continue
|
||||
var b = lr.current_battle()
|
||||
if b == null:
|
||||
break
|
||||
var fin := {}
|
||||
b.battle_finished.connect(func(p): fin["p"] = p)
|
||||
var g2 := 80
|
||||
while lr.current_battle() == b and not fin.has("p") and g2 > 0:
|
||||
g2 -= 1
|
||||
autoplay._autoplay_battle(lr, b, st, null)
|
||||
if String(lr.level_result) == "" and String(lr.current_node().get("type", "")) == "shop":
|
||||
leg_ok = not (cap_leg["payload"] as Dictionary).is_empty()
|
||||
if leg_ok:
|
||||
break
|
||||
Kit.check("legacy 态进店信号可达(seed 扫描 42–91)", leg_ok)
|
||||
Kit.check("legacy 态 node_entered 载荷无 shelf 键〔尾波 V1〕", leg_ok and not (cap_leg["payload"] as Dictionary).has("shelf"))
|
||||
Kit.check("legacy 态载荷 gp = 进店钱包现值(%d)〔尾波 V1〕" % int(cap_leg["gp"]), leg_ok and int((cap_leg["payload"] as Dictionary).get("gp", -1)) == int(cap_leg["gp"]))
|
||||
|
||||
|
||||
# 入口→Boss 全路径枚举(DFS 迭代栈——图合法性校验保证单入口无环,路径有限)
|
||||
|
||||
|
||||
|
||||
@@ -14,6 +14,7 @@ const RngScript := preload("res://core/rng_service.gd")
|
||||
const BoardGeneratorScript := preload("res://core/board_generator.gd")
|
||||
const RewardEconomyScript := preload("res://core/reward_economy.gd")
|
||||
const OrchestratorScript := preload("res://core/battle_orchestrator.gd")
|
||||
const BoardInstallerScript := preload("res://core/board_installer.gd")
|
||||
|
||||
const TAG_OK := "board_gen" # 在册合法标签(PURPOSE_TAGS 含;wr7 必须用合法标签——未知标签检查排在播种检查之前)
|
||||
|
||||
@@ -64,11 +65,15 @@ func _default_form(db) -> bool:
|
||||
|
||||
|
||||
# ①wr5(p5):两协作件违约经组装点接线传导 → orchestrator.battle_result 落 "fatal_error"
|
||||
# (棋盘生成半边:装板域拆件后生成器随 BoardInstaller 件内自建——组装点=引用束 fatal_cb 接线,
|
||||
# 经新组装点构建后触发生成器违约,封印传导断言不变)
|
||||
func _seal_propagation(db) -> bool:
|
||||
var rng_a = RngScript.new()
|
||||
rng_a.set_master_seed(5)
|
||||
var oc_bg = OrchestratorScript.new(db, rng_a)
|
||||
oc_bg._board_generator._fatal("测试违约①棋盘生成")
|
||||
var bi_bg = BoardInstallerScript.new({"db": db, "rng": rng_a, "minesweeper": oc_bg.minesweeper,
|
||||
"reward_economy": oc_bg._reward_economy, "encounter": oc_bg.encounter, "fatal_cb": oc_bg._fatal})
|
||||
bi_bg.generator._fatal("测试违约①棋盘生成")
|
||||
if oc_bg.battle_result != "fatal_error":
|
||||
push_error("[run_time_fatal_test/wr5] 棋盘生成违约未传导封印(battle_result=%s)" % str(oc_bg.battle_result))
|
||||
return false
|
||||
|
||||
Reference in new issue
Block a user