diff --git a/game/core/level_runner.gd b/game/core/level_runner.gd index 3cc3817f..05d110d5 100644 --- a/game/core/level_runner.gd +++ b/game/core/level_runner.gd @@ -721,8 +721,8 @@ func close_wallet() -> void: # ---- 商店房兑付(GP+商店房实施批:呈现层只读投影 + 购买出账)---- -# 实装归 ShopSession 件(双模式货架/定价/购买/刷新唯一宿主);本类保留同签名委托与件注入/ -# 白盒入口——外部调用面与断点取数面零变化。 +# 实装归 ShopSession 件(双模式货架/定价/购买/刷新唯一宿主);外部调用面=调用方经宿主公开 +# 成员 shop 直连(调用直连不留委托壳——2026-10-26 Middle Man 裁定)。 # 件注入(建件与宿主引用换代时调用——钱包/主角账三件/图行/装配集为共享引用,出账直接落同一引用) func _bind_shop() -> void: @@ -746,83 +746,3 @@ func _emit_wallet_event(event: String, gp_now: int, extra: Dictionary) -> void: # 购血(商店 max_hp 商品——当前生命 +Δ 并封顶新上限,与账本置满/关卡完成回血同式) func _gain_max_hp_flat(flat: int) -> void: _stats.hero_hp = mini(_stats.hero_hp + flat, _stats.effective_max_hp()) - - -func shop_products() -> Array: - return shop.shop_products() - - -func current_price(prow: Dictionary) -> int: - return shop.current_price(prow) - - -func purchased_tier(product_id: String) -> int: - return shop.purchased_tier(product_id) - - -func buy_product(product_id: String) -> bool: - return shop.buy_product(product_id) - - -func player_request_refresh() -> bool: - return shop.player_request_refresh() - - -# 散折价单点(测试取数面沿用本类调用名) -func _spend_discounted(price: int) -> int: - return shop._spend_discounted(price) - - -# 注入(AdventureRunner._start_current_level 唯一调用方——pool 模式专用):令牌库共享引用 + -# 池消费 handler + 专长凭证判定 + cap 检查回调(cap 满 kind 剔出货架候选视图)。 -func set_shop_pool(deck_ref: Array, consume_handler: Callable, ticket_consider: Callable = Callable(), cap_check: Callable = Callable()) -> void: - shop.set_shop_pool(deck_ref, consume_handler, ticket_consider, cap_check) - - -# 货架抽签白盒入口(测试取数面沿用本类调用名) -func _shop_draw_shelf() -> void: - shop._draw_shelf() - - -func pool_stock(kind: String) -> int: - return shop.pool_stock(kind) - - -func pool_price(kind: String) -> int: - return shop.pool_price(kind) - - -func shop_shelf() -> Array: - return shop.shop_shelf() - - -func shop_refresh_free_left() -> int: - return shop.shop_refresh_free_left() - - -func shop_refresh_cost() -> int: - return shop.shop_refresh_cost() - - -func shop_refresh() -> bool: - return shop.shop_refresh() - - -func spend_gp(amount: int) -> bool: - return shop.spend_gp(amount) - - -func buy_pool_item(kind: String) -> bool: - return shop.buy_pool_item(kind) - - -func is_shop_pool() -> bool: - return shop.is_shop_pool() - - -func shop_bp_shelf() -> Array: - return shop.shop_bp_shelf() - - -func shop_bp_visit_buys() -> int: - return shop.shop_bp_visit_buys() diff --git a/game/core/shop_session.gd b/game/core/shop_session.gd index 531610d6..be90aa47 100644 --- a/game/core/shop_session.gd +++ b/game/core/shop_session.gd @@ -1,7 +1,7 @@ ## VERTICAL SLICE - NOT FOR PRODUCTION ## 商店会话件:关卡商店双模式(legacy 固定三件加定价/pool 共享令牌池)的货架、定价、购买与刷新唯一宿主。 ## 钱包/主角账/装配集归宿主(GpWallet/GainJournal 共享引用经 bind 注入——GP 读写走钱包、购买加算走日记单点); -## Core 层零 UI 依赖;公开面由 LevelRunner 同签名委托承载(外部调用面零变化); +## Core 层零 UI 依赖;外部调用面=调用方经宿主 LevelRunner 公开成员 shop 直连(调用直连不留委托壳); ## legacy 模式零 RNG 零池消费(off 对照承载)。 class_name ShopSession extends RefCounted