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;
......@@ -2392,7 +2392,11 @@ export default class MainScene extends Scene {
if(npineffect){
npadd = 1;
}else{
npadd = npaddnum;
if(npaddnum>2){
npadd = npaddnum;
}else{
npadd = npaddnum;
}
}
var npcanno = this.cannoArr[np].ele;
// console.log("新炮台充能",np,npadd)
......@@ -2434,23 +2438,23 @@ 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;
}
// 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);
// 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);
}
return;
}
// if(emitcanno){
// this.fireCanno(emitcanno);
// return;
// }
if (this._converyorTag) {
......@@ -2658,8 +2662,17 @@ export default class MainScene extends Scene {
* 炮台发射完毕,开始炮台消除
*/
callBackFireCanno(canno:Element){
this.eliminate();
this.readyCannoArr.shift();
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();
}
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