Commit 888a7723 authored by wildfirecode's avatar wildfirecode

1

parent 936426e1
This diff is collapsed.
...@@ -796,10 +796,11 @@ export default class MainScene extends Scene { ...@@ -796,10 +796,11 @@ export default class MainScene extends Scene {
const elementConfig = elementConfigs[i];//对应的element const elementConfig = elementConfigs[i];//对应的element
const baseElement = elements[i]; const baseElement = elements[i];
const isCandyEle = elementConfig == ElementConfigType.CANDY; const isCandyEle = elementConfig == ElementConfigType.CANDY;
const isMonsterEle = elementConfig == ElementConfigType.MONSTER;
//不是基础元素,跳过, //不是基础元素,跳过,
if (!Tool.judgeBaseEle(this.lattices[i]) && !isCandyEle) continue; if (!Tool.judgeBaseEle(this.lattices[i]) && !isCandyEle && !isMonsterEle) continue;
//是0,跳过 //是0,跳过
if (!baseElement && !isCandyEle) 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) {//如果是随机糖果,目前只有随机糖果
...@@ -810,7 +811,11 @@ export default class MainScene extends Scene { ...@@ -810,7 +811,11 @@ export default class MainScene extends Scene {
// ele.resetToCandyView(resultBaseElement);//切换成糖果视图 // ele.resetToCandyView(resultBaseElement);//切换成糖果视图
} }
} else { }
else if (isMonsterEle) { //独眼怪物元素
}
else {
//解析elements[i]; //解析elements[i];
var arr: number[] = Tool.returnTO(elements[i]); var arr: number[] = Tool.returnTO(elements[i]);
//基础类型,没有就是null,有就-1,对ElementType对应 //基础类型,没有就是null,有就-1,对ElementType对应
......
...@@ -57,6 +57,10 @@ export enum ElementConfigType { ...@@ -57,6 +57,10 @@ export enum ElementConfigType {
*/ */
JELLY_MONSTER = 12, JELLY_MONSTER = 12,
FIREWORKS = 13, FIREWORKS = 13,
/**
* 独眼怪
*/
MONSTER = 14,
} }
// export const isCandy = (t: ElementConfigType) => { // export const isCandy = (t: ElementConfigType) => {
......
...@@ -46,6 +46,12 @@ export enum ElementType { ...@@ -46,6 +46,12 @@ export enum ElementType {
FIREWORKS_PIG, FIREWORKS_PIG,
FIREWORKS_SHOOTER,//烟花 FIREWORKS_SHOOTER,//烟花
MONSTER_RABBIT,//独眼怪
MONSTER_CHICKEN,
MONSTER_CATTLE,
MONSTER_LION,
MONSTER_PIG,
} }
export enum CandyBaseElementType { export enum CandyBaseElementType {
...@@ -58,6 +64,16 @@ export enum CandyBaseElementType { ...@@ -58,6 +64,16 @@ export enum CandyBaseElementType {
} }
export enum MonsterBaseElementType {
RANDOM = 0,//随机
RABBIT = 1,//兔子
CHICKEN = 2,//鸟
CATTLE = 3,//牛
LION = 4,//狮子
PIG = 5,//猪
}
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;
......
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