From 9f613c20b13e32fe42f2e76a52ec586ce57c73cd Mon Sep 17 00:00:00 2001 From: "COMPUTER\\EDY" <249929363@qq.com> Date: Mon, 28 Sep 2026 19:55:30 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E5=A4=8D=E6=B4=BB=E8=A1=A5?= =?UTF-8?q?=E4=B8=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- assets/Script/Map.ts | 13 +++++++++---- assets/Script/Revive.ts | 19 ++++++++++++------- assets/Script/module/Tool/GameTool.ts | 5 +++-- 3 files changed, 24 insertions(+), 13 deletions(-) diff --git a/assets/Script/Map.ts b/assets/Script/Map.ts index 3e7ad3c..26a5b79 100644 --- a/assets/Script/Map.ts +++ b/assets/Script/Map.ts @@ -5427,7 +5427,6 @@ export default class MapConroler extends cc.Component { runRewiveCopy() { if (!this.isMapRuntimeAlive()) return; this.isreview = true; - MiniGameSdk.API.showToast("继续游戏"); this.gameOver = false; this.gameWin = false; if (this.iceTrue() == false && !this.isPauseOpen() && !this.shopPause) { @@ -5435,9 +5434,6 @@ export default class MapConroler extends cc.Component { } this.timeNumber = 31; this.add_Time += 30; - NumberToImage.getTimeMargi3(30, 45, "company_", this.timeLabel) - this.blockNum = this.blocks.length; - if (this.canCompleteLevel()) this.nextLevel(1); this.releaseLosePanel(); setTimeout(() => { if (!this.isMapRuntimeAlive()) return; @@ -5446,6 +5442,15 @@ export default class MapConroler extends cc.Component { this.stopTimeCutDown(); } + // 展示与胜利检查保留在礼包发奖收尾,避免阻断复活或提前触发结算。 + finishRewiveCopy() { + if (!this.isMapRuntimeAlive()) return; + MiniGameSdk.API.showToast("继续游戏"); + NumberToImage.getTimeMargi3(30, 45, "company_", this.timeLabel) + this.blockNum = this.blocks.length; + if (this.canCompleteLevel()) this.nextLevel(1); + } + //上传数数游戏完成事件 可成功可失败 trackFinishi(name, customEventData) { let overTime = Date.now(); diff --git a/assets/Script/Revive.ts b/assets/Script/Revive.ts index cb3a179..e40e5af 100644 --- a/assets/Script/Revive.ts +++ b/assets/Script/Revive.ts @@ -140,12 +140,18 @@ export default class Revive extends cc.Component { if (uid !== cc.fx.GameConfig.GM_INFO.uid || !order || !/^reborn_Gift(?:_[2-5])?$/.test(productId)) return; const currentRun = purchaseMap && cc.isValid(purchaseMap, true) && MapConroler._instance === purchaseMap; if (currentRun) purchaseMap.recordRebornGiftPurchase(order); - if (cc.fx.GameTool.shopBuy(productId, false, { outTradeNo: order }) === false) return; + if (cc.fx.GameTool.shopBuy(productId, false, { + outTradeNo: order, + onRebornGiftGranted: () => { + // 旧局订单仍发奖励,但不能复活新局。 + if (currentRun) { + cc.fx.GameConfig.GM_INFO.revive = 0; + purchaseMap.runRewiveCopy(); + } + }, + }) === false) return; this.buyGift(); - // 旧局订单仍发奖励,但不能复活新局或提高新局的礼包价格。 - if (currentRun) { - this.revivew(purchaseMap); - } + if (currentRun) this.revivew(purchaseMap); } addListener() { @@ -174,7 +180,6 @@ export default class Revive extends cc.Component { } //发奖励 revivew(map: MapConroler) { - cc.fx.GameConfig.GM_INFO.revive = 0; if (map) map.setPropNum(); const jiazaiNode = cc.find("Canvas"); // 假设 JiaZai 挂在 Canvas 节点 const jiazaiComp = jiazaiNode && jiazaiNode.getComponent(JiaZai); @@ -197,7 +202,7 @@ export default class Revive extends cc.Component { this.node.active = false; } }, 200); - if (map && cc.isValid(map)) map.runRewiveCopy(); + if (map && cc.isValid(map)) map.finishRewiveCopy(); } buyProduct(customData) { // cc.fx.GameTool.shopBuy("revive", false); diff --git a/assets/Script/module/Tool/GameTool.ts b/assets/Script/module/Tool/GameTool.ts index 313ec49..686017e 100644 --- a/assets/Script/module/Tool/GameTool.ts +++ b/assets/Script/module/Tool/GameTool.ts @@ -576,8 +576,8 @@ var GameTool = { // MiniGameSdk.API.showToast(data); } else { - // let data = "消耗" + (-coin) + "金币"; - // MiniGameSdk.API.showToast(data); + let data = "消耗" + (-coin) + "金币"; + MiniGameSdk.API.showToast(data); } if (cc.fx.GameConfig.GM_INFO.coin < 0) { cc.fx.GameConfig.GM_INFO.coin = 0; @@ -1258,6 +1258,7 @@ var GameTool = { } this.getShopProp(propData3, compensate); if (rebornOrderKey) cc.fx.StorageMessage.setStorage(rebornOrderKey, true); + if (orderContext?.onRebornGiftGranted) orderContext.onRebornGiftGranted(); break; case "starter_pack": { const reward = starterPackReward();