Commit dd80c5fb authored by wildfirecode's avatar wildfirecode

Merge branch 'hotfix20200330_' into dev

parents 4150daa9 8a5ee75a
......@@ -19,7 +19,7 @@
background-color: #000;
background-size: 100%;
background-position: center;
background-image: url("https://yun.duiba.com.cn/db_games/activity/game/0217/startscenebg2.jpg");
background-image: url("https://yun.duiba.com.cn/db_games/activity/game/0327/startscenebg.jpg");
/* background-image: url("https://yun.duiba.com.cn/db_games/activity/game/1565600901/resource/assets/startScene/startscenebg.jpg"); */
padding: 0;
border: 0;
......
......@@ -307,6 +307,8 @@ export default class MainBase extends eui.UILayer {
}
RES.getResAsync("ele34_png");
RES.getResAsync("ele36_png");
RES.getResAsync("ele38_png");
RES.getResAsync("ele39_png");
for (var i = 1; i <= 27; i++) {
RES.getResAsync("bonusFra" + i + "_png")
}
......
This diff is collapsed.
......@@ -16,7 +16,7 @@ export default async (thisObj: MainScene) => {
const sandLattices = thisObj.lattices.filter(lattice => {
return lattice.sand;
});
console.log(sandLattices);
// console.log(sandLattices);
//map promise
//先判断是否能跳动,目前都能跳
const promiseList: Promise<any>[] = [];
......
......@@ -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[] = [];
......@@ -230,6 +231,21 @@ export class Tool {
}
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 +297,10 @@ export class Tool {
lat.element.type == ElementType.JELLY_MONSTER ||
lat.element.type == ElementType.FIREWORKS_SHOOTER ||
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.CANNO ||
lat.element.type == ElementType.CANNO_BLOCK
) {
return false
}
......@@ -344,7 +362,9 @@ export class Tool {
//上方元素为冰淇淋
else if (lat.element.type == ElementType.LOLLIPOP ||
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
}
......@@ -353,6 +373,21 @@ export class Tool {
return true
}
}
/**
* 判断是否是炮台石头
* @param lat
*/
public static judgeIscannoBlock(lat:Lattice){
if(!lat||!lat.element){
return false;
}
else if(lat.element.type==ElementType.CANNO_BLOCK){
return true;
}
else{
return false;
}
}
/**
* 判断格子上是基础元素,包括各种状态的
......@@ -428,7 +463,9 @@ export class Tool {
ele.type == ElementType.FIREWORKS_SHOOTER ||
ele.type == ElementType.CHICKEN_EGG ||
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;
}
......@@ -454,7 +491,9 @@ export class Tool {
ele.hasState(StateType.HAIRBALLGREY) ||
ele.hasState(StateType.BLOCK_LOCK) ||
ele.hasState(StateType.HAIRBALLBLACK) ||
ele.hasState(StateType.HAIRBALLBROWN)
ele.hasState(StateType.HAIRBALLBROWN) ||
ele.type == ElementType.CANNO ||
ele.type == ElementType.CANNO_BLOCK
) {
return false;
}
......@@ -474,7 +513,9 @@ export class Tool {
ele.hasState(StateType.BLOCK_LOCK) ||
ele.monster ||
ele.hasState(StateType.HAIRBALLBLACK) ||
ele.hasState(StateType.HAIRBALLBROWN)
ele.hasState(StateType.HAIRBALLBROWN) ||
ele.type == ElementType.CANNO ||
ele.type == ElementType.CANNO_BLOCK
) {
return false;
}
......@@ -860,7 +901,6 @@ export class Tool {
}
return Tool.randomT(arr);
}
/**
* 根据关卡的地图数据generateLats
*
......@@ -1177,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
import { ChapterData } from "../interface/ChapterData";
import { PassType } from "../enum/PassType";
import { ElementType } from "../enum/ElementType";
//551-575
export const Chapters22: ChapterData[] = [
//551
{
baseElementTypes: [0, 1, 2, 3, 4],
bubbleProbability: 0,
stepCount: 35,
passTarget: {
type: 1,
elements: [{
type: 1,
count: 155
}, {
type: 34,
count: 15
}]
},
starScores: [15000, 20000, 25000],
map: {
lattices: [
1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 0, 1, 0, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 0, 1, 0, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 4, 1, 0, 1, 0, 1, 4, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 0, 1, 1, 1, 1, 1, 0, 1
],
connectedLats: [],
conveyor: [
[9, 63],
[17, 71]
],
conveyorConnectedLats: [
[63, 9],
[71, 17]
],
elements: [
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, 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, 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, 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
],
recycles: [],
generateLats: [{
index: 0,
type: null
}, {
index: 1,
type: null
}, {
index: 2,
type: null
}, {
index: 3,
type: null
}, {
index: 4,
type: null
}, {
index: 5,
type: null
}, {
index: 6,
type: null
}, {
index: 7,
type: null
}, {
index: 8,
type: null
}]
}
}
]
......@@ -69,7 +69,7 @@ chapters.forEach((chapter,index) => {
*/
export function getChapterData(index: number): ChapterData {
//没有数据就返回第一关数据
return chapters[index] || chapters[1];
return chapters[index] || chapters[551];
}
var a = {
......
......@@ -13,7 +13,7 @@ import { createCandyDis3Ani } from "../anis/candy/createCandyDis3Ani";
import { createCandyDis4Ani } from "../anis/candy/createCandyDis4Ani";
import { createCandySubAni } from "../anis/candy/createCandySubAni";
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 { stateDatas, StateType } from "../enum/StateType";
import { ExplosiveBgAni } from "../periodAni/ExplosiveBgAni";
......@@ -35,11 +35,18 @@ import { Fish } from "./Fish";
* 坐标原点需要坐落在格子的中心点
* 最好到时按,底图,动效,气泡,笼子,毛球,进行分层,如果多个状态要共存时,必须分层,到时气泡的动画,要写再自己的层里
*/
//加载器
let svgaParser;
export class Element extends eui.Component {
private _fishState = 0;
private _isNeb: boolean;//是否
get isNeb() { return this._isNeb }
fishCanEliFlag: boolean;
cannoMoveClip:any;
cannoStat:number[] = [1,61,121,181,241,361];
//尝试设置碰撞状态,如果之前被特效集中,那么可以设置碰撞状态。碰撞状态之后可以准备消除。
setFishNebFlag() {
if (this._fishState > 0) {
......@@ -188,6 +195,50 @@ export class Element extends eui.Component {
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.cannobox.rotation = [-90,0,90,180][roaidx];
}
changeShowCannoStat(){
this.cannolab.text = this._cannoStat+"";
this.cannoMoveClip&&this.cannoMoveClip.gotoAndPlay(this.cannoStat[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() {
var p = Tool.getPositionByIndex(this.index);
createCandyDieBgAni(p[0], p[1], this.stage);
......@@ -255,6 +306,9 @@ export class Element extends eui.Component {
* 显示的图片,直接改source,"ele"+type
*/
protected showImage: eui.Image;
protected cannobox:eui.Group;
cannoboxwid:number = 116;
cannoboxhei:number = 116;
temEffectType: EffectType = null;
/**
......@@ -358,6 +412,8 @@ export class Element extends eui.Component {
*/
private states: State[] = []
//模拟炮台发射情况
protected cannolab: eui.Label;
/**
*
* @param type 只应该是基础元素和特殊元素
......@@ -366,8 +422,28 @@ export class Element extends eui.Component {
super();
this._type = type;
this.showImage = new eui.Image();
this.changeSource("ele" + this.type + "_png");
this.addChild(this.showImage);
this.cannobox = new eui.Group();
this.cannobox.width = this.cannoboxwid;
this.cannobox.height = this.cannoboxhei;
this.cannobox.anchorOffsetX = this.cannoboxwid/2;
this.cannobox.anchorOffsetY = this.cannoboxhei/2;
this.addChild(this.cannobox);
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.cannobox.visible = this.cannolab.visible = type == ElementType.CANNO;
this.showImage.visible = type != ElementType.CANNO;
this.cannolab.visible = false;
//鸡蛋
if (type == ElementType.CHICKEN_EGG) {
this.chickenEgg = Pool.takeOut(RecoverName.CHICKEN_EGG)
......@@ -389,6 +465,61 @@ export class Element extends eui.Component {
}
this.addChild(this.festivalEle)
}
this.createCanno();
}
//添加炮台
createCanno(){
if(this.type==ElementType.CANNO){
if(this.cannoMoveClip){
return;
}
if (!svgaParser) svgaParser = new window["SVGA"].Parser();
svgaParser.load(resPath + 'resource/assets/svgas/canno.svga', (videoItem) => {
this.cannoMoveClip = new window["SVGA"].EgretMovieClip(videoItem);
this.cannoMoveClip.lockStep = true;
var mvwidth = 102;
var mvheight = 116;
this.cannoMoveClip.x = (this.cannoboxwid-mvwidth)/2;
this.cannoMoveClip.y = 0;
this.cannobox.addChild(this.cannoMoveClip);
console.log("paotai",this.cannoMoveClip);
//1空,121,181,241,361
// this.cannoMoveClip.gotoAndStop(1);
// this.cannoMoveClip.gotoAndStop(120);
// this.cannoMoveClip.gotoAndStop(120);
// this.cannoMoveClip.gotoAndStop(180);
this.cannoMoveClip.addEventListener(egret.Event.ENTER_FRAME,this.listenCn,this);
this.cannoMoveClip.addEventListener(egret.Event.COMPLETE,this.playComplete,this);
});
}
}
// curframeidx:number = 1;
// testChangeMoveClip(num:number){
// this.curframeidx += num;
// this.cannoMoveClip.gotoAndStop(this.curframeidx);
// }
/**
* 炮台充能
* @param source
*/
listenCn(){
var statend = this.cannoStat[this._cannoStat+1];
if(this.cannoMoveClip.currentFrame>=statend){
// console.log("炮台阶段动画播放完毕",this.cannoMoveClip.currentFrame);
this.cannoMoveClip.stop();
}
}
/**
* 炮台动画播放一次完毕
*/
playComplete(){
this.cannoMoveClip.stop();
}
/**
......@@ -398,7 +529,7 @@ export class Element extends eui.Component {
changeSource(source: string) {
// this.showImage.source = 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.x = -texture.textureWidth / 2;
......@@ -429,6 +560,10 @@ export class Element extends eui.Component {
egret.Tween.removeTweens(this.showImage);
//类型重置,showImage修改
this._type = type;
this.cannolab.visible = type == ElementType.CANNO;
this.showImage.visible = type != ElementType.CANNO;
this.changeSource("ele" + type + "_png");
//特效重置
this.effectType = null;
......
......@@ -67,4 +67,11 @@ export enum ElementConfigType {
FISH = 15,
HONEY_POT = 16,
FLOWER = 17,
/** 大炮 */
CANNO_DIR_TOP = 18,
CANNO_DIR_BOTTOM = 19,
CANNO_DIR_LEFT = 20,
CANNO_DIR_RIGHT = 21,
/** 大炮石头 */
CANNO_BLOCK = 22,
}
\ No newline at end of file
......@@ -30,34 +30,36 @@ export enum ElementType {
FESTIVALELE_BIG, //节日元素大中间一个13
FESTIVALELE_SMALL, //节日元素飞溅的小元素14
CANDY_RABBIT,//兔子
CANDY_CHICKEN,//鸟
CANDY_CATTLE,//牛
CANDY_LION,//狮子
CANDY_PIG,//猪
MONSTER_JELLY1,
JELLY_MONSTER,
FIREWORKS_RABBIT,//烟花目标元素,下同
FIREWORKS_CHICKEN,
FIREWORKS_CATTLE,
FIREWORKS_LION,
FIREWORKS_PIG,
FIREWORKS_SHOOTER,//烟花
MONSTER_RABBIT,//独眼怪
MONSTER_CHICKEN,
MONSTER_CATTLE,
MONSTER_LION,
MONSTER_PIG,
FISH,//气鼓鱼
HONEY,// 蜂蜜
HONEY_POT,//蜂蜜罐
SAND,
FLOWER,
CANDY_RABBIT,//兔子15
CANDY_CHICKEN,//鸟16
CANDY_CATTLE,//牛17
CANDY_LION,//狮子18
CANDY_PIG,//猪19
MONSTER_JELLY1,//20
JELLY_MONSTER,//21
FIREWORKS_RABBIT,//烟花目标元素,下同22
FIREWORKS_CHICKEN,//23
FIREWORKS_CATTLE,//24
FIREWORKS_LION,//25
FIREWORKS_PIG,//26
FIREWORKS_SHOOTER,//烟花27
MONSTER_RABBIT,//独眼怪28
MONSTER_CHICKEN,//29
MONSTER_CATTLE,//30
MONSTER_LION,//31
MONSTER_PIG,//32
FISH,//气鼓鱼33
HONEY,// 蜂蜜34
HONEY_POT,//蜂蜜罐35
SAND,//36
FLOWER,//37
CANNO,//38
CANNO_BLOCK,//39
}
export const isMonsterEle = (t: ElementType) => {
......@@ -88,6 +90,12 @@ export enum MonsterBaseElementType {
}
export enum forwardDirection{
left="left",
up="up",
right="right",
down="down",
}
export const fireworksTypeMap: any = {}
fireworksTypeMap[ElementType.RABBIT] = ElementType.FIREWORKS_RABBIT;
fireworksTypeMap[ElementType.CHICKEN] = ElementType.FIREWORKS_CHICKEN;
......@@ -151,6 +159,13 @@ export const monsterElementMap = {
"5": ElementType.PIG,
}
export const connoDirection = {
"1":forwardDirection.left,
"2":forwardDirection.up,
"3":forwardDirection.right,
"4":forwardDirection.down,
}
export const elementMonsterResMap = {
"0": ElementType.MONSTER_RABBIT,
"1": ElementType.MONSTER_CHICKEN,
......
import { GenerateLatData } from "./GenerateLatData";
import { LatticeType } from "../enum/LatticeType";
import { ElementConfigType } from "../enum/ElementConfigType";
/**
* 地图数据接口
* 包括地图格子,和地图上的特殊元素,生成口,联通口
*/
export interface MapData {
/**
* 传送带
*/
conveyor?:number[][];
conveyorConnectedLats?:number[][];
/**
......@@ -42,7 +46,7 @@ export interface MapData {
* 9褐色毛球 特效消除,分裂
* 10黑色毛球 两次消除,一次眩晕,
*/
elements?: number[];
elements?: ElementConfigType[];
/**
* 9*9的格子,不修改写null或[]
* 十位是基础元素类型,对应数字减1就是基础元素类型
......
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