Commit 80ec99ba authored by zjz1994's avatar zjz1994

炮台暂存

parent 5844ccd5
...@@ -305,6 +305,8 @@ export default class MainBase extends eui.UILayer { ...@@ -305,6 +305,8 @@ export default class MainBase extends eui.UILayer {
} }
RES.getResAsync("ele34_png"); RES.getResAsync("ele34_png");
RES.getResAsync("ele36_png"); RES.getResAsync("ele36_png");
RES.getResAsync("ele38_png");
RES.getResAsync("ele39_png");
for (var i = 1; i <= 27; i++) { for (var i = 1; i <= 27; i++) {
RES.getResAsync("bonusFra" + i + "_png") RES.getResAsync("bonusFra" + i + "_png")
} }
......
...@@ -97,7 +97,7 @@ ...@@ -97,7 +97,7 @@
"name": "h5" "name": "h5"
}, },
{ {
"keys": "bonusFra1_png,bonusFra10_png,bonusFra11_png,bonusFra12_png,bonusFra13_png,bonusFra14_png,bonusFra15_png,bonusFra16_png,bonusFra17_png,bonusFra18_png,bonusFra19_png,bonusFra2_png,bonusFra20_png,bonusFra21_png,bonusFra22_png,bonusFra23_png,bonusFra24_png,bonusFra25_png,bonusFra26_png,bonusFra27_png,bonusFra3_png,bonusFra4_png,bonusFra5_png,bonusFra6_png,bonusFra7_png,bonusFra8_png,bonusFra9_png,bonusShoot_png,bonusTime_png,boom1_png,boom10_png,boom11_png,boom12_png,boom13_png,boom14_png,boom15_png,boom16_png,boom17_png,boom2_png,boom3_png,boom4_png,boom5_png,boom6_png,boom7_png,boom8_png,boom9_png,boomBtn_png,chooseRect_png,dangqianfenshu_png,eggPiece1_png,eggPiece2_png,eggPiece3_png,eggPiece4_png,eggPiece5_png,eggStatus0_png,eggStatus1_png,eggStatus2_png,ele0_png,ele0Exp_png,ele0Line_png,ele1_png,ele1Exp_png,ele1Line_png,ele2_png,ele2Exp_png,ele2Line_png,ele3_png,ele3Exp_png,ele3Line_png,ele4_png,ele4Exp_png,ele4Line_png,ele5_png,ele6_png,ele7_png,ele8_png,ele9_png,eleDis1_png,eleDis10_png,eleDis11_png,eleDis12_png,eleDis13_png,eleDis14_png,eleDis15_png,eleDis16_png,eleDis17_png,eleDis18_png,eleDis19_png,eleDis2_png,eleDis3_png,eleDis4_png,eleDis5_png,eleDis6_png,eleDis7_png,eleDis8_png,eleDis9_png,exLighting1_png,exLighting11_png,exLighting14_png,exLighting16_png,exLighting18_png,exLighting19_png,exLighting21_png,exLighting23_png,exLighting25_png,exLighting27_png,exLighting29_png,exLighting3_png,exLighting32_png,exLighting34_png,exLighting5_png,exLighting7_png,exLighting9_png,greenCircleDown_png,greenCircleUp_png,guidePropBoom_png,guidePropCow_png,guidePropHammer_png,guidePropHand_png,guidePropMsgPanel_png,guidePropShoe_png,hammerBtn_png,ice2_png,ice3_png,ice4_png,ice5_png,ice6_png,jellyArrow_png,leftArrow_png,lightedStar_png,lineLight_png,lockVine_png,magicLion_png,magicLionBg_png,mainMusicBtnOff_png,mainMusicBtnOn_png,mainQuestionBtn_png,mainQuitBtn_png,mainSettingBg_png,mainSoundBtnOff_png,mainSoundBtnOn_png,main_mapbottom_png,playSceneBg_jpg,progressDown_png,propNum0_png,propNum1_png,propNum2_png,propNum3_png,propNum4_png,propNum5_png,propNum6_png,propNum7_png,propNum8_png,propNum9_png,propNumBg_png,rectLat_png,rightArrow_png,rightMark_png,rock2_png,rock3_png,rock4_png,rock5_png,rock6_png,scoreNumber0_png,scoreNumber1_png,scoreNumber2_png,scoreNumber3_png,scoreNumber4_png,scoreNumber5_png,scoreNumber6_png,scoreNumber7_png,scoreNumber8_png,scoreNumber9_png,setting_png,starProgress_png,stepAni1_png,stepAni10_png,stepAni11_png,stepAni2_png,stepAni3_png,stepAni4_png,stepAni5_png,stepAni6_png,stepAni7_png,stepAni8_png,stepAni9_png,stepBtn_png,stepNumber0_png,stepNumber1_png,stepNumber2_png,stepNumber3_png,stepNumber4_png,stepNumber5_png,stepNumber6_png,stepNumber7_png,stepNumber8_png,stepNumber9_png,stepsBoard_png,targetBoard_png,targetNumber0_png,targetNumber1_png,targetNumber2_png,targetNumber3_png,targetNumber4_png,targetNumber5_png,targetNumber6_png,targetNumber7_png,targetNumber8_png,targetNumber9_png,unlightedStar_png,yellowCircleDown_png,yellowCircleUp_png,yezi1_png,bubbleStar19_png,bubleEle0_png,bubleEle1_png,bubleEle2_png,bubleEle3_png,bubleEle4_png,bubbleStar1_png,bubbleStar2_png,bubbleStar3_png,bubbleStar4_png,bubbleStar5_png,bubbleStar6_png,bubbleStar7_png,bubbleStar8_png,bubbleStar9_png,bubbleStar10_png,bubbleStar11_png,bubbleStar12_png,bubbleStar13_png,bubbleStar14_png,bubbleStar15_png,bubbleStar16_png,bubbleStar17_png,bubbleStar18_png,ele11_png,ele10_png,brownBallFace_png,eyeDownLeft_png,eyeSingle_png,greyBallFace_png,eyeDownRight_png,hairballPiece9_png,hairballPiece8_png,hairballPiece7_png,hairballPiece6_png,hairballPiece5_png,hairballPiece4_png,hairballPiece3_png,hairballPiece2_png,hairballPiece11_png,hairballPiece10_png,hairballPiece1_png,hairballDisBg_png,curScoreNum9_png,curScoreNum8_png,curScoreNum7_png,curScoreNum6_png,curScoreNum5_png,curScoreNum4_png,curScoreNum3_png,curScoreNum2_png,curScoreNum1_png,curScoreNum0_png,festivalTargetBg_png,lineLight9_png,lineLight8_png,lineLight7_png,lineLight6_png,lineLight5_png,lineLight4_png,lineLight3_png,lineLight2_png,lineLight13_png,lineLight12_png,lineLight11_png,lineLight10_png,lineLight1_png,fesRedUp_png,fesRedSmallLight_png,fesRedDown_png,fesRedCap_png,fesRedBombSta1_png,fesRedBigLight_png,fesEleSmallDis9_png,fesEleSmallDis8_png,fesEleSmallDis7_png,fesEleSmallDis6_png,fesEleSmallDis5_png,fesEleSmallDis4_png,fesEleSmallDis3_png,fesEleSmallDis2_png,fesEleSmallDis10_png,fesEleSmallDis1_png,ele12_png,ele13_png,xingxingbi_png,tinyRedMid_png,tinyRedLeft_png,tinyRedRight_png,rectLatWhite_png,fesRedBombSta2_png,ele14_png,redBombYStar_png,redBombBStar_png,redBombBSnow_png,线条尾部炸开_00000_png,线条尾部炸开_00001_png,线条尾部炸开_00002_png,线条尾部炸开_00003_png,线条尾部炸开_00004_png,线条尾部炸开_00005_png,线条尾部炸开_00006_png,线条尾部炸开_00007_png,线条尾部炸开_00008_png,ele15_png,ele16_png,ele17_png,ele18_png,ele19_png,ele20_png,empty_png,ele23_png,ele25_png,ele27_png,ele26_png,ele24_png,ele22_png,chocolateMark3_png,chocolateMark1_png,chocolateFour_png,chocolateMark0_png,chocolateMark2_png,redbombParticle_png,monster_shoot_png,ele33_1_png,ele33_0_png,ele34_png,honey_png,ele36_png", "keys": "bonusFra1_png,bonusFra10_png,bonusFra11_png,bonusFra12_png,bonusFra13_png,bonusFra14_png,bonusFra15_png,bonusFra16_png,bonusFra17_png,bonusFra18_png,bonusFra19_png,bonusFra2_png,bonusFra20_png,bonusFra21_png,bonusFra22_png,bonusFra23_png,bonusFra24_png,bonusFra25_png,bonusFra26_png,bonusFra27_png,bonusFra3_png,bonusFra4_png,bonusFra5_png,bonusFra6_png,bonusFra7_png,bonusFra8_png,bonusFra9_png,bonusShoot_png,bonusTime_png,boom1_png,boom10_png,boom11_png,boom12_png,boom13_png,boom14_png,boom15_png,boom16_png,boom17_png,boom2_png,boom3_png,boom4_png,boom5_png,boom6_png,boom7_png,boom8_png,boom9_png,boomBtn_png,chooseRect_png,dangqianfenshu_png,eggPiece1_png,eggPiece2_png,eggPiece3_png,eggPiece4_png,eggPiece5_png,eggStatus0_png,eggStatus1_png,eggStatus2_png,ele0_png,ele0Exp_png,ele0Line_png,ele1_png,ele1Exp_png,ele1Line_png,ele2_png,ele2Exp_png,ele2Line_png,ele3_png,ele3Exp_png,ele3Line_png,ele4_png,ele4Exp_png,ele4Line_png,ele5_png,ele6_png,ele7_png,ele8_png,ele9_png,eleDis1_png,eleDis10_png,eleDis11_png,eleDis12_png,eleDis13_png,eleDis14_png,eleDis15_png,eleDis16_png,eleDis17_png,eleDis18_png,eleDis19_png,eleDis2_png,eleDis3_png,eleDis4_png,eleDis5_png,eleDis6_png,eleDis7_png,eleDis8_png,eleDis9_png,exLighting1_png,exLighting11_png,exLighting14_png,exLighting16_png,exLighting18_png,exLighting19_png,exLighting21_png,exLighting23_png,exLighting25_png,exLighting27_png,exLighting29_png,exLighting3_png,exLighting32_png,exLighting34_png,exLighting5_png,exLighting7_png,exLighting9_png,greenCircleDown_png,greenCircleUp_png,guidePropBoom_png,guidePropCow_png,guidePropHammer_png,guidePropHand_png,guidePropMsgPanel_png,guidePropShoe_png,hammerBtn_png,ice2_png,ice3_png,ice4_png,ice5_png,ice6_png,jellyArrow_png,leftArrow_png,lightedStar_png,lineLight_png,lockVine_png,magicLion_png,magicLionBg_png,mainMusicBtnOff_png,mainMusicBtnOn_png,mainQuestionBtn_png,mainQuitBtn_png,mainSettingBg_png,mainSoundBtnOff_png,mainSoundBtnOn_png,main_mapbottom_png,playSceneBg_jpg,progressDown_png,propNum0_png,propNum1_png,propNum2_png,propNum3_png,propNum4_png,propNum5_png,propNum6_png,propNum7_png,propNum8_png,propNum9_png,propNumBg_png,rectLat_png,rightArrow_png,rightMark_png,rock2_png,rock3_png,rock4_png,rock5_png,rock6_png,scoreNumber0_png,scoreNumber1_png,scoreNumber2_png,scoreNumber3_png,scoreNumber4_png,scoreNumber5_png,scoreNumber6_png,scoreNumber7_png,scoreNumber8_png,scoreNumber9_png,setting_png,starProgress_png,stepAni1_png,stepAni10_png,stepAni11_png,stepAni2_png,stepAni3_png,stepAni4_png,stepAni5_png,stepAni6_png,stepAni7_png,stepAni8_png,stepAni9_png,stepBtn_png,stepNumber0_png,stepNumber1_png,stepNumber2_png,stepNumber3_png,stepNumber4_png,stepNumber5_png,stepNumber6_png,stepNumber7_png,stepNumber8_png,stepNumber9_png,stepsBoard_png,targetBoard_png,targetNumber0_png,targetNumber1_png,targetNumber2_png,targetNumber3_png,targetNumber4_png,targetNumber5_png,targetNumber6_png,targetNumber7_png,targetNumber8_png,targetNumber9_png,unlightedStar_png,yellowCircleDown_png,yellowCircleUp_png,yezi1_png,bubbleStar19_png,bubleEle0_png,bubleEle1_png,bubleEle2_png,bubleEle3_png,bubleEle4_png,bubbleStar1_png,bubbleStar2_png,bubbleStar3_png,bubbleStar4_png,bubbleStar5_png,bubbleStar6_png,bubbleStar7_png,bubbleStar8_png,bubbleStar9_png,bubbleStar10_png,bubbleStar11_png,bubbleStar12_png,bubbleStar13_png,bubbleStar14_png,bubbleStar15_png,bubbleStar16_png,bubbleStar17_png,bubbleStar18_png,ele11_png,ele10_png,brownBallFace_png,eyeDownLeft_png,eyeSingle_png,greyBallFace_png,eyeDownRight_png,hairballPiece9_png,hairballPiece8_png,hairballPiece7_png,hairballPiece6_png,hairballPiece5_png,hairballPiece4_png,hairballPiece3_png,hairballPiece2_png,hairballPiece11_png,hairballPiece10_png,hairballPiece1_png,hairballDisBg_png,curScoreNum9_png,curScoreNum8_png,curScoreNum7_png,curScoreNum6_png,curScoreNum5_png,curScoreNum4_png,curScoreNum3_png,curScoreNum2_png,curScoreNum1_png,curScoreNum0_png,festivalTargetBg_png,lineLight9_png,lineLight8_png,lineLight7_png,lineLight6_png,lineLight5_png,lineLight4_png,lineLight3_png,lineLight2_png,lineLight13_png,lineLight12_png,lineLight11_png,lineLight10_png,lineLight1_png,fesRedUp_png,fesRedSmallLight_png,fesRedDown_png,fesRedCap_png,fesRedBombSta1_png,fesRedBigLight_png,fesEleSmallDis9_png,fesEleSmallDis8_png,fesEleSmallDis7_png,fesEleSmallDis6_png,fesEleSmallDis5_png,fesEleSmallDis4_png,fesEleSmallDis3_png,fesEleSmallDis2_png,fesEleSmallDis10_png,fesEleSmallDis1_png,ele12_png,ele13_png,xingxingbi_png,tinyRedMid_png,tinyRedLeft_png,tinyRedRight_png,rectLatWhite_png,fesRedBombSta2_png,ele14_png,redBombYStar_png,redBombBStar_png,redBombBSnow_png,线条尾部炸开_00000_png,线条尾部炸开_00001_png,线条尾部炸开_00002_png,线条尾部炸开_00003_png,线条尾部炸开_00004_png,线条尾部炸开_00005_png,线条尾部炸开_00006_png,线条尾部炸开_00007_png,线条尾部炸开_00008_png,ele15_png,ele16_png,ele17_png,ele18_png,ele19_png,ele20_png,empty_png,ele23_png,ele25_png,ele27_png,ele26_png,ele24_png,ele22_png,chocolateMark3_png,chocolateMark1_png,chocolateFour_png,chocolateMark0_png,chocolateMark2_png,redbombParticle_png,monster_shoot_png,ele33_1_png,ele33_0_png,ele34_png,honey_png,ele36_png,ele38_png,ele39_png",
"name": "main2" "name": "main2"
}, },
{ {
...@@ -5111,6 +5111,16 @@ ...@@ -5111,6 +5111,16 @@
"url": "assets/help/help_invite_btn1.png", "url": "assets/help/help_invite_btn1.png",
"type": "image", "type": "image",
"name": "help_invite_btn1_png" "name": "help_invite_btn1_png"
},
{
"name": "ele38_png",
"type": "image",
"url": "assets/mainScene/ele38.png"
},
{
"name": "ele39_png",
"type": "image",
"url": "assets/mainScene/ele39.png"
} }
] ]
} }
\ No newline at end of file
...@@ -61,7 +61,7 @@ import { Ice } from '../something/class/Ice'; ...@@ -61,7 +61,7 @@ import { Ice } from '../something/class/Ice';
import { Lattice } from '../something/class/Lattice'; import { Lattice } from '../something/class/Lattice';
import { EffectType } from '../something/enum/EffectType'; import { EffectType } from '../something/enum/EffectType';
import { ElementConfigType } from '../something/enum/ElementConfigType'; import { ElementConfigType } from '../something/enum/ElementConfigType';
import { CandyBaseElementType, codeMsgs, convertBaseElementType, elementMonsterResMap, ElementType, fireworksTypeMap, FiveBaseElementTypes, MonsterBaseElementType, monsterElementMap, submitTran } from '../something/enum/ElementType'; import { CandyBaseElementType, codeMsgs, convertBaseElementType, elementMonsterResMap, ElementType, fireworksTypeMap, FiveBaseElementTypes, MonsterBaseElementType, monsterElementMap, submitTran, connoDirection, forwardDirection } from '../something/enum/ElementType';
import { isIce, isSpecialLattice, isSand, isBlock } from '../something/enum/LatticeType'; import { isIce, isSpecialLattice, isSand, isBlock } from '../something/enum/LatticeType';
import { PassType } from '../something/enum/PassType'; import { PassType } from '../something/enum/PassType';
import { RecoverName } from '../something/enum/RecoverName'; import { RecoverName } from '../something/enum/RecoverName';
...@@ -268,6 +268,8 @@ export default class MainScene extends Scene { ...@@ -268,6 +268,8 @@ export default class MainScene extends Scene {
private _steps: number; private _steps: number;
private stepNumber: StepNumber; private stepNumber: StepNumber;
//新增炮台
cannoArr:Array<{idx:number,ele:Element}> = [];
get steps(): number { get steps(): number {
return this._steps return this._steps
} }
...@@ -734,6 +736,7 @@ export default class MainScene extends Scene { ...@@ -734,6 +736,7 @@ export default class MainScene extends Scene {
//初始化地图元素 //初始化地图元素
initElement() { initElement() {
this.cannoArr = new Array();
//没有就根据地图格子随机元素 //没有就根据地图格子随机元素
var elements = this.chapterData.map.elements || Tool.setNumber01(this.chapterData.map.lattices.slice()); var elements = this.chapterData.map.elements || Tool.setNumber01(this.chapterData.map.lattices.slice());
for (var i = 0; i < elements.length; i++) { for (var i = 0; i < elements.length; i++) {
...@@ -865,12 +868,32 @@ export default class MainScene extends Scene { ...@@ -865,12 +868,32 @@ export default class MainScene extends Scene {
this.elementContainer.addChild(egg); this.elementContainer.addChild(egg);
this.lattices[i].element = egg; this.lattices[i].element = egg;
break; break;
case ElementConfigType.CANNO:
let canno:Element = Tool.getElement(ElementType.CANNO);
canno.x = p[0];
canno.y = p[1];
this.elementContainer.addChild(canno);
this.lattices[i].element = canno;
this.cannoArr.push({
idx:i,
ele:canno
});
break;
case ElementConfigType.CANNO_BLOCK:
let canno_block:Element = Tool.getElement(ElementType.CANNO_BLOCK);
canno_block.x = p[0];
canno_block.y = p[1];
this.elementContainer.addChild(canno_block);
this.lattices[i].element = canno_block;
break;
default: default:
//其他标识按空元素记 //其他标识按空元素记
this.emptys.push(i); this.emptys.push(i);
break break
} }
} }
console.log("关卡大炮配置",this.cannoArr);
} }
//重置基础元素及特效类型 //重置基础元素及特效类型
...@@ -883,10 +906,12 @@ export default class MainScene extends Scene { ...@@ -883,10 +906,12 @@ export default class MainScene extends Scene {
const baseElement = elements[i]; const baseElement = elements[i];
const isCandyEle = elementConfig == ElementConfigType.CANDY; const isCandyEle = elementConfig == ElementConfigType.CANDY;
const isMonsterEle = elementConfig == ElementConfigType.MONSTER; const isMonsterEle = elementConfig == ElementConfigType.MONSTER;
const isCanno = elementConfig == ElementConfigType.CANNO;
//不是基础元素,跳过, //不是基础元素,跳过,
if (!Tool.judgeBaseEle(this.lattices[i]) && !isCandyEle && !isMonsterEle) continue; if (!Tool.judgeBaseEle(this.lattices[i]) && !isCandyEle && !isMonsterEle && !isCanno) continue;
//是0,跳过 //是0,跳过
if (!baseElement && !isCandyEle && !isMonsterEle) continue if (!baseElement && !isCandyEle && !isMonsterEle) continue
const ele: Element = this.lattices[i].element; const ele: Element = this.lattices[i].element;
if (isCandyEle) { //糖果元素 if (isCandyEle) { //糖果元素
if (baseElement == CandyBaseElementType.RANDOM) {//如果是随机糖果,目前只有随机糖果 if (baseElement == CandyBaseElementType.RANDOM) {//如果是随机糖果,目前只有随机糖果
...@@ -903,6 +928,12 @@ export default class MainScene extends Scene { ...@@ -903,6 +928,12 @@ export default class MainScene extends Scene {
} }
ele.resetToMonsterView(elementMonsterResMap[ele.type]); ele.resetToMonsterView(elementMonsterResMap[ele.type]);
} }
else if(isCanno){//是炮台
var dirarr: number[] = Tool.returnTO(elements[i]);
var dirnum = dirarr[1]||1;
var dirType = connoDirection[dirnum];
ele.resetToCannoView(dirType);
}
else { else {
//解析elements[i]; //解析elements[i];
var arr: number[] = Tool.returnTO(elements[i]); var arr: number[] = Tool.returnTO(elements[i]);
...@@ -1188,6 +1219,8 @@ export default class MainScene extends Scene { ...@@ -1188,6 +1219,8 @@ export default class MainScene extends Scene {
var ele = e.target.parent var ele = e.target.parent
if (ele instanceof Element && if (ele instanceof Element &&
// ele.type != ElementType.ROCK && // ele.type != ElementType.ROCK &&
ele.type != ElementType.CANNO &&
ele.type != ElementType.CANNO_BLOCK &&
!ele.hasState(StateType.BLOCK_LOCK) && //石门无法消除 !ele.hasState(StateType.BLOCK_LOCK) && //石门无法消除
ele.type != ElementType.LOLLIPOP) { ele.type != ElementType.LOLLIPOP) {
this.elementContainer.removeEventListener(egret.TouchEvent.TOUCH_BEGIN, fun, this); this.elementContainer.removeEventListener(egret.TouchEvent.TOUCH_BEGIN, fun, this);
...@@ -2014,6 +2047,23 @@ export default class MainScene extends Scene { ...@@ -2014,6 +2047,23 @@ export default class MainScene extends Scene {
this.pushScoreAni(baseScore * this.commonContinuityTimes, Tool.getPositionByIndex(index)) this.pushScoreAni(baseScore * this.commonContinuityTimes, Tool.getPositionByIndex(index))
} }
} }
if(this.eliminatedElements.length>0){
for(var i=0;i<this.eliminatedElements.length;i++){
var ielimidx = this.eliminatedElements[i];
for(var p=0;p<this.cannoArr.length;p++){
var pcannoidx = this.cannoArr[p].idx;
var isnext = Tool.checkNebByidx(pcannoidx,ielimidx);
if(isnext){
var pcannoele = this.cannoArr[p].ele;
pcannoele.addOneCannoStat();
}
}
}
}
return this.eliminatedElements.length > 0; return this.eliminatedElements.length > 0;
} }
...@@ -2075,6 +2125,22 @@ export default class MainScene extends Scene { ...@@ -2075,6 +2125,22 @@ export default class MainScene extends Scene {
return return
} }
//炮台充能发射
var emitcanno:Element;
for(var p=0;p<this.cannoArr.length;p++){
var pcanno = this.cannoArr[p].ele;
var pcannostat = pcanno.checkCannoStat();
if(pcannostat){
emitcanno = pcanno;
break;
}
}
if(emitcanno){
console.log("大炮发射");
this.fireCanno(emitcanno);
return;
}
if (this._converyorTag) { if (this._converyorTag) {
await doConveyorAI(this); await doConveyorAI(this);
...@@ -2211,6 +2277,53 @@ export default class MainScene extends Scene { ...@@ -2211,6 +2277,53 @@ export default class MainScene extends Scene {
}) })
} }
//大炮发射
fireCanno(canno:Element){
var cannodir = canno._cannoDir;
var cannorow = canno.row;
var cannocol = canno.column;
var cannoFireArr:number[] = new Array();
if(cannodir==forwardDirection.left){
for(var i=cannocol;i>=0;i--){
var iemitidx = Tool.rcToIndex(cannorow,i);
cannoFireArr.push(iemitidx);
}
}else if(cannodir==forwardDirection.up){
for(var i=cannorow;i>=0;i--){
var iemitidx = Tool.rcToIndex(i,cannocol);
cannoFireArr.push(iemitidx);
}
}else if(cannodir==forwardDirection.right){
for(var i=cannocol;i<Tool.colNum;i++){
var iemitidx = Tool.rcToIndex(cannorow,i);
cannoFireArr.push(iemitidx);
}
}else if(cannodir==forwardDirection.down){
for(var i=cannorow;i<Tool.rowNum;i++){
var iemitidx = Tool.rcToIndex(i,cannocol);
cannoFireArr.push(iemitidx);
}
}
for(var j=0;j<cannoFireArr.length;j++){
var jemitidx = cannoFireArr[j];
var lat = this.lattices[jemitidx];
var caneliminate = Tool.judgeEliminate(lat);
if(lat&&(caneliminate||lat.element.type==ElementType.CANNO_BLOCK)){
if(this.eliminatedElements.indexOf(jemitidx)==-1){
this.eliminatedElements.push(jemitidx);
}
//加分
if(lat.element.type==ElementType.CANNO_BLOCK){
// console.log("炮台石头消除");
break;
}
}
}
setTimeout(()=>{
this.eliminate();
canno.resetCannoStat();
},200);
}
checkAllBlock() { checkAllBlock() {
// this.lattices.filter(item => item.block).forEach((item) => { // this.lattices.filter(item => item.block).forEach((item) => {
// item.block.nextState(); // item.block.nextState();
...@@ -2636,6 +2749,10 @@ export default class MainScene extends Scene { ...@@ -2636,6 +2749,10 @@ export default class MainScene extends Scene {
//统一逻辑,个数等,都进里面 //统一逻辑,个数等,都进里面
this.removeFestivalEleSmall(index); this.removeFestivalEleSmall(index);
} }
//炮台石头
else if (ele.type == ElementType.CANNO_BLOCK){
this.removeCannoBlock(index);
}
} }
} }
//从消除列表移除 //从消除列表移除
...@@ -3285,7 +3402,13 @@ export default class MainScene extends Scene { ...@@ -3285,7 +3402,13 @@ export default class MainScene extends Scene {
//播放动效 //播放动效
this.playAni(RecoverName.ROCK_ANI, Tool.getPositionByIndex(index)) this.playAni(RecoverName.ROCK_ANI, Tool.getPositionByIndex(index))
} }
/**
* 炮台石头的动效
*/
removeCannoBlock(index:number){
this.removeOperation(index);
//炮台石头的动效
}
/** /**
* 果冻的移除,包括动效 * 果冻的移除,包括动效
* @param index * @param index
......
...@@ -230,6 +230,21 @@ export class Tool { ...@@ -230,6 +230,21 @@ export class Tool {
} }
return false return false
} }
/**
* 根据idx判断相邻
* @param a
* @param b
*/
public static checkNebByidx(a:number,b:number){
var arc = this.indexToRc(a);
var brc = this.indexToRc(b);
if (Math.abs(arc[0] - brc[0]) == 1 && Math.abs(arc[1] - brc[1]) == 0) {
return true
} else if (Math.abs(arc[0] - brc[0]) == 0 && Math.abs(arc[1] - brc[1]) == 1) {
return true
}
return false
}
/** /**
* 数组中插入一个数值,按顺序的 * 数组中插入一个数值,按顺序的
...@@ -281,8 +296,10 @@ export class Tool { ...@@ -281,8 +296,10 @@ export class Tool {
lat.element.type == ElementType.JELLY_MONSTER || lat.element.type == ElementType.JELLY_MONSTER ||
lat.element.type == ElementType.FIREWORKS_SHOOTER || lat.element.type == ElementType.FIREWORKS_SHOOTER ||
lat.element.type == ElementType.CHICKEN_EGG || lat.element.type == ElementType.CHICKEN_EGG ||
lat.element.type == ElementType.FESTIVALELE_BIG //|| lat.element.type == ElementType.FESTIVALELE_BIG ||
// lat.element.type == ElementType.FESTIVALELE_SMALL // lat.element.type == ElementType.FESTIVALELE_SMALL
lat.element.type == ElementType.CANNO ||
lat.element.type == ElementType.CANNO_BLOCK
) { ) {
return false return false
} }
...@@ -344,7 +361,9 @@ export class Tool { ...@@ -344,7 +361,9 @@ export class Tool {
//上方元素为冰淇淋 //上方元素为冰淇淋
else if (lat.element.type == ElementType.LOLLIPOP || else if (lat.element.type == ElementType.LOLLIPOP ||
lat.element.type == ElementType.JELLY_MONSTER || lat.element.type == ElementType.JELLY_MONSTER ||
lat.element.type == ElementType.FIREWORKS_SHOOTER lat.element.type == ElementType.FIREWORKS_SHOOTER ||
lat.element.type == ElementType.CANNO ||
lat.element.type == ElementType.CANNO_BLOCK
) { ) {
return false return false
} }
...@@ -428,7 +447,9 @@ export class Tool { ...@@ -428,7 +447,9 @@ export class Tool {
ele.type == ElementType.FIREWORKS_SHOOTER || ele.type == ElementType.FIREWORKS_SHOOTER ||
ele.type == ElementType.CHICKEN_EGG || ele.type == ElementType.CHICKEN_EGG ||
ele.type == ElementType.FESTIVALELE_BIG || ele.type == ElementType.FESTIVALELE_BIG ||
ele.type == ElementType.FESTIVALELE_SMALL ele.type == ElementType.FESTIVALELE_SMALL ||
ele.type == ElementType.CANNO ||
ele.type == ElementType.CANNO_BLOCK
) { ) {
return false; return false;
} }
...@@ -454,7 +475,9 @@ export class Tool { ...@@ -454,7 +475,9 @@ export class Tool {
ele.hasState(StateType.HAIRBALLGREY) || ele.hasState(StateType.HAIRBALLGREY) ||
ele.hasState(StateType.BLOCK_LOCK) || ele.hasState(StateType.BLOCK_LOCK) ||
ele.hasState(StateType.HAIRBALLBLACK) || ele.hasState(StateType.HAIRBALLBLACK) ||
ele.hasState(StateType.HAIRBALLBROWN) ele.hasState(StateType.HAIRBALLBROWN) ||
ele.type == ElementType.CANNO ||
ele.type == ElementType.CANNO_BLOCK
) { ) {
return false; return false;
} }
...@@ -474,7 +497,9 @@ export class Tool { ...@@ -474,7 +497,9 @@ export class Tool {
ele.hasState(StateType.BLOCK_LOCK) || ele.hasState(StateType.BLOCK_LOCK) ||
ele.monster || ele.monster ||
ele.hasState(StateType.HAIRBALLBLACK) || ele.hasState(StateType.HAIRBALLBLACK) ||
ele.hasState(StateType.HAIRBALLBROWN) ele.hasState(StateType.HAIRBALLBROWN) ||
ele.type == ElementType.CANNO ||
ele.type == ElementType.CANNO_BLOCK
) { ) {
return false; return false;
} }
...@@ -860,7 +885,6 @@ export class Tool { ...@@ -860,7 +885,6 @@ export class Tool {
} }
return Tool.randomT(arr); return Tool.randomT(arr);
} }
/** /**
* 根据关卡的地图数据generateLats * 根据关卡的地图数据generateLats
* *
......
import { ChapterData } from "../interface/ChapterData"; import { ChapterData } from "../interface/ChapterData";
import { PassType } from "../enum/PassType";
import { ElementType } from "../enum/ElementType";
//551-575 //551-575
export const Chapters22: ChapterData[] = [ export const Chapters22: ChapterData[] = [
//551
{
baseElementTypes: [0, 1, 2, 3],
bubbleProbability: 0,
stepCount: 25,
passTarget: {
type: PassType.ELEMENT_TARGET,
elements: [
{
type: ElementType.CHICKEN,
count: 45,
},
],
},
starScores: [1000, 5000, 10000],
map: {
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, 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,
],
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, 18, 1, 1,
0, 1, 1, 1, 1, 1, 1, 1, 0,
0, 0, 1, 19, 1, 18, 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: [70, 71, 72, 73]
},
}
] ]
...@@ -69,7 +69,7 @@ chapters.forEach((chapter,index) => { ...@@ -69,7 +69,7 @@ chapters.forEach((chapter,index) => {
*/ */
export function getChapterData(index: number): ChapterData { export function getChapterData(index: number): ChapterData {
//没有数据就返回第一关数据 //没有数据就返回第一关数据
return chapters[index] || chapters[1]; return chapters[index] || chapters[551];
} }
var a = { var a = {
......
...@@ -13,7 +13,7 @@ import { createCandyDis3Ani } from "../anis/candy/createCandyDis3Ani"; ...@@ -13,7 +13,7 @@ import { createCandyDis3Ani } from "../anis/candy/createCandyDis3Ani";
import { createCandyDis4Ani } from "../anis/candy/createCandyDis4Ani"; import { createCandyDis4Ani } from "../anis/candy/createCandyDis4Ani";
import { createCandySubAni } from "../anis/candy/createCandySubAni"; import { createCandySubAni } from "../anis/candy/createCandySubAni";
import { EffectType } from "../enum/EffectType"; import { EffectType } from "../enum/EffectType";
import { CandyBaseElementType, ElementType, FiveBaseElementTypes, transElementRes } from "../enum/ElementType"; import { CandyBaseElementType, ElementType, FiveBaseElementTypes, transElementRes, forwardDirection } from "../enum/ElementType";
import { RecoverName } from "../enum/RecoverName"; import { RecoverName } from "../enum/RecoverName";
import { stateDatas, StateType } from "../enum/StateType"; import { stateDatas, StateType } from "../enum/StateType";
import { ExplosiveBgAni } from "../periodAni/ExplosiveBgAni"; import { ExplosiveBgAni } from "../periodAni/ExplosiveBgAni";
...@@ -188,6 +188,49 @@ export class Element extends eui.Component { ...@@ -188,6 +188,49 @@ export class Element extends eui.Component {
this.addCandyStandbyAni(); this.addCandyStandbyAni();
} }
_cannoDir:forwardDirection;
private _cannoStat:number = 0;
resetToCannoView(cannodir:forwardDirection){
this._cannoDir = cannodir;
this.resetCannoStat();
this.showImage.x = 0;
this.showImage.y = 0;
this.showImage.anchorOffsetX = this.showImage.width / 2;
this.showImage.anchorOffsetY = this.showImage.height / 2;
var roaidx:number;
if(cannodir==forwardDirection.left){
roaidx = 0;
}else if(cannodir==forwardDirection.up){
roaidx = 1;
}else if(cannodir==forwardDirection.right){
roaidx = 2;
}else if(cannodir==forwardDirection.down){
roaidx = 3;
}
this.showImage.rotation = [-90,0,90,180][roaidx];
}
changeShowCannoStat(){
this.cannolab.text = this._cannoStat+"";
}
checkCannoStat(){
if(this._cannoStat==3){
return true;
}
return false;
}
resetCannoStat(){
this._cannoStat = 0;
this.changeShowCannoStat();
}
addOneCannoStat(){
this._cannoStat += 1;
if(this._cannoStat>3){
this._cannoStat = 3;
}
this.changeShowCannoStat();
}
playCandyDieAni() { playCandyDieAni() {
var p = Tool.getPositionByIndex(this.index); var p = Tool.getPositionByIndex(this.index);
createCandyDieBgAni(p[0], p[1], this.stage); createCandyDieBgAni(p[0], p[1], this.stage);
...@@ -358,6 +401,8 @@ export class Element extends eui.Component { ...@@ -358,6 +401,8 @@ export class Element extends eui.Component {
*/ */
private states: State[] = [] private states: State[] = []
//模拟炮台发射情况
protected cannolab: eui.Label;
/** /**
* *
* @param type 只应该是基础元素和特殊元素 * @param type 只应该是基础元素和特殊元素
...@@ -366,8 +411,17 @@ export class Element extends eui.Component { ...@@ -366,8 +411,17 @@ export class Element extends eui.Component {
super(); super();
this._type = type; this._type = type;
this.showImage = new eui.Image(); this.showImage = new eui.Image();
this.changeSource("ele" + this.type + "_png"); this.changeSource("ele" + this.type + "_png");
this.addChild(this.showImage); this.addChild(this.showImage);
this.cannolab = new eui.Label();
this.cannolab.size = 30;
this.cannolab.textColor = 0xff0000;
this.cannolab.x = 0;
this.cannolab.y = 0;
this.addChild(this.cannolab);
this.cannolab.visible = type == ElementType.CANNO;
//鸡蛋 //鸡蛋
if (type == ElementType.CHICKEN_EGG) { if (type == ElementType.CHICKEN_EGG) {
this.chickenEgg = Pool.takeOut(RecoverName.CHICKEN_EGG) this.chickenEgg = Pool.takeOut(RecoverName.CHICKEN_EGG)
...@@ -398,7 +452,7 @@ export class Element extends eui.Component { ...@@ -398,7 +452,7 @@ export class Element extends eui.Component {
changeSource(source: string) { changeSource(source: string) {
// this.showImage.source = source; // this.showImage.source = source;
var texture: egret.Texture = RES.getRes(source); var texture: egret.Texture = RES.getRes(source);
if (!texture) { return; } if (!texture) { return console.error("未找到纹理",source,this.type); }
this.showImage.texture = texture this.showImage.texture = texture
this.showImage.x = -texture.textureWidth / 2; this.showImage.x = -texture.textureWidth / 2;
...@@ -429,6 +483,8 @@ export class Element extends eui.Component { ...@@ -429,6 +483,8 @@ 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.changeSource("ele" + type + "_png"); this.changeSource("ele" + type + "_png");
//特效重置 //特效重置
this.effectType = null; this.effectType = null;
......
...@@ -68,10 +68,7 @@ export enum ElementConfigType { ...@@ -68,10 +68,7 @@ export enum ElementConfigType {
HONEY_POT = 16, HONEY_POT = 16,
FLOWER = 17, FLOWER = 17,
/** 大炮 */ /** 大炮 */
CANNO_DIR_TOP = 18, CANNO = 18,
CANNO_DIR_BOTTOM = 19,
CANNO_DIR_LEFT = 20,
CANNO_DIR_RIGHT = 21,
/** 大炮石头 */ /** 大炮石头 */
CANNO_BLOCK = 22, CANNO_BLOCK = 19,
} }
\ No newline at end of file
...@@ -30,39 +30,36 @@ export enum ElementType { ...@@ -30,39 +30,36 @@ export enum ElementType {
FESTIVALELE_BIG, //节日元素大中间一个13 FESTIVALELE_BIG, //节日元素大中间一个13
FESTIVALELE_SMALL, //节日元素飞溅的小元素14 FESTIVALELE_SMALL, //节日元素飞溅的小元素14
CANDY_RABBIT,//兔子 CANDY_RABBIT,//兔子15
CANDY_CHICKEN,//鸟 CANDY_CHICKEN,//鸟16
CANDY_CATTLE,//牛 CANDY_CATTLE,//牛17
CANDY_LION,//狮子 CANDY_LION,//狮子18
CANDY_PIG,//猪 CANDY_PIG,//猪19
MONSTER_JELLY1, MONSTER_JELLY1,//20
JELLY_MONSTER, JELLY_MONSTER,//21
FIREWORKS_RABBIT,//烟花目标元素,下同 FIREWORKS_RABBIT,//烟花目标元素,下同22
FIREWORKS_CHICKEN, FIREWORKS_CHICKEN,//23
FIREWORKS_CATTLE, FIREWORKS_CATTLE,//24
FIREWORKS_LION, FIREWORKS_LION,//25
FIREWORKS_PIG, FIREWORKS_PIG,//26
FIREWORKS_SHOOTER,//烟花 FIREWORKS_SHOOTER,//烟花27
MONSTER_RABBIT,//独眼怪 MONSTER_RABBIT,//独眼怪28
MONSTER_CHICKEN, MONSTER_CHICKEN,//29
MONSTER_CATTLE, MONSTER_CATTLE,//30
MONSTER_LION, MONSTER_LION,//31
MONSTER_PIG, MONSTER_PIG,//32
FISH,//气鼓鱼 FISH,//气鼓鱼33
HONEY,// 蜂蜜 HONEY,// 蜂蜜34
HONEY_POT,//蜂蜜罐 HONEY_POT,//蜂蜜罐35
SAND, SAND,//36
FLOWER, FLOWER,//37
CANNO_LEFT, CANNO,//38
CANNO_RIGHT, CANNO_BLOCK,//39
CANNO_TOP,
CANNO_BOTTOM,
CANNO_BLOCK,
} }
export const isMonsterEle = (t: ElementType) => { export const isMonsterEle = (t: ElementType) => {
...@@ -93,6 +90,12 @@ export enum MonsterBaseElementType { ...@@ -93,6 +90,12 @@ export enum MonsterBaseElementType {
} }
export enum forwardDirection{
left="left",
up="up",
right="right",
down="down",
}
export const fireworksTypeMap: any = {} export const fireworksTypeMap: any = {}
fireworksTypeMap[ElementType.RABBIT] = ElementType.FIREWORKS_RABBIT; fireworksTypeMap[ElementType.RABBIT] = ElementType.FIREWORKS_RABBIT;
fireworksTypeMap[ElementType.CHICKEN] = ElementType.FIREWORKS_CHICKEN; fireworksTypeMap[ElementType.CHICKEN] = ElementType.FIREWORKS_CHICKEN;
...@@ -156,6 +159,13 @@ export const monsterElementMap = { ...@@ -156,6 +159,13 @@ export const monsterElementMap = {
"5": ElementType.PIG, "5": ElementType.PIG,
} }
export const connoDirection = {
"1":forwardDirection.left,
"2":forwardDirection.up,
"3":forwardDirection.right,
"4":forwardDirection.down,
}
export const elementMonsterResMap = { export const elementMonsterResMap = {
"0": ElementType.MONSTER_RABBIT, "0": ElementType.MONSTER_RABBIT,
"1": ElementType.MONSTER_CHICKEN, "1": ElementType.MONSTER_CHICKEN,
......
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