Commit 7add61de authored by zjz1994's avatar zjz1994

草地暂存

parent 5de9a8d7
This diff is collapsed.
...@@ -4,6 +4,7 @@ import wait from "../../libs/new_tc/wait"; ...@@ -4,6 +4,7 @@ import wait from "../../libs/new_tc/wait";
import { Tool } from "../something/Tool"; import { Tool } from "../something/Tool";
import { Lattice } from "../something/class/Lattice"; import { Lattice } from "../something/class/Lattice";
import { RecoverName } from "../something/enum/RecoverName"; import { RecoverName } from "../something/enum/RecoverName";
import { StateType } from "../something/enum/StateType";
/** /**
* fish爆炸 * fish爆炸
*/ */
...@@ -22,8 +23,9 @@ export default async (thisObj: MainScene) => { ...@@ -22,8 +23,9 @@ export default async (thisObj: MainScene) => {
for (const index of indexs) { for (const index of indexs) {
const lat: Lattice = thisObj.lattices[index]; const lat: Lattice = thisObj.lattices[index];
let canturgrass = Tool.judgeTurfing(lat); let canturgrass = thisObj.judgeTurfing(index);
let grassArr = new Array(); let grassArr = new Array();
var turfCp = new Array();
lat.element['fish'].toExplose(); lat.element['fish'].toExplose();
// wait(1000).then(()=>{ // wait(1000).then(()=>{
const p = Tool.getPositionByIndex(index); const p = Tool.getPositionByIndex(index);
...@@ -31,6 +33,15 @@ export default async (thisObj: MainScene) => { ...@@ -31,6 +33,15 @@ export default async (thisObj: MainScene) => {
boomAni.scaleX = boomAni.scaleY = 1; boomAni.scaleX = boomAni.scaleY = 1;
// }); // });
for (var i = 0; i < thisObj.lattices.length; i++) { for (var i = 0; i < thisObj.lattices.length; i++) {
if(canturgrass&&Math.abs(thisObj.lattices[i].row - lat.row) < 2 && Math.abs(thisObj.lattices[i].column - lat.column) < 2){
if(lat&&lat.element){
if(lat.element.type==ElementType.CANNO&&!lat.grass){
turfCp.push(i);
}else if(lat.element.type==ElementType.Pongo&&!lat.element.hasState(StateType.PongoLockState)&&!lat.grass){
turfCp.push(i);
}
}
}
if (Tool.judgeEliminate(thisObj.lattices[i]) && if (Tool.judgeEliminate(thisObj.lattices[i]) &&
(Math.abs(thisObj.lattices[i].row - lat.row) < 2 && Math.abs(thisObj.lattices[i].column - lat.column) < 2)) { (Math.abs(thisObj.lattices[i].row - lat.row) < 2 && Math.abs(thisObj.lattices[i].column - lat.column) < 2)) {
if (thisObj.eliminatedElements.indexOf(thisObj.lattices[i].index) < 0) { if (thisObj.eliminatedElements.indexOf(thisObj.lattices[i].index) < 0) {
...@@ -41,9 +52,13 @@ export default async (thisObj: MainScene) => { ...@@ -41,9 +52,13 @@ export default async (thisObj: MainScene) => {
} }
} }
} }
if(grassArr.length>0){
thisObj.changeGroGrass(grassArr); thisObj.changeGroGrass(grassArr);
} }
if(turfCp.length>0){
thisObj.changeGroGrassCp(turfCp);
}
}
await wait(500); await wait(500);
// await wait(500+1000); // await wait(500+1000);
......
...@@ -1332,6 +1332,11 @@ export class Tool { ...@@ -1332,6 +1332,11 @@ export class Tool {
let ele = lat.element; let ele = lat.element;
let canChosen = this.judgeChosen(ele); let canChosen = this.judgeChosen(ele);
if(!canChosen){ if(!canChosen){
if(ele.type==ElementType.CANNO){
return true;
}else if(ele.type==ElementType.Pongo&&!ele.hasState(StateType.PongoLockState)){
return true;
}
return false; return false;
} }
if(!lat.grass){ if(!lat.grass){
...@@ -1356,6 +1361,12 @@ export class Tool { ...@@ -1356,6 +1361,12 @@ export class Tool {
let ele = lat.element; let ele = lat.element;
let canChosen = this.judgeChosen(ele); let canChosen = this.judgeChosen(ele);
if(!canChosen){ if(!canChosen){
if(ele.type==ElementType.CANNO){
console.log("炮台可以上草坪");
return true;
}else if(ele.type==ElementType.Pongo&&!ele.hasState(StateType.PongoLockState)){
return true;
}
return false; return false;
} }
if(lat.grass){ if(lat.grass){
......
...@@ -22,7 +22,7 @@ export const Chapters27: ChapterData[] = [ ...@@ -22,7 +22,7 @@ export const Chapters27: ChapterData[] = [
2, 1, 2, 1, 1, 2, 1, 2, 1, 2, 1, 2, 1, 1, 2, 1, 2, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 19, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
16, 2, 16, 2, 1, 6, 6, 6, 6, 16, 2, 16, 2, 1, 6, 6, 6, 6,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
......
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