Commit 5aae42a8 authored by wildfirecode's avatar wildfirecode

1

parent 888a7723
......@@ -124,7 +124,7 @@
}
</script>
<script>
// window['fresp']
window['fresp']=10;
window['signconfigs'] = [
{nums: '0.10元', type: 'quan10'},
{nums: '*1', type: 'hammer'},
......@@ -136,8 +136,8 @@
];
// localStorage.clear();
window['imgver'] = '11112';
window['total_level'] = 10 + 10 * 37; /// TODO 14 不能变 总数必须大于总的关卡数
window['last_level'] = 375;//必须大于等于total_level ///TODO 标记最后一关,等于最后一关即可
window['total_level'] = 10 + 10 * 39; /// TODO 14 不能变 总数必须大于总的关卡数
window['last_level'] = 400;//必须大于等于total_level ///TODO 标记最后一关,等于最后一关即可
var sharePic = document.getElementById('pic');
......
......@@ -276,9 +276,15 @@ export default class MainBase extends eui.UILayer {
for (var i = 0; i < 21; i++) {
RES.getResAsync("ele" + i + "_png")
}
for (var i = 22; i <= 27; i++) {
for (var i = 22; i <= 32; i++) {
RES.getResAsync("ele" + i + "_png")
}
for (var i = 28; i <= 32; i++) {
RES.getResAsync(`ele${i}_0_png`);
RES.getResAsync(`ele${i}_1_png`);
RES.getResAsync(`ele${i}_2_png`);
RES.getResAsync(`ele${i}_3_png`);
}
for (var i = 1; i <= 27; i++) {
RES.getResAsync("bonusFra" + i + "_png")
}
......
......@@ -61,7 +61,7 @@ import { Ice } from '../something/class/Ice';
import { Lattice } from '../something/class/Lattice';
import { EffectType } from '../something/enum/EffectType';
import { ElementConfigType } from '../something/enum/ElementConfigType';
import { CandyBaseElementType, codeMsgs, convertBaseElementType, ElementType, FiveBaseElementTypes, submitTran, fireworksTypeMap } from '../something/enum/ElementType';
import { CandyBaseElementType, codeMsgs, convertBaseElementType, elementMonsterResMap, ElementType, fireworksTypeMap, FiveBaseElementTypes, MonsterBaseElementType, submitTran, monsterElementMap } from '../something/enum/ElementType';
import { isIce, isSpecialLattice } from '../something/enum/LatticeType';
import { PassType } from '../something/enum/PassType';
import { RecoverName } from '../something/enum/RecoverName';
......@@ -93,11 +93,6 @@ import { createData } from '../startScene/StartScene';
import Utils from '../Utils';
import { DataManager } from './../../libs/tw/manager/DataManager';
import { NetManager } from './../../libs/tw/manager/NetManager';
import { createCandyDis0Ani } from '../something/anis/candy/createCandyDis0Ani';
import { createCandyDis1Ani } from '../something/anis/candy/createCandyDis1Ani';
import { createCandyDis2Ani } from '../something/anis/candy/createCandyDis2Ani';
import { createCandyDis3Ani } from '../something/anis/candy/createCandyDis3Ani';
import { createCandyDis4Ani } from '../something/anis/candy/createCandyDis4Ani';
import jellyMonsterAI from './jellyMonsterAI';
const aniClass = {
......@@ -680,6 +675,7 @@ export default class MainScene extends Scene {
//基础元素,枷锁,气泡,灰色毛球,褐色毛球,黑色毛球 && 石门锁,有条件的锁
case ElementConfigType.BASE:
case ElementConfigType.CANDY:
case ElementConfigType.MONSTER:
case ElementConfigType.LOCK:
case ElementConfigType.BUBBLE:
case ElementConfigType.HAIRBALLGREY:
......@@ -810,10 +806,12 @@ export default class MainScene extends Scene {
// ele.resetType(baseType);//先重置ele类型
// ele.resetToCandyView(resultBaseElement);//切换成糖果视图
}
}
else if (isMonsterEle) { //独眼怪物元素
if (baseElement != MonsterBaseElementType.RANDOM) {//如果不是随机怪物
ele.resetType(monsterElementMap[baseElement]);//先重置ele类型
}
ele.resetToMonsterView(elementMonsterResMap[ele.type]);
}
else {
//解析elements[i];
......
import { ChapterData } from "../interface/ChapterData";
import { PassType } from "../enum/PassType";
import { ElementType } from "../enum/ElementType";
/**
* 376到390关数据
*/
export const Chapters15: ChapterData[] = [
//376
{
baseElementTypes: [0, 1, 2, 3, 4],
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, 14, 14, 14, 0, 14, 14, 0, 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, 5, 4, 3, 0, 2, 1, 0, 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";
/**
* 391到400关数据
*/
export const Chapters16: ChapterData[] = [
//376
{
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: [
1, 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: [
14, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 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, 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
......@@ -16,6 +16,8 @@ import { Chapters9 } from "./Chapter9";
import { PassTargetData } from "../interface/PassTargetData";
import { PassType } from "../enum/PassType";
import { submitTran } from "../enum/ElementType";
import { Chapters15 } from "./Chapter15";
import { Chapters16 } from "./Chapter16";
//所有的关卡
const chapters: ChapterData[] = [].concat(
......@@ -33,6 +35,8 @@ const chapters: ChapterData[] = [].concat(
Chapters12,
Chapters13,
Chapters14,
Chapters15,
Chapters16,
)
// console.log(chapters)
chapters.forEach((chapter,index) => {
......
import getResPath from "../../../libs/new_tc/getResPath";
import { loadSvga, initSvga, getFireworksVideoItem } from "../../loadSvga";
import { getFireworksVideoItem, initSvga, loadSvga } from "../../loadSvga";
import { createCandyDie0Ani } from "../anis/candy/createCandyDie0Ani";
import { createCandyDie1Ani } from "../anis/candy/createCandyDie1Ani";
import { createCandyDie2Ani } from "../anis/candy/createCandyDie2Ani";
......@@ -26,8 +26,8 @@ import { Candy } from "./Candy";
import { ChickenEgg } from "./ChickenEgg";
import { FestivalEle } from "./FestivalEle";
import { FestivalEle2 } from "./FestivalEle2";
import { Monster } from "./Monster";
import { State } from "./State";
import wait from "../../../libs/new_tc/wait";
/**
* 考虑到底继承白鹭的啥Component还是Container
* 坐标原点需要坐落在格子的中心点
......@@ -135,6 +135,13 @@ export class Element extends eui.Component {
});
}
resetToMonsterView(res: ElementType) {
this.changeSource("ele" + res + "_png");
this.monster = new Monster(res);
this.addChild(this.monster);
this.showImage.alpha = 0;
}
private _candy: Candy;
resetToCandyView(baseElement: CandyBaseElementType) {
const res = transElementRes(baseElement);
......@@ -309,6 +316,7 @@ export class Element extends eui.Component {
column: number
//鸡蛋
chickenEgg: ChickenEgg;
monster: Monster;//独眼怪
//节日红包大
festivalEle: FestivalEle | FestivalEle2;
......@@ -408,6 +416,10 @@ export class Element extends eui.Component {
Pool.recover(RecoverName.CHICKEN_EGG, this.chickenEgg);
this.chickenEgg = null;
}
if (this.monster) {
this.removeChild(this.monster);
this.monster = null;
}
//如果类型是节日红包大
if (type == ElementType.FESTIVALELE_BIG) {
this.festivalEle = this.festivalEle || Pool.takeOut(RecoverName.FESTIVAL_ELE)
......
import { ElementType } from "../enum/ElementType";
//四种状态的图片,剩三种了
const images = {
2: "ele" + ElementType.CHICKEN_EGG + "_png",
// 2: "eggStatus2_png",
1: "eggStatus1_png",
0: "eggStatus0_png"
}
/**
* 鸡蛋的状态
*
*/
export class Monster extends eui.Component {
private showImage: eui.Image;
/**
* 是否孵小鸡
*/
isActive: boolean;
/**
* 鸡蛋状态变化 2 1 0 再往后,可孵鸡
*/
private _statusNum: number;
get statusNum() {
return this._statusNum
}
set statusNum(value: number) {
if (value >= 0) {
this._statusNum = value;
//修改图片
if (this.showImage.source != images[this._statusNum]) {
this.changeSource();
}
} else {
this._statusNum = 0;
this.isActive = true;
}
}
res: ElementType;
getRes() {
return `ele${this.res}_${this._statusNum}_png`;
}
constructor(res: ElementType, n: number = 3) {
super();
this.touchEnabled=this.touchChildren=false;
this.res = res;
this.showImage = new eui.Image();
this.addChild(this.showImage)
this.isActive = false;
this._statusNum = n;
this.changeSource();
}
changeSource() {
const source = this.getRes();
var texture: egret.Texture = RES.getRes(source);
this.showImage.texture = texture;
this.showImage.anchorOffsetX = texture.textureWidth / 2;
this.showImage.anchorOffsetY = texture.textureHeight / 2;
}
// shakeAni() {
// this.showImage.rotation = 0;
// egret.Tween.get(this.showImage)
// .to({ rotation: 10 }, 80)
// .to({ rotation: -8 }, 160)
// .to({ rotation: 5 }, 160)
// .to({ rotation: 0 }, 50)
// }
}
\ No newline at end of file
......@@ -38,7 +38,7 @@ export enum ElementType {
MONSTER_JELLY1,
JELLY_MONSTER,
FIREWORKS_RABBIT,//烟花目标元素,下同
FIREWORKS_CHICKEN,
FIREWORKS_CATTLE,
......@@ -54,6 +54,14 @@ export enum ElementType {
MONSTER_PIG,
}
export const isMonsterEle = (t: ElementType) => {
return t == ElementType.MONSTER_RABBIT ||
t == ElementType.MONSTER_CHICKEN ||
t == ElementType.MONSTER_CATTLE ||
t == ElementType.MONSTER_LION ||
t == ElementType.MONSTER_PIG
}
export enum CandyBaseElementType {
RANDOM = 0,//随机
RABBIT = 106,//兔子
......@@ -61,7 +69,7 @@ export enum CandyBaseElementType {
CATTLE = 108,//牛
LION = 109,//狮子
PIG = 110,//猪
}
export enum MonsterBaseElementType {
......@@ -71,39 +79,39 @@ export enum MonsterBaseElementType {
CATTLE = 3,//牛
LION = 4,//狮子
PIG = 5,//猪
}
export const fireworksTypeMap:any = {}
fireworksTypeMap[ElementType.RABBIT]=ElementType.FIREWORKS_RABBIT;
fireworksTypeMap[ElementType.CHICKEN]=ElementType.FIREWORKS_CHICKEN;
fireworksTypeMap[ElementType.CATTLE]=ElementType.FIREWORKS_CATTLE;
fireworksTypeMap[ElementType.LION]=ElementType.FIREWORKS_LION;
fireworksTypeMap[ElementType.PIG]=ElementType.FIREWORKS_PIG;
export const fireworksTypeMap: any = {}
fireworksTypeMap[ElementType.RABBIT] = ElementType.FIREWORKS_RABBIT;
fireworksTypeMap[ElementType.CHICKEN] = ElementType.FIREWORKS_CHICKEN;
fireworksTypeMap[ElementType.CATTLE] = ElementType.FIREWORKS_CATTLE;
fireworksTypeMap[ElementType.LION] = ElementType.FIREWORKS_LION;
fireworksTypeMap[ElementType.PIG] = ElementType.FIREWORKS_PIG;
export const convertCandyBaseElementType = (t:CandyBaseElementType) => {
if(t==CandyBaseElementType.RABBIT)
export const convertCandyBaseElementType = (t: CandyBaseElementType) => {
if (t == CandyBaseElementType.RABBIT)
return ElementType.RABBIT;
if(t==CandyBaseElementType.CHICKEN)
if (t == CandyBaseElementType.CHICKEN)
return ElementType.CHICKEN;
if(t==CandyBaseElementType.CATTLE)
if (t == CandyBaseElementType.CATTLE)
return ElementType.CATTLE;
if(t==CandyBaseElementType.LION)
if (t == CandyBaseElementType.LION)
return ElementType.LION;
if(t==CandyBaseElementType.PIG)
if (t == CandyBaseElementType.PIG)
return ElementType.PIG;
return null;
}
export const convertBaseElementType = (t:ElementType) => {
if(t==ElementType.RABBIT)
export const convertBaseElementType = (t: ElementType) => {
if (t == ElementType.RABBIT)
return CandyBaseElementType.RABBIT;
if(t==ElementType.CHICKEN)
if (t == ElementType.CHICKEN)
return CandyBaseElementType.CHICKEN;
if(t==ElementType.CATTLE)
if (t == ElementType.CATTLE)
return CandyBaseElementType.CATTLE;
if(t==ElementType.LION)
if (t == ElementType.LION)
return CandyBaseElementType.LION;
if(t==ElementType.PIG)
if (t == ElementType.PIG)
return CandyBaseElementType.PIG;
return null;
}
......@@ -122,6 +130,28 @@ export const randonCandyBaseElement = () => {
return CandyBaseElementType.PIG;
return null;
}
// export const monsterElementResMap = {
// "28": ElementType.RABBIT,
// "29": ElementType.CHICKEN,
// "30": ElementType.CATTLE,
// "31": ElementType.LION,
// "32": ElementType.PIG,
// }
export const monsterElementMap = {
"1": ElementType.RABBIT,
"2": ElementType.CHICKEN,
"3": ElementType.CATTLE,
"4": ElementType.LION,
"5": ElementType.PIG,
}
export const elementMonsterResMap = {
"0": ElementType.MONSTER_RABBIT,
"1": ElementType.MONSTER_CHICKEN,
"2": ElementType.MONSTER_CATTLE,
"3": ElementType.MONSTER_LION,
"4": ElementType.MONSTER_PIG,
}
export const transElementRes = (t: CandyBaseElementType) => {
switch (t) {
......@@ -141,19 +171,6 @@ export const transElementRes = (t: CandyBaseElementType) => {
case CandyBaseElementType.PIG:
return ElementType.CANDY_PIG
// case CandyBaseElementType.RANDOM:
// const order = Math.ceil(Math.random() * 5);
// if (order == 1)
// return ElementType.CANDY_RABBIT;
// if (order == 2)
// return ElementType.CANDY_CHICKEN;
// if (order == 3)
// return ElementType.CANDY_CATTLE;
// if (order == 4)
// return ElementType.CANDY_LION;
// if (order == 5)
// return ElementType.CANDY_PIG;
default:
break;
}
......
......@@ -37,6 +37,7 @@ export enum RecoverName {
//元素身上的鸡蛋
CHICKEN_EGG = "ChickenEgg",
MONSTER = "MONSTER",
//元素上的大红包
FESTIVAL_ELE = "FestivalEle",
......
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