Commit 8d38115d authored by zjz1994's avatar zjz1994

樱花功能暂存

parent a1c0fc85
......@@ -1365,6 +1365,9 @@ export default class MainScene extends Scene {
}else{
this.cherryData = new Array();
}
this.freeCherryData = new Array();
this.amoveCherryData = new Array();
this.waitCherry = false;
for(var i=0;i<this.cherryData.length;i++){
var icherydata = this.cherryData[i];
......@@ -3726,6 +3729,8 @@ export default class MainScene extends Scene {
mainidxs.push(canno.index);
//特效消除猩猩--炮弹
var lockPongoArr:Array<{idx:number,part:string}> = new Array();
//特效消除樱花-炮弹
var lockCherryArr:Array<number> = new Array();
for(var j=0;j<cannoFireArr.length;j++){
var jemitidx = cannoFireArr[j];
var lat = this.lattices[jemitidx];
......@@ -3767,10 +3772,12 @@ export default class MainScene extends Scene {
//提前消除了,需要修改成炮台的消除时消除
if(lat&&lat.element){
var isbreak = this.solveOneTxPgEle(lat.element.row,lat.element.column,lockPongoArr);
var isbreak = this.solveOneTxPgEle(lat.element.row,lat.element.column,lockPongoArr,lockCherryArr);
}
}
this.solvePongoEle(lockPongoArr);
this.solveCherryEle(lockCherryArr);
var firecannoidx = canno.index;
if(this.fireteamCannoArr.indexOf(firecannoidx)==-1){
this.fireteamCannoArr.push(firecannoidx);
......@@ -5348,6 +5355,8 @@ export default class MainScene extends Scene {
var indexs = this.getNextIndexs(lat0);
var lockPongoArr:Array<{idx:number,part:string}> = new Array();
var lockCherryArr:Array<number> = new Array();
for(let i = 0; i < indexs.length; i++) {
let index = indexs[i];
let lat = this.lattices[index];
......@@ -5370,10 +5379,17 @@ export default class MainScene extends Scene {
}
// }
}
var ischery = this.checkisCherry(index);
if(ischery&&lat.element.activeStatus==0){
lockCherryArr.push(index);
}
}
//本次全地图解锁的猩猩部分处理
this.solvePongoEle(lockPongoArr);
this.solveCherryEle(lockCherryArr);
}
//消除动画中的猩猩解锁状态
changePongoStat(ele:Element){
......@@ -5411,17 +5427,18 @@ export default class MainScene extends Scene {
//横纵特效穿过解救猩猩
checkPongoHVEle(row:number,col:number,dir:string){
var lockPongoArr:Array<{idx:number,part:string}> = new Array();
var lockCherryArr:Array<number> = new Array();
if(dir=="hor"){
//向左穿透猩猩
for(var i=col-1;i>=0;i--){
var isbreak = this.solveOneTxPgEle(row,i,lockPongoArr);
var isbreak = this.solveOneTxPgEle(row,i,lockPongoArr,lockCherryArr);
if(isbreak==2){
break;
}
}
//向右穿透猩猩
for(var i=col+1;i<Tool.colNum;i++){
var isbreak = this.solveOneTxPgEle(row,i,lockPongoArr);
var isbreak = this.solveOneTxPgEle(row,i,lockPongoArr,lockCherryArr);
if(isbreak==2){
break;
}
......@@ -5429,14 +5446,14 @@ export default class MainScene extends Scene {
}else if(dir=="vir"){
//向上
for(var i=row-1;i>=0;i--){
var isbreak = this.solveOneTxPgEle(i,col,lockPongoArr);
var isbreak = this.solveOneTxPgEle(i,col,lockPongoArr,lockCherryArr);
if(isbreak==2){
break;
}
}
//向下
for(var i=row+1;i<Tool.rowNum;i++){
var isbreak = this.solveOneTxPgEle(i,col,lockPongoArr);
var isbreak = this.solveOneTxPgEle(i,col,lockPongoArr,lockCherryArr);
if(isbreak==2){
break;
}
......@@ -5444,8 +5461,10 @@ export default class MainScene extends Scene {
}
//本次特效消除的猩猩
this.solvePongoEle(lockPongoArr);
//特效消除樱花
this.solveCherryEle(lockCherryArr);
}
solveOneTxPgEle(row:number,col:number,lockPongoArr:Array<{idx:number,part:string}>){
solveOneTxPgEle(row:number,col:number,lockPongoArr:Array<{idx:number,part:string}>,lockCherryArr:Array<number>){
var eleidx = Tool.rcToIndex(row,col);
if (!this.lattices[eleidx] || !this.lattices[eleidx].element) return 1;
var lat = this.lattices[eleidx];
......@@ -5468,6 +5487,10 @@ export default class MainScene extends Scene {
}
}
var ischery = this.checkisCherry(eleidx);
if(ischery&&lat.element.activeStatus==0){
lockCherryArr.push(eleidx);
}
return 3;
}
solvePongoEle(lockPongoArr:Array<{idx:number,part:string}>){
......@@ -7436,7 +7459,12 @@ export default class MainScene extends Scene {
for(var i=0;i<this.cherryData.length;i++){
var icherydata = this.cherryData[i];
if(icherydata.indexOf(idx)!=-1){
return true;
var ilat = this.lattices[idx];
if(ilat&&ilat.element&&ilat.element.type==ElementType.cherry){
return true;
}else{
return false;
}
}
}
return false;
......@@ -7464,7 +7492,16 @@ export default class MainScene extends Scene {
}
//特效激活樱花
solveCherryEle(cherryArr:Array<number>){
for(var i=0;i<cherryArr.length;i++){
var icheryidx = cherryArr[i];
var lat = this.lattices[icheryidx];
if(lat){
var ele = lat.element;
if(ele&&ele.type==ElementType.cherry&&ele.activeStatus==0){
this.activeCherry(icheryidx);
}
}
}
}
//激活樱花
activeCherry(idx:number){
......
......@@ -7,46 +7,47 @@ export const Chapters32: ChapterData[] = [
bubbleProbability: 0, stepCount: 26,
passTarget: { type: 1, elements: [ { type: 9, count: 71 }, { type: 0, count: 102 } ] }, starScores: [ 15000, 20000, 25000 ],
map: {
lattices: [
1, 1, 0, 3, 3, 3, 0, 3, 3,
1, 1, 0, 3, 3, 3, 0, 3, 3,
3, 3, 0, 3, 3, 3, 0, 3, 3,
3, 3, 0, 3, 3, 3, 0, 3, 3,
3, 3, 61, 3, 3, 3, 61, 3, 3,
3, 3, 6, 3, 3, 3, 6, 3, 3,
3, 3, 61, 3, 3, 3, 61, 3, 3,
3, 3, 6, 3, 3, 3, 6, 3, 3,
3, 3, 0, 3, 3, 3, 0, 3, 3 ],
connectedLats: [], conveyor: [], conveyorConnectedLats: [], WORMHOLE: [],
elements: [
2, 1, 1, 1, 1, 1, 1, 1, 2,
1, 2, 1, 1, 1, 1, 1, 2, 1,
2, 1, 1, 1, 14, 1, 1, 1, 2,
1, 2, 1, 1, 1, 1, 1, 2, 1,
2, 1, 1, 1, 1, 1, 1, 1, 2,
1, 1, 9, 4, 4, 4, 9, 1, 1,
1, 1, 1, 4, 4, 4, 1, 1, 1,
1, 1, 9, 4, 4, 4, 9, 1, 1,
1, 1, 1, 5, 5, 5, 1, 1, 1 ],
baseElements: [
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,
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,
0, 0, 0, 0, 0, 0, 0, 0, 0 ],
lattices: [
0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 1, 0, 0, 0, 1, 0, 0,
0, 1, 1, 1, 0, 1, 1, 1, 0,
1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1,
0, 1, 1, 8, 1, 1, 1, 8, 0,
0, 0, 1, 1, 1, 1, 1, 0, 0,
0, 0, 0, 1, 1, 1, 0, 0, 0,
0, 0, 0, 0, 1, 0, 0, 0, 0,
],
generateLats: [
{ index: 11, type: [0], cus: [] },
{ index: 15, type: [0], cus: [] },
],
// connectedLats: [[0, 18], [1, 19], [2, 20]],
elements: [
0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 1, 0, 0, 0, 1, 0, 0,
0, 1, 1, 1, 0, 1, 1, 1, 0,
1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1,
0, 1, 1, 1, 1, 1, 1, 1, 0,
0, 0, 1, 1, 1, 1, 1, 0, 0,
0, 0, 0, 1, 1, 1, 0, 0, 0,
0, 0, 0, 0, 1, 0, 0, 0, 0,
],
baseElements: [
0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 20, 0, 0, 0, 20, 0, 0,
0, 20, 10, 20, 0, 20, 10, 20, 0,
20, 10, 20, 10, 20, 10, 20, 10, 20,
20, 10, 20, 20, 10, 20, 20, 10, 20,
0, 20, 10, 20, 10, 20, 10, 20, 0,
0, 0, 20, 10, 20, 10, 20, 0, 0,
0, 0, 0, 20, 10, 20, 0, 0, 0,
0, 0, 0, 0, 20, 0, 0, 0, 0,
],
recycles: [],
cherrydata:[
[0,1,10,9],
],
generateLats: [
{ index: 0, type: null }, { index: 1, type: null },
{ index: 3, type: null }, { index: 4, type: null },
{ index: 5, type: null }, { index: 7, type: null },
{ index: 8, type: null } ] }
[38,39,40,41,50,59,58,57,56,47],
] }
},
]
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