Commit 94fd84da authored by wildfirecode's avatar wildfirecode

1

parent fdf0915d
......@@ -202,7 +202,8 @@
"useBgImage": false,
"useBgColor": true,
"backgroundColor": "#c1c1c1",
"backgroundAlpha": 100
"backgroundAlpha": 100,
"bindingDataTestObj": []
},
"16d5c2563ca": {
"bindingDataTestObj": []
......
......@@ -294,6 +294,7 @@ export default class MainBase extends eui.UILayer {
RES.getResAsync(`ele${i}_2_png`);
RES.getResAsync(`ele${i}_3_png`);
}
RES.getResAsync("ele34_png")
for (var i = 1; i <= 27; i++) {
RES.getResAsync("bonusFra" + i + "_png")
}
......@@ -387,6 +388,7 @@ export default class MainBase extends eui.UILayer {
"guidePropHammer",
"guidePropBoom",
"道具",
"honey",
"recordbtn",
"lionMsgBg",
"guideBox",
......
......@@ -18,6 +18,6 @@
<e:Image id="icon24" width="60" height="60" y="2" source="startpanel_ele24_png"/>
<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_ele26_png"/>
<e:Image id="icon34" width="60" height="60" x="0" y="2" source="startpanel_ele34_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
export default () => {
try {
window['SAUP'].sendLogData("click", {
tag: '',   // 必传;如果需要传拓展的信息,在tag中加一个sa-data,将需要传的内容用json格式传到sa-data
sapmodid: "请写入产品提供的 modid",    // 必传;区块编码
eleid: "请写入产品提供的 eleid"        // 必传;坑位编码
});
//这里的this必须传dom节点
} catch (e) { }
}
......@@ -2402,6 +2402,10 @@ export default class MainScene extends Scene {
if (!ele) {
//以防万一还是判断一次
}
else if (ele.hasState(StateType.HONEY)) {
ele.setState(StateType.HONEY, false);
this.goElementTarget(ElementType.HONEY, [ele.x, ele.y]);
}
//下面带状态的要优先判断
//有枷锁的
else if (ele.hasState(StateType.LOCK)) {
......@@ -2485,6 +2489,10 @@ export default class MainScene extends Scene {
this.playAni(RecoverName.ELEDIS_ANI, p)
//这里面会去算个数
this.recoverEle(index);
// if(ele.hasState(StateType.HONEY)) {
// ele.setState(StateType.HONEY, false);
// this.goElementTarget(ElementType.HONEY, [ele.x, ele.y]);
// }
}
}
//石头
......
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";
/**
* 罐子爆炸
*/
......@@ -8,11 +17,67 @@ export default async (thisObj: MainScene) => {
const activeElementIndexs: number[] = [];
for (var i = 0; i < thisObj.lattices.length; i++) {
const lattice = thisObj.lattices[i]
if (lattice && lattice.element && lattice.element.type==ElementType.HONEY_POT && lattice.element.isActive) {
if (lattice && lattice.element && lattice.element.type == ElementType.HONEY_POT && lattice.element.isActive) {
activeElementIndexs.push(i);
lattice.element.canElimite = true;
}
}
console.log('激活的罐子', activeElementIndexs)
console.log('激活的罐子', activeElementIndexs);
//遍历所有基础元素
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.hasAnyState() &&
!lat.element.effectType) {
baseElements.push(lat.element);
}
}
baseElements.sort(function () { //打乱数组
return (0.5 - Math.random());
});
let genarates: Element[] = []; //生成蜂蜜的元素列表
const activeElements: Element[] = activeElementIndexs.map(i => thisObj.lattices[i].element);
const foundsResult: Element[][] = [];
//遍历激活的怪物
for (let index = 0; index < activeElements.length; index++) {
const activeEle = activeElements[index];
let founds = baseElements.filter(ele => genarates.indexOf(ele) == -1);
founds = founds.slice(0, 5);
genarates = genarates.concat(founds);
foundsResult[index] = founds;
}
const playEffect = async (index) => {
const activeEle = activeElements[index];
let founds = foundsResult[index];
founds.forEach((ele) => {
let bonusShootAni: MonsterShootAni = Pool.takeOut(RecoverName.MONSTER_SHOOT_ANI);
if (!bonusShootAni)
bonusShootAni = new MonsterShootAni();
var r = Tool.getForwardRotation([activeEle.x, activeEle.y], [ele.x, ele.y])
bonusShootAni.play(r * 180 / Math.PI, [activeEle.x, activeEle.y], [ele.x, ele.y], () => { });
thisObj.addChild(bonusShootAni);
});
};
for (let index = 0; index < activeElements.length; index++) {
playEffect(index);
}
if (genarates.length > 0)
await wait(500);
for (let index = 0; index < foundsResult.length; index++) {
const founds = foundsResult[index];
founds.forEach(ele => {
if (ele.hasAnyState())
throw new Error('不应该有状态的');
ele.setState(StateType.HONEY, true);
});
}
return activeElementIndexs
}
\ No newline at end of file
......@@ -273,6 +273,7 @@ export class Tool {
//上方元素为石头,或元素为锁定,或者是果冻,或者鸡蛋,或者大节日元素
else if (lat.element.type == ElementType.ROCK ||
lat.element.hasState(StateType.LOCK) ||
lat.element.hasState(StateType.HONEY) ||
lat.element.hasState(StateType.BLOCK_LOCK) ||
lat.element.monster ||
lat.element.type == ElementType.JELLY ||
......@@ -374,6 +375,7 @@ export class Tool {
public static judgeUpsetMove(lat: Lattice) {
if (Tool.judgeBaseEle(lat) && //基础元素
!lat.element.hasState(StateType.LOCK) && //不带锁
!lat.element.hasState(StateType.HONEY) && //不带锁
!lat.element.hasState(StateType.BLOCK_LOCK) &&
!lat.element.hasState(StateType.HAIRBALLGREY) && //不带毛球,下同
!lat.element.hasState(StateType.HAIRBALLBLACK) &&
......@@ -418,6 +420,8 @@ export class Tool {
ele.hasState(StateType.HAIRBALLGREY) ||
ele.hasState(StateType.HAIRBALLBLACK) ||
ele.hasState(StateType.HAIRBALLBROWN) ||
ele.hasState(StateType.HAIRBALLBROWN) ||
ele.hasState(StateType.HONEY) ||
ele.type == ElementType.JELLY ||
ele.type == ElementType.JELLY_MONSTER ||
ele.type == ElementType.FIREWORKS_SHOOTER ||
......@@ -464,6 +468,7 @@ export class Tool {
if (!ele ||
ele.effectType != null ||
ele.hasState(StateType.LOCK) ||
ele.hasState(StateType.HONEY) ||
ele.hasState(StateType.HAIRBALLGREY) ||
ele.hasState(StateType.BLOCK_LOCK) ||
ele.monster ||
......@@ -1080,12 +1085,17 @@ export class Tool {
public static getElement(type: ElementType): Element {
const clsMap = {};
clsMap[ElementType.HONEY_POT] = HoneyPotElement;
const cls = clsMap[type];
if (type == ElementType.HONEY_POT) {
const obj= new HoneyPotElement(type);
return obj;
}
// const cls = clsMap[type];
let obj: Element = Pool.takeOut(RecoverName.ELEMENT);
if (!obj) {
if(cls)
obj = new cls(type);
else
// if (cls)
// obj = new cls(type);
// else
obj = new Element(type)
} else {
obj.reset(type)
......
This diff is collapsed.
......@@ -67,6 +67,7 @@ export enum RecoverName {
//状态的回收
LOCK_STATE = "LockState",
BUBBLE_STATE = "BubbleState",
HONEY_STATE = "HoneyState",
HAIRBALLGREY_STATE = "HairballGreyState",
HAIRBALLBLACK_STATE = "HairballBlackState",
HAIRBALLBROWN_STATE = "HairballBrownState",
......
......@@ -5,6 +5,7 @@ import { HairballGreyState } from "../states/HairballGreyState";
import { HairballBrownState } from "../states/HairballBrownState";
import { HairballBlackState } from "../states/HairballBlackState";
import { BlockLockState } from "../states/BlockLockState";
import { HoneyState } from "../states/HoneyState";
/**
* 状态类型
......@@ -16,6 +17,7 @@ export enum StateType {
HAIRBALLBROWN,//褐色毛球 ,只能特效消除
HAIRBALLBLACK,//黑色毛球 ,两次消除,一次闭眼
BLOCK_LOCK,//石门盖住状态
HONEY,//蜂蜜
}
......@@ -27,4 +29,5 @@ export const stateDatas: { recoverName: RecoverName, className: any }[] = [
{ recoverName: RecoverName.HAIRBALLBROWN_STATE, className: HairballBrownState },
{ recoverName: RecoverName.HAIRBALLBLACK_STATE, className: HairballBlackState },
{ recoverName: RecoverName.BLOCK_STATE, className: BlockLockState },
{ recoverName: RecoverName.HONEY_STATE, className: HoneyState },
]
\ No newline at end of file
import { State } from "../class/State";
import { RecoverName } from "../enum/RecoverName";
import { Pool } from "../Pool";
/**
* 枷锁状态
* 动画比较简单,直接写这里
*/
export class HoneyState extends State {
private showImage: egret.Bitmap;
constructor() {
super();
var texture: egret.Texture = RES.getRes("honey_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;
this.changeSource("honey_png")
}
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
}
//要不要把动画放在这里,这种移除动效最好统一外面,常驻动效才
recover() {
egret.Tween.get(this)
.to({ alpha: 0 }, 750)
.call(() => {
if (this.parent) this.parent.removeChild(this);
Pool.recover(RecoverName.HONEY_STATE, this);
})
}
}
// export class LockAni extends egret.DisplayObjectContainer {
// 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;
// }
// play(callback: Function) {
// egret.Tween.get(this)
// .to({ alpha: 0 }, 750)
// .call(() => {
// if (this.parent) this.parent.removeChild(this);
// if (callback) callback();
// })
// }
// }
// export class LockAni extends Ani {
// lockUp: eui.Image;
// lockDown: eui.Image;
// constructor() {
// super()
// this.aniName = "LockAni";
// this.lockDown = new eui.Image("lockDown_png");
// this.addChild(this.lockDown);
// setTimeout(() => {
// this.lockDown.x = -this.lockDown.width / 2;
// this.lockDown.y = -this.lockDown.height / 2
// })
// //遮罩
// var mask = new egret.Shape();
// mask.graphics.beginFill(0xff0000, 1);
// mask.graphics.drawRect(-77 / 2, -78 / 2, 77, 78)
// mask.graphics.endFill();
// this.addChild(mask);
// this.lockDown.mask = mask;
// this.lockUp = new eui.Image("lockUp_png");
// this.addChild(this.lockUp);
// setTimeout(() => {
// this.lockUp.x = -this.lockUp.width / 2;
// this.lockUp.y = -this.lockUp.height / 2
// })
// }
// /**
// * 重置
// */
// reset() {
// this.alpha = 1;
// this.lockDown.y = -78 / 2
// // egret.Tween.removeTweens(this.lockDown);
// }
// play() {
// // this.reset();
// egret.Tween.get(this.lockDown)
// .to({ y: -78 - 78 / 2 }, 500)
// .call(() => {
// egret.Tween.get(this)
// .to({ alpha: 0 }, 250)
// .call(() => {
// this.recover();
// })
// })
// }
// }
\ No newline at end of file
......@@ -2137,6 +2137,31 @@
"levelNum": 425,
"maxScore": 47440,
"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
}
],
......
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