T2(迭代22秘宝批): 核心层解锁服务换代+槽位档位约束——工坊渠道面退役(_workshop_progress/workshop_status/refresh_workshop_unlocks/meta_workshop_items/WORKSHOP_ITEM_IDS/workshop_items行族全删)换解锁混合制(buy_treasure_unlock钥石购买=余额闸+重复购拒+条件件误购拒/refresh_treasure_unlocks条件刷新=AND谓词+幂等/treasure_shop_status柜台投影); 计数读数单点_treasure_unlock_progress(adventure_cleared/boss_kill_count/vision_used); save_manager新增vision_used生涯计数域(add_vision_used收束入账+缺键补零不升版本); toggle_attunement三重校验(未解锁拒+满位禁选+件档rank≤装入位序档位格——卸下恒可效果面只读装配集); pause/camp两视图秘宝匣呈现换代+UiKit计数键与档位标签单点; smoke工坊段换V3/V4/V5断言(独立档[11]防路径污染)+meta表段行族规模换代3/3/2。冒烟895/0+单元21套+探针全绿〔秘宝批 V3/V4/V5/V14/V19数据源〕
This commit is contained in:
1 parent
48b0696158
commit
a7bd4e4132
13 files changed
+235
-194
No files matched your search
@@ -360,8 +360,8 @@ func meta_boss_keystone_row(level_index: int) -> Dictionary:
|
||||
return {}
|
||||
|
||||
|
||||
func meta_workshop_items() -> Array:
|
||||
return _meta_rows("workshop_items")
|
||||
# meta_workshop_items 访问器已删除(迭代 22 T2——工坊行族退役,解锁混合制挂 treasure_items 行内;
|
||||
# 秘宝解锁投影面=MetaProgression.treasure_shop_status)
|
||||
|
||||
|
||||
func meta_conversion_row(attr: String) -> Dictionary:
|
||||
|
||||
@@ -29,59 +29,64 @@ func keystone_balance() -> int:
|
||||
return save.keystone_balance()
|
||||
|
||||
|
||||
# ---- 道具工坊(首版全走通关次数渠道——钥石直购价随定价批后补,最终双渠道并存)----
|
||||
# ---- 秘宝解锁服务(迭代 22 T2 换代——解锁混合制,契约 6;旧工坊渠道面随批删除)----
|
||||
# 〔属性锻造柜台退役——迭代 21 T4/T5:buy_forge/forge_flat/forge_level/forge_price 与 meta_forge
|
||||
# 表族随攻防所有权切分删除;生命唯一入口=树脊柱淬炼、攻/AC 唯一入口=锻造工坊路线(契约 9);
|
||||
# 注入面 hero_override 换树淬炼 flat+锻造路线加值位(预留 0)公式。〕
|
||||
|
||||
# 解锁判定量单点(可替换轴——2026-09-21 用户拍板:解锁条件须抽象、可替换、可扩展,禁与渠道实现耦合)。
|
||||
# 契约:渠道由 meta.tres workshop_items.channel 声明(缺省 total_clears,词表 MetaTable.WORKSHOP_CHANNELS
|
||||
# 封闭);本方法是渠道 → 判定数值的唯一换算点——换/加渠道 = 词表加值 + 此处增一 match 分支,
|
||||
# 阈值比较(refresh/workshop_status)与解锁写档零改动。候选渠道(语义已预留未实现):
|
||||
# adventure_depth 最高通关深度 / keystone 钥石直购双渠道。
|
||||
func _workshop_progress(channel: String) -> int:
|
||||
match channel:
|
||||
"total_clears":
|
||||
var total := 0
|
||||
for i in db.level_count(): # 表访问收口(2026-10-02——行集直扫退役)
|
||||
total += save.clear_count(i + 1)
|
||||
return total
|
||||
_:
|
||||
return 0 # 未知渠道恒 0 = 永不解锁(fail-safe 非致命——渠道词表校验兜底,不静默误解锁)
|
||||
|
||||
# 表族随攻防所有权切分删除。〕〔道具工坊解锁渠道面退役——迭代 22 T2:旧「总通关次数达阈值」
|
||||
# 行族与 _workshop_progress/workshop_status/refresh_workshop_unlocks 删除,解锁条件单一事实源=
|
||||
# treasure_items.tres 行内 unlock_keystone_cost/unlock_requires 谓词(C1 逐件分配锁定表)。〕
|
||||
|
||||
# 道具解锁读数访问器(组合根/呈现层解锁门控查询面——禁再穿透 meta.save 直读 save_manager)
|
||||
func is_item_unlocked(item_id: String) -> bool:
|
||||
return save.item_unlocked(item_id)
|
||||
|
||||
|
||||
# 工坊六行只读投影(呈现层数据源):{item_id, display_name, threshold, unlocked, progress}
|
||||
func workshop_status() -> Array:
|
||||
var out: Array[Dictionary] = []
|
||||
for row in db.meta_workshop_items():
|
||||
var iid := String(row.get("item_id", ""))
|
||||
var arow: Dictionary = db.treasure_item_row(iid) # 迭代 7 T5——失义/退役状态面(呈现「能力封存/已退役」)
|
||||
out.append({
|
||||
"item_id": iid,
|
||||
"display_name": String(row.get("display_name", "")),
|
||||
"threshold": int(row.get("clear_threshold", 0)),
|
||||
"unlocked": save.item_unlocked(iid),
|
||||
"progress": _workshop_progress(String(row.get("channel", "total_clears"))),
|
||||
"deferred": bool(arow.get("deferred", false)),
|
||||
"retired": bool(arow.get("retired", false)),
|
||||
})
|
||||
return out
|
||||
# 解锁条件计数读数单点(谓词 key → 生涯计数——封闭枚举=TreasureItemTable.UNLOCK_COUNTER_KEYS;
|
||||
# 词表加键 = 此处增一 match 分支,阈值比较与解锁写档零改动)
|
||||
func _treasure_unlock_progress(key: String) -> int:
|
||||
match key:
|
||||
"adventure_cleared":
|
||||
return save.adventure_cleared()
|
||||
"boss_kill_count":
|
||||
return save.boss_kill_count()
|
||||
"vision_used":
|
||||
return save.vision_used()
|
||||
_:
|
||||
return 0 # 未知计数键恒 0 = 永不解锁(fail-safe 非致命——schema 词表校验兜底,不静默误解锁)
|
||||
|
||||
|
||||
# 达标未解锁 → unlock_item + 写盘;返回新解锁 item_id 列(冒险收束后与营地打开时各调一次)
|
||||
func refresh_workshop_unlocks() -> Array:
|
||||
# 钥石购买解锁(营地秘宝匣唯一购买写口):仅购买件(行带 unlock_keystone_cost)可购;
|
||||
# 已解锁/余额不足/条件件误购 = 拒绝且零副作用(spend_keystone 内嵌余额闸,失败不扣币)。
|
||||
func buy_treasure_unlock(item_id: String) -> bool:
|
||||
var arow: Dictionary = db.treasure_item_row(item_id)
|
||||
var price := int(arow.get("unlock_keystone_cost", 0))
|
||||
if arow.is_empty() or price < 1 or (arow.get("unlock_requires", []) as Array).size() > 0:
|
||||
return false # 非购买件(条件件/无价行)拒绝
|
||||
if save.item_unlocked(item_id):
|
||||
return false # 已解锁重复购买拒绝
|
||||
if not save.spend_keystone(price):
|
||||
return false # 余额不足(零副作用)
|
||||
save.unlock_item(item_id)
|
||||
return save.write_to_disk()
|
||||
|
||||
|
||||
# 条件解锁刷新(达标未解锁 → unlock_item;返回新解锁 item_id 列——冒险收束后与营地打开时各调一次)。
|
||||
# 全部谓词达标才解锁(多谓词=AND——天眼双条件);幂等:已解锁跳过,重复刷新零重复入账。
|
||||
func refresh_treasure_unlocks() -> Array:
|
||||
var new_unlocks: Array[String] = []
|
||||
for row in db.meta_workshop_items():
|
||||
for row in db.treasure_attunement_rows():
|
||||
var iid := String(row.get("item_id", ""))
|
||||
if save.item_unlocked(iid):
|
||||
continue
|
||||
var progress := _workshop_progress(String(row.get("channel", "total_clears")))
|
||||
if progress >= int(row.get("clear_threshold", 99)):
|
||||
var ureqs: Array = row.get("unlock_requires", []) as Array
|
||||
if ureqs.is_empty():
|
||||
continue # 购买件不入条件刷新面
|
||||
var met := true
|
||||
for req_v in ureqs:
|
||||
var req: Dictionary = req_v as Dictionary
|
||||
if _treasure_unlock_progress(String(req.get("key", ""))) < int(req.get("threshold", 999)):
|
||||
met = false
|
||||
break
|
||||
if met:
|
||||
save.unlock_item(iid)
|
||||
new_unlocks.append(iid)
|
||||
if not new_unlocks.is_empty():
|
||||
@@ -89,6 +94,35 @@ func refresh_workshop_unlocks() -> Array:
|
||||
return new_unlocks
|
||||
|
||||
|
||||
# 秘宝匣柜台只读投影(呈现层数据源——12 件逐行解锁态/价格/条件进度):
|
||||
# {item_id, display_name, desc, tier, unlocked, mode(keystone|condition|owned), price, reqs:[{key,threshold,progress}]}
|
||||
func treasure_shop_status() -> Array:
|
||||
var out: Array[Dictionary] = []
|
||||
for row in db.treasure_attunement_rows():
|
||||
var iid := String(row.get("item_id", ""))
|
||||
var unlocked := save.item_unlocked(iid)
|
||||
var ureqs: Array = row.get("unlock_requires", []) as Array
|
||||
var req_view: Array = []
|
||||
for req_v in ureqs:
|
||||
var req: Dictionary = req_v as Dictionary
|
||||
req_view.append({
|
||||
"key": String(req.get("key", "")),
|
||||
"threshold": int(req.get("threshold", 0)),
|
||||
"progress": _treasure_unlock_progress(String(req.get("key", ""))),
|
||||
})
|
||||
out.append({
|
||||
"item_id": iid,
|
||||
"display_name": String(row.get("display_name", "")),
|
||||
"desc": String(row.get("desc", "")),
|
||||
"tier": String(row.get("tier", "")),
|
||||
"unlocked": unlocked,
|
||||
"mode": "owned" if unlocked else ("condition" if ureqs.size() > 0 else "keystone"),
|
||||
"price": int(row.get("unlock_keystone_cost", 0)),
|
||||
"reqs": req_view,
|
||||
})
|
||||
return out
|
||||
|
||||
|
||||
# ---- Boss 两档与收束入账(结算屏文案数据源)----
|
||||
# 明细 {big_reward, boss_drops, total, new_unlocks};入账与标记经 save.apply_adventure_summary
|
||||
# (keystone_drops 副本随摘要入 recent_summaries)。
|
||||
@@ -100,7 +134,7 @@ func settle_adventure(summary: Dictionary) -> Dictionary:
|
||||
save.mark_first_adventure_done()
|
||||
var drops: Array = (summary.get("keystone_drops", []) as Array).duplicate(true)
|
||||
save.apply_adventure_summary(summary, drops)
|
||||
var new_unlocks := refresh_workshop_unlocks()
|
||||
var new_unlocks := refresh_treasure_unlocks() # 迭代 22 T2——条件解锁刷新换代(旧工坊面退役)
|
||||
save.write_to_disk()
|
||||
var total := int(summary.get("keystone_total", 0))
|
||||
return {
|
||||
@@ -297,16 +331,24 @@ func _check_easter_egg() -> void:
|
||||
|
||||
# ---- 同调位账本(迭代 11 第①批 T4——装配关系/同调位求值/Y 刷新升级;设计权威 proposal §2 + 需求卡片 P1 甲)----
|
||||
|
||||
# 装配切换(营地装配覆盖层唯一写口):已装 → 卸下恒可;未装 → 非同调行拒绝 + 满位禁选;
|
||||
# 装配关系写存档持久(冒险中途不可换装——底稿 §8.5,本口只服务营地)。
|
||||
# 装配切换(营地装配覆盖层唯一写口——冒险开始前配置;冒险中零写口=装配不可变契约 1,本口只服务营地):
|
||||
# 已装 → 卸下恒可(卸下后其余件前移位序——效果面只读装配集不受格位影响);未装 → 非同调行拒绝 +
|
||||
# 满位禁选 + 档位格校验(迭代 22 T2 契约 2:装入件 append 至末位 k=已装数+1,件档 rank ≤ k——
|
||||
# 格 1=普通格/格 2=优秀格/格 3=稀有格递增向下兼容;槽位来源=树同调位节点点亮数,树接口接缝现役)。
|
||||
# 装配关系写存档持久。
|
||||
func toggle_attunement(item_id: String) -> bool:
|
||||
var equipped: Array = save.attunement_equipped()
|
||||
if not equipped.has(item_id):
|
||||
var arow: Dictionary = db.treasure_item_row(item_id)
|
||||
if arow.is_empty() or String(arow.get("form", "")) == "":
|
||||
return false # 非同调行(过渡/退役行)禁装配
|
||||
if not save.item_unlocked(item_id):
|
||||
return false # 未解锁禁装配(解锁混合制契约 6——装配以解锁为前置)
|
||||
if equipped.size() >= Attunement.slots(db, save):
|
||||
return false # 满位禁选
|
||||
var rank: int = int(db.treasure_items.TIER_RANK.get(String(arow.get("tier", "")), 99))
|
||||
if rank > equipped.size() + 1:
|
||||
return false # 件档高于将占格档(第 k 格档=k——普通/优秀/稀有递增)
|
||||
equipped.append(item_id)
|
||||
else:
|
||||
equipped.erase(item_id)
|
||||
@@ -323,8 +365,11 @@ func attune_camp_status() -> Dictionary:
|
||||
items.append({
|
||||
"item_id": iid,
|
||||
"display_name": String(row.get("display_name", "")),
|
||||
"desc": String(row.get("desc", "")),
|
||||
"tier": String(row.get("tier", "")),
|
||||
"form": String(row.get("form", "")),
|
||||
"equipped": equipped.has(iid),
|
||||
"unlocked": save.item_unlocked(iid),
|
||||
})
|
||||
var lvl := save.attune_refresh_level()
|
||||
var next_row: Dictionary = db.meta_attune_refresh_row(lvl + 1)
|
||||
|
||||
@@ -134,6 +134,8 @@ func _default_data() -> Dictionary[String, Variant]:
|
||||
"first_adventure_done": false,
|
||||
"adventure_total": 0, # 生涯终身计数·冒险总局数(迭代 18 卡④——开局即计含放弃与失败,收束唯一入账)
|
||||
"adventure_cleared": 0, # 生涯终身计数·通关局数(三关全通才计 1——判定字段 summary.cleared)
|
||||
"vision_used": 0, # 生涯终身计数·真视类工具累计使用次数(迭代 22 T2——信标网络解锁行为条件;
|
||||
# 受理成功唯一计数点=battle 层经冒险层聚合、收束入账;缺键补零不升版本——迭代 21 先例)
|
||||
},
|
||||
"breakpoint": {}, # 冒险断点快照(空 = 无断点合法态——「继续上局」隐藏;迭代 8 卡①)
|
||||
}
|
||||
@@ -272,6 +274,16 @@ func adventure_cleared() -> int:
|
||||
return int(_data["meta"].get("adventure_cleared", 0))
|
||||
|
||||
|
||||
# 真视类工具累计使用次数(迭代 22 T2——信标网络解锁行为条件;写入唯一经 add_vision_used
|
||||
# 冒险收束聚合入账,受理计数点=battle 层经冒险层聚合)
|
||||
func vision_used() -> int:
|
||||
return int(_data["meta"].get("vision_used", 0))
|
||||
|
||||
|
||||
func add_vision_used(n: int) -> void:
|
||||
_data["meta"]["vision_used"] = maxi(0, vision_used() + maxi(0, n))
|
||||
|
||||
|
||||
# ---- 天赋树域(迭代 12 T9——MetaProgression 树段读写面)----
|
||||
|
||||
func tree_nodes() -> Dictionary:
|
||||
|
||||
Reference in new issue
Block a user