Commit fb962393 authored by wildfirecode's avatar wildfirecode

1

parents 0907319a 5dcef6ac
......@@ -127,8 +127,8 @@
// localStorage.clear();
window['imgver'] = '11112';
//top 8 ,repeat 22 , bottom 3
window['total_level'] = 8 + 3 + 22 * 21;
window['last_level'] = 450;
window['total_level'] = 8 + 3 + 22 * 22;
window['last_level'] = 475;
var sharePic = document.getElementById('pic');
......
......@@ -294,7 +294,8 @@ export default class MainBase extends eui.UILayer {
RES.getResAsync(`ele${i}_2_png`);
RES.getResAsync(`ele${i}_3_png`);
}
RES.getResAsync("ele34_png")
RES.getResAsync("ele34_png");
RES.getResAsync("ele36_png");
for (var i = 1; i <= 27; i++) {
RES.getResAsync("bonusFra" + i + "_png")
}
......@@ -534,7 +535,7 @@ export default class MainBase extends eui.UILayer {
this.hcRedBoobBaseInfo(),
]);
//获取分享加体力的shareCode,不影响初始化场景,不进await
NetManager.ins.getUserShareCode(()=>{})
NetManager.ins.getUserShareCode(() => { })
MapScene.adData = DataManager.ins.getData('hc_advert');
......
......@@ -19,5 +19,6 @@
<e:Image id="icon25" width="60" height="60" x="0" y="2" source="startpanel_ele25_png"/>
<e:Image id="icon26" width="60" height="60" x="0" y="2" source="startpanel_ele26_png"/>
<e:Image id="icon34" width="60" height="60" x="0" y="2" source="startpanel_ele34_png"/>
<e:Image id="icon36" width="60" height="60" x="0" y="2" source="startpanel_ele36_png"/>
<e:BitmapLabel id="txt" text="X0" font="nums2_fnt" scaleX="0.4" scaleY="0.4" y="46" horizontalCenter="0"/>
</e:Skin>
\ No newline at end of file
......@@ -62,7 +62,7 @@ import { Lattice } from '../something/class/Lattice';
import { EffectType } from '../something/enum/EffectType';
import { ElementConfigType } from '../something/enum/ElementConfigType';
import { CandyBaseElementType, codeMsgs, convertBaseElementType, elementMonsterResMap, ElementType, fireworksTypeMap, FiveBaseElementTypes, MonsterBaseElementType, monsterElementMap, submitTran } from '../something/enum/ElementType';
import { isIce, isSpecialLattice } from '../something/enum/LatticeType';
import { isIce, isSpecialLattice, isSand, isBlock } from '../something/enum/LatticeType';
import { PassType } from '../something/enum/PassType';
import { RecoverName } from '../something/enum/RecoverName';
import { StateType } from '../something/enum/StateType';
......@@ -98,10 +98,14 @@ import doHoneyPotAI from './doHoneyPotAI';
import doMonsterAI from './doMonsterAI';
import jellyMonsterAI from './jellyMonsterAI';
import { createHoneyDisAni } from '../effect/createHoneyDisAni';
import Sand, { getSandDisplayBlock } from '../something/Sand';
import { SandAni } from '../something/anis/SandAni';
import doSandAI from './doSandAI';
const aniClass = {
"BoomAni": BoomAni,
"IceAni": IceAni,
"SandAni": SandAni,
"RockAni": RockAni,
"HorizontalAni": HorizontalAni,
"VerticalAni": VerticalAni,
......@@ -159,7 +163,7 @@ export default class MainScene extends Scene {
return 'Main2'
}
gm=()=>{
gm = () => {
var json = {};
//分数
json[1] = 9999999;
......@@ -299,7 +303,7 @@ export default class MainScene extends Scene {
async start(data) {
super.start();
window['gm'] =this.gm;
window['gm'] = this.gm;
//第几关
this.chapter = (data && data.chapter) ? data.chapter : 1;
// this.chapter = 24;
......@@ -619,15 +623,20 @@ export default class MainScene extends Scene {
}
latticeDisplay = ice;
this.lattices[i].ice = ice;
} else {
} else if (isSand(latticesD[i])) {
latticeDisplay = getSandDisplayBlock();
this.lattices[i].sand = latticeDisplay as Sand;
} else if (isBlock(latticesD[i])) {
latticeDisplay = genBlockDisplay(latticesD[i]);
this.lattices[i].block = latticeDisplay as BaseBlock;
}
if (latticeDisplay) {
this.map.addChild(latticeDisplay);
latticeDisplay.x = p[0];
latticeDisplay.y = p[1];
}
}
}
//生成口数据
var genLatDatas = this.chapterData.map.generateLats || [];
//设置生成口,
......@@ -2016,6 +2025,7 @@ export default class MainScene extends Scene {
this.eliminate();
return
}
await doSandAI(this);
const doHoneyPotAIResult = await doHoneyPotAI(this);
if (doHoneyPotAIResult.length > 0) {//如果有激活的罐子被消除,那么表示可以自动消除,则不需要进行下一步
doHoneyPotAIResult.forEach((index) => {
......@@ -2431,7 +2441,7 @@ export default class MainScene extends Scene {
}
else if (ele.hasState(StateType.HONEY)) {
ele.setState(StateType.HONEY, false);
createHoneyDisAni(ele.x,ele.y,this)
createHoneyDisAni(ele.x, ele.y, this)
this.goElementTarget(ElementType.HONEY, [ele.x, ele.y]);
}
else if (ele.monster) {//如果是独眼怪,
......@@ -3069,8 +3079,13 @@ export default class MainScene extends Scene {
const p = Tool.getPositionByIndex(lat.index);
//动画
this.playAni(RecoverName.ICE_ANI, p);
} else if (lat.sand) {
lat.sand && lat.sand.parent && lat.sand.parent.removeChild(lat.sand);
this.goElementTarget(ElementType.SAND, [lat.sand.x, lat.sand.y]);
lat.sand = null;
const p = Tool.getPositionByIndex(lat.index);
this.playAni(RecoverName.SAND_ANI, p);
}
}
goElementTarget(type: ElementType, fromP: number[]) {
......
import { ElementType } from "../something/enum/ElementType";
import MainScene from "./MainScene";
import { Tool } from "../something/Tool";
import { Element } from "../something/class/Element";
import { MonsterShootAni } from "../something/anis/MonsterShootAni";
import { Pool } from "../something/Pool";
import { RecoverName } from "../something/enum/RecoverName";
import wait from "../../libs/new_tc/wait";
import { EffectType } from "../something/enum/EffectType";
import { EggBrokenAni } from "../something/anis/EggBrokenAni";
import { StateType } from "../something/enum/StateType";
import { createHoneyBombAni } from "../effect/createHoneyBombAni";
import HoneyPotElement from "../something/class/HoneyPotElement";
import { HoneyPotShootAni } from "../something/anis/HoneyPotShootAni";
import { createHoneyBubbleAni } from "../effect/createHoneyBubbleAni";
import { HoneyPotShootAni } from "../something/anis/HoneyPotShootAni";
import { Element } from "../something/class/Element";
import HoneyPotElement from "../something/class/HoneyPotElement";
import { ElementType } from "../something/enum/ElementType";
import { RecoverName } from "../something/enum/RecoverName";
import { StateType } from "../something/enum/StateType";
import { Pool } from "../something/Pool";
import { Tool } from "../something/Tool";
import MainScene from "./MainScene";
/**
* 罐子爆炸
*/
......@@ -26,7 +23,7 @@ export default async (thisObj: MainScene) => {
lattice.element.canElimite = true;
}
}
console.log('激活的罐子', activeElementIndexs);
// console.log('激活的罐子', activeElementIndexs);
//遍历所有基础元素
const baseElements: Element[] = [];
......
import MainScene from "./MainScene";
import { Lattice } from "../something/class/Lattice";
import { Tool } from "../something/Tool";
/**
* 沙子移动
*/
export default async (thisObj: MainScene) => {
//暂时不考虑这个问题:是否应该避免石头下的沙子移动,因为被石头盖住了看不到
// const sand = thisObj.lattices.filter(lattice => {
// // return lattice.sand && (!lattice.element || lattice.element.type != ElementType.ROCK);
// });
//找出所有的沙子
const sandLattices = thisObj.lattices.filter(lattice => {
return lattice.sand;
});
console.log(sandLattices);
//map promise
//先判断是否能跳动,目前都能跳
for (let i = 0; i < sandLattices.length; i++) {
const sandLattice = sandLattices[i];
const indexEnd = judgeActionIndex(sandLattice.index, thisObj.lattices)
if (indexEnd) {//判断是否有地方可以
//先修改数据,再进行动画播放
const sand = sandLattice.sand;
sandLattice.sand=null;
const latticeEnd = thisObj.lattices[indexEnd];
latticeEnd.sand = sand;
const p = Tool.getPositionByIndex(indexEnd);
egret.Tween.get(sand).to({x:p[0],y:p[1]},200);
// sand.x = p[0];
// sand.y = p[1];
}
}
}
//找到毛球移动的目标位置
const judgeActionIndex = (index: number, lattices: Lattice[]): number => {
//四个方向尽量随机
var arr = [index - Tool.colNum, index + Tool.colNum];
var rc = Tool.indexToRc(index);
var col = rc[1];
//列数大于0才可能有左边格子
if (col > 0) arr.push(index - 1);
//列数不为最右边
if (col < Tool.colNum - 1) arr.push(index + 1);
while (arr.length) {
var rand = Math.floor(Math.random() * arr.length);
var i = arr.splice(rand, 1)[0];
if (Tool.judgeBaseEle(lattices[i]) &&
!lattices[i].element.hasAnyState() &&
!lattices[i].element.candy &&
!lattices[i].sand &&
!lattices[i].element.monster
) {
return i
}
}
return null
}
\ No newline at end of file
import centerAnchor from "./block/centerAnchor";
export default class Sand extends egret.Sprite {
constructor() {
super();
const sand = new egret.Bitmap(RES.getRes("ele36_png"));
this.addChild(sand);
centerAnchor(sand);
}
}
export const getSandDisplayBlock = () => {
return new Sand();
}
\ No newline at end of file
import { Ani } from "../class/Ani";
import { ImageAni } from "../class/ImageAni";
import { ElementType } from "../enum/ElementType";
//原点已是中心
export class SandAni extends Ani {
/**
* 图片
*/
showImage: ImageAni;
constructor() {
super();
this.aniName = "SandAni";
this.showImage = new ImageAni(["ele" + ElementType.ICE + "_png", "ice2_png", "ice3_png", "ice4_png", "ice5_png", "ice6_png"]);
this.addChild(this.showImage)
}
play() {
//重置图片
this.showImage.currentFrame = 0;
this.showImage.source = this.showImage.sourceAll[0];
this.showImage.play(() => {
this.recover();
})
}
}
\ No newline at end of file
import { ChapterData } from "../interface/ChapterData";
import { PassType } from "../enum/PassType";
import { ElementType } from "../enum/ElementType";
//451-471
export const Chapters18: ChapterData[] = [
{
baseElementTypes: [0, 1, 2, 3],
bubbleProbability: 0,
stepCount: 100,
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, 2, 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
This diff is collapsed.
......@@ -19,6 +19,7 @@ import { submitTran } from "../enum/ElementType";
import { Chapters15 } from "./Chapter15";
import { Chapters16 } from "./Chapter16";
import { Chapters17 } from "./Chapter17";
import { Chapters18 } from "./Chapter18";
//所有的关卡
const chapters: ChapterData[] = [].concat(
......@@ -39,6 +40,7 @@ const chapters: ChapterData[] = [].concat(
Chapters15,
Chapters16,
Chapters17,
Chapters18,
)
// console.log(chapters)
chapters.forEach((chapter,index) => {
......
import { ChapterData } from "../interface/ChapterData";
import { PassType } from "../enum/PassType";
import { ElementType } from "../enum/ElementType";
//426-450
export const Chapters17: ChapterData[] = [
//426
//451-471
export const Chapters18: ChapterData[] = [
{
baseElementTypes: [0, 1, 2, 3],
bubbleProbability: 0,
......@@ -20,7 +20,7 @@ export const Chapters17: ChapterData[] = [
starScores: [1000, 5000, 10000],
map: {
lattices: [
1, 0, 0, 0, 0, 0, 0, 0, 0,
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,
......@@ -36,11 +36,11 @@ export const Chapters17: ChapterData[] = [
],
// connectedLats: [[0, 18], [1, 19], [2, 20]],
elements: [
16, 0, 0, 0, 0, 0, 0, 0, 0,
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, 16, 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,
......@@ -60,4 +60,6 @@ export const Chapters17: ChapterData[] = [
// recycles: [70, 71, 72, 73]
},
}
]
\ No newline at end of file
......@@ -2,6 +2,7 @@ import BaseBlock from "../block/BaseBlock";
import { Tool } from "../Tool";
import { Element } from "./Element";
import { Ice } from "./Ice";
import Sand from "../Sand";
/**
* 位置信息直接用一个二维数组记录,然后用row,col取
......@@ -18,6 +19,7 @@ export class Lattice {
* 石门,冰石门,深冰石门
*/
block: BaseBlock;
sand: Sand;
/**
* 上面的元素(null,消除元素,石头,冰激凌等),
*/
......
......@@ -66,4 +66,5 @@ export enum ElementConfigType {
*/
FISH = 15,
HONEY_POT = 16,
FLOWER = 17,
}
\ No newline at end of file
......@@ -55,8 +55,9 @@ export enum ElementType {
FISH,//气鼓鱼
HONEY,// 蜂蜜
HONEY_POT//蜂蜜罐
// HONEY_POT//蜂蜜罐
HONEY_POT,//蜂蜜罐
SAND,
FLOWER,
}
export const isMonsterEle = (t: ElementType) => {
......
......@@ -9,7 +9,7 @@ export enum LatticeType {
BlOCK = 4, //会持续存在,无法像冰块一样被消除,但是上方可以存在元素。只是展示的时候
BLOCK_AND_ICE = 5,
BLOCK_AND_DARK_ICE = 6,
// BLOCK_AND_DARK_ICE = 7,
SAND = 7,
}
......@@ -27,3 +27,11 @@ export const isSpecialLattice = (type: LatticeType) => {
export const isIce = (type: LatticeType) => {
return type == LatticeType.ICE || type == LatticeType.DARK_ICE
}
export const isBlock = (type: LatticeType) => {
return type == LatticeType.BlOCK || type == LatticeType.BLOCK_AND_ICE || type == LatticeType.BLOCK_AND_DARK_ICE
}
export const isSand = (type: LatticeType) => {
return type == LatticeType.SAND
}
\ No newline at end of file
......@@ -47,6 +47,7 @@ export enum RecoverName {
//所有继承ani的,能单独播放的,不带回调的
ROCK_ANI = "RockAni",
ICE_ANI = "IceAni",
SAND_ANI = "SandAni",
BOOM_ANI = "BoomAni",
CANDY_DIS_ANI = "CandyDisAni",
ELEDIS_ANI = "EleDisAni",
......
......@@ -2247,6 +2247,146 @@
"levelNum": 447,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 448,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 449,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 450,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 451,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 452,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 453,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 454,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 455,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 456,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 457,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 458,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 459,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 460,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 461,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 462,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 463,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 464,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 465,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 466,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 467,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 468,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 469,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 470,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 471,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 472,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 473,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 474,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 475,
"maxScore": 47440,
"stars": 1
}
],
......
......@@ -2262,6 +2262,131 @@
"levelNum": 450,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 451,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 452,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 453,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 454,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 455,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 456,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 457,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 458,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 459,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 460,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 461,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 462,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 463,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 464,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 465,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 466,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 467,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 468,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 469,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 470,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 471,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 472,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 473,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 474,
"maxScore": 47440,
"stars": 1
},
{
"levelNum": 475,
"maxScore": 47440,
"stars": 1
}
],
......
......@@ -22,7 +22,7 @@
"chalk": "^2.3.0",
"co": "^4.6.0",
"cross-spawn": "^6.0.5",
"duiba-game-build": "git+ssh://git@gitlab2.dui88.com:wanghongyuan/dbgame-build.git",
"duiba-game-build": "git+http://gitlab2.dui88.com/wanghongyuan/dbgame-build.git",
"inquirer": "^6.2.0",
"moment": "^2.22.2",
"progress": "^2.0.0"
......
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