Commit a33792f6 authored by wildfirecode's avatar wildfirecode

Merge branch 'dev' of gitlab2.dui88.com:wanghongyuan/xiaoxiaole into dev

parents 8f3f6e43 b835f9d0
...@@ -58,7 +58,7 @@ const aniClass = { ...@@ -58,7 +58,7 @@ const aniClass = {
"EleDisAni": EleDisAni, "EleDisAni": EleDisAni,
"MagicLionAni": MagicLionAni, "MagicLionAni": MagicLionAni,
} }
const baseScore=20; const baseScore = 20;
/** /**
* 直线特效(4) 1.5倍 * 直线特效(4) 1.5倍
* 爆炸特效(L) 2.0倍 * 爆炸特效(L) 2.0倍
...@@ -683,9 +683,12 @@ export default class MainScene extends Scene { ...@@ -683,9 +683,12 @@ export default class MainScene extends Scene {
this.choosed.parent.removeChild(this.choosed) this.choosed.parent.removeChild(this.choosed)
} }
let fun: Function; let fun: Function;
this.elementContainer.addEventListener(egret.TouchEvent.TOUCH_BEGIN, fun = function () { this.elementContainer.addEventListener(egret.TouchEvent.TOUCH_BEGIN, fun = function (e) {
if (e.target.parent instanceof Element && e.target.parent.type != ElementType.ROCK) {
this.elementContainer.removeEventListener(egret.TouchEvent.TOUCH_BEGIN, fun, this); this.elementContainer.removeEventListener(egret.TouchEvent.TOUCH_BEGIN, fun, this);
this.sendPropUse(prop); var index = e.target.parent.index;
this.sendPropUse(prop, index);
}
}, this) }, this)
} else { } else {
if (!this.stepCircle) { if (!this.stepCircle) {
...@@ -701,7 +704,7 @@ export default class MainScene extends Scene { ...@@ -701,7 +704,7 @@ export default class MainScene extends Scene {
this.addChild(this.stepCircle) this.addChild(this.stepCircle)
} }
} }
sendPropUse(prop: PropType) { sendPropUse(prop: PropType, index?: number) {
Loading2.instace.show(); Loading2.instace.show();
this.removeChild(this.propGuide); this.removeChild(this.propGuide);
NetManager.ins.hc_useProp((s) => { NetManager.ins.hc_useProp((s) => {
...@@ -709,24 +712,47 @@ export default class MainScene extends Scene { ...@@ -709,24 +712,47 @@ export default class MainScene extends Scene {
//还原事件 //还原事件
this.addEventListener(egret.Event.ENTER_FRAME, this.onEnterFrame, this); this.addEventListener(egret.Event.ENTER_FRAME, this.onEnterFrame, this);
if (prop == PropType.BOOM || prop == PropType.HAMMER) { if (prop == PropType.BOOM || prop == PropType.HAMMER) {
this.enableMouseEvt(false)
this.elementContainer.addEventListener(egret.TouchEvent.TOUCH_BEGIN, this.mouseDownE, this); this.elementContainer.addEventListener(egret.TouchEvent.TOUCH_BEGIN, this.mouseDownE, this);
this.elementContainer.addEventListener(egret.TouchEvent.TOUCH_MOVE, this.mouseMoveE, this); this.elementContainer.addEventListener(egret.TouchEvent.TOUCH_MOVE, this.mouseMoveE, this);
} else { } else {
this.removeChild(this.stepCircle) this.removeChild(this.stepCircle)
showToast("步数增加成功")
} }
if (!s) return if (!s) return
//成功的
switch (prop) { switch (prop) {
case PropType.BOOM: case PropType.BOOM:
playSound(SoundType.line)
var rc = Tool.indexToRc(index);
var p = Tool.getPositionByIndex(index);
this.playAni(RecoverName.CROSS_ANI, p);
for (var i = 0; i < this.lattices.length; i++) {
var lat = this.lattices[i];
if (Tool.judgeEliminate(lat) && (lat.row == rc[0] || lat.column == rc[1])) {
this.eliminatedElements.push(i);
if (!lat.element.isLock) {
//3倍
this.pushScoreAni(baseScore * 1 * 3, Tool.getPositionByIndex(i))
}
}
}
setTimeout(()=>{
this.eliminate();
},200)
break; break;
case PropType.HAMMER: case PropType.HAMMER:
this.eliminatedElements.push(index);
this.eliminate();
break; break;
case PropType.CHANCE_NUM: case PropType.CHANCE_NUM:
this.steps += 5; this.steps += 5;
showToast("步数增加成功");
break; break;
} }
//更新道具数量
NetManager.ins.hc_home(() => {
this.updateScene();
}, window['collectRuleId']);
}, prop) }, prop)
} }
mouseDownE(e: egret.TextEvent) { mouseDownE(e: egret.TextEvent) {
...@@ -2125,7 +2151,7 @@ export default class MainScene extends Scene { ...@@ -2125,7 +2151,7 @@ export default class MainScene extends Scene {
var txt = codeMsgs[data.code] || "活动太火爆了\n请稍后再来"; var txt = codeMsgs[data.code] || "活动太火爆了\n请稍后再来";
showToast(txt); showToast(txt);
setTimeout(() => { setTimeout(() => {
SceneCtrl.instance.change(ModuleTypes.MAP_SCENE,createData()); SceneCtrl.instance.change(ModuleTypes.MAP_SCENE, createData());
}, 1300) }, 1300)
} }
} }
......
...@@ -597,4 +597,5 @@ export const Chapters: ChapterData[] = [ ...@@ -597,4 +597,5 @@ export const Chapters: ChapterData[] = [
starScores: [11000, 22000, 45000] starScores: [11000, 22000, 45000]
}, },
////////////////////// //////////////////////
] ]
\ No newline at end of file
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