Commit 13da983c authored by zjz1994's avatar zjz1994

特效充能暂存

parent 722fd25f
......@@ -2383,7 +2383,7 @@ export default class MainScene extends Scene {
}, 200)
} else {
//新大炮充能
console.log("新炮台充能",JSON.parse(JSON.stringify(pcannostatArr)));
// console.log("新炮台充能",JSON.parse(JSON.stringify(pcannostatArr)));
for(var np=0;np<pcannostatArr.length;np++){
var npdata = pcannostatArr[np];
var npineffect = npdata.ineffect;
......@@ -2391,9 +2391,13 @@ export default class MainScene extends Scene {
var npadd = 0;
if(npineffect){
npadd = 1;
}else{
if(npaddnum>2){
npadd = npaddnum;
}else{
npadd = npaddnum;
}
}
var npcanno = this.cannoArr[np].ele;
// console.log("新炮台充能",np,npadd)
for(var ap=0;ap<npadd;ap++){
......@@ -2434,24 +2438,24 @@ export default class MainScene extends Scene {
}
//炮台充能发射
var emitcanno:Element;
// var emitcanno:Element;
if(this.readyCannoArr.length>0){
var readyCannoIdx = this.readyCannoArr[0];
emitcanno = this.cannoArr[readyCannoIdx].ele;
// var readyCannoIdx = this.readyCannoArr[0];
// emitcanno = this.cannoArr[readyCannoIdx].ele;
for(var p=0;p<this.readyCannoArr.length;p++){
var preadyCannoIdx = this.readyCannoArr[p];
var pemitcanno = this.cannoArr[preadyCannoIdx].ele;
this.fireCanno(pemitcanno);
}
// for(var p=0;p<this.cannoArr.length;p++){
// var pcanno = this.cannoArr[p].ele;
// var pcannostat = pcanno.checkCannoStat();
// if(pcannostat){
// emitcanno = pcanno;
// break;
// }
// }
if(emitcanno){
this.fireCanno(emitcanno);
return;
}
// if(emitcanno){
// this.fireCanno(emitcanno);
// return;
// }
if (this._converyorTag) {
await doConveyorAI(this);
......@@ -2658,8 +2662,17 @@ export default class MainScene extends Scene {
* 炮台发射完毕,开始炮台消除
*/
callBackFireCanno(canno:Element){
var cannoidx = canno.index;
for(var i=0;i<this.readyCannoArr.length;i++){
var ireadycannoidx = this.cannoArr[this.readyCannoArr[i]].idx;
if(ireadycannoidx==cannoidx){
this.readyCannoArr.splice(i,1);
break;
}
}
if(this.readyCannoArr.length==0){
this.eliminate();
this.readyCannoArr.shift();
}
canno.resetCannoStat();
}
checkAllBlock() {
......
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