Commit 13da983c authored by zjz1994's avatar zjz1994

特效充能暂存

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