Commit 88148681 authored by wjf's avatar wjf

l

parent 5682692d
......@@ -22,4 +22,3 @@
# doc/*.txt
# 会忽略 doc/notes.txt 但不包括 doc/server/arch.txt
node_modules
bin-release
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -44,7 +44,6 @@
top: 0;
background: rgba(0, 0, 0, 0.6);
}
.app-close {
position: absolute;
width: 5vw;
......@@ -52,7 +51,6 @@
top: 5vw;
right: 5vw;
}
.app-info-wrap {
padding: 3vh 0;
box-sizing: border-box;
......@@ -69,7 +67,6 @@
flex-direction: column;
align-items: center;
}
.app-logo {
width: 18.7vw;
margin-top: 4vh;
......@@ -77,7 +74,6 @@
background-repeat: no-repeat;
background-size: 100%;
}
.app-name {
font-size: 24px;
font-weight: 400;
......@@ -86,7 +82,6 @@
text-align: center;
margin-top: 3vh;
}
.app-button {
width: 75.2vw;
height: 6.9vh;
......@@ -126,20 +121,6 @@
<img id="pic" style="width:100%;position: absolute;z-index: 999;display: none;" />
<script>
window['imgver'] = '11112';//签到itemId对应图片,线上注意对应修改
window['duiba'] = '';
window["appKeyTuia"] = "2ZjLbhEBCFAzBbihEtxLEq25mXKw";//推啊appkey
//推啊广告id
window["slotIdsTuia"] = [
"324689",//首页悬浮 0
"327165",//签到完成翻倍 1
"327166",//开始前领取道具 2
"327166",//游戏中领取道具 3
"327167",//游戏失败领取步数 4
"327165",//游戏成功翻倍领取 5
"327165",//开宝箱翻倍领取 6
]
window['signconfigs'] = [
{ nums: '*20', type: 'money' },
{ nums: '*20', type: 'money' },
......
......@@ -6,6 +6,7 @@ import wait from "../../new_tc/wait";
import { DataManager } from "../../tw/manager/DataManager";
import { NetManager } from "../../tw/manager/NetManager";
import Panel from "./Panel";
import { handleVideo } from "../../../src/myVideo/videoCtrl";
import Loading from "./Loading";
import { showToast } from "../ctrls/toastCtrl";
export default class PrizePanel extends Panel {
......@@ -72,29 +73,38 @@ export default class PrizePanel extends Panel {
//新增看视频双倍
this["doubleBtn"].addEventListener(egret.TouchEvent.TOUCH_TAP, () => {
NetManager.ins.clickLog(getlogItem(6))
NetManager.ins.getTuiaAd(
handleVideo(
(s) => {
if (s) {
//居中
this['goBtn'].horizontalCenter = 0;
//隐藏
this['doubleBtn'].visible = false;
Loading.instace.show()
NetManager.ins.getIncentiveAward(
(s) => {
Loading.instace.hide()
if (s) {
showToast("翻倍成功");
NetManager.ins.hc_home(() => {
}, window['collectRuleId']);
} else {
showToast("加倍失败");
}
},
25
)
} else {
showToast("广告未成功观看,无法加倍领取");
}
},
() => {
//居中
this['goBtn'].horizontalCenter = 0;
//隐藏
this['doubleBtn'].visible = false;
Loading.instace.show()
NetManager.ins.getIncentiveAward(
(s) => {
Loading.instace.hide()
if (s) {
showToast("翻倍成功");
NetManager.ins.hc_home(() => {
}, window['collectRuleId']);
} else {
showToast("加倍失败");
}
},
() => { },
25
)
},
() => { showToast("广告未成功观看,无法加倍领取"); },
window["slotIdsTuia"][5]
window["slotid"]
)
}, this)
}
......
......@@ -94,34 +94,15 @@ export class NetManager extends ABNetManager {
};
this.send(net);
}
/**
*
* @param rewardFn 已完成活动,执行
* @param closeFn 未完成关闭
* @param comCloseFn 已完成活动,返回的提示,一般是toast或游戏内的逻辑,暂不用
*/
public getTuiaAd(rewardFn: Function, closeFn: Function, slotId: string) {
this['tuiaRewardMark'] = false;
let _rewardFn = () => {
// rewardFn();
//这里只标记吧,下面返回再执行
this['tuiaRewardMark'] = true;
console.log("观看成功")
}
let _closeFn = () => {
if (!this['tuiaRewardMark']) {
closeFn();
} else {
rewardFn();
}
}
public getTuiaAd(rewardFn, closeFn) {
window["TAIsdk"].init({
appKey: window["appKeyTuia"] || '2ZjLbhEBCFAzBbihEtxLEq25mXKw',//固定,到时修改
slotId: slotId, //到时修改
slotId: window["slotIdTuia"] || '324689', //到时修改
deviceId: getUrl('deviceId'),
userId: window["CFG"].uid,
rewardCallback: _rewardFn,
closeCallback: _closeFn,
rewardCallback: rewardFn,
closeCallback: closeFn,
extParams: {},
debug: false,
// newWebviewFn: newWebview,
......
......@@ -18,18 +18,7 @@
//window['tryWuhanVideo']=true;
window["slotidIcon"] = "srlKMxcd2230";//首页icon的广告位id
window["slotid"] = "srlboItw2231";//其他位置广告位id
window["appKeyTuia"] = "2ZjLbhEBCFAzBbihEtxLEq25mXKw";//推啊appkey
//推啊广告id
window["slotIdsTuia"] = [
"324689",//首页悬浮 0
"327165",//签到完成翻倍 1
"327166",//开始前领取道具 2
"327166",//游戏中领取道具 3
"327167",//游戏失败领取步数 4
"327165",//游戏成功翻倍领取 5
"327165",//开宝箱翻倍领取 6
]
window["slotIdTuia"] = "324689";//推啊广告id
</script>
<div style="margin: auto;width: 100%;height: 100%;" class="egret-player" data-entry-class="Main" data-orientation="auto"
......@@ -69,7 +58,6 @@
top: 0;
background: rgba(0, 0, 0, 0.6);
}
.app-close {
position: absolute;
width: 5vw;
......@@ -77,7 +65,6 @@
top: 5vw;
right: 5vw;
}
.app-info-wrap {
padding: 3vh 0;
box-sizing: border-box;
......@@ -94,7 +81,6 @@
flex-direction: column;
align-items: center;
}
.app-logo {
width: 18.7vw;
margin-top: 4vh;
......@@ -102,7 +88,6 @@
background-repeat: no-repeat;
background-size: 100%;
}
.app-name {
font-size: 24px;
font-weight: 400;
......@@ -111,7 +96,6 @@
text-align: center;
margin-top: 3vh;
}
.app-button {
width: 75.2vw;
height: 6.9vh;
......
......@@ -514,7 +514,7 @@ export default class MainScene extends Scene {
//位置
var p = Tool.getPositionByIndex(i);
//石门
var dooreData = [4, 5, 6, 51, 61]
var dooreData = [5, 6, 51, 61]
if (dooreData.indexOf(latticesD[i]) >= 0) {
let door: Door = Pool.takeOut(RecoverName.DOOR);
var closed: boolean = (latticesD[i] + "").length == 2 ? false : true
......@@ -603,7 +603,7 @@ export default class MainScene extends Scene {
for (var i = 0; i < elements.length; i++) {
//如果对应格子为空,直接跳过,
if (!this.lattices[i]) continue;
let ele: Element;
var p = Tool.getPositionByIndex(i);
switch (elements[i]) {
//如果为0记录空格
case 0:
......@@ -617,7 +617,16 @@ export default class MainScene extends Scene {
case 9:
case 10:
var type = Tool.returnType(i, this.lattices, this.chapterData.baseElementTypes);
ele = Tool.getElement(type)
let ele: Element = Pool.takeOut(RecoverName.ELEMENT);
if (!ele) {
ele = new Element(type)
} else {
ele.reset(type)
}
ele.x = p[0];
ele.y = p[1];
this.elementContainer.addChild(ele);
this.lattices[i].element = ele;
if (elements[i] == 4) {
ele.setState(StateType.LOCK, true)
}
......@@ -638,37 +647,56 @@ export default class MainScene extends Scene {
else if (elements[i] == 10) {
ele.setState(StateType.HAIRBALLBLACK, true)
}
break;
//棒棒糖
case 3:
this.lollipopCount++;
ele = Tool.getElement(ElementType.LOLLIPOP)
let lol: Element = Pool.takeOut(RecoverName.ELEMENT);
if (!lol) {
lol = new Element(ElementType.LOLLIPOP)
} else {
lol.reset(ElementType.LOLLIPOP)
}
lol.x = p[0];
lol.y = p[1];
this.elementContainer.addChild(lol);
this.lattices[i].element = lol;
break;
//石头
case 2:
ele = Tool.getElement(ElementType.ROCK)
let rock: Element = Pool.takeOut(RecoverName.ELEMENT);
if (!rock) {
rock = new Element(ElementType.ROCK)
} else {
rock.reset(ElementType.ROCK)
}
rock.x = p[0];
rock.y = p[1];
this.elementContainer.addChild(rock);
this.lattices[i].element = rock;
break;
//果冻
case 5:
ele = Tool.getElement(ElementType.JELLY)
let jelly: Element = Tool.getElement(ElementType.JELLY)
jelly.x = p[0];
jelly.y = p[1];
this.elementContainer.addChild(jelly);
this.lattices[i].element = jelly;
break;
//鸡蛋
case 6:
ele = Tool.getElement(ElementType.CHICKEN_EGG)
let egg: Element = Tool.getElement(ElementType.CHICKEN_EGG)
egg.x = p[0];
egg.y = p[1];
this.elementContainer.addChild(egg);
this.lattices[i].element = egg;
break;
default:
//其他标识按空元素记
this.emptys.push(i);
break
}
//有元素操作
if (ele) {
var p = Tool.getPositionByIndex(i);
ele.x = p[0];
ele.y = p[1];
this.elementContainer.addChild(ele);
this.lattices[i].element = ele;
}
//针对石门修改
if (this.lattices[i].doorClosed) {
if (this.lattices[i].element) {
......@@ -679,12 +707,12 @@ export default class MainScene extends Scene {
Tool.removeEle(i, this.emptys);
}
}
}
//针对如果地图没有棒棒糖0,但是通关目标有,需要标记生成
if (this.passElements &&
this.passElements[ElementType.LOLLIPOP] &&
!this.lollipopCount) {
this.lollipopMark = true
//针对如果地图没有棒棒糖0,但是通关目标有,需要标记生成
if (this.passElements &&
this.passElements[ElementType.LOLLIPOP] &&
!this.lollipopCount) {
this.lollipopMark = true
}
}
}
//重置基础元素及特效类型
......@@ -1586,7 +1614,10 @@ export default class MainScene extends Scene {
this.lollipopMark = true
}
}
if (++count == countAll) callback();
count++;
if (count == countAll) {
callback()
}
})
}
......@@ -2054,7 +2085,9 @@ export default class MainScene extends Scene {
this.magicRotateData = [rotateData];
for (var i = 0; i < this.lattices.length; i++) {
var lat = this.lattices[i];
if (Tool.judgeMagicEliminate(lat) &&
if (Tool.judgeBaseEle(lat) && //是基础元素
!lat.doorClosed &&//石门非关闭状态
lat.element.effectType != EffectType.MAGICLION && //不能是魔力鸟特效
lat.element.type == other.type //类型相等
) {
//一个魔力鸟时其实不用加,因为石头或果冻的不会进入判断
......@@ -2323,7 +2356,9 @@ export default class MainScene extends Scene {
this.magicRotateData.push(rotateData);
//对于魔力鸟的效果有不一样的,旋转,该组元素要旋转消除
for (var i = 0; i < this.lattices.length; i++) {
if (Tool.judgeMagicEliminate(this.lattices[i]) &&
if (Tool.judgeBaseEle(this.lattices[i]) && //是基础元素
!this.lattices[i].doorClosed &&//石门非关闭状态
this.lattices[i].element.effectType != EffectType.MAGICLION && //不是魔力鸟
this.lattices[i].element.type == type //类型相等
) {
if (this.eliminatedElements.indexOf(i) < 0 && effectIndexs.indexOf(i) < 0) {
......@@ -2576,7 +2611,8 @@ export default class MainScene extends Scene {
egret.Tween.get(ele)
.to({ x: p[0], y: p[1] }, 500)
.call(() => {
if (++count == countAll) {
count++;
if (count == countAll) {
//交换结束后,判断是否有三消
if (this.threeMatch()) {
this.eliminate()
......@@ -2793,7 +2829,7 @@ export default class MainScene extends Scene {
for (let i = 0; i < indexs.length; i++) {
let index = indexs[i];
let lat = this.lattices[index];
if (lat && lat.element && !lat.doorClosed && checkFun(lat)) {
if (lat && lat.element && checkFun(lat) && !lat.doorClosed) {
//添加进消除队列,注意重复
if (this.eliminatedElements.indexOf(index) == -1) this.eliminatedElements.push(index)
}
......
......@@ -26,6 +26,7 @@ import MapTopPart from "./MapTopPart";
import RedBagAni, { createRedBagIcon } from "./RedBagAni";
import { createEffect2MovieClip } from "../effect/createEffect2";
import { NetName } from "../../libs/tw/enum/NetName";
import { handleVideo } from "../myVideo/videoCtrl";
import { getUrl } from "../myVideo/getDefaultConfig";
let doHelpFlag = false;
......@@ -56,39 +57,75 @@ export default class MapScene extends Scene {
NetManager.ins.getIconInfo((s, res) => {
//成功才显示,且有剩余次数remainAwardTimes
if (s && res.data && res.data.remainAwardTimes) {
this["tuiaGroup"].visible = true;
NetManager.ins.showLog(getlogItem(13))
this["tuiaGroup"].addEventListener(egret.TouchEvent.TOUCH_TAP, () => {
NetManager.ins.clickLog(getlogItem(13))
NetManager.ins.getTuiaAd(
() => {
Loading.instace.show();
NetManager.ins.getIconAward((succ, ress) => {
Loading.instace.hide();
if (succ) {
PanelCtrl.instance.show("DailyIconPrizePanel");
//如果次数没了就隐藏icon
if (!ress.data.remainAwardTimes) {
this["tuiaGroup"].visible = false;
}
//领奖类型:0:武汉 1:推啊
//武汉
if (res.data.type == 0) {
this["wuhanGroup"].visible = true;
NetManager.ins.showLog(getlogItem(14))
this["wuhanGroup"].addEventListener(egret.TouchEvent.TOUCH_TAP, () => {
NetManager.ins.clickLog(getlogItem(14))
handleVideo(
(s) => {
if (s) {
Loading.instace.show();
NetManager.ins.getIconAward((succ, ress) => {
Loading.instace.hide();
if (succ) {
PanelCtrl.instance.show("DailyIconPrizePanel");
//如果次数没了就隐藏icon
if (!ress.data.remainAwardTimes) {
this["wuhanGroup"].visible = false;
}
} else {
showToast("领取失败");
}
})
} else {
showToast("领取失败");
showToast("广告未成功观看,无法领取奖励");
}
})
//关闭弹框
// window['TAIsdk'].iframeNode.remove()
// setTimeout(function () {
// window['TAIsdk'].iframeNode.src = ''
// })
// window['TAIsdk'].closeBtn.style.display = 'none'
},
() => {
showToast("活动未完成,无法领取奖励");
},
window["slotIdsTuia"][0]
)
}, this)
},
() => { NetManager.ins.getIconAward(() => { }) },
window["slotidIcon"]
)
}, this)
}
//推啊
else if (res.data.type == 1) {
this["tuiaGroup"].visible = true;
NetManager.ins.showLog(getlogItem(13))
this["tuiaGroup"].addEventListener(egret.TouchEvent.TOUCH_TAP, () => {
NetManager.ins.clickLog(getlogItem(13))
this['tuiaRewardMark'] = false;
NetManager.ins.getTuiaAd(
() => {
Loading.instace.show();
NetManager.ins.getIconAward((succ, ress) => {
Loading.instace.hide();
if (succ) {
PanelCtrl.instance.show("DailyIconPrizePanel");
//如果次数没了就隐藏icon
if (!ress.data.remainAwardTimes) {
this["tuiaGroup"].visible = false;
}
} else {
showToast("领取失败");
}
})
this['tuiaRewardMark'] = true;
//关闭弹框
// window['TAIsdk'].iframeNode.remove()
// setTimeout(function () {
// window['TAIsdk'].iframeNode.src = ''
// })
// window['TAIsdk'].closeBtn.style.display = 'none'
},
() => {
//上面没回调过。就显示toast
if (!this['tuiaRewardMark']) showToast("活动未完成,无法领取奖励");
}
)
}, this)
}
}
})
......
......@@ -4,6 +4,7 @@ import { NetManager } from "../../libs/tw/manager/NetManager";
import getHomeData from "../getHomeData";
import { getlogItem } from "../Main";
import AdSmallComp from "../mapScene/AdSmallComp";
import { handleVideo } from "../myVideo/videoCtrl";
import { showToast } from "../../libs/new_wx/ctrls/toastCtrl";
import Loading from "../../libs/new_wx/components/Loading";
import { updateMainTimer } from "../../libs/new_wx/MainBase";
......@@ -39,30 +40,39 @@ export default class BoxPanel extends Panel {
this['close2Btn'].visible = false;
this["doubleBtn"].addEventListener(egret.TouchEvent.TOUCH_TAP, () => {
NetManager.ins.clickLog(getlogItem(12))
NetManager.ins.getTuiaAd(
handleVideo(
(s) => {
if (s) {
this['close2Btn'].visible = true;
this['doubleBtn'].visible = false;
Loading.instace.show()
NetManager.ins.getIncentiveAward(
(s) => {
Loading.instace.hide()
if (s) {
showToast("翻倍成功");
NetManager.ins.hc_home(() => {
updateMainTimer();
SceneCtrl.instance.updateScene();
}, window['collectRuleId']);
} else {
showToast("加倍失败");
this.hidePanel();
}
},
22
)
} else {
showToast("广告未成功观看,无法加倍领取");
}
},
() => {
this['close2Btn'].visible = true;
this['doubleBtn'].visible = false;
Loading.instace.show()
NetManager.ins.getIncentiveAward(
(s) => {
Loading.instace.hide()
if (s) {
showToast("翻倍成功");
NetManager.ins.hc_home(() => {
updateMainTimer();
SceneCtrl.instance.updateScene();
}, window['collectRuleId']);
} else {
showToast("加倍失败");
this.hidePanel();
}
},
() => { },
22
)
},
() => { showToast("广告未成功观看,无法加倍领取"); },
window["slotIdsTuia"][6]
window["slotid"]
)
}, this)
......
......@@ -2,6 +2,7 @@ import Panel from "../../libs/new_wx/components/Panel";
import { NetManager } from "../../libs/tw/manager/NetManager";
import { addRankFriendList } from "../mapScene/RankFriendList";
import { changeMapScene } from "../startScene/StartScene";
import { handleVideo } from "../myVideo/videoCtrl";
import { showToast } from "../../libs/new_wx/ctrls/toastCtrl";
import { getlogItem } from "../Main";
......@@ -32,13 +33,17 @@ export default class FailedPanel extends Panel {
this["videoBtn"].visible = true;
this["videoBtn"].addEventListener(egret.TouchEvent.TOUCH_TAP, () => {
NetManager.ins.clickLog(getlogItem(4))
NetManager.ins.getTuiaAd(
() => {
this.hidePanel();
data.complete();
handleVideo(
(s) => {
if (s) {
this.hidePanel();
data.complete();
} else {
showToast("广告未成功观看,请继续观看");
}
},
() => { showToast("广告未成功观看,无法复活"); },
window["slotIdsTuia"][4]
() => { },
window["slotid"]
)
}, this);
}
......
......@@ -3,6 +3,7 @@ import { DataManager } from "../../libs/tw/manager/DataManager";
import { addAdComp } from "./BoxPanel";
import { NetManager } from "../../libs/tw/manager/NetManager";
import { getlogItem } from "../Main";
import { handleVideo } from "../myVideo/videoCtrl";
import Loading from "../../libs/new_wx/components/Loading";
import { showToast } from "../../libs/new_wx/ctrls/toastCtrl";
import { updateMainTimer } from "../../libs/new_wx/MainBase";
......@@ -50,30 +51,38 @@ export default class SignPrizePanel extends Panel {
this['close2Btn'].visible = false;
this["doubleBtn"].addEventListener(egret.TouchEvent.TOUCH_TAP, () => {
NetManager.ins.clickLog(getlogItem(8))
NetManager.ins.getTuiaAd(
handleVideo(
(s) => {
if (s) {
Loading.instace.show();
NetManager.ins.getIncentiveAward(
(s) => {
Loading.instace.hide();
this['close2Btn'].visible = true;
this['doubleBtn'].visible = false;
if (s) {
showToast("翻倍成功");
NetManager.ins.hc_home(() => {
updateMainTimer();
SceneCtrl.instance.updateScene();
}, window['collectRuleId']);
} else {
showToast("加倍失败");
this.hidePanel();
}
},
21
)
} else {
showToast("广告未成功观看,无法加倍领取");
}
},
() => {
Loading.instace.show();
NetManager.ins.getIncentiveAward(
(s) => {
Loading.instace.hide();
this['close2Btn'].visible = true;
this['doubleBtn'].visible = false;
if (s) {
showToast("翻倍成功");
NetManager.ins.hc_home(() => {
updateMainTimer();
SceneCtrl.instance.updateScene();
}, window['collectRuleId']);
} else {
showToast("加倍失败");
this.hidePanel();
}
},
21
)
() => { },
21)
},
() => { showToast("广告未成功观看,无法加倍领取") },
window["slotIdsTuia"][1]
window["slotid"]
)
}, this)
}
......
......@@ -18,6 +18,7 @@ import { addRankFriendList } from "../mapScene/RankFriendList";
import { addAdComp } from "./BoxPanel";
import { getChapterData } from "../something/chapters/getChapter";
import { getlogItem } from "../Main";
import { handleVideo } from "../myVideo/videoCtrl";
export default class StartPanel extends Panel {
static currlevel;
......@@ -193,45 +194,57 @@ export default class StartPanel extends Panel {
onTap_video1btn() {
//看视频按钮点击
NetManager.ins.clickLog(getlogItem(2))
NetManager.ins.getTuiaAd(
() => {
this['video1btn'].visible = false;
this.videoProp[1] = 1;
this['nums1Txt'].text = (this.hammer + this.videoProp[1]) + "";
showToast("增加一个锤子道具")
handleVideo(
(s) => {
if (s) {
this['video1btn'].visible = false;
this.videoProp[1] = 1;
this['nums1Txt'].text = (this.hammer + this.videoProp[1]) + "";
showToast("增加一个锤子道具")
} else {
showToast("广告未成功观看,道具领取失败")
}
},
() => { showToast("广告未成功观看,道具领取失败") },
window["slotIdsTuia"][2]
() => { },
window["slotid"]
)
}
//炸弹
onTap_video2btn() {
//看视频按钮点击
NetManager.ins.clickLog(getlogItem(2))
NetManager.ins.getTuiaAd(
() => {
this['video2btn'].visible = false;
this.videoProp[0] = 1;
this['nums2Txt'].text = (this.boom + this.videoProp[0]) + "";
showToast("增加一个炸弹道具")
handleVideo(
(s) => {
if (s) {
this['video2btn'].visible = false;
this.videoProp[0] = 1;
this['nums2Txt'].text = (this.boom + this.videoProp[0]) + "";
showToast("增加一个炸弹道具")
} else {
showToast("广告未成功观看,道具领取失败")
}
},
() => { showToast("广告未成功观看,道具领取失败") },
window["slotIdsTuia"][2]
() => { },
window["slotid"]
)
}
//步数
onTap_video3btn() {
//看视频按钮点击
NetManager.ins.clickLog(getlogItem(2))
NetManager.ins.getTuiaAd(
() => {
this['video3btn'].visible = false;
this.videoProp[2] = 1;
this['nums3Txt'].text = (this.boom + this.videoProp[2]) + "";
showToast("增加一个增加步数道具")
handleVideo(
(s) => {
if (s) {
this['video3btn'].visible = false;
this.videoProp[2] = 1;
this['nums3Txt'].text = (this.boom + this.videoProp[2]) + "";
showToast("增加一个增加步数道具")
} else {
showToast("广告未成功观看,道具领取失败")
}
},
() => { showToast("广告未成功观看,道具领取失败") },
window["slotIdsTuia"][2]
() => { },
window["slotid"]
)
}
......
......@@ -60,15 +60,19 @@ export default class VideoBuyPanel extends Panel {
this["videoBtn"].visible = true;
this["videoBtn"].addEventListener(egret.TouchEvent.TOUCH_TAP, () => {
NetManager.ins.clickLog(getlogItem(10))
NetManager.ins.getTuiaAd(
() => {
this.hidePanel();
//回调
data.complete(true);
showToast("领取成功")
handleVideo(
(s) => {
if (s) {
this.hidePanel();
//回调
data.complete(true);
showToast("领取成功")
} else {
showToast("广告未成功观看,道具领取失败")
}
},
() => { showToast("广告未成功观看,道具领取失败") },
window["slotIdsTuia"][3]
() => { },
window["slotid"]
)
}, this);
} else {
......
......@@ -397,55 +397,6 @@ export class Tool {
return false;
}
/**
* 判断鸡蛋孵小鸡可飞入的索引
* 基础元素,无任何状态,类型不为鸡,石门非关闭
* @param lat
*/
public static judgeSetChicken(lat: Lattice): boolean {
if (Tool.judgeBaseEle(lat) &&
!lat.element.hasAnyState() &&
lat.element.type !== ElementType.CHICKEN &&
!lat.doorClosed
) {
return true;
}
return false;
}
/**
* 判断可被单魔力鸟效果消除的元素
* 是基础元素,非石门关闭,非魔力鸟,(基础类型的判断自行添加)
* @param lat
*/
public static judgeMagicEliminate(lat: Lattice): boolean {
if (Tool.judgeBaseEle(lat) && //是基础元素
!lat.doorClosed &&//石门非关闭状态
lat.element.effectType != EffectType.MAGICLION //不能是魔力鸟特效
) {
return true;
}
return false
}
/**
* 判断
* 果冻可蔓延、
* 毛球可分裂、
* 毛球可跳动
* 的方向格子索引,暂时都一致,不区分
* 是基础元素,无任何状态,石门非关闭
* @param lat
*/
public static judgeAiActionDirection(lat: Lattice): boolean {
if (Tool.judgeBaseEle(lat) &&
!lat.element.hasAnyState() &&
!lat.doorClosed
) {
return true;
}
return false;
}
/**
* 判断元素是否可被手势选中和交换
......
......@@ -689,7 +689,7 @@ export const Chapters1: ChapterData[] = [
],
},
},
//12 会开局消除,baseElements有问题
//12
{
baseElementTypes: [0, 1, 2, 3, 4],
bubbleProbability: 0,
......
......@@ -170,7 +170,7 @@ export class Element extends eui.Component {
* 替换资源时,同时修改
* @param source
*/
private changeSource(source: string) {
changeSource(source: string) {
// this.showImage.source = source;
var texture: egret.Texture = RES.getRes(source);
this.showImage.texture = texture
......@@ -274,9 +274,8 @@ export class Element extends eui.Component {
}
}
/**
* 去掉原先带的所有特效
*/
private removeEffectHas() {
//回收掉原先有的
switch (this._effectType) {
......@@ -359,7 +358,7 @@ export class Element extends eui.Component {
this.states[state] = stateEx;
//视图添加
this.addChild(this.states[state]);
//气泡定制逻辑,暂时没出现给特效元素设置气泡的操作,所以先不管,只对视图做简单处理
//气泡定制逻辑
if (state === StateType.BUBBLE) this.showImage.alpha = 0;
}
}
......
......@@ -27,8 +27,6 @@ const chickenNum: number = 4;
//节日大红包的小红包数量
export const fesELeSmallNum: number = 6;
//很多motion在石门关闭时都不能触发,暂时就只有石门,以后有多出来的再独立封装
export class AiControl {
private static _ins: AiControl
/**
......@@ -200,7 +198,7 @@ export class AiControl {
var lat = thisObj.lattices[a];
//是基础元素,但是不能有任何状态, 考虑修改小红包属性为可fall,
if (Tool.judgeBaseEle(lat) &&
!lat.element.hasAnyState() &&
!lat.element.hasAnyState()&&
!lat.doorClosed //石门未关闭
) {
redIndexs.push(a);
......@@ -378,7 +376,13 @@ export class AiControl {
for (var a = 0; a < thisObj.lattices.length; a++) {
var lat = thisObj.lattices[a];
//是基础元素,但是不能有任何状态,去掉鸡,且石门未关闭
if (Tool.judgeSetChicken(lat)) chickenIndexs.push(a);
if (Tool.judgeBaseEle(lat) &&
!lat.element.hasAnyState() &&
lat.element.type !== ElementType.CHICKEN&&
!lat.doorClosed
) {
chickenIndexs.push(a);
}
}
//如果没有能飞的格子,直接回调
if (!chickenIndexs.length) {
......@@ -495,7 +499,10 @@ export class AiControl {
bubbleAni.play(fromType, type, () => {
//显示
ele.visible = true;
if (++count == countAll) callback();
count++;
if (count == countAll) {
callback();
}
})
}
}
......@@ -738,7 +745,7 @@ function judgeFesEleBigExist(lattices: Lattice[]) {
}
/**
* 判断气泡是否存在,废弃了,气泡会再生,提前判断无意义
* 判断气泡是否存在
* @param lattices
*/
function judgeBubbleExist(lattices: Lattice[]) {
......@@ -807,7 +814,12 @@ function judgeActionIndex(index: number, lattices: Lattice[]): number {
while (arr.length) {
var rand = Math.floor(Math.random() * arr.length);
var i = arr.splice(rand, 1)[0];
if (Tool.judgeAiActionDirection(lattices[i])) return i;
if (Tool.judgeBaseEle(lattices[i]) &&
!lattices[i].element.hasAnyState() &&
!lattices[i].doorClosed
) {
return i
}
}
return null
}
......
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