feat: 三选一刷新对齐商店(2026-10-06 用户令)——免费双源 X/Y 用尽后 GP 付费档(同 shop_refresh_* 旋钮/同冒险钱包 spend_gp 单口/同 reward_pick 池重抽),付费刷计数每停点清零;CurioPickOverlay.set_refresh_display 与商店同构(钮常驻选择态/两源皆穷禁用/角标免费余量/价签行 GP 价);通关停点刷新重发带 refreshed 标直落选择面不再重开胜利总结;店内门票专长三选一维持无刷新;单测 curio_refresh_paid_test+覆盖层刷新面断言;落文=秘宝.md 双源节 GP 付费档+冒险结构 v0.16+06 商店刷新条目换代(机制已落码态)
This commit is contained in:
1 parent
ced5fb75c3
commit
12807298eb
11 files changed
+185
-30
No files matched your search
@@ -75,6 +75,7 @@ var _treasure_unlocked := {} # aux 解锁门控集(迭代 7
|
||||
var _attunement: Array = [] # 同调装配集(迭代 11 第①批 T5——params.attunement 接收面,start_level 外下传 LevelRunner)
|
||||
var _attune_refresh_x := 0 # 刷新件余量(迭代 11 第①批 T5b P1 甲——每碰三选一重置=X 表值;优先消耗、不结转)
|
||||
var _attune_refresh_y := 0 # Y 冒险周期池(开局参数面注入,用完即无——营地升级行表值)
|
||||
var _curio_paid_refreshes := 0 # 本次停点已付费刷新次数(2026-10-06 用户令对齐商店 MC-1——GP 刷新价曲线输入,随停点创建清零=与商店进店清零同构)
|
||||
var attune_charges := {} # 同调主动件冒险充能账本(迭代 11 第①批 T6——跨关卡共享 dict;settlement use_treasure 扣减直改同引用;断点随 attunement_charges 键入档)
|
||||
var _save_manager = null # 断点承载注入(迭代 8 卡①——null = 不写断点;模拟/冒烟缺省)
|
||||
var _resume_bp := {} # 续玩快照暂存(resume_adventure → _start_current_level 单跳传递)
|
||||
@@ -569,6 +570,7 @@ func node_curio_candidates() -> Dictionary:
|
||||
|
||||
func present_node_curio(candidates: Array, treasure_detail: Array = []) -> void:
|
||||
_reset_refresh_x() # 迭代 11 第①批 T5b——碰三选一重置 X 余量(不结转)
|
||||
_curio_paid_refreshes = 0 # 付费刷计数随停点清零(对齐商店进店清零——2026-10-06)
|
||||
_node_curio_pending = {"candidates": candidates.duplicate(true), "aux_detail": treasure_detail.duplicate(true)}
|
||||
|
||||
|
||||
@@ -667,30 +669,53 @@ func node_curio_pending_state() -> Dictionary:
|
||||
}
|
||||
|
||||
|
||||
# 三选一刷新(组合根唯一调用口;无停点/无余量 false 零副作用)。通关停点重抽后重发
|
||||
# 三选一刷新(免费位 X/Y——组合根唯一调用口;无停点/无余量 false 零副作用)。通关停点重抽后重发
|
||||
# curio_choice_presented(呈现层重建卡片+刷新余量);节点停点由组合根读 node_curio_pending_state 重 present。
|
||||
func refresh_curio() -> bool:
|
||||
if _attune_refresh_x <= 0 and _attune_refresh_y <= 0:
|
||||
return _refresh_curio_common(false)
|
||||
|
||||
|
||||
# 三选一 GP 付费刷新(2026-10-06 用户令对齐商店 MC-1——免费位 X/Y 用尽后转付费,同旋钮同曲线同钱包;
|
||||
# 组合根先经 curio_stop_pending+钱包支出再调,本口只做计数与重抽)。池规则全保留——不放回/达上限剔牌/掷定前置直显。
|
||||
func refresh_curio_paid() -> bool:
|
||||
return _refresh_curio_common(true)
|
||||
|
||||
|
||||
# 本次 GP 付费刷新价(与商店货架刷新同源:ceil(基价 × 曲线^本次停点已付费刷)——读同两个调参旋钮,单点调参)
|
||||
func curio_refresh_gp_cost() -> int:
|
||||
return int(ceil(float(db.adventure.shop_refresh_cost_base)
|
||||
* pow(db.adventure.shop_refresh_cost_curve, float(_curio_paid_refreshes))))
|
||||
|
||||
|
||||
# 三选一停点在途谓词(付费路径扣费前置校验——无停点禁扣钱,防空转烧钱包)
|
||||
func curio_stop_pending() -> bool:
|
||||
return not _curio_pending.is_empty() or not _node_curio_pending.is_empty()
|
||||
|
||||
|
||||
func _refresh_curio_common(paid: bool) -> bool:
|
||||
if not curio_stop_pending():
|
||||
return false
|
||||
if not _curio_pending.is_empty():
|
||||
if paid:
|
||||
_curio_paid_refreshes += 1
|
||||
else:
|
||||
if _attune_refresh_x <= 0 and _attune_refresh_y <= 0:
|
||||
return false
|
||||
if _attune_refresh_x > 0:
|
||||
_attune_refresh_x -= 1
|
||||
else:
|
||||
_attune_refresh_y -= 1
|
||||
if not _curio_pending.is_empty():
|
||||
var cands: Array = _draw_curio_candidates("level_clear")
|
||||
_curio_pending["candidates"] = cands.duplicate(true)
|
||||
_curio_pending["aux_detail"] = _last_draw_treasure.duplicate()
|
||||
var payload: Dictionary = (_curio_pending.get("payload", {}) as Dictionary).duplicate(true)
|
||||
payload["candidates"] = cands
|
||||
payload["aux_detail"] = _last_draw_treasure.duplicate()
|
||||
payload["refreshed"] = true # 重发载荷带标——呈现层直落选择面,不再重开胜利总结面(2026-10-06)
|
||||
curio_choice_presented.emit(payload) # 同信号重 present(零自动推进契约不破——停点仍在途)
|
||||
_snapshot_breakpoint()
|
||||
return true
|
||||
if not _node_curio_pending.is_empty():
|
||||
if _attune_refresh_x > 0:
|
||||
_attune_refresh_x -= 1
|
||||
else:
|
||||
_attune_refresh_y -= 1
|
||||
var cands2: Array = _draw_curio_candidates("reward_node")
|
||||
_node_curio_pending["candidates"] = cands2.duplicate(true)
|
||||
_node_curio_pending["aux_detail"] = _last_draw_treasure.duplicate()
|
||||
@@ -954,6 +979,7 @@ func _on_level_finished(payload: Dictionary) -> void:
|
||||
# 置位先于 emit(信号同步派发——处理器内立即确认时 _pending_next_level 必须已就位)
|
||||
_pending_next_level = true
|
||||
_reset_refresh_x() # 迭代 11 第①批 T5b——碰三选一重置 X 余量(不结转)
|
||||
_curio_paid_refreshes = 0 # 付费刷计数随停点清零(对齐商店进店清零——2026-10-06)
|
||||
var pick_payload: Dictionary = {
|
||||
"level_index": level_index,
|
||||
"candidates": _draw_curio_candidates("level_clear"), # T4 渠道白名单——关底 Boss 击败=通关渠道只出专长
|
||||
|
||||
@@ -865,6 +865,14 @@ func shop_refresh() -> bool:
|
||||
return true
|
||||
|
||||
|
||||
# GP 冒险钱包单口支出(2026-10-06——三选一 GP 付费刷新与商店刷新共用同一钱包;余额不足 false 零副作用)
|
||||
func spend_gp(amount: int) -> bool:
|
||||
if amount <= 0 or gp < amount:
|
||||
return false
|
||||
gp -= amount
|
||||
return true
|
||||
|
||||
|
||||
# 购买(pool 模式唯一购买口):在架(kind→在架令牌)/余额前置校验零副作用 → handler 消费在架
|
||||
# 令牌本体(kind+tier——_apply_curio_pick 同口写加算区+账本+摘牌,跨渠道共库)→ 出账 → 进店购买
|
||||
# 次计数 → wallet 事件 → 三件全重抽(未买不保留——重抽绑购买,无独立刷新动作)
|
||||
|
||||
Reference in new issue
Block a user