Commit 8d590385 authored by zjz1994's avatar zjz1994

草坪暂存

parent e071b49f
...@@ -6398,6 +6398,7 @@ export default class MainScene extends Scene { ...@@ -6398,6 +6398,7 @@ export default class MainScene extends Scene {
var i1idx = mainidxs[i1]; var i1idx = mainidxs[i1];
var i1canturff = this.judgeTurfing(i1idx); var i1canturff = this.judgeTurfing(i1idx);
var i1canturft = this.judgeTurfto(i1idx); var i1canturft = this.judgeTurfto(i1idx);
var i1data = { var i1data = {
idx:i1idx, idx:i1idx,
canturff:i1canturff, canturff:i1canturff,
...@@ -6409,6 +6410,14 @@ export default class MainScene extends Scene { ...@@ -6409,6 +6410,14 @@ export default class MainScene extends Scene {
var i2idx = allidxs[i2]; var i2idx = allidxs[i2];
var i2canturff = this.judgeTurfing(i2idx); var i2canturff = this.judgeTurfing(i2idx);
var i2canturft = this.judgeTurfto(i2idx); var i2canturft = this.judgeTurfto(i2idx);
var isCannoPn = Tool.checkIsCannoPn(this.lattices[i2idx]);
if(isCannoPn){
this.turfing(i2idx);
i2canturff = true;
i2canturft = false;
}
var i2data = { var i2data = {
idx:i2idx, idx:i2idx,
canturff:i2canturff, canturff:i2canturff,
...@@ -6416,6 +6425,7 @@ export default class MainScene extends Scene { ...@@ -6416,6 +6425,7 @@ export default class MainScene extends Scene {
} }
alldata.push(i2data); alldata.push(i2data);
} }
//炮台猩猩的直接铺草
var turidx = this.recoverArr.length; var turidx = this.recoverArr.length;
var newturdata = { var newturdata = {
turidx:turidx, turidx:turidx,
......
...@@ -1379,5 +1379,16 @@ export class Tool { ...@@ -1379,5 +1379,16 @@ export class Tool {
} }
return true; return true;
} }
//草坪判断是否是炮台,猩猩
public static checkIsCannoPn(lat:Lattice){
if(lat&&lat.element){
var ele = lat.element;
if(ele.type==ElementType.CANNO&&!lat.grass){
return true;
}else if(ele.type==ElementType.Pongo&&!ele.hasState(StateType.PongoLockState)&&!lat.grass){
return true;
}
}
return false;
}
} }
\ 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