Commit e7adeb9c authored by zjz1994's avatar zjz1994

调整炮台逻辑

parent 7062d043
...@@ -2320,12 +2320,13 @@ export default class MainScene extends Scene { ...@@ -2320,12 +2320,13 @@ export default class MainScene extends Scene {
var jemitidx = cannoFireArr[j]; var jemitidx = cannoFireArr[j];
var lat = this.lattices[jemitidx]; var lat = this.lattices[jemitidx];
var caneliminate = Tool.judgeEliminate(lat); var caneliminate = Tool.judgeEliminate(lat);
if(lat&&(caneliminate||lat.element.type==ElementType.CANNO_BLOCK)){ var iscannoblock = Tool.judgeIscannoBlock(lat);
if(lat&&(caneliminate||iscannoblock)){
if(this.eliminatedElements.indexOf(jemitidx)==-1){ if(this.eliminatedElements.indexOf(jemitidx)==-1){
this.eliminatedElements.push(jemitidx); this.eliminatedElements.push(jemitidx);
} }
//加分 //加分
if(lat.element.type==ElementType.CANNO_BLOCK){ if(iscannoblock){
// console.log("炮台石头消除"); // console.log("炮台石头消除");
break; break;
} }
......
...@@ -372,6 +372,21 @@ export class Tool { ...@@ -372,6 +372,21 @@ export class Tool {
return true return true
} }
} }
/**
* 判断是否是炮台石头
* @param lat
*/
public static judgeIscannoBlock(lat:Lattice){
if(!lat||!lat.element){
return false;
}
else if(lat.element.type==ElementType.CANNO_BLOCK){
return true;
}
else{
return false;
}
}
/** /**
* 判断格子上是基础元素,包括各种状态的 * 判断格子上是基础元素,包括各种状态的
......
...@@ -6,59 +6,92 @@ import { ElementType } from "../enum/ElementType"; ...@@ -6,59 +6,92 @@ import { ElementType } from "../enum/ElementType";
export const Chapters22: ChapterData[] = [ export const Chapters22: ChapterData[] = [
//551 //551
{ {
baseElementTypes: [0, 1, 2, 3], baseElementTypes: [0, 1, 2, 3, 4],
bubbleProbability: 0, bubbleProbability: 0,
stepCount: 25, stepCount: 35,
passTarget: { passTarget: {
type: PassType.ELEMENT_TARGET, type: 1,
elements: [ elements: [{
{ type: 1,
type: ElementType.CHICKEN, count: 155
count: 45, }, {
}, type: 34,
], count: 15
}, }]
starScores: [1000, 5000, 10000], },
map: { starScores: [15000, 20000, 25000],
lattices: [ map: {
0, 0, 0, 0, 0, 0, 0, 0, 0, lattices: [
0, 0, 1, 0, 0, 0, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1,
0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 0, 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, 0, 1, 0, 1, 1, 1,
0, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1,
0, 0, 1, 1, 1, 1, 1, 0, 0, 1, 4, 1, 0, 1, 0, 1, 4, 1,
0, 0, 0, 1, 1, 1, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1,
0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1,
], 1, 0, 1, 1, 1, 1, 1, 0, 1
generateLats: [ ],
{ index: 11, type: [0], cus: [] }, connectedLats: [],
{ index: 15, type: [0], cus: [] }, conveyor: [
], [9, 63],
// connectedLats: [[0, 18], [1, 19], [2, 20]], [17, 71]
elements: [ ],
0, 0, 0, 0, 0, 0, 0, 0, 0, conveyorConnectedLats: [
0, 0, 1, 0, 0, 0, 1, 0, 0, [63, 9],
0, 1, 1, 1, 0, 1, 1, 1, 0, [71, 17]
1, 1, 1, 1, 1, 1, 1, 1, 1, ],
1, 1, 1, 1, 1, 1, 18, 1, 1, elements: [
0, 1, 1, 1, 1, 1, 1, 1, 0, 1, 18, 1, 1, 1, 1, 1, 1, 1,
0, 0, 1, 19, 1, 18, 1, 0, 0, 1, 1, 1, 1, 2, 1, 1, 18, 1,
0, 0, 0, 1, 1, 1, 0, 0, 0, 1, 1, 1, 2, 2, 2, 1, 1, 1,
0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 6, 1, 1, 1, 1, 1, 6, 1,
], 1, 1, 1, 1, 16, 1, 1, 1, 1,
baseElements: [ 1, 1, 1, 1, 16, 1, 1, 1, 1,
0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 16, 1, 1, 1, 1,
0, 0, 20, 0, 0, 0, 20, 0, 0, 5, 6, 1, 1, 2, 1, 1, 6, 5,
0, 20, 10, 20, 0, 20, 10, 20, 0, 1, 1, 1, 2, 2, 2, 1, 1, 1
20, 10, 20, 10, 20, 10, 20, 10, 20, ],
20, 10, 20, 20, 10, 20, 20, 10, 20, baseElements: [
0, 20, 10, 20, 10, 20, 10, 20, 0, 0, 40, 0, 0, 0, 0, 0, 0, 0,
0, 0, 20, 10, 20, 10, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0,
0, 0, 0, 20, 10, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
], 0, 0, 0, 0, 0, 0, 0, 0, 0,
// recycles: [70, 71, 72, 73] 0, 0, 0, 0, 0, 0, 0, 0, 0,
}, 0, 0, 0, 0, 0, 0, 0, 0, 0,
} 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0
],
recycles: [],
generateLats: [{
index: 0,
type: null
}, {
index: 1,
type: null
}, {
index: 2,
type: null
}, {
index: 3,
type: null
}, {
index: 4,
type: null
}, {
index: 5,
type: null
}, {
index: 6,
type: null
}, {
index: 7,
type: null
}, {
index: 8,
type: null
}]
}
}
] ]
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