This commit is contained in:
computer\尼卡 2025-08-08 11:51:56 +08:00
parent 942b2c9dc6
commit 2cc681c468
2 changed files with 17 additions and 7 deletions

View File

@ -745,7 +745,8 @@ export default class Block extends cc.Component {
} }
//道具魔棒消除 //道具魔棒消除
eliminate(num?:number) { eliminate() {
clearTimeout(this.scheduleCallback2); clearTimeout(this.scheduleCallback2);
clearTimeout(this.scheduleCallback); clearTimeout(this.scheduleCallback);
clearTimeout(this.scheduleCallback3); clearTimeout(this.scheduleCallback3);
@ -786,10 +787,10 @@ export default class Block extends cc.Component {
this.node.getChildByName("boom").getComponent("Boom").stopBoom(); this.node.getChildByName("boom").getComponent("Boom").stopBoom();
} }
this.scheduleCallback2 = setTimeout(() => { this.scheduleCallback2 = setTimeout(() => {
MapConroler._instance.blockNum -= 1; MapConroler._instance.blockNum -= 1;
if (num == 1) { MapConroler._instance.special_Treatment(this.node);
MapConroler._instance.special_Treatment(this.node);
}
}, 950); }, 950);
this.scheduleCallback2 = setTimeout(() => { this.scheduleCallback2 = setTimeout(() => {
//如果方块可以消除 //如果方块可以消除

View File

@ -144,6 +144,7 @@ export default class MapConroler extends cc.Component {
arr: any; arr: any;
isreview: boolean = false isreview: boolean = false
lastHammerTime: number; lastHammerTime: number;
eliMinNUM: Boolean = false;
// mapInfo: number[][] = []; // mapInfo: number[][] = [];
@ -1530,7 +1531,12 @@ export default class MapConroler extends cc.Component {
this.blocks.splice(i, 1); this.blocks.splice(i, 1);
} }
} }
this.changeState(true);
if (this.eliMinNUM == true) {
this.changeState(true);
this.eliMinNUM = false;
}
} }
judgeWin(number) { judgeWin(number) {
@ -2755,8 +2761,9 @@ export default class MapConroler extends cc.Component {
} }
} }
if (nomalArray.length > 1) { if (nomalArray.length > 1) {
this.eliMinNUM = true;
nomalArray = cc.fx.GameTool.shuffleArray(nomalArray); nomalArray = cc.fx.GameTool.shuffleArray(nomalArray);
nomalArray[0].getComponent("Block").eliminate(1); nomalArray[0].getComponent("Block").eliminate();
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;
@ -2774,6 +2781,7 @@ export default class MapConroler extends cc.Component {
// } // }
} }
else if (nomalArray.length == 1) { else if (nomalArray.length == 1) {
this.eliMinNUM = true;
nomalArray[0].getComponent("Block").eliminate(1); 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) {
@ -2798,11 +2806,12 @@ export default class MapConroler extends cc.Component {
}, 200 + time); }, 200 + time);
} }
else { else {
this.eliMinNUM = true;
let count = 2; let count = 2;
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(1); this.loackArray[i].getComponent("Block").eliminate();
count -= 1; count -= 1;
if (count == 0) { if (count == 0) {
break; break;