冰冻使用道具修改 魔棒bug

This commit is contained in:
computer\尼卡 2025-08-08 11:04:52 +08:00
parent d5ab6e2611
commit 942b2c9dc6
2 changed files with 25 additions and 13 deletions

View File

@ -598,7 +598,7 @@ export default class Block extends cc.Component {
MapConroler._instance.upDoor(tempColor); MapConroler._instance.upDoor(tempColor);
}, 250); }, 250);
MapConroler._instance.nextLevel(); MapConroler._instance.nextLevel(1);
this.node.active = false; this.node.active = false;
this.node.removeFromParent(); this.node.removeFromParent();
setTimeout(() => { setTimeout(() => {
@ -745,7 +745,7 @@ export default class Block extends cc.Component {
} }
//道具魔棒消除 //道具魔棒消除
eliminate() { eliminate(num?:number) {
clearTimeout(this.scheduleCallback2); clearTimeout(this.scheduleCallback2);
clearTimeout(this.scheduleCallback); clearTimeout(this.scheduleCallback);
clearTimeout(this.scheduleCallback3); clearTimeout(this.scheduleCallback3);
@ -787,7 +787,9 @@ export default class Block extends cc.Component {
} }
this.scheduleCallback2 = setTimeout(() => { this.scheduleCallback2 = setTimeout(() => {
MapConroler._instance.blockNum -= 1; MapConroler._instance.blockNum -= 1;
MapConroler._instance.special_Treatment(this.node); if (num == 1) {
MapConroler._instance.special_Treatment(this.node);
}
}, 950); }, 950);
this.scheduleCallback2 = setTimeout(() => { this.scheduleCallback2 = setTimeout(() => {
//如果方块可以消除 //如果方块可以消除
@ -810,7 +812,7 @@ export default class Block extends cc.Component {
this.node.getChildByName("boom").getComponent("Boom").destroyBoom(false); this.node.getChildByName("boom").getComponent("Boom").destroyBoom(false);
} }
MapConroler._instance.nextLevel(); MapConroler._instance.nextLevel(0);
this.node.active = false; this.node.active = false;
this.node.removeFromParent(); this.node.removeFromParent();
setTimeout(() => { setTimeout(() => {
@ -940,7 +942,7 @@ export default class Block extends cc.Component {
this.node.getChildByName("boom").getComponent("Boom").destroyBoom(false); this.node.getChildByName("boom").getComponent("Boom").destroyBoom(false);
} }
MapConroler._instance.nextLevel(); MapConroler._instance.nextLevel(0);
this.node.active = false; this.node.active = false;
this.node.removeFromParent(); this.node.removeFromParent();
setTimeout(() => { setTimeout(() => {

View File

@ -1551,9 +1551,19 @@ export default class MapConroler extends cc.Component {
} }
//判断游戏成功下一关 //判断游戏成功下一关
nextLevel() { nextLevel(num: number) {
this.pause = false; if (num == 1) {
this.openIce(); this.pause = false;
this.openIce();
} else {
if (this.iceTrue() == true) {
this.pause = true;
} else {
this.pause = false;
this.openIce();
}
}
this.blockNum = this.blocks.length; this.blockNum = this.blocks.length;
@ -1782,7 +1792,7 @@ export default class MapConroler extends cc.Component {
} }
this.blockNum = this.blocks.length; this.blockNum = this.blocks.length;
if (this.blockNum == 0) this.nextLevel(); if (this.blockNum == 0) this.nextLevel(1);
this.node.parent.parent.getChildByName("Lose").active = false; this.node.parent.parent.getChildByName("Lose").active = false;
setTimeout(() => { setTimeout(() => {
@ -1803,7 +1813,7 @@ export default class MapConroler extends cc.Component {
this.add_Time += 20; this.add_Time += 20;
NumberToImage.getTimeMargin(20, 50, "time_", this.timeLabel) NumberToImage.getTimeMargin(20, 50, "time_", this.timeLabel)
this.blockNum = this.blocks.length; this.blockNum = this.blocks.length;
if (this.blockNum == 0) this.nextLevel(); if (this.blockNum == 0) this.nextLevel(1);
this.node.parent.parent.getChildByName("Lose").active = false; this.node.parent.parent.getChildByName("Lose").active = false;
setTimeout(() => { setTimeout(() => {
this.reviewState = false; this.reviewState = false;
@ -2746,7 +2756,7 @@ export default class MapConroler extends cc.Component {
} }
if (nomalArray.length > 1) { if (nomalArray.length > 1) {
nomalArray = cc.fx.GameTool.shuffleArray(nomalArray); nomalArray = cc.fx.GameTool.shuffleArray(nomalArray);
nomalArray[0].getComponent("Block").eliminate(); nomalArray[0].getComponent("Block").eliminate(1);
let time = 0; let time = 0;
if (nomalArray[0].getComponent("Block").type == 1 || nomalArray[0].getComponent("Block").type == 9) { if (nomalArray[0].getComponent("Block").type == 1 || nomalArray[0].getComponent("Block").type == 9) {
time = 200; time = 200;
@ -2764,7 +2774,7 @@ export default class MapConroler extends cc.Component {
// } // }
} }
else if (nomalArray.length == 1) { else if (nomalArray.length == 1) {
nomalArray[0].getComponent("Block").eliminate(); nomalArray[0].getComponent("Block").eliminate(1);
let time = 0; let time = 0;
if (nomalArray[0].getComponent("Block").type == 1 || nomalArray[0].getComponent("Block").type == 9) { if (nomalArray[0].getComponent("Block").type == 1 || nomalArray[0].getComponent("Block").type == 9) {
time = 200; time = 200;
@ -2792,7 +2802,7 @@ export default class MapConroler extends cc.Component {
if (this.loackArray.length != 0) { if (this.loackArray.length != 0) {
for (let i = 0; i < this.loackArray.length; i++) { for (let i = 0; i < this.loackArray.length; i++) {
// console.log("没有普通快,魔法消除一个带锁块"); // console.log("没有普通快,魔法消除一个带锁块");
this.loackArray[i].getComponent("Block").eliminate(); this.loackArray[i].getComponent("Block").eliminate(1);
count -= 1; count -= 1;
if (count == 0) { if (count == 0) {
break; break;