Commit bd1f14de authored by zjz1994's avatar zjz1994

代码暂存

parent 66e558cc
...@@ -3894,4 +3894,50 @@ export default class MainScene extends Scene { ...@@ -3894,4 +3894,50 @@ export default class MainScene extends Scene {
RES.getResAsync('playSceneBg_jpg') RES.getResAsync('playSceneBg_jpg')
]); ]);
} }
//新大炮充能
//相邻加
addCannoStatByNext(cannoid:number,eleidx:number){
if (!this.lattices[eleidx] || !this.lattices[eleidx].element) return false;
var cannoidx:number = this.cannoArr[cannoid].idx;
var isnext = Tool.checkNebByidx(cannoidx,eleidx);
var ele = this.lattices[eleidx].element;
if(isnext&&Tool.judgeChosen(ele)){
return true;
}else{
return false;
}
}
//横向特效加
addCannoStatByHor(cannoid:number,row:number,col:number){
var cannoidx:number = this.cannoArr[cannoid].idx;
var cannorc = Tool.indexToRc(cannoidx);
var cannorow = cannorc[0];
var cannocol = cannorc[1];
var addhor:boolean = false;
if(cannocol>col){
for(var i=0;i<Tool.colNum;i++){
var eleidx = Tool.rcToIndex(row,i);
if (!this.lattices[eleidx] || !this.lattices[eleidx].element) continue;
var lat = this.lattices[eleidx];
var iscannoblock = Tool.judgeIscannoBlock(lat);
if(iscannoblock){
break;
}
if(cannorow==row){
if(cannocol==i){
addhor = true;
break;
}
}else{
var addhortemp = this.addCannoStatByNext(cannoid,eleidx);
if(addhortemp){
addhor = true;
break;
}
}
}
}
}
} }
\ No newline at end of file
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