Commit bc3e2017 authored by wjf's avatar wjf

l

parent ca065cb6
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -46,64 +46,11 @@ export class GameGuide extends egret.DisplayObjectContainer {
this.thisObj = thisObj
this.stepCount = chapterFuns[thisObj.chapter] ? chapterFuns[thisObj.chapter].stepCount : 0;
this.stepAll = this.stepCount;
//双特效的不过
if (this.thisObj.chapter == 8) {
var indexs = chapterFuns[thisObj.chapter].showIndexs[0];
for (var i = 0; i < indexs.length; i++) {
var index = indexs[i];
if (this.thisObj.lattices[index] &&
this.thisObj.lattices[index].element &&
this.thisObj.lattices[index].element.type <= 4)
this.thisObj.lattices[indexs[i]].element.effectType = i == 0 ? EffectType.VERTICAL : EffectType.EXPLOSIVE
}
} else {
this.initElementEx();
}
}
/**
* 修改原先元素
* 唯一影响mainScene里布局的方法,如果有bug优先查
*/
private initElementEx() {
if (!chapterFuns[this.thisObj.chapter] ||
!chapterFuns[this.thisObj.chapter].elementTypes) {
return
}
var lattices = this.thisObj.lattices;
var chapter = this.thisObj.chapter;
var elementTypes = chapterFuns[this.thisObj.chapter].elementTypes;
for (var i = 0; i < elementTypes.length; i++) {
if (!elementTypes[i]) continue
//如果元素为普通元素
if (lattices[i] &&
lattices[i].element &&
lattices[i].element.type <= 4) {
var effectType = lattices[i].element.effectType;
var isLock = lattices[i].element.isLock;
lattices[i].element.reset(elementTypes[i] - 1);
lattices[i].element.isLock = isLock;
//如果不是需要显示的元素,恢复特效
if (chapterFuns[chapter].showIndexs[0].indexOf(i) == -1) {
//还原该有的特效
if (effectType != null) lattices[i].element.effectType = effectType
}
}
}
}
show() {
//判断一次,如果引导并不能产生消除,就return,并移除自己
if (!this.stepCount || !judgeMatch(this.thisObj.chapter, this.stepAll - this.stepCount, this.thisObj.lattices)) {
if (this.parent) this.parent.removeChild(this);
writeCache(getCacheKey() + this.thisObj.chapter);
this.thisObj.gameGuide = null;
return
}
show() {
var step = this.stepAll - this.stepCount;
this.drawBg(step);
......@@ -174,31 +121,19 @@ export class GameGuide extends egret.DisplayObjectContainer {
const chapterFuns = {
//基本操作 1
1: {
//初始化类型图
elementTypes: [
0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0,
1, 5, 5, 4, 3, 1, 1, 2, 5,
2, 4, 3, 5, 5, 1, 1, 5, 2,
3, 2, 4, 4, 2, 2, 5, 5, 2,
2, 1, 5, 2, 5, 2, 3, 1, 5,
2, 3, 4, 4, 5, 3, 3, 2, 1,
0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0,
],
//需要步数
stepCount: 1,
//中空的格子,stepCount有多少,就有多少组
showIndexs: [
[39, 40, 41, 48],
[67, 66, 68, 58],
],
//和遮挡的格子
hideIndexs: [
[40, 41],
[66, 68],
],
//手势来回滑的两个位置索引
handIndexs: [
[39, 48]
[58, 67]
],
//提示文案,尽量通用点的位置。x肯定都居中
msg: [
......@@ -206,201 +141,147 @@ const chapterFuns = {
]
},
//冰块消除
5: {
elementTypes: [
0, 0, 1, 2, 4, 5, 1, 0, 0,
0, 0, 1, 3, 1, 3, 4, 0, 0,
0, 0, 5, 3, 2, 4, 3, 0, 0,
0, 0, 2, 1, 5, 2, 1, 0, 0,
0, 0, 1, 2, 3, 4, 5, 0, 0,
0, 0, 1, 3, 1, 3, 4, 0, 0,
0, 0, 5, 3, 2, 4, 3, 0, 0,
0, 0, 2, 1, 5, 2, 1, 0, 0,
0, 0, 1, 2, 3, 4, 5, 0, 0,
],
2: {
stepCount: 1,
showIndexs: [
[40, 48, 49, 50],
[18, 19, 20, 21],
],
hideIndexs: [
[48, 50],
[18, 19],
],
handIndexs: [
[40, 49]
[21, 20]
],
msg: [
"消除冰块上的元素即可打破冰块"
]
},
//直线特效
6: {
elementTypes: [
1, 2, 4, 5, 1, 3, 5, 4, 3,
1, 3, 1, 3, 4, 1, 3, 5, 2,
5, 3, 2, 4, 3, 4, 4, 3, 1,
2, 1, 5, 2, 1, 3, 2, 1, 5,
1, 2, 3, 4, 5, 1, 2, 3, 4,
2, 2, 4, 5, 1, 3, 5, 4, 3,
1, 3, 1, 3, 4, 1, 3, 5, 2,
5, 3, 2, 4, 3, 4, 4, 3, 1,
2, 1, 5, 2, 1, 3, 2, 1, 5,
],
//石头消除
3: {
stepCount: 1,
showIndexs: [
[13, 21, 22, 23, 24],
[12, 13, 14, 15],
],
hideIndexs: [
[21, 23, 24],
[14, 15],
],
handIndexs: [
[13, 22]
[12, 13]
],
msg: [
"4个同色元素形成直线就能合成直线特效,\n消除直线特效会产生直线消除"
"当石头附近的元素产生消除时,即可粉碎石头"
]
},
//爆炸特效
7: {
elementTypes: [
1, 2, 4, 5, 0, 3, 5, 4, 3,
1, 3, 1, 3, 0, 1, 3, 5, 2,
5, 3, 2, 4, 3, 4, 4, 3, 1,
2, 1, 5, 2, 1, 3, 2, 1, 5,
1, 2, 3, 1, 2, 1, 1, 3, 4,
2, 2, 4, 5, 1, 3, 5, 4, 3,
1, 3, 1, 3, 4, 1, 3, 5, 2,
0, 3, 2, 4, 3, 4, 4, 3, 0,
0, 0, 5, 2, 1, 3, 2, 0, 0,
],
stepCount: 1,
//直线特效
5: {
stepCount: 2,
showIndexs: [
[31, 39, 40, 41, 42, 49],
[13, 22, 31, 40, 23],
[40, 49, 58, 50],
],
hideIndexs: [
[31, 41, 42, 49],
[13, 31, 40],
[40, 58],
],
handIndexs: [
[39, 40]
[23, 22],
[49, 50]
],
msg: [
"5个同色动物头像成L形或T形就能合成\n爆炸特效,消除爆炸特效会产生3*3的范围消除"
"4个同色元素形成直线就能合成直线特效",
"消除直线特效会产生直线消除"
]
},
//两特效组合
//爆炸特效
8: {
elementTypes: null,
stepCount: 2,
showIndexs: [
[2, 11, 20, 19, 18, 21],
[20, 29, 38, 30]
],
hideIndexs: [
[20, 38],
],
handIndexs: [
[30, 29]
],
msg: [
"5个同色动物头像成L形或T形就能合成爆炸特效",
"消除爆炸特效会产生3*3的范围消除",
]
},
//特效组合
9: {
stepCount: 1,
showIndexs: [
[48, 49],
[63, 72],
],
hideIndexs: [
[],
],
handIndexs: [
[48, 49]
[63, 72],
],
msg: [
"将两个特效互相拖动即可直接触发组合特效,\n组合特效的效果视组合的两个特效类型而定"
// "五个相同动物形成一字型即可合成魔力花特效",
// "拖动魔力花特效即可直接触发"
]
},
//魔力鸟特效
9: {
elementTypes: [
1, 2, 4, 5, 1, 3, 5, 4, 3,
1, 3, 1, 3, 1, 1, 3, 5, 2,
5, 3, 2, 1, 3, 4, 5, 3, 1,
0, 1, 5, 2, 1, 3, 2, 1, 0,
1, 2, 3, 1, 1, 4, 1, 3, 4,
2, 2, 4, 5, 0, 3, 5, 4, 3,
1, 3, 1, 3, 4, 1, 3, 5, 2,
5, 3, 2, 4, 3, 4, 4, 3, 1,
2, 1, 5, 2, 1, 3, 2, 1, 5
],
10: {
stepCount: 2,
showIndexs: [
[4, 13, 22, 31, 40, 21],
[40, 39]
[73, 64, 55, 46, 37, 54],
[73, 64]
],
hideIndexs: [
[4, 13, 31, 40],
[73, 64, 46, 37],
[]
],
handIndexs: [
[21, 22],
[40, 39]
[54, 55],
[73, 64]
],
msg: [
"五个相同动物形成一字型即可合成魔力花特效",
"拖动魔力花特效即可直接触发"
]
},
//棒棒糖消除
10: {
elementTypes: [
0, 0, 5, 2, 0, 4, 4, 0, 0,
0, 0, 2, 1, 4, 1, 1, 0, 0,
0, 0, 2, 1, 2, 4, 4, 0, 0,
0, 0, 4, 3, 1, 4, 2, 0, 0,
0, 0, 3, 5, 1, 2, 1, 0, 0,
0, 0, 4, 3, 5, 2, 3, 0, 0,
0, 0, 3, 5, 4, 3, 5, 0, 0,
0, 0, 1, 4, 4, 2, 5, 0, 0,
0, 0, 4, 2, 2, 1, 2, 0, 0
],
//魔力鸟加特效
12: {
stepCount: 1,
showIndexs: [
[4, 5, 6, 13],
[13, 22],
],
hideIndexs: [
[5, 6],
[],
],
handIndexs: [
[13, 4]
[13, 22],
],
msg: [
"当棒棒糖移至底层时,即可移除棒棒糖"
"交换这两个特效元素,\n猜猜会发生什么"
]
},
//石头消除
19: {
elementTypes: [
0, 2, 3, 0, 2, 0, 5, 1, 0,
0, 1, 1, 0, 1, 0, 1, 3, 0,
0, 4, 3, 0, 0, 0, 4, 4, 0,
0, 5, 0, 0, 0, 0, 0, 4, 0,
0, 3, 2, 0, 0, 0, 4, 3, 0,
4, 1, 5, 1, 0, 3, 1, 4, 4,
0, 5, 1, 2, 4, 3, 5, 1, 0,
0, 0, 3, 3, 5, 1, 1, 0, 0,
0, 0, 0, 3, 2, 3, 0, 0, 0,
],
//棒棒糖消除
100: {
stepCount: 1,
showIndexs: [
[46, 47, 48, 56],
[4, 5, 6, 13],
],
hideIndexs: [
[46, 48],
[5, 6],
],
handIndexs: [
[47, 56]
[13, 4]
],
msg: [
"当石头附近的元素产生消除时,即可粉碎石头"
"当棒棒糖移至底层时,即可移除棒棒糖"
]
},
//笼子消除
24: {
elementTypes: [
0, 0, 0, 1, 2, 4, 0, 0, 0,
0, 0, 0, 1, 4, 2, 0, 0, 0,
0, 0, 3, 3, 2, 2, 1, 0, 0,
0, 3, 3, 5, 5, 4, 4, 2, 0,
3, 1, 5, 5, 3, 1, 3, 2, 3,
5, 4, 1, 2, 4, 3, 4, 3, 2,
2, 3, 4, 1, 3, 1, 3, 5, 3,
0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0
],
stepCount: 1,
showIndexs: [
[40, 49, 58, 50],
......@@ -417,17 +298,6 @@ const chapterFuns = {
},
//果冻消除
81: {
elementTypes: [
0, 0, 0, 4, 5, 2, 0, 0, 0,
0, 0, 4, 5, 3, 4, 1, 0, 0,
0, 5, 5, 4, 4, 1, 4, 2, 0,
3, 2, 1, 5, 4, 3, 1, 4, 5,
4, 3, 5, 4, 2, 3, 1, 3, 4,
1, 2, 2, 1, 3, 2, 2, 5, 3,
0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0,
5, 2, 3, 1, 0, 3, 5, 5, 1
],
stepCount: 1,
showIndexs: [
[32, 41, 50, 49],
......@@ -485,57 +355,6 @@ function createLattices9(indexs: number[]): number[] {
return arr
}
/**
* 判断是否有效
* 需要2次引导时重写逻辑,要把手移动的元素算入
*/
function judgeMatch(chapter: number, step: number, lattices: Lattice[]): boolean {
var data = chapterFuns[chapter];
if (!data ||
!data.showIndexs ||
!data.showIndexs[step]) {
return false;
}
//取出所有的元素索引
var indexs = data.showIndexs[step];
var elements: Element[] = []
var arr = {};
for (var i = 0; i < indexs.length; i++) {
var index = indexs[i];
if (lattices[index] && lattices[index].element) {
elements.push(lattices[index].element)
var type = lattices[index].element.type;
if (!arr[type]) arr[type] = 0;
arr[type]++;
}
}
//特效组合,或魔力鸟 的,就两个元素的应该
if (elements.length == 2) {
if (elements[0].effectType == EffectType.MAGICLION &&
elements[1].type <= 4) {
return true
}
if (elements[1].effectType == EffectType.MAGICLION &&
elements[0].type <= 4) {
return true
}
if (elements[1].effectType != null &&
elements[0].effectType != null) {
return true
}
}
//这个要重写
for (var a in arr) {
if (arr[a] >= 3) {
return true
}
}
return false
}
var arr = ["apple", "orange", "apple", "orange", "pear", "orange"];
function getWordCnt(arr: any[]) {
return arr.reduce(function (prev, next) {
......
......@@ -60,7 +60,8 @@ import { FallAniData, FallType } from '../something/interface/FallAniData';
import { EleMaskAni } from '../something/anis/EleMaskAni';
import { getChapterData } from '../something/chapters/getChapter';
import { GenerateLatData } from '../something/interface/GenerateLatData';
import { FallEleType } from '../something/enum/FallELeType';
import { StateType } from '../something/enum/StateType';
import { HairballState } from '../something/states/HairballState';
const aniClass = {
"BoomAni": BoomAni,
......@@ -258,7 +259,7 @@ export default class MainScene extends Scene {
}
//设置栏置顶
this.addChild(this["settingAll"])
//AiControl初始化,用于判断格子中是否有果冻,是否有鸡蛋,必须在初始化元素后执行
//AiControl初始化,
AiControl.ins.init(this.lattices);
//引导
......@@ -490,9 +491,12 @@ export default class MainScene extends Scene {
case 0:
this.emptys.push(i);
break;
//基础元素,枷锁
//基础元素,枷锁,一级毛球,二级毛球
case 1:
case 4:
case 7:
case 8:
case 9:
var type = Tool.returnType(i, this.lattices, this.chapterData.baseElementTypes);
let ele: Element = Pool.takeOut(RecoverName.ELEMENT);
if (!ele) {
......@@ -505,8 +509,19 @@ export default class MainScene extends Scene {
this.elementContainer.addChild(ele);
this.lattices[i].element = ele;
if (elements[i] == 4) {
ele.isLock = true;
} else {
ele.setState(StateType.LOCK, true)
}
else if (elements[i] == 7) {
//气泡要设定type
ele.setState(StateType.BUBBLE, true, type)
}
else if (elements[i] == 8) {
ele.setState(StateType.BUBBLE, true, 1)
}
else if (elements[i] == 9) {
ele.setState(StateType.BUBBLE, true, 2)
}
else {
//加特效
if (Math.random() < this.chapterData.effectInitProbability) {
ele.effectType = Tool.randomT([0, 1, 2, 3])
......@@ -597,19 +612,23 @@ export default class MainScene extends Scene {
if (baseType > 4) continue;
let ele: Element = this.lattices[i].element;
if (baseType != null) {
//重置类型
var isLock = ele.isLock;
//重置类型,该有的状态保留还原
var isLock = ele.hasState(StateType.LOCK);
var isBubble = ele.hasState(StateType.BUBBLE);
var isHairball = ele.hasState(StateType.HAIRBALL);
ele.reset(baseType);
ele.isLock = isLock;
ele.setState(StateType.LOCK, isLock);
ele.setState(StateType.BUBBLE, isBubble);
ele.setState(StateType.HAIRBALL, isHairball);
}
//特效类型
ele.effectType = arr[0] ? arr[0] - 1 : null;
//特效类型,有气炮的不能加特效
if (!ele.hasState(StateType.BUBBLE)) ele.effectType = arr[0] ? arr[0] - 1 : null;
}
}
//初始化引导,游戏和道具
initGuide() {
//游戏引导
const gameGuideChapterNum = [1, 5, 6, 7, 8, 9, 10, 19, 24, 81]
const gameGuideChapterNum = [1, 2, 3, 5, 8, 9, 10, 12]
if (gameGuideChapterNum.indexOf(this.chapter >> 0) > -1) {
if (!readCache(getCacheKey() + this.chapter)) {
this.gameGuide = new GameGuide(this);
......@@ -617,16 +636,16 @@ export default class MainScene extends Scene {
this.gameGuide.show();
}
}
// 234是道具引导
else if (this.chapter == 2 || this.chapter == 3 || this.chapter == 4) {
if (!readCache(getCacheKey() + this.chapter + "prop")) {
this.enableMouseEvt(false);
var pgi = new PropGuideInt(this)
this.addChild(pgi);
pgi.init(this.chapter >> 0)
this.lattices[41].element.effectType = EffectType.EXPLOSIVE
}
}
// 234是道具引导,先不加
// else if (this.chapter == 2 || this.chapter == 3 || this.chapter == 4) {
// if (!readCache(getCacheKey() + this.chapter + "prop")) {
// this.enableMouseEvt(false);
// var pgi = new PropGuideInt(this)
// this.addChild(pgi);
// pgi.init(this.chapter >> 0)
// this.lattices[41].element.effectType = EffectType.EXPLOSIVE
// }
// }
}
/**
......@@ -868,7 +887,7 @@ export default class MainScene extends Scene {
if (Tool.judgeEliminate(lat) && (lat.row == rc[0] || lat.column == rc[1])) {
if (this.eliminatedElements.indexOf(i) == -1) {
this.eliminatedElements.push(i);
if (!lat.element.isLock) {
if (Tool.judgeHasScore(lat.element)) {
//算直线+直线LL
this.pushScoreAni(baseScore * 1 * effectBaseTimes.LL, Tool.getPositionByIndex(i))
}
......@@ -881,10 +900,12 @@ export default class MainScene extends Scene {
break;
case PropType.HAMMER:
this.eliminatedElements.push(index);
this.pushScoreAni(
baseScore * 1 * (effectBaseTimes[this.lattices[index].element.effectType] || 1),
Tool.getPositionByIndex(index)
)
if (Tool.judgeHasScore(this.lattices[index].element)) {
this.pushScoreAni(
baseScore * 1 * (effectBaseTimes[this.lattices[index].element.effectType] || 1),
Tool.getPositionByIndex(index)
)
}
this.eliminate();
break;
case PropType.CHANCE_NUM:
......@@ -936,7 +957,6 @@ export default class MainScene extends Scene {
mouseMoveE(e) {
if (this.SELECTED && e.target.parent instanceof Element) {
if (!Tool.judgeChosen(e.target.parent)) return
// if (e.target.parent.type == ElementType.ROCK || e.target.parent.isLock) return
if (Tool.checkNeb(e.target.parent, this.SELECTED)) {
this.exchangeElementAni(this.SELECTED, e.target.parent, this.callbackEx);
this.SELECTED.removeChild(this.choosed);
......@@ -1403,14 +1423,20 @@ export default class MainScene extends Scene {
}
//否则根据type来定
else {
if (data.type == FallEleType.RANELE) {
//type没有或type长度没有,随机
if (!data.type || !data.type.length) {
type = Tool.randomT(this.chapterData.baseElementTypes)
}
else if (data.type == FallEleType.RANEFF) {
type = Tool.randomT(this.chapterData.baseElementTypes);
effectType = Tool.randomT([0, 1, 2, 3])
} else {
type = data.type - 2
//type里随机。随机出来如果是0,还是随机
else {
var code = Tool.randomT(data.type);
if (code) {
var codeData = Tool.praseEleNumber(code);
type = codeData[0] === null ? Tool.randomT(this.chapterData.baseElementTypes) : codeData[0];
effectType = codeData[1];
} else {
type = Tool.randomT(this.chapterData.baseElementTypes)
}
}
}
}
......@@ -1554,7 +1580,8 @@ export default class MainScene extends Scene {
if (this.eliminatedElements.length && !this.hasPassed) this.commonContinuityTimes++;
for (var aa = 0; aa < this.eliminatedElements.length; aa++) {
var index = this.eliminatedElements[aa];
if (!this.lattices[index].element.isLock) {
//没有锁,也没有毛球
if (Tool.judgeHasScore(this.lattices[index].element)) {
this.pushScoreAni(baseScore * this.commonContinuityTimes, Tool.getPositionByIndex(index))
}
}
......@@ -1732,7 +1759,7 @@ export default class MainScene extends Scene {
//本来没必要判断特效组合时是否有重复的消除元素,但是recoverEle里会有判断石头或果冻的加入,造成重复
if (this.eliminatedElements.indexOf(i) == -1) this.eliminatedElements.push(i);
//两个魔力鸟分数MM
if (!lat.element.isLock && lat.element.type <= 4/*&&lat.element.effectType==null*/) {
if (Tool.judgeHasScore(lat.element)) {
this.pushScoreAni(baseScore * this.effectContinuityTimes * effectBaseTimes.MM, Tool.getPositionByIndex(i))
}
}
......@@ -1778,11 +1805,13 @@ export default class MainScene extends Scene {
}
} else {
//普通元素的旋转消除,无特效,无锁
if (!lat.element.isLock && lat.element.effectType == null) {
if (!lat.element.hasState(StateType.LOCK) &&
!lat.element.hasState(StateType.HAIRBALL) &&
lat.element.effectType == null) {
rotateData.elementsIndex.push(i);
}
}
if (!lat.element.isLock) {
if (Tool.judgeHasScore(lat.element)) {
//魔力鸟和
this.pushScoreAni(baseScore * this.effectContinuityTimes * effectBaseTimes["3"], Tool.getPositionByIndex(i))
}
......@@ -1804,7 +1833,7 @@ export default class MainScene extends Scene {
var lat = this.lattices[i];
if (Tool.judgeEliminate(lat) && (lat.row == lat1.row || lat.column == lat1.column)) {
if (this.eliminatedElements.indexOf(i) == -1) this.eliminatedElements.push(i);
if (!lat.element.isLock && lat.element.type <= 4) {
if (Tool.judgeHasScore(lat.element)) {
//线与线
this.pushScoreAni(baseScore * this.effectContinuityTimes * effectBaseTimes.LL, Tool.getPositionByIndex(i))
}
......@@ -1828,7 +1857,7 @@ export default class MainScene extends Scene {
if (Tool.judgeEliminate(lat) &&
(Math.abs(lat.row - lat1.row) < 2 || Math.abs(lat.column - lat1.column) < 2)) {
if (this.eliminatedElements.indexOf(i) == -1) this.eliminatedElements.push(i);
if (!lat.element.isLock && lat.element.type <= 4) {
if (Tool.judgeHasScore(lat.element)) {
//线和炸弹
this.pushScoreAni(baseScore * this.effectContinuityTimes * effectBaseTimes.EL, Tool.getPositionByIndex(i))
}
......@@ -1853,7 +1882,7 @@ export default class MainScene extends Scene {
if (Tool.judgeEliminate(lat) &&
(Math.abs(lat.row - lat1.row) < 3 && Math.abs(lat.column - lat1.column) < 3)) {
if (this.eliminatedElements.indexOf(i) == -1) this.eliminatedElements.push(i);
if (!lat.element.isLock && lat.element.type <= 4) {
if (Tool.judgeHasScore(lat.element)) {
//两个炸弹
this.pushScoreAni(baseScore * this.effectContinuityTimes * effectBaseTimes.EE, Tool.getPositionByIndex(i))
}
......@@ -1899,28 +1928,39 @@ export default class MainScene extends Scene {
if (!ele) {
//以防万一还是判断一次
}
else if (ele.isLock) {
//有枷锁的
else if (ele.hasState(StateType.LOCK)) {
//被禁锢的解开
ele.isLock = false;
ele.setState(StateType.LOCK, false);
}
//有毛球的
else if (ele.hasState(StateType.HAIRBALL)) {
//逻辑再写,记录毛球的状态,是破碎还是分裂 ,待写
//破碎直接执行,分裂到下次,方法全写在毛球的状态里
var hairballState: HairballState = ele.getState(StateType.HAIRBALL);
if (hairballState.levelNum == 2) {
hairballState.isActive = true;
} else {
//设为无毛球
ele.setState(StateType.HAIRBALL, false)
//算个数
this.goElementTarget(ele.getState(StateType.HAIRBALL));
}
}
//如果有特效,存下
else if (ele.effectType != null) {
effectIndexs.push(index);
} else {
//即将生成特效的,变成特效,不消除
//即将生成特效的,变成特效,不消除
if (ele.temEffectType != null) {
ele.effectType = ele.temEffectType;
ele.temEffectType = null;
//有气泡的需要去掉状态
ele.setState(StateType.BUBBLE, false)
//但是算个数,
this.goElementTarget(ele);
//如果格子有冰
this.iceBroken(this.lattices[index]);
//如果格子附近有石头
this.rokeBroken(this.lattices[index]);
//如果格子附近有果冻
this.jellyBroken(this.lattices[index]);
//如果附近有鸡蛋
this.eggBroken(this.lattices[index])
//附近依旧有影响
this.checkNebAll(this.lattices[index])
} else {
//单纯元素消失特效
if (ele.type <= 4) {
......@@ -1936,6 +1976,8 @@ export default class MainScene extends Scene {
//果冻
else if (ele.type == ElementType.JELLY) {
this.removeJelly(index);
//算个数
this.goElementTarget(ele);
}
//鸡蛋
else if (ele.type == ElementType.CHICKEN_EGG) {
......@@ -1943,7 +1985,7 @@ export default class MainScene extends Scene {
ele.chickenEgg.statusNum--;
//鸡蛋的摆动
ele.chickenEgg.shakeAni();
//鸡蛋动效,待改
//鸡蛋动效
this.playAni(RecoverName.EGGBROKEN_ANI, p)
}
}
......@@ -1991,11 +2033,13 @@ export default class MainScene extends Scene {
if (this.eliminatedElements.indexOf(i) < 0 && effectIndexs.indexOf(i) < 0) {
this.eliminatedElements.push(i);
//无特效未枷锁
if (!this.lattices[i].element.isLock && this.lattices[i].element.effectType == null) {
if (!this.lattices[i].element.hasState(StateType.LOCK) &&
!this.lattices[i].element.hasState(StateType.HAIRBALL) &&
this.lattices[i].element.effectType == null) {
rotateData.elementsIndex.push(i);
}
//
if (!this.lattices[i].element.isLock) {
if (Tool.judgeHasScore(this.lattices[i].element)) {
this.pushScoreAni(baseScore * this.effectContinuityTimes * effectBaseTimes["3"], Tool.getPositionByIndex(i))
}
}
......@@ -2015,7 +2059,7 @@ export default class MainScene extends Scene {
if (this.eliminatedElements.indexOf(i) < 0 && effectIndexs.indexOf(i) < 0) {
this.eliminatedElements.push(i);
//
if (!this.lattices[i].element.isLock && this.lattices[i].element.type <= 4) {
if (Tool.judgeHasScore(this.lattices[i].element)) {
this.pushScoreAni(baseScore * this.effectContinuityTimes * effectBaseTimes["2"], Tool.getPositionByIndex(i))
}
}
......@@ -2034,7 +2078,7 @@ export default class MainScene extends Scene {
if (this.eliminatedElements.indexOf(ein) < 0 && effectIndexs.indexOf(ein) < 0) {
this.eliminatedElements.push(ein);
//
if (!this.lattices[ein].element.isLock && this.lattices[ein].element.type <= 4) {
if (Tool.judgeHasScore(this.lattices[ein].element)) {
this.pushScoreAni(baseScore * this.effectContinuityTimes * effectBaseTimes["0"], Tool.getPositionByIndex(ein))
}
}
......@@ -2053,7 +2097,7 @@ export default class MainScene extends Scene {
if (this.eliminatedElements.indexOf(ein) < 0 && effectIndexs.indexOf(ein) < 0) {
this.eliminatedElements.push(ein);
//
if (!this.lattices[ein].element.isLock && this.lattices[ein].element.type <= 4) {
if (Tool.judgeHasScore(this.lattices[ein].element)) {
this.pushScoreAni(baseScore * this.effectContinuityTimes * effectBaseTimes["1"], Tool.getPositionByIndex(ein))
}
}
......@@ -2097,9 +2141,7 @@ export default class MainScene extends Scene {
var effectElements = [], elements = [];
for (var i = Tool.colNum * Tool.rowNum - 1; i >= 0; i--) {
var lat = this.lattices[i];
if (lat &&
lat.element &&
lat.element.type <= 4) {
if (Tool.judgeBaseEle(lat)) {
if (lat.element.effectType != null) {
effectElements.push(i);
} else {
......@@ -2113,8 +2155,10 @@ export default class MainScene extends Scene {
this.eliminate();
}
else {
if (this.steps == 0) {
//如果步数原先就为0;直接提交了
//如果步数原先就为0或没有元素了;直接提交了
if (this.steps == 0 || elements.length == 0) {
this.score += 1000 * this.steps;
this.steps = 0;
var json = this.getSubmitJson()
this.submit(json)
return
......@@ -2214,10 +2258,9 @@ export default class MainScene extends Scene {
var anis = [];//两个,0下标是元素,1下标是索引
for (var i = 0; i < this.lattices.length; i++) {
var lat = this.lattices[i];
if (lat &&
lat.element &&
lat.element.type <= 4 &&
!lat.element.isLock) {
if (Tool.judgeBaseEle(lat) &&
!lat.element.hasState(StateType.LOCK) &&
!lat.element.hasState(StateType.HAIRBALL)) {
lats.push(lat)
}
}
......@@ -2269,7 +2312,7 @@ export default class MainScene extends Scene {
* 置空格子的element,
* 从容器移除
* 回收元素
* 如果格子有冰
* 如果格子有冰等等
* @param index
*/
recoverEle(index: number) {
......@@ -2282,16 +2325,8 @@ export default class MainScene extends Scene {
Pool.recover(RecoverName.ELEMENT, ele);
//置空格子的element,
this.lattices[index].element = null;
if (ele.type != ElementType.LOLLIPOP) {
//如果格子有冰
this.iceBroken(this.lattices[index]);
//如果附近有石头
this.rokeBroken(this.lattices[index]);
//如果附近有果冻
this.jellyBroken(this.lattices[index]);
//如果附近有鸡蛋
this.eggBroken(this.lattices[index])
}
//棒棒糖消除不产生任何其他效果
if (ele.type != ElementType.LOLLIPOP) this.checkNebAll(this.lattices[index]);
//计算元素消除个数
this.goElementTarget(ele);
}
......@@ -2430,20 +2465,20 @@ export default class MainScene extends Scene {
}
goElementTarget(ele: Element | Ice) {
goElementTarget(ele: Element | Ice | HairballState) {
if (!this.passElements) return
var type: number;
if (ele instanceof Ice) {
type = ElementType.ICE;
}
else if (ele instanceof HairballState) {
type = ElementType.HAIRBALL;
} else {
type = ele.type;
}
if (this.passElements[type] != undefined) {
if (this.passElements[type] != 0) {
this.passElements[type]--;
//显示修改,在动画后修改
// this.elementTargets.targets[ElementType.ICE].count--
//如果通关目标有冰,还有飞入的动效
var p = this.elementTargets.targets[type].localToGlobal(40 * 0.8, 40 * 0.8)
FlyTargetAni(ele, [p.x, p.y], this)
}
......@@ -2451,42 +2486,10 @@ export default class MainScene extends Scene {
this.hasEliminatedElements[type]++;
}
}
/**
* 附近是否有石头
* @param lat 格子
*/
rokeBroken(lat: Lattice) {
var indexMy = lat.index;
//判断上下左右是否有石头
var indexs = [
indexMy - Tool.colNum,
indexMy + Tool.colNum,
]
if (lat.column > 0) {
indexs.push(indexMy - 1)
}
if (lat.column < Tool.colNum - 1) {
indexs.push(indexMy + 1)
}
for (let i = 0; i < indexs.length; i++) {
let index = indexs[i];
let lat = this.lattices[index];
if (lat &&
lat.element &&
lat.element.type == ElementType.ROCK) {
// this.removeRock(index)
//添加进消除队列,注意重复
if (this.eliminatedElements.indexOf(index) == -1) this.eliminatedElements.push(index)
}
}
}
/**
* 附近是否有果冻
* @param lat 格子
*/
jellyBroken(lat: Lattice) {
//检查附近是否有相应元素
checkNebEle(lat: Lattice, checkFun: (la: Lattice) => boolean) {
var indexMy = lat.index;
//判断上下左右是否有果冻
var indexs = [
indexMy - Tool.colNum,
indexMy + Tool.colNum,
......@@ -2500,42 +2503,32 @@ export default class MainScene extends Scene {
for (let i = 0; i < indexs.length; i++) {
let index = indexs[i];
let lat = this.lattices[index];
if (lat &&
lat.element &&
lat.element.type == ElementType.JELLY) {
// this.removeJelly(index)
if (checkFun(lat)) {
//添加进消除队列,注意重复
if (this.eliminatedElements.indexOf(index) == -1) this.eliminatedElements.push(index)
}
}
}
/**
* 附近是否有鸡蛋
* @param lat
*/
eggBroken(lat: Lattice) {
var indexMy = lat.index;
//判断上下左右是否有果冻
var indexs = [
indexMy - Tool.colNum,
indexMy + Tool.colNum,
]
if (lat.column > 0) {
indexs.push(indexMy - 1)
}
if (lat.column < Tool.colNum - 1) {
indexs.push(indexMy + 1)
}
for (let i = 0; i < indexs.length; i++) {
let index = indexs[i];
let lat = this.lattices[index];
if (lat &&
lat.element &&
lat.element.type == ElementType.CHICKEN_EGG) {
//添加进消除队列,注意重复
if (this.eliminatedElements.indexOf(index) == -1) this.eliminatedElements.push(index)
}
}
//检查附近所有元素
checkNebAll(latttice: Lattice) {
//如果格子有冰
this.iceBroken(latttice);
//如果附近有石头
this.checkNebEle(latttice, (lat) => {
return lat && lat.element && lat.element.type == ElementType.ROCK
});
//如果附近有果冻
this.checkNebEle(latttice, (lat) => {
return lat && lat.element && lat.element.type == ElementType.JELLY
});
//如果附近有鸡蛋
this.checkNebEle(latttice, (lat) => {
return lat && lat.element && lat.element.type == ElementType.CHICKEN_EGG
});
//如果附近有毛球
this.checkNebEle(latttice, (lat) => {
return lat && lat.element && lat.element.hasState(StateType.HAIRBALL)
});
}
/**
* 石头的移除,包括动效
......
......@@ -8,6 +8,7 @@ import { writeCache, getCacheKey } from "../mapScene/GuideCon";
import { showToast } from "../../libs/new_wx/ctrls/toastCtrl";
import { Element } from "../something/class/Element";
import { StepAni } from "../something/anis/StepAni";
import { StateType } from "../something/enum/StateType";
const msgs = {
......@@ -175,7 +176,7 @@ export class PropGuideInt extends egret.DisplayObjectContainer {
if (Tool.judgeEliminate(lat) && (lat.row == rc[0] || lat.column == rc[1])) {
if (this.thisObj.eliminatedElements.indexOf(i) == -1) {
this.thisObj.eliminatedElements.push(i);
if (!lat.element.isLock) {
if (!lat.element.hasState(StateType.LOCK) && !lat.element.hasState(StateType.HAIRBALL)) {
//算直线+直线LL
this.thisObj.pushScoreAni(baseScore * 1 * effectBaseTimes.LL, Tool.getPositionByIndex(i))
}
......
......@@ -9,6 +9,7 @@ import { RecoverName } from "./enum/RecoverName";
import { RectMask } from "./class/RectMask";
import { FallType } from "./interface/FallAniData";
import { GenerateLatData } from "./interface/GenerateLatData";
import { StateType } from "./enum/StateType";
export class Tool {
/**
......@@ -216,7 +217,7 @@ export class Tool {
}
//上方元素为石头,或元素为锁定,或者是果冻,或者鸡蛋
else if (lat.element.type == ElementType.ROCK ||
lat.element.isLock ||
lat.element.hasState(StateType.LOCK) ||
lat.element.type == ElementType.JELLY ||
lat.element.type == ElementType.CHICKEN_EGG) {
return false
......@@ -229,7 +230,7 @@ export class Tool {
/**
* 判断格子是否可进行匹配,
* 不包括魔力鸟,
* 不包括魔力鸟,不包括头毛球的
* 包括笼子里的
* @param lat
*/
......@@ -238,12 +239,13 @@ export class Tool {
if (!lat || !lat.element) {
return false
}
//上方元素为石头,或为冰淇淋,或为魔力鸟,或为果冻,或为鸡蛋
//上方元素为石头,或为冰淇淋,或为魔力鸟,或为果冻,或为鸡蛋,或有毛球
else if (lat.element.type == ElementType.ROCK ||
lat.element.type == ElementType.LOLLIPOP ||
lat.element.effectType == EffectType.MAGICLION ||
lat.element.type == ElementType.JELLY ||
lat.element.type == ElementType.CHICKEN_EGG) {
lat.element.type == ElementType.CHICKEN_EGG ||
lat.element.hasState(StateType.HAIRBALL)) {
return false
}
//剩下情况
......@@ -272,7 +274,7 @@ export class Tool {
}
/**
* 判断格子上是基础元素
* 判断格子上是基础元素,包括各种状态的
* @param lat
*/
public static judgeBaseEle(lat: Lattice) {
......@@ -299,7 +301,8 @@ export class Tool {
public static judgeChosen(ele: Element) {
if (!ele ||
ele.type == ElementType.ROCK ||
ele.isLock ||
ele.hasState(StateType.LOCK) ||
ele.hasState(StateType.HAIRBALL) ||
ele.type == ElementType.JELLY ||
ele.type == ElementType.CHICKEN_EGG
) {
......@@ -307,6 +310,25 @@ export class Tool {
}
return true
}
/**
* 是否要算分数
* 排除元素 石头,鸡蛋,果冻,
* 排除状态 枷锁,毛球
* @param ele 元素
*/
public static judgeHasScore(ele: Element): boolean {
if (!ele ||
ele.type == ElementType.ROCK ||
ele.type == ElementType.JELLY ||
ele.type == ElementType.CHICKEN_EGG ||
ele.type == ElementType.LOLLIPOP ||
ele.hasState(StateType.LOCK) ||
ele.hasState(StateType.HAIRBALL)
) {
return false;
}
return true
}
/**
* 检测死图,需要提示
......@@ -562,13 +584,15 @@ export class Tool {
var effectCount = 0;
//记录是否有两个格子挨着,且未锁定
var hasTwo = false;
//记录是否有三个格子挨着,且未锁定,这个逻辑略烦,暂定至少都未锁定,有bug再改
//记录是否有三个格子挨着,且未锁定,没有毛球,这个逻辑略烦,暂定至少都未锁定,有bug再改
var hasThree = false;
for (var i = 0; i < lattices.length; i++) {
if (lattices[i] &&
lattices[i].element &&
lattices[i].element.type <= 4 &&
!lattices[i].element.isLock) {
!lattices[i].element.hasState(StateType.LOCK) &&
!lattices[i].element.hasState(StateType.HAIRBALL)
) {
var type = lattices[i].element.type;
if (!arr[type]) arr[type] = 0;
arr[type]++;
......@@ -696,7 +720,7 @@ export class Tool {
for (var i = 0; i < generateLats.length; i++) {
var generateLat: GenerateLatData = generateLats[i];
var index = generateLat.index;
if(!lattices[index])continue
if (!lattices[index]) continue
lattices[index].isGenerate = true;
var rc = this.indexToRc(index);
//确实属于哪一列
......
......@@ -4,6 +4,7 @@ import { Pool } from "../Pool";
import { Element } from "../class/Element";
import { Ice } from "../class/Ice";
import { ElementType } from "../enum/ElementType";
import { HairballState } from "../states/HairballState";
export function FlyTargetAni(ele: any, p: number[], con: egret.DisplayObjectContainer) {
//弄一个替代的
let eleC;
......@@ -24,6 +25,15 @@ export function FlyTargetAni(ele: any, p: number[], con: egret.DisplayObjectCont
eleC.reset()
}
}
//是毛球
else if(ele instanceof HairballState){
eleC = Pool.takeOut(RecoverName.HAIRBALL_STATE);
if (!eleC) {
eleC = new HairballState()
} else {
eleC.reset(1)
}
}
eleC.x = ele.x;
eleC.y = ele.y;
con.addChild(eleC);
......@@ -42,6 +52,11 @@ export function FlyTargetAni(ele: any, p: number[], con: egret.DisplayObjectCont
Pool.recover(RecoverName.ICE, eleC);
con["elementTargets"].targets[ElementType.ICE].count--
}
//是毛球
else if (ele instanceof HairballState) {
Pool.recover(RecoverName.HAIRBALL_STATE, eleC);
con["elementTargets"].targets[ElementType.HAIRBALL].count--
}
// callback()
})
}
\ No newline at end of file
import { Ani } from "../class/Ani";
import { ElementType } from "../enum/ElementType";
export class JellyDisAni extends Ani {
showImage: egret.Bitmap;
......@@ -8,7 +9,7 @@ export class JellyDisAni extends Ani {
super()
this.aniName = "JellyDisAni";
var arr = ["ele8_png", "greenCircleDown_png", "greenCircleUp_png"];
var arr = ["ele"+ElementType.JELLY+"_png", "greenCircleDown_png", "greenCircleUp_png"];
var objs = ["showImage", "downCircle", "upCircle"];
for (var i = 0; i < arr.length; i++) {
......
......@@ -3,6 +3,7 @@ import { Pool } from "../Pool";
import { RecoverName } from "../enum/RecoverName";
import { playSound, SoundType } from "../../soundCtrl";
import { Tool } from "../Tool";
import { ElementType } from "../enum/ElementType";
/**
* 需要回调的
......@@ -17,7 +18,7 @@ export class JellySpreadAni extends egret.DisplayObjectContainer {
shoot: egret.Bitmap;
constructor() {
super()
var texture: egret.Texture = RES.getRes("ele8_png")
var texture: egret.Texture = RES.getRes("ele"+ElementType.JELLY+"_png")
this.targetImage = new egret.Bitmap(texture);
this.targetImage.anchorOffsetX = texture.textureWidth / 2;
this.targetImage.anchorOffsetY = texture.textureHeight / 2;
......
......@@ -8,7 +8,7 @@ import { ElementType } from "../enum/ElementType";
export const Chapters1: ChapterData[] = [
//第0关为空吧,
null,
//1
//1引导基本消除
{
baseElementTypes: [0, 1, 2, 3],
effectInitProbability: 0,
......@@ -36,8 +36,8 @@ export const Chapters1: ChapterData[] = [
0, 0, 0, 0, 1, 0, 0, 0, 0,
],
generateLats: [
{ index: 11, type: 0, cus: [] },
{ index: 15, type: 0, cus: [] },
{ index: 11, type: [0], cus: [] },
{ index: 15, type: [0], cus: [] },
],
// connectedLats: [[0, 18], [1, 19], [2, 20]],
elements: [
......@@ -65,7 +65,7 @@ export const Chapters1: ChapterData[] = [
// recycles: [70, 71, 72, 73]
},
},
//2
//2引导冰块消除
{
baseElementTypes: [0, 1, 2, 3],
effectInitProbability: 0,
......@@ -122,4 +122,766 @@ export const Chapters1: ChapterData[] = [
// recycles: [70, 71, 72, 73]
},
},
//3引导石头消除
{
baseElementTypes: [0, 1, 2, 3, 4],
effectInitProbability: 0,
stepCount: 20,
passTarget: {
type: PassType.ELEMENT_TARGET,
elements: [
{
type: ElementType.ROCK,
count: 19
}
]
},
starScores: [4000, 8000, 12000],
map: {
lattices: [
0, 0, 1, 1, 1, 1, 1, 0, 0,
0, 0, 1, 1, 1, 1, 1, 0, 0,
0, 0, 1, 1, 1, 1, 1, 0, 0,
0, 0, 1, 1, 1, 1, 1, 0, 0,
0, 0, 1, 1, 1, 1, 1, 0, 0,
0, 0, 1, 1, 1, 1, 1, 0, 0,
0, 0, 1, 1, 1, 1, 1, 0, 0,
0, 0, 1, 1, 1, 1, 1, 0, 0,
0, 0, 1, 1, 1, 1, 1, 0, 0,
],
elements: [
0, 0, 1, 1, 1, 1, 1, 0, 0,
0, 0, 1, 1, 1, 1, 1, 0, 0,
0, 0, 2, 2, 2, 2, 2, 0, 0,
0, 0, 2, 2, 1, 2, 2, 0, 0,
0, 0, 2, 1, 2, 1, 2, 0, 0,
0, 0, 1, 2, 1, 2, 1, 0, 0,
0, 0, 2, 2, 2, 2, 2, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0,
],
baseElements: [
0, 0, 10, 10, 20, 10, 10, 0, 0,
0, 0, 30, 40, 10, 40, 40, 0, 0,
0, 0, 2, 2, 2, 2, 2, 0, 0,
0, 0, 2, 2, 10, 2, 2, 0, 0,
0, 0, 2, 10, 2, 10, 2, 0, 0,
0, 0, 10, 2, 10, 2, 10, 0, 0,
0, 0, 2, 2, 2, 2, 2, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0,
],
generateLats: [
{ index: 2, type: [0], cus: [] },
{ index: 3, type: [0], cus: [] },
{ index: 4, type: [0], cus: [] },
{ index: 5, type: [0], cus: [] },
{ index: 6, type: [0], cus: [] },
],
},
},
//4
{
baseElementTypes: [0, 1, 2, 3, 4],
effectInitProbability: 0,
stepCount: 28,
passTarget: {
type: PassType.ELEMENT_TARGET,
elements: [
{
type: ElementType.ICE,
count: 24
}
]
},
starScores: [4000, 8000, 12000],
map: {
lattices: [
0, 1, 1, 1, 1, 1, 1, 1, 0,
0, 3, 3, 1, 1, 1, 3, 3, 0,
0, 3, 3, 1, 1, 1, 3, 3, 0,
0, 3, 3, 1, 1, 1, 3, 3, 0,
0, 1, 1, 1, 1, 1, 1, 1, 0,
0, 1, 1, 1, 1, 1, 1, 1, 0,
0, 2, 2, 1, 1, 1, 2, 2, 0,
0, 2, 2, 1, 1, 1, 2, 2, 0,
0, 2, 2, 1, 1, 1, 2, 2, 0,
],
elements: [
0, 1, 1, 1, 1, 1, 1, 1, 0,
0, 1, 1, 1, 1, 1, 1, 1, 0,
0, 1, 1, 1, 1, 1, 1, 1, 0,
0, 1, 1, 1, 1, 1, 1, 1, 0,
0, 1, 1, 1, 1, 1, 1, 1, 0,
0, 1, 1, 1, 1, 1, 1, 1, 0,
0, 1, 1, 1, 1, 1, 1, 1, 0,
0, 1, 1, 1, 1, 1, 1, 1, 0,
0, 1, 1, 1, 1, 1, 1, 1, 0,
],
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,
],
generateLats: [
{ index: 1, type: [0], cus: [] },
{ index: 2, type: [0], cus: [] },
{ index: 3, type: [0], cus: [] },
{ index: 4, type: [0], cus: [] },
{ index: 5, type: [0], cus: [] },
{ index: 6, type: [0], cus: [] },
{ index: 7, type: [0], cus: [] },
],
},
},
//5 直线引导
{
baseElementTypes: [0, 1, 2, 3, 4],
effectInitProbability: 0,
stepCount: 25,
passTarget: {
type: PassType.ELEMENT_TARGET,
elements: [
{
type: ElementType.RABBIT,
count: 35
},
{
type: ElementType.CHICKEN,
count: 35
}
]
},
starScores: [4000, 8000, 12000],
map: {
lattices: [
0, 1, 1, 1, 1, 1, 1, 1, 0,
0, 1, 1, 1, 1, 1, 1, 1, 0,
0, 1, 0, 1, 1, 1, 0, 1, 0,
0, 1, 1, 1, 1, 1, 1, 1, 0,
1, 1, 1, 1, 1, 1, 1, 1, 1,
0, 1, 1, 1, 1, 1, 1, 1, 0,
0, 1, 0, 1, 1, 1, 0, 1, 0,
0, 1, 1, 1, 1, 1, 1, 1, 0,
0, 1, 1, 1, 1, 1, 1, 1, 0,
],
elements: [
0, 1, 1, 1, 1, 1, 1, 1, 0,
0, 1, 1, 1, 1, 1, 1, 1, 0,
0, 1, 0, 1, 1, 1, 0, 1, 0,
0, 1, 1, 1, 1, 1, 1, 1, 0,
1, 1, 1, 1, 1, 1, 1, 1, 1,
0, 1, 1, 1, 1, 1, 1, 1, 0,
0, 1, 0, 1, 1, 1, 0, 1, 0,
0, 1, 1, 1, 1, 1, 1, 1, 0,
0, 1, 1, 1, 1, 1, 1, 1, 0,
],
baseElements: [
0, 10, 20, 10, 20, 10, 20, 10, 0,
0, 20, 10, 20, 30, 20, 10, 20, 0,
0, 10, 0, 10, 20, 30, 0, 10, 0,
0, 20, 10, 20, 30, 1, 1, 1, 0,
40, 50, 40, 50, 30, 40, 50, 40, 50,
0, 20, 10, 20, 10, 30, 10, 20, 0,
0, 10, 0, 10, 30, 10, 0, 10, 0,
0, 20, 10, 20, 10, 20, 10, 20, 0,
0, 10, 20, 10, 20, 10, 20, 10, 0,
],
generateLats: [
{ index: 1, type: [0], cus: [] },
{ index: 2, type: [0], cus: [] },
{ index: 3, type: [0], cus: [] },
{ index: 4, type: [0], cus: [10, 20, 30, 40] },
{ index: 5, type: [0], cus: [] },
{ index: 6, type: [0], cus: [] },
{ index: 7, type: [0], cus: [] },
],
},
},
//6
{
baseElementTypes: [0, 1, 2, 3, 4],
effectInitProbability: 0,
stepCount: 25,
passTarget: {
type: PassType.ELEMENT_TARGET,
elements: [
{
type: ElementType.ICE,
count: 17
},
]
},
starScores: [4000, 8000, 12000],
map: {
lattices: [
0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 1, 1, 1, 0, 1, 1, 1, 0,
0, 1, 3, 3, 1, 3, 3, 1, 0,
0, 1, 3, 3, 1, 3, 3, 1, 0,
0, 0, 1, 1, 3, 1, 1, 0, 0,
0, 1, 3, 3, 1, 3, 3, 1, 0,
0, 1, 3, 3, 1, 3, 3, 1, 0,
0, 1, 1, 1, 0, 1, 1, 1, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0,
],
elements: [
0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 1, 1, 1, 0, 1, 1, 1, 0,
0, 1, 1, 1, 1, 1, 1, 1, 0,
0, 1, 1, 1, 1, 1, 1, 1, 0,
0, 0, 1, 1, 1, 1, 1, 0, 0,
0, 1, 1, 1, 1, 1, 1, 1, 0,
0, 1, 1, 1, 1, 1, 1, 1, 0,
0, 1, 1, 1, 0, 1, 1, 1, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0,
],
baseElements: [
0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 10, 20, 20, 0, 30, 30, 50, 0,
0, 40, 30, 30, 40, 10, 10, 30, 0,
0, 10, 30, 30, 40, 10, 10, 50, 0,
0, 0, 40, 40, 50, 40, 40, 0, 0,
0, 30, 20, 20, 40, 50, 50, 20, 0,
0, 30, 20, 20, 40, 50, 50, 10, 0,
0, 40, 40, 50, 0, 20, 40, 20, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0,
],
generateLats: [
{ index: 10, type: [0], cus: [] },
{ index: 11, type: [0], cus: [] },
{ index: 12, type: [0], cus: [] },
{ index: 14, type: [0], cus: [] },
{ index: 15, type: [0], cus: [] },
{ index: 16, type: [0], cus: [] },
],
},
},
//7
{
baseElementTypes: [0, 1, 2, 3, 4],
effectInitProbability: 0,
stepCount: 25,
passTarget: {
type: PassType.ELEMENT_TARGET,
elements: [
{
type: ElementType.ICE,
count: 17
},
]
},
starScores: [4000, 8000, 12000],
map: {
lattices: [
0, 0, 0, 1, 1, 1, 1, 1, 1,
1, 1, 0, 1, 3, 3, 3, 3, 1,
1, 1, 0, 1, 3, 3, 3, 3, 1,
1, 1, 0, 1, 3, 3, 3, 3, 1,
1, 1, 0, 1, 3, 3, 3, 3, 1,
1, 1, 0, 1, 3, 3, 3, 3, 1,
1, 1, 0, 1, 3, 3, 3, 3, 1,
0, 0, 0, 1, 1, 1, 1, 1, 1,
0, 0, 0, 0, 0, 0, 0, 0, 0,
],
elements: [
0, 0, 0, 1, 1, 1, 1, 1, 1,
1, 1, 0, 1, 1, 1, 1, 1, 1,
1, 1, 0, 1, 1, 1, 1, 1, 1,
1, 1, 0, 1, 1, 1, 1, 1, 1,
1, 1, 0, 1, 1, 1, 1, 1, 1,
1, 1, 0, 1, 1, 1, 1, 1, 1,
1, 1, 0, 1, 1, 1, 1, 1, 1,
0, 0, 0, 1, 1, 1, 1, 1, 1,
0, 0, 0, 0, 0, 0, 0, 0, 0,
],
baseElements: [
0, 0, 0, 20, 20, 30, 30, 20, 20,
10, 20, 0, 20, 20, 30, 30, 20, 20,
10, 20, 0, 10, 10, 40, 40, 10, 10,
20, 10, 0, 10, 10, 40, 40, 10, 10,
10, 20, 0, 20, 20, 30, 30, 20, 20,
20, 10, 0, 20, 20, 30, 30, 20, 20,
20, 10, 0, 40, 40, 10, 10, 40, 40,
0, 0, 0, 40, 40, 10, 10, 40, 40,
0, 0, 0, 0, 0, 0, 0, 0, 0,
],
generateLats: [
{ index: 9, type: [10, 20], cus: [] },
{ index: 10, type: [10, 20], cus: [] },
{ index: 3, type: [0], cus: [] },
{ index: 4, type: [0], cus: [10, 20, 30, 40] },
{ index: 5, type: [0], cus: [] },
{ index: 6, type: [0], cus: [] },
{ index: 7, type: [0], cus: [] },
{ index: 8, type: [0], cus: [] },
],
},
},
//8 引导爆炸
{
baseElementTypes: [0, 1, 2, 3, 4],
effectInitProbability: 0,
stepCount: 25,
passTarget: {
type: PassType.ELEMENT_TARGET,
elements: [
{
type: ElementType.ICE,
count: 18
},
]
},
starScores: [4000, 8000, 12000],
map: {
lattices: [
0, 0, 1, 0, 0, 0, 0, 1, 0,
0, 2, 2, 2, 0, 0, 1, 1, 1,
1, 2, 2, 2, 1, 0, 0, 1, 0,
0, 2, 2, 2, 1, 1, 0, 1, 0,
0, 0, 1, 1, 0, 1, 1, 1, 1,
0, 0, 0, 1, 1, 2, 2, 2, 1,
0, 1, 0, 0, 1, 2, 2, 2, 1,
1, 1, 1, 1, 1, 2, 2, 2, 1,
0, 1, 0, 0, 1, 1, 1, 1, 1,
],
elements: [
0, 0, 1, 0, 0, 0, 0, 1, 0,
0, 1, 1, 1, 0, 0, 1, 1, 1,
1, 1, 1, 1, 1, 0, 0, 1, 0,
0, 1, 1, 1, 1, 1, 0, 1, 0,
0, 0, 1, 1, 0, 1, 1, 1, 1,
0, 1, 0, 1, 1, 1, 1, 1, 1,
0, 1, 0, 0, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1,
0, 1, 0, 0, 1, 1, 1, 1, 1,
],
baseElements: [
0, 0, 10, 0, 0, 0, 0, 10, 0,
0, 20, 10, 20, 0, 0, 10, 30, 10,
10, 10, 20, 10, 40, 0, 0, 10, 0,
0, 10, 20, 10, 40, 40, 0, 10, 0,
0, 0, 10, 40, 0, 40, 10, 20, 20,
0, 0, 0, 40, 40, 30, 10, 10, 20,
0, 10, 0, 0, 40, 10, 20, 10, 10,
10, 30, 10, 10, 20, 10, 20, 30, 30,
0, 10, 0, 0, 20, 20, 10, 30, 30,
],
generateLats: [
{ index: 2, type: [0], cus: [40, 40] },
{ index: 7, type: [0], cus: [] },
{ index: 10, type: [0], cus: [30] },
{ index: 12, type: [0], cus: [] },
{ index: 15, type: [0], cus: [] },
{ index: 17, type: [0], cus: [] },
{ index: 18, type: [0], cus: [] },
{ index: 22, type: [0], cus: [] },
{ index: 42, type: [0], cus: [] },
{ index: 44, type: [0], cus: [] },
{ index: 55, type: [0], cus: [] },
{ index: 63, type: [0], cus: [] },
{ index: 65, type: [0], cus: [] },
{ index: 66, type: [0], cus: [] },
],
},
},
//9 引导双特效
{
baseElementTypes: [0, 1, 2, 3, 4],
effectInitProbability: 0,
stepCount: 27,
passTarget: {
type: PassType.ELEMENT_TARGET,
elements: [
{
type: ElementType.ICE,
count: 36
},
]
},
starScores: [4000, 8000, 12000],
map: {
lattices: [
2, 2, 0, 1, 1, 0, 0, 1, 1,
2, 2, 0, 2, 2, 1, 1, 2, 2,
2, 2, 0, 2, 2, 1, 1, 2, 2,
2, 2, 0, 1, 1, 1, 1, 1, 1,
2, 2, 0, 1, 1, 1, 1, 1, 1,
2, 2, 0, 1, 2, 2, 2, 2, 1,
0, 0, 0, 0, 0, 0, 0, 0, 0,
2, 0, 2, 2, 0, 2, 2, 0, 2,
2, 0, 2, 2, 0, 2, 2, 0, 2,
],
elements: [
1, 1, 0, 1, 1, 0, 0, 1, 1,
1, 1, 0, 1, 1, 1, 1, 1, 1,
1, 1, 0, 1, 1, 1, 1, 1, 1,
1, 1, 0, 1, 1, 1, 1, 1, 1,
1, 1, 0, 1, 1, 1, 1, 1, 1,
1, 1, 0, 1, 1, 1, 1, 1, 1,
0, 0, 0, 0, 0, 0, 0, 0, 0,
1, 0, 1, 1, 0, 1, 1, 0, 1,
1, 0, 1, 1, 0, 1, 1, 0, 1,
],
baseElements: [
10, 10, 0, 50, 50, 0, 0, 50, 50,
10, 10, 0, 40, 40, 30, 30, 20, 20,
20, 20, 0, 40, 40, 30, 30, 20, 20,
20, 20, 0, 20, 20, 10, 10, 40, 40,
30, 30, 0, 20, 20, 10, 10, 40, 40,
30, 30, 0, 40, 40, 20, 20, 30, 30,
0, 0, 0, 0, 0, 0, 0, 0, 0,
21, 0, 10, 10, 0, 20, 20, 0, 30,
33, 0, 10, 10, 0, 20, 20, 0, 30,
],
generateLats: [
{ index: 0, type: [0], cus: [] },
{ index: 1, type: [0], cus: [] },
{ index: 3, type: [0], cus: [] },
{ index: 4, type: [0], cus: [] },
{ index: 7, type: [0], cus: [] },
{ index: 8, type: [0], cus: [] },
{ index: 63, type: [0], cus: [] },
{ index: 65, type: [0], cus: [] },
{ index: 66, type: [0], cus: [] },
{ index: 68, type: [0], cus: [] },
{ index: 69, type: [0], cus: [] },
{ index: 71, type: [0], cus: [] },
],
},
},
//10 引导魔力鸟
{
baseElementTypes: [0, 1, 2, 3],
effectInitProbability: 0,
stepCount: 27,
passTarget: {
type: PassType.ELEMENT_TARGET,
elements: [
{
type: ElementType.CHICKEN,
count: 35
},
{
type: ElementType.CATTLE,
count: 35
},
]
},
starScores: [4000, 8000, 12000],
map: {
lattices: [
0, 0, 0, 1, 1, 1, 1, 1, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 1, 1, 1, 1, 1, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 1, 0, 1, 1, 1, 1, 1, 1,
0, 1, 0, 1, 1, 1, 1, 1, 1,
1, 1, 0, 1, 1, 1, 1, 1, 1,
0, 1, 0, 1, 1, 1, 1, 1, 1,
0, 1, 0, 1, 1, 1, 1, 1, 1,
],
elements: [
0, 0, 0, 1, 1, 1, 1, 1, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 1, 1, 1, 1, 1, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 1, 0, 1, 1, 1, 1, 1, 1,
0, 1, 0, 1, 1, 1, 1, 1, 1,
1, 1, 0, 1, 1, 1, 1, 1, 1,
0, 1, 0, 1, 1, 1, 1, 1, 1,
0, 1, 0, 1, 1, 1, 1, 1, 1,
],
baseElements: [
0, 0, 0, 30, 20, 30, 20, 30, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 20, 30, 20, 30, 20, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 20, 0, 30, 30, 20, 20, 10, 10,
0, 20, 0, 30, 30, 20, 20, 10, 10,
20, 30, 0, 40, 40, 30, 30, 20, 20,
0, 20, 0, 40, 40, 30, 30, 20, 20,
0, 20, 0, 10, 10, 20, 20, 10, 10,
],
generateLats: [
{ index: 4, type: [0], cus: [] },
{ index: 5, type: [0], cus: [] },
{ index: 6, type: [0], cus: [] },
{ index: 7, type: [0], cus: [] },
{ index: 8, type: [0], cus: [] },
{ index: 48, type: [0], cus: [] },
{ index: 49, type: [0], cus: [] },
{ index: 50, type: [0], cus: [] },
{ index: 51, type: [0], cus: [] },
{ index: 52, type: [0], cus: [] },
{ index: 53, type: [0], cus: [] },
],
},
},
//11
{
baseElementTypes: [0, 1, 2, 3, 4],
effectInitProbability: 0,
stepCount: 28,
passTarget: {
type: PassType.ELEMENT_TARGET,
elements: [
{
type: ElementType.ICE,
count: 37
},
]
},
starScores: [4000, 8000, 12000],
map: {
lattices: [
2, 0, 0, 0, 2, 2, 2, 2, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 1, 1, 1, 1, 1, 1,
0, 0, 0, 2, 2, 2, 2, 2, 2,
0, 0, 0, 2, 2, 2, 2, 2, 2,
0, 0, 0, 3, 3, 3, 3, 3, 3,
2, 2, 0, 3, 3, 3, 3, 3, 3,
0, 0, 0, 3, 3, 3, 3, 3, 3,
0, 0, 0, 1, 1, 1, 1, 1, 1,
],
elements: [
1, 0, 0, 0, 1, 1, 1, 1, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 1, 1, 1, 1, 1, 1,
0, 0, 0, 1, 1, 1, 1, 1, 1,
0, 0, 0, 1, 1, 1, 1, 1, 1,
0, 0, 0, 1, 1, 1, 1, 1, 1,
1, 1, 0, 1, 1, 1, 1, 1, 1,
0, 0, 0, 1, 1, 1, 1, 1, 1,
0, 0, 0, 1, 1, 1, 1, 1, 1,
],
baseElements: [
11, 0, 0, 0, 20, 20, 30, 30, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 10, 10, 20, 20, 10, 10,
0, 0, 0, 40, 40, 50, 50, 40, 40,
0, 0, 0, 20, 20, 30, 30, 20, 20,
0, 0, 0, 40, 40, 10, 10, 40, 40,
11, 13, 0, 50, 50, 30, 30, 50, 50,
0, 0, 0, 40, 40, 20, 20, 40, 40,
0, 0, 0, 30, 30, 10, 10, 30, 30,
],
generateLats: [
{ index: 0, type: [0], cus: [] },
{ index: 5, type: [0], cus: [14, 11, 14] },
{ index: 6, type: [0], cus: [11, 14, 11] },
{ index: 72, type: [0], cus: [] },
{ index: 73, type: [0], cus: [] },
{ index: 21, type: [0], cus: [] },
{ index: 22, type: [0], cus: [] },
{ index: 23, type: [0], cus: [] },
{ index: 24, type: [0], cus: [] },
{ index: 25, type: [0], cus: [] },
{ index: 26, type: [0], cus: [] },
],
},
},
//12
{
baseElementTypes: [0, 1, 2, 3, 4],
effectInitProbability: 0,
stepCount: 28,
passTarget: {
type: PassType.ELEMENT_TARGET,
elements: [
{
type: ElementType.CHICKEN,
count: 45
},
{
type: ElementType.CATTLE,
count: 65
},
]
},
starScores: [4000, 8000, 12000],
map: {
lattices: [
0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 1, 1, 1, 0, 0, 0,
0, 0, 0, 0, 1, 0, 0, 0, 0,
1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1,
0, 0, 0, 0, 3, 0, 0, 0, 0,
0, 0, 1, 1, 1, 1, 1, 0, 0,
],
elements: [
0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 1, 1, 1, 0, 0, 0,
0, 0, 0, 0, 1, 0, 0, 0, 0,
1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1,
0, 0, 0, 0, 3, 0, 0, 0, 0,
0, 0, 1, 1, 1, 1, 1, 0, 0,
],
baseElements: [
0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 20, 21, 20, 0, 0, 0,
0, 0, 0, 0, 14, 0, 0, 0, 0,
10, 10, 20, 20, 50, 30, 30, 40, 40,
10, 10, 20, 20, 50, 30, 30, 40, 40,
40, 40, 30, 30, 40, 10, 10, 50, 50,
40, 40, 30, 30, 30, 10, 10, 50, 50,
0, 0, 0, 0, 30, 0, 0, 0, 0,
0, 0, 10, 20, 10, 20, 10, 0, 0,
],
generateLats: [
{ index: 12, type: [0], cus: [] },
{ index: 13, type: [0], cus: [] },
{ index: 14, type: [0], cus: [] },
{ index: 27, type: [0], cus: [] },
{ index: 28, type: [0], cus: [] },
{ index: 29, type: [0], cus: [] },
{ index: 30, type: [0], cus: [] },
{ index: 32, type: [0], cus: [] },
{ index: 33, type: [0], cus: [] },
{ index: 34, type: [0], cus: [] },
{ index: 35, type: [0], cus: [] },
{ index: 74, type: [0], cus: [] },
{ index: 75, type: [0], cus: [] },
{ index: 77, type: [0], cus: [] },
{ index: 78, type: [0], cus: [] },
],
},
},
//13
{
baseElementTypes: [0, 1, 2, 3],
effectInitProbability: 0,
stepCount: 28,
passTarget: {
type: PassType.ELEMENT_TARGET,
elements: [
{
type: ElementType.ICE,
count: 27
},
]
},
starScores: [4000, 8000, 12000],
map: {
lattices: [
0, 0, 0, 0, 0, 0, 0, 0, 0,
1, 1, 1, 1, 1, 1, 1, 1, 1,
2, 1, 2, 2, 2, 1, 2, 2, 2,
2, 1, 1, 1, 2, 1, 1, 1, 2,
2, 1, 2, 2, 2, 1, 2, 2, 2,
2, 1, 2, 1, 1, 1, 1, 1, 2,
2, 1, 2, 2, 2, 1, 2, 2, 2,
1, 1, 1, 1, 1, 1, 1, 1, 1,
0, 0, 0, 0, 0, 0, 0, 0, 0,
],
elements: [
0, 0, 0, 0, 0, 0, 0, 0, 0,
1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 2, 2, 2, 1, 1, 1, 1,
1, 1, 1, 1, 2, 1, 1, 1, 1,
1, 1, 2, 2, 2, 1, 1, 1, 1,
1, 1, 2, 1, 1, 1, 1, 1, 1,
1, 1, 2, 2, 2, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1,
0, 0, 0, 0, 0, 0, 0, 0, 0,
],
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,
],
generateLats: [
{ index: 9, type: [0], cus: [] },
{ index: 10, type: [0], cus: [] },
{ index: 11, type: [0], cus: [] },
{ index: 12, type: [0], cus: [] },
{ index: 13, type: [0], cus: [] },
{ index: 14, type: [0], cus: [] },
{ index: 15, type: [0], cus: [] },
{ index: 16, type: [0], cus: [] },
{ index: 17, type: [0], cus: [] },
],
},
},
//14
{
baseElementTypes: [0, 1, 2, 3],
effectInitProbability: 0,
stepCount: 28,
passTarget: {
type: PassType.ELEMENT_TARGET,
elements: [
{
type: ElementType.ROCK,
count: 39
},
]
},
starScores: [4000, 8000, 12000],
map: {
lattices: [
0, 0, 0, 1, 1, 1, 0, 0, 0,
0, 0, 0, 1, 1, 1, 0, 0, 0,
0, 0, 0, 1, 1, 1, 0, 0, 0,
1, 1, 1, 1, 1, 1, 1, 1, 2,
1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1,
],
elements: [
0, 0, 0, 1, 1, 1, 0, 0, 0,
0, 0, 0, 1, 1, 1, 0, 0, 0,
0, 0, 0, 1, 1, 1, 0, 0, 0,
2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 0, 0, 0, 2, 2, 2,
2, 2, 2, 0, 0, 0, 2, 2, 2,
2, 2, 2, 0, 0, 0, 2, 2, 2,
2, 2, 2, 0, 0, 0, 2, 2, 2,
2, 2, 2, 0, 0, 0, 2, 2, 2,
],
baseElements: [
0, 0, 0, 10, 20, 10, 0, 0, 0,
0, 0, 0, 20, 10, 20, 0, 0, 0,
0, 0, 0, 10, 20, 10, 0, 0, 0,
1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1,
],
generateLats: [
{ index: 3, type: [0], cus: [] },
{ index: 4, type: [0], cus: [] },
{ index: 5, type: [0], cus: [] },
{ index: 27, type: [0], cus: [] },
{ index: 28, type: [0], cus: [] },
{ index: 29, type: [0], cus: [] },
{ index: 35, type: [0], cus: [] },
{ index: 34, type: [0], cus: [] },
{ index: 33, type: [0], cus: [] },
],
},
},
]
\ No newline at end of file
......@@ -2,6 +2,8 @@ import { Pool } from "../Pool";
/**
* 动效的基类,包含一些固定方法
* play无参数,不需要回调
* 有自动回收方法recover
*/
export class Ani extends egret.DisplayObjectContainer {
/**
......
......@@ -2,12 +2,15 @@ import { ElementType } from "../enum/ElementType";
import { EffectType } from "../enum/EffectType";
import { Pool } from "../Pool";
import { RecoverName } from "../enum/RecoverName";
import { LockAni } from "../anis/LockAni";
import { MagicLionBgAni } from "../periodAni/MagicLionBgAni";
import { HorizontalBgAni } from "../periodAni/HorizontalBgAni";
import { VerticalBgAni } from "../periodAni/VerticalBgAni";
import { ExplosiveBgAni } from "../periodAni/ExplosiveBgAni";
import { ChickenEgg } from "./ChickenEgg";
import { State } from "./State";
import { StateType } from "../enum/StateType";
import { LockState } from "../states/LockState";
import { HairballState } from "../states/HairballState";
/**
......@@ -23,7 +26,7 @@ export class Element extends eui.Component {
return this._type
}
/**
* 显示的图片,直接改source,"ele"+type+effectType
* 显示的图片,直接改source,"ele"+type
*/
showImage: eui.Image;
......@@ -39,7 +42,7 @@ export class Element extends eui.Component {
if (this._effectType == value) return
if (value != null) {
//先去掉原先有的
this.removeHas();
this.removeEffectHas();
//赋值现在的
switch (value) {
case EffectType.MAGICLION:
......@@ -90,7 +93,7 @@ export class Element extends eui.Component {
} else {
// console.log(this._effectType)
//回收掉原先有的
this.removeHas();
this.removeEffectHas();
this.changeSource("ele" + this.type + "_png");
this._effectType = null;
// console.log(this)
......@@ -112,34 +115,15 @@ export class Element extends eui.Component {
* 第几列
*/
column: number
//鸡蛋
chickenEgg: ChickenEgg;
/**
* 带动画的
* 所有的状态,注意,变色气泡特殊,不能和特效共存,所以初始化时,气泡的不能加特效。生成特效,去掉气泡
* 索引必须按枚举
*/
lockAni: LockAni
private _isLock: boolean = false;
get isLock() {
return this._isLock;
}
set isLock(value: boolean) {
if (this._isLock == value) return;
if (value) {
//如果是加锁,肯定为空
this.lockAni = Pool.takeOut(RecoverName.LOCK_ANI)
if (!this.lockAni) {
//新建,里面是解锁的所有图片组
this.lockAni = new LockAni();
} else {
this.lockAni.reset();
}
this.addChild(this.lockAni)
} else {
//如果去锁
this.lockAni.play()
this.lockAni = null;
}
this._isLock = value
}
chickenEgg: ChickenEgg;
private states: State[] = []
constructor(type: ElementType) {
super();
this._type = type;
......@@ -150,13 +134,14 @@ export class Element extends eui.Component {
if (type == ElementType.CHICKEN_EGG) {
this.chickenEgg = Pool.takeOut(RecoverName.CHICKEN_EGG)
if (!this.chickenEgg) {
//新建,里面是解锁的所有图片组
this.chickenEgg = new ChickenEgg();
} else {
this.chickenEgg.reset();
}
this.addChild(this.chickenEgg)
}
//
}
/**
......@@ -191,13 +176,28 @@ export class Element extends eui.Component {
//特效重置
this.effectType = null;
this.temEffectType = null;
//lock重置
this._isLock = false;
//回收lockImage
if (this.lockAni) {
this.removeChild(this.lockAni);
Pool.recover(RecoverName.LOCK_ANI, this.lockAni);
this.lockAni = null;
//所有状态重置
for (var i = 0; i < this.states.length; i++) {
let state = this.states[i];
if (!state) continue
//直接移除
this.removeChild(state);
//直接回收
var recoverType: RecoverName
switch (i) {
case StateType.LOCK:
recoverType = RecoverName.LOCK_STATE;
break;
case StateType.BUBBLE:
recoverType = RecoverName.BUBBLE_STATE;
break;
case StateType.HAIRBALL:
recoverType = RecoverName.HAIRBALL_STATE;
break;
}
Pool.recover(recoverType, state);
//置空
this.states[i] = null;
}
//如果类型是鸡蛋
if (type == ElementType.CHICKEN_EGG) {
......@@ -217,7 +217,7 @@ export class Element extends eui.Component {
}
}
private removeHas() {
private removeEffectHas() {
//回收掉原先有的
switch (this._effectType) {
case EffectType.MAGICLION:
......@@ -249,4 +249,87 @@ export class Element extends eui.Component {
// .to({ scaleY: 0.7 }, 200)
// .to({ scaleY: 1 }, 100)
}
/**
* 是否有该状态
* @param state
*/
hasState(state: StateType): boolean {
return !!this.states[state];
}
/**
* 设置状态
* @param state 状态类型
* @param set true为设置
*/
setState(state: StateType, set: boolean, data?: any) {
//set为false的话,
if (!set) {
//如果原先有状态,去掉
if (this.hasState(state)) {
//自己回收,动画,然后从父级移除,最后进入pool
this.states[state].recover();
//置空
this.states[state] = null;
}
//原先每状态不管
else {
}
}
//set为true的话
else {
//如果有状态,执行重置
if (this.hasState(state)) {
this.states[state].reset(data);
}
//没有的话加上
else {
switch (state) {
case StateType.LOCK:
let lockState = Pool.takeOut(RecoverName.LOCK_STATE);
if (!lockState) {
lockState = new LockState();
} else {
lockState.reset()
}
this.states[state] = lockState;
break;
case StateType.BUBBLE:
break;
case StateType.HAIRBALL:
let hairBallState = Pool.takeOut(RecoverName.HAIRBALL_STATE);
if (!hairBallState) {
hairBallState = new HairballState(data);
} else {
hairBallState.reset(data)
}
this.states[state] = hairBallState;
break;
}
//视图添加
this.addChild(this.states[state]);
}
}
}
/**
* 判断是否有任何特效,true表示有,false表示没有
*/
hasAnyState(): boolean {
for (var i = 0; i < this.states.length; i++) {
if (this.states[i]) return true
}
return false
}
/**
* 取得一个状态
* @param state
*/
getState(state: StateType): any {
return this.states[state]
}
}
\ No newline at end of file
import { ElementType } from "../enum/ElementType";
export class Ice extends eui.Image {
/**
......@@ -18,7 +19,7 @@ export class Ice extends eui.Image {
constructor(n: number = 2) {
super()
this.source = "ele7_png";
this.source = "ele" + ElementType.ICE + "_png";
if (n == 2) {
this.alpha = 1;
} else {
......@@ -28,7 +29,7 @@ export class Ice extends eui.Image {
}
reset(n: number = 2){
reset(n: number = 2) {
this.scaleX = this.scaleY = 1;
if (n == 2) {
this.alpha = 1;
......
import { Element } from "./Element";
/**
* 元素的各种状态
*/
export class State extends egret.DisplayObjectContainer {
constructor() {
super()
}
//重置方法,子类重写
reset(data: any) {
}
//回收,子类继承重写
recover() {
}
}
\ No newline at end of file
/**
* 元素类型 <=4就是基础元素
*
* 修改索引时,需要修改ele的图片,和通关目标类。飞入特效类
*/
export enum ElementType {
//基础5种元素
RABBIT = 0,//兔子0
CHICKEN,//鸡1
CATTLE,//牛2
LION,//狮子3
PIG,//猪4
//特殊元素
ROCK,//石头5
LOLLIPOP,//棒棒糖6
JELLY,//果冻7
CHICKEN_EGG,//鸡蛋8
ICE,//冰块7 有时间重构的话,不适合放这里
//下面几种为了通关目标,有时间重构的话,不适合放这里
//地图状态
ICE,//冰块9
//元素身上状态
HAIRBALL,//毛球10
JELLY,//果冻8
CHICKEN_EGG,//鸡蛋9
}
var a = [
0, 40, 30, 0, 44, 0, 20, 40, 0,
......
/**
* 掉落元素类型
* 没用了
*/
export enum FallEleType {
RANELE = 0,//随机元素无特效
......
......@@ -20,7 +20,6 @@ export enum RecoverName {
//元素身上
LOCK_ANI = "LockAni",
MAGICLIONBG_ANI = "MagicLionBgAni",
HORIZONTALBG_ANI = "HorizontalBgAni",
VERTICALBG_ANI = "VerticalBgAni",
......@@ -44,5 +43,10 @@ export enum RecoverName {
EGGBROKEN_ANI = "EggBrokenAni",
//方形遮罩
RECT_MASK = "RectMask"
RECT_MASK = "RectMask",
//状态的回收
LOCK_STATE ="LockState",
BUBBLE_STATE="BubbleState",
HAIRBALL_STATE="HairballState",
}
\ No newline at end of file
/**
* 通关类型
*/
export enum StateType {
LOCK = 0,//锁
BUBBLE,//变色气泡
HAIRBALL,//毛球
}
\ No newline at end of file
import { FallEleType } from "../enum/FallELeType";
/**
* 格子生成口数据格式
*/
......@@ -11,8 +8,9 @@ export interface GenerateLatData{
index: number;
/**
* 掉落元素类型
* 里面随机类型和下一致
*/
type:FallEleType
type:number[]
/**
* 自定义掉落元素
* 十位是基础元素类型,对应数字减1就是基础元素类型
......
......@@ -31,6 +31,9 @@ export interface MapData {
* 4元素枷锁
* 5果冻
* 6鸡蛋
* 7变色气泡
* 8一级毛球
* 9二级毛球
*/
elements?: number[];
/**
......
......@@ -8,6 +8,7 @@ import { Lattice } from "../class/Lattice";
import { ChickenEgg } from "../class/ChickenEgg";
import { HatchAni } from "../anis/HatchAni";
import { PieceToEggAni } from "../anis/PieceToEggAni";
import { StateType } from "../enum/StateType";
//孵鸡的数量
const chickenNum: number = 4
......@@ -22,12 +23,31 @@ export class AiControl {
*/
private hasJelly: boolean;
/**
* 提前记录所有的鸡蛋的索引
* 提前记录所有的鸡蛋的索引,因为鸡蛋数量不会改变
*/
private eggs: number[];
/**
* 判断是否还有气泡,暂时不考虑气泡能再生
*/
private hasBubble: boolean;
/**
* 判断是否还有毛球,暂时不考虑毛球能再生
*/
private hasHairball: boolean;
/**
* 用于判断格子中
* 是否有果冻,
* 是否有鸡蛋,
* 是否有毛球,
* 是否有变色气泡,
* 必须在初始化元素后执行
* @param lattices
*/
init(lattices: Lattice[]) {
this.hasJelly = judgeJellyExist(lattices);
this.hasBubble = judgeBubbleExist(lattices);
this.hasHairball = judgeHairballExist(lattices);
this.eggs = getEggs(lattices);
}
......@@ -96,13 +116,13 @@ export class AiControl {
var chickenIndexs: number[] = [];
for (var a = 0; a < thisObj.lattices.length; a++) {
var lat = thisObj.lattices[a];
if (lat &&
lat.element &&
lat.element.type <= 4) {
//是基础元素,但是不能有任何状态
if (Tool.judgeBaseEle(lat) &&
!lat.element.hasAnyState()) {
chickenIndexs.push(a);
}
}
//如果没有能飞的格子
//如果没有能飞的格子,直接回调
if (!chickenIndexs.length) {
callback();
return
......@@ -120,7 +140,7 @@ export class AiControl {
for (var b = 0; b < activeEggIndexs.length; b++) {
let activeEggIndex = activeEggIndexs[b];
//从chickenIndexsCopy取四个,不足就在chickenIndexs随个
let four: number[] = chickenIndexsCopy.splice(0, 4);
let four: number[] = chickenIndexsCopy.splice(0, chickenNum);
if (four.length < chickenNum) {
//补上剩下的,如果还不足,就不管
four = four.concat(Tool.getRandomArrayElementsEx(chickenIndexs, chickenNum - four.length))
......@@ -145,6 +165,7 @@ export class AiControl {
if (count == countAll) {
//做个延时,有节奏感
setTimeout(() => {
//检测三消,有就执行消除,没有就回调
if (thisObj.threeMatch()) {
thisObj.eliminate();
} else {
......@@ -156,6 +177,36 @@ export class AiControl {
}
}
/**
* 变色气泡
*
* @param thisObj
* @param callback
*/
bubbleMotion(thisObj: MainScene, callback: Function) {
//无气泡,直接回调
if (!this.hasBubble) {
callback();
return
}
//找出所有的气泡
var indexs = [];
for (var i = 0; i < thisObj.lattices.length; i++) {
var lat = thisObj.lattices[i];
//是基础元素,有气泡状态
if (Tool.judgeBaseEle(lat) && !lat.element.hasState(StateType.BUBBLE)) {
indexs.push(i);
}
}
let count = 0;
let contAll = indexs.length;
//对所有气泡进行变色处理
for (var a = 0; a < indexs.length; a++) {
}
}
}
......@@ -174,6 +225,30 @@ function judgeJellyExist(lattices: Lattice[]) {
}
return false;
}
/**
* 判断毛球是否存在
* @param lattices
*/
function judgeHairballExist(lattices: Lattice[]) {
for (var i = 0; i < lattices.length; i++) {
var lattice = lattices[i]
//必须是基础元素,然后判断状态毛球,有一个就返回true
if (Tool.judgeBaseEle(lattice) && lattice.element.hasState(StateType.HAIRBALL)) return true
}
return false;
}
/**
* 判断气泡是否存在
* @param lattices
*/
function judgeBubbleExist(lattices: Lattice[]) {
for (var i = 0; i < lattices.length; i++) {
var lattice = lattices[i]
//必须是基础元素,然后判断状态气泡,有一个就返回true
if (Tool.judgeBaseEle(lattice) && lattice.element.hasState(StateType.BUBBLE)) return true
}
return false;
}
/**
* 获取所有鸡蛋的索引
* @param lattices
......@@ -190,15 +265,15 @@ function getEggs(lattices: Lattice[]) {
) {
arr.push(i)
}
}
return arr;
}
/**
* 获取能蔓延的
* 获取能蔓延的果冻
* @param lattices
* @return 返回自身索引和蔓延的索引
*/
function getJellySpreadAni(lattices: Lattice[]) {
var indexs: number[] = [];
......@@ -208,6 +283,7 @@ function getJellySpreadAni(lattices: Lattice[]) {
if (!lattice || !lattice.element || lattice.element.type != ElementType.JELLY) continue
indexs.push(i);
}
//没有果冻,返回0
if (!indexs.length) return 0
while (indexs.length) {
var rand = Math.floor(Math.random() * indexs.length);
......@@ -238,10 +314,8 @@ function judgeSpread(index: number, lattices: Lattice[]): number {
while (arr.length) {
var rand = Math.floor(Math.random() * arr.length);
var i = arr.splice(rand, 1)[0];
if (lattices[i] &&
lattices[i].element &&
lattices[i].element.type <= 4 &&
!lattices[i].element.isLock) {
if (Tool.judgeBaseEle(lattices[i]) &&
!lattices[i].element.hasAnyState()) {
return i
}
}
......@@ -249,3 +323,6 @@ function judgeSpread(index: number, lattices: Lattice[]): number {
}
import { State } from "../class/State";
import { Pool } from "../Pool";
import { RecoverName } from "../enum/RecoverName";
import { ElementType } from "../enum/ElementType";
/**
* 枷锁状态
*/
export class HairballState extends State {
private showImage: egret.Bitmap;
/**
* 是否激活
*/
isActive: boolean;
/**
* 毛球等级,1或2
*/
private _levelNum: number;
get levelNum() {
return this._levelNum
}
set levelNum(value: number) {
if (this._levelNum == value) return
this._levelNum = value;
var source: string;
if (value == 2) {
source = "hairballDark_png";
} else {
source = "ele" + ElementType.HAIRBALL + "_png"
}
this.changeSource(source)
}
constructor(level: number = 2) {
super();
this.showImage = new egret.Bitmap();
this.addChild(this.showImage);
this.levelNum = level;
this.isActive = false;
}
reset(level: number = 2) {
this.levelNum = level;
this.isActive = false;
}
recover() {
//动画是添加进这里的
//回收消失动效
setTimeout(() => {
if (this.parent) this.parent.removeChild(this);
Pool.recover(RecoverName.HAIRBALL_STATE, this);
})
}
private changeSource(source: string) {
var texture: egret.Texture = RES.getRes(source);
this.showImage.texture = texture;
this.showImage.x = -texture.textureWidth / 2;
this.showImage.y = -texture.textureHeight / 2
}
}
\ No newline at end of file
import { Ani } from "../class/Ani";
export class LockAni extends Ani {
export class LockAni extends egret.DisplayObjectContainer {
private showImage: egret.Bitmap;
constructor() {
super()
this.aniName = "LockAni";
var texture: egret.Texture = RES.getRes("lockVine_png")
this.showImage = new egret.Bitmap(texture);
this.addChild(this.showImage);
......@@ -19,11 +17,12 @@ export class LockAni extends Ani {
reset() {
this.alpha = 1;
}
play() {
play(callback: Function) {
egret.Tween.get(this)
.to({ alpha: 0 }, 750)
.call(() => {
this.recover();
if (this.parent) this.parent.removeChild(this);
if (callback) callback();
})
}
}
......
import { State } from "../class/State";
import { Pool } from "../Pool";
import { RecoverName } from "../enum/RecoverName";
/**
* 枷锁状态
*/
export class LockState extends State {
private showImage: egret.Bitmap;
constructor() {
super();
var texture: egret.Texture = RES.getRes("lockVine_png")
this.showImage = new egret.Bitmap(texture);
this.addChild(this.showImage);
this.showImage.x = -texture.textureWidth / 2;
this.showImage.y = -texture.textureHeight / 2
}
reset() {
this.alpha = 1;
}
recover() {
egret.Tween.get(this)
.to({ alpha: 0 }, 750)
.call(() => {
if (this.parent) this.parent.removeChild(this);
Pool.recover(RecoverName.LOCK_STATE, this);
})
}
}
\ 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