Commit 975c9ba7 authored by wildfirecode's avatar wildfirecode

更新新元素

parent 5362fc39
import { Element } from "../something/class/Element";
import { StateType } from "../something/enum/StateType";
import MainScene from "./MainScene";
import { Tool } from "../something/Tool";
import { EffectType } from "../something/enum/EffectType";
import wait from "../../libs/new_tc/wait";
import { MonsterShootAni, monstShootAniDur } from "../something/anis/MonsterShootAni";
import { RecoverName } from "../something/enum/RecoverName";
import { Pool } from "../something/Pool";
import { createMonsterStatusAni } from "../effect/createMonsterStatusAni";
/**
* 独眼怪爆炸
*/
export default async (thisObj: MainScene) => {
//先找出所有激活的怪物
const awakeMonsterIndexs: number[] = [];
for (var i = 0; i < thisObj.lattices.length; i++) {
const lattice = thisObj.lattices[i]
if (lattice && lattice.element && lattice.element.monster && lattice.element.monster.active) {
if (!lattice.element.hasState(StateType.BLOCK_LOCK))
awakeMonsterIndexs.push(i);
}
}
//遍历所有基础元素
const baseElements: Element[] = [];
for (var i = Tool.colNum * Tool.rowNum - 1; i >= 0; i--) {
var lat = thisObj.lattices[i];
if (Tool.judgeBaseEle(lat) &&
!lat.element.monster &&
!lat.element.candy &&
!lat.element.effectType) {
baseElements.push(lat.element);
}
}
baseElements.sort(function () { //打乱数组
return (0.5 - Math.random());
});
let genarateEffect: Element[] = []; //生成的特效的列表
const activeMosterEles: Element[] = awakeMonsterIndexs.map(i => thisObj.lattices[i].element);
const foundsResult: Element[][] = [];
//遍历激活的怪物
for (let index = 0; index < activeMosterEles.length; index++) {
const monsterEle = activeMosterEles[index];
//找到相同颜色的元素
let founds = baseElements.filter(ele => ele.type == monsterEle.type && genarateEffect.indexOf(ele) == -1);
founds = founds.slice(0, 3);
genarateEffect = genarateEffect.concat(founds);
foundsResult[index] = founds;
}
const playEffect = async (index) => {
const monsterEle = activeMosterEles[index];
//找到相同颜色的元素
let founds = foundsResult[index];
await createMonsterStatusAni(monsterEle.x, monsterEle.y, thisObj);
monsterEle.monster.hide();
founds.forEach((ele) => {
let bonusShootAni: MonsterShootAni = Pool.takeOut(RecoverName.MONSTER_SHOOT_ANI);
if (!bonusShootAni)
bonusShootAni = new MonsterShootAni();
var r = Tool.getForwardRotation([monsterEle.x, monsterEle.y], [ele.x, ele.y])
bonusShootAni.play(r * 180 / Math.PI, [monsterEle.x, monsterEle.y], [ele.x, ele.y], () => { });
thisObj.addChild(bonusShootAni);
});
};
for (let index = 0; index < activeMosterEles.length; index++) {
playEffect(index);
}
if (genarateEffect.length > 0)
await wait(monstShootAniDur + 300);
for (let index = 0; index < foundsResult.length; index++) {
const founds = foundsResult[index];
founds.forEach(ele => {
ele.effectType = Math.random() > 0.5 ? EffectType.HORIZONTAL : EffectType.VERTICAL;
});
activeMosterEles[index].monster.resetStatus();
}
// console.log('激活的怪物数据', foundsResult);
//禁用所有的怪物,再开始播放怪物释放技能的动画,完了再播放怪物睡眠、苏醒的动画,再重新启用怪物
return genarateEffect; //如果有苏醒的怪物
}
\ No newline at end of file
......@@ -2,4 +2,70 @@ import { ChapterData } from "../interface/ChapterData";
import { PassType } from "../enum/PassType";
import { ElementType } from "../enum/ElementType";
//476-500
export const Chapters19: ChapterData[] = []
\ No newline at end of file
export const Chapters19: ChapterData[] = [
{
baseElementTypes: [0, 1, 2, 3,4],
bubbleProbability: 0,
stepCount: 999,
passTarget: {
type: PassType.ELEMENT_TARGET,
elements: [
{
type: ElementType.CHICKEN,
count: 995,
},
],
},
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,
],
conveyor:[
[20,56],
[57,60],
[51,24],
// [23,20],
],
conveyorConnectedLats:[
[76,29]
],
generateLats: [
{ index: 11, type: [0], cus: [] },
{ index: 15, type: [0], cus: [] },
],
connectedLats: [[76, 11]],
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, 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,
],
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: [70, 71, 72, 73]
},
}
]
\ No newline at end of file
......@@ -2387,132 +2387,6 @@
"levelNum": 475,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 476,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 477,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 478,
"maxScore": 47440,
"stars": 1
}
,
{
"levelNum": 479,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 480,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 481,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 482,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 483,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 484,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 485,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 486,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 487,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 488,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 489,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 490,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 491,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 492,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 493,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 494,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 495,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 496,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 497,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 498,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 499,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 500,
"maxScore": 47440,
"stars": 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