更新复活补丁

This commit is contained in:
COMPUTER\EDY 2026-09-28 19:55:30 +08:00
parent 832daee12b
commit 9f613c20b1
3 changed files with 24 additions and 13 deletions

View File

@ -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();

View File

@ -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);

View File

@ -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();