merge: M-3迭代7魔法道具内容+元进度数值标定 T0-T8全落——AuxItemTable六行+掉落投放(解锁门控空集零投放)+库存四步受理+三选一奖励节点+HUD两步交互+叠加层呈现+工坊封存呈现+换算率复核读数(6/9/1 vs 实测1.7/4.1/0.0 U1呈报);重闸全绿(冒烟577/0+五探针+单测12套+doc三闸熵增零新增+机检11/11+MC剥additive 0/400逐位);出口=T9目检(检查单已交);台账259-263

# Conflicts:
#	game/presentation/views/node_overlay.gd
This commit is contained in:
DKChan committed 2026-09-29 08:59:31 +08:00
commit fd39a58aee
35 files changed
+1990 -19

No files matched your search

+28 -1
View File
@@ -62,6 +62,9 @@ var base_override := {"atk": 0, "max_hp": 0, "armor_class": 0} # 永久强化
var _shop_purchased := {} # product_id → 已购档数(现价重算输入;冒险开始清零)
# 协作对象私有(E1/E3 封装收口 2026-09-13):settlement 读取经 current_battle() 成文出口
var _settlement = null # 当前战斗编排器(关卡结束置 null)
var aux_inventory = null # 魔法道具 关卡域库存(迭代 7 T3——AuxItems;跨战斗延续,
var _aux_unlocked := {} # aux 解锁门控集(迭代 7 T5——拍板③甲;空集=零投放)
# 关卡末清空+快照计数入 level_finished 载荷)
var hero_atk_pct := 0 # 测试面板覆盖值(切片专用)
var hero_hp_pct := 0
@@ -364,6 +367,11 @@ func _enter_node(node: Dictionary) -> bool:
func _start_battle(node: Dictionary) -> bool:
_settlement = BattleOrchestrator.new(db, rng)
if aux_inventory == null:
aux_inventory = AuxItems.new(db) # 惰性建——关卡域单实例(跨战斗延续)
_settlement.aux_inventory = aux_inventory # 迭代 7 T3——库存注入(授予路由+use_aux 编排消费面)
if _settlement != null:
_settlement.set_aux_unlocked(_aux_unlocked) # 迭代 7 T5——解锁门控下传(装板摇号前)
# core↔core 接线只许方法 Callable(ADR-0001 静态规则 S6——lambda 捕获 self 会延长
# RefCounted 生命周期乃至成环:settlement 的信号持捕获 runner 的 lambda,runner 又持 settlement)
_settlement.step_row.connect(_forward_step_row)
@@ -408,8 +416,13 @@ func _on_battle_finished(payload: Dictionary) -> void:
close_wallet() # 单关模式:关卡收束即冒险收束(GP 清零);冒险模式归 AdventureRunner._settle
_running = false
_settlement = null
var aux_cleared := 0
if aux_inventory != null:
aux_cleared = aux_inventory.inventory_count() # 快照计数(清空前——「剩余道具随关卡结束清空」可见反馈取数)
aux_inventory.reset() # 迭代 7 T3——关卡末库存清空(无论输赢,幂等)
level_finished.emit({"result": level_result, "hp": hp_left, "node_index": node_index,
"node_id": _node_id(node), "node_type": String(node.get("type", ""))})
"node_id": _node_id(node), "node_type": String(node.get("type", "")),
"aux_cleared": aux_cleared}) # additive 扩签(不参与派生——node_map 扩签先例)
return
# 接口漂移清偿(关卡节点地图 v1.0 ⑦):战斗胜利不再自动推进——确认后进选路口
_settlement = null
@@ -462,6 +475,20 @@ func pick_next_node(node_id: int) -> bool:
func current_battle():
return _settlement
# aux 解锁门控集注入(迭代 7 T5——AdventureRunner 自 params 传递)
func set_aux_unlocked(ids: Dictionary) -> void:
_aux_unlocked = ids
if _settlement != null:
_settlement.set_aux_unlocked(ids)
# 奖励节点兑付透传(迭代 7 T5——呈现层三选一 → 关卡域库存;来源归因 reward_node)
func grant_aux_item(item_id: String, source: String) -> Dictionary:
if aux_inventory == null:
aux_inventory = AuxItems.new(db)
return aux_inventory.add_item(item_id, source, Vector2i(-1, -1), 0)
return _settlement
# ---- 玩家输入转发(呈现层只与 runner 对话)----