From 1c6e8f7c2f115200b6235e828b78428226430b16 Mon Sep 17 00:00:00 2001 From: "COMPUTER\\EDY" <249929363@qq.com> Date: Mon, 29 Sep 2025 14:33:45 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E5=85=B3=E5=8D=A1=E9=85=8D?= =?UTF-8?q?=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- assets/Script/Block.ts | 24 +++++++ assets/Script/JiaZai.ts | 6 +- assets/Script/Map.ts | 92 +++++++++++++++++++++------ assets/Script/Sdk/MiniGameSdk.ts | 14 ++-- assets/Script/Wall.ts | 2 + assets/Script/module/Tool/GameTool.ts | 33 ++-------- assets/custom/Json/level11.json | 2 +- assets/custom/Json/level30.json | 2 +- assets/res/texture_Block.meta | 13 ---- assets/shop/script/shop.ts | 2 +- 10 files changed, 116 insertions(+), 74 deletions(-) delete mode 100644 assets/res/texture_Block.meta diff --git a/assets/Script/Block.ts b/assets/Script/Block.ts index 83fb5ea..12f1cc7 100644 --- a/assets/Script/Block.ts +++ b/assets/Script/Block.ts @@ -29,6 +29,12 @@ export enum BlockType { "叠加块上" = 10, /*障碍块 */ "障碍块" = 11, + /*第二上锁块 */ + "第二上锁块" = 12, + /*第二钥匙块 */ + "第二钥匙块" = 13, + /*门钥匙 */ + "门钥匙" = 14, } @@ -307,12 +313,30 @@ export default class Block extends cc.Component { key.parent = this.node; key.setPosition(posConfig.pos1.x, posConfig.pos1.y); break; + case BlockType.第二钥匙块: + let key2 = cc.instantiate(MapConroler._instance.Block_Prop[2]); + key2.parent = this.node; + key2.color = cc.color(255, 125, 0); + key2.setPosition(posConfig.pos1.x, posConfig.pos1.y); + break; + case BlockType.门钥匙: + let key3 = cc.instantiate(MapConroler._instance.Block_Prop[2]); + key3.parent = this.node; + key3.setPosition(posConfig.pos1.x, posConfig.pos1.y); + break; case BlockType.上锁块: let lock = cc.instantiate(MapConroler._instance.Block_Prop[this.type]); lock.parent = this.node; lock.setPosition(posConfig.pos1.x, posConfig.pos1.y); lock.getComponent("Lock").init(this.block_Info.lockTime); break; + case BlockType.第二上锁块: + let lock2 = cc.instantiate(MapConroler._instance.Block_Prop[3]); + lock2.parent = this.node; + lock2.color = cc.color(255, 125, 0); + lock2.setPosition(posConfig.pos1.x, posConfig.pos1.y); + lock2.getComponent("Lock").init(this.block_Info.lockTime); + break; case BlockType.冻结块: let freeze = cc.instantiate(MapConroler._instance.Block_Prop[this.type]); freeze.parent = this.node; diff --git a/assets/Script/JiaZai.ts b/assets/Script/JiaZai.ts index 305c20d..5a28c19 100644 --- a/assets/Script/JiaZai.ts +++ b/assets/Script/JiaZai.ts @@ -522,7 +522,6 @@ export default class JiaZai extends cc.Component { // NumberToImage.numberToImageNodes(1000, 35, 15, "button_", coin, true); - } // 弹窗倒计时 @@ -531,13 +530,12 @@ export default class JiaZai extends cc.Component { this.heathScheduleCallback = function () { if (cc.fx.GameConfig.GM_INFO.min_Time <= 0) { this.stopHeathTimeCutDown(); - let timeTemp = cc.fx.GameTool.getTimeMargin(cc.fx.GameConfig.GM_INFO.min_Time); //console.log("健康值倒计时结束,当前时间:", timeTemp, cc.fx.GameConfig.GM_INFO.min_Time); if (timeLabelNode) { NumberToImage.getTimeMargin(cc.fx.GameConfig.GM_INFO.min_Time, 50, "month_", timeLabelNode); } - NumberToImage.numberToImageNodes(cc.fx.GameConfig.GM_INFO.hp, 40, 20, "month_", this.heath, true); + NumberToImage.numberToImageNodes(cc.fx.GameConfig.GM_INFO.hp, 40, 20, "time_", this.heath, true); } else { let timeTemp = cc.fx.GameTool.getTimeMargin(cc.fx.GameConfig.GM_INFO.min_Time); if (timeLabelNode) { @@ -567,7 +565,7 @@ export default class JiaZai extends cc.Component { this.Stamina.getChildByName("time").getComponent(cc.Label).string = timeTemp; } if (cc.fx.GameConfig.GM_INFO.hp < cc.fx.GameConfig.GM_INFO.hp_Max) { - // MiniGameSdk.API.showToast("恢复一点体力"); + MiniGameSdk.API.showToast("恢复一点体力"); cc.fx.GameTool.setUserHealth(1, (data) => { cc.fx.GameTool.getHealth((data) => { this.setHealthInfo(true); diff --git a/assets/Script/Map.ts b/assets/Script/Map.ts index 7323d73..c18af06 100644 --- a/assets/Script/Map.ts +++ b/assets/Script/Map.ts @@ -134,7 +134,9 @@ export default class MapConroler extends cc.Component { ishammer: boolean = false;//魔法棒与锤子区分 ismagic: boolean = false;//魔法棒状态 freezeArray: any; //冻结 - loackArray: any; //上锁 + lockArray: any; //上锁块 + lockArray2: any; //上锁块2 + particleEffects: cc.ParticleAsset[]; // leftDoors: []; //左门 rightDoors: any; //右门 @@ -440,7 +442,8 @@ export default class MapConroler extends cc.Component { this.riseFallBlcok = []; this.mapBlockArray = []; this.freezeArray = []; - this.loackArray = []; + this.lockArray = []; + this.lockArray2 = []; this.count_Time = 0; this.add_Time = 0; @@ -1728,7 +1731,9 @@ export default class MapConroler extends cc.Component { } } - if (node.getComponent("Block").type == 2 || node.getComponent("Block").type == 4) { + // if (node.getComponent("Block").type == 2 || node.getComponent("Block").type == 4) { + //普通钥匙块 + if (node.getComponent("Block").type == 2) { let lockBlock = this.node.children.filter(child => { if (child.getComponent("Block")) { if (child.getComponent("Block").type == 3) @@ -1739,8 +1744,34 @@ export default class MapConroler extends cc.Component { for (let i = 0; i < lockBlock.length; i++) { lockBlock[i].getChildByName("lock").getComponent("Lock").reduce(); } - } + //第二钥匙块 + else if (node.getComponent("Block").type == 13) { + let lockBlock2 = this.node.children.filter(child => { + if (child.getComponent("Block")) { + if (child.getComponent("Block").type == 12) + return child + } + }); + if (lockBlock2.length > 0) + for (let i = 0; i < lockBlock2.length; i++) { + lockBlock2[i].getChildByName("lock").getComponent("Lock").reduce(); + } + } + //门钥匙块,消除门的 + else if (node.getComponent("Block").type == 14) { + // let lockBlock2 = this.node.children.filter(child => { + // if (child.getComponent("Block")) { + // if (child.getComponent("Block").type == 13) + // return child + // } + // }); + // if (lockBlock2.length > 0) + // for (let i = 0; i < lockBlock2.length; i++) { + // lockBlock2[i].getChildByName("lock").getComponent("Lock").reduce(); + // } + } + for (let i = 0; i < this.blocks.length; i++) { if (this.blocks[i] == node) { @@ -1982,20 +2013,20 @@ export default class MapConroler extends cc.Component { coin: -coin } if (type == "time") { - if (cc.fx.GameConfig.GM_INFO.review == 1) coin = 1000; - else if (cc.fx.GameConfig.GM_INFO.review == 2) coin = 1500; + if (cc.fx.GameConfig.GM_INFO.review == 1) coin = 500; + else if (cc.fx.GameConfig.GM_INFO.review == 2) coin = 500; } else if (type == "boom") { - if (cc.fx.GameConfig.GM_INFO.reviewBoom == 1) coin = 1000; - else if (cc.fx.GameConfig.GM_INFO.reviewBoom == 2) coin = 1500; + if (cc.fx.GameConfig.GM_INFO.reviewBoom == 1) coin = 500; + else if (cc.fx.GameConfig.GM_INFO.reviewBoom == 2) coin = 500; } else if (type == "lock") { - if (cc.fx.GameConfig.GM_INFO.reviewDoor == 1) coin = 1000; - else if (cc.fx.GameConfig.GM_INFO.reviewDoor == 2) coin = 1500; + if (cc.fx.GameConfig.GM_INFO.reviewDoor == 1) coin = 500; + else if (cc.fx.GameConfig.GM_INFO.reviewDoor == 2) coin = 500; } else if (type == "revolving") { - if (cc.fx.GameConfig.GM_INFO.reviewDoor == 1) coin = 1000; - else if (cc.fx.GameConfig.GM_INFO.reviewDoor == 2) coin = 1500; + if (cc.fx.GameConfig.GM_INFO.reviewDoor == 1) coin = 500; + else if (cc.fx.GameConfig.GM_INFO.reviewDoor == 2) coin = 500; } data.coin = -coin; // console.log("自身金币:",cc.fx.GameConfig.GM_INFO.coin,"消耗金币:",coin); @@ -2679,6 +2710,7 @@ export default class MapConroler extends cc.Component { else MiniGameSdk.API.showToast("道具使用中,请稍后再试"); } + } } @@ -3170,7 +3202,12 @@ export default class MapConroler extends cc.Component { // console.log("方块类型",this.blocks[i].getComponent("Block").type); if (this.blocks[i].getComponent("Block").type == 3) { if (this.blocks[i].getComponent("Block").block_Info.floor == undefined || this.blocks[i].getComponent("Block").block_Info.floor == null) { - this.loackArray.push(this.blocks[i]); + this.lockArray.push(this.blocks[i]); + } + } + else if (this.blocks[i].getComponent("Block").type == 12) { + if (this.blocks[i].getComponent("Block").block_Info.floor == undefined || this.blocks[i].getComponent("Block").block_Info.floor == null) { + this.lockArray2.push(this.blocks[i]); } } else if (this.blocks[i].getComponent("Block").type == 4) { @@ -3222,13 +3259,18 @@ export default class MapConroler extends cc.Component { time = 200; } setTimeout(() => { - if (this.freezeArray.length == 0 && this.loackArray.length == 0) { + if (this.freezeArray.length == 0 && this.lockArray.length == 0 && this.lockArray2.length == 0) { // console.log("只剩下一个块道具使用完毕"); } else { - if (this.loackArray.length != 0) { + if (this.lockArray.length != 0) { // console.log("消除一个普通块后,消除一个带锁块"); - this.loackArray[0].getComponent("Block").eliminate(false); + this.lockArray[0].getComponent("Block").eliminate(false); + return; + } + else if (this.lockArray2.length != 0) { + // console.log("消除一个普通块后,消除一个冻结块"); + this.lockArray2[0].getComponent("Block").eliminate(false); return; } else if (this.freezeArray.length != 0) { @@ -3241,10 +3283,20 @@ export default class MapConroler extends cc.Component { } else { let count = 2; - if (this.loackArray.length != 0) { - for (let i = 0; i < this.loackArray.length; i++) { + if (this.lockArray.length != 0) { + for (let i = 0; i < this.lockArray.length; i++) { // console.log("没有普通快,魔法消除一个带锁块"); - this.loackArray[i].getComponent("Block").eliminate(true); + this.lockArray[i].getComponent("Block").eliminate(true); + count -= 1; + if (count == 0) { + break; + } + } + } + if (count != 0 && this.lockArray2.length != 0) { + for (let i = 0; i < this.lockArray2.length; i++) { + // console.log("没有普通快,魔法消除一个带锁块"); + this.lockArray2[i].getComponent("Block").eliminate(true); count -= 1; if (count == 0) { break; @@ -3522,7 +3574,7 @@ export default class MapConroler extends cc.Component { continue; } } - else if (this.wall_Pass[j].special == 3 || this.wall_Pass[j].special == 4 || this.wall_Pass[j].special == 5) { + else if (this.wall_Pass[j].special == 3 || this.wall_Pass[j].special == 4 || this.wall_Pass[j].special == 5 || this.wall_Pass[j].special == 6) { // console.log("冻结门,不可通行"); continue; } diff --git a/assets/Script/Sdk/MiniGameSdk.ts b/assets/Script/Sdk/MiniGameSdk.ts index 41f7d20..62157cc 100644 --- a/assets/Script/Sdk/MiniGameSdk.ts +++ b/assets/Script/Sdk/MiniGameSdk.ts @@ -1285,7 +1285,7 @@ export namespace MiniGameSdk { if (typeof wx !== 'undefined' && wx !== null) { // console.log("设置用户注册属性"); API._ta.userSet({ register_time: time }); - API._ta.userSet({ uid: cc.fx.GameConfig.GM_INFO.uid.toString() }); + API._ta.userSet({ uid: cc.fx.GameConfig.GM_INFO.userId }); } } @@ -1294,7 +1294,7 @@ export namespace MiniGameSdk { // console.log("上传金币和关卡信息给数数") API._ta.userSet({ current_level: (cc.fx.GameConfig.GM_INFO.level + 1) }); API._ta.userSet({ current_coin: cc.fx.GameConfig.GM_INFO.coin }); - API._ta.userSet({ uid: cc.fx.GameConfig.GM_INFO.uid.toString() }); + API._ta.userSet({ uid: cc.fx.GameConfig.GM_INFO.userId }); } } @@ -1310,7 +1310,7 @@ export namespace MiniGameSdk { current_health: cc.fx.GameConfig.GM_INFO.hp, //当前体力值 tmp_coin: cc.fx.GameConfig.GM_INFO.coin,//当前金币 version: cc.fx.GameConfig.GM_INFO.version.toString(),//当前版本号 - user_id: cc.fx.GameConfig.GM_INFO.uid.toString() //用户id + user_id: cc.fx.GameConfig.GM_INFO.userId //用户id }; if (register_time != null) { // console.log("设置用户公共属性注册:————————————", register_time); @@ -1320,7 +1320,7 @@ export namespace MiniGameSdk { tmp_coin: cc.fx.GameConfig.GM_INFO.coin,//当前金币 version: cc.fx.GameConfig.GM_INFO.version.toString(), register_time: register_time, - user_id: cc.fx.GameConfig.GM_INFO.uid.toString(), //用户id + user_id: cc.fx.GameConfig.GM_INFO.userId, //用户id pay_user: pay_user }; } @@ -1331,7 +1331,7 @@ export namespace MiniGameSdk { current_health: cc.fx.GameConfig.GM_INFO.hp, //当前体力值 tmp_coin: cc.fx.GameConfig.GM_INFO.coin,//当前金币 version: cc.fx.GameConfig.GM_INFO.version.toString(), - user_id: cc.fx.GameConfig.GM_INFO.uid.toString(), //用户id + user_id: cc.fx.GameConfig.GM_INFO.userId, //用户id pay_user: pay_user } } @@ -1476,8 +1476,8 @@ export namespace MiniGameSdk { static shareGame() { if (typeof wx !== 'undefined' && wx !== null) { let helpLevel = cc.fx.GameConfig.GM_INFO.level + 1; - if (helpLevel > 373) { - helpLevel = 373; + if (cc.fx.GameTool.maxLevel()) { + helpLevel -= 1; } // 获取关卡信息和 UID const level = helpLevel; diff --git a/assets/Script/Wall.ts b/assets/Script/Wall.ts index 9735e58..9b18ce3 100644 --- a/assets/Script/Wall.ts +++ b/assets/Script/Wall.ts @@ -23,6 +23,8 @@ export enum WallSpecial { "旋转门顺时针" = 4, /*旋转门逆时针*/ "旋转门逆时针" = 5, + /*上锁门*/ + "上锁门" = 6, } export enum WallType { diff --git a/assets/Script/module/Tool/GameTool.ts b/assets/Script/module/Tool/GameTool.ts index b80443f..c55f80d 100644 --- a/assets/Script/module/Tool/GameTool.ts +++ b/assets/Script/module/Tool/GameTool.ts @@ -398,8 +398,8 @@ var GameTool = { //关卡上限 maxLevel() { let jg = false; - if (cc.fx.GameConfig.GM_INFO.level > 439) { - cc.fx.GameConfig.GM_INFO.level = 440; + if (cc.fx.GameConfig.GM_INFO.level > 599) { + cc.fx.GameConfig.GM_INFO.level = 600; jg = true; } return jg; @@ -1195,31 +1195,8 @@ var GameTool = { setWechatGameGroup: function (type: 2 | 3 | 6) { //@ts-ignore if (typeof wx !== 'undefined' && wx !== null) { - //@ts-ignore - if (cc.fx.GameConfig.GM_INFO.openid) { - const openid = cc.fx.GameConfig.GM_INFO.openid; - const lastChar = openid[openid.length - 1]; - const charCode = lastChar.charCodeAt(0); - let groupNumber: number; - //console.log("openid尾数____________________:", charCode); - - // 根据 type 参数计算分组编号 - switch (type) { - case 2: - groupNumber = charCode % 2; - break; - case 3: - groupNumber = charCode % 3; - break; - case 6: - groupNumber = charCode % 6; - break; - default: - //console.log('type 参数值无效,必须为 2、3 或 6'); - return; - } - //console.log("type____________________:", type); - //console.log("分组编号____________________:", groupNumber); + if (cc.fx.GameConfig.GM_INFO.userId) { + let groupNumber = cc.fx.GameConfig.GM_INFO.userId % type; return groupNumber; } } @@ -1227,6 +1204,8 @@ var GameTool = { }, + + //购买行为,获得道具 getShopProp(propData, compensate) { //@ts-ignore diff --git a/assets/custom/Json/level11.json b/assets/custom/Json/level11.json index 9cb6d7e..a201f69 100644 --- a/assets/custom/Json/level11.json +++ b/assets/custom/Json/level11.json @@ -7,7 +7,7 @@ 9, 12 ], - "time": 100, + "time": 150, "gap": [] } ], diff --git a/assets/custom/Json/level30.json b/assets/custom/Json/level30.json index a048b92..07b0fed 100644 --- a/assets/custom/Json/level30.json +++ b/assets/custom/Json/level30.json @@ -7,7 +7,7 @@ 11, 11 ], - "time": 200, + "time": 240, "gap": [] } ], diff --git a/assets/res/texture_Block.meta b/assets/res/texture_Block.meta deleted file mode 100644 index 7a52c9e..0000000 --- a/assets/res/texture_Block.meta +++ /dev/null @@ -1,13 +0,0 @@ -{ - "ver": "1.1.3", - "uuid": "2ef5a7c6-04f5-418a-85b6-bf39220cd512", - "importer": "folder", - "isBundle": false, - "bundleName": "", - "priority": 1, - "compressionType": {}, - "optimizeHotUpdate": {}, - "inlineSpriteFrames": {}, - "isRemoteBundle": {}, - "subMetas": {} -} \ No newline at end of file diff --git a/assets/shop/script/shop.ts b/assets/shop/script/shop.ts index b5b30f4..e21d125 100644 --- a/assets/shop/script/shop.ts +++ b/assets/shop/script/shop.ts @@ -391,7 +391,7 @@ export default class NewClass extends cc.Component { if (this.Stamina && this.Stamina.getChildByName("time")) { this.Stamina.getChildByName("time").getComponent(cc.Label).string = timeTemp; } - MiniGameSdk.API.showToast("恢复一点滴点体力"); + MiniGameSdk.API.showToast("恢复一点体力"); cc.fx.GameTool.setUserHealth(1, (data) => { cc.fx.GameTool.getHealth(null); this.setHealthInfo(true);