Commit c8711f99 authored by wildfirecode's avatar wildfirecode

Merge branch 'hotfix20200330_' of gitlab2.dui88.com:wanghongyuan/xiaoxiaole into hotfix20200330_

parents f06e7029 8cfdbb00
...@@ -2424,12 +2424,22 @@ export default class MainScene extends Scene { ...@@ -2424,12 +2424,22 @@ export default class MainScene extends Scene {
} }
} }
} }
setTimeout(()=>{ canno.fireCanno();
this.eliminate();
// setTimeout(()=>{
// this.eliminate();
this.readyCannoArr.shift(); // this.readyCannoArr.shift();
canno.resetCannoStat(); // canno.resetCannoStat();
},200); // },200);
}
/**
* 炮台发射完毕,开始炮台消除
*/
callBackFireCanno(canno:Element){
this.eliminate();
this.readyCannoArr.shift();
canno.resetCannoStat();
} }
checkAllBlock() { checkAllBlock() {
// this.lattices.filter(item => item.block).forEach((item) => { // this.lattices.filter(item => item.block).forEach((item) => {
......
...@@ -6,92 +6,59 @@ import { ElementType } from "../enum/ElementType"; ...@@ -6,92 +6,59 @@ import { ElementType } from "../enum/ElementType";
export const Chapters22: ChapterData[] = [ export const Chapters22: ChapterData[] = [
//551 //551
{ {
baseElementTypes: [0, 1, 2, 3, 4], baseElementTypes: [0, 1, 2, 3],
bubbleProbability: 0, bubbleProbability: 0,
stepCount: 35, stepCount: 25,
passTarget: { passTarget: {
type: 1, type: PassType.ELEMENT_TARGET,
elements: [{ elements: [
type: 1, {
count: 155 type: ElementType.CHICKEN,
}, { count: 45,
type: 34, },
count: 15 ],
}]
}, },
starScores: [15000, 20000, 25000], starScores: [1000, 5000, 10000],
map: { map: {
lattices: [ 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,
1, 1, 1, 0, 1, 0, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 0, 1, 0, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 4, 1, 0, 1, 0, 1, 4, 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, 1, 1, 1, 1, 1, 1, 0,
1, 0, 1, 1, 1, 1, 1, 0, 1 0, 0, 1, 1, 1, 1, 1, 0, 0,
], 0, 0, 0, 1, 1, 1, 0, 0, 0,
connectedLats: [], 0, 0, 0, 0, 1, 0, 0, 0, 0,
conveyor: [
[9, 63],
[17, 71]
], ],
conveyorConnectedLats: [ generateLats: [
[63, 9], { index: 11, type: [0], cus: [] },
[71, 17] { index: 15, type: [0], cus: [] },
], ],
// connectedLats: [[0, 18], [1, 19], [2, 20]],
elements: [ elements: [
1, 19, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1, 1, 1, 1, 2, 1, 1, 20, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0,
1, 1, 1, 2, 2, 2, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0,
1, 6, 1, 1, 1, 1, 1, 6, 1, 1, 1, 19, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 16, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 16, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 0,
1, 22, 1, 1, 16, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 0, 0,
5, 6, 1, 1, 2, 1, 1, 6, 5, 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,
], ],
baseElements: [ 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, 20, 0, 0, 0, 20, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20, 10, 20, 0, 20, 10, 20, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 20, 10, 20, 10, 20, 10, 20, 10, 20,
0, 0, 0, 0, 0, 0, 0, 0, 0, 20, 10, 20, 20, 10, 20, 20, 10, 20,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20, 10, 20, 10, 20, 10, 20, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20, 10, 20, 10, 20, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 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,
], ],
recycles: [], // recycles: [70, 71, 72, 73]
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
}]
}
} }
] ]
...@@ -45,6 +45,7 @@ export class Element extends eui.Component { ...@@ -45,6 +45,7 @@ export class Element extends eui.Component {
fishCanEliFlag: boolean; fishCanEliFlag: boolean;
cannoMoveClip:any; cannoMoveClip:any;
cannoCnClip:any;
cannoStat:number[] = [1,61,121,181,241,361]; cannoStat:number[] = [1,61,121,181,241,361];
//尝试设置碰撞状态,如果之前被特效集中,那么可以设置碰撞状态。碰撞状态之后可以准备消除。 //尝试设置碰撞状态,如果之前被特效集中,那么可以设置碰撞状态。碰撞状态之后可以准备消除。
...@@ -219,14 +220,44 @@ export class Element extends eui.Component { ...@@ -219,14 +220,44 @@ export class Element extends eui.Component {
} }
changeShowCannoStat(){ changeShowCannoStat(){
this.cannolab.text = this._cannoStat+""; this.cannolab.text = this._cannoStat+"";
this.cannoMoveClip&&this.cannoMoveClip.gotoAndPlay(this.cannoStat[this._cannoStat]); this.changeMvPlay(this._cannoStat);
}
changeMvPlay(_stat:number){
if(this.cannoMoveClip){
var endframe:number;
var curframe:number = this.cannoMoveClip.currentFrame;
this.cannoMoveClip.gotoAndPlay(curframe,true);
if(_stat==0){
endframe = 1;
}else if(_stat==1){
endframe = 121;
}else if(_stat==2){
endframe = 181;
}else if(_stat==3){
endframe = 241;
}else if(_stat==4){
endframe = 361;
}
// this.changeShowCanno(curframe,endframe);
this.stopFrame = endframe;
}
} }
/**
* 炮台能否发射
*/
checkCannoStat(){ checkCannoStat(){
if(this._cannoStat==3){ if(this._cannoStat==3){
return true; return true;
} }
return false; return false;
} }
/**
* 炮台发射
*/
fireCanno(){
this.changeMvPlay(4);
}
resetCannoStat(){ resetCannoStat(){
this._cannoStat = 0; this._cannoStat = 0;
this.changeShowCannoStat(); this.changeShowCannoStat();
...@@ -235,6 +266,8 @@ export class Element extends eui.Component { ...@@ -235,6 +266,8 @@ export class Element extends eui.Component {
this._cannoStat += 1; this._cannoStat += 1;
if(this._cannoStat>3){ if(this._cannoStat>3){
this._cannoStat = 3; this._cannoStat = 3;
}else{//充能动画
this.cannoCnClip.gotoAndPlay(1,true);
} }
this.changeShowCannoStat(); this.changeShowCannoStat();
} }
...@@ -442,8 +475,9 @@ export class Element extends eui.Component { ...@@ -442,8 +475,9 @@ export class Element extends eui.Component {
this.addChild(this.cannolab); this.addChild(this.cannolab);
this.cannobox.visible = this.cannolab.visible = type == ElementType.CANNO; this.cannobox.visible = this.cannolab.visible = type == ElementType.CANNO;
this.showImage.visible = type != ElementType.CANNO; this.touchEnabled = this.showImage.visible = type != ElementType.CANNO;
this.cannolab.visible = false;
// this.cannolab.visible = false;
//鸡蛋 //鸡蛋
if (type == ElementType.CHICKEN_EGG) { if (type == ElementType.CHICKEN_EGG) {
this.chickenEgg = Pool.takeOut(RecoverName.CHICKEN_EGG) this.chickenEgg = Pool.takeOut(RecoverName.CHICKEN_EGG)
...@@ -477,51 +511,58 @@ export class Element extends eui.Component { ...@@ -477,51 +511,58 @@ export class Element extends eui.Component {
return; return;
} }
if (!svgaParser) svgaParser = new window["SVGA"].Parser(); if (!svgaParser) svgaParser = new window["SVGA"].Parser();
svgaParser.load(resPath + 'resource/assets/svgas/canno.svga', (videoItem) => { var svgas = ["canno","cannofire","cannoparticle","cannolight"];
this.cannoMoveClip = new window["SVGA"].EgretMovieClip(videoItem); for(let i=0;i<svgas.length;i++){
this.cannoMoveClip.lockStep = true; let mvname = svgas[i];
var mvwidth = 102; svgaParser.load(resPath + 'resource/assets/svgas/'+mvname+'.svga',(videoItem)=>{
var mvheight = 116; if(mvname=="canno"){
this.cannoMoveClip.x = (this.cannoboxwid-mvwidth)/2; this.cannoMoveClip = new window["SVGA"].EgretMovieClip(videoItem);
this.cannoMoveClip.y = 0; this.cannoMoveClip.lockStep = true;
this.cannobox.addChild(this.cannoMoveClip); var mvwidth = 102;
var mvheight = 116;
console.log("paotai",this.cannoMoveClip); this.cannoMoveClip.x = (this.cannoboxwid-mvwidth)/2;
this.cannoMoveClip.y = 0;
//1空,121,181,241,361 this.cannobox.addChild(this.cannoMoveClip);
// this.cannoMoveClip.gotoAndStop(1); this.cannoMoveClip.gotoAndStop(1);
// this.cannoMoveClip.gotoAndStop(120); this.cannoMoveClip.addEventListener(egret.Event.ENTER_FRAME,this.toFrameAni,this);
// this.cannoMoveClip.gotoAndStop(120); }else if(mvname=="cannolight"){
// this.cannoMoveClip.gotoAndStop(180); this.cannoCnClip = new window["SVGA"].EgretMovieClip(videoItem);
this.cannoMoveClip.addEventListener(egret.Event.ENTER_FRAME,this.listenCn,this); this.cannoCnClip.lockStep = true;
this.cannoMoveClip.addEventListener(egret.Event.COMPLETE,this.playComplete,this); var mvwidth = 400;
}); var mvheight = 400;
this.cannoCnClip.x = (this.cannoboxwid-mvwidth)/2;
this.cannoCnClip.y = (this.cannoboxhei-mvheight)/2;
this.cannobox.addChild(this.cannoCnClip);
this.cannoCnClip.gotoAndStop(1);
this.cannoCnClip.addEventListener(egret.Event.COMPLETE,this.addOnePower,this);
console.log("光圈cannocnClip",this.cannoCnClip);
}else if(mvname=="cannoparticle"){
}
});
}
} }
} }
// curframeidx:number = 1; stopFrame:number;
// testChangeMoveClip(num:number){
// this.curframeidx += num;
// this.cannoMoveClip.gotoAndStop(this.curframeidx);
// }
/** /**
* 炮台充能 * 炮台动画停止
* @param source
*/ */
listenCn(){ toFrameAni(){
var statend = this.cannoStat[this._cannoStat+1]; var curframe = this.cannoMoveClip.currentFrame;
if(this.cannoMoveClip.currentFrame>=statend){ if(curframe>=this.stopFrame){
// console.log("炮台阶段动画播放完毕",this.cannoMoveClip.currentFrame); this.cannoMoveClip.gotoAndStop(this.stopFrame);
this.cannoMoveClip.stop(); if(this.stopFrame==361){
console.log("炮台发射完毕");
}
} }
} }
/** /**
* 炮台动画播放一次完毕 * 光圈充能动画
*/ */
playComplete(){ addOnePower(){
this.cannoMoveClip.stop(); console.log("一次光圈充能");
this.cannoCnClip.gotoAndStop(1);
} }
/** /**
* 替换资源时,同时修改 * 替换资源时,同时修改
* @param source * @param source
...@@ -560,9 +601,9 @@ export class Element extends eui.Component { ...@@ -560,9 +601,9 @@ export class Element extends eui.Component {
egret.Tween.removeTweens(this.showImage); egret.Tween.removeTweens(this.showImage);
//类型重置,showImage修改 //类型重置,showImage修改
this._type = type; this._type = type;
this.cannolab.visible = type == ElementType.CANNO; this.cannobox.visible = this.cannolab.visible = type == ElementType.CANNO;
this.showImage.visible = type != ElementType.CANNO; this.showImage.visible = type != ElementType.CANNO;
// this.cannolab.visible = false;
this.changeSource("ele" + type + "_png"); this.changeSource("ele" + type + "_png");
//特效重置 //特效重置
......
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