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.scheduleCallback);
clearTimeout(this.scheduleCallback3);
@ -786,10 +787,10 @@ export default class Block extends cc.Component {
this.node.getChildByName("boom").getComponent("Boom").stopBoom();
}
this.scheduleCallback2 = setTimeout(() => {
MapConroler._instance.blockNum -= 1;
if (num == 1) {
MapConroler._instance.special_Treatment(this.node);
}
MapConroler._instance.special_Treatment(this.node);
}, 950);
this.scheduleCallback2 = setTimeout(() => {
//如果方块可以消除

View File

@ -144,6 +144,7 @@ export default class MapConroler extends cc.Component {
arr: any;
isreview: boolean = false
lastHammerTime: number;
eliMinNUM: Boolean = false;
// mapInfo: number[][] = [];
@ -1530,7 +1531,12 @@ export default class MapConroler extends cc.Component {
this.blocks.splice(i, 1);
}
}
this.changeState(true);
if (this.eliMinNUM == true) {
this.changeState(true);
this.eliMinNUM = false;
}
}
judgeWin(number) {
@ -2755,8 +2761,9 @@ export default class MapConroler extends cc.Component {
}
}
if (nomalArray.length > 1) {
this.eliMinNUM = true;
nomalArray = cc.fx.GameTool.shuffleArray(nomalArray);
nomalArray[0].getComponent("Block").eliminate(1);
nomalArray[0].getComponent("Block").eliminate();
let time = 0;
if (nomalArray[0].getComponent("Block").type == 1 || nomalArray[0].getComponent("Block").type == 9) {
time = 200;
@ -2774,6 +2781,7 @@ export default class MapConroler extends cc.Component {
// }
}
else if (nomalArray.length == 1) {
this.eliMinNUM = true;
nomalArray[0].getComponent("Block").eliminate(1);
let time = 0;
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);
}
else {
this.eliMinNUM = true;
let count = 2;
if (this.loackArray.length != 0) {
for (let i = 0; i < this.loackArray.length; i++) {
// console.log("没有普通快,魔法消除一个带锁块");
this.loackArray[i].getComponent("Block").eliminate(1);
this.loackArray[i].getComponent("Block").eliminate();
count -= 1;
if (count == 0) {
break;