From 0d8501dd3f58a543f77b53ba832a9318cf66b229 Mon Sep 17 00:00:00 2001 From: DKChan <524912269@qq.com> Date: Thu, 29 Oct 2026 07:47:43 +0800 Subject: [PATCH] =?UTF-8?q?=E8=BF=AD=E4=BB=A342-=E5=8D=A12-T1:=20=E5=95=86?= =?UTF-8?q?=E5=BA=97=E5=A7=94=E6=89=98=E5=A3=B3=E5=85=A8=E9=87=8F=E6=8B=86?= =?UTF-8?q?=E9=99=A4=E2=80=94=E2=80=9419=E4=B8=AA=E5=90=8C=E7=AD=BE?= =?UTF-8?q?=E5=90=8D=E5=A7=94=E6=89=98=E5=88=A0=E9=99=A4(=E5=90=AB?= =?UTF-8?q?=E6=AD=BB=E5=A3=B3=5Fspend=5Fdiscounted/pool=5Fstock=E4=B8=A4?= =?UTF-8?q?=E6=9E=9A)=EF=BC=8B=E5=8C=BA=E5=9D=97=E6=B3=A8=E9=87=8A?= =?UTF-8?q?=E6=B6=89=E5=A7=94=E6=89=98=E7=99=BD=E7=9B=92=E4=B8=A4=E5=8F=A5?= =?UTF-8?q?=E5=88=A0=E9=99=A4(:724-725,=E7=95=99723=E8=8A=82=E5=A4=B4?= =?UTF-8?q?=E5=B9=B6=E6=8D=A2=E4=BB=A3=E4=B8=BA=E7=9B=B4=E8=BF=9E=E8=A1=A8?= =?UTF-8?q?=E8=BF=B0);shop=5Fsession.gd:4=E5=A4=B4=E6=B3=A8=E6=8D=A2?= =?UTF-8?q?=E4=BB=A3=E3=80=8C=E5=A4=96=E9=83=A8=E8=B0=83=E7=94=A8=E9=9D=A2?= =?UTF-8?q?=3D=E8=B0=83=E7=94=A8=E6=96=B9=E7=BB=8F=E5=AE=BF=E4=B8=BBLevelR?= =?UTF-8?q?unner=E5=85=AC=E5=BC=80=E6=88=90=E5=91=98shop=E7=9B=B4=E8=BF=9E?= =?UTF-8?q?=E3=80=8D;=E6=AE=8B=E7=95=99=E6=89=AB=E6=8F=8F19=E6=96=B9?= =?UTF-8?q?=E6=B3=95=E5=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E5=8F=98?= =?UTF-8?q?=E9=87=8F30=E6=8C=81=E5=B9=B3=E3=80=82=E5=AE=9E=E7=8E=B0?= =?UTF-8?q?=E5=86=B3=E5=AE=9A=E8=AE=B0=E5=BD=95:=E5=8D=A1T1=E9=87=8C?= =?UTF-8?q?=E7=A8=8B=E7=A2=91=E5=87=BA=E5=8F=A3run=5Fall=5Fgates--code?= =?UTF-8?q?=E5=B9=B6=E5=85=A5=E8=BF=AD=E4=BB=A3=E6=80=BB=E6=94=B6=E5=8F=A3?= =?UTF-8?q?=E5=8D=95=E6=AC=A1=E5=85=A8=E9=87=8F=E9=97=B8(iter=E6=8A=80?= =?UTF-8?q?=E8=83=BD=E9=97=B8=E5=BA=8F=E5=88=97=E6=AF=8F=E8=BF=AD=E4=BB=A3?= =?UTF-8?q?=E4=B8=80=E6=AC=A1=E9=93=81=E5=BE=8B,=E9=97=B8=E5=90=8E?= =?UTF-8?q?=E4=BB=A3=E7=A0=81=E9=9D=A2=E5=86=BB=E7=BB=93=E5=89=8D=E4=B8=8D?= =?UTF-8?q?=E5=86=8D=E8=B7=91)=E2=80=94=E2=80=94=E9=97=B811=20PARITY?= =?UTF-8?q?=E8=A7=A6=E9=9D=A2NEED-APPROVAL=E5=B1=8A=E6=97=B6=E7=94=B1?= =?UTF-8?q?=E7=94=A8=E6=88=B7=E8=A3=81=E5=86=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- game/core/level_runner.gd | 84 +-------------------------------------- game/core/shop_session.gd | 2 +- 2 files changed, 3 insertions(+), 83 deletions(-) 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