Commit 466a18aa authored by zjz1994's avatar zjz1994

修复黑洞转移没填补empty的bug

parent adfb0cde
......@@ -1177,7 +1177,9 @@ export default class MainScene extends Scene {
switch(elements[i]) {
//如果为0记录空格
case ElementConfigType.EMPTY:
this.emptys.push(i);
if(this.emptys.indexOf(i)==-1){
this.emptys.push(i);
}
break;
//基础元素,枷锁,气泡,灰色毛球,褐色毛球,黑色毛球 && 石门锁,有条件的锁
case ElementConfigType.BASE:
......@@ -1425,7 +1427,10 @@ export default class MainScene extends Scene {
break;
default:
//其他标识按空元素记
this.emptys.push(i);
if(this.emptys.indexOf(i)==-1){
this.emptys.push(i);
}
break
}
}
......@@ -2158,7 +2163,7 @@ export default class MainScene extends Scene {
fall(callback: Function) {
//去重一次
Tool.removeReapty(this.emptys);
//逻辑需要重新梳理
if(/*!this.fallVerMark ||*/ Tool.judgeOutOne(this.emptys, this.lattices)) {
// this.fallVerMark = true;
......@@ -2224,7 +2229,10 @@ export default class MainScene extends Scene {
//去掉一个
this.emptys.splice(emptyIndex, 1);
//加上一个
this.emptys.push(index);
if(this.emptys.indexOf(index)==-1){
this.emptys.push(index);
}
lat.element = null
}
} else {
......@@ -2272,7 +2280,10 @@ export default class MainScene extends Scene {
// this.emptys.splice(emptyIndex, 1);
Tool.removeEle(downIndex, this.emptys)
//加上一个
this.emptys.push(index);
if(this.emptys.indexOf(index)==-1){
this.emptys.push(index);
}
lat.element = null
}
} else {
......@@ -3435,15 +3446,25 @@ export default class MainScene extends Scene {
await doWormHoleAI(this);
// console.log("黑洞转移完毕");
//黑洞转移,使黑洞占位变空,需要添加到emptys中
//黑洞转移,使黑洞占位变空,需要添加到emptys中,
// bug修复:黑洞转移会使空的变为有东西的,需要把emptys中对应的去掉
for(var _w=0;_w<this.lattices.length;_w++){
var _wlattice = this.lattices[_w];
if(_wlattice&&!_wlattice.element
&&this.emptys.indexOf(_wlattice.index)==-1){
this.emptys.push(_wlattice.index);
}
if(_wlattice&&_wlattice.element){
var isInempty = this.emptys.indexOf(_wlattice.index);
if(isInempty!=-1){
// console.log("bug修复,黑洞转移去空");
this.emptys.splice(isInempty,1);
}
}
}
//棒棒糖消除
var recoverlp2 = this.checkEmtbbt();
if(recoverlp2>0){
......@@ -5278,7 +5299,10 @@ export default class MainScene extends Scene {
ele.addDisable();
//添加进emptys
this.emptys.push(index)
if(this.emptys.indexOf(index)==-1){
this.emptys.push(index);
}
//从容器移除
this.elementContainer.removeChild(ele);
//回收元素
......
......@@ -110,4 +110,40 @@ export const Chapters26: ChapterData[] = [
2, 2, 4, 1, 4, 1, 4, 2, 2,
1, 2, 5, 4, 5, 4, 5, 2, 1 ],
baseElements: [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ], recycles: [], generateLats: [ { index: 0, type: null }, { index: 8, type: null }, { index: 10, type: null }, { index: 16, type: null }, { index: 20, type: null }, { index: 24, type: null }, { index: 30, type: null }, { index: 32, type: null }, { index: 40, type: null } ] } },
]
{ baseElementTypes: [ 4, 3, 2, 1 ], bubbleProbability: 0, stepCount: 27, passTarget: { type: 1, elements: [ { type: 9, count: 73 } ] }, starScores: [ 15000, 20000, 25000 ], map: {
lattices: [
3, 3, 3, 3, 3, 3, 3, 3, 3,
0, 3, 3, 3, 3, 3, 3, 3, 3,
3, 0, 3, 3, 3, 3, 3, 3, 3,
3, 3, 0, 3, 3, 3, 3, 3, 3,
3, 3, 3, 3, 1, 3, 3, 3, 3,
3, 3, 3, 3, 3, 3, 0, 3, 3,
3, 3, 3, 3, 0, 3, 3, 0, 3,
3, 3, 3, 3, 3, 3, 3, 3, 0,
3, 3, 3, 3, 3, 3, 3, 3, 3 ], connectedLats: [], conveyor: [], conveyorConnectedLats: [],
// WORMHOLE: [ [ 10, 16, 70, 64 ], [ 30, 32, 50, 48 ] ],
WORMHOLE: [ [ 10, 16, 70, 64 ]],
elements: [
1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 4, 1, 1, 1, 1, 1, 4, 1,
2, 1, 1, 1, 1, 1, 14, 1, 1,
2, 1, 1, 4, 1, 4, 1, 1, 1,
2, 2, 2, 1, 12, 1, 2, 2, 2,
2, 2, 2, 4, 4, 4, 1, 2, 2,
2, 2, 2, 1, 1, 0, 0, 1, 2,
2, 4, 2, 1, 1, 0, 0, 0, 1,
2, 2, 2, 1, 1, 0, 0, 0, 0 ],
baseElements: [
0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0
], recycles: [], generateLats: [ { index: 0, type: null }, { index: 1, type: null }, { index: 2, type: null }, { index: 3, type: null }, { index: 4, type: null }, { index: 5, type: null }, { index: 6, type: null }, { index: 7, type: null }, { index: 8, type: null } ] } },
]
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment