From ee0f9db31e8a2d57ee4e55384442f295543f4ce2 Mon Sep 17 00:00:00 2001 From: "COMPUTER\\EDY" <249929363@qq.com> Date: Wed, 29 Apr 2026 14:38:41 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- assets/Script/Block.ts | 14 +++++---- assets/Script/GameManager.ts | 36 ++++++++++++++++------- assets/Script/Map.ts | 4 ++- assets/Script/MapBlock.ts | 1 + assets/Script/module/Config/GameConfig.ts | 2 +- assets/Script/module/Pay/Utils.ts | 3 ++ 6 files changed, 41 insertions(+), 19 deletions(-) diff --git a/assets/Script/Block.ts b/assets/Script/Block.ts index cc7bcfb..e8a2863 100644 --- a/assets/Script/Block.ts +++ b/assets/Script/Block.ts @@ -845,7 +845,6 @@ export default class Block extends cc.Component { else { console.log("只是重新刷一遍颜色"); this.initColor(true); - this.setMapColor(); } } @@ -1415,7 +1414,7 @@ export default class Block extends cc.Component { MapConroler._instance.blockLock == true || MapConroler._instance.change_colorBlock == true || MapConroler._instance.jump_state != null || MapConroler._instance.buttonWall.length > 0) && !MapConroler._instance.gameOver && !MapConroler._instance.gameWin) { - console.log("!!!!!!!!!准备判死啦"); + let gameover = MapConroler._instance.predict_End(true); if (gameover == false) { MapConroler._instance.failReason(); @@ -2774,18 +2773,20 @@ export default class Block extends cc.Component { let x = this.posX + pos.x; let y = this.posY + pos.y; MapConroler._instance.mapBlocksWall[x][y].getComponent("MapBlock").block_Id = this.node.uuid; - MapConroler._instance.mapBlocksWall[x][y].getComponent("MapBlock").nowColor = this.color; + if (MapConroler._instance.buttonBlock.length > 0) + MapConroler._instance.mapBlocksWall[x][y].getComponent("MapBlock").nowColor = this.color; } } } setMapColor() { - if (this.allBlocks.length > 0) { + if (this.allBlocks.length > 0 && MapConroler._instance.buttonBlock.length > 0) { for (let i = 0; i < this.allBlocks.length; i++) { let pos = this.allBlocks[i]; let x = this.posX + pos.x; let y = this.posY + pos.y; - MapConroler._instance.mapBlocksWall[x][y].getComponent("MapBlock").nowColor = this.color; + if (this.color && MapConroler._instance.mapBlocksWall[x][y]) + MapConroler._instance.mapBlocksWall[x][y].getComponent("MapBlock").nowColor = this.color; } } MapConroler._instance.checkButton(); @@ -2846,7 +2847,8 @@ export default class Block extends cc.Component { if (MapConroler._instance.mapBlocksWall[x][y]) { if (MapConroler._instance.mapBlocksWall[x][y].getComponent("MapBlock")) { MapConroler._instance.mapBlocksWall[x][y].getComponent("MapBlock").block_Id = ""; - MapConroler._instance.mapBlocksWall[x][y].getComponent("MapBlock").nowColor = -1; + if (MapConroler._instance.buttonBlock.length > 0) + MapConroler._instance.mapBlocksWall[x][y].getComponent("MapBlock").nowColor = -1; } } diff --git a/assets/Script/GameManager.ts b/assets/Script/GameManager.ts index c96460c..88f30f4 100644 --- a/assets/Script/GameManager.ts +++ b/assets/Script/GameManager.ts @@ -450,6 +450,7 @@ export default class GameManager extends cc.Component { data.coinAmount = 0; } if (levelInfo.level > data.levelAmount) { + console.log("本地等级 大于服务器等级才走这里") cc.fx.GameConfig.GM_INFO.level = levelInfo.level; cc.fx.GameConfig.GM_INFO.coin = coinInfo.coin; cc.fx.GameConfig.GM_INFO.freezeAmount = propInfo.freezeAmount; @@ -513,18 +514,30 @@ export default class GameManager extends cc.Component { cc.fx.StorageMessage.setStorage("level", levelInfo); let coinInfo = { "coin": data.coinAmount, "timestamp": timestamp }; cc.fx.StorageMessage.setStorage("coin", coinInfo); - let propInfo = { - "freezeAmount": data.freezeAmount, - "hammerAmount": data.hammerAmount, - "magicAmount": data.magicAmount, - "timestamp": timestamp, + if (data.forcedUpdate == true) { + let propInfo = { + "freezeAmount": data.freezeAmount, + "hammerAmount": data.hammerAmount, + "magicAmount": data.magicAmount, + "timestamp": timestamp, + } + cc.fx.GameConfig.GM_INFO.freezeAmount = data.freezeAmount; + cc.fx.GameConfig.GM_INFO.hammerAmount = data.hammerAmount; + cc.fx.GameConfig.GM_INFO.magicAmount = data.magicAmount; + cc.fx.GameConfig.GM_INFO.level = data.levelAmount; + cc.fx.GameConfig.GM_INFO.coin = data.coinAmount; + cc.fx.StorageMessage.setStorage("prop", propInfo); + // console.log("走的强制刷新", cc.fx.GameConfig.GM_INFO.hammerAmount) } - cc.fx.GameConfig.GM_INFO.freezeAmount = data.freezeAmount; - cc.fx.GameConfig.GM_INFO.hammerAmount = data.hammerAmount; - cc.fx.GameConfig.GM_INFO.magicAmount = data.magicAmount; - cc.fx.GameConfig.GM_INFO.level = data.levelAmount; - cc.fx.GameConfig.GM_INFO.coin = data.coinAmount; - cc.fx.StorageMessage.setStorage("prop", propInfo); + else { + cc.fx.GameConfig.GM_INFO.freezeAmount = propInfo.freezeAmount; + cc.fx.GameConfig.GM_INFO.hammerAmount = propInfo.hammerAmount; + cc.fx.GameConfig.GM_INFO.magicAmount = propInfo.magicAmount; + cc.fx.GameConfig.GM_INFO.level = data.levelAmount; + cc.fx.GameConfig.GM_INFO.coin = data.coinAmount; + // console.log("走的本地缓存刷新", cc.fx.GameConfig.GM_INFO.hammerAmount) + } + this.load3 = true; this.load4 = true; } @@ -566,6 +579,7 @@ export default class GameManager extends cc.Component { "magicAmount": data.magicAmount, "timestamp": timestamp, } + console.log("不应该走到这里的的-_----------------"); cc.fx.GameConfig.GM_INFO.freezeAmount = data.freezeAmount; cc.fx.GameConfig.GM_INFO.hammerAmount = data.hammerAmount; cc.fx.GameConfig.GM_INFO.magicAmount = data.magicAmount; diff --git a/assets/Script/Map.ts b/assets/Script/Map.ts index 454ba49..e2600c5 100644 --- a/assets/Script/Map.ts +++ b/assets/Script/Map.ts @@ -2326,8 +2326,10 @@ export default class MapConroler extends cc.Component { }); if (colorBlock.length > 0) { for (let i = 0; i < colorBlock.length; i++) { - if (colorBlock[i]) + if (colorBlock[i]) { colorBlock[i].getComponent("Block").changeBlockColor(); + } + } } } diff --git a/assets/Script/MapBlock.ts b/assets/Script/MapBlock.ts index 6ccd2ca..1ff788c 100644 --- a/assets/Script/MapBlock.ts +++ b/assets/Script/MapBlock.ts @@ -32,6 +32,7 @@ export default class NewClass extends cc.Component { nowColor: number = -1; onLoad() { + this.nowColor = -1; // this.direction = ""; // this.block_Id = ""; } diff --git a/assets/Script/module/Config/GameConfig.ts b/assets/Script/module/Config/GameConfig.ts index d36dbcd..919231c 100644 --- a/assets/Script/module/Config/GameConfig.ts +++ b/assets/Script/module/Config/GameConfig.ts @@ -299,7 +299,7 @@ export class GameConfig { vibrateOpen: true, //震动 coinnum: 0, //每局的金币数 paid_user: false, //是否是付费用户 - version: "1.9.64", //版本号 + version: "1.9.66", //版本号 shushu_DistinctId: "", //数数访客ID shushu_AccountId: "", //数数账号ID uid: "", //用户和后端唯一id diff --git a/assets/Script/module/Pay/Utils.ts b/assets/Script/module/Pay/Utils.ts index 9de0acf..ec74a14 100644 --- a/assets/Script/module/Pay/Utils.ts +++ b/assets/Script/module/Pay/Utils.ts @@ -1437,6 +1437,9 @@ export default class Utils { console.log("设置无尽关卡等级:", setData); Utils.POST("setUserLevel", setData, res => { if (res.code === 1) { + let endLevelNum = res.data.endLevelNum; + if (parseInt(data2) < Number(endLevelNum)) + cc.fx.GameConfig.GM_INFO.endLevelNum = Number(endLevelNum); console.log("设置无尽关卡", res); if (callBack) callBack(res); } else {