Commit ff43736c authored by zjz1994's avatar zjz1994

调整炮台配置

parent e7adeb9c
......@@ -870,7 +870,10 @@ export default class MainScene extends Scene {
this.elementContainer.addChild(egg);
this.lattices[i].element = egg;
break;
case ElementConfigType.CANNO:
case ElementConfigType.CANNO_DIR_TOP:
case ElementConfigType.CANNO_DIR_BOTTOM:
case ElementConfigType.CANNO_DIR_LEFT:
case ElementConfigType.CANNO_DIR_RIGHT:
let canno:Element = Tool.getElement(ElementType.CANNO);
canno.x = p[0];
canno.y = p[1];
......@@ -908,11 +911,11 @@ export default class MainScene extends Scene {
const baseElement = elements[i];
const isCandyEle = elementConfig == ElementConfigType.CANDY;
const isMonsterEle = elementConfig == ElementConfigType.MONSTER;
const isCanno = elementConfig == ElementConfigType.CANNO;
const isCanno = Tool.IsCanno(elementConfig);
//不是基础元素,跳过,
if (!Tool.judgeBaseEle(this.lattices[i]) && !isCandyEle && !isMonsterEle && !isCanno) continue;
//是0,跳过
if (!baseElement && !isCandyEle && !isMonsterEle) continue
if (!baseElement && !isCandyEle && !isMonsterEle && !isCanno) continue
const ele: Element = this.lattices[i].element;
if (isCandyEle) { //糖果元素
......@@ -931,9 +934,7 @@ export default class MainScene extends Scene {
ele.resetToMonsterView(elementMonsterResMap[ele.type]);
}
else if(isCanno){//是炮台
var dirarr: number[] = Tool.returnTO(elements[i]);
var dirnum = dirarr[1]||1;
var dirType = connoDirection[dirnum];
var dirType = Tool.getCannoDir(elementConfig);
ele.resetToCannoView(dirType);
}
else {
......@@ -2148,7 +2149,6 @@ export default class MainScene extends Scene {
// }
// }
if(emitcanno){
console.log("大炮发射");
this.fireCanno(emitcanno);
return;
}
......
......@@ -2,13 +2,14 @@ import { Element } from "./class/Element";
import { Lattice } from "./class/Lattice";
import { RectMask } from "./class/RectMask";
import { EffectType } from "./enum/EffectType";
import { ElementType, FiveBaseElementTypes } from "./enum/ElementType";
import { ElementType, FiveBaseElementTypes, forwardDirection } from "./enum/ElementType";
import { RecoverName } from "./enum/RecoverName";
import { StateType } from "./enum/StateType";
import { FallType } from "./interface/FallAniData";
import { GenerateLatData } from "./interface/GenerateLatData";
import { Pool } from "./Pool";
import HoneyPotElement from "./class/HoneyPotElement";
import { ElementConfigType } from "./enum/ElementConfigType";
//两种,0无棒棒糖,1有
const offsetYTwo: number[] = [];
......@@ -1216,4 +1217,36 @@ export class Tool {
}
return outArr
}
/**
* 判断是否是炮台
* @param type
*/
public static IsCanno(type:ElementConfigType){
if(type==ElementConfigType.CANNO_DIR_TOP||
type==ElementConfigType.CANNO_DIR_BOTTOM||
type==ElementConfigType.CANNO_DIR_LEFT||
type==ElementConfigType.CANNO_DIR_RIGHT
){
return true;
}
return false;
}
public static getCannoDir(type:ElementConfigType){
if(type==ElementConfigType.CANNO_DIR_TOP){
return forwardDirection.up;
}
else if(type==ElementConfigType.CANNO_DIR_BOTTOM){
return forwardDirection.down;
}
else if(type==ElementConfigType.CANNO_DIR_LEFT){
return forwardDirection.left;
}
else if(type==ElementConfigType.CANNO_DIR_RIGHT){
return forwardDirection.right;
}else{
console.error("未定义跑跳");
}
}
}
\ No newline at end of file
......@@ -42,19 +42,19 @@ export const Chapters22: ChapterData[] = [
[71, 17]
],
elements: [
1, 18, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 2, 1, 1, 18, 1,
1, 19, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 2, 1, 1, 20, 1,
1, 1, 1, 2, 2, 2, 1, 1, 1,
1, 6, 1, 1, 1, 1, 1, 6, 1,
1, 1, 1, 1, 16, 1, 1, 1, 1,
1, 1, 1, 1, 16, 1, 1, 1, 1,
1, 1, 1, 1, 16, 1, 1, 1, 1,
1, 22, 1, 1, 16, 1, 1, 1, 1,
5, 6, 1, 1, 2, 1, 1, 6, 5,
1, 1, 1, 2, 2, 2, 1, 1, 1
],
baseElements: [
0, 40, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 10, 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, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0,
......
......@@ -68,7 +68,10 @@ export enum ElementConfigType {
HONEY_POT = 16,
FLOWER = 17,
/** 大炮 */
CANNO = 18,
CANNO_DIR_TOP = 18,
CANNO_DIR_BOTTOM = 19,
CANNO_DIR_LEFT = 20,
CANNO_DIR_RIGHT = 21,
/** 大炮石头 */
CANNO_BLOCK = 19,
CANNO_BLOCK = 22,
}
\ No newline at end of file
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