Commit 87826b84 authored by zjz1994's avatar zjz1994

调整特效铺草

parent 986a796d
......@@ -397,7 +397,6 @@ export default class MainScene extends Scene {
turfingArr:Array<number> = []
constructor(){
super();
// console.log('mainscene-------constructor');
window['gm'] = this.gm;
//基础ui
//目标
......@@ -498,7 +497,6 @@ export default class MainScene extends Scene {
super.start();
this.resetMainScene();
// console.log("mainscene---------start",data,data.chapter);
// window['gm'] = this.gm;
//第几关
this.chapter = (data && data.chapter) ? data.chapter : 1;
......@@ -691,11 +689,9 @@ export default class MainScene extends Scene {
mvdata = cannoparticlemvdata;
}
if(mvdata){
// console.log("复用mvdata,免加载");
if(!mv){
mv = new window["SVGA"].EgretMovieClip(mvdata);
}else{
// console.log("复用了炮台动画");
}
this.initCannoMv(mv,jsvgname,icannobianhao);
}else{
......@@ -797,7 +793,6 @@ export default class MainScene extends Scene {
//该遍历之后尽量简化下
getCannoByBianhao(cannoidx:number):Element{
var canno:Element;
// console.log("获取大炮",cannoidx,this.cannoidxArr);
for(var i=0;i<this.cannoidxArr.length;i++){
var ilattice = this.lattices[this.cannoidxArr[i]];
if(ilattice&&ilattice.element&&ilattice.element.type==ElementType.CANNO){
......@@ -1086,7 +1081,6 @@ export default class MainScene extends Scene {
onehole.y = jholepos[1];
onehole.name = "wormhole_"+i+"_"+j;
// console.log("添加了一个黑洞",onehole);
}
}else{
console.error(i+"号线仅存在一个黑洞????");
......@@ -1143,7 +1137,6 @@ export default class MainScene extends Scene {
if(isGrass(latticesD[i])){
this.lattices[i].grass = latticeblock.grass;
console.log("石门上的grass",i,this.lattices[i].grass);
}
}
if(latticeDisplay) {
......@@ -1210,9 +1203,7 @@ export default class MainScene extends Scene {
var elements = this.chapterData.map.elements || Tool.setNumber01(this.chapterData.map.lattices.slice());
//猩猩初始时加入
var pongoArr:Array<{tl:number,tr:number,bl:number,br:number}> = new Array();
// console.log("开始initElement",this.chapter);
for(let i = 0; i < elements.length; i++) {
// console.log("initElement遍历-------",i);
//如果对应格子为空,直接跳过,
if(!this.lattices[i]) continue;
var p = Tool.getPositionByIndex(i);
......@@ -1237,7 +1228,6 @@ export default class MainScene extends Scene {
if(!ele) {
ele = new Element(type)
} else {
// console.log("initElement复用ele",i,elements[i],Tool.indexToRc(i));
ele.reset(type)
}
ele.x = p[0];
......@@ -1273,7 +1263,6 @@ export default class MainScene extends Scene {
if(!lol) {
lol = new Element(ElementType.LOLLIPOP)
} else {
// console.log("initElement复用ele",i,elements[i],Tool.indexToRc(i));
lol.reset(ElementType.LOLLIPOP)
}
lol.x = p[0];
......@@ -1287,7 +1276,6 @@ export default class MainScene extends Scene {
if(!rock) {
rock = new Element(ElementType.ROCK)
} else {
// console.log("initElement复用ele",i,elements[i],Tool.indexToRc(i));
rock.reset(ElementType.ROCK)
}
rock.x = p[0];
......@@ -1388,7 +1376,6 @@ export default class MainScene extends Scene {
var onepongodata = this.createOnePongoByTl(i);
pongoArr.push(onepongodata);
}else{
// console.log("是已经创建的猩猩的一部分")
}
//猩猩每部分默认被锁住
let pongo:Element = Tool.getElement(ElementType.Pongo);
......@@ -1631,7 +1618,6 @@ export default class MainScene extends Scene {
//侦听事件
initEvents() {
// console.log('mainscene-----------开始监听事件----initEvents');
this.addEventListener(egret.Event.ENTER_FRAME, this.onEnterFrame, this);
this.settingBtn.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_settingBtn, this)
this.questionBtn.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_questionBtn, this)
......@@ -1658,7 +1644,6 @@ export default class MainScene extends Scene {
removeEvents() {
// console.log('mainscene-------removeEvents');
this.removeEventListener(egret.Event.ENTER_FRAME, this.onEnterFrame, this);
this.settingBtn.removeEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_settingBtn, this);
this.questionBtn.removeEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_questionBtn, this)
......@@ -1701,7 +1686,6 @@ export default class MainScene extends Scene {
this.cannoEffect = new Array();
}
destroy() {
// console.log("mainscene-------------destroy");
super.destroy();
}
......@@ -1941,7 +1925,6 @@ export default class MainScene extends Scene {
// }
var grassArr = new Array();
var canturgrass = this.judgeTurfing(index);
// console.log("能够蔓延出去",canturgrass);
//新增石头阻挡
var elimitarr = this.getEliPassCannoStone(rc[0],rc[1]);
for(var j=0;j<elimitarr.length;j++){
......@@ -2484,12 +2467,9 @@ export default class MainScene extends Scene {
//能掉落,记录元素动画
anis.push({ele: latFall.element, indexs: [{index: indexMy, type: type}]});
//去掉
// console.log(emptys)
// console.log(indexFall)
emptys.splice(i, 1);
//在剩下emptys的加上一个,正上方的那个
// Tool.insertEX(indexFall, emptys)
// console.log(emptys)
// emptys.push(indexFall)
emptys.splice(i + 1, 0, indexFall);
// Tool.removeEle(indexMy,emptys)
......@@ -2910,7 +2890,6 @@ export default class MainScene extends Scene {
this.scoreAnis.length = 0;
this.score += scoreAll;
this.oneStepScore += scoreAll;
// console.log(this.score)
//this.eliminatedElements已为0;对有特效的特殊处理,又会添加进eliminatedElements,
//必须在上面得分动效后,因为下面这波重新出现的元素要在下一次出现
this.effectEliminate(effectIndexs,pcannostatArr);
......@@ -2994,7 +2973,6 @@ export default class MainScene extends Scene {
// return;
// }
if(this.freepongoArr.length==1){//拍块
// console.log("一只猩猩拍块");
// this.pongoPaiKuang(this.freepongoArr[0]);
// var pongotl = this.freepongoArr.shift();
// if(this.gopongoArr.indexOf(pongotl)==-1){
......@@ -3025,7 +3003,6 @@ export default class MainScene extends Scene {
return;
}
if(this.freepongoArr.length>1){//清场
// console.log("多只猩猩清场",this.freepongoArr.length,JSON.stringify(this.freepongoArr));
// this.pongoClearScene();
// for(var fp=this.freepongoArr.length-1;fp>=0;fp--){
// var fptl = this.freepongoArr.splice(fp,1)[0];
......@@ -3093,7 +3070,6 @@ export default class MainScene extends Scene {
//棒棒糖消除
var recoverlp1 = this.checkEmtbbt();
if(recoverlp1>0){
// console.log("传送带棒棒糖消除");
this.fall(()=>{
this.fallCallback();
})
......@@ -3137,7 +3113,6 @@ export default class MainScene extends Scene {
this._checkMtag.block = false;
const blockResult = await this.checkAllBlock();
if(blockResult && blockResult.length && blockResult.some(item => item)) {
// console.log('有至少一个门翻转过来了', blockResult);
this.eliminate();
return;
}
......@@ -3208,13 +3183,29 @@ export default class MainScene extends Scene {
//如果早已通关,正在结算
if(this.hasPassed) {
// console.log("结算检测---------------------弹窗检测3");
//如果原先特效还有,
if(!this.isCountingTime) {
this.terminateSteps();
}
//如果只有步数转化的,不能再进结算,
else {
var effectElements = [], elements = [];
for(var i = Tool.colNum * Tool.rowNum - 1; i >= 0; i--) {
var lat = this.lattices[i];
if(Tool.judgeBaseEle(lat)&&!lat.element.hasState(StateType.BLOCK_LOCK)) {
if(lat.element.effectType != null) {
effectElements.push(i);
} else {
elements.push(lat.element)
}
}
}
if(effectElements.length) {
Array.prototype.push.apply(this.eliminatedElements, effectElements);
this.eliminate();
}else{
console.log("可以结束");
}
return;
//通关了
//提交分数等
......@@ -3476,7 +3467,6 @@ export default class MainScene extends Scene {
}
//加分
if(iscannoblock){
// console.log("炮台石头消除");
break;
}
......@@ -3563,7 +3553,6 @@ export default class MainScene extends Scene {
if(inidx!=-1){
this.wormFireworks.splice(inidx,1);
if(this.wormFireworks.length==0&&this._checkMtag.wormhole&&!this.incheckFall){
// console.log("黑洞上的烟花播放完毕");
this.aiMotionCheckDieMap();
}
}
......@@ -3572,13 +3561,11 @@ export default class MainScene extends Scene {
* 果冻蔓延和气泡变色需要重新检查死图
*/
async aiMotionCheckDieMap() {
// console.log("重置点击验证");
this.incheckFall = false;
//黑洞转移
if(this._checkMtag.wormhole){
let wormholes = this.chapterData.map.WORMHOLE;
if(wormholes&&wormholes.length>0){
// console.log("虫洞位移检测",this.wormHolePromise.length);
if(this.wormFireworks.length>0){
return// console.error("等待烟花放完");
}
......@@ -3588,10 +3575,8 @@ export default class MainScene extends Scene {
});
// console.log("开始黑洞转移");
await doWormHoleAI(this);
// console.log("黑洞转移完毕");
//黑洞转移,使黑洞占位变空,需要添加到emptys中,
// bug修复:黑洞转移会使空的变为有东西的,需要把emptys中对应的去掉
......@@ -3605,7 +3590,6 @@ export default class MainScene extends Scene {
if(_wlattice&&_wlattice.element){
var isInempty = this.emptys.indexOf(_wlattice.index);
if(isInempty!=-1){
// console.log("bug修复,黑洞转移去空");
this.emptys.splice(isInempty,1);
}
}
......@@ -3615,7 +3599,6 @@ export default class MainScene extends Scene {
//棒棒糖消除
var recoverlp2 = this.checkEmtbbt();
if(recoverlp2>0){
// console.log("传送带棒棒糖消除");
// this.fall(()=>{
// this.fallCallback();
// })
......@@ -3657,7 +3640,6 @@ export default class MainScene extends Scene {
this.gameGuide.show()
}
;
// console.log("重置点击222");
//允许移动
this.enableMouseEvt(true);
//检查是否有红包炸弹弹框;有就弹出;然后置空
......@@ -4289,7 +4271,6 @@ export default class MainScene extends Scene {
if(!ele)continue;
var p = Tool.getPositionByIndex(index);
var canturgrass = this.judgeTurfing(index);
console.log("特效传播草坪",canturgrass);
var grassArr = new Array();
var turfCp = new Array();
switch(ele.effectType) {
......@@ -4325,11 +4306,11 @@ export default class MainScene extends Scene {
this.lattices[i].element.effectType != EffectType.MAGICLION && //不是魔力鸟
this.lattices[i].element.type == type //类型相等
) {
if(canturgrass&&Tool.judgeTurfto(this.lattices[i])){
grassArr.push(i);
}
if(this.eliminatedElements.indexOf(i) < 0 && effectIndexs.indexOf(i) < 0) {
if(canturgrass&&Tool.judgeTurfto(this.lattices[i])){
grassArr.push(i);
}
this.eliminatedElements.push(i);
//无特效未枷锁,无毛球的参与旋转
if(Tool.judgeMagicRotate(this.lattices[i].element)) {
......@@ -4370,10 +4351,11 @@ export default class MainScene extends Scene {
}
if(Tool.judgeEliminate(this.lattices[i]) &&
(Math.abs(this.lattices[i].row - lat.row) < 2 && Math.abs(this.lattices[i].column - lat.column) < 2)) {
if(this.eliminatedElements.indexOf(i) < 0 && effectIndexs.indexOf(i) < 0) {
if(canturgrass&&Tool.judgeTurfto(this.lattices[i])){
grassArr.push(i);
}
if(this.eliminatedElements.indexOf(i) < 0 && effectIndexs.indexOf(i) < 0) {
this.eliminatedElements.push(i);
if(this.lattices[i].element.type == ElementType.FISH) {
this.lattices[i].element.nextFishState();
......@@ -4420,10 +4402,11 @@ export default class MainScene extends Scene {
for(var j1=0;j1<elimitarr.length;j1++){
var jelidx = elimitarr[j1];
var jlat = this.lattices[jelidx];
if(canturgrass&&Tool.judgeTurfto(jlat)){
grassArr.push(jelidx);
}
if(this.eliminatedElements.indexOf(jelidx)==-1&&effectIndexs.indexOf(jelidx)==-1){
if(canturgrass&&Tool.judgeTurfto(jlat)){
grassArr.push(jelidx);
}
this.eliminatedElements.push(jelidx);
if(jlat.element.type==ElementType.FISH){
jlat.element.nextFishState();
......@@ -4483,10 +4466,11 @@ export default class MainScene extends Scene {
for(var j1=0;j1<elimitarr.length;j1++){
var jelidx = elimitarr[j1];
var jlat = this.lattices[jelidx];
if(canturgrass&&Tool.judgeTurfto(jlat)){
grassArr.push(jelidx);
}
if(this.eliminatedElements.indexOf(jelidx)==-1&&effectIndexs.indexOf(jelidx)==-1){
if(canturgrass&&Tool.judgeTurfto(jlat)){
grassArr.push(jelidx);
}
this.eliminatedElements.push(jelidx);
if(jlat.element.type==ElementType.FISH){
jlat.element.nextFishState();
......@@ -4515,11 +4499,9 @@ export default class MainScene extends Scene {
break;
}
if(grassArr.length>0){
console.log("特效传播草坪",JSON.stringify(grassArr));
this.changeGroGrass(grassArr);
}
if(turfCp.length>0){
console.log("炮台猩猩草坪",JSON.stringify(turfCp))
this.changeGroGrassCp(turfCp);
}
}
......@@ -4569,7 +4551,7 @@ export default class MainScene extends Scene {
}
//如果特效有,消除特效
if(effectElements.length) {
console.log("结算检测---------------------有需要特效消除",JSON.stringify(effectElements));
// console.log("结算检测---------------------有需要特效消除",JSON.stringify(effectElements));
Array.prototype.push.apply(this.eliminatedElements, effectElements);
this.eliminate();
} else {
......
......@@ -49,7 +49,7 @@ export const Chapters28: ChapterData[] = [
0, 91, 1, 1, 1, 1, 1, 1, 0,
1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1,
4, 4, 4, 4, 4, 4, 4, 4, 4,
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, 8, 1, 3, 0, 0, 0 ], connectedLats: [],
......@@ -61,9 +61,9 @@ export const Chapters28: ChapterData[] = [
1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1,
4, 19, 19, 1, 1, 1, 1, 1, 4,
2, 1, 1, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2,
1, 5, 4, 5, 12, 5, 4, 5, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 4, 1, 12, 1, 4, 1, 1,
1, 1, 4, 4, 4, 4, 4, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1 ],
baseElements: [
......
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