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")
} }
......
This diff is collapsed.
...@@ -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