iter50-卡2:卡B(断言补齐): 四域13新断言+2处既有扩展——①增益结算链V1-V5 ②设置存储V6-V8 ⑤Boss门控V9/V10 ⑥锻造V11-V16; 新件settings_store_test与boss_gate_test; manifest+2; 73套件全绿

This commit is contained in:
DKChan committed 2026-11-03 06:31:05 +08:00
1 parent e658492703
commit cd133932f9
9 files changed
+329 -1

No files matched your search

@@ -29,6 +29,10 @@ func _init() -> void:
_test_status_grant_all_per_unit(db)
_test_status_death_clears(db)
_test_status_merge_per_unit(db)
_test_status_decay_and_clear(db)
_test_status_stack_full_reject(db)
_test_status_independent_branch(db)
_test_status_snapshot_first_grant(db)
quit(Kit.finish("system_contracts_test"))
@@ -209,3 +213,81 @@ func _test_status_merge_per_unit(db) -> void:
granted_n += 1
Kit.check("同体合并照旧:叠加行满层拒绝(恰授 max_stack=%d 层)〔个体化批 V4〕" % max_stack, granted_n == max_stack)
Kit.check("同体合并照旧:满层时异体仍受理(拒绝只在同体内原子)〔个体化批 V4〕", effects.apply_effect("enrage", "e3", src) == true)
# ---- B4 结算链契约(断言补齐批——①增益状态结算链):衰减逐值/战斗结束全清/满层拒绝/独立并存/首授快照 ----
func _test_status_decay_and_clear(db) -> void:
var effects = StatusContainerScript.new(db)
effects.notify_battle_start()
var src := {"source_class": "seal_hit", "origin_cell": Vector2i(-1, -1), "round_index": 0}
var wrow: Dictionary[Variant, Variant] = db.combat.status_effects.row_by_id("weaken")
var w_dur: int = int(wrow.duration_settlements)
Kit.check("V1 前置:weaken 时长 ≥2(两拍衰减观测面)", w_dur >= 2)
Kit.check("V1 前置:e1 受理", effects.apply_effect("weaken", "e1", src))
Kit.check("衰减逐值:首次 decay 返回移除数 0(未归零)〔断言补齐批 V1〕", effects.decay_round() == 0)
Kit.check("衰减逐值:每结算恰 −1(remaining=%d−1)〔断言补齐批 V1〕" % (w_dur - 1),
effects.query_active("e1").size() == 1 and int(effects.query_active("e1")[0].remaining_settlements) == w_dur - 1)
Kit.check("到期移除:第二次 decay 返回移除数 1〔断言补齐批 V2〕", effects.decay_round() == 1)
Kit.check("到期移除:归零实例当轮销毁(投影零行)〔断言补齐批 V2〕", effects.query_active("e1").is_empty())
effects.apply_effect("weaken", "e2", src)
effects.apply_effect("attack_up", StatusContainerScript.OWNER_HERO, src)
Kit.check("V2 前置:两桶各持实例", effects.query_active_side("enemy").size() == 1 and effects.query_active(StatusContainerScript.OWNER_HERO).size() == 1)
Kit.check("战斗结束全清:notify_battle_end 返回 true 且全实例清空(两桶零行)〔断言补齐批 V2〕",
effects.notify_battle_end() and effects.query_active_side("enemy").is_empty() and effects.query_active(StatusContainerScript.OWNER_HERO).is_empty())
func _test_status_stack_full_reject(db) -> void:
var effects = StatusContainerScript.new(db)
effects.notify_battle_start()
var src := {"source_class": "seal_hit", "origin_cell": Vector2i(-1, -1), "round_index": 0}
var erow: Dictionary[Variant, Variant] = db.combat.status_effects.row_by_id("enrage")
var max_stack: int = int(erow.max_stack)
for i in range(max_stack):
effects.apply_effect("enrage", "e1", src)
Kit.check("V3 前置:满层(恰 %d 层)" % max_stack,
effects.query_active("e1").size() == 1 and int(effects.query_active("e1")[0].layers) == max_stack)
var before_layers: int = int(effects.query_active("e1")[0].layers)
var before_rem: int = int(effects.query_active("e1")[0].remaining_settlements)
Kit.check("满层拒绝:再授返 false〔断言补齐批 V3〕", effects.apply_effect("enrage", "e1", src) == false)
Kit.check("满层拒绝:层数与剩余零写入(容器逐字不变——原子拒绝)〔断言补齐批 V3〕",
int(effects.query_active("e1")[0].layers) == before_layers and int(effects.query_active("e1")[0].remaining_settlements) == before_rem)
func _test_status_independent_branch(db) -> void:
var effects = StatusContainerScript.new(db)
effects.notify_battle_start()
var probe := {
"effect_id": "probe_independent_v4",
"display_name": "并存试验",
"target_side": "enemy",
"magnitude": 7,
"unit": "flat",
"duration_settlements": 2,
"stack_policy": "independent",
"max_stack": 1,
}
db.combat.status_effects.rows.append(probe) # 直改已加载表(运行时注入试验行——并存分支零内容行,夹具面)
var src := {"source_class": "seal_hit", "origin_cell": Vector2i(-1, -1), "round_index": 0}
Kit.check("independent 并存:第一次授予受理〔断言补齐批 V4〕", effects.apply_effect("probe_independent_v4", "e1", src))
Kit.check("independent 并存:第二次授予受理(并存——无合并无满层语义)〔断言补齐批 V4〕", effects.apply_effect("probe_independent_v4", "e1", src))
var both: Array = effects.query_active("e1")
Kit.check("independent 并存:两实例各持时长 2 独立倒数〔断言补齐批 V4〕",
both.size() == 2 and int(both[0].remaining_settlements) == 2 and int(both[1].remaining_settlements) == 2)
db.combat.status_effects.rows.pop_back() # 测毕还原(表行零残留)
Kit.check("independent 试验行测毕还原(row_by_id 零命中)", db.combat.status_effects.row_by_id("probe_independent_v4").is_empty())
func _test_status_snapshot_first_grant(db) -> void:
var effects = StatusContainerScript.new(db)
effects.notify_battle_start()
var src_first := {"source_class": "seal_hit", "origin_cell": Vector2i(3, 4), "round_index": 1}
var src_second := {"source_class": "mine_hit", "origin_cell": Vector2i(8, 9), "round_index": 5}
effects.apply_effect("weaken", "e1", src_first)
effects.apply_effect("weaken", "e1", src_second) # 累加:时长加、归因与快照沿首授
var inst: Array = effects.query_active("e1")
Kit.check("首授快照:累加合并仍单实例〔断言补齐批 V5〕", inst.size() == 1)
Kit.check("首授快照:origin_cell/round_index/source_class 沿首授(合并实例只持首授归因)〔断言补齐批 V5〕",
String(inst[0].source_class) == "seal_hit" and inst[0].origin_cell == Vector2i(3, 4) and int(inst[0].round_index) == 1)
Kit.check("首授快照:幅度快照 = 首授时表值(抗热重载域)〔断言补齐批 V5〕",
int(inst[0].snap_magnitude) == int(db.combat.status_effects.row_by_id("weaken").magnitude))