|
|
@@ -271,6 +271,20 @@ mk.console.log("watchAD:" + e);
|
|
|
if (e) {
|
|
|
gData.adClearSickData.clearSick();
|
|
|
mk.ui.closePanel(t.node.name);
|
|
|
+var o = "";
|
|
|
+switch (gData.adClearSickData.tab) {
|
|
|
+case s.ProductType.nzw:
|
|
|
+o = "已消灭害虫";
|
|
|
+break;
|
|
|
+
|
|
|
+case s.ProductType.dw:
|
|
|
+o = "已恢复健康";
|
|
|
+break;
|
|
|
+
|
|
|
+default:
|
|
|
+o = "已恢复供电";
|
|
|
+}
|
|
|
+mk.tip.pop(o);
|
|
|
}
|
|
|
});
|
|
|
};
|
|
|
@@ -344,10 +358,8 @@ gData.gameData.setFarmDataMap(this.curConfigID, t, !1);
|
|
|
var e = gData.gameData.getFarmDataMap(this.curConfigID + 1);
|
|
|
e.state = r.FarmState.CanUnlock;
|
|
|
gData.gameData.setFarmDataMap(this.curConfigID + 1, e);
|
|
|
-} else {
|
|
|
-gData.gameData.setFarmDataMap(this.curConfigID, t);
|
|
|
+} else gData.gameData.setFarmDataMap(this.curConfigID, t);
|
|
|
gData.gameData.setNextProduct();
|
|
|
-}
|
|
|
};
|
|
|
return i([ s ], e);
|
|
|
}(c.Data);
|
|
|
@@ -835,7 +847,6 @@ e.prototype.destroyBanner = function() {
|
|
|
this.bannerAdState = i.Close;
|
|
|
this.ifLoadShow = !1;
|
|
|
this.ATBannerJS.destroyBanner();
|
|
|
-this.loadBanner();
|
|
|
};
|
|
|
e.prototype.onBannerAdLoaded = function() {
|
|
|
this.bannerAdState = i.LoadSuccess;
|
|
|
@@ -852,6 +863,7 @@ this.bannerAdState = i.Show;
|
|
|
mk.console.logSingle("banner ", "onBannerAdShow");
|
|
|
var o = JSON.parse(e);
|
|
|
gData.adData.updateADLog(7, t, o);
|
|
|
+this.loadBanner();
|
|
|
};
|
|
|
e.prototype.onBannerAdClick = function() {};
|
|
|
e.prototype.onBannerAdAutoRefresh = function() {};
|
|
|
@@ -1026,19 +1038,17 @@ var i, r = t("../../zgSingleton"), c = t("./ATSDKMgr"), s = function(t) {
|
|
|
a(e, t);
|
|
|
function e() {
|
|
|
var e = null !== t && t.apply(this, arguments) || this;
|
|
|
-e.interAdType = -1;
|
|
|
-e.interAdState = 0;
|
|
|
-e.ifLoadShow = !1;
|
|
|
+e.interAdStateArr = new Array();
|
|
|
+e.ifLoadShowArr = new Array();
|
|
|
return e;
|
|
|
}
|
|
|
e.prototype.init = function() {
|
|
|
this.ATInterstitialJS = cc.ATInterstitialJS;
|
|
|
this.ATInterstitialJS.proxy = this;
|
|
|
this.ATInterstitialJS.init();
|
|
|
-if (this.interAdState == i.Unload) {
|
|
|
-this.loadInter(0);
|
|
|
-this.loadInter(1);
|
|
|
-this.loadInter(2);
|
|
|
+for (var t = 0; t < 3; t++) {
|
|
|
+this.interAdStateArr[t] = i.Unload;
|
|
|
+this.loadInter(t);
|
|
|
}
|
|
|
};
|
|
|
e.prototype.getPlaceIDByType = function(t) {
|
|
|
@@ -1073,49 +1083,51 @@ return this.ATInterstitialJS.hasAdReady(this.getPlaceIDByType(t));
|
|
|
};
|
|
|
e.prototype.loadInter = function(t, e) {
|
|
|
void 0 === e && (e = !1);
|
|
|
-this.ifLoadShow = e;
|
|
|
-this.interAdState = i.Loading;
|
|
|
+this.ifLoadShowArr[t] = e;
|
|
|
+this.interAdStateArr[t] = i.Loading;
|
|
|
var o = this.getPlaceIDByType(t);
|
|
|
this.ATInterstitialJS.loadInter(o);
|
|
|
};
|
|
|
e.prototype.showInter = function(t) {
|
|
|
-if (this.interAdState == i.Show && t == this.interAdType) console.log("当前插屏类型正在展示"); else {
|
|
|
+if (this.interAdStateArr[t] == i.Show) console.log("当前插屏类型正在展示"); else {
|
|
|
mk.console.logSingle("inter ", "showInter " + t);
|
|
|
-this.interAdType = t;
|
|
|
if (this.hasAdReady(t)) {
|
|
|
-this.interAdState = i.Show;
|
|
|
+this.interAdStateArr[t] = i.Show;
|
|
|
this.ATInterstitialJS.showInter(this.getPlaceIDByType(t));
|
|
|
-} else this.interAdState == i.Loading ? this.ifLoadShow = !0 : this.loadInter(t, !0);
|
|
|
+} else this.interAdStateArr[t] == i.Loading ? this.ifLoadShowArr[t] = !0 : this.loadInter(t, !0);
|
|
|
}
|
|
|
};
|
|
|
e.prototype.onInterstitialAdLoaded = function(t) {
|
|
|
-this.interAdState = i.LoadSuccess;
|
|
|
var e = this.checkPlacementIDType(t);
|
|
|
+this.interAdStateArr[e] = i.LoadSuccess;
|
|
|
mk.console.logSingle("inter ", "onInterstitialAdLoaded " + e);
|
|
|
-this.ifLoadShow && this.showInter(e);
|
|
|
+this.ifLoadShowArr[e] && this.showInter(e);
|
|
|
};
|
|
|
e.prototype.onInterstitialAdLoadFail = function(t) {
|
|
|
-this.interAdState = i.LoadFail;
|
|
|
-var e = 11, o = this.checkPlacementIDType(t);
|
|
|
-mk.console.logSingle("inter ", "onInterstitialAdLoadFail " + o);
|
|
|
-0 == o ? e = 11 : 1 == o && (e = 10);
|
|
|
-gData.adData.updateADLog(e, t);
|
|
|
+var e = this.checkPlacementIDType(t);
|
|
|
+this.interAdStateArr[e] = i.LoadFail;
|
|
|
+var o = 11;
|
|
|
+mk.console.logSingle("inter ", "onInterstitialAdLoadFail " + e);
|
|
|
+0 == e ? o = 11 : 1 == e && (o = 10);
|
|
|
+gData.adData.updateADLog(o, t);
|
|
|
};
|
|
|
e.prototype.onInterstitialAdShow = function(t, e) {
|
|
|
-this.interAdState = i.Show;
|
|
|
-var o = JSON.parse(e), n = 2, a = this.checkPlacementIDType(t);
|
|
|
-mk.console.logSingle("inter ", "onInterstitialAdShow " + a);
|
|
|
-0 == a ? n = 2 : 1 == a && (n = 9);
|
|
|
-gData.adData.updateADLog(n, t, o);
|
|
|
+var o = this.checkPlacementIDType(t);
|
|
|
+this.interAdStateArr[o] = i.Show;
|
|
|
+var n = JSON.parse(e), a = 2;
|
|
|
+mk.console.logSingle("inter ", "onInterstitialAdShow " + o);
|
|
|
+0 == o ? a = 2 : 1 == o && (a = 9);
|
|
|
+gData.adData.updateADLog(a, t, n);
|
|
|
+this.loadInter(o);
|
|
|
};
|
|
|
e.prototype.onInterstitialAdClick = function() {};
|
|
|
e.prototype.onInterstitialAdClose = function(t, e) {
|
|
|
-this.interAdState = i.Close;
|
|
|
-if (1 == this.checkPlacementIDType(t)) {
|
|
|
-var o = JSON.parse(e);
|
|
|
-gData.adData.updateADLog(8, t, o);
|
|
|
-this.loadInter(1);
|
|
|
-} else this.loadInter(0);
|
|
|
+var o = this.checkPlacementIDType(t);
|
|
|
+this.interAdStateArr[o] = i.Close;
|
|
|
+if (0 == o) ; else if (1 == o) {
|
|
|
+var n = JSON.parse(e);
|
|
|
+gData.adData.updateADLog(8, t, n);
|
|
|
+}
|
|
|
};
|
|
|
e.prototype.onInterstitialAdFailedToPlayVideo = function(t, e) {
|
|
|
mk.console.logSingle("onInterstitialAdFailedToPlayVideo placementId >> ", t);
|
|
|
@@ -2505,7 +2517,7 @@ Math.random() <= this.getPerByEcpm() && mk.ui.openPanel("module/newOpenRedBag/ne
|
|
|
}
|
|
|
};
|
|
|
t.prototype.getPerByEcpm = function() {
|
|
|
-return .3;
|
|
|
+return 1;
|
|
|
};
|
|
|
return t;
|
|
|
}();
|
|
|
@@ -7686,6 +7698,10 @@ gData.factorySystem.currSelectFactory = this;
|
|
|
gData.plantData.openPanel(this.tab, this.configID);
|
|
|
break;
|
|
|
|
|
|
+case s.FactroyState.Producting:
|
|
|
+mk.ui.openPanel("module/speedUpUI/speedUp");
|
|
|
+break;
|
|
|
+
|
|
|
case s.FactroyState.Ripe:
|
|
|
gData.factorySystem.currSelectFactory = this;
|
|
|
gData.harvestData.openPanel(this.configID, this.data.productID, this.onHarvest.bind(this));
|
|
|
@@ -8595,6 +8611,7 @@ gData.plantData.openPanel(s.ProductType.nzw, this.configID);
|
|
|
break;
|
|
|
|
|
|
case s.FarmState.Growing:
|
|
|
+mk.ui.openPanel("module/speedUpUI/speedUp");
|
|
|
break;
|
|
|
|
|
|
case s.FarmState.Ripe:
|
|
|
@@ -11065,6 +11082,7 @@ this.setFramDataMapByServer();
|
|
|
this.setPastureDataMapByServer();
|
|
|
this.setFactoryDataMapByServer();
|
|
|
this.initSetMaxProduct();
|
|
|
+this.initProductTimes();
|
|
|
this.initLeftTimes();
|
|
|
this.initFarmMapGetRewardData();
|
|
|
}
|
|
|
@@ -11155,8 +11173,11 @@ this.init_makeInfo = !0;
|
|
|
}
|
|
|
};
|
|
|
t.prototype.firstCheckNext = function() {
|
|
|
-if (!this.hasFirstCheck && gData.pastureSystem.pastureIcons.length >= 3 && gData.factorySystem.factoryIcons.length >= 6) {
|
|
|
+if (!this.hasFirstCheck && gData.farmSystem.farms.length >= 18 && gData.pastureSystem.pastureIcons.length >= 3 && gData.factorySystem.factoryIcons.length >= 6) {
|
|
|
this.hasFirstCheck = !0;
|
|
|
+r.default.objSortByKey(gData.farmSystem.farms, "sortID");
|
|
|
+r.default.objSortByKey(gData.pastureSystem.pastureIcons, "sortID");
|
|
|
+r.default.objSortByKey(gData.factorySystem.factoryIcons, "sortID");
|
|
|
gData.gameData.setNextProduct(!1);
|
|
|
}
|
|
|
};
|
|
|
@@ -11269,8 +11290,11 @@ times: e
|
|
|
this._productMakeTimesData.push(r);
|
|
|
}
|
|
|
var c = t + 1, s = this.getProductMap(t), l = this.getProductMap(c);
|
|
|
-t == this.getMaxProduct(this.configs.tab) && (gData.plantData.init_itemIndex = t);
|
|
|
-l && l.tab == s.tab && c > this.getMaxProduct(s.tab) && 1 == l.unlock && l.value <= e && this.setMaxProduct(s.tab, c);
|
|
|
+t == this.getMaxProduct(s.tab) && l && (gData.plantData.init_itemIndex = c);
|
|
|
+if (l && l.tab == s.tab && c > this.getMaxProduct(s.tab) && 1 == l.unlock && l.value <= e) {
|
|
|
+this.setMaxProduct(s.tab, c);
|
|
|
+this.getProductMap(c + 1) && (gData.plantData.init_lock = c + 1);
|
|
|
+}
|
|
|
this.setProp(i.productMakeTimes, this._productMakeTimesData);
|
|
|
};
|
|
|
t.prototype.getProductMakeTimesById = function(t) {
|
|
|
@@ -11442,6 +11466,10 @@ o && this.setProp(i.maxProduct, this._maxProduct);
|
|
|
t.prototype.initSetMaxProduct = function() {
|
|
|
this._maxProduct.length <= 0 && (this._maxProduct = this.getProp(i.maxProduct));
|
|
|
};
|
|
|
+t.prototype.initProductTimes = function() {
|
|
|
+this._productMakeTimesData = this.getProp(i.productMakeTimes);
|
|
|
+for (var t = this._productMakeTimesData.length, e = 0; e < t; e++) this._productMakeTimesMap.set(this._productMakeTimesData[e].id, this._productMakeTimesData[e].times);
|
|
|
+};
|
|
|
t.prototype.checkGradeUpUnLock = function() {
|
|
|
for (var t in p) {
|
|
|
var e = p[t], o = this.getProductArrByType(e), n = o.length, a = null, r = !1;
|
|
|
@@ -12283,6 +12311,10 @@ gData.gameData.init_task = !0;
|
|
|
});
|
|
|
}
|
|
|
};
|
|
|
+e.prototype.doFlyExpAni = function() {
|
|
|
+var t = this.lbl_farmLevel.node.parent.convertToWorldSpaceAR(this.lbl_farmLevel.node.getPosition());
|
|
|
+mk.fly.PlayCoinAnim(2, 3, this.btn_product, t, function() {});
|
|
|
+};
|
|
|
i([ d({
|
|
|
type: cc.Node,
|
|
|
displayName: "游戏核心玩法"
|
|
|
@@ -12611,7 +12643,7 @@ Object.defineProperty(o, "__esModule", {
|
|
|
value: !0
|
|
|
});
|
|
|
o.GradeRewardData = void 0;
|
|
|
-var s = t("../../../mk/data/Data"), l = t("../GameData"), p = cc._decorator.ccclass, u = function(t) {
|
|
|
+var s = t("../../../mk/data/Data"), l = cc._decorator.ccclass, p = function(t) {
|
|
|
a(e, t);
|
|
|
function e() {
|
|
|
var e = null !== t && t.apply(this, arguments) || this;
|
|
|
@@ -12641,37 +12673,39 @@ return [ 2, o ];
|
|
|
});
|
|
|
});
|
|
|
};
|
|
|
-e.prototype.addGradeExp = function() {
|
|
|
+e.prototype.addGradeExp = function(t, e) {
|
|
|
+void 0 === e && (e = !1);
|
|
|
return r(this, void 0, void 0, function() {
|
|
|
-var t, e, o;
|
|
|
-return c(this, function(n) {
|
|
|
-switch (n.label) {
|
|
|
+var o, n, a;
|
|
|
+return c(this, function(i) {
|
|
|
+switch (i.label) {
|
|
|
case 0:
|
|
|
-t = {
|
|
|
-expAddType: l.ExpAddType.EAT_video
|
|
|
+o = {
|
|
|
+expAddType: t
|
|
|
};
|
|
|
-return [ 4, mk.http.sendData("farmGrade/updateFarmGrageInfo", t) ];
|
|
|
+return [ 4, mk.http.sendData("farmGrade/updateFarmGrageInfo", o) ];
|
|
|
|
|
|
case 1:
|
|
|
-if (0 != (e = n.sent()).errcode) return [ 2 ];
|
|
|
+if (0 != (n = i.sent()).errcode) return [ 2 ];
|
|
|
+a = n.data.userExp - gData.gameData.gameData.farmExpValue;
|
|
|
+if (e) {
|
|
|
this.changeExp = !0;
|
|
|
-o = e.data.userExp - gData.gameData.gameData.farmExpValue;
|
|
|
-gData.gameData.gameData.gradeLevel = e.data.farmLevel;
|
|
|
-gData.gameData.gameData.farmExpValue = e.data.userExp;
|
|
|
-gData.gameData.gameData.farmGradeData = e.data.userFarmGrageRewardInfo;
|
|
|
-mk.tip.pop("获得" + o + "点等级经验");
|
|
|
+mk.tip.pop("获得" + a + "点等级经验");
|
|
|
+} else gData.gameData.gameStyle.doFlyExpAni(a);
|
|
|
+gData.gameData.gameData.gradeLevel = n.data.farmLevel;
|
|
|
+gData.gameData.gameData.farmExpValue = n.data.userExp;
|
|
|
+gData.gameData.gameData.farmGradeData = n.data.userFarmGrageRewardInfo;
|
|
|
return [ 2 ];
|
|
|
}
|
|
|
});
|
|
|
});
|
|
|
};
|
|
|
-return i([ p ], e);
|
|
|
+return i([ l ], e);
|
|
|
}(s.Data);
|
|
|
-o.GradeRewardData = u;
|
|
|
+o.GradeRewardData = p;
|
|
|
cc._RF.pop();
|
|
|
}, {
|
|
|
-"../../../mk/data/Data": "Data",
|
|
|
-"../GameData": "GameData"
|
|
|
+"../../../mk/data/Data": "Data"
|
|
|
} ],
|
|
|
GradeRewardItem: [ function(t, e, o) {
|
|
|
"use strict";
|
|
|
@@ -13031,7 +13065,7 @@ if (!cc.sys.isNative || gData.loginData.isAuth) {
|
|
|
mk.ad.videoAdType = c.VideoAdType.farmGradeAddExp;
|
|
|
mk.ad.watchAd(function(t) {
|
|
|
mk.console.log("watchAD:" + t);
|
|
|
-t && gData.farmGradeData.addGradeExp();
|
|
|
+t && gData.farmGradeData.addGradeExp(c.ExpAddType.EAT_video, !0);
|
|
|
});
|
|
|
} else r.default.WxAuth();
|
|
|
};
|
|
|
@@ -14068,7 +14102,7 @@ done: !0
|
|
|
Object.defineProperty(o, "__esModule", {
|
|
|
value: !0
|
|
|
});
|
|
|
-var s = t("../../../game/data/AdData"), l = cc._decorator, p = l.ccclass, u = (l.property,
|
|
|
+var s = t("../../../game/data/AdData"), l = t("../../../game/data/GameData"), p = cc._decorator, u = p.ccclass, d = (p.property,
|
|
|
function(t) {
|
|
|
a(e, t);
|
|
|
function e() {
|
|
|
@@ -14085,10 +14119,29 @@ return [ 2 ];
|
|
|
};
|
|
|
e.prototype.clickSuperBtn = function() {
|
|
|
return r(this, void 0, void 0, function() {
|
|
|
+var t = this;
|
|
|
return c(this, function() {
|
|
|
-mk.ad.watchAd(function(t) {
|
|
|
-mk.console.log("watchAD:" + t);
|
|
|
-t && gData.adData.watchVideo(s.AdFun.harvest);
|
|
|
+mk.ad.watchAd(function(e) {
|
|
|
+return r(t, void 0, void 0, function() {
|
|
|
+return c(this, function(t) {
|
|
|
+switch (t.label) {
|
|
|
+case 0:
|
|
|
+mk.console.log("watchAD:" + e);
|
|
|
+return e ? [ 4, gData.adData.watchVideo(s.AdFun.harvest) ] : [ 3, 3 ];
|
|
|
+
|
|
|
+case 1:
|
|
|
+t.sent();
|
|
|
+return [ 4, gData.farmGradeData.addGradeExp(l.ExpAddType.EAT_harvest) ];
|
|
|
+
|
|
|
+case 2:
|
|
|
+t.sent();
|
|
|
+t.label = 3;
|
|
|
+
|
|
|
+case 3:
|
|
|
+return [ 2 ];
|
|
|
+}
|
|
|
+});
|
|
|
+});
|
|
|
});
|
|
|
return [ 2 ];
|
|
|
});
|
|
|
@@ -14103,12 +14156,13 @@ mk.ad.destoryBanner();
|
|
|
e.prototype.clickClose = function() {
|
|
|
mk.ui.closePanel(this.node.name);
|
|
|
};
|
|
|
-return i([ p ], e);
|
|
|
+return i([ u ], e);
|
|
|
}(cc.Component));
|
|
|
-o.default = u;
|
|
|
+o.default = d;
|
|
|
cc._RF.pop();
|
|
|
}, {
|
|
|
-"../../../game/data/AdData": "AdData"
|
|
|
+"../../../game/data/AdData": "AdData",
|
|
|
+"../../../game/data/GameData": "GameData"
|
|
|
} ],
|
|
|
HelpData: [ function(t, e, o) {
|
|
|
"use strict";
|
|
|
@@ -16605,6 +16659,7 @@ return e;
|
|
|
e.prototype.start = function() {
|
|
|
this.canvas = cc.find("Canvas");
|
|
|
this.node.on(cc.Node.EventType.TOUCH_START, this.onMapTouchBegin, this);
|
|
|
+this.node.setPosition(cc.v2(72, 348));
|
|
|
};
|
|
|
e.prototype.onDestroy = function() {
|
|
|
this.node.off(cc.Node.EventType.TOUCH_START, this.onMapTouchBegin, this);
|
|
|
@@ -18854,6 +18909,7 @@ this.eatNode.active = !0;
|
|
|
break;
|
|
|
|
|
|
case s.PastureState.Growing:
|
|
|
+mk.ui.openPanel("module/speedUpUI/speedUp");
|
|
|
break;
|
|
|
|
|
|
case s.PastureState.Ripe:
|
|
|
@@ -19404,6 +19460,7 @@ this.tab = null;
|
|
|
this.configID = -1;
|
|
|
this.productArr = [];
|
|
|
this.init_itemIndex = -1;
|
|
|
+this.init_lock = -1;
|
|
|
}
|
|
|
t.prototype.openPanel = function(t, e) {
|
|
|
this.tab = t;
|
|
|
@@ -19584,6 +19641,16 @@ return [ 2 ];
|
|
|
});
|
|
|
});
|
|
|
};
|
|
|
+e.prototype.update = function() {
|
|
|
+if (gData.plantData.init_itemIndex == this.data.picture) {
|
|
|
+this.initItem(this.data);
|
|
|
+gData.plantData.init_itemIndex = -1;
|
|
|
+}
|
|
|
+if (gData.plantData.init_lock == this.data.picture) {
|
|
|
+this.initItem(this.data);
|
|
|
+gData.plantData.init_lock = -1;
|
|
|
+}
|
|
|
+};
|
|
|
e.prototype.initItem = function(t) {
|
|
|
return r(this, void 0, void 0, function() {
|
|
|
var e, o, n, a, i, r, s, p;
|
|
|
@@ -19743,17 +19810,11 @@ return e;
|
|
|
}
|
|
|
e.prototype.start = function() {
|
|
|
gData.plantData.init_itemIndex = -1;
|
|
|
+gData.plantData.init_lock = -1;
|
|
|
this.initScollView();
|
|
|
};
|
|
|
-e.prototype.update = function() {
|
|
|
-if (-1 != gData.plantData.init_itemIndex) {
|
|
|
-var t = this.getItemDataByID();
|
|
|
-this.tableView.contentMoveByIndex(t, .1);
|
|
|
-gData.plantData.init_itemIndex = -1;
|
|
|
-}
|
|
|
-};
|
|
|
-e.prototype.getItemDataByID = function() {
|
|
|
-for (var t = this.list_data.length, e = 0; e < t; e++) if (this.list_data[e].picture == gData.plantData.init_itemIndex) return e;
|
|
|
+e.prototype.getItemDataByID = function(t) {
|
|
|
+for (var e = this.list_data.length, o = 0; o < e; o++) if (this.list_data[o].picture == t) return o;
|
|
|
return 0;
|
|
|
};
|
|
|
e.prototype.initScollView = function() {
|