diff --git a/assets/Scene/GameScene.fire b/assets/Scene/GameScene.fire index e286949..0883460 100644 --- a/assets/Scene/GameScene.fire +++ b/assets/Scene/GameScene.fire @@ -16642,7 +16642,7 @@ "__id__": 416 } ], - "_active": true, + "_active": false, "_components": [], "_prefab": null, "_opacity": 255, diff --git a/assets/Script/Block.ts b/assets/Script/Block.ts index 55617ed..b3ffa91 100644 --- a/assets/Script/Block.ts +++ b/assets/Script/Block.ts @@ -604,7 +604,7 @@ export default class Block extends cc.Component { this.node.active = false; this.node.removeFromParent(); setTimeout(() => { - if (type == true && MapConroler._instance.openWall.length > 0 + if (MapConroler._instance.blockNum != 0 && type == true && MapConroler._instance.openWall.length > 0 && !MapConroler._instance.gameOver && MapConroler._instance.gameWin) { let gameover = MapConroler._instance.predict_End(); if (gameover == false) { @@ -937,7 +937,15 @@ export default class Block extends cc.Component { MapConroler._instance.nextLevel(); this.node.active = false; this.node.removeFromParent(); - console.log("222") + setTimeout(() => { + if (MapConroler._instance.blockNum != 0 && MapConroler._instance.openWall.length > 0 + && !MapConroler._instance.gameOver && MapConroler._instance.gameWin) { + let gameover = MapConroler._instance.predict_End(); + if (gameover == false) { + MapConroler._instance.failLevel("lock"); + } + } + }, 500); //如果是锤子状态消除 MapConroler._instance.ishammer = false; MapConroler._instance.ismagic = false; diff --git a/assets/Script/JiaZai.ts b/assets/Script/JiaZai.ts index 2d5e9a2..5516b46 100644 --- a/assets/Script/JiaZai.ts +++ b/assets/Script/JiaZai.ts @@ -201,7 +201,7 @@ export default class JiaZai extends cc.Component { // this.openHeath(); this.uploadToCloud(cc.fx.GameConfig.GM_INFO.level + 1); this.rewarded(); - + this.getMonthlyCardValidityDays(); Utils.getMonthlyCard((data) => { if (data.code == 1) { cc.fx.GameConfig.GM_INFO.hp_Max = 7; @@ -769,7 +769,7 @@ export default class JiaZai extends cc.Component { } else { this.monthCardBtn.active = false; this.monthCardBtn2.active = true; - NumberToImage.numberToImageNodes(25, 35, 20, "month_", this.monthCardTime, true); + NumberToImage.numberToImageNodes(cc.fx.GameConfig.GM_INFO.monthTime, 35, 20, "month_", this.monthCardTime, true); } }) this.monthCard.active = false; @@ -798,7 +798,7 @@ export default class JiaZai extends cc.Component { }) this.monthCardBtn.active = false; this.monthCardBtn2.active = true; - NumberToImage.numberToImageNodes(25, 35, 20, "month_", this.monthCardTime, true); + NumberToImage.numberToImageNodes(cc.fx.GameConfig.GM_INFO.monthTime, 35, 20, "month_", this.monthCardTime, true); } }) @@ -872,16 +872,22 @@ export default class JiaZai extends cc.Component { } //获取月卡有效期距离今天的天数 - getMonthlyCardValidityDays() { - let nowTime = Math.floor(Date.now() / 1000); - let validityTime = 0; + //获取月卡有效期距离今天的天数 + getMonthlyCardValidityDays(callback) { + const nowTime = Date.now(); // 毫秒 Utils.getMonthlyCard((data) => { - if (data.code == 1) { - validityTime = data.monthCardTime; + if (data.code === 1) { + const validityTime = data.data.monthCardTime; // 毫秒 + const diffMs = validityTime - nowTime; + const days = Math.floor(diffMs / 86400000); + cc.fx.GameConfig.GM_INFO.monthTime = days; + console.log('剩余天数', days); + + callback(days); // 把结果通过回调返回 + } else { + callback(0); // 失败时返回 0 } - }) - let days = Math.floor((validityTime - nowTime) / (24 * 60 * 60)); - return days; + }); } // update (dt) {} diff --git a/assets/Script/Map.ts b/assets/Script/Map.ts index f742d67..818a1c7 100644 --- a/assets/Script/Map.ts +++ b/assets/Script/Map.ts @@ -1751,6 +1751,7 @@ export default class MapConroler extends cc.Component { }); } } + returnHome() { cc.fx.AudioManager._instance.playEffect("anniu_Big", null); if (MapConroler._instance = null) { @@ -1810,6 +1811,9 @@ export default class MapConroler extends cc.Component { this.node.parent.parent.getChildByName("Lose").getChildByName("Boom").active = false; if (type) { if (type == "time") { + this.node.parent.parent.getChildByName("Lose").getChildByName("Time").active = true; + this.node.parent.parent.getChildByName("Lose").getChildByName("Boom").active = false; + this.node.parent.parent.getChildByName("Lose").getChildByName("Lock").active = false; let buyBtn = this.node.parent.parent.getChildByName("Lose").getChildByName("Time").getChildByName("buyBtn"); buyBtn.getChildByName("coin1").active = buyBtn.getChildByName("coin2").active = buyBtn.getChildByName("coin3").active = false; if (cc.fx.GameConfig.GM_INFO.review == 0) buyBtn.getChildByName("coin1").active = true; @@ -1819,6 +1823,7 @@ export default class MapConroler extends cc.Component { else if (type == "boom") { this.node.parent.parent.getChildByName("Lose").getChildByName("Time").active = false; this.node.parent.parent.getChildByName("Lose").getChildByName("Boom").active = true; + this.node.parent.parent.getChildByName("Lose").getChildByName("Lock").active = false; let buyBtn = this.node.parent.parent.getChildByName("Lose").getChildByName("Boom").getChildByName("buyBtn"); buyBtn.getChildByName("coin1").active = buyBtn.getChildByName("coin2").active = buyBtn.getChildByName("coin3").active = false; if (cc.fx.GameConfig.GM_INFO.reviewBoom == 0) buyBtn.getChildByName("coin1").active = true; diff --git a/assets/Script/module/Config/GameConfig.ts b/assets/Script/module/Config/GameConfig.ts index 8fb6588..0582579 100644 --- a/assets/Script/module/Config/GameConfig.ts +++ b/assets/Script/module/Config/GameConfig.ts @@ -106,6 +106,7 @@ export class GameConfig { magicAFirst: boolean; //魔法棒道具第一次 hp_Max: number; //体力最大值 doubleCoin: number;//是否翻倍 + monthTime: number;//月卡时间 }; @@ -256,6 +257,7 @@ export class GameConfig { magicAFirst: false, //魔法棒道具第一次 hp_Max: 5, //体力最大值 doubleCoin: 1, //是否双倍 + monthTime: 0, //月卡时间 }; // this.setCode(this.getKey("scode")); // this.GM_INFO.level = 0; diff --git a/assets/Script/module/Tool/GameTool.ts b/assets/Script/module/Tool/GameTool.ts index c08395e..0d9749d 100644 --- a/assets/Script/module/Tool/GameTool.ts +++ b/assets/Script/module/Tool/GameTool.ts @@ -646,6 +646,13 @@ var GameTool = { "timestamp": 0 } } + else if (health > 0 && cc.fx.GameConfig.GM_INFO.hp != cc.fx.GameConfig.GM_INFO.hp_Max) { + let oldTime = cc.fx.StorageMessage.getStorage("health").timestamp; + healthInfo = { + "health": cc.fx.GameConfig.GM_INFO.hp, + "timestamp": oldTime + } + } else { healthInfo = { "health": cc.fx.GameConfig.GM_INFO.hp, @@ -699,12 +706,18 @@ var GameTool = { buyProp(propid, callback: Function) { //@ts-ignore if (typeof wx !== 'undefined' && wx !== null) { + let num = 3; let cost = 600; + if (propid == 2003) { cost = 900; + num = 3; + } + else if (propid == 2002) { num = 1; } + console.log("_____________新版本", num); cc.fx.GameTool.changeCoin(-cost); const dataTemp = { change_reason: "商城购买道具消耗", diff --git a/assets/Script/monthlyCard.ts b/assets/Script/monthlyCard.ts index 82479b3..9001ed7 100644 --- a/assets/Script/monthlyCard.ts +++ b/assets/Script/monthlyCard.ts @@ -162,7 +162,7 @@ export default class NewClass extends cc.Component { } else { this.monthCardBtn.active = false; this.monthCardBtn2.active = true; - NumberToImage.numberToImageNodes(25, 35, 20, "month_", this.monthCardTime, true); + NumberToImage.numberToImageNodes(cc.fx.GameConfig.GM_INFO.monthTime, 35, 20, "month_", this.monthCardTime, true); } }) } diff --git a/assets/shop/script/shop.ts b/assets/shop/script/shop.ts index 66eda68..f479ea0 100644 --- a/assets/shop/script/shop.ts +++ b/assets/shop/script/shop.ts @@ -691,7 +691,7 @@ export default class NewClass extends cc.Component { this.monthCardTime.active = true; } }) - NumberToImage.numberToImageNodes(25, 35, 15, "button_", this.monthCardTime.children[1], true); + NumberToImage.numberToImageNodes(cc.fx.GameConfig.GM_INFO.monthTime, 35, 15, "button_", this.monthCardTime.children[1], true); } // update (dt) {}