Commit 8166e310 authored by wildfirecode's avatar wildfirecode

1

parent ebbe3280
...@@ -138,8 +138,8 @@ ...@@ -138,8 +138,8 @@
// localStorage.clear(); // localStorage.clear();
window['imgver'] = '11112'; window['imgver'] = '11112';
//top 8 ,repeat 22 , bottom 3 //top 8 ,repeat 22 , bottom 3
window['total_level'] = 8 + 3 + 22 * 20; window['total_level'] = 8 + 3 + 22 * 21;
window['last_level'] = 425; window['last_level'] = 450;
var sharePic = document.getElementById('pic'); var sharePic = document.getElementById('pic');
......
...@@ -96,6 +96,7 @@ import { NetManager } from './../../libs/tw/manager/NetManager'; ...@@ -96,6 +96,7 @@ import { NetManager } from './../../libs/tw/manager/NetManager';
import doMonsterAI from './doMonsterAI'; import doMonsterAI from './doMonsterAI';
import jellyMonsterAI from './jellyMonsterAI'; import jellyMonsterAI from './jellyMonsterAI';
import doFishAI from './doFishAI'; import doFishAI from './doFishAI';
import HoneyPotElement from '../something/class/HoneyPotElement';
const aniClass = { const aniClass = {
"BoomAni": BoomAni, "BoomAni": BoomAni,
...@@ -760,6 +761,14 @@ export default class MainScene extends Scene { ...@@ -760,6 +761,14 @@ export default class MainScene extends Scene {
this.lattices[i].element = monster; this.lattices[i].element = monster;
monster.resetMonster(); monster.resetMonster();
break; break;
case ElementConfigType.HONEY_POT:
let honeyPot:Element = Tool.getElement(ElementType.HONEY_POT);
honeyPot.x = p[0];
honeyPot.y = p[1];
this.elementContainer.addChild(honeyPot);
this.lattices[i].element = honeyPot;
honeyPot.resetView();
break;
//烟花 //烟花
case ElementConfigType.FIREWORKS: case ElementConfigType.FIREWORKS:
let fireworks: Element = Tool.getElement(ElementType.FIREWORKS_SHOOTER) let fireworks: Element = Tool.getElement(ElementType.FIREWORKS_SHOOTER)
......
...@@ -8,6 +8,7 @@ import { StateType } from "./enum/StateType"; ...@@ -8,6 +8,7 @@ import { StateType } from "./enum/StateType";
import { FallType } from "./interface/FallAniData"; import { FallType } from "./interface/FallAniData";
import { GenerateLatData } from "./interface/GenerateLatData"; import { GenerateLatData } from "./interface/GenerateLatData";
import { Pool } from "./Pool"; import { Pool } from "./Pool";
import HoneyPotElement from "./class/HoneyPotElement";
//两种,0无棒棒糖,1有 //两种,0无棒棒糖,1有
const offsetYTwo: number[] = []; const offsetYTwo: number[] = [];
...@@ -1077,8 +1078,14 @@ export class Tool { ...@@ -1077,8 +1078,14 @@ export class Tool {
* @param type * @param type
*/ */
public static getElement(type: ElementType): Element { public static getElement(type: ElementType): Element {
const clsMap = {};
clsMap[ElementType.HONEY_POT] = HoneyPotElement;
const cls = clsMap[type];
let obj: Element = Pool.takeOut(RecoverName.ELEMENT); let obj: Element = Pool.takeOut(RecoverName.ELEMENT);
if (!obj) { if (!obj) {
if(cls)
obj = new cls(type);
else
obj = new Element(type) obj = new Element(type)
} else { } else {
obj.reset(type) obj.reset(type)
......
import { ChapterData } from "../interface/ChapterData";
import { PassType } from "../enum/PassType";
import { ElementType } from "../enum/ElementType";
//401-425
export const Chapters16: ChapterData[] = [
//1引导基本消除
{
baseElementTypes: [0, 1, 2, 3],
bubbleProbability: 0,
stepCount: 25,
passTarget: {
type: PassType.ELEMENT_TARGET,
elements: [
{
type: ElementType.CHICKEN,
count: 45,
},
],
},
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,
],
generateLats: [
{ index: 11, type: [0], cus: [] },
{ index: 15, type: [0], cus: [] },
],
// connectedLats: [[0, 18], [1, 19], [2, 20]],
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, 15, 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, 20, 0, 0, 0, 20, 0, 0,
0, 20, 10, 20, 0, 20, 10, 20, 0,
20, 10, 20, 10, 20, 10, 20, 10, 20,
20, 10, 20, 20, 10, 20, 20, 10, 20,
0, 20, 10, 20, 10, 20, 10, 20, 0,
0, 0, 20, 10, 20, 10, 20, 0, 0,
0, 0, 0, 20, 10, 20, 0, 0, 0,
0, 0, 0, 0, 20, 0, 0, 0, 0,
],
// recycles: [70, 71, 72, 73]
},
},
]
\ No newline at end of file
import { ChapterData } from "../interface/ChapterData";
import { PassType } from "../enum/PassType";
import { ElementType } from "../enum/ElementType";
//426-450
export const Chapters17: ChapterData[] = [
//426
{
baseElementTypes: [0, 1, 2, 3],
bubbleProbability: 0,
stepCount: 25,
passTarget: {
type: PassType.ELEMENT_TARGET,
elements: [
{
type: ElementType.CHICKEN,
count: 45,
},
],
},
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,
],
generateLats: [
{ index: 11, type: [0], cus: [] },
{ index: 15, type: [0], cus: [] },
],
// connectedLats: [[0, 18], [1, 19], [2, 20]],
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, 20, 0, 0, 0, 20, 0, 0,
0, 20, 10, 20, 0, 20, 10, 20, 0,
20, 10, 20, 10, 20, 10, 20, 10, 20,
20, 10, 20, 20, 10, 20, 20, 10, 20,
0, 20, 10, 20, 10, 20, 10, 20, 0,
0, 0, 20, 10, 20, 10, 20, 0, 0,
0, 0, 0, 20, 10, 20, 0, 0, 0,
0, 0, 0, 0, 20, 0, 0, 0, 0,
],
// recycles: [70, 71, 72, 73]
},
}
]
\ No newline at end of file
...@@ -667,4 +667,5 @@ export class Element extends eui.Component { ...@@ -667,4 +667,5 @@ export class Element extends eui.Component {
return ele return ele
} }
get candy() { return this._candy } get candy() { return this._candy }
resetView(){}
} }
\ No newline at end of file
import { ElementType } from "../enum/ElementType";
import { loadSvga } from "../../loadSvga";
import getResPath from "../../../libs/new_tc/getResPath";
import { createMonsterStatusAni } from "../../effect/createMonsterStatusAni";
const frames = [
[1, 120],
[121, 360],
[361, 600],
[601, 960],
];
export class HoneyPot extends eui.Component {
async nextStatus() {
this._statusNum++;
if (this._statusNum > 4) {
this._statusNum = 4;
this.removeEvents();
}
//播放动画,动画时间要短200ms以内
if (this._statusNum <= 3) {
createMonsterStatusAni(this.x, this.y, this.parent);
this.changeSource();
}
}
hide(){
this._mv.scaleX=this._mv.scaleY=0;
}
resetStatus() {
this.addEvents();
this._statusNum = 0;
this._mv.gotoAndPlay(1);
egret.Tween.get(this._mv).to({scaleY:1,scaleX:1},500,egret.Ease.backOut).call(()=>{
this.changeSource();
})
}
get active(): boolean {
return this._statusNum == 4;
}
/**
* 状态变化 0,1,2,3
*/
private _statusNum: number;
res: ElementType;
_mv;
getRes() {
return `ele${this.res}_${this._statusNum}_png`;
}
type;
constructor(res: ElementType, type: number, n: number = 0) {
super();
this.res = res;
this.type = type;
this._statusNum = n;
this.initSvga();
}
async initSvga() {
const mv: any = await loadSvga(getResPath() + 'resource/assets/svgas/monster' + this.type + '.svga');
this._mv = mv;
this.addChild(mv);
mv.anchorOffsetX = 87 / 2;
mv.anchorOffsetY = 92 / 2;
this.addEvents();
this.changeSource();
}
private addEvents() {
this._mv.addEventListener(egret.Event.ENTER_FRAME, this.onEnterFrame, this);
}
onEnterFrame() {
if (this._statusNum <= 3 && this._mv.currentFrame == frames[this._statusNum][1]) {
this._mv.gotoAndPlay(frames[this._statusNum][0]);
}
}
removeEvents() {
this._mv.removeEventListener(egret.Event.ENTER_FRAME, this.onEnterFrame, this);
}
changeSource() {
if (this._mv)
this._mv.gotoAndPlay(frames[this._statusNum][0]);
}
}
\ No newline at end of file
import { Element } from "./Element";
export default class HoneyPotElement extends Element {
resetView(){
}
}
\ No newline at end of file
...@@ -65,4 +65,5 @@ export enum ElementConfigType { ...@@ -65,4 +65,5 @@ export enum ElementConfigType {
* 汽鼓鱼 * 汽鼓鱼
*/ */
FISH = 15, FISH = 15,
HONEY_POT = 16,
} }
\ No newline at end of file
...@@ -2137,6 +2137,131 @@ ...@@ -2137,6 +2137,131 @@
"levelNum": 425, "levelNum": 425,
"maxScore": 47440, "maxScore": 47440,
"stars": 1 "stars": 1
},
{
"levelNum": 426,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 427,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 428,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 429,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 430,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 431,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 432,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 433,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 434,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 435,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 436,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 437,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 438,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 439,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 440,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 441,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 442,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 443,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 444,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 445,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 446,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 447,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 448,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 449,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 450,
"maxScore": 47440,
"stars": 1
} }
], ],
......
...@@ -2137,6 +2137,131 @@ ...@@ -2137,6 +2137,131 @@
"levelNum": 425, "levelNum": 425,
"maxScore": 47440, "maxScore": 47440,
"stars": 1 "stars": 1
},
{
"levelNum": 426,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 427,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 428,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 429,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 430,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 431,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 432,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 433,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 434,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 435,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 436,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 437,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 438,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 439,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 440,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 441,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 442,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 443,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 444,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 445,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 446,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 447,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 448,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 449,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 450,
"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