window.__require = function t(e, i, o) {
function a(n, s) {
if (!i[n]) {
if (!e[n]) {
var l = n.split("/");
l = l[l.length - 1];
if (!e[l]) {
var c = "function" == typeof __require && __require;
if (!s && c) return c(l, !0);
if (r) return r(l, !0);
throw new Error("Cannot find module '" + n + "'");
}
n = l;
}
var u = i[n] = {
exports: {}
};
e[n][0].call(u.exports, function(t) {
return a(e[n][1][t] || t);
}, u, u.exports, t, e, i, o);
}
return i[n].exports;
}
for (var r = "function" == typeof __require && __require, n = 0; n < o.length; n++) a(o[n]);
return a;
}({
AStarFinder: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "0fcd3Y6PKdDYapQhfNdn6b9", "AStarFinder");
var o = this && this.__values || function(t) {
var e = "function" == typeof Symbol && Symbol.iterator, i = e && t[e], o = 0;
if (i) return i.call(t);
if (t && "number" == typeof t.length) return {
next: function() {
t && o >= t.length && (t = void 0);
return {
value: t && t[o++],
done: !t
};
}
};
throw new TypeError(e ? "Object is not iterable." : "Symbol.iterator is not defined.");
};
Object.defineProperty(i, "__esModule", {
value: !0
});
var a = t("../../DebugConfig"), r = t("../../MapBox"), n = t("./StaticGrid"), s = function() {
function t() {}
t.backTracePath = function(t, e, i) {
void 0 === i && (i = !1);
e.clear();
e.push(t.tile);
for (;t.parent; ) {
t = t.parent;
e.push(t.tile);
}
i || e.reverse();
return e;
};
t.getNext = function(t) {
for (var e = 0, i = null, o = 0; o < t.length; o++) if (!i || i.compareTo(t[o]) > 0) {
e = o;
i = t[o];
}
t.splice(e, 1);
return i;
};
t.findPath = function(e, i) {
var s, l, c, u, d, h, p = [], f = null, m = null;
if (e.endToStartPath) {
f = e.endNode;
m = e.startNode;
} else {
f = e.startNode;
m = e.endNode;
}
var y = e.heuristicFunc, _ = e.searchGrid, g = e.diagonalMovement, v = e.weight, b = e.boat;
f.startToCurNodeLen = 0;
f.heuristicStartToEndLen = 0;
p.push(f);
f.isOpened = !0;
t.result_split_path = !1;
t.lastGlobalRegionID = 0;
for (;0 != p.length; ) {
if (-1 != e.maxOpenList && p.length > e.maxOpenList) return i;
var T = p.shift();
T.isClosed = !0;
_.addToClosed(T);
var w = T.tile;
if (T.equals(m)) return t.backTracePath(m, i, e.endToStartPath);
if (e.useGlobalPathLock) {
if (w.region.regionPathID < t.lastGlobalRegionID && -1 != w.region.regionPathID) {
T.isClosed = !0;
_.addToClosed(T);
continue;
}
w.region.regionPathID > t.lastGlobalRegionID && (t.lastGlobalRegionID = w.region.regionPathID);
}
var B = g != n.DiagonalMovement.Never ? w.neighboursAll : w.neighbours;
try {
for (var k = (s = void 0, o(B)), A = k.next(); !A.done; A = k.next()) {
var S = A.value, x = _.m_nodes[S.x][S.y];
if (!(x.isClosed || S.type.block && !e.block)) {
if (e.useGlobalPathLock) {
if (S.region.regionPathID < t.lastGlobalRegionID && -1 != S.region.regionPathID) {
T.isClosed = !0;
_.addToClosed(T);
continue;
}
S.region.regionPathID > t.lastGlobalRegionID && (t.lastGlobalRegionID = S.region.regionPathID);
if (!(S.region.usedByPathLock || null !== (u = null === (c = S.edge_region_right) || void 0 === c ? void 0 : c.usedByPathLock) && void 0 !== u && u || null !== (h = null === (d = S.edge_region_up) || void 0 === d ? void 0 : d.usedByPathLock) && void 0 !== h && h)) {
T.isClosed = !0;
_.addToClosed(T);
continue;
}
}
if (b) {
if (!S.isGoodForBoat()) continue;
} else {
if (S.type.lava && !e.lava) continue;
if (!(e.block && S.type.block || e.lava && S.type.lava)) if (e.ground && e.water) {
if (!S.type.ground && !S.type.water) continue;
} else if (!S.type.ground && e.ground || !S.type.water && e.water) continue;
}
var C = 1;
e.roads && r.default.inst.getTileSimple(x.x, x.y).type.road && (C = .01);
if (a.default.SystemSplitAstar && t.lastGlobalRegionID >= 2) {
t.result_split_path = !0;
return t.backTracePath(T, i, e.endToStartPath);
}
var O = T.startToCurNodeLen + C * (x.x - T.x == 0 || x.y - T.y == 0 ? 1 : 1.414);
if (!x.isOpened || O < x.startToCurNodeLen) {
x.startToCurNodeLen = O;
0 == x.heuristicCurNodeToEndLen && (x.heuristicCurNodeToEndLen = v * y(Math.abs(x.x - m.x), Math.abs(x.y - m.y)));
x.heuristicStartToEndLen = x.startToCurNodeLen + x.heuristicCurNodeToEndLen;
x.parent = T;
if (!x.isOpened) {
p.push(x);
x.isOpened = !0;
_.addToClosed(x);
}
}
}
}
} catch (t) {
s = {
error: t
};
} finally {
try {
A && !A.done && (l = k.return) && l.call(k);
} finally {
if (s) throw s.error;
}
}
}
return i;
};
t.lastGlobalRegionID = 0;
t.result_split_path = !1;
return t;
}();
i.default = s;
cc._RF.pop();
}, {
"../../DebugConfig": "DebugConfig",
"../../MapBox": "MapBox",
"./StaticGrid": "StaticGrid"
} ],
AStarParam: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "60a56tg8VFPvZkcSfEqijns", "AStarParam");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
});
Object.defineProperty(i, "__esModule", {
value: !0
});
i.ParamBase = i.Heuristic = i.HeuristicMode = void 0;
var r, n = t("./StaticGrid");
(function(t) {
t[t.MANHATTAN = 0] = "MANHATTAN";
t[t.EUCLIDEAN = 1] = "EUCLIDEAN";
t[t.CHEBYSHEV = 2] = "CHEBYSHEV";
})(r = i.HeuristicMode || (i.HeuristicMode = {}));
var s = function() {
function t() {}
t.manhattan = function(t, e) {
return t + e;
};
t.euclidean = function(t, e) {
var i = t, o = e;
return Math.sqrt(i * i + o * o);
};
t.chebyshev = function(t, e) {
return Math.max(t, e);
};
return t;
}();
i.Heuristic = s;
var l = function() {
function t() {
this.m_searchGrid = null;
this.m_startNode = null;
this.m_endNode = null;
this.m_heuristic = null;
}
Object.defineProperty(t.prototype, "heuristicFunc", {
get: function() {
return this.m_heuristic;
},
enumerable: !1,
configurable: !0
});
Object.defineProperty(t.prototype, "searchGrid", {
get: function() {
return this.m_searchGrid;
},
enumerable: !1,
configurable: !0
});
Object.defineProperty(t.prototype, "startNode", {
get: function() {
return this.m_startNode;
},
enumerable: !1,
configurable: !0
});
Object.defineProperty(t.prototype, "endNode", {
get: function() {
return this.m_endNode;
},
enumerable: !1,
configurable: !0
});
t.prototype.setGrid = function(t, e, i) {
this.m_searchGrid = t;
this.m_startNode = this.m_searchGrid.getNodeAt(e.x, e.y);
this.m_endNode = this.m_searchGrid.getNodeAt(i.x, i.y);
this.m_startNode || (this.m_startNode = new n.ASNode(e.x, e.y, !0));
this.m_endNode || (this.m_endNode = new n.ASNode(i.x, i.y, !0));
};
t.prototype._reset = function(t, e, i) {
void 0 === i && (i = null);
};
t.prototype.reset = function(t, e, i) {
void 0 === i && (i = null);
this._reset(t, e, i);
this.m_startNode = null;
this.m_endNode = null;
i && (this.m_searchGrid = i);
this.m_searchGrid.reset();
this.m_startNode = this.m_searchGrid.getNodeAt(t.x, t.y);
this.m_endNode = this.m_searchGrid.getNodeAt(e.x, e.y);
this.m_startNode || (this.m_startNode = new n.ASNode(t.x, t.y, !0));
this.m_endNode || (this.m_endNode = new n.ASNode(e.x, e.y, !0));
};
t.prototype.setHeuristic = function(t) {
this.m_heuristic = null;
switch (t) {
case r.MANHATTAN:
this.m_heuristic = s.manhattan;
break;

case r.EUCLIDEAN:
this.m_heuristic = s.euclidean;
break;

case r.CHEBYSHEV:
this.m_heuristic = s.chebyshev;
break;

default:
this.m_heuristic = s.euclidean;
}
};
return t;
}();
i.ParamBase = l;
var c = function(t) {
a(e, t);
function e() {
var e = null !== t && t.apply(this, arguments) || this;
e.weight = 0;
e.maxOpenList = -1;
e.roads = !1;
e.useGlobalPathLock = !1;
e.boat = !1;
e.limit = !1;
e.water = !1;
e.lava = !1;
e.block = !1;
e.ground = !1;
e.endToStartPath = !1;
return e;
}
e.prototype.resetParam = function() {
this.roads = !1;
this.water = !1;
this.lava = !1;
this.ground = !1;
this.useGlobalPathLock = !1;
this.boat = !1;
this.limit = !1;
this.endToStartPath = !1;
};
return e;
}(l);
i.default = c;
cc._RF.pop();
}, {
"./StaticGrid": "StaticGrid"
} ],
AchievementItem: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "74df44zpAxKSKfWYbfWzuAu", "AchievementItem");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
}), r = this && this.__decorate || function(t, e, i, o) {
var a, r = arguments.length, n = r < 3 ? e : null === o ? o = Object.getOwnPropertyDescriptor(e, i) : o;
if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) n = Reflect.decorate(t, e, i, o); else for (var s = t.length - 1; s >= 0; s--) (a = t[s]) && (n = (r < 3 ? a(n) : r > 3 ? a(e, i, n) : a(e, i)) || n);
return r > 3 && n && Object.defineProperty(e, i, n), n;
};
Object.defineProperty(i, "__esModule", {
value: !0
});
var n = t("../../../../common/src/data/AchievData"), s = cc._decorator, l = s.ccclass, c = s.property, u = function(t) {
a(e, t);
function e() {
var e = null !== t && t.apply(this, arguments) || this;
e.title = null;
e.desc = null;
e.icon = null;
e.btnReward = null;
e.atlas = null;
e.callback = null;
e.clicked = !1;
return e;
}
e.prototype.start = function() {};
e.prototype.click = function() {
if (this.callback && !this.clicked) {
this.clicked = !0;
this.callback();
}
};
e.prototype.updateItem = function(t, e) {
this.clicked = !1;
this.callback = e;
var i = n.default.getConfigByID(t.id);
this.title.string = t.name;
this.desc.string = i.desc;
this.btnReward.active = !t.awarded;
this.btnReward.getChildByName("btn").active = t.complete;
this.btnReward.getChildByName("label").active = !t.complete;
var o = this.atlas.getSpriteFrame("propIcon-icon" + i.icon);
o && (this.icon.spriteFrame = o);
};
r([ c(cc.Label) ], e.prototype, "title", void 0);
r([ c(cc.Label) ], e.prototype, "desc", void 0);
r([ c(cc.Sprite) ], e.prototype, "icon", void 0);
r([ c(cc.Node) ], e.prototype, "btnReward", void 0);
r([ c(cc.SpriteAtlas) ], e.prototype, "atlas", void 0);
return r([ l ], e);
}(cc.Component);
i.default = u;
cc._RF.pop();
}, {
"../../../../common/src/data/AchievData": void 0
} ],
AchievementToast: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "a4da5J1KK1FIoLMJPWGkv6k", "AchievementToast");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
}), r = this && this.__decorate || function(t, e, i, o) {
var a, r = arguments.length, n = r < 3 ? e : null === o ? o = Object.getOwnPropertyDescriptor(e, i) : o;
if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) n = Reflect.decorate(t, e, i, o); else for (var s = t.length - 1; s >= 0; s--) (a = t[s]) && (n = (r < 3 ? a(n) : r > 3 ? a(e, i, n) : a(e, i)) || n);
return r > 3 && n && Object.defineProperty(e, i, n), n;
};
Object.defineProperty(i, "__esModule", {
value: !0
});
var n = t("../../../../common/src/data/AchievData"), s = cc._decorator, l = s.ccclass, c = s.property, u = function(t) {
a(e, t);
function e() {
var e = null !== t && t.apply(this, arguments) || this;
e.title = null;
e.desc = null;
e.icon = null;
e.atlas = null;
e.callback = null;
return e;
}
e.prototype.start = function() {
var t = this;
this.node.y = .8 * cc.winSize.height;
cc.tween(this.node).to(.3, {
y: .35 * cc.winSize.height
}, {
easing: "backOut"
}).delay(2).to(.3, {
y: .8 * cc.winSize.height
}, {
easing: "backOut"
}).call(function() {
t.node.destroy();
t.callback && t.callback();
}).start();
};
e.prototype.show = function(t, e) {
this.callback = e;
var i = n.default.getConfigByID(t.id);
this.title.string = t.name;
this.desc.string = i.desc;
var o = this.atlas.getSpriteFrame("propIcon-icon" + i.icon);
o && (this.icon.spriteFrame = o);
};
r([ c(cc.Label) ], e.prototype, "title", void 0);
r([ c(cc.Label) ], e.prototype, "desc", void 0);
r([ c(cc.Sprite) ], e.prototype, "icon", void 0);
r([ c(cc.SpriteAtlas) ], e.prototype, "atlas", void 0);
return r([ l ], e);
}(cc.Component);
i.default = u;
cc._RF.pop();
}, {
"../../../../common/src/data/AchievData": void 0
} ],
AchievementView: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "95ab95CWHVOzqdT0XCWe+mo", "AchievementView");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
}), r = this && this.__decorate || function(t, e, i, o) {
var a, r = arguments.length, n = r < 3 ? e : null === o ? o = Object.getOwnPropertyDescriptor(e, i) : o;
if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) n = Reflect.decorate(t, e, i, o); else for (var s = t.length - 1; s >= 0; s--) (a = t[s]) && (n = (r < 3 ? a(n) : r > 3 ? a(e, i, n) : a(e, i)) || n);
return r > 3 && n && Object.defineProperty(e, i, n), n;
};
Object.defineProperty(i, "__esModule", {
value: !0
});
var n = t("../../../../../framework/main/Constants"), s = t("../../../../../framework/utils/Tools"), l = t("../../../../common/src/advert/AdsManager"), c = t("../../../../common/src/advert/sdk/GameTdd"), u = t("../../../../common/src/data/AchievData"), d = t("../../../../common/src/data/RewardData"), h = t("../../../../common/src/data/UserData"), p = t("../../../../common/src/GamePopBase"), f = t("../../../../common/src/module/scrollView/List"), m = t("../../common/ViewController"), y = t("../audio/GameAudio"), _ = t("../guide/GuideController"), g = t("../reward/AdView"), v = t("../reward/AwardView"), b = t("./AchievementItem"), T = cc._decorator, w = T.ccclass, B = T.property, k = function(t) {
a(e, t);
function e() {
var e = null !== t && t.apply(this, arguments) || this;
e.percent = null;
e.progressBar = null;
e.btnRewards = [];
e.scrollView = null;
e.pbItem = null;
e.pageIdx = 0;
e.datas = [];
e.totalCfg = [ 5, 20, 40, 60 ];
e.totalRewardID = [ 1, 1, 1, 1 ];
e.guiding = !1;
return e;
}
i = e;
e.prototype.onLoad = function() {
i.inst = this;
u.default.dispatcher.on(u.default.eventName, this.updateList, this);
l.default.preloadNativeAd();
};
e.prototype.onDestroy = function() {
u.default.dispatcher.off(u.default.eventName, this);
};
e.prototype.open = function() {
t.prototype.open.call(this, function() {});
this.updateList();
};
e.prototype.onClickToggle = function(t, e) {
var i = parseInt(e);
if (i != this.pageIdx) {
y.default.playClick();
this.pageIdx = i;
this.updateList();
}
};
e.prototype.updateTop = function() {
var t = u.default.getAchievCount() || 1, e = u.default.getCompleteCount() || 0;
this.percent.string = "成就进度：" + e + " / " + t;
t > 0 && (this.progressBar.progress = e / t);
for (var i = 0; i < this.btnRewards.length; i++) {
this.btnRewards[i].active = e >= this.totalCfg[i];
this.btnRewards[i].parent.active = !h.default.member.achievTotal[i];
}
};
e.prototype.updateList = function() {
switch (this.pageIdx) {
case 0:
this.datas[this.pageIdx] = u.default.getRecommendedList();
break;

case 1:
this.datas[this.pageIdx] = u.default.getAchievingList();
break;

case 2:
this.datas[this.pageIdx] = u.default.getCompleteList(!0);
}
this.scrollView.getComponent(f.default).numItems = this.datas[this.pageIdx].length;
this.updateTop();
_.default.inst.in(_.GUIDE_TYPE.achiev, 2) && _.default.inst.do(_.GUIDE_TYPE.achiev);
};
e.prototype.updateItem = function(t, e) {
var i = this;
if (!(this.datas[this.pageIdx].length <= e)) {
var o = this.datas[this.pageIdx][e], a = u.default.getConfigByID(o.id);
t.getComponent(b.default).updateItem(o, function() {
if (u.default.award(o.id)) {
var t = [], e = h.default.getPropConfigByID(n.default.MODE == n.MODE_TYPE.LOCK ? 1002 : a.propID), r = s.default.fromJson(e, new h.PropConfig());
if (r) {
var d = n.default.MODE == n.MODE_TYPE.LOCK ? a.times : a.times + .2;
r.number = Math.floor(e.reward * d);
t.push(r);
}
m.default.open(m.view_type.AwardView, null, null, !0, function(e) {
e.getComponent(v.default).init(v.Reward_type.achiev, t);
});
var p = c.default.getData("p1", c.v_type.Number), f = null != p ? p : .5;
OPPO_GAME ? i.scheduleOnce(function() {
var e = l.default.getNativeAdData();
e && m.default.open(m.view_type.AdView, null, null, !1, function(i) {
i.getComponent(g.default).init(!0, t, e);
}, function() {
l.default.preloadNativeAd();
});
}, f) : QQ_GAME && i.scheduleOnce(function() {
l.default.showInterstitialAd(function() {});
}, f);
}
});
}
};
e.prototype.getTotalReward = function(t, e) {
var i = parseInt(e), o = this.totalRewardID[i];
m.default.open(m.view_type.AwardView, null, null, !0, function(t) {
t.getComponent(v.default).init(v.Reward_type.achiev, n.default.MODE == n.MODE_TYPE.LOCK ? d.default.getLockPropConfig(2) : o);
});
h.default.member.achievTotal[i] = !0;
h.default.save();
this.updateTop();
};
var i;
e.inst = null;
r([ B(cc.Label) ], e.prototype, "percent", void 0);
r([ B(cc.ProgressBar) ], e.prototype, "progressBar", void 0);
r([ B([ cc.Node ]) ], e.prototype, "btnRewards", void 0);
r([ B(cc.ScrollView) ], e.prototype, "scrollView", void 0);
r([ B(cc.Prefab) ], e.prototype, "pbItem", void 0);
return i = r([ w ], e);
}(p.GamePopBase);
i.default = k;
cc._RF.pop();
}, {
"../../../../../framework/main/Constants": void 0,
"../../../../../framework/utils/Tools": void 0,
"../../../../common/src/GamePopBase": void 0,
"../../../../common/src/advert/AdsManager": void 0,
"../../../../common/src/advert/sdk/GameTdd": void 0,
"../../../../common/src/data/AchievData": void 0,
"../../../../common/src/data/RewardData": void 0,
"../../../../common/src/data/UserData": void 0,
"../../../../common/src/module/scrollView/List": void 0,
"../../common/ViewController": "ViewController",
"../audio/GameAudio": "GameAudio",
"../guide/GuideController": "GuideController",
"../reward/AdView": "AdView",
"../reward/AwardView": "AwardView",
"./AchievementItem": "AchievementItem"
} ],
ActionLibrary: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "17de8aMOllMJbI3h7LZfy06", "ActionLibrary");
Object.defineProperty(i, "__esModule", {
value: !0
});
var o = t("../../../common/src/data/AchievData"), a = t("../assetLibrary/AssetManager"), r = t("../brush/Brush"), n = t("../common/ToolBox"), s = t("../common/ViewController"), l = t("../Config"), c = t("../map/map/MapLayer"), u = t("../map/tile/TileType"), d = t("../MapBox"), h = t("./ActorStatus"), p = t("./ActorTool"), f = t("./other/Tornado"), m = function() {
function t() {}
t.pyromaniacEffect = function(e, i) {
var o, a, r, s, l, c, u, d;
void 0 === i && (i = null);
if (!e.kingdom) return !1;
if (!e.currentTile) return !1;
if (!(null === (a = null === (o = e.a) || void 0 === o ? void 0 : o.attackTarget) || void 0 === a ? void 0 : a.currentTile)) return !1;
if (n.Toolbox.randomChance(.95)) return !1;
var h = n.Toolbox.randomChance(.5) && (null === (r = e.a) || void 0 === r ? void 0 : r.attackTarget) ? p.default.getTileNearby(p.ActorTileTarget.RandomTileWithCivStructures, null === (u = null === (c = null === (l = e.a) || void 0 === l ? void 0 : l.attackTarget) || void 0 === c ? void 0 : c.currentTile) || void 0 === u ? void 0 : u.chunk) : p.default.getTileNearby(p.ActorTileTarget.RandomTileWithCivStructures, null === (s = e.currentTile) || void 0 === s ? void 0 : s.chunk);
if (!h) return !1;
if (!t.canThrowBomb(e, h)) return !1;
if ((null === (d = h.zone.city) || void 0 === d ? void 0 : d.kingdom) && !e.kingdom.isEnemy(h.zone.city.kingdom)) return !1;
t.throwTorchAtTile(e, h);
return !0;
};
t.throwTorchAtTile = function(t, e) {
var i = cc.v3(e.pos), o = cc.Vec2.distance(t.currentPosition, i), a = n.Toolbox.getNewPoint(t.currentPosition.x, t.currentPosition.y, i.x, i.y, o), r = n.Toolbox.getNewPoint(t.currentPosition.x, t.currentPosition.y, i.x, i.y, t.a.curStats.size);
r.y += .5;
d.default.inst.stackEffects.startProjectile(r, a, "torch");
};
t.bombermanEffect = function(e, i) {
var o, a, r;
void 0 === i && (i = null);
if (n.Toolbox.randomChance(.98) || !(null === (o = null == e ? void 0 : e.a) || void 0 === o ? void 0 : o.currentPosition) || !(null === (r = null === (a = null == e ? void 0 : e.a) || void 0 === a ? void 0 : a.attackTarget) || void 0 === r ? void 0 : r.currentPosition)) return !1;
var s = null;
e.a.attackTarget && n.Toolbox.distVec3(e.a.currentPosition, e.a.attackTarget.currentPosition) > 4 && (s = e.a.attackTarget.currentTile);
if (!s && n.Toolbox.randomChance(.5) && (s = p.default.getTileNearby(p.ActorTileTarget.RandomTileWithUnits, e.currentTile.chunk))) {
var l = !1;
s.chunk.k_dict_objects.forEach(function(t, i) {
if (!i.isNature() && e.kingdom.isEnemy(i)) {
s = e.currentTile;
l = !0;
}
});
l || (s = null);
}
!s && n.Toolbox.randomChance(.5) && (s = p.default.getTileNearby(p.ActorTileTarget.RandomTNT, e.currentTile.chunk));
s || (s = p.default.getTileNearby(p.ActorTileTarget.RandomBurnableTile, e.currentTile.chunk));
if (!s) return !1;
if (!t.canThrowBomb(e, s)) return !1;
t.throwBombAtTile(e, s);
return !0;
};
t.canThrowBomb = function(t, e) {
void 0 === e && (e = null);
var i = n.Toolbox.distVec2Float(cc.v2(t.a.currentPosition), e.pos);
return i > 3 && i < 26;
};
t.throwBombAtTile = function(t, e) {
void 0 === e && (e = null);
var i = cc.v3(e.pos), o = cc.Vec2.distance(t.currentPosition, i), a = n.Toolbox.getNewPoint(t.currentPosition.x, t.currentPosition.y, i.x, i.y, o), r = n.Toolbox.getNewPoint(t.currentPosition.x, t.currentPosition.y, i.x, i.y, t.a.curStats.size);
r.y += .5;
d.default.inst.stackEffects.startProjectile(r, a, "firebomb");
};
t.zombieEffect = function(t, e) {
void 0 === e && (e = null);
t.a.spawnParticle(n.Toolbox.color_infected);
n.Toolbox.randomChance(.25) && t.a.startShake(.2, .05, !0, !1);
return !0;
};
t.infectedEffect = function(t, e) {
void 0 === e && (e = null);
t.a.spawnParticle(n.Toolbox.color_infected);
t.a.startShake(.4, .2, !0, !1);
if (n.Toolbox.randomChance(.05)) {
var i = t.a.data.health / 10;
t.a.getHit(Math.max(i, 100));
}
return !0;
};
t.mushSporesEffect = function(t, e) {
void 0 === e && (e = null);
d.default.inst.getObjectsInChunks(e, 3, c.MapObjectType.Actor);
d.default.inst.temp_map_objects.shuffle();
for (var i = 3, o = 0; o < d.default.inst.temp_map_objects.length; o++) {
var a = d.default.inst.temp_map_objects[o];
if (a != t.a && !n.Toolbox.randomChance(.7) && a.addTrait("mushSpores")) {
a.spawnParticle(n.Toolbox.color_mushSpores);
if (0 == --i) break;
}
}
return !0;
};
t.tumorEffect = function(t, e) {
void 0 === e && (e = null);
t.a.startShake(.4, .2, !0, !1);
n.Toolbox.randomChance(.1) && t.a.getHit(.1 * t.a.curStats.health, !1, h.AttackType.Tumor, null, !1);
return !0;
};
t.healingAuraEffect = function(t, e) {
void 0 === e && (e = null);
if (n.Toolbox.randomChance(.2)) {
d.default.inst.getObjectsInChunks(e, 4, c.MapObjectType.Actor);
d.default.inst.temp_map_objects.forEach(function(e) {
var i = e;
if (i != t.a && i.data.health < i.curStats.health) {
i.restoreHealth(10);
i.spawnParticle(n.Toolbox.color_heal);
i.removeTrait("plague");
}
});
}
return !0;
};
t.regenerationEffect = function(t, e) {
void 0 === e && (e = null);
if (t.a.haveTrait("infected")) return !0;
var i = !0;
t.a.stats.needFood && (i = t.a.data.hunger > 0);
if (t.a.data.health != t.a.curStats.health && i && n.Toolbox.randomChance(.2)) {
t.a.restoreHealth(1);
t.a.spawnParticle(n.Toolbox.color_heal);
}
return !0;
};
t.coldAuraEffect = function(t, e) {
void 0 === e && (e = null);
d.default.inst.drawWithBrush(t.currentTile.pos, r.default.getBrushBySize(4), 100, "temperatureMinus");
return !0;
};
t.plagueEffect = function(e, i) {
void 0 === i && (i = null);
t.tickPlagueInfection(e.a);
e.a.startShake(.4, .2, !0, !1);
n.Toolbox.randomChance(.07) && e.a.getHit(.1 * e.a.curStats.health, !1, h.AttackType.Plague, null, !1);
return !0;
};
t.ratEffect = function(e, i) {
void 0 === i && (i = null);
n.Toolbox.randomChance(.7) && p.default.countRatsNearby(e.a) > 10 && n.Toolbox.randomChance(.2) && t.tickPlagueInfection(e.a);
return !0;
};
t.tickPlagueInfection = function(t) {
t.spawnParticle(n.Toolbox.color_plague);
n.Toolbox.randomChance(.05) && t.currentTile.chunk.k_dict_objects.forEach(function(e) {
e.forEach(function(e) {
var i;
e.objectType != c.MapObjectType.Actor || null === (i = e.base_data) || void 0 === i || !i.alive || n.Toolbox.randomBool() || n.Toolbox.distVec3(t.currentPosition, e.currentPosition) > 6 || e.a.addTrait("plague");
});
});
};
t.burningFeetEffect = function(t, e) {
void 0 === e && (e = null);
d.default.inst.drawWithBrush(t.currentTile.pos, r.default.getBrushBySize(4), 100, "burningFeetEffect");
t.a.isInWater() || t.currentTile.setFire(!0);
t.currentTile.neighbours.forEach(function(t) {
t.setFire();
t.setBurned();
});
return !0;
};
t.iconFlowerPrintsEffect = function(t, e) {
void 0 === e && (e = null);
if (!n.Toolbox.randomChance(.3)) return !1;
var i = t.a.currentTile;
if (!i.type.canGrowFlowers) return !1;
d.default.inst.terraformTile2(i, u.TileType.get(i.type.flowersTypeID), a.default.terraform.get("flash"));
return !0;
};
t.castSpawnSkeleton = function(e, i) {
var o;
void 0 === i && (i = null);
e && (i = e.currentTile);
n.Toolbox.findSameUnitInChunkAround(i.chunk, "skeleton");
if (n.Toolbox.temp_list_units.length > 6) return !1;
var a = null === (o = null == i ? void 0 : i.region) || void 0 === o ? void 0 : o.tiles.getRandom();
if (!a) return !1;
t.spawnSkeleton(null, a);
return !0;
};
t.spawnSkeleton = function(t, e) {
void 0 === e && (e = null);
if (e) return !1;
d.default.inst.stackEffects.get("fx_create_skeleton").spawnAt(e.posV3, .1).setCallback(19, function() {
d.default.inst.createNewUnit("skeleton", e).makeWait(1);
});
return !0;
};
t.castFire = function(t, e) {
void 0 === e && (e = null);
t && (e = t.currentTile);
if (!e) return !1;
d.default.inst.dropManager.spawn(e, "fire", 15);
for (var i = 0; i < 3; i++) d.default.inst.dropManager.spawn(e.neighboursAll.getRandom(), "fire", 15);
return !0;
};
t.castBloodRain = function(t, e) {
void 0 === e && (e = null);
t && (e = t.currentTile);
if (!e) return !1;
d.default.inst.dropManager.spawn(e, "bloodRain", 15);
return !0;
};
t.castSpawnSeeds = function(t, e) {
void 0 === e && (e = null);
e || (e = t.currentTile);
if (!e) return !1;
d.default.inst.dropManager.spawn(e, "seeds", 15);
return !0;
};
t.castCurses = function(t, e) {
void 0 === e && (e = null);
if (!e) return !1;
d.default.inst.dropManager.spawn(e, "curse", 15);
return !0;
};
t.castLightning = function(t, e) {
void 0 === e && (e = null);
t && (e = t.currentTile);
d.default.spawnLightning(e, .15);
return !0;
};
t.castTornado = function(t, e) {
void 0 === e && (e = null);
t && (e = t.currentTile);
if (!e) return !1;
d.default.inst.createNewUnit("tornado", e).getComponent(f.default).resizeTornado(f.default.TORNADO_SCALE_DEFAULT / 3);
return !0;
};
t.createBlueOrbs = function(t, e) {
void 0 === e && (e = null);
t && (e = t.currentTile);
var i = cc.v3(e.posV3.x, e.posV3.y);
e.region.tiles.forEach(function(t) {
n.Toolbox.randomChance(.1) && d.default.inst.stackEffects.startProjectile(i, t.posV3, "blue_orb_small");
});
return !0;
};
t.castCure = function(t, e) {
void 0 === e && (e = null);
e && (e = t.currentTile);
if (!e) return !1;
d.default.inst.dropManager.spawn(e, "cure", 15);
return !0;
};
t.castShieldOnHimself = function(e, i) {
void 0 === i && (i = null);
return t.addShieldEffectOnTarget(e);
};
t.addShieldEffectOnTarget = function(t, e) {
void 0 === e && (e = null);
if (t.a.activeStatus_dict.has("shield")) return !1;
t.a.addStatusEffect("shield", 30);
return !0;
};
t.addBurningEffectOnTarget = function(t, e) {
void 0 === e && (e = null);
if (t.isBuilding() && t.b.stats.burnable) {
t.addStatusEffect("burning");
"tumor" == t.stats.id && o.default.update(46);
return !0;
}
if (t.isActor()) {
t.addStatusEffect("burning");
return !0;
}
return !1;
};
t.addFrozenEffectOnTarget20 = function(e, i) {
void 0 === i && (i = null);
return !!n.Toolbox.randomChance(.2) && t.addFrozenEffectOnTarget(e, i);
};
t.addFrozenEffectOnTarget = function(t, e) {
void 0 === e && (e = null);
if (t.isBuilding()) return !1;
t.addStatusEffect("frozen");
return !0;
};
t.addSlowEffectOnTarget20 = function(e, i) {
void 0 === i && (i = null);
return !!n.Toolbox.randomChance(.2) && t.addSlowEffectOnTarget(e, i);
};
t.addSlowEffectOnTarget = function(t, e) {
void 0 === e && (e = null);
if (t.isBuilding()) return !1;
t.addStatusEffect("slowness");
return !0;
};
t.increaseDroppedBombsCounter = function(t, e) {
void 0 === t && (t = null);
void 0 === e && (e = "");
o.default.update(65, d.default.inst.gameStats.bombsDropped++, !0);
};
t.mageDeath = function(t, e) {
var i, o, a;
void 0 === e && (e = null);
if (t.isActor() && (null === (i = t.a) || void 0 === i ? void 0 : i.attackedBy)) {
null === (a = null === (o = t.a.attackedBy) || void 0 === o ? void 0 : o.a) || void 0 === a || a.addTrait("mageslayer");
return !0;
}
return !1;
};
t.tryToGrowTree = function(t, e) {
void 0 === e && (e = null);
e.type.canGrowGreens && d.default.inst.growGreens(e);
d.default.inst.tryGrowPlant(e);
return !0;
};
t.tryToCreateFlowers = function(t, e) {
void 0 === e && (e = null);
e.type.canGrowFlowers && d.default.inst.terraformTile2(e, u.TileType.get(e.type.flowersTypeID), a.default.terraform.get("flash"));
return !0;
};
t.startNuke = function(t, e) {
void 0 === e && (e = null);
t.a.findCurrentTile();
d.default.inst.stackEffects.spawnNukeFlash(e, "atomicBomb");
return !0;
};
t.fireBlood = function(t, e) {
void 0 === e && (e = null);
for (var i = 0; i < 5; i++) n.Toolbox.randomBool() && d.default.inst.dropManager.spawnBurstPixel(t.a.currentTile, "fire", 0, n.Toolbox.randomFloat(.6, 1.1), .3, .15);
return !0;
};
t.teleportRandom = function(t, e) {
var i;
void 0 === e && (e = null);
var o = null === (i = d.default.inst.islandsCalculator.getRandomIslandGround()) || void 0 === i ? void 0 : i.regions.getRandom().tiles.getRandom();
if (!o) return !1;
if (o.type.block) return !1;
if (!o.type.ground) return !1;
var a = t.a.stats.effect_teleport;
"" == a && (a = "fx_teleport_blue");
if (!d.default.inst.qualityChanger.lowRes) {
d.default.inst.stackEffects.get(a).spawnAt(t.currentPosition, t.a.curStats.scale);
var r = d.default.inst.stackEffects.get(a).spawnAt(o.posV3, t.a.curStats.scale);
r && r.spriteAnimation.setFrameIndex(9);
}
t.a.cancelAllBeh();
t.a.spawnOn(o);
return !0;
};
t.turnIntoMush = function(t, e) {
void 0 === e && (e = null);
var i = t.a;
if (!i || !i.node) return !1;
if (!i.haveTrait("mushSpores")) return !1;
if (!i.inMapBorder()) return !1;
if (!i.stats.canTurnIntoMush) return !1;
i.removeTrait("cursed");
i.removeTrait("infected");
i.removeTrait("mushSpores");
i.removeTrait("tumorInfection");
var a = d.default.inst.createNewUnit(i.stats.mushID, i.currentTile);
p.default.copyUnitToOtherUnit(i, a);
d.default.inst.qualityChanger.lowRes || d.default.inst.stackEffects.startSpawnEffect(a.currentTile);
d.default.inst.destroyActor(t);
o.default.update(44);
return !0;
};
t.turnIntoTumorMonster = function(t, e) {
void 0 === e && (e = null);
var i = t.a;
if (!i || !i.node) return !1;
if (!i.haveTrait("tumorInfection")) return !1;
if (!i.inMapBorder()) return !1;
if (!i.stats.canTurnIntoTumorMonster) return !1;
i.removeTrait("cursed");
i.removeTrait("infected");
i.removeTrait("mushSpores");
i.removeTrait("tumorInfection");
var o = d.default.inst.createNewUnit(i.stats.tumorMonsterID, i.currentTile);
p.default.copyUnitToOtherUnit(i, o);
d.default.inst.qualityChanger.lowRes || d.default.inst.stackEffects.startSpawnEffect(o.currentTile);
d.default.inst.destroyActor(t);
return !0;
};
t.turnIntoZombie = function(e, i) {
void 0 === i && (i = null);
var a = e.a;
if (!a || !a.node) return !1;
if (!a.haveTrait("infected")) return !1;
if (!a.inMapBorder()) return !1;
if (!a.stats.canTurnIntoZombie) return !1;
a.removeTrait("cursed");
a.removeTrait("infected");
a.removeTrait("mushSpores");
a.removeTrait("tumorInfection");
var r = a.stats.zombieID ? a.stats.zombieID : "zombie";
if ("dragon" == a.stats.id) {
a.removeTrait("fire_blood");
a.removeTrait("fire_proof");
o.default.update(43);
}
var s = d.default.inst.createNewUnit(r, a.currentTile);
p.default.copyUnitToOtherUnit(a, s);
s.data.firstName = "Un" + n.Toolbox.lowerCaseFirst(a.data.firstName);
d.default.inst.qualityChanger.lowRes || d.default.inst.stackEffects.startSpawnEffect(s.currentTile);
d.default.inst.destroyActor(e);
if (a.stats.animal) {
if (t.zombieList) {
t.zombieList.add(a.stats.id);
if (t.zombieList.size >= 5) {
t.zombieList = null;
o.default.update(42, 5, !0);
}
}
} else o.default.update(37);
o.default.update(71, d.default.inst.gameStats.infectedZombie++, !0);
return !0;
};
t.turnIntoSkeleton = function(t, e) {
void 0 === e && (e = null);
var i = t.a;
if (!i || !i.node) return !1;
if (!i.stats.skeletonID) return !1;
if (!i.haveTrait("cursed")) return !1;
if (!i.inMapBorder()) return !1;
var o = i.stats.skeletonID;
i.removeTrait("cursed");
i.removeTrait("infected");
i.removeTrait("mushSpores");
i.removeTrait("tumorInfection");
var a = d.default.inst.createNewUnit(o, i.currentTile);
p.default.copyUnitToOtherUnit(i, a);
a.data.firstName = "Un" + n.Toolbox.lowerCaseFirst(i.data.firstName);
d.default.inst.qualityChanger.lowRes || d.default.inst.stackEffects.startSpawnEffect(a.currentTile);
d.default.inst.destroyActor(t);
return !0;
};
t.getActorNearPos = function(t) {
var e = null, i = 0, o = 0;
d.default.inst.units.list.forEach(function(a) {
var r;
if ((null === (r = a.data) || void 0 === r ? void 0 : r.alive) && a.stats.canBeInspected && !a.isInsideSomething() && !((i = n.Toolbox.distVec2Float(cc.v2(a.currentPosition), t)) > 3) && (!e || i < o)) {
e = a;
o = i;
}
});
return e;
};
t.getActorFromTile = function(t) {
void 0 === t && (t = null);
if (!t) return null;
var e = null, i = 0, o = 0;
d.default.inst.units.list.forEach(function(a) {
var r;
if ((null === (r = a.data) || void 0 === r ? void 0 : r.alive) && a.stats.canBeInspected && !a.isInsideSomething() && !((i = n.Toolbox.distTile(a.currentTile, t)) > 3) && (!e || i < o)) {
e = a;
o = i;
}
});
return e;
};
t.inspectUnit = function(e, i) {
void 0 === e && (e = null);
void 0 === i && (i = null);
var a = e ? t.getActorFromTile(e) : d.default.inst.getActorNearCursor();
if (!a) return !1;
l.default.selectedUnit = a;
s.default.open(s.view_type.CreatureInfo);
o.default.update(17);
return !0;
};
t.inspectCity = function(t, e) {
var i;
void 0 === t && (t = null);
void 0 === e && (e = "");
if (null === (i = null == t ? void 0 : t.zone) || void 0 === i ? void 0 : i.city) {
l.default.selectedCity = t.zone.city;
s.default.open(s.view_type.CityWindow);
}
return !0;
};
t.inspectKingdom = function(t, e) {
var i, o;
void 0 === t && (t = null);
void 0 === e && (e = "");
if (null === (o = null === (i = null == t ? void 0 : t.zone) || void 0 === i ? void 0 : i.city) || void 0 === o ? void 0 : o.kingdom) {
l.default.selectedKingdom = t.zone.city.kingdom;
s.default.open(s.view_type.KingdomWindow);
}
return !0;
};
t.action_fire = function(e, i) {
void 0 === e && (e = null);
void 0 === i && (i = null);
!d.default.inst.flashEffects.contains(i) && n.Toolbox.randomChance(.2) && d.default.inst.particlesFire.spawn(i.posV3.x, i.posV3.y);
d.default.inst.getObjectsInChunks(i);
d.default.inst.temp_map_objects.forEach(function(e) {
var i, o;
(null === (i = e.base_data) || void 0 === i ? void 0 : i.alive) && !(null === (o = e.currentTile) || void 0 === o ? void 0 : o.type.water) && t.addBurningEffectOnTarget(e);
});
i.setFire(!0);
return !0;
};
t.action_growTornadoes = function(t, e) {
void 0 === t && (t = null);
void 0 === e && (e = "");
f.default.growTornados(t);
};
t.action_shrinkTornadoes = function(t, e) {
void 0 === t && (t = null);
void 0 === e && (e = "");
f.default.shrinkTornados(t);
};
t.zombieList = new Set();
return t;
}();
i.default = m;
cc._RF.pop();
}, {
"../../../common/src/data/AchievData": void 0,
"../Config": "Config",
"../MapBox": "MapBox",
"../assetLibrary/AssetManager": "AssetManager",
"../brush/Brush": "Brush",
"../common/ToolBox": "ToolBox",
"../common/ViewController": "ViewController",
"../map/map/MapLayer": "MapLayer",
"../map/tile/TileType": "TileType",
"./ActorStatus": "ActorStatus",
"./ActorTool": "ActorTool",
"./other/Tornado": "Tornado"
} ],
ActiveStatusEffect: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "1b123MDVmhGcIO/rjAcOawk", "ActiveStatusEffect");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
}), r = this && this.__decorate || function(t, e, i, o) {
var a, r = arguments.length, n = r < 3 ? e : null === o ? o = Object.getOwnPropertyDescriptor(e, i) : o;
if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) n = Reflect.decorate(t, e, i, o); else for (var s = t.length - 1; s >= 0; s--) (a = t[s]) && (n = (r < 3 ? a(n) : r > 3 ? a(e, i, n) : a(e, i)) || n);
return r > 3 && n && Object.defineProperty(e, i, n), n;
};
Object.defineProperty(i, "__esModule", {
value: !0
});
i.StatusEffect = void 0;
var n = t("../animation/SpriteAnimation"), s = t("../assetLibrary/AssetLibrary"), l = t("../base/BaseStats"), c = t("../world/WorldAction"), u = function(t) {
a(e, t);
function e() {
var e = null !== t && t.apply(this, arguments) || this;
e.action = c.default.create();
e.actionOnHit = c.default.create();
e.actionInterval = 0;
e.duration = 10;
e.texture = "";
e.random_frame = !1;
e.animated = !1;
e.animation_speed = .1;
e.animation_speed_random = 0;
e.startScale = 0;
e.targetScale = 0;
e.random_flip = !1;
e.cancelActorJob = !1;
e.baseStats = new l.default();
e.oppositeTraits = [];
e.oppositeStatus = [];
e.removeStatus = [];
e.spriteList = [];
return e;
}
return e;
}(s.Asset);
i.StatusEffect = u;
var d = cc._decorator, h = d.ccclass, p = (d.property, function(t) {
a(e, t);
function e() {
var e = null !== t && t.apply(this, arguments) || this;
e.actionTimer = 0;
e.timer = 0;
e.asset = null;
e.finished = !1;
e.simObject = null;
e.curZ = 0;
return e;
}
e.prototype.setStatus = function(t, e) {
this.asset = t;
this.simObject = e;
this.actionTimer = this.asset.actionInterval;
this.timer = this.asset.duration;
};
e.prototype.setZFlip = function(t) {
this.curZ = t;
var e = this.node.position;
e.z = t;
this.node.position = e;
};
e.prototype.updateZFlip = function() {
this.simObject.isActor() && (this.simObject.a.flip ? .01 != this.curZ && this.setZFlip(.01) : -.01 != this.curZ && this.setZFlip(-.01));
};
e.prototype.logicUpdate = function(e) {
t.prototype.logicUpdate.call(this, e);
this.updateZFlip();
if (!this.finished) {
if (0 != this.asset.actionInterval) if (this.actionTimer > 0) this.actionTimer -= e; else {
this.actionTimer = this.asset.actionInterval;
this.asset.action.isEmpty || this.asset.action.do(this.simObject, this.simObject.currentTile);
}
this.timer > 0 ? this.timer -= e : this.finished = !0;
}
};
return r([ h ], e);
}(n.SpriteAnimation));
i.default = p;
cc._RF.pop();
}, {
"../animation/SpriteAnimation": "SpriteAnimation",
"../assetLibrary/AssetLibrary": "AssetLibrary",
"../base/BaseStats": "BaseStats",
"../world/WorldAction": "WorldAction"
} ],
ActorAnimationLoader: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "2c68fo3QuZEo5SSDUh98MUO", "ActorAnimationLoader");
Object.defineProperty(i, "__esModule", {
value: !0
});
var o = t("../texture/TextureLoader"), a = t("./UnitSpriteAnimation"), r = function() {
function t() {}
t.init = function() {
o.TextureLoader.inst.getSpriteFrames(o.ATLAS_TYPE.WORLDATLAS, "actors/races/items/").forEach(function(e, i) {
t.dictItems.set(i, e);
});
};
t.getItem = function(e) {
return t.dictItems.get(e);
};
t.getHeadSpecial = function(e, i) {
var a = e + "_" + i, r = t.dictCivHeads.get(a);
if (!t.dictCivHeads.has(a)) {
o.TextureLoader.inst.getSpriteFrames(o.ATLAS_TYPE.WORLDATLAS, e).forEach(function(i, o) {
var a = e + "_" + o;
t.dictCivHeads.set(a, i);
});
r = t.dictCivHeads.get(a);
}
return r;
};
t.getHead = function(e, i) {
var a = e + "_head_" + i, r = t.dictCivHeads.get(a);
if (!r) {
o.TextureLoader.inst.getSpriteFrames(o.ATLAS_TYPE.WORLDATLAS, e).forEach(function(i, o) {
t.dictCivHeads.set(e + "_" + o, i);
});
r = t.dictCivHeads.get(a);
}
return r;
};
t.getHeadFromFullPath = function(e) {
var i = t.dictCivHeads.get(e);
if (!i) {
o.TextureLoader.inst.getSpriteFrames(o.ATLAS_TYPE.WORLDATLAS, e).forEach(function(i) {
t.dictCivHeads.set(e, i);
});
i = t.dictCivHeads.get(e);
}
return i;
};
t.loadAnimationBoat = function(e) {
if (!t.dict_boats.has(e)) {
var i = new Map(), r = o.TextureLoader.inst.getSpriteFrames(o.ATLAS_TYPE.WORLDATLAS, "actors/boats/" + e);
r.forEach(function(t, e) {
i.set(e, t);
});
var n = new a.AnimationDataBoat();
n.broken = new a.ActorAnimation();
n.broken.frames = [ i.get("broken") ];
n.normal = new a.ActorAnimation();
n.normal.frames = [ i.get("normal") ];
r.forEach(function(e, o) {
!o.includes("@1") && o.includes("@") && t.createBoatAnimationArray(n, i, o);
});
t.dict_boats.set(e, n);
}
return t.dict_boats.get(e);
};
t.createBoatAnimationArray = function(t, e, i, o) {
void 0 === o && (o = .2);
var r = parseInt(i.split("@")[0]), n = new a.ActorAnimation();
n.frames = [];
n.frames.push(e.get(r + "@0"));
n.frames.push(e.get(r + "@1"));
n.timeBetweenFrames = o;
t.dict.set(r, n);
};
t.loadAnimationUnit = function(e, i) {
if (!t.dict_units.has(e)) {
var a = t.generateAnimation(e, i);
if (i.texture_heads) {
var r = o.TextureLoader.inst.getSpriteFrames(o.ATLAS_TYPE.WORLDATLAS, i.texture_heads);
a.heads = Array.from(r.values());
}
}
return t.dict_units.get(e);
};
t.generateAnimation = function(e, i) {
var r = new a.AnimationDataUnit();
r.sprites = new Map();
o.TextureLoader.inst.getSpriteFrames(o.ATLAS_TYPE.WORLDATLAS, e).forEach(function(t, e) {
r.sprites.set(e, t);
});
r.frameData = new Map();
r.id = e;
t.generateFrameData(r, r.sprites, "walk_0,walk_1,walk_2,walk_3,swim_0,swim_1,swim_2,swim_3");
t.dict_units.set(e, r);
i.animation_swim && (r.swimming = t.createAnim(r.sprites, i.animation_swim, i.animation_swim_speed));
i.animation_walk && (r.walking = t.createAnim(r.sprites, i.animation_walk, i.animation_walk_speed));
return r;
};
t.generateFrameData = function(e, i, o) {
o.split(",").forEach(function(o) {
if (i.has(o)) {
var r = new a.AnimationFrameData();
r.id = o;
if (i.has(o + "_head")) {
var n = t.getHeadY(o) + 3;
r.posHead = cc.v2(0, n);
r.showHead = !0;
}
if (i.has(o + "_item")) {
n = t.getItemY(o);
r.posItem = cc.v2(-3.5, n);
r.showItem = !0;
}
e.frameData.set(o, r);
}
});
};
t.getHeadY = function(t) {
switch (t) {
case "walk_0":
return 6;

case "walk_1":
return 8;

case "walk_2":
return 7;

case "walk_3":
return 5;

case "swim_0":
return 4;

case "swim_1":
return 3;

case "swim_2":
return 4;

case "swim_3":
default:
return 3;
}
};
t.getItemY = function(t) {
switch (t) {
case "walk_0":
return 3.6;

case "walk_1":
return 6.5;

case "walk_2":
return 5.8;

case "walk_3":
return 3.8;

default:
return 4;
}
};
t.createAnim = function(e, i, o) {
void 0 === o && (o = .01);
var r = new a.ActorAnimation();
r.frames = t.createArray(e, i);
r.timeBetweenFrames = o;
return r;
};
t.createArray = function(t, e) {
for (var i = e.split(","), o = [], a = 0, r = 0; r < i.length; r++) if (t.has(i[a])) {
var n = t.get(i[a]);
o.push(n);
a++;
}
return o;
};
t.dict_units = new Map();
t.dict_boats = new Map();
t.dictItems = new Map();
t.dictCivHeads = new Map();
t.banner = null;
return t;
}();
i.default = r;
cc._RF.pop();
}, {
"../texture/TextureLoader": "TextureLoader",
"./UnitSpriteAnimation": "UnitSpriteAnimation"
} ],
ActorBag: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "57e03uKmwhPZYts+0q+8rwR", "ActorBag");
Object.defineProperty(i, "__esModule", {
value: !0
});
var o = function() {
function t() {
this.resource = "";
this.amount = 0;
}
t.prototype.add = function(t, e) {
this.resource = t;
this.amount += e;
};
t.prototype.empty = function() {
this.resource = "";
this.amount = 0;
};
t.prototype.getResource = function(t) {
return this.resource != t ? 0 : this.amount;
};
return t;
}();
i.default = o;
cc._RF.pop();
}, {} ],
ActorBase: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "b55cb7OxndGUqaAYA0I+YPu", "ActorBase");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
}), r = this && this.__values || function(t) {
var e = "function" == typeof Symbol && Symbol.iterator, i = e && t[e], o = 0;
if (i) return i.call(t);
if (t && "number" == typeof t.length) return {
next: function() {
t && o >= t.length && (t = void 0);
return {
value: t && t[o++],
done: !t
};
}
};
throw new TypeError(e ? "Object is not iterable." : "Symbol.iterator is not defined.");
};
Object.defineProperty(i, "__esModule", {
value: !0
});
i.ActorContainer = i.SplitPathStatus = void 0;
var n, s = t("../../../../framework/lib/prototype/MathUtils"), l = t("../../../../framework/utils/Log"), c = t("../../../common/src/GameCommon"), u = t("../ai/AiSystem"), d = t("../animation/ActorAnimationLoader"), h = t("../assetLibrary/AssetManager"), p = t("../assetLibrary/lib/ItemLibrary"), f = t("../base/BaseContainer"), m = t("../base/BaseSimObject"), y = t("../common/Globals"), _ = t("../common/ItemTools"), g = t("../common/ToolBox"), v = t("../map/generator/ItemGenerator"), b = t("../map/generator/NameGenerator"), T = t("../map/map/MapLayer"), w = t("../MapBox"), B = t("../world/WorldTimer"), k = t("./ActorBag"), A = t("./ActorEquipment"), S = t("./ActorMove"), x = t("./ActorStatus");
(function(t) {
t[t.Normal = 0] = "Normal";
t[t.Prepare = 1] = "Prepare";
t[t.Split = 2] = "Split";
})(n = i.SplitPathStatus || (i.SplitPathStatus = {}));
var C = function(t) {
a(e, t);
function e() {
return null !== t && t.apply(this, arguments) || this;
}
return e;
}(f.ObjectContainer);
i.ActorContainer = C;
var O = function(t) {
a(e, t);
function e() {
var e = null !== t && t.apply(this, arguments) || this;
e.unitGroup = null;
e.beh_tile_target = null;
e.beh_building_target = null;
e.beh_actor_target = null;
e.insideBuilding = null;
e.insideBoat = null;
e.inventory = new k.default();
e.equipment = null;
e.homeBuilding = null;
e.attackedBy = null;
e.race = null;
e.data = null;
e.professionAsset = null;
e.stats = null;
e.tempPosition = cc.Vec3.ZERO;
e.nextStepPosition = y.default.emptyVector;
e.shakeOffset = cc.Vec3.ZERO;
e.moveJumpOffset = cc.Vec3.ZERO;
e.is_moving = !1;
e.tileTarget = null;
e.nextStepTile = null;
e.split_path = null;
e.current_path = [];
e.current_path_global = [];
e.callbacks_on_death = [];
e.callbacks_landed = [];
e.callbacks_added_madness = [];
e.callbacks_cancel_path_movement = [];
e.callbacks_get_hit = [];
e.attackTarget = null;
e.timer_action = 0;
e.timer_jump_animation = 0;
e.forceTimer = null;
e.hitboxZ = 0;
e.forceVector = cc.Vec3.ZERO;
e.actorAnimationData = null;
e.current_texture = "";
e.targetsToIgnore = new Set();
e.targetsToIgnoreTimer = null;
e.flying = !1;
e._positionDirty = !1;
e.attackTimer = 0;
e.s_attackType = null;
e.s_slashType = "";
e.s_weapon_texture = "";
e.s_head_sprite = null;
e.s_attackSpeed_seconds = 0;
e.s_crit_chance = 0;
e.s_personality = null;
e.s_traits_ids = new Set();
e.s_special_effect_traits = [];
e._status_frozen = !1;
e._trait_weightless = !1;
e._trait_peaceful = !1;
e._trait_fire_resistant = !1;
e.ai = null;
e.hasItem = !1;
e._isInWater = !1;
e._is_visible = !0;
e.frameData = null;
e._currentTileDirty = !0;
e._animDirty = !0;
e.actorScale = 1;
e.targetScale = 0;
e._current_item_texture = "";
e._actionFall = !1;
e.shakeHorizontal = !0;
e.shakeVertical = !0;
e.shakeTimer = new B.default(.3, !0);
e.shakeVolume = .1;
e.rotationCooldown = 0;
e.actorSize = .1;
e.curAngle = cc.v3();
e.targetAngle = cc.v3();
e.unit_sprite_color = cc.Color.WHITE;
e.jumpTime = 0;
e.lastX = -10;
e.lastY = -10;
e.flipAngle = 0;
e.flip = !1;
e.flipScale = cc.v3(1, 1, 1);
e._timeout_targets = 0;
e.isGroupLeader = !1;
return e;
}
e.prototype.setActorSize = function(t) {
this.actorSize = t;
};
e.prototype.create = function() {
t.prototype.create.call(this);
this.ai = new u.AiSystemActor(this);
this.ai.jobs_library = h.default.job_actor;
this.ai.task_library = h.default.tasks_actor;
this.ai.nextJobDelegate = this.getNextJob.bind(this);
this.ai.jobSetStartAction = this.jobSetStartActionAction.bind(this);
this.ai.jobSetEndAction = this.jobSetEndActionAction.bind(this);
this.ai.clearAction = this.clearBeh.bind(this);
this.targetsToIgnore.clear();
this.targetsToIgnoreTimer = new B.default(3, this.clearIgnoreTargets.bind(this));
this.flying = this.stats.flying;
};
e.prototype.clearBeh = function() {
this.clearTasks();
this.beh_tile_target = null;
this.beh_building_target = null;
this.beh_actor_target = null;
};
e.prototype.jobSetStartActionAction = function() {
var t;
(null === (t = this.data) || void 0 === t ? void 0 : t.alive) && this.loadTexture();
};
e.prototype.jobSetEndActionAction = function() {
var t;
(null === (t = this.data) || void 0 === t ? void 0 : t.alive) && this.loadTexture();
};
e.prototype.getNextJob = function() {
return e.nextJobActor(this);
};
e.nextJobActor = function(t) {
var e, i, o, a, r = "";
r = (null === (e = t.stats) || void 0 === e ? void 0 : e.unit) ? (null === (o = t.stats) || void 0 === o ? void 0 : o.baby) ? "baby" : t.city ? "citizen" : null === (a = t.stats) || void 0 === a ? void 0 : a.job : null === (i = t.stats) || void 0 === i ? void 0 : i.job;
t.haveTrait("madness") && (r = "random_move");
t.haveStatus("burning") && (r = "unit_on_fire");
return r || null;
};
e.prototype.newCreature = function(t) {
void 0 === t && (t = 0);
w.default.inst.gameStats.creaturesCreated++;
this.race = h.default.raceLibrary.get(this.stats.race);
this.setData(new x.default());
this.data.actorID = w.default.inst.mapStats.getNextId("unit");
this.generatePersonality();
this.updateStats();
this.data.bornTime = t;
this.data.health = this.curStats.health;
this.data.statsID = this.stats.id;
this.stats.diet_meat ? this.data.hunger = this.stats.maxHunger / 2 : this.stats.needFood && (this.data.hunger = this.stats.maxHunger);
};
e.prototype.setData = function(e) {
this.data = e;
t.prototype.setData.call(this, e);
};
e.generateCivUnit = function(t, e, i) {
g.Toolbox.randomBool() ? e.gender = x.ActorGender.Male : e.gender = x.ActorGender.Female;
e.favoriteFood = i.preferred_food.getRandom();
e.firstName = b.default.getName(t.nameTemplate, e.gender);
};
e.prototype.generatePersonality = function() {
this.data.generateTraits(this.stats, this.race);
this.race.civilization ? e.generateCivUnit(this.stats, this.data, this.race) : this.data.firstName = b.default.getName(this.stats.nameTemplate);
if (this.stats.defaultWeapons && this.stats.defaultWeapons.length > 0) {
var t = this.stats.defaultWeapons.getRandom(), i = h.default.items.get(t), o = "base";
this.stats.defaultWeaponsMaterial.length > 0 && (o = this.stats.defaultWeaponsMaterial.getRandom());
v.default.generateItem(i, o, this.equipment.weapon, w.default.inst.mapStats.year - 10);
}
for (var a = 0; a < this.data.traits.length; ) h.default.traits.get(this.data.traits[a]) ? a++ : this.data.traits.splice(a, 1);
this.statsDirty = !0;
};
e.prototype.resetTraits = function() {
var t = this;
this.data.traits.clear();
this.s_traits_ids.clear();
this.stats.traits && this.stats.traits.forEach(function(e) {
t.addTrait(e);
});
this.statsDirty = !0;
};
e.prototype.removeTrait = function(t) {
for (var e = 0; e < this.data.traits.length; e++) if (this.data.traits[e] == t) {
this.data.traits.splice(e, 1);
break;
}
this.statsDirty = !0;
};
e.prototype.addTrait = function(t) {
var e = this;
if (this.haveTrait(t)) return !1;
if (this.haveOppositeTrait(t)) return !1;
"madness" == t && this.callbacks_added_madness.forEach(function(t) {
t(e);
});
this.data.traits.push(t);
this.statsDirty = !0;
return !0;
};
e.prototype.clearIgnoreTargets = function() {
this.targetsToIgnore.clear();
};
e.prototype.getUnitTexture = function() {
var t;
return (null === (t = this.professionAsset) || void 0 === t ? void 0 : t.special_skin_path) ? "races/" + this.stats.race + "/" + this.professionAsset.special_skin_path : this.data.gender == x.ActorGender.Female ? "races/" + this.stats.race + "/unit_female" : "races/" + this.stats.race + "/unit_male";
};
e.prototype.loadTexture = function() {
var t = this.stats.unit ? this.getUnitTexture() : this.stats.texture_path;
if (this.current_texture != t) {
this.current_texture = t;
if (this.current_texture) {
this.actorAnimationData = d.default.loadAnimationUnit("actors/" + this.current_texture, this.stats);
this._animDirty = !0;
}
}
};
e.prototype.addForce = function(t, e, i) {
if (this.stats.canBeMovedByPowers && !(this.zPosition.y > 0)) {
this.forceVector.x = .6 * t;
this.forceVector.y = .6 * e;
this.forceVector.z = 2 * i;
}
};
e.prototype.canAttackTarget = function(t) {
var e, i, o, a, r, n, s, l, c, u, d, h, f, m, y, _, g, v, b, B, k, A, S = t;
if (!(null == S ? void 0 : S.node.active)) return !1;
if (!(null === (e = null == S ? void 0 : S.base_data) || void 0 === e ? void 0 : e.alive) || !(null === (i = null == S ? void 0 : S.data) || void 0 === i ? void 0 : i.alive)) return !1;
if (!(null === (a = null === (o = null == S ? void 0 : S.a) || void 0 === o ? void 0 : o.data) || void 0 === a ? void 0 : a.alive)) return !1;
if (S.objectType == T.MapObjectType.Actor) {
if (!(null === (r = S.a) || void 0 === r ? void 0 : r.stats.canBeKilledByStuff)) return !1;
if (null === (l = null === (s = null === (n = S.a) || void 0 === n ? void 0 : n.ai) || void 0 === s ? void 0 : s.action) || void 0 === l ? void 0 : l.special_inside_object) return !1;
if (!(null === (d = null === (u = null === (c = S.a) || void 0 === c ? void 0 : c.kingdom) || void 0 === u ? void 0 : u.asset) || void 0 === d ? void 0 : d.mad) && !(null === (m = null === (f = null === (h = this.a) || void 0 === h ? void 0 : h.kingdom) || void 0 === f ? void 0 : f.asset) || void 0 === m ? void 0 : m.mad) && !w.default.inst.worldLaws.world_law_angry_civilians.boolVal) {
if ((null === (y = S.a) || void 0 === y ? void 0 : y.race) == this.race && (null === (g = null === (_ = S.a) || void 0 === _ ? void 0 : _.professionAsset) || void 0 === g ? void 0 : g.is_civilian)) return !1;
if ((null === (v = S.a) || void 0 === v ? void 0 : v.race) == this.race && this.a.professionAsset.is_civilian) return !1;
}
if ((null === (b = S.a) || void 0 === b ? void 0 : b.isInAir()) && this.s_attackType == p.WeaponType.Melee) return !1;
} else if (!this.stats.canAttackBuildings) return !!(this.stats.canAttackBrains && (null === (k = null === (B = null == S ? void 0 : S.kingdom) || void 0 === B ? void 0 : B.asset) || void 0 === k ? void 0 : k.brain));
if (this.stats.waterCreature) {
if (!S.isInWater()) return !1;
if (!(null === (A = S.currentTile) || void 0 === A ? void 0 : A.isSameIsland(this.currentTile))) return !1;
} else if (this.s_attackType == p.WeaponType.Melee && S.isInWater()) return !1;
return !0;
};
e.prototype.isInAir = function() {
return !!this.flying || this.stats.hovering;
};
e.prototype.isFlying = function() {
return this.flying;
};
e.prototype.isHovering = function() {
return this.stats.hovering;
};
e.prototype.isAffectedByWater = function() {
return !this.isInAir() && this._isInWater;
};
e.prototype.onEnable = function() {
this._is_visible = !0;
this._animDirty = !0;
this.updateAnimation(w.default.inst.elapsed);
};
e.prototype.onDisable = function() {
this._is_visible = !1;
};
e.prototype.updateAnimation = function(t, e) {
var i;
void 0 === e && (e = !1);
if (this.ai.action && this.ai.action.forceAnimation) this.spriteAnimation.applyCurrentSpriteGraphics(this.actorAnimationData.sprites.get(this.ai.action.forceAnimation)); else if (e || this._is_visible) {
if (this.actorAnimationData && this._animDirty) {
this._animDirty = !1;
if (this.isAffectedByWater()) {
var o = this.actorAnimationData;
if (o && (null === (i = o.swimming) || void 0 === i ? void 0 : i.frames.length) > 0) {
this.spriteAnimation.setFrames(this.actorAnimationData.swimming.frames);
this.spriteAnimation.timeBetweenFrames = this.actorAnimationData.swimming.timeBetweenFrames;
this.doAnimation();
return;
}
}
if (this.actorAnimationData.walking) {
this.spriteAnimation.setFrames(this.actorAnimationData.walking.frames);
this.spriteAnimation.timeBetweenFrames = this.actorAnimationData.walking.timeBetweenFrames;
}
}
this.doAnimation();
}
};
e.prototype.doAnimation = function() {
var t;
(null === (t = this.data) || void 0 === t ? void 0 : t.alive) && !this.stats.specialAnimation && this.spriteAnimation && !this.stats.animationAlwaysLooped && (this.is_moving && 0 == this.zPosition.y || this.isAffectedByWater() ? this.spriteAnimation.isOn = !0 : this.timer_jump_animation > 0 ? this.spriteAnimation.isOn = !0 : this.zPosition.y > 0 && this.spriteAnimation.isOn ? this.spriteAnimation.stopAt(2) : this.spriteAnimation.stopAt(this.stats.animation_idle));
};
e.prototype.logicUpdate = function(e) {
var i;
t.prototype.logicUpdate.call(this, e);
this.base_data.timeExists += e;
this.timer_jump_animation > 0 && (this.timer_jump_animation -= e);
(this._currentTileDirty || this.nextStepTile && g.Toolbox.distTile(this.currentTile, this.nextStepTile) > 2) && this.findCurrentTile();
var o = this.currentTile.type.liquid && 0 == this.moveJumpOffset.y && this.zPosition.y <= 0 && (null === (i = this.data) || void 0 === i ? void 0 : i.alive);
if (o != this._isInWater) {
this._animDirty = !0;
this._isInWater = o;
}
this.updateAnimation(e);
};
e.prototype.updateSpriteAnimation = function(e) {
this._is_visible && t.prototype.updateSpriteAnimation.call(this, e);
};
e.prototype.getWeaponAsset = function() {
return this.stats.use_items && !this.equipment.weapon.isEmpty() ? h.default.items.get(this.equipment.weapon.data.id) : h.default.items.get(this.stats.defaultWeapon);
};
e.prototype.updateTargetScale = function() {
if (this.node) if (this.curStats.scale > 0) {
this.targetScale = this.curStats.scale;
this.node.scale = this.targetScale;
this.actorScale = this.targetScale;
this.actorSize = this.targetScale;
} else this.targetScale = 0;
};
e.prototype.updateStats = function() {
var e, i = this;
t.prototype.updateStats.call(this);
if (null === (e = this.data) || void 0 === e ? void 0 : e.alive) {
this.data.mood || (this.data.mood = "normal");
var o = h.default.moods.get(this.data.mood);
this.curStats.clear();
this.curStats.addStats(this.stats.baseStats);
this.curStats.addStats(o.baseStats);
this.curStats.diplomacy += this.data.diplomacy;
this.curStats.stewardship += this.data.stewardship;
this.curStats.warfare += this.data.warfare;
this.activeStatusEffects.forEach(function(t) {
i.curStats.addStats(t.asset.baseStats);
});
var a = h.default.items.get(this.stats.defaultWeapon);
a && this.curStats.addStats(a.baseStats);
var r = this.getWeaponAsset();
this.s_attackType = r.attackType;
this.s_slashType = r.slash;
this.stats.use_items && !this.equipment.weapon.isEmpty() ? this.s_weapon_texture = "w_" + this.equipment.weapon.data.id + "_" + this.equipment.weapon.data.material : this.s_weapon_texture = "";
this.findHeadSprite();
this.data.traits.forEach(function(t) {
var e = h.default.traits.get(t);
e && i.curStats.addStats(e.baseStats);
});
if (this.stats.unit) {
this.s_personality = null;
if (this.kingdom && this.kingdom.isCiv() && this.kingdom.king == this || this.city && this.city.leader == this) {
var n = "balanced", l = this.curStats.diplomacy;
if (this.curStats.diplomacy > this.curStats.stewardship) {
n = "diplomat";
l = this.curStats.diplomacy;
} else if (this.curStats.diplomacy < this.curStats.stewardship) {
n = "administrator";
l = this.curStats.stewardship;
}
this.curStats.warfare > l && (n = "militarist");
this.s_personality = h.default.personalities.get(n);
this.curStats.addStats(this.s_personality.baseStats);
}
}
this._trait_weightless = this.haveTrait("weightless");
this._status_frozen = this.haveStatus("frozen");
this.curStats.damage += (this.data.level - 1) / 2;
this.curStats.armor += (this.data.level - 1) / 3;
this.curStats.crit += this.data.level - 1;
this.curStats.attackSpeed += this.data.level - 1;
this.curStats.health += 20 * (this.data.level - 1);
this.s_traits_ids.clear();
this.s_special_effect_traits.clear();
this.data.traits.forEach(function(t) {
i.s_traits_ids.add(t);
var e = h.default.traits.get(t);
e && e.action_special_effect && i.s_special_effect_traits.push(e);
});
this.checkMadness();
this._trait_peaceful = this.haveTrait("peaceful");
this._trait_fire_resistant = this.haveTrait("fire_proof");
this.stats.use_items && A.default.getList(this.equipment).forEach(function(t) {
if (t.data) {
_.default.calcItemValues(t.data);
i.curStats.addStats(_.default.s_stats);
}
});
this.curStats.normalize();
if (this.event_full_heal) {
this.event_full_heal = !1;
this.data.health = this.curStats.health;
}
this.curStats.health += s.default.intCast(this.curStats.health * (this.curStats.mod_health / 100));
this.curStats.damage += s.default.intCast(this.curStats.damage * (this.curStats.mod_damage / 100));
this.curStats.armor += s.default.intCast(this.curStats.armor * (this.curStats.mod_armor / 100));
this.curStats.crit += s.default.intCast(this.curStats.crit * (this.curStats.mod_crit / 100));
this.curStats.diplomacy += s.default.intCast(this.curStats.diplomacy * (this.curStats.mod_diplomacy / 100));
this.curStats.speed += s.default.intCast(this.curStats.speed * (this.curStats.mod_speed / 100));
this.curStats.attackSpeed += s.default.intCast(this.curStats.attackSpeed * (this.curStats.mod_attackSpeed / 100));
this.curStats.health < 1 && (this.curStats.health = 1);
this.data.health > this.curStats.health && (this.data.health = this.curStats.health);
this.data.health < 1 && (this.data.health = 1);
this.curStats.damage < 1 && (this.curStats.damage = 1);
this.curStats.speed < 1 && (this.curStats.speed = 1);
this.curStats.armor < 0 && (this.curStats.armor = 0);
this.curStats.diplomacy < 0 && (this.curStats.diplomacy = 0);
this.curStats.dodge < 0 && (this.curStats.dodge = 0);
this.curStats.accuracy < 10 && (this.curStats.accuracy = 10);
this.curStats.crit < 0 && (this.curStats.crit = 0);
this.curStats.attackSpeed < 0 && (this.curStats.attackSpeed = 1);
this.curStats.attackSpeed >= 300 && (this.curStats.attackSpeed = 300);
this.s_attackSpeed_seconds = (300 - this.curStats.attackSpeed) / (100 + this.curStats.attackSpeed);
this.s_crit_chance = this.curStats.crit / 100;
this.curStats.zones = 2 * (this.curStats.stewardship + 1);
this.curStats.cities = this.curStats.stewardship / 5 + 1;
this.curStats.army = this.curStats.warfare + 5;
this.curStats.army < 0 && (this.curStats.army = 5);
this.attackTimer = 0;
this.updateTargetScale();
this.curStats.normalize();
this.currentScale.x = this.curStats.scale;
this.currentScale.y = this.curStats.scale;
this.currentScale.z = this.curStats.scale;
}
};
e.prototype.findHeadSprite = function() {
if (this.actorAnimationData && this.stats.body_separate_part_head) {
this.s_head_sprite = null;
this.tryToLoadFunHead();
if (!this.s_head_sprite) if (this.stats.unit) {
var t = !1, e = "";
if (this.data.profession != x.UnitProfession.Warrior || this.equipment.helmet.isEmpty()) if (this.data.profession == x.UnitProfession.King) {
e = "head_king";
t = !0;
} else if (this.haveTrait("wise")) {
e = this.data.gender != x.ActorGender.Male ? "head_old_female" : "head_old_male";
t = !0;
} else e = this.data.gender != x.ActorGender.Male ? "heads_female" : "heads_male"; else {
e = "head_warrior";
t = !0;
}
if (t) {
var i = "actors/races/" + this.stats.race + "/heads_special";
this.s_head_sprite = d.default.getHeadSpecial(i, e);
} else {
i = "actors/races/" + this.stats.race + "/" + e;
this.checkHeadID();
this.s_head_sprite = d.default.getHead(i, this.data.head);
}
} else {
this.checkHeadID();
this.data.head > this.actorAnimationData.heads.length - 1 && (this.data.head = 0);
this.s_head_sprite = this.actorAnimationData.heads[this.data.head];
}
}
};
e.prototype.tryToLoadFunHead = function() {};
e.prototype.checkHeadID = function() {
if (-1 == this.data.head) {
this.loadTexture();
this.stats.unit ? this.data.head = g.Toolbox.randomInt(0, this.stats.heads) : this.data.head = g.Toolbox.randomInt(0, this.actorAnimationData.heads.length);
}
};
e.prototype.checkMadness = function() {
var t, e;
this.haveTrait("madness") && !(null === (e = null === (t = this.kingdom) || void 0 === t ? void 0 : t.asset) || void 0 === e ? void 0 : e.mad) && this.setKingdom(w.default.inst.kingdoms.dict_hidden.get("mad"));
};
e.prototype.setKingdom = function(t) {
var e;
if (this.kingdom != t) {
!t && (null === (e = this.data) || void 0 === e ? void 0 : e.alive) && l.default.d("kingdom is set... ");
this.kingdom && this.kingdom.removeUnit(this);
this.kingdom = t;
this.kingdom && this.kingdom.addUnit(this);
}
};
e.prototype.haveOppositeTrait = function(t) {
var e, i;
if (!(t = "string" == typeof t ? h.default.traits.get(t) : t)) return !1;
if (!t.oppositeArr) return !1;
var o = t.oppositeArr;
try {
for (var a = r(o), n = a.next(); !n.done; n = a.next()) {
var s = n.value;
if (this.haveTrait(s)) return !0;
}
} catch (t) {
e = {
error: t
};
} finally {
try {
n && !n.done && (i = a.return) && i.call(a);
} finally {
if (e) throw e.error;
}
}
return !1;
};
e.prototype.haveStatus = function(t) {
return !!this.activeStatus_dict.has(t);
};
e.prototype.haveTrait = function(t) {
var e, i, o;
if (null === (o = this.s_traits_ids) || void 0 === o ? void 0 : o.has(t)) return !0;
if (this.statsDirty) try {
for (var a = r(this.data.traits), n = a.next(); !n.done; n = a.next()) if (n.value == t) return !0;
} catch (t) {
e = {
error: t
};
} finally {
try {
n && !n.done && (i = a.return) && i.call(a);
} finally {
if (e) throw e.error;
}
}
return !1;
};
e.prototype.inMapBorder = function() {
return !(this.currentPosition.x > w.default.width || this.currentPosition.y > w.default.height || this.currentPosition.x < 0 || this.currentPosition.y < 0);
};
e.prototype.updateForce = function(t) {
if (0 != this.forceVector.x || 0 != this.forceVector.y || 0 != this.forceVector.z) {
t *= .6;
this._positionDirty = !0;
this.zPosition.y += this.forceVector.z * t * 40;
0 != this.forceVector.x && (this.currentPosition.x += this.forceVector.x * t * 40);
0 != this.forceVector.y && (this.currentPosition.y += this.forceVector.y * t * 40);
this.zPosition.y < 0 && (this.zPosition.y = 0);
this.forceVector.z -= 5 * t;
if (this.forceVector.z <= 0 && this.zPosition.y <= 0) {
this.forceVector.z = 0;
this.forceVector.x = 0;
this.forceVector.y = 0;
this._actionFall = !0;
}
}
};
e.prototype.actionLanded = function() {
var t = this;
this.updateAnimation(0);
this._positionDirty = !0;
this._currentTileDirty = !0;
this.callbacks_landed.forEach(function(e) {
e(t);
});
};
e.prototype.updateFall = function(t) {
if (!(this.zPosition.y < 0)) {
t *= .6;
this.zPosition.y -= 25 * t;
if (this.zPosition.y <= 0) {
this.zPosition.y = 0;
this._actionFall = !0;
}
this._positionDirty = !0;
}
};
e.prototype.updateShake = function() {
if (!c.default.isPaused) if (this.shakeTimer.isActive) {
this.shakeVertical && (this.shakeOffset.y = g.Toolbox.randomFloat(-this.shakeVolume, this.shakeVolume));
this.shakeHorizontal && (this.shakeOffset.x = g.Toolbox.randomFloat(-this.shakeVolume, this.shakeVolume));
this._positionDirty = !0;
} else if (0 != this.shakeOffset.x || 0 != this.shakeOffset.y) {
this.shakeOffset.set(cc.Vec3.ZERO);
this._positionDirty = !0;
}
};
e.prototype.isNearbyTile = function(t) {
return this.currentTile == t || t.neighboursAll.has(this.currentTile);
};
e.prototype.updateFlipRotation = function(t) {
if (this.stats.flipAnimation) {
if (this.flip) {
this.flipAngle += 600 * t;
this.flipAngle > 180 && (this.flipAngle = 180);
} else {
this.flipAngle -= 600 * t;
this.flipAngle < 0 && (this.flipAngle = 0);
}
this.targetAngle.y != this.flipAngle && (this.targetAngle.y = this.flipAngle);
}
};
e.prototype.updateRotationBack = function(t) {
if (this.rotationCooldown > 0) this.rotationCooldown -= t; else {
if (0 == this.targetAngle.z) return;
if (this.targetAngle.z > 300) {
this.targetAngle.z += 10;
this.targetAngle.z >= 360 && (this.targetAngle.z = 0);
} else {
this.targetAngle.z -= 10;
this.targetAngle.z < 0 && (this.targetAngle.z = 0);
}
}
};
e.prototype.updateRotation = function() {
if (this.curAngle.x != this.targetAngle.x || this.curAngle.y != this.targetAngle.y || this.curAngle.z != this.targetAngle.z) {
this.curAngle.set(this.targetAngle);
this.updateScaleX();
this.node.angle = this.curAngle.z;
}
};
e.prototype.updateScaleX = function() {
this.node.scaleX = (this.targetAngle.y - 90) / -90 * this.actorSize;
};
e.prototype.updateDeadAnimation = function() {
var t;
if (this.spriteRenderer && (null === (t = this.stats) || void 0 === t || !t.specialDeadAnimation)) {
if (this.stats.deathAnimationAngle && this.targetAngle.z < 90) {
this.targetAngle.z = s.default.lerp(this.targetAngle.z, 90, 4 * w.default.inst.elapsed);
this.targetAngle.z > 90 && (this.targetAngle.z = 90);
if (Math.abs(this.curAngle.z) < 45) return;
}
this.changeMoveJumpOffset(-.05);
this.isFalling() || this.updateDeadBlackAnimation();
}
};
e.prototype.isFalling = function() {
return 0 != this.zPosition.y || 0 != this.moveJumpOffset.y;
};
e.prototype.updateDeadBlackAnimation = function() {
if (this.unit_sprite_color.g > 0) {
this.unit_sprite_color.r -= 127.5 * w.default.inst.elapsed;
this.unit_sprite_color.g -= 127.5 * w.default.inst.elapsed;
this.unit_sprite_color.b -= 127.5 * w.default.inst.elapsed;
this.setUnitSpriteColor(this.unit_sprite_color);
} else this.node.opacity > 0 ? this.node.opacity -= 255 * w.default.inst.elapsed : this.killHimself(!0, x.AttackType.None, !1);
};
e.prototype.setUnitSpriteColor = function(t) {
this.node.color = t;
this.node.children.forEach(function(e) {
e.color = t;
});
};
e.prototype.updateWalkJump = function(t) {
if (!(!this._is_visible && 0 == this.moveJumpOffset.y || this.zPosition.y > 0 || this.stats.disableJumpAnimation)) {
if (this.is_moving) {
if (!this.is_moving && 0 == this.jumpTime || this.isAffectedByWater()) return;
} else if (0 == this.moveJumpOffset.y && (0 == this.jumpTime || this.isAffectedByWater())) return;
this.jumpTime += 6 * w.default.inst.elapsed;
this.jumpTime >= 1 ? this.changeMoveJumpOffset(-3 * t) : this.changeMoveJumpOffset(3 * t);
if (this.jumpTime >= 2) {
this.jumpTime = 0;
this.changeMoveJumpOffset(0);
}
this.stats.rotatingAnimation && (this.targetAngle.z += 200 * (0 - this.moveJumpOffset.y) * w.default.inst.elapsed);
this._positionDirty = !0;
}
};
e.prototype.changeMoveJumpOffset = function(t) {
this.moveJumpOffset.y += t;
this.moveJumpOffset.y < 0 && (this.moveJumpOffset.y = 0);
this._positionDirty = !0;
};
e.prototype.setCurrentTile = function(t) {
this.currentTile = t;
};
e.prototype.setCurrentTilePosition = function(t) {
this.setCurrentTile(t);
this.currentPosition.set(t.posV3);
this._positionDirty = !0;
};
e.prototype.spawnOn = function(t, e) {
void 0 === e && (e = 0);
this.setCurrentTilePosition(t);
this.zPosition.y = e;
this.hitboxZ = this.stats.defaultZ;
};
e.prototype.findCurrentTile = function(t) {
var e, i, o, a;
void 0 === t && (t = !0);
if (this._currentTileDirty || this.currentPosition.x != this.lastX || this.currentPosition.y != this.lastY) {
this._currentTileDirty = !1;
this.lastX = this.currentPosition.x;
this.lastY = this.currentPosition.y;
var n = s.default.intCast(this.currentPosition.x), l = s.default.intCast(this.currentPosition.y);
n >= w.default.width && (n = w.default.width - 1);
l >= w.default.height && (l = w.default.height - 1);
n < 0 && (n = 0);
l < 0 && (l = 0);
this.setCurrentTile(w.default.inst.getTileSimple(n, l));
if (!(g.Toolbox.dist(this.currentTile.posV3.x, this.currentTile.posV3.y, this.currentPosition.x, this.currentPosition.y) < .5) && t) if (this.currentTile.type.water && this.stats.dieInWater && !this.stats.flying) try {
for (var c = r(this.currentTile.neighboursAll), u = c.next(); !u.done; u = c.next()) {
var d = u.value;
if (!d.type.liquid) {
this.currentTile = d;
break;
}
}
} catch (t) {
e = {
error: t
};
} finally {
try {
u && !u.done && (i = c.return) && i.call(c);
} finally {
if (e) throw e.error;
}
} else {
if (this.currentTile.type.liquid || !this.stats.dieOnGround) return;
try {
for (var h = r(this.currentTile.neighboursAll), p = h.next(); !p.done; p = h.next()) {
var f = p.value;
if (f.type.liquid) {
this.currentTile = f;
break;
}
}
} catch (t) {
o = {
error: t
};
} finally {
try {
p && !p.done && (a = h.return) && a.call(h);
} finally {
if (o) throw o.error;
}
}
}
}
};
e.prototype.moveTo = function(t) {
this._positionDirty = !0;
this.is_moving = !0;
if (this.attackTarget || !this.currentTile || !t.data.fire || this.currentTile.data.fire || this._trait_fire_resistant) {
this.nextStepTile = t;
g.Toolbox.distTile(this.currentTile, t) > 2 ? this._currentTileDirty = !0 : this.setCurrentTile(this.nextStepTile);
this.nextStepPosition = t.posV3.clone();
} else this.cancelAllBeh();
};
e.prototype.setFlip = function(t) {
this.flip = t;
};
e.prototype.smoothMovement = function(t, e) {
var i;
if (this.nextStepPosition.x != y.default.emptyVector.x && (null === (i = this.data) || void 0 === i ? void 0 : i.alive)) {
this.is_moving = !0;
if (g.Toolbox.distVec3(this.currentPosition, t) > Number.EPSILON) {
this.stats.flipAnimation && this.is_moving && (this.currentPosition.x < t.x ? this.setFlip(!0) : this.setFlip(!1));
var o = this.stats.ignoreTileSpeedMod || this.isInAir() || this.stats.waterCreature ? 1 : !this.currentTile.type.liquid || this.currentTile.type.liquid ? this.currentTile.type.walkMod : 1;
!this.stats.ignoreTileSpeedMod && this._isInWater && 1 != this.stats.speedModWater && (o *= this.stats.speedModWater);
var a = o * this.curStats.speed * .1;
a < .1 && (a = .1);
a *= e;
this.currentPosition = g.Toolbox.moveTowards(this.currentPosition, t, a);
this._positionDirty = !0;
return;
}
}
this._positionDirty = !0;
this.is_moving = !1;
this.isUsingPath() && this.updatePathMovement();
};
e.prototype.isUsingPath = function() {
return 0 != this.current_path.length || this.split_path != n.Normal;
};
e.prototype.goTo = function(t, e, i) {
void 0 === e && (e = !1);
void 0 === i && (i = !1);
this.setTileTarget(t);
return S.default.goTo(this, t, e, i);
};
e.prototype.stopMovement = function() {
this.split_path = n.Normal;
this.nextStepTile = null;
this.current_path_global = null;
this.current_path = [];
this.setTileTarget(null);
this.is_moving = !1;
this.nextStepPosition = y.default.emptyVector;
};
e.prototype.updatePathMovement = function() {
var t = this;
if (0 != this.current_path.length) {
var e = this.current_path.shift();
if (e) if (!this.stats.isBoat || e.isGoodForBoat()) {
if (e.type.block) {
var i = this.ai.task;
if (i && !i.moveFromBlock) {
this.cancelAllBeh();
this.moveTo(e);
return;
}
}
this.stats.dieInLava && e.type.lava ? this.cancelAllBeh() : this.stats.dieInWater && e.type.water && !this._isInWater ? this.cancelAllBeh() : this.stats.dieOnGround && e.type.ground ? this.cancelAllBeh() : this.moveTo(e);
} else {
this.callbacks_cancel_path_movement.forEach(function(e) {
e(t);
});
this.cancelAllBeh();
}
} else {
if (this.split_path == n.Normal) return;
if (this.split_path == n.Prepare) {
this.split_path = n.Split;
this.timer_action = g.Toolbox.randomFloat(0, 2);
return;
}
this.split_path = n.Normal;
this.tileTarget && this.goTo(this.tileTarget);
}
};
e.prototype.setTileTarget = function(t) {
this.tileTarget && this.tileTarget.targetedBy == this && (this.tileTarget.targetedBy = null);
this.tileTarget = t;
this.tileTarget && (this.tileTarget.targetedBy = this);
};
e.clearStatusEffects = function(t) {
if (0 != t.activeStatusEffects.length) for (;0 < t.activeStatusEffects.length; ) {
var e = t.activeStatusEffects[0];
t.removeStatusEffect(e.asset.id, e, 0);
}
};
e.prototype.clearTasks = function() {
this.insideBuilding = null;
this._timeout_targets = 0;
this.attackTarget = null;
this.timer_action = 0;
this.setTileTarget(null);
};
e.prototype.cancelAllBeh = function() {
var t;
this.inventory.resource && (null === (t = this.city) || void 0 === t ? void 0 : t.data) && this.city.data.storage.change(this.inventory.resource, this.inventory.amount);
this.inventory.empty();
this.ai.clearBeh();
this.ai.setTaskBehFinished();
this.ai.setJob(null);
this.clearTasks();
this.stopMovement();
};
e.spriteOffset = cc.v3(.5, .5);
e.actorCastPos = cc.v3(0, 13);
e.possible_moves = [];
e.possible_zones = [];
e.d_colorTileTarget = cc.color(0, 255, 255, 76.5);
e.d_colorTilePath = cc.color(255, 127.5, 127.5, 229.5);
e.d_colorKillTarget = cc.color(255, 0, 0, 255);
e.d_colorHomeCity = cc.color(255, 255, 0, 127.5);
e.d_colorCurrentTile = cc.color(255, 0, 0, 255);
return e;
}(m.default);
i.default = O;
cc._RF.pop();
}, {
"../../../../framework/lib/prototype/MathUtils": void 0,
"../../../../framework/utils/Log": void 0,
"../../../common/src/GameCommon": void 0,
"../MapBox": "MapBox",
"../ai/AiSystem": "AiSystem",
"../animation/ActorAnimationLoader": "ActorAnimationLoader",
"../assetLibrary/AssetManager": "AssetManager",
"../assetLibrary/lib/ItemLibrary": "ItemLibrary",
"../base/BaseContainer": "BaseContainer",
"../base/BaseSimObject": "BaseSimObject",
"../common/Globals": "Globals",
"../common/ItemTools": "ItemTools",
"../common/ToolBox": "ToolBox",
"../map/generator/ItemGenerator": "ItemGenerator",
"../map/generator/NameGenerator": "NameGenerator",
"../map/map/MapLayer": "MapLayer",
"../world/WorldTimer": "WorldTimer",
"./ActorBag": "ActorBag",
"./ActorEquipment": "ActorEquipment",
"./ActorMove": "ActorMove",
"./ActorStatus": "ActorStatus"
} ],
ActorEquipmentSlot: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "d145dXQlgVA0ZTTygWbBl+6", "ActorEquipmentSlot");
Object.defineProperty(i, "__esModule", {
value: !0
});
i.ItemData = i.EquipmentType = void 0;
var o;
(function(t) {
t[t.Weapon = 0] = "Weapon";
t[t.Helmet = 1] = "Helmet";
t[t.Armor = 2] = "Armor";
t[t.Boots = 3] = "Boots";
t[t.Ring = 4] = "Ring";
t[t.Amulet = 5] = "Amulet";
})(o = i.EquipmentType || (i.EquipmentType = {}));
i.ItemData = function() {
this.year = 0;
this.by = "";
this.from = "";
this.id = "";
this.material = "";
this.prefix = "";
this.suffix = "";
this.type = o.Weapon;
};
var a = function() {
function t(t) {
void 0 === t && (t = o.Armor);
this.type = t;
this.emptySlot();
}
t.prototype.copyTo = function(t) {
this.data = t.data;
};
t.prototype.isEmpty = function() {
return null == this.data;
};
t.prototype.emptySlot = function() {
this.data = null;
};
t.prototype.setItem = function(t) {
this.data = t;
};
return t;
}();
i.default = a;
cc._RF.pop();
}, {} ],
ActorEquipment: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "3c33653ybVBd7RexOHEfh9H", "ActorEquipment");
Object.defineProperty(i, "__esModule", {
value: !0
});
var o = t("./ActorEquipmentSlot"), a = function() {
function t() {
this.NONE = "none";
this.helmet = new o.default(o.EquipmentType.Helmet);
this.armor = new o.default(o.EquipmentType.Armor);
this.weapon = new o.default(o.EquipmentType.Weapon);
this.boots = new o.default(o.EquipmentType.Boots);
this.ring = new o.default(o.EquipmentType.Ring);
this.amulet = new o.default(o.EquipmentType.Amulet);
}
t.prototype.getDataForSave = function() {
var e = [];
t._list = t.getList(this);
t._list.forEach(function(t) {
e.push(t.data);
});
return e;
};
t.prototype.load = function(t) {
var e = this;
t && 0 != t.length && t.forEach(function(t) {
e.getSlot(t.type).setItem(t);
});
};
t.getList = function(e, i) {
void 0 === i && (i = !1);
t._list = [];
t.addToList(e.helmet, i);
t.addToList(e.armor, i);
t.addToList(e.weapon, i);
t.addToList(e.boots, i);
t.addToList(e.ring, i);
t.addToList(e.amulet, i);
return t._list;
};
t.prototype.getSlot = function(t) {
switch (t) {
case o.EquipmentType.Weapon:
return this.weapon;

case o.EquipmentType.Helmet:
return this.helmet;

case o.EquipmentType.Armor:
return this.armor;

case o.EquipmentType.Boots:
return this.boots;

case o.EquipmentType.Ring:
return this.ring;

case o.EquipmentType.Amulet:
return this.amulet;

default:
return null;
}
};
t.addToList = function(e, i) {
if (i) {
if (e.data) return;
} else if (!e.data) return;
t._list.push(e);
};
t._list = [];
return t;
}();
i.default = a;
cc._RF.pop();
}, {
"./ActorEquipmentSlot": "ActorEquipmentSlot"
} ],
ActorJobLibrary: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "51ed3yGiSFOTpDSpzT8a/mg", "ActorJobLibrary");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
});
Object.defineProperty(i, "__esModule", {
value: !0
});
var r = t("../../actors/ActorJob"), n = t("../../ai/conditions/CondGroupLeader"), s = t("../../ai/conditions/CondHaveAttackTarget"), l = t("../../ai/conditions/CondHaveUnitGroup"), c = t("../../ai/conditions/CondNoAttackTarget"), u = t("../../ai/conditions/CondNotGroupLeader"), d = t("../../ai/conditions/CondNoUnitGroup"), h = function(t) {
a(e, t);
function e() {
return null !== t && t.apply(this, arguments) || this;
}
e.prototype.init = function() {
t.prototype.init.call(this);
this.initJobsCivs();
this.initJobsMobs();
this.initJobsBoats();
};
e.prototype.initJobsBoats = function() {
var t = new r.default();
t.id = "boat_fishing";
this.add(t);
this.t.addTask("boat_danger_check");
this.t.addTask("boat_fishing");
this.t.addTask("boat_idle");
var e = new r.default();
t.id = "boat_trading";
this.add(e);
this.t.addTask("boat_danger_check");
this.t.addTask("boat_trading");
this.t.addTask("boat_idle");
var i = new r.default();
i.id = "boat_transport";
this.add(i);
this.t.addTask("boat_danger_check");
this.t.addTask("boat_transport_check");
this.t.addTask("boat_idle");
};
e.prototype.initJobsCivs = function() {
var t = new r.default();
t.id = "unit";
this.add(t);
this.t.addTask("check_join_city");
this.t.addTask("build_city_here");
this.t.addTask("random_move");
this.t.addTask("check_join_empty_nearby_city");
this.t.addTask("nomad_try_build_city");
this.t.addTask("check_if_stuck_on_small_land");
this.t.addTask("end_job");
var e = new r.default();
e.id = "baby";
this.add(e);
this.t.addTask("random_move");
this.t.addTask("city_idle_walking");
this.t.addTask("stay_in_house");
this.t.addTask("check_if_stuck_on_small_land");
var i = new r.default();
i.id = "citizen";
this.add(i);
this.t.addTask("random_move");
this.t.addTask("city_idle_walking");
this.t.addTask("find_city_job");
this.t.addTask("stay_in_house");
this.t.addTask("try_to_return_home");
this.t.addTask("check_if_stuck_on_small_land");
var o = new r.default();
o.id = "fireman";
this.add(o);
this.t.addTask("put_out_fire");
this.t.addTask("end_job");
var a = new r.default();
a.id = "hunter";
a.cityJob = !0;
this.add(a);
this.t.addTask("random_move");
this.t.addTask("look_for_animals");
this.t.addTask("end_job");
var h = new r.default();
h.id = "builder";
h.cityJob = !0;
this.add(h);
this.t.addTask("build_new_building");
this.t.addTask("end_job");
var p = new r.default();
p.id = "settler";
p.cityJob = !0;
p.cancel_when_embarking = !1;
this.add(p);
this.t.addTask("city_idle_walking");
this.t.addTask("settler_check_transport");
this.t.addTask("settler_same_island");
this.t.addTask("build_city_here");
this.t.addTask("check_join_city");
this.t.addTask("try_to_return_home");
this.t.addTask("check_if_stuck_on_small_land");
var f = new r.default();
f.id = "cleaner";
f.cityJob = !0;
this.add(f);
this.t.addTask("cleaning");
this.t.addTask("end_job");
var m = new r.default();
m.id = "road_builder";
m.cityJob = !0;
this.add(m);
this.t.addTask("build_road");
this.t.addTask("end_job");
var y = new r.default();
y.id = "woodcutter";
y.cityJob = !0;
this.add(y);
this.t.addTask("chop_trees");
this.t.addTask("end_job");
var _ = new r.default();
_.id = "miner";
_.cityJob = !0;
this.add(_);
this.t.addTask("mine");
this.t.addTask("end_job");
var g = new r.default();
g.id = "miner_deposit";
g.cityJob = !0;
this.add(g);
this.t.addTask("mine_deposit");
this.t.addTask("end_job");
var v = new r.default();
v.id = "metalworker";
v.cityJob = !0;
this.add(v);
this.t.addTask("convert_ore");
this.t.addTask("end_job");
var b = new r.default();
b.id = "blacksmith";
b.cityJob = !0;
this.add(b);
this.t.addTask("make_items");
this.t.addTask("end_job");
var T = new r.default();
T.id = "gatherer";
T.cityJob = !0;
this.add(T);
this.t.addTask("collect_fruits");
this.t.addTask("end_job");
var w = new r.default();
w.id = "farmer_plower";
w.cityJob = !0;
this.add(w);
this.t.addTask("farming_make_field");
this.t.addTask("end_job");
var B = new r.default();
B.id = "farmer";
B.cityJob = !0;
this.add(B);
this.t.addTask("plant_crops");
this.t.addTask("harvest");
this.t.addTask("end_job");
var k = new r.default();
k.id = "attacker";
k.cityJob = !0;
this.add(k);
this.t.addTask("warrior_check_city_army_group");
this.t.addTask("city_idle_walking");
this.t.addCondition(new n.default());
this.t.addCondition(new l.default());
this.t.addCondition(new c.default());
this.t.addTask("warrior_army_leader_move_random");
this.t.addCondition(new n.default());
this.t.addCondition(new l.default());
this.t.addTask("warrior_army_leader_move_to_attack_target");
this.t.addCondition(new n.default());
this.t.addCondition(new l.default());
this.t.addCondition(new s.default());
this.t.addTask("warrior_army_follow_leader");
this.t.addCondition(new l.default());
this.t.addCondition(new u.default());
this.t.addTask("city_idle_walking");
this.t.addCondition(new d.default());
this.t.addTask("random_move");
this.t.addCondition(new d.default());
this.t.addTask("check_warrior_transport");
this.t.addTask("wait");
this.t.addTask("try_to_return_home");
this.t.addTask("check_if_stuck_on_small_land");
var A = new r.default();
A.id = "defender";
A.cityJob = !0;
this.add(A);
this.t.addTask("check_warrior_defender");
this.t.addTask("wait");
this.t.addTask("try_to_return_home");
};
e.prototype.initJobsMobs = function() {
var t = new r.default();
t.id = "rat";
this.add(t);
this.t.addTask("rat");
this.t.addTask("check_hunger_animal");
this.t.addTask("try_babymaking");
var e = new r.default();
e.id = "crab";
this.add(e);
this.t.addTask("swim_to_island");
this.t.addTask("crab_danger_check");
this.t.addTask("random_move");
this.t.addTask("crab_danger_check");
this.t.addTask("try_babymaking");
this.t.addTask("crab");
this.t.addTask("crab_danger_check");
var i = new r.default();
i.id = "crab_burrow";
this.add(i);
this.t.addTask("crab_burrow");
var o = new r.default();
o.id = "animal_water_eater";
this.add(o);
this.t.addTask("swim_to_island");
this.t.addTask("wait10");
this.t.addTask("random_move");
this.t.addTask("try_babymaking");
this.t.addTask("water_feeding");
this.t.addTask("wait10");
var a = new r.default();
a.id = "animal";
this.add(a);
this.t.addTask("random_animal_move");
this.t.addTask("check_hunger_animal");
this.t.addTask("try_babymaking");
this.t.addTask("wait10");
var n = new r.default();
n.id = "bee";
this.add(n);
this.t.addTask("pollinate");
this.t.addTask("random_move");
var s = new r.default();
s.id = "animal_herd";
this.add(s);
this.t.addTask("random_move");
this.t.addTask("check_hunger_animal");
this.t.addTask("try_babymaking");
this.t.addTask("follow_same_race");
this.t.addTask("wait5");
var l = new r.default();
l.id = "random_move";
this.add(l);
this.t.addTask("random_move");
var c = new r.default();
c.id = "random_swim";
this.add(c);
this.t.addTask("random_swim");
var u = new r.default();
u.id = "move_mob";
this.add(u);
this.t.addTask("random_move");
this.t.addTask("attack_golden_brain");
var d = new r.default();
d.id = "skeleton_job";
this.add(d);
this.t.addTask("skeleton_move");
this.t.addTask("attack_golden_brain");
var h = new r.default();
h.id = "necromancer";
this.add(h);
this.t.addTask("random_move");
this.t.addTask("wait");
this.t.addTask("check_heal");
this.t.addTask("make_skeleton");
this.t.addTask("attack_golden_brain");
var p = new r.default();
p.id = "evil_mage";
this.add(p);
this.t.addTask("random_move");
this.t.addTask("check_heal");
this.t.addTask("random_teleport");
this.t.addTask("wait");
var f = new r.default();
f.id = "white_mage";
this.add(f);
this.t.addTask("random_move");
this.t.addTask("check_heal");
this.t.addTask("random_teleport");
this.t.addTask("wait");
var m = new r.default();
m.id = "druid";
this.add(m);
this.t.addTask("random_move");
this.t.addTask("check_heal");
this.t.addTask("spawn_seeds");
this.t.addTask("wait");
var y = new r.default();
y.id = "plague_doctor";
this.add(y);
this.t.addTask("check_cure");
this.t.addTask("burn_tumors");
this.t.addTask("random_move_towards_civ_building");
this.t.addTask("check_heal");
this.t.addTask("wait");
var _ = new r.default();
_.id = "mush";
this.add(_);
this.t.addTask("random_move");
this.t.addTask("wait");
var g = new r.default();
g.id = "tumor_monster";
this.add(g);
this.t.addTask("random_move");
this.t.addTask("wait");
var v = new r.default();
v.id = "unit_on_fire";
this.add(v);
this.t.addTask("short_move");
this.t.addTask("short_move");
this.t.addTask("short_move");
this.t.addTask("run_to_water");
this.t.addTask("end_job");
};
return e;
}(t("../AssetLibrary").default);
i.default = h;
cc._RF.pop();
}, {
"../../actors/ActorJob": "ActorJob",
"../../ai/conditions/CondGroupLeader": "CondGroupLeader",
"../../ai/conditions/CondHaveAttackTarget": "CondHaveAttackTarget",
"../../ai/conditions/CondHaveUnitGroup": "CondHaveUnitGroup",
"../../ai/conditions/CondNoAttackTarget": "CondNoAttackTarget",
"../../ai/conditions/CondNoUnitGroup": "CondNoUnitGroup",
"../../ai/conditions/CondNotGroupLeader": "CondNotGroupLeader",
"../AssetLibrary": "AssetLibrary"
} ],
ActorJob: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "9f4b1Gdew9FIZXh0rvSbqAb", "ActorJob");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
});
Object.defineProperty(i, "__esModule", {
value: !0
});
i.JobCityAsset = i.JobAsset = void 0;
var r = t("../assetLibrary/AssetLibrary"), n = t("../base/BaseContainer"), s = function(t) {
a(e, t);
function e() {
var e = null !== t && t.apply(this, arguments) || this;
e.tasks = [];
return e;
}
e.prototype.addCondition = function(t) {
this.tasks[this.tasks.length - 1].addCondition(t);
};
e.prototype.addTask = function(t) {
var e = new n.TaskContainer();
e.id = t;
this.tasks.push(e);
};
return e;
}(r.Asset);
i.JobAsset = s;
var l = function(t) {
a(e, t);
function e() {
return null !== t && t.apply(this, arguments) || this;
}
return e;
}(s);
i.JobCityAsset = l;
var c = function(t) {
a(e, t);
function e() {
var e = null !== t && t.apply(this, arguments) || this;
e.active = [];
e.cancel_when_embarking = !0;
return e;
}
return e;
}(s);
i.default = c;
cc._RF.pop();
}, {
"../assetLibrary/AssetLibrary": "AssetLibrary",
"../base/BaseContainer": "BaseContainer"
} ],
ActorMove: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "ed674cMfn9CYpy+n/3AJ5za", "ActorMove");
Object.defineProperty(i, "__esModule", {
value: !0
});
i.PathFinderResult = i.ExecuteEvent = void 0;
var o, a, r = t("../ai/pathFinding/AStarFinder"), n = t("../common/PathfinderTools"), s = t("../DebugConfig"), l = t("../MapBox"), c = t("./ActorBase");
(function(t) {
t[t.True = 0] = "True";
t[t.False = 1] = "False";
t[t.Continue = 2] = "Continue";
})(o = i.ExecuteEvent || (i.ExecuteEvent = {}));
(function(t) {
t[t.PathFound = 0] = "PathFound";
t[t.NotFound = 1] = "NotFound";
t[t.SamePlace = 2] = "SamePlace";
t[t.DifferentIslands = 3] = "DifferentIslands";
})(a = i.PathFinderResult || (i.PathFinderResult = {}));
var u = function() {
function t() {}
t.goTo = function(e, i, u, d) {
void 0 === u && (u = !1);
void 0 === d && (d = !1);
e.current_path.clear();
e.current_path_global = null;
if (!s.default.UnitPathfinding) {
e.current_path.push(i);
return o.True;
}
if (e.stats.isBoat && !i.isGoodForBoat()) return o.False;
if (e.isInAir()) {
e.current_path.push(i);
return o.True;
}
var h = e.currentTile.isSameIsland(i);
h && !e.isInWater() && (u = !1);
l.default.inst.pathfindingParam.resetParam();
l.default.inst.pathfindingParam.block = d;
l.default.inst.pathfindingParam.lava = !e.stats.dieInLava;
e.currentTile.type.lava && (l.default.inst.pathfindingParam.lava = !0);
l.default.inst.pathfindingParam.water = e.stats.waterCreature;
(u && !e.stats.dieInWater || e.isInWater()) && (l.default.inst.pathfindingParam.water = !0);
l.default.inst.pathfindingParam.ground = !e.stats.waterCreature;
l.default.inst.pathfindingParam.boat = e.stats.isBoat && e.currentTile.isGoodForBoat();
l.default.inst.pathfindingParam.limit = !0;
n.default.tryToGetSimplePath(e.currentTile, i, e.current_path, e.stats, l.default.inst.pathfindingParam) || e.current_path.clear();
l.default.inst.pathFindingVisualiser.showPath(null, e.current_path);
if (e.current_path.length > 0) {
e.setTileTarget(i);
return o.True;
}
if (!h) {
if (!(i.type.ground && l.default.inst.pathfindingParam.ground || i.type.water && l.default.inst.pathfindingParam.water || i.type.lava && l.default.inst.pathfindingParam.lava || i.type.block && l.default.inst.pathfindingParam.block)) return o.False;
if (i.region.island.getTileCount() < e.currentTile.region.island.getTileCount()) {
if (!i.region.island.connectedWith(e.currentTile.region.island)) return o.False;
l.default.inst.pathfindingParam.endToStartPath = !0;
} else if (!e.currentTile.region.island.connectedWith(i.region.island)) return o.False;
}
var p = s.default.UseGlobalPathLock;
!e.stats.isBoat && h || (p = !1);
if (p) {
switch (l.default.inst.regionPathFinder.getGlobalPath(e.currentTile, i, e.stats.isBoat)) {
case a.SamePlace:
e.current_path.push(i);
return o.True;

case a.NotFound:
case a.DifferentIslands:
return o.True;
}
if (l.default.inst.regionPathFinder.last_globalPath) {
e.current_path_global = l.default.inst.regionPathFinder.last_globalPath;
var f = 0;
e.current_path_global.forEach(function(t) {
t.usedByPathLock = !0;
t.regionPathID = f++;
});
if (e.stats.isBoat && s.default.CheckGoodForBoat) {
t._temp_list = [];
e.current_path_global.forEach(function(i) {
i.neighbours.forEach(function(i) {
if (!e.current_path_global.includes(i)) {
i.usedByPathLock = !0;
t._temp_list.push(i);
}
});
});
}
} else {
e.currentTile.region.usedByPathLock = !0;
e.currentTile.region.regionPathID = 0;
}
}
l.default.inst.pathfindingParam.useGlobalPathLock = p;
var m = i;
r.default.result_split_path && e.current_path_global && e.current_path_global.length > 2 && (m = e.current_path_global[2].tiles.getRandom());
l.default.inst.calcPath(e.currentTile, m, e.current_path);
r.default.result_split_path && (e.split_path = c.SplitPathStatus.Prepare);
if (p) {
e.current_path_global && e.current_path_global.forEach(function(t) {
t.usedByPathLock = !1;
t.regionPathID = -1;
});
e.currentTile.region.usedByPathLock = !1;
e.currentTile.region.regionPathID = -1;
}
e.setTileTarget(i);
return o.True;
};
t._temp_list = [];
return t;
}();
i.default = u;
cc._RF.pop();
}, {
"../DebugConfig": "DebugConfig",
"../MapBox": "MapBox",
"../ai/pathFinding/AStarFinder": "AStarFinder",
"../common/PathfinderTools": "PathfinderTools",
"./ActorBase": "ActorBase"
} ],
ActorStatsLibrary: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "357c73L1bJI5KpJYXm+41ex", "ActorStatsLibrary");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
});
Object.defineProperty(i, "__esModule", {
value: !0
});
var r = t("../../../../../framework/utils/Log"), n = t("../../../../../framework/utils/Tools"), s = t("../../actors/ActionLibrary"), l = t("../../actors/ActorStats"), c = t("../../actors/ActorStatus"), u = t("../../actors/construction/ConstructionLayerDebug"), d = t("../../common/ToolBox"), h = t("../../world/WorldAction"), p = function(t) {
a(e, t);
function e() {
var e = null !== t && t.apply(this, arguments) || this;
e.spawnInRuins = [];
return e;
}
e.prototype.init = function() {
var e = this;
cc.log("INIT ActorStats");
t.prototype.init.call(this);
var i = new l.default();
i.id = "_unit";
i.canBeKilledByStuff = !0;
i.canBeKilledByDrawing = !0;
i.canAttackBuildings = !0;
i.unit = !0;
i.swimToIsland = !0;
i.canBeMovedByPowers = !0;
i.canBeHurtByPowers = !0;
i.canTurnIntoZombie = !0;
i.updateZ = !0;
i.effectDamage = !0;
i.flipAnimation = !0;
i.actorSize = c.ActorSize.Normal;
i.canBeInspected = !0;
i.hideOnMinimap = !0;
i.use_items = !0;
i.take_items = !0;
i.needFood = !0;
i.diet_meat = !0;
i.inspect_home = !0;
i.disableJumpAnimation = !1;
i.deathAnimationAngle = !0;
i.prefab = "p_unit";
i.body_separate_part_head = !0;
i.body_separate_part_hands = !0;
i.canHaveStatusEffect = !0;
this.add(i);
this.t.canTurnIntoMush = !0;
this.t.mushID = "mush_unit";
this.t.canTurnIntoTumorMonster = !0;
this.t.tumorMonsterID = "tumor_monster_unit";
this.t.animation_walk = "walk_0,walk_1,walk_2,walk_3";
this.t.animation_swim = "swim_0,swim_1,swim_2,swim_3";
this.t.animation_walk_speed = .1;
this.t.animation_swim_speed = .1;
this.t.job = "unit";
this.t.baseStats.speed = 100;
this.t.baseStats.attackSpeed = 60;
this.t.defaultWeapon = "hands";
this.t.skeletonID = "skeleton_cursed";
this.clone("unit_human", "_unit");
this.t.nameLocale = "Humans";
this.t.nameTemplate = "human_name";
this.t.race = "human";
this.t.maxAge = 70;
this.t.icon = "iconHumans";
this.t.color = d.Toolbox.makeColor("#005E72");
this.t.zombieID = "zombie";
this.t.setBaseStats(100, 15, 40, 0, 5, 92, 5);
this.clone("unit_elf", "_unit");
this.t.nameLocale = "Elves";
this.t.nameTemplate = "elf_name";
this.t.race = "elf";
this.t.maxAge = 200;
this.t.icon = "iconElves";
this.t.color = d.Toolbox.makeColor("#005D00");
this.t.zombieID = "zombie_elf";
this.addTrait("weightless");
this.t.setBaseStats(120, 15, 50, 0, 10, 95, 8);
this.t.action_death.clear();
this.t.action_death.add(s.default.tryToGrowTree);
this.clone("unit_orc", "_unit");
this.t.nameLocale = "Orcs";
this.t.nameTemplate = "orc_name";
this.t.race = "orc";
this.t.maxAge = 50;
this.t.icon = "iconOrcs";
this.t.color = d.Toolbox.makeColor("#2F5225");
this.t.zombieID = "zombie_orc";
this.addTrait("regeneration");
this.addTrait("savage");
this.t.setBaseStats(150, 18, 50, 3, 0, 90, 1);
this.clone("unit_dwarf", "_unit");
this.t.nameLocale = "Dwarves";
this.t.nameTemplate = "dwarf_name";
this.t.race = "dwarf";
this.t.maxAge = 110;
this.t.baseStats.attackSpeed = 50;
this.t.icon = "iconDwarf";
this.t.color = d.Toolbox.makeColor("#828282");
this.t.zombieID = "zombie_dwarf";
this.t.setBaseStats(200, 22, 30, 4, 0, 90, 4);
this.addTrait("miner");
this.clone("baby_human", "unit_human");
this.t.body_separate_part_head = !1;
this.t.body_separate_part_hands = !1;
this.t.baseStats.speed = 10;
this.t.timeToGrow = 200;
this.t.baby = !0;
this.t.animation_idle = 3;
this.addTrait("peaceful");
this.t.growIntoID = "unit_human";
this.clone("baby_elf", "unit_elf");
this.t.body_separate_part_head = !1;
this.t.body_separate_part_hands = !1;
this.t.baseStats.speed = 10;
this.t.timeToGrow = 400;
this.t.baby = !0;
this.t.animation_idle = 3;
this.t.growIntoID = "unit_elf";
this.addTrait("peaceful");
this.t.action_death.clear();
this.t.action_death.add(s.default.tryToGrowTree);
this.clone("baby_orc", "unit_orc");
this.t.body_separate_part_head = !1;
this.t.body_separate_part_hands = !1;
this.t.baseStats.speed = 10;
this.t.timeToGrow = 120;
this.t.baby = !0;
this.t.animation_idle = 3;
this.t.growIntoID = "unit_orc";
this.addTrait("peaceful");
this.clone("baby_dwarf", "unit_dwarf");
this.t.body_separate_part_head = !1;
this.t.body_separate_part_hands = !1;
this.t.baseStats.speed = 10;
this.t.timeToGrow = 250;
this.t.baby = !0;
this.t.animation_idle = 3;
this.t.growIntoID = "unit_dwarf";
this.addTrait("peaceful");
var o = new l.default();
o.id = "antBlack";
o.race = "special";
o.kingdom = "ants";
o.canBeKilledByStuff = !0;
o.canBeKilledByDrawing = !0;
o.ignoreTileSpeedMod = !0;
o.skipFightLogic = !0;
o.ignoreJobs = !0;
o.canBeMovedByPowers = !0;
o.canBeHurtByPowers = !0;
o.updateZ = !0;
o.effectDamage = !0;
o.flipAnimation = !0;
o.actorSize = c.ActorSize.Normal;
o.hideOnMinimap = !0;
o.prefab = "p_unit";
o.color = d.Toolbox.makeColor("#000000");
o.canHaveStatusEffect = !0;
o.dieOnBlocks = !1;
this.add(o);
this.addFlag("ant");
this.t.nameLocale = "Black Ant";
this.t.texture_path = "t_antblack";
this.t.animation_walk = "walk_0,walk_1,walk_2";
this.t.animation_walk_speed = .03;
this.t.animation_swim_speed = .12;
this.t.baseStats.speed = 40;
this.t.baseStats.knockback = 0;
this.addTrait("strong_minded");
this.clone("antGreen", "antBlack");
this.t.nameLocale = "Green Ant";
this.t.texture_path = "t_antgreen";
this.t.color = d.Toolbox.makeColor("#007F0E");
this.clone("antBlue", "antBlack");
this.t.nameLocale = "Blue Ant";
this.t.texture_path = "t_antblue";
this.t.color = d.Toolbox.makeColor("#0094FF");
this.clone("antRed", "antBlack");
this.t.nameLocale = "Red Ant";
this.t.texture_path = "t_antred";
this.t.color = d.Toolbox.makeColor("#FF2511");
this.clone("sandSpider", "antBlack");
this.t.nameLocale = "Sand Spider";
this.t.texture_path = "t_sandspider";
this.t.color = d.Toolbox.makeColor("#2D2D2D");
this.t.baseStats.speed = 100;
this.clone("worm", "antBlack");
this.t.nameLocale = "Worm";
this.t.animation_walk = "walk_0";
this.t.canBeMovedByPowers = !1;
this.t.canBeHurtByPowers = !0;
this.t.canBeKilledByStuff = !1;
this.t.race = "special";
this.t.baseStats.speed = 100;
this.t.color.a = 0;
this.t.shadow = !1;
this.t.texture_path = "t_worm";
this.addTrait("fire_proof");
var a = new l.default();
a.id = "printer";
a.race = "nature";
a.kingdom = "nature";
a.canBeKilledByDrawing = !0;
a.ignoreTileSpeedMod = !0;
a.skipFightLogic = !0;
a.ignoreJobs = !0;
a.canBeMovedByPowers = !1;
a.canBeHurtByPowers = !0;
a.updateZ = !0;
a.effectDamage = !0;
a.flipAnimation = !0;
a.hideOnMinimap = !0;
a.needFood = !1;
a.skipSave = !0;
a.prefab = "p_unit";
a.canHaveStatusEffect = !0;
a.dieOnBlocks = !1;
a.ignoredByInfinityCoin = !0;
this.add(a);
this.addFlag("ant");
this.t.nameLocale = "Printer";
this.t.texture_path = "t_printer";
this.t.baseStats.health = 1;
this.t.baseStats.speed = 1e4;
this.t.animation_walk = "walk_0,walk_1,walk_2";
this.t.animation_walk_speed = .03;
this.t.animation_swim_speed = .12;
var n = new l.default();
n.id = "tentacle";
n.race = "special";
n.kingdom = "tumor";
n.canBeKilledByDrawing = !0;
n.countAsUnit = !1;
n.ignoreTileSpeedMod = !0;
n.skipFightLogic = !0;
n.ignoreJobs = !0;
n.canBeMovedByPowers = !1;
n.canBeHurtByPowers = !0;
n.updateZ = !0;
n.effectDamage = !0;
n.flipAnimation = !0;
n.hideOnMinimap = !0;
n.needFood = !1;
n.skipSave = !0;
n.shadow = !1;
n.prefab = "p_unit";
this.add(n);
this.addFlag("ant");
this.t.nameLocale = "Tumor";
this.t.animation_walk = "walk_0";
this.t.texture_path = "t_tentacle";
this.t.baseStats.health = 1;
this.t.baseStats.speed = 70;
this.t.baseStats.attackSpeed = 100;
this.t.baseStats.damage = 10;
this.t.baseStats.knockback = .6;
this.t.immune_to_tumor = !0;
this.addTrait("strong_minded");
var h = new l.default();
h.id = "dragon";
h.race = "dragon";
h.kingdom = "dragons";
h.canBeKilledByStuff = !0;
h.canBeKilledByDrawing = !0;
h.ignoreTileSpeedMod = !0;
h.skipFightLogic = !0;
h.ignoreJobs = !0;
h.canBeMovedByPowers = !0;
h.canBeHurtByPowers = !0;
h.updateZ = !0;
h.defaultZ = 0;
h.effectDamage = !0;
h.flipAnimation = !0;
h.specialAnimation = !0;
h.specialDeadAnimation = !0;
h.canTurnIntoZombie = !0;
h.zombieID = "zombie_dragon";
h.actorSize = c.ActorSize.Huge;
h.canBeInspected = !0;
h.hideFavoriteIcon = !0;
h.icon = "iconDragon";
h.inspectAvatarScale = 1.5;
h.prefab = "p_dragon";
h.needFood = !1;
h.dieOnBlocks = !1;
this.add(h);
this.t.nameLocale = "Dragon";
this.t.baseStats.scale = .3;
this.t.baseStats.size = 2;
this.t.baseStats.health = 1e3;
this.t.baseStats.speed = 60;
this.t.baseStats.attackSpeed = 100;
this.t.baseStats.damage = 80;
this.t.baseStats.knockback = .6;
this.addTrait("immortal");
this.addTrait("regeneration");
this.addTrait("strong_minded");
this.addTrait("fire_proof");
this.addTrait("fire_blood");
this.clone("zombie_dragon", "dragon");
this.t.nameLocale = "Zombie";
this.t.prefab = "p_zombie_dragon";
this.setZombie();
this.removeTrait("fire_proof");
this.removeTrait("fire_blood");
this.addTrait("acid_blood");
this.addTrait("acid_proof");
var p = new l.default();
p.id = "UFO";
p.kingdom = "aliens";
p.race = "ufo";
p.canBeKilledByStuff = !0;
p.canBeKilledByDrawing = !0;
p.ignoreTileSpeedMod = !0;
p.skipFightLogic = !0;
p.ignoreJobs = !0;
p.flying = !0;
p.canBeMovedByPowers = !0;
p.canBeHurtByPowers = !0;
p.effectDamage = !0;
p.specialAnimation = !0;
p.specialDeadAnimation = !0;
p.actorSize = c.ActorSize.Huge;
p.canBeInspected = !0;
p.icon = "iconUfo";
p.needFood = !1;
p.hideFavoriteIcon = !0;
p.dieByLightning = !0;
p.prefab = "p_ufo";
p.dieOnBlocks = !1;
this.add(p);
this.t.nameLocale = "UFO";
this.t.baseStats.scale = .3;
this.t.baseStats.health = 500;
this.t.baseStats.speed = 200;
this.t.baseStats.attackSpeed = 100;
this.t.baseStats.damage = 80;
this.t.baseStats.knockback = .6;
this.addTrait("immortal");
this.addTrait("strong_minded");
this.addTrait("fire_proof");
var f = new l.default();
f.id = "boulder";
f.race = "nature";
f.kingdom = "nature";
f.canBeKilledByDrawing = !0;
f.ignoreTileSpeedMod = !0;
f.skipFightLogic = !0;
f.ignoreJobs = !0;
f.canBeMovedByPowers = !0;
f.canBeHurtByPowers = !0;
f.updateZ = !0;
f.effectDamage = !0;
f.specialAnimation = !0;
f.specialDeadAnimation = !0;
f.needFood = !1;
f.skipSave = !0;
f.prefab = "p_boulder";
f.dieOnBlocks = !1;
f.ignoredByInfinityCoin = !0;
this.add(f);
this.t.nameLocale = "Bowling Ball";
this.t.baseStats.scale = .3;
var m = new l.default();
m.id = "tornado";
m.race = "nature";
m.kingdom = "nature";
m.canBeKilledByDrawing = !0;
m.ignoreTileSpeedMod = !0;
m.skipFightLogic = !0;
m.ignoreJobs = !0;
m.flying = !0;
m.canBeMovedByPowers = !0;
m.canBeHurtByPowers = !0;
m.updateZ = !0;
m.flipAnimation = !0;
m.specialAnimation = !0;
m.specialDeadAnimation = !0;
m.needFood = !1;
m.skipSave = !0;
m.prefab = "p_tornado";
m.dieOnBlocks = !1;
m.ignoredByInfinityCoin = !0;
this.add(m);
this.t.nameLocale = "Tornado";
this.t.baseStats.scale = 0;
this.t.baseStats.speed = 50;
this.t.baseStats.attackSpeed = 100;
this.t.baseStats.damage = 7;
this.addTrait("strong_minded");
var y = new l.default();
y.id = "crabzilla";
y.race = "crabzilla";
y.kingdom = "crabzilla";
y.canBeKilledByStuff = !0;
y.canBeKilledByDrawing = !0;
y.ignoreTileSpeedMod = !0;
y.skipFightLogic = !0;
y.ignoreJobs = !0;
y.flying = !1;
y.canBeMovedByPowers = !1;
y.canBeHurtByPowers = !0;
y.updateZ = !0;
y.flipAnimation = !1;
y.specialAnimation = !0;
y.specialDeadAnimation = !0;
y.needFood = !1;
y.skipSave = !0;
y.prefab = "p_crabzilla";
y.dieOnBlocks = !1;
y.ignoredByInfinityCoin = !0;
this.add(y);
this.t.nameLocale = "Crabzilla";
this.t.baseStats.scale = .25;
this.t.actorSize = c.ActorSize.Huge;
this.t.baseStats.health = 5e3;
this.t.baseStats.speed = 50;
this.t.baseStats.attackSpeed = 100;
this.t.baseStats.damage = 7;
this.t.baseStats.size = 8;
this.t.canLevelUp = !1;
this.t.shadow = !1;
this.t.hit_fx_alternative_offset = !1;
this.t.action_death.add(s.default.startNuke);
this.addTrait("strong_minded");
var _ = new l.default();
_.id = "godFinger";
_.actorSize = c.ActorSize.Huge;
_.race = "special";
_.kingdom = "nature";
_.canBeKilledByStuff = !0;
_.ignoreTileSpeedMod = !0;
_.skipFightLogic = !0;
_.ignoreJobs = !0;
_.canBeMovedByPowers = !0;
_.canBeHurtByPowers = !0;
_.updateZ = !0;
_.effectDamage = !0;
_.specialAnimation = !0;
_.needFood = !1;
_.skipSave = !0;
_.deathAnimationAngle = !0;
_.prefab = "p_godFinger";
_.dieOnBlocks = !1;
this.add(_);
this.t.nameLocale = "God Finger";
this.t.baseStats.scale = .3;
this.t.baseStats.health = 30;
this.t.baseStats.damage = 10;
this.t.dieInWater = !1;
this.t.dieInLava = !1;
this.addTrait("strong_minded");
this.addTrait("fire_proof");
var g = new l.default();
g.id = "santa";
g.race = "special";
g.kingdom = "santa";
g.canBeKilledByDrawing = !0;
g.ignoreTileSpeedMod = !0;
g.skipFightLogic = !0;
g.ignoreJobs = !0;
g.flying = !0;
g.canBeMovedByPowers = !0;
g.canBeHurtByPowers = !0;
g.effectDamage = !0;
g.dieByLightning = !0;
g.skipSave = !0;
g.prefab = "p_santa";
this.add(g);
this.t.nameLocale = "Robot Santa";
this.t.baseStats.health = 50;
this.t.baseStats.damage = 10;
this.t.baseStats.speed = 60;
this.t.baseStats.size = 2;
this.addTrait("strong_minded");
this.addTrait("immune");
this.addTrait("evil");
var v = new l.default();
v.id = "_mob";
v.canBeKilledByStuff = !0;
v.canBeKilledByDrawing = !0;
v.canAttackBuildings = !0;
v.swimToIsland = !0;
v.canBeMovedByPowers = !0;
v.canBeHurtByPowers = !0;
v.updateZ = !0;
v.effectDamage = !0;
v.flipAnimation = !0;
v.canBeInspected = !0;
v.hideOnMinimap = !0;
v.deathAnimationAngle = !0;
v.prefab = "p_unit";
v.inspect_children = !1;
v.canHaveStatusEffect = !0;
this.add(v);
this.t.canTurnIntoMush = !0;
this.t.mushID = "mush_unit";
this.t.canTurnIntoTumorMonster = !0;
this.t.tumorMonsterID = "tumor_monster_unit";
this.t.defaultWeapon = "base";
this.t.job = "random_move";
this.t.animation_walk = "walk_0,walk_1,walk_2,walk_2,walk_1";
this.t.animation_swim = "swim_0,swim_1,swim_1,swim_2";
this.t.animation_walk_speed = .03;
this.t.animation_swim_speed = .12;
this.clone("_animal", "_mob");
this.t.canTurnIntoMush = !0;
this.t.mushID = "mush_animal";
this.t.canTurnIntoTumorMonster = !0;
this.t.tumorMonsterID = "tumor_monster_animal";
this.t.inspect_children = !0;
this.t.needFood = !0;
this.t.job = "animal";
this.t.animal = !0;
this.t.procreate = !0;
this.t.source_meat = !0;
this.t.defaultWeapon = "jaws";
this.t.maxAge = 100;
var b = new l.default();
b.id = "_peacefulAnimal";
b.kingdom = "neutral_animals";
b.canBeKilledByStuff = !0;
b.canBeKilledByDrawing = !0;
b.swimToIsland = !0;
b.procreate = !0;
b.canBeMovedByPowers = !0;
b.canBeHurtByPowers = !0;
b.updateZ = !0;
b.effectDamage = !0;
b.flipAnimation = !0;
b.needFood = !0;
b.canBeInspected = !0;
b.hideOnMinimap = !0;
b.animal = !0;
b.deathAnimationAngle = !0;
b.prefab = "p_unit";
b.canHaveStatusEffect = !0;
this.add(b);
this.t.canTurnIntoMush = !0;
this.t.mushID = "mush_animal";
this.t.canTurnIntoTumorMonster = !0;
this.t.tumorMonsterID = "tumor_monster_animal";
this.t.maxAge = 200;
this.t.animation_walk = "walk_0,walk_1,walk_2,walk_2,walk_1";
this.t.animation_swim = "swim_0,swim_1,swim_1,swim_2";
this.t.animation_walk_speed = .03;
this.t.animation_swim_speed = .12;
this.t.baseStats.damage = 1;
this.addTrait("peaceful");
this.t.job = "animal";
this.clone("_carnivore", "_animal");
this.t.needFood = !0;
this.t.diet_meat = !0;
this.t.diet_meat_insect = !0;
this.clone("_herbivore", "_peacefulAnimal");
this.t.needFood = !0;
this.t.diet_grass = !0;
this.t.diet_flowers = !0;
this.t.diet_crops = !0;
this.t.diet_berries = !0;
this.t.diet_meat_insect = !0;
this.clone("_omnivore", "_animal");
this.t.needFood = !0;
this.t.diet_meat = !0;
this.t.diet_meat_insect = !0;
this.t.diet_grass = !1;
this.t.diet_flowers = !0;
this.t.diet_crops = !0;
this.t.diet_berries = !0;
this.clone("sheep", "_herbivore");
this.t.nameLocale = "Sheeps";
this.t.nameTemplate = "sheep_name";
this.t.baseStats.speed = 30;
this.t.race = "sheep";
this.t.diet_grass = !0;
this.t.source_meat = !0;
this.t.actorSize = c.ActorSize.Normal;
this.t.icon = "iconSheep";
this.t.color = d.Toolbox.makeColor("#D7D7D7");
this.t.baseStats.damage = 5;
this.t.job = "animal_herd";
this.t.texture_path = "t_sheep";
this.t.playRandomSound = !0;
this.t.playRandomSound_id = "sheep";
this.t.canTurnIntoZombie = !0;
this.t.zombieID = "zombie_sheep";
this.clone("zombie_sheep", "sheep");
this.t.nameLocale = "Zombie";
this.t.texture_path = "t_zombie_sheep";
this.setZombie();
this.clone("cow", "_herbivore");
this.t.nameLocale = "Cow";
this.t.kingdom = "neutral_animals";
this.t.nameTemplate = "cow_name";
this.t.baseStats.speed = 30;
this.t.race = "cow";
this.t.diet_grass = !0;
this.t.source_meat = !0;
this.t.actorSize = c.ActorSize.Normal;
this.t.icon = "iconCow";
this.t.color = d.Toolbox.makeColor("#D7D7D7");
this.t.baseStats.damage = 5;
this.t.job = "animal";
this.t.texture_path = "t_cow";
this.t.playRandomSound = !1;
this.t.playRandomSound_id = "cow";
this.t.canTurnIntoZombie = !0;
this.t.zombieID = "zombie_cow";
this.clone("zombie_cow", "cow");
this.t.nameLocale = "Zombie";
this.t.texture_path = "t_zombie_cow";
this.setZombie();
this.clone("penguin", "_animal");
this.t.nameLocale = "Penguin";
this.t.job = "animal_water_eater";
this.t.nameTemplate = "penguin_name";
this.t.needFood = !0;
this.t.swimToIsland = !1;
this.t.speedModWater = 30;
this.t.kingdom = "neutral_animals";
this.t.baseStats.speed = 15;
this.t.race = "penguin";
this.t.source_meat = !0;
this.t.actorSize = c.ActorSize.Normal;
this.t.icon = "iconPenguin";
this.t.color = d.Toolbox.makeColor("#D7D7D7");
this.t.baseStats.damage = 5;
this.t.texture_path = "t_penguin";
this.t.playRandomSound = !1;
this.t.playRandomSound_id = "penguin";
this.t.canTurnIntoZombie = !0;
this.t.zombieID = "zombie_penguin";
this.addTrait("weightless");
this.clone("zombie_penguin", "penguin");
this.t.nameLocale = "Zombie";
this.t.texture_path = "t_zombie_penguin";
this.setZombie();
this.clone("turtle", "_animal");
this.t.nameLocale = "Turtle";
this.t.job = "animal_water_eater";
this.t.needFood = !0;
this.t.swimToIsland = !1;
this.t.speedModWater = 40;
this.t.kingdom = "neutral_animals";
this.t.baseStats.speed = 5;
this.t.race = "turtle";
this.t.source_meat = !0;
this.t.actorSize = c.ActorSize.Small;
this.t.icon = "iconTurtle";
this.t.color = d.Toolbox.makeColor("#D7D7D7");
this.t.baseStats.damage = 5;
this.t.texture_path = "t_turtle";
this.t.playRandomSound = !1;
this.t.playRandomSound_id = "turtle";
this.t.layEggs = !0;
this.t.eggStatsID = "egg_turtle";
this.t.disableJumpAnimation = !0;
this.t.animation_walk_speed = .3;
this.t.animation_walk = "walk_0,walk_1,walk_2";
this.t.canTurnIntoZombie = !0;
this.t.zombieID = "zombie_turtle";
this.addTrait("weightless");
this.clone("zombie_turtle", "turtle");
this.t.nameLocale = "Zombie";
this.t.texture_path = "t_zombie_turtle";
this.setZombie();
this.clone("crab", "_animal");
this.t.nameLocale = "Crab";
this.t.kingdom = "crab";
this.t.race = "crab";
this.t.needFood = !0;
this.t.swimToIsland = !1;
this.t.job = "crab";
this.t.disableJumpAnimation = !0;
this.t.baseStats.speed = 10;
this.t.source_meat = !0;
this.t.actorSize = c.ActorSize.Small;
this.t.icon = "iconCrab";
this.t.color = d.Toolbox.makeColor("#D7D7D7");
this.t.baseStats.damage = 5;
this.t.texture_path = "t_crab";
this.t.playRandomSound = !1;
this.t.playRandomSound_id = "crab";
this.t.layEggs = !0;
this.t.eggStatsID = "egg_crab";
this.t.canTurnIntoZombie = !0;
this.t.zombieID = "zombie_crab";
this.addTrait("weightless");
this.clone("zombie_crab", "crab");
this.t.nameLocale = "Zombie";
this.t.texture_path = "t_zombie_crab";
this.setZombie();
this.clone("fairy", "_peacefulAnimal");
this.t.nameLocale = "Fairy";
this.t.kingdom = "good";
this.t.procreate = !1;
this.t.animation_walk = "walk_0,walk_1,walk_2,walk_3";
this.t.baseStats.health = 10;
this.t.animationAlwaysLooped = !0;
this.t.baseStats.speed = 35;
this.t.needFood = !1;
this.t.race = "good";
this.t.hovering = !0;
this.t.source_meat = !1;
this.t.source_meat_insect = !1;
this.t.actorSize = c.ActorSize.VerySmall;
this.t.icon = "iconFairy";
this.t.color = d.Toolbox.makeColor("#23F3FF");
this.t.baseStats.damage = 5;
this.t.texture_path = "t_fairy";
this.t.disableJumpAnimation = !0;
this.addTrait("weightless");
this.addTrait("healing_aura");
this.addTrait("immune");
this.addTrait("immortal");
this.addTrait("energized");
this.t.action_death.clear();
this.t.action_death.add(s.default.tryToCreateFlowers);
var T = new l.default();
T.id = "_insect";
T.race = "insect";
T.kingdom = "neutral_animals";
T.canBeKilledByStuff = !0;
T.canBeKilledByDrawing = !0;
T.dieInWater = !0;
T.procreate = !1;
T.canBeMovedByPowers = !0;
T.canBeHurtByPowers = !0;
T.updateZ = !0;
T.effectDamage = !0;
T.flipAnimation = !0;
T.needFood = !1;
T.canBeInspected = !0;
T.hideOnMinimap = !0;
T.animal = !0;
T.source_meat_insect = !0;
T.actorSize = c.ActorSize.Tiny;
T.color = d.Toolbox.makeColor("#23F3FF");
T.deathAnimationAngle = !0;
T.prefab = "p_unit";
T.canHaveStatusEffect = !0;
this.add(T);
this.t.maxAge = 200;
this.t.animation_walk = "walk_0,walk_1,walk_2,walk_2,walk_1";
this.t.animation_swim = "swim_0,swim_1,swim_1,swim_2";
this.t.animation_walk_speed = .03;
this.t.animation_swim_speed = .12;
this.t.baseStats.speed = 3;
this.t.baseStats.health = 1;
this.t.baseStats.damage = 1;
this.addTrait("peaceful");
this.t.job = "animal";
this.t.maxRandomAmount = 5;
this.clone("_flying_insect", "_insect");
this.t.animationAlwaysLooped = !0;
this.t.hovering = !0;
this.t.disableJumpAnimation = !0;
this.t.animationAlwaysLooped = !0;
this.t.skipSave = !0;
this.t.flipAnimation = !1;
this.t.dieInWater = !1;
this.addTrait("weightless");
this.clone("bee", "_flying_insect");
this.t.nameLocale = "Bee";
this.t.animation_walk = "walk_0,walk_1";
this.t.baseStats.health = 10;
this.t.baseStats.speed = 15;
this.t.hovering_max = 1;
this.t.flipAnimation = !0;
this.t.icon = "iconBee";
this.t.color = d.Toolbox.makeColor("#23F3FF");
this.t.baseStats.damage = 5;
this.t.diet_meat_insect = !1;
this.t.diet_meat = !1;
this.t.diet_meat_same_race = !1;
this.t.texture_path = "t_bee";
this.t.needFood = !1;
this.t.job = "bee";
this.clone("fly", "_flying_insect");
this.t.nameLocale = "Fly";
this.t.texture_path = "t_fly";
this.clone("butterfly", "_flying_insect");
this.t.nameLocale = "Butterfly";
this.t.icon = "iconButterfly";
this.t.baseStats.health = 10;
this.t.baseStats.speed = 15;
this.t.texture_path = "t_butterfly";
this.t.maxRandomAmount = 6;
this.t.flipAnimation = !0;
this.t.color = d.Toolbox.makeColor("#23F3FF");
this.t.action_death.clear();
this.t.action_death.add(s.default.tryToCreateFlowers);
this.clone("grasshopper", "_insect");
this.t.nameLocale = "Grasshopper";
this.t.texture_path = "t_grasshopper";
this.t.shadow = !1;
this.clone("beetle", "_insect");
this.t.nameLocale = "Beetle";
this.t.disableJumpAnimation = !0;
this.t.texture_path = "t_beetle";
this.t.shadow = !1;
var w = new l.default();
w.id = "_egg";
w.kingdom = "neutral_animals";
w.egg = !0;
w.source_meat = !0;
w.canBeKilledByStuff = !0;
w.canBeKilledByDrawing = !0;
w.skipFightLogic = !0;
w.updateZ = !0;
w.effectDamage = !0;
w.canBeMovedByPowers = !0;
w.canBeHurtByPowers = !0;
w.specialAnimation = !0;
w.hideOnMinimap = !0;
w.canBeInspected = !0;
w.deathAnimationAngle = !0;
w.prefab = "p_unit";
w.ignoreJobs = !0;
w.canHaveStatusEffect = !0;
this.add(w);
this.t.color = d.Toolbox.makeColor("#E5E5B8");
this.t.needFood = !1;
this.t.actorSize = c.ActorSize.VerySmall;
this.t.animation_walk = "walk_0";
this.t.kingdom = "neutral_animals";
this.addFlag("egg");
this.t.setBaseStats(1, 0, 0, 0, 0, 0, 0);
this.t.inspect_stats = !1;
this.addTrait("strong_minded");
this.addTrait("immune");
this.clone("egg_chicken", "_egg");
this.t.nameLocale = "Chicken";
this.t.race = "chicken";
this.t.nameTemplate = "chicken_name";
this.t.growIntoID = "chick";
this.t.texture_path = "t_egg_chicken";
this.clone("egg_crab", "_egg");
this.t.nameLocale = "Crab";
this.t.race = "crab";
this.t.growIntoID = "crab";
this.t.texture_path = "t_egg_crab";
this.clone("egg_turtle", "_egg");
this.t.nameLocale = "Turtle";
this.t.race = "turtle";
this.t.growIntoID = "turtle";
this.t.texture_path = "t_egg_turtle";
this.clone("chicken", "_herbivore");
this.t.nameLocale = "Chicken";
this.t.baseStats.health = 50;
this.t.baseStats.speed = 20;
this.t.baseStats.damage = 4;
this.t.race = "chicken";
this.t.nameTemplate = "chicken_name";
this.t.diet_grass = !0;
this.t.source_meat = !0;
this.t.actorSize = c.ActorSize.VerySmall;
this.t.layEggs = !0;
this.t.eggStatsID = "egg_chicken";
this.t.icon = "iconChicken";
this.t.color = d.Toolbox.makeColor("#DEDAC4");
this.t.texture_path = "t_chicken";
this.addTrait("weightless");
this.t.canTurnIntoZombie = !0;
this.t.zombieID = "zombie_chicken";
this.clone("zombie_chicken", "chicken");
this.t.nameLocale = "Zombie";
this.t.texture_path = "t_zombie_chicken";
this.setZombie();
this.clone("chick", "chicken");
this.t.procreate = !1;
this.t.baseStats.health = 20;
this.t.baseStats.speed = 10;
this.t.baseStats.damage = 1;
this.t.layEggs = !1;
this.t.texture_path = "t_chick";
this.t.baby = !0;
this.t.timeToGrow = 100;
this.t.growIntoID = "chicken";
this.clone("rat", "_omnivore");
this.t.nameLocale = "Rat";
this.t.baseStats.health = 10;
this.t.baseStats.damage = 2;
this.t.actorSize = c.ActorSize.VerySmall;
this.t.texture_path = "t_rat";
this.t.dieInWater = !1;
this.t.race = "rat";
this.t.kingdom = "rats";
this.t.baseStats.speed = 30;
this.t.shadow = !0;
this.t.needFood = !0;
this.t.source_meat = !0;
this.t.diet_meat_same_race = !0;
this.t.maxRandomAmount = 5;
this.t.canAttackBuildings = !1;
this.t.color = d.Toolbox.makeColor("#2D2D2D");
this.t.job = "rat";
this.addTrait("rat");
this.t.canTurnIntoZombie = !0;
this.t.zombieID = "zombie_rat";
this.clone("zombie_rat", "rat");
this.t.nameLocale = "Zombie";
this.t.texture_path = "t_zombie_rat";
this.setZombie();
this.clone("ratKing", "_omnivore");
this.t.nameLocale = "Rat King";
this.t.procreate = !1;
this.t.baseStats.health = 50;
this.t.baseStats.speed = 30;
this.t.baseStats.damage = 5;
this.t.race = "rat";
this.t.kingdom = "ratKings";
this.t.source_meat = !0;
this.t.actorSize = c.ActorSize.Small;
this.t.icon = "iconRatKing";
this.t.color = d.Toolbox.makeColor("#2D2D2D");
this.t.texture_path = "t_ratking";
this.t.needFood = !0;
this.t.diet_meat = !0;
this.t.canAttackBuildings = !1;
this.t.diet_meat_same_race = !0;
this.t.job = "rat";
this.addTrait("weightless");
this.addTrait("ratKing");
this.t.canTurnIntoZombie = !0;
this.t.zombieID = "zombie_ratKing";
this.clone("zombie_ratKing", "ratKing");
this.t.nameLocale = "Zombie";
this.t.texture_path = "t_zombie_ratking";
this.setZombie();
this.clone("cat", "_carnivore");
this.t.nameLocale = "Cat";
this.t.kingdom = "cats";
this.t.baseStats.health = 99;
this.t.baseStats.speed = 30;
this.t.baseStats.damage = 4;
this.t.race = "cat";
this.t.skipFightLogic = !1;
this.t.source_meat = !0;
this.t.actorSize = c.ActorSize.Small;
this.t.icon = "iconCat";
this.t.color = d.Toolbox.makeColor("#C2974E");
this.t.texture_path = "t_cat";
this.t.canTurnIntoZombie = !0;
this.t.zombieID = "zombie_cat";
this.addTrait("weightless");
this.t.defaultWeapon = "claws";
this.clone("zombie_cat", "cat");
this.t.nameLocale = "Zombie";
this.t.texture_path = "t_zombie_cat";
this.setZombie();
this.clone("rabbit", "_herbivore");
this.t.nameLocale = "Rabbit";
this.t.baseStats.speed = 20;
this.t.race = "rabbit";
this.t.source_meat = !0;
this.t.actorSize = c.ActorSize.VerySmall;
this.t.icon = "iconRabbit";
this.t.color = d.Toolbox.makeColor("#D3D6D1");
this.t.texture_path = "t_rabbit";
this.addTrait("weightless");
this.t.canTurnIntoZombie = !0;
this.t.zombieID = "zombie_rabbit";
this.clone("zombie_rabbit", "rabbit");
this.t.nameLocale = "Zombie";
this.t.texture_path = "t_zombie_rabbit";
this.setZombie();
this.clone("piranha", "_mob");
this.t.nameLocale = "Piranha";
this.t.race = "piranha";
this.t.kingdom = "piranhas";
this.t.baseStats.speed = 30;
this.t.baseStats.attackSpeed = 200;
this.t.baseStats.damage = 20;
this.t.baseStats.knockback = .5;
this.t.canAttackBuildings = !1;
this.t.dieOnGround = !0;
this.t.waterCreature = !0;
this.t.swimToIsland = !1;
this.t.diet_meat = !0;
this.t.actorSize = c.ActorSize.Small;
this.t.icon = "iconPiranha";
this.t.needFood = !1;
this.t.color = d.Toolbox.makeColor("#3483B6");
this.t.job = "random_swim";
this.t.texture_path = "t_piranha";
this.clone("bandit", "_mob");
this.t.nameLocale = "Bandits";
this.t.body_separate_part_head = !0;
this.t.body_separate_part_hands = !0;
this.t.race = "bandit";
this.t.kingdom = "bandits";
this.t.baseStats.speed = 60;
this.t.baseStats.attackSpeed = 100;
this.t.baseStats.damage = 10;
this.t.baseStats.knockback = 1;
this.t.icon = "iconBandit";
this.t.needFood = !1;
this.t.color = d.Toolbox.makeColor("#4A3F35");
this.t.canTurnIntoZombie = !0;
this.t.zombieID = "zombie";
this.t.skeletonID = "skeleton_cursed";
this.t.texture_path = "t_bandit";
this.t.texture_heads = "t_bandit_heads";
this.t.defaultWeapons = [ "spear", "sword", "bow" ];
this.t.defaultWeaponsMaterial = [ "bronze", "steel", "iron" ];
this.t.use_items = !0;
this.t.take_items = !0;
this.addTrait("bomberman");
this.clone("snowman", "_mob");
this.t.nameLocale = "Snowman";
this.t.race = "snowman";
this.t.kingdom = "snowman";
this.t.baseStats.speed = 30;
this.t.baseStats.attackSpeed = 70;
this.t.baseStats.damage = 10;
this.t.baseStats.knockback = 1;
this.t.defaultWeapon = "snowball";
this.t.icon = "iconSnowman";
this.t.color = d.Toolbox.makeColor("#FFFFFF");
this.t.texture_path = "t_snowman";
this.t.dieInWater = !0;
this.t.canTurnIntoMush = !1;
this.t.canTurnIntoTumorMonster = !1;
this.addTrait("regeneration");
this.addTrait("cold_aura");
this.addTrait("fat");
this.addTrait("freeze_proof");
this.clone("bear", "_carnivore");
this.t.nameLocale = "Bear";
this.t.race = "bear";
this.t.kingdom = "bears";
this.t.baseStats.health = 110;
this.t.baseStats.speed = 60;
this.t.baseStats.attackSpeed = 200;
this.t.baseStats.damage = 25;
this.t.baseStats.knockback = 1.2;
this.t.baseStats.knockbackReduction = 30;
this.t.baseStats.targets = 2;
this.t.procreate = !0;
this.t.diet_meat = !0;
this.t.diet_berries = !0;
this.t.canTurnIntoZombie = !0;
this.t.zombieID = "zombie_bear";
this.t.canAttackBuildings = !1;
this.t.actorSize = c.ActorSize.Big;
this.t.icon = "iconBear";
this.t.color = d.Toolbox.makeColor("#6C522D");
this.t.texture_path = "t_bear";
this.addTrait("strong");
this.t.defaultWeapon = "claws";
this.clone("zombie_bear", "bear");
this.t.nameLocale = "Zombie";
this.t.texture_path = "t_zombie_bear";
this.setZombie();
this.clone("wolf", "_carnivore");
this.t.nameLocale = "Wolfs";
this.t.nameTemplate = "wolf_name";
this.t.race = "wolf";
this.t.kingdom = "wolves";
this.t.baseStats.speed = 70;
this.t.canAttackBuildings = !1;
this.t.baseStats.attackSpeed = 100;
this.t.baseStats.damage = 15;
this.t.baseStats.knockback = .8;
this.t.procreate = !0;
this.t.canTurnIntoZombie = !0;
this.t.zombieID = "zombie_wolf";
this.t.actorSize = c.ActorSize.Normal;
this.t.texture_path = "t_wolf";
this.t.icon = "iconWolf";
this.t.color = d.Toolbox.makeColor("#393939");
this.t.job = "animal_herd";
this.t.playRandomSound = !0;
this.t.playRandomSound_id = "wolf";
this.t.diet_meat_same_race = !0;
this.t.diet_meat = !0;
this.clone("zombie_wolf", "wolf");
this.t.nameLocale = "Zombie";
this.t.texture_path = "t_zombie_wolf";
this.setZombie();
this.clone("demon", "_mob");
this.t.nameLocale = "Demon";
this.t.body_separate_part_head = !0;
this.t.body_separate_part_hands = !0;
this.t.defaultWeapons = [ "flame_sword" ];
this.t.use_items = !0;
this.t.race = "demon";
this.t.kingdom = "demons";
this.t.baseStats.health = 120;
this.t.baseStats.speed = 60;
this.t.baseStats.attackSpeed = 10;
this.t.baseStats.damage = 10;
this.t.baseStats.knockback = 1;
this.t.baseStats.targets = 0;
this.t.dieInWater = !0;
this.t.dieInLava = !1;
this.t.icon = "iconDemon";
this.t.needFood = !1;
this.t.color = d.Toolbox.makeColor("#EE3A42");
this.t.canTurnIntoZombie = !0;
this.t.zombieID = "zombie";
this.t.skeletonID = "skeleton_cursed";
this.t.job = "move_mob";
this.t.texture_path = "t_demon";
this.t.texture_heads = "t_demon_heads";
this.t.animation_walk = "walk_0,walk_1,walk_2,walk_3";
this.t.animation_swim = "swim_0,swim_1,swim_2,swim_3";
this.t.disableJumpAnimation = !0;
this.addTrait("immortal");
this.addTrait("regeneration");
this.addTrait("burning_feet");
this.addTrait("fire_blood");
this.addTrait("fire_proof");
this.addTrait("evil");
this.clone("zombie", "_mob");
this.t.nameLocale = "Zombie";
this.t.body_separate_part_head = !0;
this.t.body_separate_part_hands = !0;
this.t.baseStats.health = 150;
this.t.baseStats.speed = 10;
this.t.baseStats.attackSpeed = 110;
this.t.baseStats.damage = 24;
this.t.baseStats.dodge = 0;
this.t.baseStats.knockback = 1;
this.t.icon = "iconZombie";
this.t.needFood = !1;
this.t.use_items = !0;
this.t.color = d.Toolbox.makeColor("#24803E");
this.t.job = "move_mob";
this.t.texture_path = "t_zombie_human";
this.t.texture_heads = "t_zombie_human_heads";
this.t.canAttackBuildings = !1;
this.t.canAttackBrains = !0;
this.t.disableJumpAnimation = !0;
this.t.animation_walk = "walk_0,walk_1,walk_2,walk_3";
this.t.animation_swim = "swim_0,swim_1,swim_2,swim_3";
this.setZombie();
this.clone("zombie_orc", "zombie");
this.t.texture_path = "t_zombie_orc";
this.t.texture_heads = "t_zombie_orc_heads";
this.addTrait("regeneration");
this.addTrait("savage");
this.clone("zombie_dwarf", "zombie");
this.t.texture_path = "t_zombie_dwarf";
this.t.texture_heads = "t_zombie_dwarf_heads";
this.addTrait("miner");
this.clone("zombie_elf", "zombie");
this.t.texture_path = "t_zombie_elf";
this.t.texture_heads = "t_zombie_elf_heads";
this.addTrait("weightless");
this.clone("necromancer", "_mob");
this.t.nameLocale = "Necromancer";
this.t.body_separate_part_head = !1;
this.t.body_separate_part_hands = !0;
this.t.race = "necromancer";
this.t.kingdom = "undead";
this.t.baseStats.health = 500;
this.t.baseStats.speed = 30;
this.t.baseStats.attackSpeed = 0;
this.t.baseStats.damage = 1;
this.t.baseStats.knockback = 1;
this.t.baseStats.targets = 1;
this.t.dieInLava = !0;
this.t.icon = "iconNecromancer";
this.t.needFood = !1;
this.t.color = d.Toolbox.makeColor("#EE3A42");
this.t.canTurnIntoZombie = !0;
this.t.zombieID = "zombie";
this.t.skeletonID = "skeleton_cursed";
this.t.job = "necromancer";
this.t.attack_spells = [ "curse", "spawnSkeleton", "bloodRain", "bloodRain" ];
this.t.effect_cast_top = "fx_cast_top_green";
this.t.effect_cast_ground = "fx_cast_ground_green";
this.t.texture_path = "t_necromancer";
this.t.use_items = !0;
this.t.defaultWeapons = [ "necromancer_staff" ];
this.t.animation_walk = "walk_0,walk_1,walk_2,walk_3";
this.t.animation_swim = "swim_0,swim_1,swim_2,swim_3";
this.t.disableJumpAnimation = !0;
this.t.action_death.clear();
this.t.action_death.add(s.default.mageDeath);
this.addTrait("immortal");
this.addTrait("regeneration");
this.addTrait("evil");
this.clone("druid", "_mob");
this.t.nameLocale = "Druid";
this.t.body_separate_part_head = !0;
this.t.body_separate_part_hands = !0;
this.t.race = "good";
this.t.kingdom = "druid";
this.t.baseStats.health = 500;
this.t.baseStats.speed = 30;
this.t.baseStats.attackSpeed = 0;
this.t.baseStats.damage = 1;
this.t.baseStats.knockback = 1;
this.t.baseStats.targets = 1;
this.t.dieInLava = !0;
this.t.icon = "iconDruid";
this.t.needFood = !1;
this.t.color = d.Toolbox.makeColor("#EE3A42");
this.t.canTurnIntoZombie = !0;
this.t.zombieID = "zombie";
this.t.skeletonID = "skeleton_cursed";
this.t.job = "druid";
this.t.attack_spells = [ "bloodRain" ];
this.t.effect_cast_top = "fx_cast_top_blue";
this.t.effect_cast_ground = "fx_cast_ground_blue";
this.t.texture_path = "t_druid";
this.t.texture_heads = "t_druid_heads";
this.t.use_items = !0;
this.t.defaultWeapons = [ "druid_staff" ];
this.t.animation_walk = "walk_0,walk_1,walk_2,walk_3";
this.t.animation_swim = "swim_0,swim_1,swim_2,swim_3";
this.t.disableJumpAnimation = !0;
this.t.action_death.clear();
this.t.action_death.add(s.default.mageDeath);
this.t.action_death.add(s.default.tryToGrowTree);
this.addTrait("immortal");
this.addTrait("regeneration");
this.addTrait("flower_prints");
this.clone("plagueDoctor", "_mob");
this.t.nameLocale = "Plague Doctor";
this.t.immune_to_tumor = !0;
this.t.body_separate_part_head = !1;
this.t.body_separate_part_hands = !0;
this.t.race = "good";
this.t.kingdom = "good";
this.t.maxAge = 100;
this.t.baseStats.health = 500;
this.t.baseStats.speed = 20;
this.t.baseStats.attackSpeed = 0;
this.t.baseStats.damage = 1;
this.t.baseStats.knockback = 1;
this.t.baseStats.targets = 1;
this.t.dieInLava = !0;
this.t.icon = "iconPlagueDoctor";
this.t.needFood = !1;
this.t.color = d.Toolbox.makeColor("#EE3A42");
this.t.canTurnIntoZombie = !0;
this.t.zombieID = "zombie";
this.t.skeletonID = "skeleton_cursed";
this.t.job = "plague_doctor";
this.t.attack_spells = [ "bloodRain" ];
this.t.effect_cast_top = "fx_cast_top_blue";
this.t.effect_cast_ground = "fx_cast_ground_blue";
this.t.texture_path = "t_plaguedoctor";
this.t.use_items = !0;
this.t.defaultWeapons = [ "plague_doctor_staff" ];
this.t.animation_walk = "walk_0,walk_1,walk_2,walk_3";
this.t.animation_swim = "swim_0,swim_1,swim_2,swim_3";
this.t.disableJumpAnimation = !0;
this.t.action_death.clear();
this.t.action_death.add(s.default.mageDeath);
this.addTrait("regeneration");
this.addTrait("immune");
this.addTrait("fire_proof");
this.clone("whiteMage", "_mob");
this.t.nameLocale = "White Mage";
this.t.body_separate_part_head = !1;
this.t.body_separate_part_hands = !0;
this.t.race = "good";
this.t.kingdom = "good";
this.t.baseStats.health = 300;
this.t.baseStats.speed = 30;
this.t.baseStats.attackSpeed = 0;
this.t.baseStats.damage = 1;
this.t.baseStats.knockback = 1;
this.t.baseStats.targets = 1;
this.t.dieInLava = !0;
this.t.icon = "iconWhiteMage";
this.t.needFood = !1;
this.t.color = d.Toolbox.makeColor("#EE3A42");
this.t.canTurnIntoZombie = !0;
this.t.zombieID = "zombie";
this.t.skeletonID = "skeleton_cursed";
this.t.job = "white_mage";
this.t.attack_spells = [ "teleportRandom", "bloodRain", "shield" ];
this.t.texture_path = "t_whitemage";
this.t.effect_teleport = "fx_teleport_blue";
this.t.effect_cast_top = "fx_cast_top_blue";
this.t.effect_cast_ground = "fx_cast_ground_blue";
this.t.use_items = !0;
this.t.defaultWeapons = [ "white_staff" ];
this.t.animation_walk = "walk_0,walk_1,walk_2,walk_3";
this.t.animation_swim = "swim_0,swim_1,swim_2,swim_3";
this.t.disableJumpAnimation = !0;
this.t.action_death.clear();
this.t.action_death.add(s.default.mageDeath);
this.addTrait("immortal");
this.addTrait("regeneration");
this.addTrait("freeze_proof");
this.clone("evilMage", "_mob");
this.t.nameLocale = "Evil Mage";
this.t.body_separate_part_head = !1;
this.t.body_separate_part_hands = !0;
this.t.race = "evilMage";
this.t.nameTemplate = "evil_mage_name";
this.t.kingdom = "evil";
this.t.baseStats.health = 500;
this.t.baseStats.speed = 30;
this.t.baseStats.attackSpeed = 0;
this.t.baseStats.damage = 1;
this.t.baseStats.knockback = 1;
this.t.baseStats.targets = 1;
this.t.dieInLava = !0;
this.t.icon = "iconEvilMage";
this.t.needFood = !1;
this.t.color = d.Toolbox.makeColor("#EE3A42");
this.t.canTurnIntoZombie = !0;
this.t.zombieID = "zombie";
this.t.skeletonID = "skeleton_cursed";
this.t.job = "evil_mage";
this.t.effect_teleport = "fx_teleport_red";
this.t.effect_cast_top = "fx_cast_top_red";
this.t.effect_cast_ground = "fx_cast_ground_red";
this.t.attack_spells = [ "teleportRandom", "lightning", "tornado", "bloodRain", "bloodRain", "fire" ];
this.t.texture_path = "t_evilmage";
this.t.use_items = !0;
this.t.defaultWeapons = [ "evil_staff" ];
this.t.animation_walk = "walk_0,walk_1,walk_2,walk_3";
this.t.animation_swim = "swim_0,swim_1,swim_2,swim_3";
this.t.disableJumpAnimation = !0;
this.t.action_death.clear();
this.t.action_death.add(s.default.mageDeath);
this.addTrait("evil");
this.addTrait("fire_proof");
this.addTrait("immortal");
this.addTrait("regeneration");
this.clone("skeleton", "_mob");
this.t.nameLocale = "Skeleton";
this.t.body_separate_part_head = !0;
this.t.body_separate_part_hands = !0;
this.t.race = "undead";
this.t.kingdom = "undead";
this.t.baseStats.health = 60;
this.t.baseStats.speed = 30;
this.t.baseStats.attackSpeed = 40;
this.t.baseStats.damage = 10;
this.t.icon = "iconSkeleton";
this.t.needFood = !1;
this.t.color = d.Toolbox.makeColor("#ffffff");
this.t.job = "skeleton_job";
this.t.texture_path = "t_skeleton";
this.t.texture_heads = "t_skeleton_heads";
this.t.defaultWeapons = [ "spear", "sword", "bow" ];
this.t.defaultWeaponsMaterial = [ "bronze", "steel", "iron" ];
this.t.use_items = !0;
this.t.take_items = !0;
this.t.disableJumpAnimation = !0;
this.t.animation_walk = "walk_0,walk_1,walk_2,walk_3";
this.t.animation_swim = "swim_0,swim_1,swim_2,swim_3";
this.t.disableJumpAnimation = !0;
this.t.canTurnIntoMush = !1;
this.t.canTurnIntoTumorMonster = !1;
this.addTrait("immortal");
this.addTrait("weightless");
this.clone("skeleton_cursed", "skeleton");
this.t.defaultWeapons = [];
this.t.defaultWeaponsMaterial = [];
this.clone("mush_unit", "_mob");
this.t.nameLocale = "Mush";
this.t.body_separate_part_head = !0;
this.t.body_separate_part_hands = !0;
this.t.race = "mush";
this.t.kingdom = "mush";
this.t.baseStats.health = 300;
this.t.baseStats.speed = 30;
this.t.baseStats.attackSpeed = 40;
this.t.baseStats.damage = 30;
this.t.icon = "iconMush";
this.t.needFood = !1;
this.t.color = d.Toolbox.makeColor("#FF49CB");
this.t.job = "mush";
this.t.texture_path = "t_mush_unit";
this.t.texture_heads = "t_mush_unit_heads";
this.t.use_items = !0;
this.t.take_items = !0;
this.t.disableJumpAnimation = !0;
this.t.animation_walk = "walk_0,walk_1,walk_2,walk_3";
this.t.animation_swim = "swim_0,swim_1,swim_2,swim_3";
this.t.canTurnIntoZombie = !1;
this.t.canTurnIntoMush = !1;
this.t.canTurnIntoTumorMonster = !1;
this.addTrait("immortal");
this.addTrait("weightless");
this.addTrait("mushSpores");
this.addTrait("regeneration");
this.clone("mush_animal", "mush_unit");
this.t.baseStats.health = 150;
this.t.baseStats.speed = 20;
this.t.baseStats.attackSpeed = 20;
this.t.baseStats.damage = 20;
this.t.texture_path = "t_mush_animal";
this.t.body_separate_part_hands = !1;
this.t.body_separate_part_head = !1;
this.t.use_items = !1;
this.t.take_items = !1;
this.clone("tumor_monster_unit", "_mob");
this.t.nameLocale = "Tumor";
this.t.immune_to_tumor = !0;
this.t.canTurnIntoTumorMonster = !1;
this.t.body_separate_part_head = !0;
this.t.body_separate_part_hands = !0;
this.t.race = "tumor";
this.t.kingdom = "tumor";
this.t.baseStats.health = 60;
this.t.baseStats.speed = 30;
this.t.baseStats.attackSpeed = 40;
this.t.baseStats.damage = 10;
this.t.icon = "iconTumor";
this.t.needFood = !1;
this.t.color = d.Toolbox.makeColor("#FF49CB");
this.t.job = "tumor_monster";
this.t.texture_path = "t_tumor_monster_unit";
this.t.texture_heads = "t_tumor_monster_unit_heads";
this.t.use_items = !0;
this.t.take_items = !0;
this.t.disableJumpAnimation = !0;
this.t.animation_walk = "walk_0,walk_1,walk_2,walk_3";
this.t.animation_swim = "swim_0,swim_1,swim_2,swim_3";
this.addTrait("immortal");
this.addTrait("weightless");
this.clone("tumor_monster_animal", "tumor_monster_unit");
this.t.texture_path = "t_tumor_monster_animal";
this.t.body_separate_part_hands = !1;
this.t.body_separate_part_head = !1;
this.t.use_items = !1;
this.t.take_items = !1;
this.clone("walker", "_mob");
this.t.nameLocale = "Cold Ones";
this.t.body_separate_part_head = !0;
this.t.race = "walker";
this.t.kingdom = "walkers";
this.t.baseStats.speed = 20;
this.t.baseStats.attackSpeed = 160;
this.t.baseStats.damage = 40;
this.t.baseStats.knockback = 1;
this.t.baseStats.targets = 2;
this.t.icon = "iconWalker";
this.t.needFood = !1;
this.t.color = d.Toolbox.makeColor("#90D2D4");
this.t.canTurnIntoZombie = !0;
this.t.zombieID = "zombie";
this.t.skeletonID = "skeleton_cursed";
this.t.job = "move_mob";
this.t.texture_path = "t_walker";
this.t.texture_heads = "t_walker_heads";
this.t.animation_walk = "walk_0,walk_1,walk_2,walk_3";
this.t.animation_swim = "swim_0,swim_1,swim_2,swim_3";
this.t.disableJumpAnimation = !0;
this.addTrait("immortal");
this.addTrait("regeneration");
this.addTrait("cold_aura");
this.addTrait("weightless");
this.addTrait("freeze_proof");
this.clone("livingPlants", "_mob");
this.t.nameLocale = "Living Plants";
this.t.actorSize = c.ActorSize.Big;
this.t.race = "livingPlants";
this.t.kingdom = "living_plants";
this.t.baseStats.health = 300;
this.t.baseStats.speed = 10;
this.t.baseStats.armor = 0;
this.t.baseStats.attackSpeed = 70;
this.t.baseStats.damage = 30;
this.t.baseStats.knockback = 1.2;
this.t.baseStats.knockbackReduction = 80;
this.t.baseStats.targets = 3;
this.t.dieInWater = !0;
this.t.icon = "iconLivingPlants";
this.t.needFood = !1;
this.t.color = d.Toolbox.makeColor("#115D11");
this.t.rotatingAnimation = !0;
this.t.inspectAvatarScale = 1;
this.t.baseStats.scale = .25;
this.t.canTurnIntoMush = !1;
this.t.canTurnIntoTumorMonster = !1;
this.addTrait("immortal");
this.addTrait("regeneration");
this.clone("livingHouse", "_mob");
this.t.nameLocale = "Living Houses";
this.t.actorSize = c.ActorSize.Big;
this.t.race = "livingHouse";
this.t.kingdom = "living_houses";
this.t.baseStats.health = 500;
this.t.baseStats.armor = 1;
this.t.baseStats.speed = 10;
this.t.baseStats.attackSpeed = 60;
this.t.baseStats.damage = 50;
this.t.baseStats.knockback = 1.4;
this.t.baseStats.knockbackReduction = 80;
this.t.baseStats.targets = 3;
this.t.dieInWater = !0;
this.t.icon = "iconLivingHouse";
this.t.needFood = !1;
this.t.color = d.Toolbox.makeColor("#24803E");
this.t.rotatingAnimation = !0;
this.t.inspectAvatarScale = 1;
this.t.baseStats.scale = .25;
this.t.canTurnIntoMush = !1;
this.t.canTurnIntoTumorMonster = !1;
this.addTrait("immortal");
this.clone("greg", "_mob");
this.t.nameLocale = "Greg";
this.t.actorSize = c.ActorSize.Big;
this.t.texture_path = "t_greg";
this.t.animation_walk = "walk_0";
this.t.animation_swim = "walk_0";
this.t.race = "greg";
this.t.kingdom = "greg";
this.t.baseStats.health = 1e3;
this.t.baseStats.armor = 1;
this.t.baseStats.speed = 5;
this.t.baseStats.attackSpeed = 60;
this.t.baseStats.damage = 20;
this.t.baseStats.knockback = 1.4;
this.t.baseStats.knockbackReduction = 80;
this.t.baseStats.targets = 3;
this.t.dieInWater = !0;
this.t.icon = "iconGreg";
this.t.needFood = !1;
this.t.color = d.Toolbox.makeColor("#24803E");
this.t.rotatingAnimation = !0;
this.t.nameTemplate = "greg";
this.addTrait("immortal");
var B = new l.default();
B.id = "_boat";
B.race = "boat";
B.canBeKilledByStuff = !0;
B.canBeKilledByDrawing = !0;
B.canAttackBuildings = !0;
B.canBeMovedByPowers = !0;
B.canBeHurtByPowers = !0;
B.updateZ = !0;
B.effectDamage = !0;
B.dieOnGround = !0;
B.waterCreature = !0;
B.shadow = !1;
B.isBoat = !0;
B.kingdom = "neutral_animals";
B.skipFightLogic = !0;
B.canBeInspected = !0;
B.hideOnMinimap = !0;
B.inspect_stats = !1;
B.inspect_children = !1;
B.inspect_experience = !1;
B.inspect_kills = !1;
B.inspect_home = !0;
B.specialAnimation = !0;
B.immune_to_injures = !0;
B.prefab = "p_boat";
this.add(B);
this.t.nameLocale = "Boats";
this.t.inspectAvatarScale = 1;
this.t.color = d.Toolbox.makeColor("#000000");
this.t.baseStats.scale = .25;
this.t.baseStats.knockbackReduction = 100;
this.addTrait("boat");
this.clone("boat_trading", "_boat");
this.t.baseStats.health = 1e3;
this.t.baseStats.armor = 50;
this.t.baseStats.speed = 140;
this.t.drawBoatMark = !0;
this.t.job = "boat_trading";
this.t.cost = new u.ConstructionCost(10, 0, 0, 10);
this.clone("boat_transport", "_boat");
this.t.baseStats.speed = 120;
this.t.baseStats.health = 1500;
this.t.baseStats.armor = 60;
this.t.drawBoatMark = !0;
this.t.job = "boat_transport";
this.t.cost = new u.ConstructionCost(5, 0, 2, 20);
this.clone("boat_fishing", "_boat");
this.t.baseStats.speed = 60;
this.t.baseStats.health = 500;
this.t.baseStats.armor = 50;
this.t.job = "boat_fishing";
this.t.cost = new u.ConstructionCost(5, 0, 0, 5);
r.default.d("GENERATE ACTOR STATS " + this.list.length);
this.spawnInRuins.push("rat");
this.list.forEach(function(t) {
e.t = t;
!t.id.includes("_") && t.actorSize <= c.ActorSize.Small && e.addTrait("weightless");
});
};
e.prototype.setZombie = function() {
this.t.nameLocale = "Zombie";
this.t.canAttackBrains = !0;
this.t.race = "undead";
this.t.kingdom = "undead";
this.t.take_items = !1;
this.t.take_items_ignore_range_weapons = !0;
this.addTrait("zombie");
this.addTrait("immortal");
this.t.canTurnIntoZombie = !1;
this.t.needFood = !1;
this.t.zombieID = "";
this.t.job = "move_mob";
this.t.canTurnIntoMush = !1;
};
e.prototype.addFlag = function(t) {
this.t.flags.push(t);
};
e.prototype.clear = function() {
this.list.forEach(function(t) {
t.currentAmount = 0;
});
};
e.prototype.addTrait = function(t) {
this.t.traits.includes(t) || this.t.traits.push(t);
};
e.prototype.removeTrait = function(t) {
this.t.traits.remove(t);
};
e.prototype.clone = function(t, e) {
var i = JSON.parse(JSON.stringify(this.get(e))), o = n.default.fromJson(i, new l.default());
o.action_death = h.default.create();
o.id = t;
this.add(o);
return o;
};
return e;
}(t("../AssetLibrary").default);
i.default = p;
cc._RF.pop();
}, {
"../../../../../framework/utils/Log": void 0,
"../../../../../framework/utils/Tools": void 0,
"../../actors/ActionLibrary": "ActionLibrary",
"../../actors/ActorStats": "ActorStats",
"../../actors/ActorStatus": "ActorStatus",
"../../actors/construction/ConstructionLayerDebug": "ConstructionLayerDebug",
"../../common/ToolBox": "ToolBox",
"../../world/WorldAction": "WorldAction",
"../AssetLibrary": "AssetLibrary"
} ],
ActorStats: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "9dfb0iLOPpIdb23SUFrmqZ6", "ActorStats");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
});
Object.defineProperty(i, "__esModule", {
value: !0
});
var r = t("../assetLibrary/AssetLibrary"), n = t("../base/BaseStats"), s = t("../world/WorldAction"), l = t("./ActorStatus"), c = function(t) {
a(e, t);
function e() {
var e = t.call(this) || this;
e.race = "animal";
e.nameLocale = "";
e.kingdom = "";
e.actorSize = l.ActorSize.Normal;
e.animation_walk = "";
e.animation_walk_speed = .1;
e.animation_swim = "";
e.animation_swim_speed = .1;
e.texture_heads = "";
e.baseStats = new n.default();
e.defaultWeapon = "base";
e.immune_to_tumor = !1;
e.aggression = 0;
e.shadow = !0;
e.hit_fx_alternative_offset = !0;
e.canLevelUp = !0;
e.nameTemplate = "default_name";
e.playRandomSound = !1;
e.playRandomSound_id = "-";
e.maxAge = 0;
e.timeToGrow = 0;
e.use_items = !1;
e.take_items = !1;
e.take_items_ignore_range_weapons = !1;
e.animation_idle = 0;
e.canBeKilledByStuff = !1;
e.canBeKilledByDrawing = !1;
e.ignoreTileSpeedMod = !1;
e.skipFightLogic = !1;
e.canAttackBuildings = !1;
e.canAttackBrains = !1;
e.ignoreJobs = !1;
e.countAsUnit = !0;
e.egg = !1;
e.animal = !1;
e.unit = !1;
e.baby = !1;
e.texture_path = "";
e.body_separate_part_head = !1;
e.body_separate_part_hands = !1;
e.hovering_min = .5;
e.hovering_max = 1.2;
e.hovering = !1;
e.flying = !1;
e.disableJumpAnimation = !1;
e.rotatingAnimation = !1;
e.dieOnBlocks = !0;
e.dieOnGround = !1;
e.dieInWater = !1;
e.waterCreature = !1;
e.isBoat = !1;
e.drawBoatMark = !1;
e.swimToIsland = !1;
e.speedModWater = 1;
e.procreate = !1;
e.layEggs = !1;
e.eggStatsID = "";
e.prefab = "";
e.dieInLava = !0;
e.canBeMovedByPowers = !1;
e.canBeHurtByPowers = !1;
e.canTurnIntoZombie = !1;
e.canTurnIntoMush = !1;
e.canTurnIntoTumorMonster = !1;
e.canReceiveTraits = !0;
e.zombieID = "";
e.skeletonID = "";
e.mushID = "";
e.tumorMonsterID = "";
e.showIconInspectWindow = !1;
e.showIconInspectWindow_id = "";
e.hideFavoriteIcon = !1;
e.canBeInspected = !1;
e.inspectAvatarScale = 2.5;
e.maxHunger = 100;
e.needFood = !1;
e.diet_berries = !1;
e.diet_crops = !1;
e.diet_flowers = !1;
e.diet_grass = !1;
e.diet_meat = !1;
e.diet_meat_insect = !1;
e.diet_meat_same_race = !1;
e.source_meat = !1;
e.source_meat_insect = !1;
e.defaultZ = 0;
e.updateZ = !1;
e.hideOnMinimap = !1;
e.inspect_stats = !0;
e.inspect_children = !0;
e.inspect_kills = !0;
e.inspect_experience = !0;
e.inspect_home = !1;
e.immune_to_injures = !1;
e.job = "";
e.effect_cast_top = "";
e.effect_cast_ground = "";
e.effect_teleport = "";
e.attack_spells = [];
e.heads = 7;
e.animationAlwaysLooped = !1;
e.effectDamage = !1;
e.specialAnimation = !1;
e.flipAnimation = !1;
e.specialDeadAnimation = !1;
e.deathAnimationAngle = !1;
e.canHaveStatusEffect = !1;
e.dieByLightning = !1;
e.growIntoID = "";
e.icon = "iconQuestionMark";
e.skipSave = !1;
e.color = cc.Color.TRANSPARENT;
e.cost = null;
e.traits = [];
e.defaultWeapons = [];
e.defaultWeaponsMaterial = [];
e.flags = [];
e.flags_dict = null;
e.maxRandomAmount = 3;
e.currentAmount = 0;
e.action_death = s.default.create();
e.baseStats.damage = 10;
e.baseStats.health = 100;
e.baseStats.armor = 0;
e.baseStats.speed = 40;
e.baseStats.dodge = 0;
e.baseStats.accuracy = 90;
e.baseStats.attackSpeed = 1;
e.baseStats.diplomacy = 0;
e.baseStats.knockback = 1;
e.baseStats.knockbackReduction = 0;
e.baseStats.targets = 1;
e.baseStats.areaOfEffect = 1;
e.baseStats.size = .5;
e.baseStats.range = 1;
e.baseStats.damageCritMod = 2;
e.baseStats.scale = .1;
e.baseStats.mod_supply_timer = 1;
return e;
}
e.prototype.clearFlags = function() {
this.flags = [];
this.flags_dict = null;
};
e.prototype.haveFlag = function(t) {
var e = this;
if (null == this.flags_dict) {
this.flags_dict = new Map();
this.flags.forEach(function(t) {
e.flags_dict.set(t, !0);
});
}
return this.flags_dict.has(t);
};
e.prototype.setBaseStats = function(t, e, i, o, a, r, n) {
this.baseStats.health = t;
this.baseStats.damage = e;
this.baseStats.speed = i;
this.baseStats.armor = o;
this.baseStats.dodge = a;
this.baseStats.accuracy = r;
this.baseStats.diplomacy = n;
};
return e;
}(r.Asset);
i.default = c;
cc._RF.pop();
}, {
"../assetLibrary/AssetLibrary": "AssetLibrary",
"../base/BaseStats": "BaseStats",
"../world/WorldAction": "WorldAction",
"./ActorStatus": "ActorStatus"
} ],
ActorStatus: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "60b77tTI5xDy4LQ6EXF4hCc", "ActorStatus");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
}), r = this && this.__values || function(t) {
var e = "function" == typeof Symbol && Symbol.iterator, i = e && t[e], o = 0;
if (i) return i.call(t);
if (t && "number" == typeof t.length) return {
next: function() {
t && o >= t.length && (t = void 0);
return {
value: t && t[o++],
done: !t
};
}
};
throw new TypeError(e ? "Object is not iterable." : "Symbol.iterator is not defined.");
};
Object.defineProperty(i, "__esModule", {
value: !0
});
i.ActorTag = i.ActorSize = i.ActorDirection = i.ActorGender = i.ActorData = i.ActorAsset = i.UnitProfession = i.AttackType = void 0;
var n, s = t("../assetLibrary/AssetManager"), l = t("../base/BaseObjectData"), c = t("../common/ToolBox"), u = t("../MapBox"), d = t("./ActorBag");
(function(t) {
t[t.Acid = 0] = "Acid";
t[t.Fire = 1] = "Fire";
t[t.Plague = 2] = "Plague";
t[t.Tumor = 3] = "Tumor";
t[t.Other = 4] = "Other";
t[t.Bomb = 5] = "Bomb";
t[t.Hunger = 6] = "Hunger";
t[t.Eaten = 7] = "Eaten";
t[t.Age = 8] = "Age";
t[t.GrowUp = 9] = "GrowUp";
t[t.Divine = 10] = "Divine";
t[t.None = 11] = "None";
})(i.AttackType || (i.AttackType = {}));
(function(t) {
t[t.Null = 0] = "Null";
t[t.Baby = 1] = "Baby";
t[t.Unit = 2] = "Unit";
t[t.King = 3] = "King";
t[t.Leader = 4] = "Leader";
t[t.Warrior = 5] = "Warrior";
})(n = i.UnitProfession || (i.UnitProfession = {}));
i.ActorAsset = function() {
this.list = [];
};
i.ActorData = function() {
this.items = [];
this.inventory = new d.default();
this.status = new h();
this.cityID = "";
this.x = 0;
this.y = 0;
this.special = "";
};
(function(t) {
t[t.Unknown = 0] = "Unknown";
t[t.Male = 1] = "Male";
t[t.Female = 2] = "Female";
})(i.ActorGender || (i.ActorGender = {}));
(function(t) {
t[t.Up = 0] = "Up";
t[t.UpRight = 1] = "UpRight";
t[t.Right = 2] = "Right";
t[t.UpLeft = 3] = "UpLeft";
t[t.Down = 4] = "Down";
t[t.DownRight = 5] = "DownRight";
t[t.DownLeft = 6] = "DownLeft";
t[t.Left = 7] = "Left";
})(i.ActorDirection || (i.ActorDirection = {}));
(function(t) {
t[t.Tiny = 0] = "Tiny";
t[t.VerySmall = 1] = "VerySmall";
t[t.Small = 2] = "Small";
t[t.Normal = 3] = "Normal";
t[t.Big = 4] = "Big";
t[t.Huge = 5] = "Huge";
})(i.ActorSize || (i.ActorSize = {}));
i.ActorTag = function() {
this.id = "";
this.valString = "";
this.valInt = 0;
this.valBool = !1;
};
var h = function(t) {
a(e, t);
function e() {
var e = null !== t && t.apply(this, arguments) || this;
e.actorID = "";
e.firstName = "firstName";
e.favoriteFood = "";
e.mood = "";
e.transportID = "";
e.gender = null;
e.head = -1;
e.homeBuildingID = "";
e.statsID = "?";
e.profession = n.Null;
e.kills = 0;
e.age = 1;
e.bornTime = 0;
e.children = 0;
e.hunger = 0;
e.level = 1;
e.experience = 0;
e.diplomacy = 0;
e.stewardship = 0;
e.warfare = 0;
e.favorite = !1;
e.traits = [];
return e;
}
e.prototype.generateTraits = function(t, e) {
var i = this;
t.traits && t.traits.forEach(function(t) {
i.addTrait(t);
});
e.civilization && this.generateCivUnitTraits();
};
e.prototype.addTrait = function(t) {
this.traits.includes(t) || this.traits.push(t);
};
e.prototype.inheritTraits = function(t) {
var e = this;
t.forEach(function(t) {
var i = s.default.traits.get(t);
if (i && 0 != i.inherit) {
var o = c.Toolbox.randomFloat(0, 100);
i.inherit < o || e.traits.includes(i.id) || e.haveOppositeTrait(i) || e.addTrait(i.id);
}
});
};
e.prototype.generateCivUnitTraits = function() {
var t = this;
s.default.traits.list.forEach(function(e) {
if (0 != e.birth) {
var i = c.Toolbox.randomFloat(0, 100);
e.birth < i || t.traits.includes(e.id) || t.haveOppositeTrait(e) || t.addTrait(e.id);
}
});
};
e.prototype.haveOppositeTrait = function(t) {
var e, i;
if (!t || !t.oppositeArr) return !1;
var o = t.oppositeArr;
try {
for (var a = r(o), n = a.next(); !n.done; n = a.next()) {
var s = n.value;
if (this.traits.includes(s)) return !0;
}
} catch (t) {
e = {
error: t
};
} finally {
try {
n && !n.done && (i = a.return) && i.call(a);
} finally {
if (e) throw e.error;
}
}
return !1;
};
e.prototype.updateAge = function(t) {
this.age++;
var e = s.default.unitStats.get(this.statsID);
if (e.unit && this.age % 3 == 0 && this.age <= 100) switch (t.preferred_attribute.getRandom()) {
case "diplomacy":
this.diplomacy++;
break;

case "warfare":
this.warfare++;
break;

case "stewardship":
this.stewardship++;
}
return 0 == e.maxAge || e.maxAge > this.age || !u.default.inst.worldLaws.world_law_old_age.boolVal || !c.Toolbox.randomChance(.3);
};
return e;
}(l.default);
i.default = h;
cc._RF.pop();
}, {
"../MapBox": "MapBox",
"../assetLibrary/AssetManager": "AssetManager",
"../base/BaseObjectData": "BaseObjectData",
"../common/ToolBox": "ToolBox",
"./ActorBag": "ActorBag"
} ],
ActorTool: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "7bd85QGmbhEGJ4gK93fgQrh", "ActorTool");
var o = this && this.__values || function(t) {
var e = "function" == typeof Symbol && Symbol.iterator, i = e && t[e], o = 0;
if (i) return i.call(t);
if (t && "number" == typeof t.length) return {
next: function() {
t && o >= t.length && (t = void 0);
return {
value: t && t[o++],
done: !t
};
}
};
throw new TypeError(e ? "Object is not iterable." : "Symbol.iterator is not defined.");
};
Object.defineProperty(i, "__esModule", {
value: !0
});
i.ActorTileTarget = void 0;
var a, r = t("../assetLibrary/AssetManager"), n = t("../assetLibrary/lib/ResourceLibrary"), s = t("../building/Docks"), l = t("../common/ToolBox"), c = t("../map/map/MapLayer"), u = t("../MapBox");
(function(t) {
t[t.RandomTNT = 0] = "RandomTNT";
t[t.RandomBurnableTile = 1] = "RandomBurnableTile";
t[t.RandomTileWithUnits = 2] = "RandomTileWithUnits";
t[t.RandomTileWithCivStructures = 3] = "RandomTileWithCivStructures";
})(a = i.ActorTileTarget || (i.ActorTileTarget = {}));
var d = function() {
function t() {}
t.countRatsNearby = function(t) {
u.default.inst.getObjectsInChunks(t.currentTile, 10, c.MapObjectType.Actor);
var e = 0;
u.default.inst.temp_map_objects.forEach(function(t) {
t.haveTrait("rat") && e++;
});
return e;
};
t.findNewBuildingTarget = function(e, i) {
var a, r, n, s, l, c, u, d;
if (!e.city) return null;
t.possible_buildings = [];
e.city.zones.shuffle();
switch (i) {
case "new_building":
var h = e.city.getBuildingToBuild();
if (h && h.tiles.length > 0) {
var p = h.getConstructionTile();
p && p.isSameIsland(e.currentTile) && t.possible_buildings.push(h);
}
break;

case "random_house_building":
var f = e.city.buildings.getSimpleList();
f.shuffle();
try {
for (var m = o(f), y = m.next(); !y.done; y = m.next()) {
var _ = y.value;
if ((null === (n = _.currentTile) || void 0 === n ? void 0 : n.isSameIsland(e.currentTile)) && !(null === (s = _.data) || void 0 === s ? void 0 : s.underConstruction) && (null === (l = _.data) || void 0 === l ? void 0 : l.alive) && !(null === (c = _.stats) || void 0 === c ? void 0 : c.isRuin) && 0 != (null === (u = _.stats) || void 0 === u ? void 0 : u.housing)) {
t.possible_buildings.push(_);
break;
}
}
} catch (t) {
a = {
error: t
};
} finally {
try {
y && !y.done && (r = m.return) && r.call(m);
} finally {
if (a) throw a.error;
}
}
break;

case "ruins":
e.city.zones.forEach(function(e) {
e.ruins.forEach(function(e) {
t.possible_buildings.push(e);
});
e.abandoned.forEach(function(e) {
t.possible_buildings.push(e);
});
});
break;

case "mine":
if (e.city.haveBuildingType("mine")) {
var g = e.city.getBuildingType("mine");
(null === (d = g.currentTile) || void 0 === d ? void 0 : d.isSameIsland(e.currentTile)) && t.possible_buildings.push(g);
}
break;

default:
return t.findNewTargetInZones(e, i);
}
return 0 == t.possible_buildings.length ? null : t.possible_buildings.getRandom();
};
t.findNewTargetInZones = function(e, i) {
var o = null;
t.possible_buildings.clear();
for (var a = 0; a < e.city.zones.length; a++) {
var r = e.city.zones[a];
o = null;
switch (i) {
case "trees":
o = r.trees;
break;

case "gold":
o = r.gold;
break;

case "ore":
o = r.ore;
break;

case "stone":
o = r.stone;
break;

case "fruitBush":
o = r.food;
}
if (o && 0 != o.size) {
o.forEach(function(i) {
var o, a, r, s;
!(null === (o = i.currentTile) || void 0 === o ? void 0 : o.targetedBy) && (null === (a = i.currentTile) || void 0 === a ? void 0 : a.isSameIsland(e.currentTile)) && ((null === (r = i.stats) || void 0 === r ? void 0 : r.resourceType) != n.ResourceType.Fruits && (null === (s = i.stats) || void 0 === s ? void 0 : s.resourceType) != n.ResourceType.Tree || i.haveResources) && t.possible_buildings.push(i);
});
if (t.possible_buildings.length > 0) break;
}
}
return 0 == t.possible_buildings.length ? null : t.possible_buildings.getRandom();
};
t.getTileNearby = function(e, i) {
t.temp_chunks.clear();
t.temp_chunks.push(i);
t.temp_chunks.addRange(i.neighboursAll);
t.possible_moves.clear();
for (var o = 0; o < t.temp_chunks.length; o++) {
var r = t.temp_chunks[o];
if (!(t.possible_moves.length > 20)) for (var n = 0; n < r.tiles.length; n++) {
var s = r.tiles[n];
if (!(t.possible_moves.length > 20)) switch (e) {
case a.RandomTNT:
(s.type.landmine || s.type.explodable) && t.possible_moves.push(s);
break;

case a.RandomTileWithUnits:
s.units.length > 0 && t.possible_moves.push(s);
break;

case a.RandomBurnableTile:
(s.type.burnable || s.type.trees) && t.possible_moves.push(s);
break;

case a.RandomTileWithCivStructures:
s.building && s.building.city && t.possible_moves.push(s);
s.type.burnable && s.zone.city && t.possible_moves.push(s);
}
}
}
return 0 == t.possible_moves.length ? null : t.possible_moves.getRandom();
};
t.getDockTradeTarget = function(t) {
var e, i, a = t.currentTile.region.island.docks;
if (0 == a.length) return null;
a.shuffle();
try {
for (var r = o(a), n = r.next(); !n.done; n = r.next()) {
var s = n.value;
if (t.homeBuilding != s.building && (s.isDockGood() || s.checkWaterTiles()) && !s.building.isNonUsable() && !s.building.city.kingdom.isEnemy(t.kingdom)) return s;
}
} catch (t) {
e = {
error: t
};
} finally {
try {
n && !n.done && (i = r.return) && i.call(r);
} finally {
if (e) throw e.error;
}
}
return null;
};
t.getRandomTileForBoat = function(t) {
var e = t.currentTile.region;
e.neighbours.length > 0 && l.Toolbox.randomBool() && (e = e.neighbours.getRandom());
return e.tiles.length > 0 ? e.tiles.getRandom() : null;
};
t.attributeDice = function(t, e) {
void 0 === e && (e = 2);
for (var i = 0, o = t.curStats.diplomacy + t.curStats.warfare + t.curStats.stewardship, a = 0; a < e; a++) i += l.Toolbox.randomInt(0, o);
return i;
};
t.checkHomeDocks = function(t) {
var e;
t.homeBuilding && !t.homeBuilding.isNonUsable() || t.currentTile.region.island.docks.forEach(function(e) {
var i, o, a, r, n;
(null === (i = e.building) || void 0 === i ? void 0 : i.isNonUsable()) || (null === (a = null === (o = e.building) || void 0 === o ? void 0 : o.city) || void 0 === a ? void 0 : a.kingdom.isEnemy(t.kingdom)) || (null === (n = null === (r = e.building) || void 0 === r ? void 0 : r.city) || void 0 === n ? void 0 : n.kingdom) != t.kingdom || e.addBoatToDock(t);
});
t.homeBuilding && !t.homeBuilding.isNonUsable() || t.setHomeBuilding(null);
if (t.homeBuilding) if (null === (e = t.homeBuilding.currentTile) || void 0 === e ? void 0 : e.isSameIsland(t.currentTile)) t.homeBuilding.getComponent(s.default).checkWaterTiles() || t.setHomeBuilding(null); else {
t.homeBuilding.getComponent(s.default).removeBoatFromDock(t);
t.setHomeBuilding(null);
}
};
t.copyUnitToOtherUnit = function(t, e) {
t.spriteRenderer.enabled = !1;
e.currentPosition = t.currentPosition;
e.node.position = t.node.position;
e.curAngle = t.node.eulerAngles;
e.node.eulerAngles = e.curAngle;
e.data.firstName = t.data.firstName;
e.data.age = t.data.age;
e.data.kills = t.data.kills;
e.data.children = t.data.children;
e.data.favorite = t.data.favorite;
e.takeItems(t, e.stats.take_items_ignore_range_weapons);
t.data.traits.forEach(function(t) {
"peaceful" != t && e.addTrait(t);
});
e.statsDirty = !0;
e._positionDirty = !0;
};
t.canBeCuredFromTraits = function(t) {
for (var e = 0; e < t.s_traits_ids.size; e++) {
var i = t.s_traits_ids[e], o = r.default.traits.get(i);
if (o && o.can_be_cured) return !0;
}
return !1;
};
t.possible_moves = [];
t.temp_chunks = [];
t.possible_buildings = [];
return t;
}();
i.default = d;
cc._RF.pop();
}, {
"../MapBox": "MapBox",
"../assetLibrary/AssetManager": "AssetManager",
"../assetLibrary/lib/ResourceLibrary": "ResourceLibrary",
"../building/Docks": "Docks",
"../common/ToolBox": "ToolBox",
"../map/map/MapLayer": "MapLayer"
} ],
ActorTraitLibrary: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "5327freNtFBJ4fx4HY3JNZZ", "ActorTraitLibrary");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
}), r = this && this.__values || function(t) {
var e = "function" == typeof Symbol && Symbol.iterator, i = e && t[e], o = 0;
if (i) return i.call(t);
if (t && "number" == typeof t.length) return {
next: function() {
t && o >= t.length && (t = void 0);
return {
value: t && t[o++],
done: !t
};
}
};
throw new TypeError(e ? "Object is not iterable." : "Symbol.iterator is not defined.");
};
Object.defineProperty(i, "__esModule", {
value: !0
});
i.ActorTrait = i.TraitType = i.TraitGroup = void 0;
var n, s, l = t("../../actors/ActionLibrary"), c = t("../../base/BaseStats"), u = t("../../world/WorldAction"), d = t("../AssetLibrary"), h = t("../AssetManager");
(function(t) {
t[t.Personality = 0] = "Personality";
t[t.Genetic = 1] = "Genetic";
t[t.Other = 2] = "Other";
})(n = i.TraitGroup || (i.TraitGroup = {}));
(function(t) {
t[t.Positive = 0] = "Positive";
t[t.Negative = 1] = "Negative";
t[t.Other = 2] = "Other";
})(s = i.TraitType || (i.TraitType = {}));
var p = function(t) {
a(e, t);
function e() {
var e = null !== t && t.apply(this, arguments) || this;
e.icon = "";
e.birth = 0;
e.inherit = 0;
e.opposite = "";
e.oppositeArr = [];
e.transformationTrait = !1;
e.baseStats = new c.default();
e.sameTraitMod = 0;
e.oppositeTraitMod = 0;
e.group = n.Other;
e.type = s.Other;
e.action_death = u.default.create();
e.action_special_effect = u.default.create();
e.can_be_cured = !1;
return e;
}
return e;
}(d.Asset);
i.ActorTrait = p;
var f = function(t) {
a(e, t);
function e() {
return null !== t && t.apply(this, arguments) || this;
}
e.prototype.init = function() {
t.prototype.init.call(this);
var e = new p();
e.id = "boat";
e.icon = "iconBoat";
e.opposite = "plague,immortal,energized,wise";
this.add(e);
var i = new p();
i.id = "energized";
i.icon = "iconLightning";
this.t.baseStats.speed = 10;
this.add(i);
var o = new p();
o.id = "vermin";
o.icon = "iconVermin";
this.add(o);
var a = new p();
a.id = "ratKing", a.icon = "iconRatKing", this.add(a);
var r = new p();
r.id = "rat", r.icon = "iconRat", this.add(r);
this.t.action_special_effect.add(l.default.ratEffect);
var c = new p();
c.id = "healing_aura", c.icon = "iconHealingAura", this.add(c);
this.t.action_special_effect.add(l.default.healingAuraEffect);
var u = new p();
u.id = "savage";
u.icon = "iconSavage";
u.group = n.Personality;
u.type = s.Positive;
u.sameTraitMod = 5;
u.birth = .5;
this.add(u);
var d = new p();
d.id = "miner";
d.icon = "iconMiner";
d.group = n.Personality;
d.type = s.Positive;
d.birth = .5;
this.add(d);
var h = new p();
h.id = "veteran";
h.icon = "iconVeteran";
h.group = n.Personality;
h.type = s.Positive;
h.sameTraitMod = 5;
this.add(h);
this.t.baseStats.warfare = 5;
this.t.baseStats.damage = 3;
this.t.baseStats.armor = 1;
this.t.baseStats.dodge = 2;
this.t.baseStats.health = 30;
var f = new p();
f.id = "wise";
f.icon = "iconWise";
f.group = n.Personality;
f.type = s.Positive;
f.opposite = "stupid,boat";
this.add(f);
this.t.baseStats.diplomacy = 2;
this.t.baseStats.stewardship = 2;
this.t.baseStats.warfare = 2;
var m = new p();
m.id = "strong_minded";
m.icon = "iconStrongMinded";
m.opposite = "madness";
m.group = n.Personality;
m.type = s.Positive;
this.add(m);
var y = new p();
y.id = "peaceful";
y.icon = "iconPeaceful";
y.group = n.Personality;
y.type = s.Positive;
this.add(y);
var _ = new p();
_.id = "zombie";
_.icon = "iconZombie";
this.add(_);
this.t.action_special_effect.add(l.default.zombieEffect);
var g = new p();
g.id = "infected";
g.icon = "iconInfected";
g.opposite = "immune,boat";
g.inherit = 100;
this.add(g);
this.t.can_be_cured = !0;
this.t.transformationTrait = !0;
this.t.action_special_effect.add(l.default.infectedEffect);
this.t.action_death.add(l.default.turnIntoZombie);
this.t.baseStats.dodge = -5;
this.t.baseStats.speed = 4;
this.t.baseStats.loyalty_traits = -15;
var v = new p();
v.id = "mushSpores";
v.icon = "iconMushSpores";
v.opposite = "immune,boat";
v.inherit = 100;
this.add(v);
this.t.can_be_cured = !0;
this.t.transformationTrait = !0;
this.t.action_death.add(l.default.mushSporesEffect);
this.t.action_death.add(l.default.turnIntoMush);
this.t.baseStats.dodge = -5;
this.t.baseStats.speed = 4;
this.t.baseStats.loyalty_traits = -15;
var b = new p();
b.id = "tumorInfection";
b.icon = "iconTumorInfection";
b.opposite = "immune,boat";
b.inherit = 100;
this.add(b);
this.t.can_be_cured = !0;
this.t.action_special_effect.add(l.default.tumorEffect);
this.t.action_death.add(l.default.turnIntoTumorMonster);
this.t.baseStats.dodge = -5;
this.t.baseStats.speed = 4;
this.t.baseStats.loyalty_traits = -15;
var T = new p();
T.id = "plague";
T.icon = "iconPlague";
T.opposite = "immune,immortal,rat,ratKing,boat";
T.inherit = 100;
this.add(T);
this.t.can_be_cured = !0;
this.t.action_special_effect.add(l.default.plagueEffect);
this.t.baseStats.speed = -10;
this.t.baseStats.damage = -3;
this.t.baseStats.dodge = -10;
this.t.baseStats.armor = -1;
this.t.baseStats.loyalty_traits = -15;
var w = new p();
w.id = "blessed";
w.icon = "iconBlessing";
w.opposite = "evil";
this.add(w);
this.t.baseStats.mod_armor = 10;
this.t.baseStats.mod_damage = 50;
this.t.baseStats.mod_health = 50;
this.t.baseStats.mod_speed = 50;
this.t.baseStats.mod_diplomacy = 20;
this.t.baseStats.mod_crit = 10;
var B = new p();
B.id = "cursed";
B.icon = "iconCurse";
B.opposite = "evil,boat";
this.add(B);
this.t.can_be_cured = !0;
this.t.transformationTrait = !0;
this.t.action_death.add(l.default.turnIntoSkeleton);
this.t.baseStats.loyalty_traits = -100;
this.t.baseStats.mod_armor = -50;
this.t.baseStats.mod_damage = -50;
this.t.baseStats.mod_health = -50;
this.t.baseStats.mod_speed = -20;
this.t.baseStats.mod_diplomacy = -90;
this.t.baseStats.mod_attackSpeed = -50;
var k = new p();
k.id = "evil";
k.icon = "iconEvil";
k.opposite = "cursed,blessed";
this.add(k);
var A = new p();
A.id = "kingslayer";
A.icon = "iconKingslayer";
this.add(A);
this.t.baseStats.mod_supply_timer = 2;
this.t.baseStats.loyalty_traits = -25;
this.t.baseStats.attackSpeed = 5;
this.t.baseStats.diplomacy = -5;
this.t.baseStats.warfare = 5;
var S = new p();
S.id = "mageslayer";
S.icon = "iconMageslayer";
this.add(S);
this.t.baseStats.loyalty_traits = -10;
this.t.baseStats.warfare = 5;
this.t.baseStats.crit = 3;
this.t.baseStats.dodge = 2;
this.t.baseStats.accuracy = 3;
var x = new p();
x.id = "giant";
x.icon = "iconGiant";
x.group = n.Personality;
x.type = s.Positive;
x.opposite = "tiny";
x.birth = .5;
x.inherit = 10;
this.add(x);
this.t.baseStats.scale = .05;
this.t.baseStats.mod_health = 50;
this.t.baseStats.attackSpeed = -5;
var C = new p();
C.id = "tiny";
C.icon = "iconTiny";
C.group = n.Personality;
C.type = s.Negative;
C.opposite = "giant";
C.birth = .5;
C.inherit = 10;
this.add(C);
this.t.baseStats.diplomacy = -1;
this.t.baseStats.scale = -.02;
this.t.baseStats.mod_health = -50;
this.t.baseStats.attackSpeed = 10;
this.t.baseStats.speed = 5;
var O = new p();
O.id = "madness";
O.icon = "iconMadness";
O.opposite = "strong_minded";
this.add(O);
this.t.baseStats.damage = 1;
this.t.baseStats.speed = 5;
this.t.baseStats.diplomacy = -100;
this.t.baseStats.attackSpeed = 10;
this.t.baseStats.loyalty_traits = -100;
var P = new p();
P.id = "immortal";
P.icon = "iconImmortal";
P.birth = .1;
P.sameTraitMod = -20;
P.group = n.Genetic;
P.type = s.Positive;
P.opposite = "boat";
this.add(P);
this.t.baseStats.health = 10;
this.t.baseStats.loyalty_traits = -20;
var R = new p();
R.id = "crippled";
R.icon = "iconCrippled";
R.sameTraitMod = 10;
R.type = s.Negative;
this.add(R);
this.t.baseStats.speed = -15;
this.t.baseStats.diplomacy = -1;
this.t.baseStats.attackSpeed = -15;
var M = new p();
M.id = "eyepatch";
M.icon = "iconEyePatch";
M.sameTraitMod = 20;
M.type = s.Negative;
this.add(M);
this.t.baseStats.accuracy = -10;
this.t.baseStats.diplomacy = 1;
this.t.baseStats.attackSpeed = -15;
this.t.baseStats.crit = -15;
var L = new p();
L.id = "skin_burns";
L.icon = "iconSkinBurns";
L.sameTraitMod = 40;
L.type = s.Negative;
this.add(L);
this.t.baseStats.diplomacy = -1;
this.t.baseStats.speed = -5;
this.t.baseStats.attackSpeed = -5;
var F = new p();
F.id = "tough";
F.icon = "iconTough";
F.birth = 1.5;
F.group = n.Genetic;
F.type = s.Positive;
F.sameTraitMod = -5;
this.add(F);
this.t.baseStats.armor = 2;
var D = new p();
D.id = "strong";
D.icon = "iconStrong";
D.birth = 1.5;
D.opposite = "weak";
D.oppositeTraitMod = -10;
D.sameTraitMod = 5;
D.group = n.Genetic;
D.type = s.Positive;
this.add(D);
this.t.baseStats.damage = 3;
this.t.baseStats.warfare = 2;
var I = new p();
I.id = "weak";
I.icon = "iconWeak";
I.birth = 1.5;
I.opposite = "strong";
I.oppositeTraitMod = -10;
I.group = n.Genetic;
I.type = s.Negative;
this.add(I);
this.t.baseStats.damage = -1;
this.t.baseStats.warfare = -2;
this.t.baseStats.diplomacy = -2;
var j = new p();
j.id = "stupid";
j.icon = "iconStupid";
j.birth = 1.5;
j.opposite = "genius,wise";
j.sameTraitMod = 30;
j.group = n.Genetic;
j.type = s.Negative;
this.add(j);
this.t.baseStats.diplomacy = -2;
this.t.baseStats.warfare = -2;
this.t.baseStats.stewardship = -5;
this.t.baseStats.loyalty_traits = -15;
this.t.baseStats.personality_rationality = -.5;
var E = new p();
E.id = "genius";
E.icon = "iconGenius";
E.birth = .9;
E.opposite = "stupid";
E.sameTraitMod = 20;
E.oppositeTraitMod = -20;
E.group = n.Genetic;
E.type = s.Positive;
this.add(E);
this.t.baseStats.diplomacy = 5;
this.t.baseStats.warfare = 5;
this.t.baseStats.stewardship = 7;
this.t.baseStats.loyalty_traits = -10;
var N = new p();
N.id = "regeneration";
N.icon = "iconRegeneration";
N.birth = .5;
N.group = n.Genetic;
N.type = s.Positive;
this.add(N);
this.t.action_special_effect.add(l.default.regenerationEffect);
var G = new p();
G.id = "ugly";
G.icon = "iconUgly";
G.birth = 2;
G.opposite = "attractive";
G.sameTraitMod = 5;
G.oppositeTraitMod = -15;
G.group = n.Genetic;
G.type = s.Negative;
this.add(G);
var U = new p();
U.id = "fat";
U.icon = "iconFat";
U.birth = 2;
U.opposite = "agile,weightless";
U.oppositeTraitMod = -10;
U.sameTraitMod = 10;
U.group = n.Genetic;
U.type = s.Negative;
this.add(U);
this.t.baseStats.dodge = -10;
this.t.baseStats.accuracy = -5;
this.t.baseStats.attackSpeed = -10;
var z = new p();
z.id = "attractive";
z.icon = "iconAttractive";
z.birth = 1.5;
z.opposite = "ugly";
z.sameTraitMod = 10;
z.group = n.Genetic;
z.type = s.Positive;
this.add(z);
this.t.baseStats.diplomacy = 2;
this.t.baseStats.stewardship = 1;
this.t.baseStats.crit = 10;
var W = new p();
W.id = "fast";
W.icon = "iconFast";
W.birth = 1;
W.opposite = "slow";
W.group = n.Genetic;
W.type = s.Positive;
this.add(W);
this.t.baseStats.speed = 10;
this.t.baseStats.attackSpeed = 5;
var H = new p();
H.id = "slow";
H.icon = "iconSlow";
H.birth = 2;
H.opposite = "fast,agile";
H.group = n.Genetic;
H.type = s.Negative;
this.add(H);
this.t.baseStats.speed = -10;
this.t.baseStats.attackSpeed = -5;
var K = new p();
K.id = "gluttonous";
K.icon = "iconGluttonous";
K.birth = 1;
K.inherit = 50;
K.sameTraitMod = 5;
K.group = n.Genetic;
K.type = s.Negative;
this.add(K);
var V = new p();
V.id = "burning_feet";
V.icon = "iconBurningFeet";
this.add(V);
this.t.action_special_effect.add(l.default.burningFeetEffect);
var q = new p();
q.id = "flower_prints";
q.icon = "iconFlowerPrints";
this.add(q);
this.t.action_special_effect.add(l.default.iconFlowerPrintsEffect);
var Z = new p();
Z.id = "acid_blood";
Z.icon = "iconAcidBlood";
this.add(Z);
var J = new p();
J.id = "acid_proof";
J.icon = "iconAcidProof";
this.add(J);
var Y = new p();
Y.id = "fire_blood";
Y.icon = "iconFireBlood";
this.add(Y);
this.t.action_death.add(l.default.fireBlood);
var X = new p();
X.id = "fire_proof";
X.icon = "iconFireProof";
this.add(X);
var Q = new p();
Q.id = "freeze_proof";
Q.icon = "iconFreezeProof";
this.add(Q);
var $ = new p();
$.id = "cold_aura";
$.icon = "iconColdAura";
this.add($);
this.t.action_special_effect.add(l.default.coldAuraEffect);
var tt = new p();
tt.id = "bomberman";
tt.icon = "iconGrenade";
this.add(tt);
this.t.action_special_effect.add(l.default.bombermanEffect);
var et = new p();
et.id = "pyromaniac";
et.icon = "iconPyromaniac";
et.birth = 1;
this.add(et);
this.t.action_special_effect.add(l.default.pyromaniacEffect);
this.t.baseStats.warfare = 3;
var it = new p();
it.id = "eagle_eyed";
it.icon = "iconEagleEye";
it.birth = .7;
it.opposite = "short_sighted";
it.group = n.Genetic;
it.type = s.Positive;
this.add(it);
this.t.baseStats.accuracy = 10;
this.t.baseStats.crit = 15;
var ot = new p();
ot.id = "short_sighted";
ot.icon = "iconShortsighted";
ot.birth = .7;
ot.opposite = "eagle_eyed";
ot.group = n.Genetic;
ot.type = s.Negative;
this.add(ot);
this.t.baseStats.accuracy = -5;
this.t.baseStats.crit = -5;
var at = new p();
at.id = "lucky", at.icon = "iconLucky", at.birth = .7, at.opposite = "unlucky", 
at.group = n.Genetic, at.type = s.Positive;
this.add(at);
this.t.baseStats.dodge = 5;
this.t.baseStats.accuracy = 4;
this.t.baseStats.crit = 30;
var rt = new p();
rt.id = "unlucky";
rt.icon = "iconUnlucky";
rt.birth = .7;
rt.opposite = "lucky";
rt.group = n.Genetic;
rt.type = s.Negative;
this.add(rt);
this.t.baseStats.dodge = -2;
this.t.baseStats.accuracy = -4;
this.t.baseStats.crit = -30;
var nt = new p();
nt.id = "immune";
nt.icon = "iconImmune";
nt.birth = .25;
nt.inherit = 10;
nt.group = n.Genetic;
nt.type = s.Positive;
this.add(nt);
this.t.baseStats.armor = 3;
var st = new p();
st.id = "agile";
st.icon = "iconAgile";
st.birth = .75;
st.opposite = "fat,slow";
st.sameTraitMod = 5;
st.group = n.Genetic;
st.type = s.Positive;
this.add(st);
this.t.baseStats.dodge = 10;
this.t.baseStats.attackSpeed = 30;
var lt = new p();
lt.id = "deceitful";
lt.icon = "iconDeceitful";
lt.birth = 1.5;
lt.inherit = -1;
lt.opposite = "honest";
lt.sameTraitMod = -15;
lt.oppositeTraitMod = -5;
lt.group = n.Personality;
lt.type = s.Negative;
this.add(lt);
this.t.baseStats.diplomacy = 1;
this.t.baseStats.stewardship = 4;
this.t.baseStats.loyalty_traits = -20;
var ct = new p();
ct.id = "bloodlust";
ct.icon = "iconBloodlust";
ct.birth = 1.5;
ct.opposite = "pacifist";
ct.group = n.Personality;
ct.type = s.Negative;
this.add(ct);
this.t.baseStats.mod_supply_timer = 1.5;
this.t.baseStats.loyalty_traits = -20;
this.t.baseStats.warfare = 10;
this.t.baseStats.diplomacy = -2;
var ut = new p();
ut.id = "pacifist";
ut.icon = "iconPacifist";
ut.birth = 1.5;
ut.opposite = "bloodlust";
ut.group = n.Personality;
ut.type = s.Positive;
this.add(ut);
this.t.baseStats.mod_supply_timer = -.1;
this.t.baseStats.loyalty_traits = 50;
this.t.baseStats.diplomacy = 10;
this.t.baseStats.warfare = -4;
var dt = new p();
dt.id = "ambitious";
dt.icon = "iconAmbitious";
dt.birth = 1.6;
dt.opposite = "content";
dt.inherit = -1;
dt.sameTraitMod = -10;
this.add(dt);
this.t.baseStats.diplomacy = 2;
this.t.baseStats.warfare = 4;
this.t.baseStats.stewardship = 1;
this.t.baseStats.damage = 1;
this.t.baseStats.loyalty_traits = -15;
var ht = new p();
ht.id = "content";
ht.icon = "iconContent";
ht.birth = 2;
ht.opposite = "ambitious,greedy";
ht.inherit = -1;
ht.sameTraitMod = 15;
ht.group = n.Personality;
ht.type = s.Positive;
this.add(ht);
this.t.baseStats.mod_supply_timer = -.3;
this.t.baseStats.loyalty_traits = 10;
this.t.baseStats.diplomacy = 2;
this.t.baseStats.stewardship = 2;
this.t.baseStats.warfare = -2;
var pt = new p();
pt.id = "honest";
pt.icon = "iconHonest";
pt.birth = 1.8;
pt.opposite = "deceitful";
pt.inherit = -1;
pt.sameTraitMod = 10;
pt.oppositeTraitMod = -10;
pt.group = n.Personality;
pt.type = s.Positive;
this.add(pt);
this.t.baseStats.stewardship = 3;
this.t.baseStats.diplomacy = 2;
this.t.baseStats.warfare = -2;
this.t.baseStats.loyalty_traits = 5;
var ft = new p();
ft.id = "paranoid";
ft.icon = "iconParanoid";
ft.birth = 1.4;
ft.opposite = "honest";
ft.inherit = -1;
ft.group = n.Personality;
ft.type = s.Negative;
this.add(ft);
this.t.baseStats.diplomacy = -2;
this.t.baseStats.warfare = 4;
this.t.baseStats.mod_supply_timer = .5;
this.t.baseStats.loyalty_traits = -15;
var mt = new p();
mt.id = "greedy";
mt.icon = "iconGreedy";
mt.birth = 1.5;
mt.inherit = -1;
mt.opposite = "content";
mt.group = n.Personality;
mt.type = s.Negative;
this.add(mt);
this.t.baseStats.diplomacy = -2;
this.t.baseStats.stewardship = -3;
this.t.baseStats.warfare = 4;
this.t.baseStats.mod_supply_timer = 4;
this.t.baseStats.loyalty_traits = -5;
var yt = new p();
yt.id = "weightless";
yt.icon = "iconWeightless";
yt.birth = .8;
yt.opposite = "fat";
this.add(yt);
};
e.prototype.add = function(e) {
t.prototype.add.call(this, e);
this.checkDefault(e);
return e;
};
e.prototype.checkDefault = function(t) {
0 == t.inherit && (t.inherit = 10 * t.birth);
t.opposite && (t.oppositeArr = t.opposite.split(","));
};
e.prototype.checkTraitsMod = function(t, e) {
var i, o, a = 0, n = function(t) {
var i = h.default.traits.get(t);
if (!i) return "continue";
0 != i.sameTraitMod && e.haveTrait(t) && (a += i.sameTraitMod);
if (0 == i.oppositeTraitMod) return "continue";
i.oppositeArr.forEach(function(t) {
e.haveTrait(t) && (a += i.oppositeTraitMod);
});
};
try {
for (var s = r(t.data.traits), l = s.next(); !l.done; l = s.next()) n(l.value);
} catch (t) {
i = {
error: t
};
} finally {
try {
l && !l.done && (o = s.return) && o.call(s);
} finally {
if (i) throw i.error;
}
}
return a;
};
return e;
}(d.default);
i.default = f;
cc._RF.pop();
}, {
"../../actors/ActionLibrary": "ActionLibrary",
"../../base/BaseStats": "BaseStats",
"../../world/WorldAction": "WorldAction",
"../AssetLibrary": "AssetLibrary",
"../AssetManager": "AssetManager"
} ],
Actor: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "3012dJCKrVOWp1izKor8ou3", "Actor");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
}), r = this && this.__decorate || function(t, e, i, o) {
var a, r = arguments.length, n = r < 3 ? e : null === o ? o = Object.getOwnPropertyDescriptor(e, i) : o;
if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) n = Reflect.decorate(t, e, i, o); else for (var s = t.length - 1; s >= 0; s--) (a = t[s]) && (n = (r < 3 ? a(n) : r > 3 ? a(e, i, n) : a(e, i)) || n);
return r > 3 && n && Object.defineProperty(e, i, n), n;
}, n = this && this.__values || function(t) {
var e = "function" == typeof Symbol && Symbol.iterator, i = e && t[e], o = 0;
if (i) return i.call(t);
if (t && "number" == typeof t.length) return {
next: function() {
t && o >= t.length && (t = void 0);
return {
value: t && t[o++],
done: !t
};
}
};
throw new TypeError(e ? "Object is not iterable." : "Symbol.iterator is not defined.");
};
Object.defineProperty(i, "__esModule", {
value: !0
});
var s = t("../../../../framework/lib/prototype/MathUtils"), l = t("../../../common/src/data/AchievData"), c = t("../../../common/src/GameCommon"), u = t("../animation/SpriteAnimation"), d = t("../assetLibrary/AssetManager"), h = t("../assetLibrary/lib/ItemLibrary"), p = t("../assetLibrary/lib/SpellLibrary"), f = t("../common/CachedRaycastIslands"), m = t("../common/Globals"), y = t("../common/ItemTools"), _ = t("../common/ToolBox"), g = t("../game/audio/GameAudio"), v = t("../map/map/MapLayer"), b = t("../MapBox"), T = t("../ui/log/WorldLog"), w = t("../world/WorldTimer"), B = t("./ActionLibrary"), k = t("./ActorBase"), A = t("./ActorEquipment"), S = t("./ActorEquipmentSlot"), x = t("./ActorStatus"), C = t("./HoverModule"), O = t("./other/Ant"), P = t("./other/Baby"), R = t("./other/Bee"), M = t("./other/boat/Boat"), L = t("./other/dragon/Dragon"), F = t("./other/Egg"), D = t("./other/GodFinger"), I = t("./other/Tornado"), j = t("./other/UFO"), E = cc._decorator, N = E.ccclass, G = (E.property, 
function(t) {
a(e, t);
function e() {
var e = null !== t && t.apply(this, arguments) || this;
e.new_creature = !0;
e.colorEffect = 0;
e.timerSound = null;
e.timerReproduction = null;
e.growTimer = null;
e.specialTimer = 0;
e.children_special = [];
e.children_pre_behaviour = [];
e.children_behaviour = [];
e.curTransformPosition = cc.Vec3.ZERO;
e.colorMaterial = null;
e._bestDist = 0;
e._tempDist = 0;
e._bestObject = null;
e.diet_index = 0;
e._activeSelf = !1;
e._onlyHitByActor = !0;
return e;
}
i = e;
Object.defineProperty(e.prototype, "coloredName", {
get: function() {
var t;
if (this.data) {
var e = this.kingdom;
return (null === (t = null == e ? void 0 : e.kingdomColor) || void 0 === t ? void 0 : t.colorBorderOut) ? "<color=" + this.kingdom.kingdomColor.colorBorderOut.toHEX("#rrggbbaa") + ">" + this.data.firstName + "</color>" : this.data.firstName;
}
return "";
},
enumerable: !1,
configurable: !0
});
e.prototype.updateChildren = function(t, e) {
t.length <= 0 || t.forEach(function(t) {
t.logicUpdate(e);
});
};
e.prototype.loadStats = function(t) {
this.stats = t;
this.statsDirty = !0;
this.stats.use_items && (this.equipment = new A.default());
};
e.prototype.setHomeBuilding = function(t) {
this.homeBuilding = t;
this.homeBuilding ? this.data.homeBuildingID = t.data.objectID : this.data.homeBuildingID = "";
};
e.prototype.create = function() {
if (!this.created) {
t.prototype.create.call(this);
this.setObjectType(v.MapObjectType.Actor);
var e = this.node.getChildByName("body");
if (e) {
this.spriteRenderer = e.getComponent(cc.Sprite);
this.spriteAnimation = e.getComponent(u.SpriteAnimation);
}
this.stats.currentAmount++;
this.new_creature && (this.stats.unit ? this.stats.baby ? this.setProfession(x.UnitProfession.Baby) : this.setProfession(x.UnitProfession.Unit) : this.setProfession(x.UnitProfession.Null));
this.loadTexture();
this.race = d.default.raceLibrary.get(this.stats.race);
this.race.units.add(this);
if ("nature" != this.race.id) {
this.timerReproduction = new w.default(10, !0);
this.growTimer = new w.default(.05, this.updateGrowthScale.bind(this));
}
this.timerSound = new w.default(2, this.playRandomSound.bind(this));
this.stats.hovering && (this.moveJumpOffset.y = this.stats.hovering_min);
this.addChildren();
if (this.stats.kingdom.includes("ants")) {
var i = 0, o = 0, a = 0, r = 0;
b.default.inst.units.list.forEach(function(t) {
"antBlack" == t.stats.id && i++;
"antBlue" == t.stats.id && r++;
"antRed" == t.stats.id && a++;
"antGreen" == t.stats.id && o++;
});
i + o + a + r >= 30 && l.default.update(40, 30, !0);
}
this.updateStats();
this.updateTargetScale();
this.startBabymakingTimeout();
this.callbacks_landed.push(this.cancelAllBeh.bind(this));
this.callbacks_landed.push(this.checkDeathOutsideMap.bind(this));
this.callbacks_added_madness.push(this.applyMadness.bind(this));
this.callbacks_on_death.push(k.default.clearStatusEffects);
this._positionDirty = !0;
this.updatePos();
this.node.name = this.stats.id + "_" + this.data.actorID;
}
};
e.prototype.checkDeathOutsideMap = function() {
this.inMapBorder() || this.killHimself();
};
e.prototype.loadFromSave = function() {
this.checkMadness();
this.statsDirty = !0;
for (var t = 0; t < this.data.traits.length; ) d.default.traits.get(this.data.traits[t]) ? t++ : this.data.traits.splice(t, 1);
this.stats.unit && this.data.profession == x.UnitProfession.Null && (this.data.profession = x.UnitProfession.Unit);
this.setProfession(this.data.profession);
};
e.prototype.setProfession = function(t) {
this.data.profession = t;
this.professionAsset = d.default.professions.getAsset(t);
this.statsDirty = !0;
this.cancelAllBeh();
};
e.prototype.isProfession = function(t) {
return this.data.profession == t;
};
e.prototype.updateHunger = function() {
this.data.hunger--;
if (this.data.hunger <= 10 && this.city) {
var t = this.city.getFoodItem(this.data.favoriteFood);
if (t) {
this.consumeCityFoodItem(t);
t = null;
this.haveTrait("gluttonous") && (t = this.city.getFoodItem(this.data.favoriteFood)) && this.consumeCityFoodItem(t);
}
}
if (this.data.hunger <= 0) {
this.data.hunger = 0;
0 == this.data.hunger && this.getHit(1, !0, x.AttackType.Hunger);
}
};
e.prototype.consumeCityFoodItem = function(t) {
this.city.eatFoodItem(t.id);
this.restoreStatsFromEating(t.restoreHunger, t.restoreHealth);
t.id == this.data.favoriteFood && this.restoreStatsFromEating(t.restoreHunger / 2, t.restoreHealth / 2);
this.data.favoriteFood && (t.id == this.data.favoriteFood && "happy" != this.data.mood ? this.changeMood("happy") : "happy" == this.data.mood ? this.changeMood("normal") : "normal" == this.data.mood ? _.Toolbox.randomChance(.2) && this.changeMood("sad") : "sad" == this.data.mood && _.Toolbox.randomChance(.05) && this.changeMood("angry"));
};
e.prototype.changeMood = function(t) {
if (t != this.data.mood) {
this.statsDirty = !0;
this.data.mood = t;
}
};
e.prototype.restoreStatsFromEating = function(t, e, i) {
void 0 === t && (t = 100);
void 0 === e && (e = .1);
void 0 === i && (i = !1);
this.data.hunger += t;
i && this.data.hunger > this.stats.maxHunger && (this.data.hunger = this.stats.maxHunger);
this.data.health < this.curStats.health && this.restoreHealth(s.default.intCast(this.curStats.health * e + 1));
};
e.prototype.restoreHealth = function(t) {
if (this.data.health != this.curStats.health) {
this.data.health += t;
this.data.health > this.curStats.health && (this.data.health = this.curStats.health);
}
};
e.prototype.reloadInventory = function() {
this.statsDirty = !0;
};
e.prototype.isRace = function(t) {
return "string" == typeof t ? this.stats.race == t : this.stats.race == t.stats.race;
};
e.prototype.addChildren = function() {
this.children_pre_behaviour = [];
this.children_behaviour = [];
this.children_special = [];
this.getComponent(D.default) && this.addChild(this.getComponent(D.default), this.children_special);
this.getComponent(L.default) && this.addChild(this.getComponent(L.default), this.children_special);
this.getComponent(j.default) && this.addChild(this.getComponent(j.default), this.children_special);
this.getComponent(I.default) && this.addChild(this.getComponent(I.default), this.children_special);
if (this.stats.flags.includes("ant")) {
this.addComponent(O.default);
this.addChild(this.getComponent(O.default), this.children_behaviour);
}
if (this.stats.flags.includes("egg")) {
this.addComponent(F.default);
this.addChild(this.getComponent(F.default), this.children_pre_behaviour);
}
if (this.stats.baby) {
this.addComponent(P.default);
this.addChild(this.addComponent(P.default), this.children_pre_behaviour);
}
this.stats.hovering && this.addChild(this.addComponent(C.default), this.children_special);
"bee" == this.stats.id && this.addChild(this.addComponent(R.default), this.children_pre_behaviour);
this.stats.isBoat && this.addChild(this.addComponent(M.default), this.children_pre_behaviour);
};
e.prototype.addChild = function(t, e) {
null == e || e.push(t);
t.create();
};
e.prototype.updateSpecialTraitEffects = function() {
var t = this;
if (0 != this.s_special_effect_traits.length) {
i._tempTraitList.clear();
i._tempTraitList.addRange(this.s_special_effect_traits);
i._tempTraitList.forEach(function(e) {
e.action_special_effect.isEmpty || e.action_special_effect.do(t, t.currentTile);
});
}
};
e.prototype.spawnParticle = function(t) {
if (!_.Toolbox.randomBool() && !b.default.inst.qualityChanger.lowRes) {
var e = this.node.position;
e.y += this.spriteRenderer.node.y * this.node.scaleY / 2;
e.x += _.Toolbox.randomFloat(-.2, .2);
e.y += _.Toolbox.randomFloat(-.2, .2);
b.default.inst.stackEffects.spawnStatusParticle(e, t);
}
};
e.prototype.makeWait = function(t) {
void 0 === t && (t = 10);
this.stopMovement();
this.timer_action = t;
};
e.prototype.playRandomSound = function() {
this.stats.playRandomSound && g.default.play(this.stats.playRandomSound_id);
};
e.prototype.startShake = function(t, e, i, o) {
void 0 === t && (t = .3);
void 0 === e && (e = .1);
void 0 === i && (i = !0);
void 0 === o && (o = !0);
this.shakeHorizontal = i;
this.shakeVertical = o;
this.shakeTimer.startTimer(t);
this.shakeVolume = e;
};
e.prototype.updateSpecialTimers = function(t) {
if (this.s_special_effect_traits.length > 0) if (this.specialTimer > 0) this.specialTimer -= t; else {
this.specialTimer = 1;
this.updateSpecialTraitEffects();
}
this.timerSound.logicUpdate(cc.director.getDeltaTime());
};
e.prototype.canFight = function() {
var t;
return !(!this.ai.task || null !== (t = this.ai.task.ignoreFightCheck) && void 0 !== t && t || this.stats.skipFightLogic || this._trait_peaceful);
};
e.prototype.updateBehaviour = function(t) {
var e, i, o, a, r;
if (!(0 != this.forceVector.x || 0 != this.forceVector.y || 0 != this.forceVector.z || 0 != this.zPosition.y && this.stats.updateZ) && this.currentTile) {
if (this.attackTarget) if (!(null === (e = this.attackTarget.base_data) || void 0 === e ? void 0 : e.alive) || (null === (i = this.kingdom) || void 0 === i ? void 0 : i.isCiv()) && !(null === (a = null === (o = this.attackTarget) || void 0 === o ? void 0 : o.kingdom) || void 0 === a ? void 0 : a.isEnemy(this.kingdom))) this.attackTarget = null; else {
(null === (r = this.kingdom) || void 0 === r ? void 0 : r.isCiv()) && this.kingdom.isEnemy(this.attackTarget.kingdom);
if (this.canAttackTarget(this.attackTarget)) {
if (this.attackTimer > 0 || this.attackTimer > 0 && this.isInAttackRange(this.attackTarget)) {
this.stopMovement();
return;
}
if (this.tryToAttack(this.attackTarget)) {
this.stopMovement();
return;
}
}
}
if (this.checkEnemyTargets()) this.stopMovement(); else if (!this.is_moving) {
if (this.isUsingPath()) {
this.updatePathMovement();
return;
}
this.updateChildren(this.children_behaviour, t);
this.ai.logicUpdate(t);
}
}
};
e.prototype.checkEnemyTargets = function() {
var t, e, i, o;
if (!this.canFight()) return !1;
if (this.attackTarget) {
(null === (e = null === (t = this.ai) || void 0 === t ? void 0 : t.task) || void 0 === e ? void 0 : e.fighting) || this.ai.setTask("fight", !0, !0);
return !1;
}
if (this._timeout_targets > 0) return !1;
this._timeout_targets = .4 + _.Toolbox.randomFloat(0, .1);
(null === (o = null === (i = this.attackTarget) || void 0 === i ? void 0 : i.base_data) || void 0 === o ? void 0 : o.alive) && !this.targetsToIgnore.has(this.attackTarget) && this.canAttackTarget(this.attackTarget) || (this.attackTarget = null);
var a = this.findEnemyObjectTarget();
if (a) {
if (this.attackTarget) {
var r = _.Toolbox.distTile(this.attackTarget.currentTile, this.currentTile);
if (_.Toolbox.distTile(a.currentTile, this.currentTile) < r) {
this.attackTarget = a;
this._timeout_targets = 1;
}
} else this.attackTarget = a;
this.ai.setTask("fight", !1, !0);
return !0;
}
return !1;
};
e.prototype.findEnemyObjectTarget = function() {
var t, e, i = this;
if (this.isAffectedByWater() && !this.stats.waterCreature) return null;
this._tempDist = 0;
this._bestDist = 0;
this._bestObject = null;
_.Toolbox.temp_list_objects.clear();
this.kingdom || this.checkKingdom();
_.Toolbox.findEnemiesOfKingdomInChunk(this.currentTile.chunk, this.kingdom);
this.currentTile.chunk.neighboursAll.forEach(function(t) {
_.Toolbox.findEnemiesOfKingdomInChunk(t, i.kingdom);
});
try {
for (var o = n(_.Toolbox.temp_list_objects), a = o.next(); !a.done; a = o.next()) {
var r = a.value;
this.checkObjectList(r);
if (this._bestObject) break;
}
} catch (e) {
t = {
error: e
};
} finally {
try {
a && !a.done && (e = o.return) && e.call(o);
} finally {
if (t) throw t.error;
}
}
return this._bestObject ? this._bestObject : null;
};
e.prototype.updatePos = function() {
if (this._positionDirty) {
this._positionDirty = !1;
this.curTransformPosition = this.currentPosition.add(this.zPosition).add(this.moveJumpOffset).add(this.shakeOffset);
this.curTransformPosition.z = this.currentPosition.y;
this.isAffectedByWater() && (this.curTransformPosition.z += .3);
this.curTransformPosition.z < 0 && (this.curTransformPosition.z = 0);
this.node.position != this.curTransformPosition && (this.node.position = this.curTransformPosition);
}
};
e.prototype.updateAge = function() {
var t;
if (this.data.updateAge(this.race) || this.haveTrait("immortal")) {
if (this.city) {
(null === (t = this.city.kingdom) || void 0 === t ? void 0 : t.king) == this && this.addExperience(20);
this.city.leader == this && this.addExperience(10);
}
this.data.age > 40 && _.Toolbox.randomChance(.3) && this.addTrait("wise");
} else this.killHimself(!1, x.AttackType.Age);
};
e.prototype.checkKingdom = function() {
if (!this.kingdom) {
this.checkMadness();
this.stats.unit ? this.setKingdom(b.default.inst.kingdoms.dict_hidden.get("nomads_" + this.stats.race)) : this.stats.kingdom && this.setKingdom(b.default.inst.kingdoms.dict_hidden.get(this.stats.kingdom));
}
};
e.prototype.isInsideSomething = function() {
var t;
return !(null === (t = this.ai.action) || void 0 === t || !t.special_inside_object);
};
e.prototype.isItemRendered = function() {
return !(!this.stats.use_items || this.isInWater() || this.equipment.weapon.isEmpty() && (!this.ai.task || !this.ai.task.force_item_sprite) && !this.inventory.resource);
};
e.prototype.getRenderedToolOrItem = function() {
return this.inventory.resource ? this.inventory.resource : this.ai.task && this.ai.task.force_item_sprite ? this.ai.task.force_item_sprite : "";
};
e.prototype.getTextureToRenderInHand = function() {
return this.getRenderedToolOrItem() || this.s_weapon_texture;
};
e.prototype.updateTimers = function(t) {
var e, i, o;
0 != this.zPosition.y && this.stats.updateZ && this.updateFall(t);
(null === (i = null === (e = this.attackedBy) || void 0 === e ? void 0 : e.base_data) || void 0 === i ? void 0 : i.alive) || (this.attackedBy = null);
if (!this.insideBoat) {
this.shakeTimer.logicUpdate(t);
this.updateFlipRotation(t);
if (!c.default.isPaused) {
this.updateShake();
this.updateForce(t);
if (null === (o = this.data) || void 0 === o ? void 0 : o.alive) {
this.updateRotationBack(t);
if (!this._status_frozen) {
this.updateWalkJump(t);
this.attackTimer >= 0 && (this.attackTimer -= t);
this._timeout_targets >= 0 && (this._timeout_targets -= cc.director.getDeltaTime());
this.timer_action >= 0 && (this.timer_action -= t);
this.canFight() && this.targetsToIgnoreTimer.logicUpdate(t);
}
}
}
}
};
e.prototype.logicUpdate = function(e) {
var i, o, a, r, n;
t.prototype.logicUpdate.call(this, e);
if (this._actionFall) {
this._actionFall = !1;
this.actionLanded();
}
if (!this._activeSelf) if (null === (i = this.ai.action) || void 0 === i ? void 0 : i.special_inside_object) {
if ((!this.insideBuilding || this.insideBuilding.isNonUsable()) && !this.insideBoat) {
this.exitHouse();
this.cancelAllBeh();
}
} else {
this.exitHouse();
this.cancelAllBeh();
}
if (null !== (o = this.insideBoat) && void 0 !== o && o.actor) this.setCurrentTilePosition(this.insideBoat.actor.currentTile); else {
this.checkKingdom();
this.updateColorEffect(e);
this.updatePos();
this.updateChildren(this.children_special, e);
this.updateRotation();
if ((null === (a = this.data) || void 0 === a ? void 0 : a.alive) && (null === (r = this.base_data) || void 0 === r ? void 0 : r.alive)) {
if (!this.checkCurTileAction() || c.default.isPaused) return;
this.updateStatusEffects(e);
if (this._status_frozen) return;
this.updateChildren(this.children_pre_behaviour, e);
if (!this.race.nature) {
this.stats.specialAnimation || this.actorScale == this.targetScale || this.growTimer.logicUpdate(e);
this.timerReproduction.logicUpdate(e);
this.updateSpecialTimers(e);
}
if (!(this.timer_action >= 0) && (null === (n = this.data) || void 0 === n ? void 0 : n.alive)) {
this.updateBehaviour(e);
this.nextStepPosition.x != m.default.emptyVector.x && this.smoothMovement(this.nextStepPosition, e);
}
} else this.updateDeadAnimation();
}
};
e.prototype.checkCurTileAction = function() {
var t, e;
if (0 == this.zPosition.y) {
if (this.stats.canBeKilledByStuff) {
if (this.stats.dieOnGround && !this.currentTile.type.liquid) {
this.stats.id.includes("piranha") && l.default.update(52);
this.killHimself();
}
if (c.default.isPaused) return !1;
if (!this.isInAir()) {
this.currentTile.type.water && this.removeStatusEffect("burning");
this.stats.dieInWater && this.currentTile.type.water && this.colorEffect <= 0 && !this.shakeTimer.isActive && this.getHit(5);
this.stats.dieOnBlocks && this.currentTile.type.block && this.colorEffect <= 0 && !this.shakeTimer.isActive && this.getHit(1);
this.currentTile.type.landmine && b.default.inst.explosionLayer.explodeBomb(this.currentTile);
this.currentTile.type.creep && this.stats.canTurnIntoTumorMonster && !this.stats.immune_to_tumor && this.currentTile.type.give_trait && _.Toolbox.randomChance(this.currentTile.type.give_trait_chance) && this.addTrait(this.currentTile.type.give_trait);
if (this.currentTile.type.damageUnits && this.colorEffect <= 0 && (!this.currentTile.type.creep || !this.stats.immune_to_tumor) && (!this.currentTile.type.lava || this.stats.dieInLava)) {
this.getHit(this.currentTile.type.damage);
this.stats.specialAnimation || this.spriteAnimation.stopAt(2);
if (!(null === (t = this.data) || void 0 === t ? void 0 : t.alive)) return !1;
}
if (this.currentTile.data.fire && !this._trait_fire_resistant) {
B.default.addBurningEffectOnTarget(this);
this.stats.specialAnimation || this.spriteAnimation.stopAt(2);
if (!(null === (e = this.data) || void 0 === e ? void 0 : e.alive)) return !1;
}
this.currentTile.type.damagedWhenWalked && !this._trait_weightless && (this.currentTile.health > 0 ? this.currentTile.health-- : b.default.inst.terraformTile2(this.currentTile, this.currentTile.type.decreaseTo, d.default.terraform.get("flash")));
}
}
!this.stats.dieOnBlocks || !this.currentTile.type.block || this.isInAir() || this.is_moving || this.ai.task && this.ai.task.moveFromBlock || this.ai.setTask("move_from_block", !0, !0);
!this.currentTile.type.liquid || this.stats.waterCreature || !this.stats.swimToIsland || this.is_moving || this.ai.task && this.ai.task.swim_to_island || this.ai.setTask("swim_to_island", !0, !0);
}
return !0;
};
e.prototype.killHimself = function(t, e, i, o) {
var a, r, n, s, c, u = this;
void 0 === t && (t = !1);
void 0 === e && (e = x.AttackType.Other);
void 0 === i && (i = !0);
void 0 === o && (o = !0);
if ((null === (a = this.data) || void 0 === a ? void 0 : a.alive) || t) {
if (null === (r = this.data) || void 0 === r ? void 0 : r.alive) {
"tornado" == this.stats.id && this.getComponent(I.default).killTornado();
this.data.alive = !1;
this.base_data.alive = !1;
this.insideBoat && this.insideBoat.removeFromTaxi(this);
"crabzilla" == this.stats.id && (t = !0);
if (o) {
this.stats.action_death.isEmpty || this.stats.action_death.do(this, this.currentTile);
if (!cc.isValid(this.node, !0)) return;
for (var h = 0; h < this.data.traits.length; ) {
var p = this.data.traits[h], f = d.default.traits.get(p);
if (f) {
f.action_death.isEmpty || f.action_death.do(this, this.currentTile);
this.data.traits.includes(p) && h++;
}
}
cc.isValid(this.node, !0) || (t = !0);
this.callbacks_on_death.forEach(function(t) {
t(u);
});
}
this.haveTrait("energized") && e != x.AttackType.None && b.default.spawnLightning(this.currentTile);
if (i) {
b.default.inst.gameStats.creaturesDied++;
b.default.inst.mapStats.deaths++;
switch (e) {
case x.AttackType.Plague:
b.default.inst.mapStats.deaths_plague++;
break;

case x.AttackType.Other:
b.default.inst.mapStats.deaths_other++;
break;

case x.AttackType.Bomb:
b.default.inst.mapStats.deaths_explosion++;
b.default.inst.countKillByDestructionPowers();
break;

case x.AttackType.Divine:
b.default.inst.mapStats.deaths_divine++;
b.default.inst.countKillByDivineLightPowers();
break;

case x.AttackType.Hunger:
b.default.inst.mapStats.deaths_hunger++;
break;

case x.AttackType.Eaten:
b.default.inst.mapStats.deaths_eaten++;
l.default.update(7);
l.default.update(72, b.default.inst.mapStats.deaths_eaten, !0);
break;

case x.AttackType.Age:
b.default.inst.mapStats.deaths_age++;
}
}
this.stats.currentAmount--;
this.data.favorite && e != x.AttackType.GrowUp && ((null === (n = this.attackedBy) || void 0 === n ? void 0 : n.a) ? T.default.logFavMurder(this, null === (s = this.attackedBy) || void 0 === s ? void 0 : s.a) : T.default.logFavDead(this));
this.race.units.remove(this);
this.clearTasks();
this.stopMovement();
!this.stats.specialAnimation && this.spriteAnimation && this.spriteAnimation.stopAnimations();
(null === (c = this.getComponent(O.default)) || void 0 === c ? void 0 : c.isTumorTentacle) && this.getComponent(O.default).killTentacle();
}
if (this.city) {
this.city.removeCitizen(this, i, e);
this.setCity(null);
}
if (t) {
this.race.units.remove(this);
this.kingdom && this.setKingdom(null);
b.default.inst.destroyActor(this);
}
this.attackTarget = null;
}
};
e.prototype.isInAttackRange = function(t) {
var e = !1;
try {
e = _.Toolbox.distVec3(this.currentPosition, t.currentPosition) < this.curStats.range + t.curStats.size;
} catch (t) {
cc.log(t);
}
return e;
};
e.prototype.tryToAttack = function(t) {
if (this.isInWater() && !this.stats.waterCreature) return !1;
if (this.attackTimer > 0) return !1;
var e = t.currentTile;
if (!this.isInAttackRange(t)) return !1;
if (this.s_attackType == h.WeaponType.Melee && t.zPosition.y > 0) return !1;
this.timer_action = this.s_attackSpeed_seconds;
this.attackTimer = this.s_attackSpeed_seconds;
this.punchTargetAnimation(t.node.position, t.currentTile, !0, this.s_attackType == h.WeaponType.Range);
g.default.playPunch(this.currentPosition);
var i = t.currentPosition.clone();
t.objectType == v.MapObjectType.Actor && t.a.is_moving && t.a.isFlying() && (i = _.Toolbox.moveTowards(i, t.a.nextStepPosition, 3 * t.curStats.size));
var o = cc.Vec3.distance(this.currentPosition, t.currentPosition) + t.getZ(), a = _.Toolbox.getNewPoint(this.currentPosition.x, this.currentPosition.y, i.x, i.y, o - t.curStats.size), r = this.currentPosition.clone();
r.y += .5;
r.x += i.x > this.currentPosition.x ? .5 : -.5;
var n = 57.29578 * _.Toolbox.getAngle(r.x, r.y, i.x, i.y);
if (this.s_attackType == h.WeaponType.Melee) {
r = _.Toolbox.getNewPoint(r.x, r.y, i.x, i.y + t.getZ(), 2 * this.curStats.size);
b.default.inst.newAttack(this, a, e, t);
} else if (this.s_attackType == h.WeaponType.Range) {
r = _.Toolbox.getNewPoint(r.x, r.y, i.x, i.y + t.getZ(), this.curStats.size);
if (!this.tryToCastSpell(t)) for (var s = this.getWeaponAsset().projectile, l = 0; l < this.curStats.projectiles; l++) {
a.x = i.x;
a.y = i.y + .1;
a.x += _.Toolbox.randomFloat(0 - (t.curStats.size + 1), t.curStats.size + 1);
a.y += _.Toolbox.randomFloat(0 - t.curStats.size, t.curStats.size);
var c = _.Toolbox.getNewPoint(this.currentPosition.x, this.currentPosition.y, i.x, i.y, this.curStats.size);
c.y += .5;
var u = 0;
t.isInAir() && (u = t.getZ());
var d = b.default.inst.stackEffects.startProjectile(c, a, s, u);
n = d.getAngle();
if (d) {
d.byUnit = this;
d.setStats(d.byUnit.curStats);
d.targetObject = t;
}
}
}
b.default.inst.stackEffects.slash(r, this.s_slashType, n);
return !0;
};
e.prototype.tryToCastSpell = function(t) {
var e = this.stats.attack_spells;
if (e && 0 == e.length) return !1;
this.stats.attack_spells.shuffle();
var i = d.default.spells.get(this.stats.attack_spells.getRandom());
if (!_.Toolbox.randomChance(i.chance)) return !1;
i.castTarget == p.CastTarget.Himself && (t = this);
if (i.castEntity == p.CastEntity.BuildingsOnly) {
if (t.isActor()) return !1;
} else if (i.castEntity == p.CastEntity.UnitsOnly && t.isBuilding()) return !1;
var o = this.data.health / this.curStats.health;
if (0 != i.healthPercent && i.healthPercent <= o) return !1;
if (0 != i.min_distance && _.Toolbox.distTile(this.currentTile, t.currentTile) < i.min_distance) return !1;
var a = !i.action.isEmpty && i.action.do(t, t.currentTile);
a && this.doCastAnimation();
return a;
};
e.prototype.doCastAnimation = function() {
if (!b.default.inst.qualityChanger.lowRes) {
var t = b.default.inst.stackEffects.get(this.stats.effect_cast_ground).spawnAt(this.currentPosition, this.curStats.scale);
if (t) {
t.node.parent = this.node;
t.node.position = cc.Vec3.ZERO;
t = null;
}
if (t = b.default.inst.stackEffects.get(this.stats.effect_cast_top).spawnAt(this.currentPosition.add(k.default.actorCastPos), this.curStats.scale)) {
t.node.parent = this.node;
t.node.position = k.default.actorCastPos;
}
}
};
e.prototype.getZ = function() {
return this.zPosition.y + this.hitboxZ;
};
e.prototype.punchTargetAnimation = function(t, e, i, o, a) {
void 0 === i && (i = !0);
void 0 === o && (o = !1);
void 0 === a && (a = 40);
if (this.stats.flipAnimation) {
i && (this.node.x < t.x ? this.setFlip(!0) : this.setFlip(!1));
this.targetAngle.z = o ? this.flip ? a : (360 - a) % 360 : this.flip ? (360 - a) % 360 : a;
}
};
e.prototype.startColorEffect = function(t) {
void 0 === t && (t = "red");
if (this.stats.effectDamage) {
this.colorEffect = .3;
"red" == t ? this.colorMaterial = cc.Color.RED : "white" == t && (this.colorMaterial = cc.Color.WHITE);
this.updateColorEffect(0);
}
};
e.prototype.updateColorEffect = function(t) {
if (0 != this.colorEffect && null != this.spriteRenderer) {
this.colorEffect -= t;
this.colorEffect < 0 && (this.colorEffect = 0);
this.colorEffect > 0 ? this.setUnitSpriteColor(this.colorMaterial) : this.setUnitSpriteColor(cc.Color.WHITE);
}
};
e.prototype.getHit = function(t, e, i, o, a) {
var r, n, c = this;
void 0 === e && (e = !0);
void 0 === i && (i = x.AttackType.Other);
void 0 === o && (o = null);
void 0 === a && (a = !0);
this.attackedBy = null;
if (!(a && (null === (r = this.shakeTimer) || void 0 === r ? void 0 : r.isActive) || !(null === (n = this.data) || void 0 === n ? void 0 : n.alive) || this.data.health <= 0)) {
o || (this._onlyHitByActor = !1);
i == x.AttackType.Other && (t *= 1 - this.curStats.armor / 100);
t < 1 && (t = 1);
this.data.health -= s.default.intCast(t);
this.timer_action = .002;
if (i == x.AttackType.Other && !this.stats.immune_to_injures && !this.haveStatus("shield")) {
_.Toolbox.randomChance(.02) && this.addTrait("crippled");
_.Toolbox.randomChance(.02) && this.addTrait("eyepatch");
this.addExperience(1);
}
e && this.startColorEffect();
if (this.data.health <= 0) {
o != this && (this.attackedBy = o);
this.killHimself(!1, i);
if (this._onlyHitByActor) {
"dragon" == this.stats.id && l.default.update(53);
"UFO" == this.stats.id && l.default.update(54);
}
if (!o || o == this || !o.isActor()) return;
o.a.increaseKillCount();
o.a.stats.use_items && !this.haveTrait("infected") && o.a.stats.take_items && o.a.takeItems(this, o.a.stats.take_items_ignore_range_weapons);
if (!o.city) return;
var u = !1;
if (this.stats.animal) {
u = !0;
o.city.data.storage.change("meat");
} else this.stats.unit && o.a.haveTrait("savage") && (u = !0);
u && (_.Toolbox.randomChance(.5) ? o.city.data.storage.change("bones") : _.Toolbox.randomChance(.5) ? o.city.data.storage.change("leather") : _.Toolbox.randomChance(.5) && o.city.data.storage.change("meat"));
} else {
this.shakeTimer.startTimer();
o != this && (this.attackedBy = o);
!this.attackTarget && this.attackedBy && !this.targetsToIgnore.has(this.attackedBy) && this.canAttackTarget(this.attackedBy) && (this.attackTarget = this.attackedBy);
this.activeStatusEffects.length > 0 && this.activeStatusEffects.forEach(function(t) {
t.asset.actionOnHit && t.asset.actionOnHit.do(c, c.currentTile);
});
this.callbacks_get_hit.forEach(function(t) {
t(c);
});
}
}
};
e.prototype.takeItems = function(t, e) {
var i, o;
void 0 === e && (e = !1);
if (this.stats.use_items && t.stats.use_items) {
var a = A.default.getList(t.equipment);
try {
for (var r = n(a), s = r.next(); !s.done; s = r.next()) {
var l = s.value;
if (l.data && (l.type != S.EquipmentType.Weapon || !e || d.default.items.get(l.data.id).attackType != h.WeaponType.Range)) {
var c = this.equipment.getSlot(l.type);
if (c.data) {
y.default.calcItemValues(c.data);
var u = y.default.s_value;
y.default.calcItemValues(l.data);
if (y.default.s_value > u) {
c.setItem(l.data);
l.emptySlot();
this.statsDirty = !0;
}
} else {
c.setItem(l.data);
l.emptySlot();
this.statsDirty = !0;
}
}
}
} catch (t) {
i = {
error: t
};
} finally {
try {
s && !s.done && (o = r.return) && o.call(r);
} finally {
if (i) throw i.error;
}
}
}
};
e.prototype.increaseKillCount = function() {
this.data.kills++;
this.data.kills > 10 && this.addTrait("veteran");
this.addExperience(10);
};
e.prototype.getExpToLevelup = function() {
return 100 + 20 * (this.data.level - 1);
};
e.prototype.addExperience = function(t) {
if (this.stats.canLevelUp && !(this.data.level >= 10)) {
var e = this.getExpToLevelup();
this.data.experience += t;
if (this.data.experience >= e) {
this.data.experience = 0;
this.data.level++;
10 == this.data.level && (this.data.experience = e);
this.statsDirty = !0;
this.event_full_heal = !0;
}
}
};
e.prototype.checkObjectList = function(t) {
var e = this;
t.forEach(function(t) {
var i, o, a, r = t;
if (r != e && (null === (i = r.base_data) || void 0 === i ? void 0 : i.alive) && (null === (o = r.data) || void 0 === o ? void 0 : o.alive) && e.canAttackTarget(r) && (0 != e.s_attackType || (null === (a = r.currentTile) || void 0 === a ? void 0 : a.isSameIsland(e.currentTile)) || f.default.getResult(e.currentTile, r.currentTile, e.stats) != f.RaycastResult.NotPossible && !r.currentTile.type.block && e.currentTile.region.island.connectedWith(r.currentTile.region.island)) && (!r.isBuilding() || !e.kingdom.isCiv() || !r.b.stats.cityBuilding || r.kingdom.race != e.kingdom.race) && !e.targetsToIgnore.has(r)) {
e._tempDist = _.Toolbox.distTile(r.currentTile, e.currentTile);
if (!e._bestObject || e._tempDist < e._bestDist) {
e._bestObject = r;
e._bestDist = e._tempDist;
}
}
});
};
e.prototype.startBabymakingTimeout = function() {
this.timerReproduction && this.timerReproduction.startTimer(40 + _.Toolbox.randomFloat(0, 40));
};
e.prototype.stayInBuilding = function(t) {
this.insideBuilding = t;
this.setActorVisible(!1);
};
e.prototype.exitHouse = function() {
this.timer_action = 0;
this.insideBuilding = null;
this.setActorVisible(!0);
};
e.prototype.embarkInto = function(t) {
var e, i;
if (null !== (i = null === (e = this.ai.job) || void 0 === e ? void 0 : e.cancel_when_embarking) && void 0 !== i && i) this.cancelAllBeh(); else {
this.clearTasks();
this.stopMovement();
this.ai.restartJob();
}
this.data.transportID = t.actor.data.actorID;
this.setActorVisible(!1);
this.node.position = cc.v3(-1e5, -1e4);
this.insideBoat = t;
this.insideBoat.addUnitInto(this);
};
e.prototype.setActorVisible = function(t) {
this._activeSelf = t;
this.node.active = t;
};
e.prototype.disembarkTo = function(t, e) {
this.spawnOn(e);
this.data.transportID = null;
this.setActorVisible(!0);
this.insideBoat = null;
this._currentTileDirty = !0;
};
e.prototype.isCurrentJob = function(t) {
return !!this.ai.job && this.ai.job.id == t;
};
e.prototype.checkZoneForGround = function(t) {
t.tiles.forEach(function(t) {
t.type.liquid || k.default.possible_moves.push(t);
});
};
e.prototype.becomeCitizen = function(t) {
this.city != t && t.addNewUnit(this);
};
e.prototype.spawnOn = function(e, i) {
void 0 === i && (i = 0);
t.prototype.spawnOn.call(this, e, i);
if (this.stats.id.includes("santa")) {
var o = _.Toolbox.randomFloat(30, 50);
this.currentPosition.y -= o;
this.zPosition.y = o;
} else this.stats.id.includes("UFO") && (this.zPosition.y = 8);
};
e.prototype.applyRandomForce = function() {
var t = _.Toolbox.randomFloat(.05, .4), e = this.currentTile.neighboursAll.getRandom(), i = _.Toolbox.getAngle(this.currentTile.posV3.x, this.currentTile.posV3.y, e.posV3.x, e.posV3.y);
this.addForce((0 - Math.cos(i)) * t, (0 - Math.sin(i)) * t, t);
};
e.prototype.applyMadness = function(t) {
if (t.city) {
t.city.removeCitizen(this);
t.removeFromCity();
}
t.removeTrait("peaceful");
t.startShake(.3, .2);
t.startColorEffect("white");
t.kingdom && t.kingdom.removeUnit(t);
t.setKingdom(b.default.inst.kingdoms.dict_hidden.get("mad"));
t.cancelAllBeh();
};
e.prototype.updateGrowthScale = function() {
if (0 != this.targetScale) {
this.actorScale += .001;
this.actorScale > this.targetScale && (this.actorScale = this.targetScale);
var t = cc.v3(this.actorScale, this.actorScale, this.actorScale);
this.flipScale.x < 0 && (t.x = 0 - t.x);
this.node.setScale(t);
}
};
e.prototype.justBorn = function() {
this.actorScale = .02;
this.updateGrowthScale();
};
e.prototype.removeFromCity = function() {
this.setCity(null);
};
e.prototype.setCity = function(t) {
this.city = t;
};
e.prototype.removeFromGroup = function() {
this.unitGroup && this.unitGroup.removeUnit(this);
this.unitGroup = null;
};
e.prototype.isInCityIsland = function() {
var t, e;
if (!this.city || !(null === (t = this.data) || void 0 === t ? void 0 : t.alive)) return !1;
var i = this.city.getTile();
return !!i && !(null === (e = this.currentTile) || void 0 === e || !e.isSameIsland(i));
};
e.prototype.setGroupLeader = function(t) {
this.isGroupLeader = t;
};
e.prototype.getAnimationFrameData = function() {
return this.frameData;
};
var i;
e._tempTraitList = [];
return i = r([ N ], e);
}(k.default));
i.default = G;
cc._RF.pop();
}, {
"../../../../framework/lib/prototype/MathUtils": void 0,
"../../../common/src/GameCommon": void 0,
"../../../common/src/data/AchievData": void 0,
"../MapBox": "MapBox",
"../animation/SpriteAnimation": "SpriteAnimation",
"../assetLibrary/AssetManager": "AssetManager",
"../assetLibrary/lib/ItemLibrary": "ItemLibrary",
"../assetLibrary/lib/SpellLibrary": "SpellLibrary",
"../common/CachedRaycastIslands": "CachedRaycastIslands",
"../common/Globals": "Globals",
"../common/ItemTools": "ItemTools",
"../common/ToolBox": "ToolBox",
"../game/audio/GameAudio": "GameAudio",
"../map/map/MapLayer": "MapLayer",
"../ui/log/WorldLog": "WorldLog",
"../world/WorldTimer": "WorldTimer",
"./ActionLibrary": "ActionLibrary",
"./ActorBase": "ActorBase",
"./ActorEquipment": "ActorEquipment",
"./ActorEquipmentSlot": "ActorEquipmentSlot",
"./ActorStatus": "ActorStatus",
"./HoverModule": "HoverModule",
"./other/Ant": "Ant",
"./other/Baby": "Baby",
"./other/Bee": "Bee",
"./other/Egg": "Egg",
"./other/GodFinger": "GodFinger",
"./other/Tornado": "Tornado",
"./other/UFO": "UFO",
"./other/boat/Boat": "Boat",
"./other/dragon/Dragon": "Dragon"
} ],
AdView: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "06b34Wn2fBJ+5O7ILR9ZSK7", "AdView");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
}), r = this && this.__decorate || function(t, e, i, o) {
var a, r = arguments.length, n = r < 3 ? e : null === o ? o = Object.getOwnPropertyDescriptor(e, i) : o;
if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) n = Reflect.decorate(t, e, i, o); else for (var s = t.length - 1; s >= 0; s--) (a = t[s]) && (n = (r < 3 ? a(n) : r > 3 ? a(e, i, n) : a(e, i)) || n);
return r > 3 && n && Object.defineProperty(e, i, n), n;
}, n = this && this.__values || function(t) {
var e = "function" == typeof Symbol && Symbol.iterator, i = e && t[e], o = 0;
if (i) return i.call(t);
if (t && "number" == typeof t.length) return {
next: function() {
t && o >= t.length && (t = void 0);
return {
value: t && t[o++],
done: !t
};
}
};
throw new TypeError(e ? "Object is not iterable." : "Symbol.iterator is not defined.");
};
Object.defineProperty(i, "__esModule", {
value: !0
});
var s = t("../../../../../framework/main/Constants"), l = t("../../../../common/src/advert/AdsManager"), c = t("../../../../common/src/advert/AdTools"), u = t("../../../../common/src/data/UserData"), d = t("../../../../common/src/GamePopBase"), h = t("../../../../common/src/MsgCache"), p = t("../../texture/TextureLoader"), f = cc._decorator, m = f.ccclass, y = f.property, _ = function(t) {
a(e, t);
function e() {
var e = null !== t && t.apply(this, arguments) || this;
e.title = null;
e.source = null;
e.logoBox = null;
e.adSprite = null;
e.video = null;
e.btnLabel = null;
e.rewardItem = [];
e.data = [];
e.adId = "";
return e;
}
e.prototype.init = function(t, e, i) {
var o, a;
this.data = Array.from(e);
this.title.string = t ? "获得奖励" : "盒子礼物";
this.source.active = t;
this.logoBox.active = !t;
this.video.active = t;
this.btnLabel.string = t ? "双倍领取" : "领取";
try {
for (var r = n(this.rewardItem), s = r.next(); !s.done; s = r.next()) s.value.active = !1;
} catch (t) {
o = {
error: t
};
} finally {
try {
s && !s.done && (a = r.return) && a.call(r);
} finally {
if (o) throw o.error;
}
}
this.showAd(i);
this.showReward(this.data);
};
e.prototype.showAd = function(t) {
var e = this;
this.adId = t.adPositionId;
this.adSprite.node.getChildByName("title").getComponent(cc.Label).string = t.title || "点击查看";
cc.find("load/label", this.adSprite.node).getComponent(cc.Label).string = t.clickBtnTxt || "点击查看";
var i = t.desc || t.source;
this.adSprite.node.getChildByName("desc").getComponent(cc.Label).string = i || "";
var o = c.default.checkImageUrl(t, !1), a = !!o;
this.adSprite.node.active = a;
a && cc.assetManager.loadRemote(o, {
ext: ".png"
}, function(t, i) {
t ? cc.error("广告图片展示错误：", JSON.stringify(t)) : cc.isValid(e.adSprite) && (e.adSprite.spriteFrame = new cc.SpriteFrame(i));
});
};
e.prototype.showReward = function(t) {
for (var e = 0; e < t.length; e++) if (this.rewardItem[e]) {
this.rewardItem[e].active = !0;
this.rewardItem[e].getChildByName("name").getComponent(cc.Label).string = t[e].propName;
var i = this.rewardItem[e].getChildByName("rare");
i.active = t[e].rare >= 0 && s.default.MODE != s.MODE_TYPE.LOCK;
var o = p.TextureLoader.inst.getSpriteFrame(p.ATLAS_TYPE.UIATLAS, "reward/rare_" + t[e].rare);
o && (i.getComponent(cc.Sprite).spriteFrame = o);
var a = this.rewardItem[e].getChildByName("icon"), r = p.TextureLoader.inst.getSpriteFrame(p.ATLAS_TYPE.UIATLAS, "propIcon/icon" + t[e].propID);
r && (a.getComponent(cc.Sprite).spriteFrame = r);
var n = this.rewardItem[e].getChildByName("num");
n.getComponent(cc.Label).string = t[e].number.toString();
n.active = !1;
var l = u.default.getPropByID(t[e].propID);
if (!l) return;
s.default.MODE == s.MODE_TYPE.COUNT || 1002 == l.propID ? n.active = !0 : s.default.MODE != s.MODE_TYPE.ALL || l.lock || (n.active = !0);
}
};
e.prototype.click = function(t) {
var e = this, i = t.getCurrentTarget().getComponent(cc.Button);
i.interactable = !1;
if (this.video.active) {
s.default.REPORT_ID = "achievVideo";
l.default.showVideoAds(function(t) {
if (1 == t) e.reward(2); else {
var o = 0 == t ? "视频播放未完成。" : "视频播放失败，请稍候再试！";
h.default.pushToast(o);
i.interactable = !0;
}
});
} else this.reward();
};
e.prototype.reward = function(t) {
var e, i;
void 0 === t && (t = 1);
try {
for (var o = n(this.data), a = o.next(); !a.done; a = o.next()) {
var r = a.value, l = u.default.getPropByID(r.propID);
if (l) {
s.default.MODE == s.MODE_TYPE.LOCK ? l.lock = !1 : s.default.MODE == s.MODE_TYPE.ALL && l.lock ? l.lock = !1 : l.number += r.number * t;
1002 == l.propID && (l.number += r.number * t);
}
}
} catch (t) {
e = {
error: t
};
} finally {
try {
a && !a.done && (i = o.return) && i.call(o);
} finally {
if (e) throw e.error;
}
}
u.default.save();
h.default.pushToast("恭喜你，领取奖励成功！");
this.close();
};
e.prototype.closeAd = function() {
this.adSprite.node.active = !1;
};
e.prototype.clickAd = function() {
l.default.reportNativeAdClick(this.adId);
HUAWEI_GAME && this.closeAd();
};
e.prototype.reportAdShow = function() {
l.default.reportNativeAdShow(this.adId);
};
r([ y(cc.Label) ], e.prototype, "title", void 0);
r([ y(cc.Node) ], e.prototype, "source", void 0);
r([ y(cc.Node) ], e.prototype, "logoBox", void 0);
r([ y(cc.Sprite) ], e.prototype, "adSprite", void 0);
r([ y(cc.Node) ], e.prototype, "video", void 0);
r([ y(cc.Label) ], e.prototype, "btnLabel", void 0);
r([ y([ cc.Node ]) ], e.prototype, "rewardItem", void 0);
return r([ m ], e);
}(d.GamePopBase);
i.default = _;
cc._RF.pop();
}, {
"../../../../../framework/main/Constants": void 0,
"../../../../common/src/GamePopBase": void 0,
"../../../../common/src/MsgCache": void 0,
"../../../../common/src/advert/AdTools": void 0,
"../../../../common/src/advert/AdsManager": void 0,
"../../../../common/src/data/UserData": void 0,
"../../texture/TextureLoader": "TextureLoader"
} ],
AiSystem: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "34ed8sHs5hGCpC609yk/mwe", "AiSystem");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
}), r = this && this.__values || function(t) {
var e = "function" == typeof Symbol && Symbol.iterator, i = e && t[e], o = 0;
if (i) return i.call(t);
if (t && "number" == typeof t.length) return {
next: function() {
t && o >= t.length && (t = void 0);
return {
value: t && t[o++],
done: !t
};
}
};
throw new TypeError(e ? "Object is not iterable." : "Symbol.iterator is not defined.");
};
Object.defineProperty(i, "__esModule", {
value: !0
});
i.AiSystemTester = i.AiSystemKingdom = i.AiSystemCity = i.AiSystemActor = void 0;
var n = t("../assetLibrary/AssetManager"), s = t("../behaviour/BehaviourActionBase"), l = function() {
function t(e) {
this.jobs_library = null;
this.task_library = null;
this.action_index = 0;
this.task_index = 0;
this.job = null;
this.task = null;
this.action = null;
this.ai_object = null;
this.nextJobDelegate = null;
this.jobSetStartAction = null;
this.jobSetEndAction = null;
this.clearAction = null;
this.ai_object = e;
this.nextJobDelegate = t.nextJobDefault();
}
t.prototype.updateNewBehJob = function() {
var t, e;
if (!this.job) {
var i = this.nextJobDelegate();
this.setJob(i);
}
if (this.job) {
this.task_index > this.job.tasks.length - 1 && (this.task_index = 0);
var o = this.job.tasks[this.task_index++], a = !0;
if (o.conditions && o.conditions.length > 0) try {
for (var n = r(o.conditions), s = n.next(); !s.done && (a = s.value.check(this.ai_object)); s = n.next()) ;
} catch (e) {
t = {
error: e
};
} finally {
try {
s && !s.done && (e = n.return) && e.call(n);
} finally {
if (t) throw t.error;
}
}
a ? this.setTask(o.id) : this.setTask("nothing");
}
};
t.prototype.setTask = function(t, e, i) {
void 0 === e && (e = !0);
void 0 === i && (i = !1);
e && this.clearBeh();
if (i) {
this.job = null;
this.task_index = 0;
}
this.task = this.task_library.get(t);
this.action_index = 0;
};
t.prototype.restartJob = function() {
this.action_index = 0;
this.task_index = 0;
};
t.prototype.clearBeh = function() {
this.clearAction && this.clearAction();
};
t.prototype.setJob = function(t) {
this.jobSetStartAction && this.jobSetStartAction();
this.job = t ? this.jobs_library.get(t) : null;
this.task_index = 0;
this.jobSetEndAction && this.jobSetEndAction();
};
t.prototype.logicUpdate = function() {
if (this.task) if (this.action_index > this.task.list.length - 1) this.setTaskBehFinished(); else {
this.action = this.task.get(this.action_index);
switch (this.action.startExecute(this.ai_object)) {
case s.BehResult.Continue:
this.action_index++;
break;

case s.BehResult.Stop:
this.setTaskBehFinished();
break;

case s.BehResult.RestartTask:
this.action_index = 0;
break;

case s.BehResult.RepeatStep:
case s.BehResult.Skip:
}
} else this.updateNewBehJob();
};
t.prototype.setTaskBehFinished = function() {
this.task = null;
this.action_index = -1;
};
t.prototype.debugLogAction = function() {};
t.prototype.debugLogActionResult = function() {};
t.nextJobDefault = function() {
return null;
};
return t;
}();
i.default = l;
var c = function(t) {
a(e, t);
function e(e) {
return t.call(this, e) || this;
}
return e;
}(l);
i.AiSystemActor = c;
var u = function(t) {
a(e, t);
function e(e) {
return t.call(this, e) || this;
}
return e;
}(l);
i.AiSystemCity = u;
var d = function(t) {
a(e, t);
function e(e) {
return t.call(this, e) || this;
}
return e;
}(l);
i.AiSystemKingdom = d;
var h = function(t) {
a(e, t);
function e(e) {
var i = t.call(this, e) || this;
i.jobs_library = n.default.tester_jobs;
i.task_library = n.default.tester_tasks;
return i;
}
return e;
}(l);
i.AiSystemTester = h;
cc._RF.pop();
}, {
"../assetLibrary/AssetManager": "AssetManager",
"../behaviour/BehaviourActionBase": "BehaviourActionBase"
} ],
AntimatterBombEffect: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "4ba1bWzcWJPvZmlynS5DtKH", "AntimatterBombEffect");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
}), r = this && this.__decorate || function(t, e, i, o) {
var a, r = arguments.length, n = r < 3 ? e : null === o ? o = Object.getOwnPropertyDescriptor(e, i) : o;
if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) n = Reflect.decorate(t, e, i, o); else for (var s = t.length - 1; s >= 0; s--) (a = t[s]) && (n = (r < 3 ? a(n) : r > 3 ? a(e, i, n) : a(e, i)) || n);
return r > 3 && n && Object.defineProperty(e, i, n), n;
};
Object.defineProperty(i, "__esModule", {
value: !0
});
var n = t("../actors/ActorStatus"), s = t("../animation/SpriteAnimation"), l = t("../assetLibrary/AssetManager"), c = t("../base/BaseEffect"), u = t("../brush/Brush"), d = t("../game/audio/GameAudio"), h = t("../MapBox"), p = cc._decorator, f = p.ccclass, m = (p.property, 
function(t) {
a(e, t);
function e() {
var e = null !== t && t.apply(this, arguments) || this;
e.used = !1;
e.godPower = null;
return e;
}
e.prototype.create = function() {
t.prototype.create.call(this);
};
e.prototype.onLoad = function() {
this.spriteAnimation = this.getComponent(s.SpriteAnimation);
};
e.prototype.logicUpdate = function(e) {
t.prototype.logicUpdate.call(this, e);
h.default.inst.startShake();
if (this.spriteAnimation.currentFrameIndex >= 15 && !this.used) {
this.used = !0;
h.default.inst.applyForce(this.tile, 10, 0, !0, !1, 1e3, [], null, n.AttackType.Bomb);
h.default.inst.drawWithBrush(this.tile.pos, u.default.getBrushBySize(11), 1, "tile", this.godPower.tileType, this.godPower);
}
};
e.prototype.spawn = function(t) {
this.tile = t;
this.used = !1;
this.godPower = l.default.powers.get("tileDeepOcean");
this.prepare(t, 1);
this.spriteAnimation.resetAnim();
d.default.playAntimatterBomb();
};
return r([ f ], e);
}(c.default));
i.default = m;
cc._RF.pop();
}, {
"../MapBox": "MapBox",
"../actors/ActorStatus": "ActorStatus",
"../animation/SpriteAnimation": "SpriteAnimation",
"../assetLibrary/AssetManager": "AssetManager",
"../base/BaseEffect": "BaseEffect",
"../brush/Brush": "Brush",
"../game/audio/GameAudio": "GameAudio"
} ],
Ant: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "e1c86qsurxM2YqnpBC6DfiH", "Ant");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
}), r = this && this.__decorate || function(t, e, i, o) {
var a, r = arguments.length, n = r < 3 ? e : null === o ? o = Object.getOwnPropertyDescriptor(e, i) : o;
if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) n = Reflect.decorate(t, e, i, o); else for (var s = t.length - 1; s >= 0; s--) (a = t[s]) && (n = (r < 3 ? a(n) : r > 3 ? a(e, i, n) : a(e, i)) || n);
return r > 3 && n && Object.defineProperty(e, i, n), n;
};
Object.defineProperty(i, "__esModule", {
value: !0
});
var n = t("../../../../../framework/lib/prototype/MathUtils"), s = t("../../assetLibrary/AssetManager"), l = t("../../base/BaseActorComponent"), c = t("../../brush/Brush"), u = t("../../common/ToolBox"), d = t("../../game/audio/GameAudio"), h = t("../../map/tile/TileType"), p = t("../../MapBox"), f = t("../ActorStatus"), m = cc._decorator, y = m.ccclass, _ = (m.property, 
function(t) {
a(e, t);
function e() {
var e = null !== t && t.apply(this, arguments) || this;
e.tumorTicks = -1;
e.stuckTicks = 0;
e.stepsMin = 0;
e.stepsMax = 0;
e.nextTile = null;
e.printTileOrigin = null;
e.printTick = 0;
e.currentPrint = null;
e.randomSteps = 0;
e.spiderChangedDirection = !1;
e.redAntTileType1 = "";
e.redAntTileType2 = "";
e.antMode = 0;
e.antCounter = 0;
e.antSteps = 0;
e.changeDir = 3;
e.isTumorTentacle = !1;
e.tumor = null;
return e;
}
i = e;
e.prototype.create = function() {
t.prototype.create.call(this);
this.currentDirection = f.ActorDirection.Up;
this.stepsMin = u.Toolbox.randomInt(1, 6);
this.stepsMax = u.Toolbox.randomInt(10, 60);
};
e.prototype.logicUpdate = function(e) {
t.prototype.logicUpdate.call(this, e);
"sandSpider" == this.actor.stats.id ? this.sandSpider() : "worm" == this.actor.stats.id ? this.updateWorm() : "tentacle" == this.actor.stats.id ? this.tumorTick() : "printer" == this.actor.stats.id ? this.updatePrinter() : this.chooseAntAction();
};
e.prototype.updatePrinter = function() {
if (this.currentPrint) for (var t = 0; t < this.currentPrint.stepsPerTick; t++) this.printStep();
};
e.prototype.setPrintTemplate = function(t) {
this.currentPrint = t;
this.printTileOrigin = this.actor.currentTile;
};
e.prototype.printStep = function() {
if (this.printTick >= this.currentPrint.steps.length) this.actor.killHimself(!1, f.AttackType.None, !1); else {
var t = this.currentPrint.steps[this.printTick], e = p.default.inst.getTile(this.printTileOrigin.pos.x + t.x, this.printTileOrigin.pos.y + t.y);
if (e) {
this.actor.spawnOn(e);
this.printTile();
}
this.printTick++;
}
};
e.prototype.printTile = function() {
d.default.playPrint1(this.node.position);
if (this.actor.currentTile.type.increaseTo) {
p.default.inst.terraformTile2(this.actor.currentTile, this.actor.currentTile.type.increaseTo, s.default.terraform.get("destroy"));
p.default.inst.setTileDirty(this.actor.currentTile, !0);
}
p.default.inst.conwayLayer.remove(this.actor.currentTile);
};
e.prototype.chooseAntAction = function() {
switch (this.actor.stats.id) {
case "antBlack":
this.antBlack();
break;

case "antGreen":
this.antGreen();
break;

case "antBlue":
this.antBlue();
break;

case "antRed":
this.antRed();
}
};
e.prototype.antAction = function(t) {
var e, o, a, r, n, s, l, c, u, d, h, p, m, y, _, g, v;
if ("worm" == this.actor.stats.id) {
t < 0 && (t = i.wormdirections.length - 1);
t == i.wormdirections.length && (t = 0);
v = i.wormdirections[t];
} else {
t < 0 && (t = i.directions.length - 1);
t == i.directions.length && (t = 0);
v = i.directions[t];
}
var b = null;
switch (v) {
case f.ActorDirection.Up:
(b = this.actor.currentTile.tile_up) || (b = this.actor.currentTile.tile_down);
break;

case f.ActorDirection.UpRight:
(b = null === (o = null === (e = this.actor.currentTile) || void 0 === e ? void 0 : e.tile_up) || void 0 === o ? void 0 : o.tile_right) || (b = null === (r = null === (a = this.actor.currentTile) || void 0 === a ? void 0 : a.tile_down) || void 0 === r ? void 0 : r.tile_left);
break;

case f.ActorDirection.UpLeft:
(b = null === (s = null === (n = this.actor.currentTile) || void 0 === n ? void 0 : n.tile_up) || void 0 === s ? void 0 : s.tile_left) || (b = null === (c = null === (l = this.actor.currentTile) || void 0 === l ? void 0 : l.tile_down) || void 0 === c ? void 0 : c.tile_right);
break;

case f.ActorDirection.Right:
(b = this.actor.currentTile.tile_right) || (b = this.actor.currentTile.tile_left);
break;

case f.ActorDirection.Down:
(b = this.actor.currentTile.tile_down) || (b = this.actor.currentTile.tile_up);
break;

case f.ActorDirection.DownRight:
(b = null === (d = null === (u = this.actor.currentTile) || void 0 === u ? void 0 : u.tile_down) || void 0 === d ? void 0 : d.tile_right) || (b = null === (p = null === (h = this.actor.currentTile) || void 0 === h ? void 0 : h.tile_up) || void 0 === p ? void 0 : p.tile_left);
break;

case f.ActorDirection.DownLeft:
(b = null === (y = null === (m = this.actor.currentTile) || void 0 === m ? void 0 : m.tile_down) || void 0 === y ? void 0 : y.tile_left) || (b = null === (g = null === (_ = this.actor.currentTile) || void 0 === _ ? void 0 : _.tile_up) || void 0 === g ? void 0 : g.tile_right);
break;

case f.ActorDirection.Left:
(b = this.actor.currentTile.tile_left) || (b = this.actor.currentTile.tile_right);
}
this.moveTo(b);
};
e.prototype.getNewDirection = function(t) {
var e, i, o, a, r, n, s, l;
return this.actor.currentTile.tile_up == t ? f.ActorDirection.Up : (null === (i = null === (e = this.actor.currentTile) || void 0 === e ? void 0 : e.tile_up) || void 0 === i ? void 0 : i.tile_right) == t ? f.ActorDirection.UpRight : (null === (a = null === (o = this.actor.currentTile) || void 0 === o ? void 0 : o.tile_up) || void 0 === a ? void 0 : a.tile_left) == t ? f.ActorDirection.UpLeft : this.actor.currentTile.tile_down == t ? f.ActorDirection.Down : (null === (n = null === (r = this.actor.currentTile) || void 0 === r ? void 0 : r.tile_down) || void 0 === n ? void 0 : n.tile_right) == t ? f.ActorDirection.DownRight : (null === (l = null === (s = this.actor.currentTile) || void 0 === s ? void 0 : s.tile_down) || void 0 === l ? void 0 : l.tile_left) == t ? f.ActorDirection.DownLeft : this.actor.currentTile.tile_left == t ? f.ActorDirection.Left : this.actor.currentTile.tile_right == t ? f.ActorDirection.Right : f.ActorDirection.Up;
};
e.prototype.getNextTileBasedOnDirection = function(t, e) {
var i, o, a, r, n = null;
e == f.ActorDirection.Up && (n = null == t ? void 0 : t.tile_up);
f.ActorDirection.UpRight == e && (n = null === (i = null == t ? void 0 : t.tile_up) || void 0 === i ? void 0 : i.tile_right);
f.ActorDirection.UpLeft == e && (n = null === (o = null == t ? void 0 : t.tile_up) || void 0 === o ? void 0 : o.tile_left);
f.ActorDirection.Down == e && (n = null == t ? void 0 : t.tile_down);
f.ActorDirection.DownRight == e && (n = null === (a = null == t ? void 0 : t.tile_down) || void 0 === a ? void 0 : a.tile_right);
f.ActorDirection.DownLeft == e && (n = null === (r = null == t ? void 0 : t.tile_down) || void 0 === r ? void 0 : r.tile_left);
f.ActorDirection.Left == e && (n = null == t ? void 0 : t.tile_left);
f.ActorDirection.Right == e && (n = null == t ? void 0 : t.tile_right);
return n || (null == t ? void 0 : t.tile_up);
};
e.prototype.moveTo = function(t) {
this.currentDirection = this.getNewDirection(t);
this.nextTile = this.getNextTileBasedOnDirection(t, this.currentDirection);
this.nextTile && (this.nextTile = this.getNextTileBasedOnDirection(this.nextTile, this.currentDirection));
this.nextTile && (this.nextTile = this.getNextTileBasedOnDirection(this.nextTile, this.currentDirection));
this.nextTile && !this.nextTile.type.block ? this.actor.moveTo(t) : this.currentDirection = this.getNewDirection(t);
};
e.prototype.updateWorm = function() {
if (0 == this.antSteps || this.antSteps > this.randomSteps) {
this.currentDirection = u.Toolbox.getRandom(i.wormdirections);
this.randomSteps = u.Toolbox.randomInt(this.stepsMin, this.stepsMax);
this.antSteps = 1;
}
var t = i.wormdirections.indexOf(this.currentDirection);
this.actor.currentTile.Height < 220 && p.default.inst.drawWithBrush(this.actor.currentTile.pos, c.default.getBrushBySize(2), 3, "worm");
this.antAction(t);
this.antSteps++;
};
e.prototype.sandSpider = function() {
if (0 == this.antSteps) this.currentDirection = u.Toolbox.getRandom(i.directions); else if (this.actor.currentTile.type.isType("sand") && !this.spiderChangedDirection) {
this.currentDirection = u.Toolbox.getRandom(i.directions);
this.spiderChangedDirection = !0;
}
var t = i.directions.indexOf(this.currentDirection);
this.actor.currentTile.type.isType("sand") || (this.spiderChangedDirection = !1);
this.terraformTile(this.actor.currentTile, "sand");
this.antAction(t);
this.antSteps++;
this.antSteps > 20 && this.actor.killHimself(!1, f.AttackType.None, !1);
};
e.prototype.antBlue = function() {
var t = i.directions.indexOf(this.currentDirection), e = "";
if (this.actor.currentTile.type.liquid) {
e = "sand";
t++;
} else {
e = "shallow_waters";
t--;
}
this.terraformTile(this.actor.currentTile, e);
this.antAction(t);
};
e.prototype.antRed = function() {
if (!this.redAntTileType1) {
this.redAntTileType1 = h.TileType.getRandomTileType();
this.redAntTileType2 = h.TileType.getRandomTileType(this.redAntTileType1);
}
var t = i.directions.indexOf(this.currentDirection);
0 == this.antSteps && (t = i.directions.indexOf(this.currentDirection));
if (this.actor.currentTile.type.isType(this.redAntTileType2)) {
this.terraformTile(this.actor.currentTile, this.redAntTileType1);
if (this.antSteps++ > 3) {
t++;
this.antSteps = 0;
}
} else {
this.terraformTile(this.actor.currentTile, this.redAntTileType2);
if (this.antSteps++ > 3) {
t--;
this.antSteps = 0;
}
}
this.antAction(t);
};
e.prototype.antGreen = function() {
var t = i.directions.indexOf(this.currentDirection), e = "";
if (this.actor.currentTile.type.liquid) {
e = "sand";
t--;
} else if (this.actor.currentTile.type.isType("sand")) {
e = "soil";
t++;
} else if (this.actor.currentTile.type.isType("soil")) {
e = "forest";
t--;
} else if (this.actor.currentTile.type.isType("forest")) {
e = "soil";
t++;
} else {
e = "sand";
t--;
}
this.terraformTile(this.actor.currentTile, e);
this.antAction(t);
};
e.prototype.antBlack = function() {
var t = i.directions.indexOf(this.currentDirection);
if (0 == this.antMode) {
this.actor.currentTile.type.liquid && (this.antCounter = 20);
if (this.antCounter > 0) {
var e = "";
if (this.actor.currentTile.type.isType("mountains")) {
e = "hills";
t--;
} else {
e = "mountains";
t++;
}
this.terraformTile(this.actor.currentTile, e);
this.antCounter--;
}
if (0 == this.antCounter) {
this.antCounter = 40;
this.antMode = 1;
this.currentDirection = u.Toolbox.getRandom(i.directions);
t = i.directions.indexOf(this.currentDirection);
}
} else if (this.antCounter > 0) {
this.antCounter--;
if (this.actor.currentTile.type.isType("mountains") || this.actor.currentTile.type.isType("hills")) {
this.currentDirection = u.Toolbox.getRandom(i.directions);
t = i.directions.indexOf(this.currentDirection);
} else {
this.terraformTile(this.actor.currentTile, "sand");
this.currentDirection = u.Toolbox.getRandom(i.directions);
t = i.directions.indexOf(this.currentDirection);
}
0 == this.antCounter && (this.antMode = 0);
}
this.antAction(t);
};
e.prototype.antTile1 = function() {
var t = i.directions.indexOf(this.currentDirection);
this.changeDir--;
var e = t, o = "";
if (this.actor.currentTile.type.isType("forest")) {
o = "soil";
t++;
} else if (this.actor.currentTile.type.liquid) {
o = "sand";
t++;
} else {
o = "forest";
t--;
}
this.terraformTile(this.actor.currentTile, o);
this.changeDir > 0 ? t = e : this.changeDir = 2;
this.antAction(t);
};
e.prototype.killTentacle = function() {
if (this.tumor) {
this.tumor.tentacles--;
this.tumor = null;
}
};
e.prototype.setTumor = function(t) {
this.tumor = t;
this.tumorTicks = -1;
this.tumor.tentacles++;
this.isTumorTentacle = !0;
};
e.prototype.tumorTick = function() {
var t, e;
if (null === (e = null === (t = this.tumor.building) || void 0 === t ? void 0 : t.data) || void 0 === e ? void 0 : e.alive) if (this.tumorTicks < 0 || this.stuckTicks > 10 || this.actor.currentTile.type.liquid) {
this.actor.stopMovement();
this.tumorTicks = 10;
this.stuckTicks = 0;
this.actor.spawnOn(this.tumor.building.currentTile);
this.tumorDirection = u.Toolbox.getRandom(i.directions);
} else {
var o = this.actor.currentTile.pos.x, a = this.actor.currentTile.pos.y;
switch (this.tumorDirection) {
case f.ActorDirection.Up:
o += n.default.randomInt(-1, 2);
a++;
break;

case f.ActorDirection.Right:
o++;
a += n.default.randomInt(-1, 2);
break;

case f.ActorDirection.Down:
o += n.default.randomInt(-1, 2);
a--;
break;

case f.ActorDirection.Left:
o--;
a += n.default.randomInt(-1, 2);
}
var r = p.default.inst.getTile(o, a);
if (null == r || r.type.liquid || r.type.rocks || r.data.fire || r.type.block) {
this.stuckTicks++;
this.tumorDirection = u.Toolbox.getRandom(i.directions);
} else {
this.stuckTicks = 0;
this.moveTo(r);
if (r.type.canBecomeCreep && !r.type.creep) {
this.tumorTicks--;
p.default.inst.terraformTile2(r, h.TileType.get(r.type.creepID), s.default.terraform.get("tumor_attack"));
}
}
} else this.actor.killHimself(!1, f.AttackType.None, !1);
};
e.prototype.terraformTile = function(t, e) {
p.default.inst.terraformTile2(t, h.TileType.get(e), s.default.terraform.get("destroy"));
};
var i;
e.directions = [ f.ActorDirection.Up, f.ActorDirection.Right, f.ActorDirection.Down, f.ActorDirection.Left ];
e.wormdirections = [ f.ActorDirection.Up, f.ActorDirection.UpRight, f.ActorDirection.UpLeft, f.ActorDirection.Right, f.ActorDirection.DownRight, f.ActorDirection.DownLeft, f.ActorDirection.Down, f.ActorDirection.Left ];
return i = r([ y ], e);
}(l.default));
i.default = _;
cc._RF.pop();
}, {
"../../../../../framework/lib/prototype/MathUtils": void 0,
"../../MapBox": "MapBox",
"../../assetLibrary/AssetManager": "AssetManager",
"../../base/BaseActorComponent": "BaseActorComponent",
"../../brush/Brush": "Brush",
"../../common/ToolBox": "ToolBox",
"../../game/audio/GameAudio": "GameAudio",
"../../map/tile/TileType": "TileType",
"../ActorStatus": "ActorStatus"
} ],
AssetLibrary: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "9ef8c0WabBN4ohVDr1vg4LG", "AssetLibrary");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
});
Object.defineProperty(i, "__esModule", {
value: !0
});
i.BaseAssetLibrary = i.Asset = void 0;
var r = t("../../../../framework/utils/Log"), n = t("../../../../framework/utils/SaveUtils");
i.Asset = function() {
this.id = "ASSET_ID";
};
var s = function() {
function t() {
this.id = "ASSET_LIBRARY";
}
t.prototype.init = function() {};
t.prototype.saveAssets = function() {
var t = JSON.stringify(this);
n.default.set("/modules/core/" + this.id, t);
};
return t;
}();
i.BaseAssetLibrary = s;
var l = function(t) {
a(e, t);
function e() {
var e = null !== t && t.apply(this, arguments) || this;
e.list = new Array();
e.dict = new Map();
e.t = null;
return e;
}
e.prototype.get = function(t) {
return this.dict.get(t);
};
e.prototype.add = function(t) {
var e = t.id;
if (this.dict.has(e)) {
for (var i = 0; i < this.list.length; i++) if (this.list[i].id == e) {
this.list.splice(i, 1);
break;
}
this.dict.delete(e);
r.default.d("[" + this.id + "] found new asset to replace... " + e);
}
this.t = t;
this.list.push(t);
this.dict.set(e, t);
return t;
};
e.prototype.clone = function() {
return null;
};
return e;
}(s);
i.default = l;
cc._RF.pop();
}, {
"../../../../framework/utils/Log": void 0,
"../../../../framework/utils/SaveUtils": void 0
} ],
AssetManager: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "06c6ebna2lJAYeIFyQyfjwT", "AssetManager");
Object.defineProperty(i, "__esModule", {
value: !0
});
var o = t("../map/generator/ItemGenerator"), a = t("../tester/TesterBehTaskLibrary"), r = t("../tester/TesterJobLibrary"), n = t("./lib/ActorJobLibrary"), s = t("./lib/ActorStatsLibrary"), l = t("./lib/ActorTraitLibrary"), c = t("./lib/BehaviourTaskActorLibrary"), u = t("./lib/BehaviourTaskCityLibrary"), d = t("./lib/BehaviourTaskKingdomLibrary"), h = t("./lib/BuildingLibrary"), p = t("./lib/CityJobLibrary"), f = t("./lib/DisasterLibrary"), m = t("./lib/DropsLibrary"), y = t("./lib/ItemAccessoryMaterialLibrary"), _ = t("./lib/ItemArmorMaterialLibrary"), g = t("./lib/ItemLibrary"), v = t("./lib/ItemPrefixLibrary"), b = t("./lib/ItemSuffixLibrary"), T = t("./lib/ItemWeaponMaterialLibrary"), w = t("./lib/KingdomJobLibrary"), B = t("./lib/KingdomLibrary"), k = t("./lib/MoodLibrary"), A = t("./lib/NameGeneratorLibrary"), S = t("./lib/PersonalityLibrary"), x = t("./lib/PowerLibrary"), C = t("./lib/ProfessionLibrary"), O = t("./lib/ProjectileLibrary"), P = t("./lib/RaceLibrary"), R = t("./lib/ResourceLibrary"), M = t("./lib/SpellLibrary"), L = t("./lib/StatusLibrary"), F = t("./lib/TerraformList"), D = function() {
function t() {
this.list = [];
this.dict = new Map();
this.assetgv = "0";
this.add(t.professions = new C.default(), "professions");
this.add(t.personalities = new S.default(), "personalities");
this.add(t.moods = new k.default(), "moods");
this.add(t.drops = new m.default(), "drops");
this.add(t.buildings = new h.default(), "buildings");
this.add(t.status = new L.default(), "status");
this.add(t.spells = new M.default(), "spells");
this.add(t.tasks_actor = new c.default(), "beh");
this.add(t.tasks_city = new u.default(), "beh_city");
this.add(t.tasks_kingdom = new d.default(), "beh_kingdom");
this.add(t.kingdoms = new B.default(), "kingdoms");
this.add(t.raceLibrary = new P.default(), "race");
this.add(t.unitStats = new s.default(), "units");
this.add(t.nameGenerator = new A.default(), "name_generator");
this.add(t.disasters = new f.default(), "disasters");
this.add(t.traits = new l.default(), "traits");
this.add(t.job_actor = new n.default(), "jobs_actor");
this.add(t.job_city = new p.default(), "jobs_city");
this.add(t.job_kingdom = new w.default(), "jobs_kingdom");
this.add(t.powers = new x.default(), "powers");
this.add(t.items = new g.default(), "items");
this.add(t.items_prefix = new v.default(), "items_prefix");
this.add(t.items_suffix = new b.default(), "items_suffix");
this.add(t.items_material_weapon = new T.default(), "items_material_weapon");
this.add(t.items_material_armor = new _.default(), "items_material_armor");
this.add(t.items_material_accessory = new y.default(), "items_material_jewelry");
this.add(t.resources = new R.default(), "resources");
this.add(t.terraform = new F.default(), "terraform");
this.add(t.projectiles = new O.default(), "projectiles");
this.add(t.tester_jobs = new r.default(), "tester_jobs");
this.add(t.tester_tasks = new a.default(), "tester_tasks");
o.default.init();
}
t.init = function() {
t.inst = new t();
};
t.prototype.add = function(t, e) {
if ("0" == this.assetgv[0]) {
t.init();
this.list.push(t);
this.dict.set(e, t);
t.id = e;
}
};
t.inst = null;
t.job_kingdom = null;
t.tasks_kingdom = null;
t.job_city = null;
t.tasks_city = null;
t.job_actor = null;
t.tasks_actor = null;
t.moods = null;
t.personalities = null;
t.professions = null;
t.drops = null;
t.buildings = null;
t.unitStats = null;
t.traits = null;
t.kingdoms = null;
t.nameGenerator = null;
t.disasters = null;
t.raceLibrary = null;
t.resources = null;
t.items = null;
t.items_prefix = null;
t.items_suffix = null;
t.items_material_weapon = null;
t.items_material_armor = null;
t.items_material_accessory = null;
t.projectiles = null;
t.terraform = null;
t.powers = null;
t.spells = null;
t.status = null;
t.tester_jobs = null;
t.tester_tasks = null;
return t;
}();
i.default = D;
cc._RF.pop();
}, {
"../map/generator/ItemGenerator": "ItemGenerator",
"../tester/TesterBehTaskLibrary": "TesterBehTaskLibrary",
"../tester/TesterJobLibrary": "TesterJobLibrary",
"./lib/ActorJobLibrary": "ActorJobLibrary",
"./lib/ActorStatsLibrary": "ActorStatsLibrary",
"./lib/ActorTraitLibrary": "ActorTraitLibrary",
"./lib/BehaviourTaskActorLibrary": "BehaviourTaskActorLibrary",
"./lib/BehaviourTaskCityLibrary": "BehaviourTaskCityLibrary",
"./lib/BehaviourTaskKingdomLibrary": "BehaviourTaskKingdomLibrary",
"./lib/BuildingLibrary": "BuildingLibrary",
"./lib/CityJobLibrary": "CityJobLibrary",
"./lib/DisasterLibrary": "DisasterLibrary",
"./lib/DropsLibrary": "DropsLibrary",
"./lib/ItemAccessoryMaterialLibrary": "ItemAccessoryMaterialLibrary",
"./lib/ItemArmorMaterialLibrary": "ItemArmorMaterialLibrary",
"./lib/ItemLibrary": "ItemLibrary",
"./lib/ItemPrefixLibrary": "ItemPrefixLibrary",
"./lib/ItemSuffixLibrary": "ItemSuffixLibrary",
"./lib/ItemWeaponMaterialLibrary": "ItemWeaponMaterialLibrary",
"./lib/KingdomJobLibrary": "KingdomJobLibrary",
"./lib/KingdomLibrary": "KingdomLibrary",
"./lib/MoodLibrary": "MoodLibrary",
"./lib/NameGeneratorLibrary": "NameGeneratorLibrary",
"./lib/PersonalityLibrary": "PersonalityLibrary",
"./lib/PowerLibrary": "PowerLibrary",
"./lib/ProfessionLibrary": "ProfessionLibrary",
"./lib/ProjectileLibrary": "ProjectileLibrary",
"./lib/RaceLibrary": "RaceLibrary",
"./lib/ResourceLibrary": "ResourceLibrary",
"./lib/SpellLibrary": "SpellLibrary",
"./lib/StatusLibrary": "StatusLibrary",
"./lib/TerraformList": "TerraformList"
} ],
AutoTesterBot: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "a3a9dfS0udPhIUZLfsKeDoP", "AutoTesterBot");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
});
Object.defineProperty(i, "__esModule", {
value: !0
});
var r = t("../ai/AiSystem"), n = t("../assetLibrary/AssetManager"), s = function(t) {
a(e, t);
function e() {
var e = null !== t && t.apply(this, arguments) || this;
e.debugString = "";
e.active = !1;
e.ai = null;
e.wait = 0;
return e;
}
e.prototype.create = function() {
t.prototype.create.call(this);
this.ai = new r.AiSystemTester(this);
this.ai.nextJobDelegate = n.default.tester_jobs.getNextJob;
};
e.prototype.logicUpdate = function(e) {
if (this.active) {
t.prototype.logicUpdate.call(this, e);
this.wait > 0 ? this.wait -= e : this.ai.logicUpdate(e);
}
};
return e;
}(t("../base/BaseMapObject").default);
i.default = s;
cc._RF.pop();
}, {
"../ai/AiSystem": "AiSystem",
"../assetLibrary/AssetManager": "AssetManager",
"../base/BaseMapObject": "BaseMapObject"
} ],
AwardView: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "c472190yXxNaLVFP1d6T6pX", "AwardView");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
}), r = this && this.__decorate || function(t, e, i, o) {
var a, r = arguments.length, n = r < 3 ? e : null === o ? o = Object.getOwnPropertyDescriptor(e, i) : o;
if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) n = Reflect.decorate(t, e, i, o); else for (var s = t.length - 1; s >= 0; s--) (a = t[s]) && (n = (r < 3 ? a(n) : r > 3 ? a(e, i, n) : a(e, i)) || n);
return r > 3 && n && Object.defineProperty(e, i, n), n;
}, n = this && this.__values || function(t) {
var e = "function" == typeof Symbol && Symbol.iterator, i = e && t[e], o = 0;
if (i) return i.call(t);
if (t && "number" == typeof t.length) return {
next: function() {
t && o >= t.length && (t = void 0);
return {
value: t && t[o++],
done: !t
};
}
};
throw new TypeError(e ? "Object is not iterable." : "Symbol.iterator is not defined.");
};
Object.defineProperty(i, "__esModule", {
value: !0
});
i.Reward_type = void 0;
var s, l = t("../../../../../framework/main/Constants"), c = t("../../../../common/src/advert/AdsManager"), u = t("../../../../common/src/advert/sdk/GameTdd"), d = t("../../../../common/src/data/RewardData"), h = t("../../../../common/src/data/UserData"), p = t("../../../../common/src/GamePopBase"), f = t("../../common/ToolBox"), m = t("../../texture/TextureLoader");
(function(t) {
t[t.online = 0] = "online";
t[t.sign = 1] = "sign";
t[t.cumulative = 2] = "cumulative";
t[t.luckyWheel = 3] = "luckyWheel";
t[t.boxMonster = 4] = "boxMonster";
t[t.collect = 5] = "collect";
t[t.achiev = 6] = "achiev";
t[t.vedio = 7] = "vedio";
t[t.mystery = 8] = "mystery";
t[t.share = 9] = "share";
t[t.boxGift = 10] = "boxGift";
})(s = i.Reward_type || (i.Reward_type = {}));
var y = [ "在线奖励", "签到奖励", "累计奖励", "幸运转盘", "稀有宝箱怪", "收藏有礼", "成就奖励", "视频奖励", "神秘礼物", "分享奖励", "盒子礼物" ], _ = cc._decorator, g = _.ccclass, v = _.property, b = function(t) {
a(e, t);
function e() {
var e = null !== t && t.apply(this, arguments) || this;
e.source = null;
e.rewardItem = [];
e.data = [];
e.type = s.online;
e.guiding = !1;
e.bannerTime = 0;
return e;
}
Object.defineProperty(e.prototype, "isGuiding", {
set: function(t) {
this.guiding = t;
},
enumerable: !1,
configurable: !0
});
e.prototype.onLoad = function() {
this.bg.getChildByName("btnClose").active = l.default.MODE != l.MODE_TYPE.LOCK;
};
e.prototype.init = function(t, e) {
var i, o;
this.type = t;
this.source.string = y[t];
try {
for (var a = n(this.rewardItem), r = a.next(); !r.done; r = a.next()) r.value.active = !1;
} catch (t) {
i = {
error: t
};
} finally {
try {
r && !r.done && (o = a.return) && o.call(a);
} finally {
if (i) throw i.error;
}
}
this.data = "number" == typeof e ? d.default.getRewards(e) : Array.from(e);
this.showReward(this.data);
};
e.prototype.showReward = function(t) {
for (var e = 0; e < t.length; e++) if (this.rewardItem[e]) {
this.rewardItem[e].active = !0;
this.rewardItem[e].getChildByName("name").getComponent(cc.Label).string = t[e].propName;
var i = this.rewardItem[e].getChildByName("rare");
i.active = t[e].rare >= 0 && l.default.MODE != l.MODE_TYPE.LOCK;
var o = m.TextureLoader.inst.getSpriteFrame(m.ATLAS_TYPE.UIATLAS, "reward/rare_" + t[e].rare);
o && (i.getComponent(cc.Sprite).spriteFrame = o);
var a = this.rewardItem[e].getChildByName("icon"), r = m.TextureLoader.inst.getSpriteFrame(m.ATLAS_TYPE.UIATLAS, "propIcon/icon" + t[e].propID);
r && (a.getComponent(cc.Sprite).spriteFrame = r);
var n = this.rewardItem[e].getChildByName("num");
n.getComponent(cc.Label).string = t[e].number.toString();
n.active = !1;
var s = h.default.getPropByID(t[e].propID);
if (!s) return;
if (l.default.MODE == l.MODE_TYPE.LOCK) s.lock = !1; else if (l.default.MODE == l.MODE_TYPE.ALL) if (s.lock) s.lock = !1; else {
n.active = !0;
s.number += t[e].number;
} else {
n.active = !0;
s.number += t[e].number;
}
if (1002 == s.propID) {
n.active = !0;
s.number += t[e].number;
}
}
h.default.save();
};
e.prototype.sure = function(t) {
var e = this;
if (1 != this.bannerTime) if (2 != this.bannerTime) {
var i = t.getCurrentTarget(), o = u.default.getData("p5", u.v_type.Number), a = u.default.getData("p6", u.v_type.Number) || .3;
if (l.default.MODE == l.MODE_TYPE.LOCK && null != o && f.Toolbox.randomRate(o / 100)) {
this.bannerTime++;
var r = i.parent.convertToWorldSpaceAR(i.position);
this.scheduleOnce(function() {
c.default.moveBanner(r.y);
e.bg.getChildByName("btnClose").active = !0;
setTimeout(function() {
e.bannerTime++;
c.default.hideBannerAd(!1);
}, 2e3);
}, a);
} else this.close();
} else this.close();
};
r([ v(cc.Label) ], e.prototype, "source", void 0);
r([ v([ cc.Node ]) ], e.prototype, "rewardItem", void 0);
return r([ g ], e);
}(p.GamePopBase);
i.default = b;
cc._RF.pop();
}, {
"../../../../../framework/main/Constants": void 0,
"../../../../common/src/GamePopBase": void 0,
"../../../../common/src/advert/AdsManager": void 0,
"../../../../common/src/advert/sdk/GameTdd": void 0,
"../../../../common/src/data/RewardData": void 0,
"../../../../common/src/data/UserData": void 0,
"../../common/ToolBox": "ToolBox",
"../../texture/TextureLoader": "TextureLoader"
} ],
Baby: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "b1ef3iiGydBi5f5emmS4R6K", "Baby");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
}), r = this && this.__decorate || function(t, e, i, o) {
var a, r = arguments.length, n = r < 3 ? e : null === o ? o = Object.getOwnPropertyDescriptor(e, i) : o;
if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) n = Reflect.decorate(t, e, i, o); else for (var s = t.length - 1; s >= 0; s--) (a = t[s]) && (n = (r < 3 ? a(n) : r > 3 ? a(e, i, n) : a(e, i)) || n);
return r > 3 && n && Object.defineProperty(e, i, n), n;
};
Object.defineProperty(i, "__esModule", {
value: !0
});
var n = t("../../base/BaseActorComponent"), s = t("../../MapBox"), l = t("../ActorStatus"), c = cc._decorator, u = c.ccclass, d = (c.property, 
function(t) {
a(e, t);
function e() {
var e = null !== t && t.apply(this, arguments) || this;
e.timerGrow = 0;
return e;
}
e.prototype.create = function() {
t.prototype.create.call(this);
this.timerGrow = this.actor.stats.timeToGrow;
};
e.prototype.logicUpdate = function(e) {
t.prototype.logicUpdate.call(this, e);
this.timerGrow -= e;
if (this.timerGrow <= 0) {
var i = s.default.inst.createNewUnit(this.actor.stats.growIntoID, this.actor.currentTile);
i.startBabymakingTimeout();
i.data.hunger = i.stats.maxHunger / 2;
s.default.inst.gameStats.creaturesBorn--;
if (this.actor.stats.unit) {
this.actor.city && this.actor.city.addNewUnit(i);
i.setKingdom(this.actor.kingdom);
}
i.data.firstName = this.actor.data.firstName;
i.data.age = this.actor.data.age;
i.data.bornTime = this.actor.data.bornTime;
i.data.health = this.actor.data.health;
i.data.gender = this.actor.data.gender;
i.data.kills = this.actor.data.kills;
this.actor.data.traits.forEach(function(t) {
"peaceful" != t && i.addTrait(t);
});
this.actor.data.favorite && (i.data.favorite = !0);
this.actor.killHimself(!0, l.AttackType.GrowUp, !1);
}
};
return r([ u ], e);
}(n.default));
i.default = d;
cc._RF.pop();
}, {
"../../MapBox": "MapBox",
"../../base/BaseActorComponent": "BaseActorComponent",
"../ActorStatus": "ActorStatus"
} ],
BaseActorComponent: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "30021k+fMtO6qkKlDHSLF6J", "BaseActorComponent");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
});
Object.defineProperty(i, "__esModule", {
value: !0
});
var r = function(t) {
a(e, t);
function e() {
var e = null !== t && t.apply(this, arguments) || this;
e.actor = null;
return e;
}
e.prototype.create = function() {
this.actor = this.getComponent("Actor");
t.prototype.create.call(this);
};
return e;
}(t("./BaseMapObject").default);
i.default = r;
cc._RF.pop();
}, {
"./BaseMapObject": "BaseMapObject"
} ],
BaseAnimatedObject: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "f81ecyjENlBf6PTCXjUb3de", "BaseAnimatedObject");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
});
Object.defineProperty(i, "__esModule", {
value: !0
});
var r = t("../animation/SpriteAnimation"), n = function(t) {
a(e, t);
function e() {
var e = null !== t && t.apply(this, arguments) || this;
e.spriteAnimation = null;
e.shadow = null;
e.lastShadowPos = cc.Vec3.ZERO;
e.lastShadowScale = 0;
return e;
}
e.prototype.create = function() {
t.prototype.create.call(this);
this.spriteAnimation = this.node.getComponent(r.SpriteAnimation);
};
e.prototype.logicUpdate = function(e) {
t.prototype.logicUpdate.call(this, e);
this.updateSpriteAnimation(e);
};
e.prototype.updateSpriteAnimation = function(t) {
this.spriteAnimation && this.spriteAnimation.logicUpdate(t);
};
e.prototype.resetShadow = function() {
this.lastShadowPos = cc.Vec3.ZERO;
this.lastShadowScale = 0;
};
e.prototype.checkShadowPosition = function(t) {
if (this.lastShadowPos.x != t.x || this.lastShadowPos.y != t.y) {
this.lastShadowPos.set(t);
this.shadow.node.position = this.lastShadowPos;
}
var e = this.node.scale;
if (this.lastShadowScale != e) {
this.lastShadowScale = e;
this.shadow.node.scale = e;
}
};
return e;
}(t("./BaseMapObject").default);
i.default = n;
cc._RF.pop();
}, {
"../animation/SpriteAnimation": "SpriteAnimation",
"./BaseMapObject": "BaseMapObject"
} ],
BaseBuilding: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "eaf4cCoDhBGzrGOgBKREbr3", "BaseBuilding");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
});
Object.defineProperty(i, "__esModule", {
value: !0
});
i.BuildingAnimationUpdated = i.BaseBuildingComponent = i.BuildingContainer = i.BuildingAnimationData = i.BuildingAnimation = i.BuildingData = i.BuildingAnimationState = i.BuildPlacingType = i.BuildingPlacements = i.BuildingState = void 0;
var r, n = t("../animation/SpriteAnimation"), s = t("./BaseContainer"), l = t("./BaseObjectData");
(function(t) {
t[t.Null = 0] = "Null";
t[t.Normal = 1] = "Normal";
t[t.CivKingdom = 2] = "CivKingdom";
t[t.CivAbandoned = 3] = "CivAbandoned";
t[t.Ruins = 4] = "Ruins";
t[t.Removed = 5] = "Removed";
})(r = i.BuildingState || (i.BuildingState = {}));
(function(t) {
t[t.Random = 0] = "Random";
t[t.Center = 1] = "Center";
})(i.BuildingPlacements || (i.BuildingPlacements = {}));
(function(t) {
t[t.New = 0] = "New";
t[t.Load = 1] = "Load";
})(i.BuildPlacingType || (i.BuildPlacingType = {}));
(function(t) {
t[t.Normal = 0] = "Normal";
t[t.OnRuin = 1] = "OnRuin";
t[t.OnRemove = 2] = "OnRemove";
})(i.BuildingAnimationState || (i.BuildingAnimationState = {}));
var c = function(t) {
a(e, t);
function e() {
var e = null !== t && t.apply(this, arguments) || this;
e.state = r.Null;
e.mainX = 0;
e.mainY = 0;
e.templateID = "";
e.cityID = "";
e.underConstruction = !0;
e.spawnPixelActive = !0;
e.objectID = "";
e.progress = 0;
e.frameID = -1;
return e;
}
return e;
}(l.default);
i.BuildingData = c;
i.BuildingAnimation = function(t) {
this.frames = [];
this.timeBetweenFrames = .5;
this.timeBetweenFrames = t;
};
i.BuildingAnimationData = function() {
this.idle = null;
this.animated = !1;
};
var u = function(t) {
a(e, t);
function e() {
return null !== t && t.apply(this, arguments) || this;
}
return e;
}(s.ObjectContainer);
i.BuildingContainer = u;
var d = function(t) {
a(e, t);
function e() {
var e = null !== t && t.apply(this, arguments) || this;
e.building = null;
return e;
}
e.prototype.create = function() {
this.building = this.getComponent("Building");
};
e.prototype.logicUpdate = function() {};
return e;
}(cc.Component);
i.BaseBuildingComponent = d;
var h = function(t) {
a(e, t);
function e() {
var e = null !== t && t.apply(this, arguments) || this;
e.spriteAnimation = null;
return e;
}
e.prototype.create = function() {
t.prototype.create.call(this);
this.spriteAnimation = this.getComponent(n.SpriteAnimation);
};
e.prototype.logicUpdate = function(t) {
this.spriteAnimation.logicUpdate(t);
};
return e;
}(d);
i.BuildingAnimationUpdated = h;
cc._RF.pop();
}, {
"../animation/SpriteAnimation": "SpriteAnimation",
"./BaseContainer": "BaseContainer",
"./BaseObjectData": "BaseObjectData"
} ],
BaseCondition: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "e142c6cDz5Fu48SpaN6u5eC", "BaseCondition");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
});
Object.defineProperty(i, "__esModule", {
value: !0
});
i.BehaviourTesterCondition = i.BehaviourKingdomCondition = i.BehaviourCityCondition = i.BehaviourActorCondition = void 0;
var r = function() {
function t() {}
t.prototype.check = function() {
return !0;
};
return t;
}();
i.default = r;
var n = function(t) {
a(e, t);
function e() {
return null !== t && t.apply(this, arguments) || this;
}
e.prototype.check = function(e) {
return t.prototype.check.call(this, e);
};
return e;
}(r);
i.BehaviourActorCondition = n;
var s = function(t) {
a(e, t);
function e() {
return null !== t && t.apply(this, arguments) || this;
}
e.prototype.check = function(e) {
return t.prototype.check.call(this, e);
};
return e;
}(r);
i.BehaviourCityCondition = s;
var l = function(t) {
a(e, t);
function e() {
return null !== t && t.apply(this, arguments) || this;
}
e.prototype.check = function(e) {
return t.prototype.check.call(this, e);
};
return e;
}(r);
i.BehaviourKingdomCondition = l;
var c = function(t) {
a(e, t);
function e() {
return null !== t && t.apply(this, arguments) || this;
}
return e;
}(r);
i.BehaviourTesterCondition = c;
cc._RF.pop();
}, {} ],
BaseContainer: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "2188dua0gpDD4kE0o0Q76v9", "BaseContainer");
Object.defineProperty(i, "__esModule", {
value: !0
});
i.ObjectContainer = i.TaskContainer = void 0;
var o = function() {
function t() {
this.conditions = [];
}
t.prototype.addCondition = function(t) {
this.conditions.push(t);
};
return t;
}();
i.TaskContainer = o;
var a = function() {
function t() {
this._to_remove = [];
this._to_add = [];
this._hashSet = new Set();
this._simpleListDirty = !1;
this._simpleList = [];
}
Object.defineProperty(t.prototype, "count", {
get: function() {
return this._hashSet.size;
},
enumerable: !1,
configurable: !0
});
Object.defineProperty(t.prototype, "list", {
get: function() {
return Array.from(this._hashSet);
},
enumerable: !1,
configurable: !0
});
t.prototype.forEach = function(t) {
this._hashSet.forEach(function(e) {
t(e);
});
};
t.prototype.has = function(t) {
return this._hashSet.has(t);
};
Object.defineProperty(t.prototype, "length", {
get: function() {
return this._hashSet.size;
},
enumerable: !1,
configurable: !0
});
t.prototype.clear = function() {
this._hashSet.clear();
this._to_add = [];
this._to_remove = [];
this._simpleList = [];
this._simpleListDirty = !1;
};
t.prototype.checkAddRemove = function() {
var t = this;
if (this._to_add.length > 0) {
this._simpleListDirty = !0;
this._to_add.forEach(function(e) {
t._hashSet.add(e);
});
this._to_add = [];
}
if (!(this._to_remove.length <= 0)) {
this._simpleListDirty = !0;
this._to_remove.forEach(function(e) {
t._hashSet.delete(e);
});
this._to_remove = [];
}
};
t.prototype.getSimpleList = function() {
null == this._simpleList && (this._simpleList = []);
this.checkSimpleListDirty();
return this._simpleList;
};
t.prototype.checkSimpleListDirty = function() {
var t = this;
if (this._simpleListDirty) {
this._simpleList = [];
this._hashSet.forEach(function(e) {
t._simpleList.push(e);
});
this._simpleListDirty = !1;
}
};
t.prototype.getRandom = function() {
this.checkSimpleListDirty();
return null == this._simpleList || 0 == this._simpleList.length ? null : this._simpleList.getRandom();
};
t.prototype.debug = function() {
return this._hashSet.size + "/" + this._to_add.length + "/" + this._to_remove.length;
};
t.prototype.add = function(t) {
this._to_add.push(t);
};
t.prototype.remove = function(t) {
this._to_remove.push(t);
};
t.prototype.putInSimpleList = function(t) {
this._hashSet.forEach(function(e) {
t.push(e);
});
};
return t;
}();
i.ObjectContainer = a;
cc._RF.pop();
}, {} ],
BaseEffectController: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "833327t4G9IfogdnbnK9Z9N", "BaseEffectController");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
}), r = this && this.__decorate || function(t, e, i, o) {
var a, r = arguments.length, n = r < 3 ? e : null === o ? o = Object.getOwnPropertyDescriptor(e, i) : o;
if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) n = Reflect.decorate(t, e, i, o); else for (var s = t.length - 1; s >= 0; s--) (a = t[s]) && (n = (r < 3 ? a(n) : r > 3 ? a(e, i, n) : a(e, i)) || n);
return r > 3 && n && Object.defineProperty(e, i, n), n;
}, n = this && this.__values || function(t) {
var e = "function" == typeof Symbol && Symbol.iterator, i = e && t[e], o = 0;
if (i) return i.call(t);
if (t && "number" == typeof t.length) return {
next: function() {
t && o >= t.length && (t = void 0);
return {
value: t && t[o++],
done: !t
};
}
};
throw new TypeError(e ? "Object is not iterable." : "Symbol.iterator is not defined.");
};
Object.defineProperty(i, "__esModule", {
value: !0
});
var s = t("../../../common/src/GameCommon"), l = t("../base/BaseEffect"), c = t("../base/BaseMapObject"), u = t("../common/ToolBox"), d = cc._decorator, h = d.ccclass, p = d.property, f = function(t) {
a(e, t);
function e() {
var e = null !== t && t.apply(this, arguments) || this;
e.prefab = null;
e.list = [];
e.timer = 0;
e.timer_interval = .9;
e.objectLimit = 0;
e.useInterval = !0;
e.pool = new cc.NodePool();
return e;
}
e.prototype.create = function() {
t.prototype.create.call(this);
};
e.prototype.getObject = function() {
var t = this.pool.get();
t || (t = cc.instantiate(this.prefab));
this.list.push(t);
var e = t.getComponent(l.default);
this.addNewObject(e);
e.create();
e.active = !0;
e.state = 1;
e.clear();
return e;
};
e.prototype.addNewObject = function(t) {
t.controller = this;
t.node.parent = this.node;
};
e.prototype.killObject = function(t) {
t.active = !0;
t.clear();
this.list.remove(t.node);
this.pool.put(t.node);
};
e.prototype.logicUpdate = function(e) {
t.prototype.logicUpdate.call(this, e);
this.updateChildren(e);
this.updateSpawn(e);
};
e.prototype.updateSpawn = function(t) {
if (!s.default.isPaused && this.useInterval) {
if (this.timer > 0) {
this.timer -= t;
return;
}
this.timer = this.timer_interval;
this.spawn();
}
};
e.prototype.updateChildren = function(t) {
var e, i;
try {
for (var o = n(this.list), a = o.next(); !a.done; a = o.next()) {
var r = a.value.getComponent(l.default);
r.created && r.logicUpdate(t);
}
} catch (t) {
e = {
error: t
};
} finally {
try {
a && !a.done && (i = o.return) && i.call(o);
} finally {
if (e) throw e.error;
}
}
};
e.prototype.spawn = function() {};
e.prototype.spawnNew = function() {
if (this.isInLimit()) return null;
var t = this.getObject();
t.spriteAnimation && t.spriteAnimation.resetAnim();
return t;
};
e.prototype.spawnAt = function(t, e) {
void 0 === e && (e = .5);
if (this.isInLimit()) return null;
var i = this.getObject();
i.prepare(t, e);
return i;
};
e.prototype.spawnAtRandomScale = function(t, e, i) {
void 0 === e && (e = 1);
void 0 === i && (i = 1);
if (this.isInLimit()) return null;
var o = this.getObject(), a = u.Toolbox.randomFloat(e, i);
o.prepare(t, a);
return o;
};
e.prototype.isInLimit = function() {
return 0 != this.objectLimit && this.list.length > this.objectLimit;
};
e.prototype.clear = function() {
var t = this;
this.list.forEach(function(e) {
t.pool.put(e);
});
this.list = [];
};
r([ p({
type: cc.Prefab,
tooltip: "预制"
}) ], e.prototype, "prefab", void 0);
return r([ h ], e);
}(c.default);
i.default = f;
cc._RF.pop();
}, {
"../../../common/src/GameCommon": void 0,
"../base/BaseEffect": "BaseEffect",
"../base/BaseMapObject": "BaseMapObject",
"../common/ToolBox": "ToolBox"
} ],
BaseEffect: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "c7e64r6ZCdJSYgoIKXOVsPO", "BaseEffect");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
}), r = this && this.__decorate || function(t, e, i, o) {
var a, r = arguments.length, n = r < 3 ? e : null === o ? o = Object.getOwnPropertyDescriptor(e, i) : o;
if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) n = Reflect.decorate(t, e, i, o); else for (var s = t.length - 1; s >= 0; s--) (a = t[s]) && (n = (r < 3 ? a(n) : r > 3 ? a(e, i, n) : a(e, i)) || n);
return r > 3 && n && Object.defineProperty(e, i, n), n;
};
Object.defineProperty(i, "__esModule", {
value: !0
});
var n = t("../animation/SpriteAnimation"), s = t("../common/ToolBox"), l = t("../map/tile/WorldTile"), c = t("../MapBox"), u = t("./BaseAnimatedObject"), d = cc._decorator, h = d.ccclass, p = d.property, f = function(t) {
a(e, t);
function e() {
var e = null !== t && t.apply(this, arguments) || this;
e.active = !1;
e.effectIndex = 0;
e.STATE_START = 1;
e.STATE_ON_DEATH = 2;
e.STATE_KILLED = 3;
e.scale = 0;
e.alpha = 0;
e.tile = null;
e.controller = null;
e.state = 0;
e.sprRenderer = null;
e.autoYZ = !1;
e.callback = null;
e.callbackOnFrame = -1;
return e;
}
e.prototype.create = function() {
t.prototype.create.call(this);
this.sprRenderer || (this.sprRenderer = this.getComponent(cc.Sprite));
this.node.position = cc.v3(s.Toolbox.randomRange(-50, 30), s.Toolbox.randomRange(0, c.default.height));
this.state = 1;
this.setAlpha(255);
};
e.prototype.makeParentController = function() {
this.node.parent = this.controller.node;
};
e.prototype.setScale = function(t) {
this.scale = t;
this.scale < 0 && (this.scale = 0);
this.node.scale = t;
};
e.prototype.prepare = function(t, e) {
void 0 === e && (e = 1);
this.state = 1;
var i = t instanceof cc.Vec3 ? t : t.posV3, o = 0;
this.autoYZ && (o = i.y);
this.node.angle = 0;
this.node.position = t instanceof l.default ? cc.v3(i.x + .5, i.y, o) : cc.v3(i.x, i.y, o);
this.setScale(e);
this.setAlpha(255);
this.getComponent(n.SpriteAnimation) && this.getComponent(n.SpriteAnimation).resetAnim();
};
e.prototype.setAlpha = function(t) {
this.alpha = t;
this.node.opacity = this.alpha;
};
e.prototype.setTile = function(t) {
this.tile = t;
this.node.position = cc.v3(t.posV3.x, t.posV3.y);
};
e.prototype.startToDie = function() {
this.state = 2;
};
e.prototype.kill = function() {
this.state = 3;
this.controller.killObject(this);
};
e.prototype.clear = function() {
this.callback = null;
this.callbackOnFrame = -1;
};
e.prototype.logicUpdate = function(e) {
t.prototype.logicUpdate.call(this, e);
if (-1 != this.callbackOnFrame && this.spriteAnimation.currentFrameIndex == this.callbackOnFrame) {
this.callback();
this.clear();
}
};
e.prototype.setCallback = function(t, e) {
this.callbackOnFrame = t;
this.callback = e;
};
r([ p(cc.Sprite) ], e.prototype, "sprRenderer", void 0);
r([ p({
tooltip: "默认false"
}) ], e.prototype, "autoYZ", void 0);
return r([ h ], e);
}(u.default);
i.default = f;
cc._RF.pop();
}, {
"../MapBox": "MapBox",
"../animation/SpriteAnimation": "SpriteAnimation",
"../common/ToolBox": "ToolBox",
"../map/tile/WorldTile": "WorldTile",
"./BaseAnimatedObject": "BaseAnimatedObject"
} ],
BaseMapObject: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "f2ce1H6LutNK6md7OZQCHKV", "BaseMapObject");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
});
Object.defineProperty(i, "__esModule", {
value: !0
});
var r = function(t) {
a(e, t);
function e() {
var e = null !== t && t.apply(this, arguments) || this;
e.currentTile = null;
e.zPosition = cc.Vec3.ZERO;
e.currentPosition = cc.Vec3.ZERO;
e.currentScale = cc.Vec3.ZERO;
e.created = !1;
return e;
}
e.prototype.create = function() {
this.created = !0;
};
e.prototype.logicUpdate = function() {};
return e;
}(cc.Component);
i.default = r;
cc._RF.pop();
}, {} ],
BaseObjectData: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "19bbbGMdkZGfbW0S6R59z2W", "BaseObjectData");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
}), r = this && this.__decorate || function(t, e, i, o) {
var a, r = arguments.length, n = r < 3 ? e : null === o ? o = Object.getOwnPropertyDescriptor(e, i) : o;
if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) n = Reflect.decorate(t, e, i, o); else for (var s = t.length - 1; s >= 0; s--) (a = t[s]) && (n = (r < 3 ? a(n) : r > 3 ? a(e, i, n) : a(e, i)) || n);
return r > 3 && n && Object.defineProperty(e, i, n), n;
};
Object.defineProperty(i, "__esModule", {
value: !0
});
i.BaseModule = void 0;
var n = t("../map/tile/TileDictionary"), s = t("./BaseMapObject"), l = cc._decorator, c = l.ccclass, u = l.property, d = function() {
function t() {
this.timeExists = 0;
this.alive = !0;
this.health = 100;
}
r([ u() ], t.prototype, "timeExists", void 0);
r([ u() ], t.prototype, "alive", void 0);
r([ u() ], t.prototype, "health", void 0);
return r([ c("BaseObjectData") ], t);
}();
i.default = d;
var h = function(t) {
a(e, t);
function e() {
var e = null !== t && t.apply(this, arguments) || this;
e.tileDictionary = new n.TileDictionary();
return e;
}
e.prototype.clear = function() {};
return e;
}(s.default);
i.BaseModule = h;
cc._RF.pop();
}, {
"../map/tile/TileDictionary": "TileDictionary",
"./BaseMapObject": "BaseMapObject"
} ],
BaseSimObject: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "6971bRHFmFLoKruCbBzNUSV", "BaseSimObject");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
}), r = this && this.__decorate || function(t, e, i, o) {
var a, r = arguments.length, n = r < 3 ? e : null === o ? o = Object.getOwnPropertyDescriptor(e, i) : o;
if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) n = Reflect.decorate(t, e, i, o); else for (var s = t.length - 1; s >= 0; s--) (a = t[s]) && (n = (r < 3 ? a(n) : r > 3 ? a(e, i, n) : a(e, i)) || n);
return r > 3 && n && Object.defineProperty(e, i, n), n;
}, n = this && this.__values || function(t) {
var e = "function" == typeof Symbol && Symbol.iterator, i = e && t[e], o = 0;
if (i) return i.call(t);
if (t && "number" == typeof t.length) return {
next: function() {
t && o >= t.length && (t = void 0);
return {
value: t && t[o++],
done: !t
};
}
};
throw new TypeError(e ? "Object is not iterable." : "Symbol.iterator is not defined.");
};
Object.defineProperty(i, "__esModule", {
value: !0
});
var s = t("../actors/ActorStatus"), l = t("../assetLibrary/AssetManager"), c = t("../common/ToolBox"), u = t("../effect/ActiveStatusEffect"), d = t("../map/map/MapLayer"), h = t("../texture/TextureLoader"), p = t("./BaseAnimatedObject"), f = t("./BaseObjectData"), m = t("./BaseStats"), y = cc._decorator, _ = y.ccclass, g = y.property, v = function(t) {
a(e, t);
function e() {
var e = null !== t && t.apply(this, arguments) || this;
e.pbEffects = null;
e.object_destroyed = !1;
e.kingdom = null;
e.city = null;
e.statsDirty = !0;
e.event_full_heal = !1;
e.curStats = new m.default();
e.a = null;
e.b = null;
e.objectType = d.MapObjectType.Actor;
e.base_data = null;
e.activeStatusEffects = [];
e.activeStatus_dict = new Map();
e.spriteRenderer = null;
return e;
}
e.prototype.create = function() {
t.prototype.create.call(this);
this.spriteRenderer = this.getComponent(cc.Sprite);
};
e.prototype.addStatusEffect = function(t, e) {
var i, o, a, r, s, d = this;
void 0 === e && (e = -1);
if ((null === (s = this.base_data) || void 0 === s ? void 0 : s.alive) && (!this.isActor() || this.a.stats.canHaveStatusEffect) && !this.activeStatus_dict.has(t)) {
var p = l.default.status.get(t);
if (this.isActor() && p.oppositeTraits.length > 0) try {
for (var f = n(p.oppositeTraits), m = f.next(); !m.done; m = f.next()) {
var y = m.value;
if (this.a.haveTrait(y)) return;
}
} catch (t) {
i = {
error: t
};
} finally {
try {
m && !m.done && (o = f.return) && o.call(f);
} finally {
if (i) throw i.error;
}
}
if (p.oppositeStatus.length > 0) try {
for (var _ = n(p.oppositeStatus), g = _.next(); !g.done; g = _.next()) {
var v = g.value;
if (this.activeStatus_dict.has(v)) return;
}
} catch (t) {
a = {
error: t
};
} finally {
try {
g && !g.done && (r = _.return) && r.call(_);
} finally {
if (a) throw a.error;
}
}
if (null == p.spriteList || 0 == p.spriteList.length) {
var b = h.TextureLoader.inst.getSpriteFrames(h.ATLAS_TYPE.WORLDATLAS, "effects/" + p.texture);
p.spriteList = Array.from(b.values());
}
var T = cc.instantiate(this.pbEffects).getComponent(u.default);
T.node.parent = this.node;
T.node.anchorY = 0;
T.create();
T.setStatus(p, this);
-1 != e && (T.timer = e);
T.timeBetweenFrames = p.animation_speed + c.Toolbox.randomFloat(0, p.animation_speed_random);
T.setFrames(p.spriteList);
p.random_frame && T.setRandomFrame();
if (p.random_flip) {
var w = c.Toolbox.randomBool() ? 1 : -1;
T.spriteRenderer.node.scaleX *= w;
}
T.isOn = p.animated;
T.simObject = this;
T.updateZFlip();
this.statsDirty = !0;
this.activeStatusEffects.push(T);
this.activeStatus_dict.set(t, T);
this.isActor() && p.cancelActorJob && this.a.cancelAllBeh();
this.isBuilding() && T.setZFlip(-.01);
p.removeStatus.length <= 0 || p.removeStatus.forEach(function(t) {
d.removeStatusEffect(t);
});
}
};
e.prototype.removeStatusEffect = function(t, e, i) {
void 0 === e && (e = null);
void 0 === i && (i = -1);
if (this.activeStatus_dict.has(t)) {
this.statsDirty = !0;
e || (e = this.activeStatus_dict.get(t));
-1 == i && (i = this.activeStatusEffects.indexOf(e));
this.activeStatusEffects.splice(i, 1);
this.activeStatus_dict.delete(t);
e.node && e.node.destroy();
}
};
e.prototype.setData = function(t) {
t || cc.log("BaseObjectData为空");
this.base_data = t;
};
e.prototype.isActor = function() {
return this.objectType == d.MapObjectType.Actor;
};
e.prototype.isBuilding = function() {
return this.objectType == d.MapObjectType.Building;
};
e.prototype.setObjectType = function(t) {
this.objectType = t;
this.objectType == d.MapObjectType.Actor ? this.a = this : this.b = this;
};
e.prototype.logicUpdate = function(e) {
t.prototype.logicUpdate.call(this, e);
this.statsDirty && this.updateStats();
};
e.prototype.updateStatusEffects = function(t) {
if (0 != this.activeStatusEffects.length) for (var e = 0; e < this.activeStatusEffects.length; ) {
var i = this.activeStatusEffects[e];
i.logicUpdate(t);
i.finished ? this.removeStatusEffect(i.asset.id, i, e) : e++;
}
};
e.prototype.updateStats = function() {
this.statsDirty = !1;
};
e.prototype.isInWater = function() {
return this.currentTile.type.liquid;
};
e.prototype.isInAir = function() {
return !1;
};
e.prototype.getZ = function() {
return 0;
};
e.prototype.getHit = function(t, e, i, o, a) {
void 0 === e && (e = !0);
void 0 === i && (i = s.AttackType.Other);
void 0 === o && (o = null);
void 0 === a && (a = !0);
};
r([ g(cc.Prefab) ], e.prototype, "pbEffects", void 0);
r([ g({
type: cc.Enum(d.MapObjectType)
}) ], e.prototype, "objectType", void 0);
r([ g(f.default) ], e.prototype, "base_data", void 0);
return r([ _ ], e);
}(p.default);
i.default = v;
cc._RF.pop();
}, {
"../actors/ActorStatus": "ActorStatus",
"../assetLibrary/AssetManager": "AssetManager",
"../common/ToolBox": "ToolBox",
"../effect/ActiveStatusEffect": "ActiveStatusEffect",
"../map/map/MapLayer": "MapLayer",
"../texture/TextureLoader": "TextureLoader",
"./BaseAnimatedObject": "BaseAnimatedObject",
"./BaseObjectData": "BaseObjectData",
"./BaseStats": "BaseStats"
} ],
BaseStats: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "e2b4ffnlTVH1awqY428OVyE", "BaseStats");
Object.defineProperty(i, "__esModule", {
value: !0
});
var o = t("../../../../framework/lib/prototype/MathUtils"), a = function() {
function t() {
this.personality_aggression = 0;
this.personality_administration = 0;
this.personality_diplomatic = 0;
this.personality_rationality = 0;
this.diplomacy = 0;
this.warfare = 0;
this.stewardship = 0;
this.army = 0;
this.cities = 0;
this.zones = 0;
this.damage = 0;
this.speed = 0;
this.health = 0;
this.armor = 0;
this.dodge = 0;
this.accuracy = 0;
this.targets = 0;
this.projectiles = 0;
this.crit = 0;
this.damageCritMod = 0;
this.range = 0;
this.size = 0;
this.areaOfEffect = 0;
this.attackSpeed = 0;
this.knockback = 0;
this.loyalty_traits = 0;
this.loyalty_mood = 0;
this.opinion = 0;
this.knockbackReduction = 0;
this.mod_health = 0;
this.mod_damage = 0;
this.mod_armor = 0;
this.mod_crit = 0;
this.mod_diplomacy = 0;
this.mod_speed = 0;
this.mod_attackSpeed = 0;
this.scale = 0;
this.mod_supply_timer = 0;
}
t.prototype.addStats = function(t) {
this.personality_rationality += t.personality_rationality;
this.personality_aggression += t.personality_aggression;
this.personality_diplomatic += t.personality_diplomatic;
this.personality_administration += t.personality_administration;
this.opinion += t.opinion;
this.loyalty_traits += t.loyalty_traits;
this.loyalty_mood += t.loyalty_mood;
this.scale += t.scale;
this.damage += t.damage;
this.attackSpeed += t.attackSpeed;
this.speed += t.speed;
this.health += t.health;
this.armor += t.armor;
this.diplomacy += t.diplomacy;
this.warfare += t.warfare;
this.stewardship += t.stewardship;
this.army += t.army;
this.cities += t.cities;
this.zones += t.zones;
this.dodge += t.dodge;
this.accuracy += t.accuracy;
this.targets += t.targets;
this.projectiles += t.projectiles;
this.crit += t.crit;
this.damageCritMod += t.damageCritMod;
this.range += t.range;
this.size += t.size;
this.areaOfEffect += t.areaOfEffect;
this.knockback += t.knockback;
this.knockbackReduction += t.knockbackReduction;
this.mod_health += t.mod_health;
this.mod_damage += t.mod_damage;
this.mod_armor += t.mod_armor;
this.mod_crit += t.mod_crit;
this.mod_diplomacy += t.mod_diplomacy;
this.mod_speed += t.mod_speed;
this.mod_supply_timer += t.mod_supply_timer;
};
t.prototype.clear = function() {
this.personality_rationality = 0;
this.personality_aggression = 0;
this.personality_diplomatic = 0;
this.personality_administration = 0;
this.opinion = 0;
this.loyalty_mood = 0;
this.loyalty_traits = 0;
this.mod_supply_timer = 0;
this.scale = 0;
this.damage = 0;
this.attackSpeed = 0;
this.projectiles = 0;
this.speed = 0;
this.health = 0;
this.armor = 0;
this.diplomacy = 0;
this.warfare = 0;
this.stewardship = 0;
this.army = 0;
this.cities = 0;
this.zones = 0;
this.dodge = 0;
this.accuracy = 0;
this.targets = 0;
this.crit = 0;
this.damageCritMod = 0;
this.range = 0;
this.size = 0;
this.areaOfEffect = 0;
this.knockback = 0;
this.knockbackReduction = 0;
this.mod_health = 0;
this.mod_damage = 0;
this.mod_armor = 0;
this.mod_crit = 0;
this.mod_diplomacy = 0;
this.mod_speed = 0;
this.mod_attackSpeed = 0;
};
t.prototype.normalize = function() {
this.stewardship = o.default.clamp(this.stewardship, 0, 999);
this.warfare = o.default.clamp(this.warfare, 0, 999);
this.diplomacy = o.default.clamp(this.diplomacy, 0, 999);
this.personality_aggression = o.default.clamp(this.personality_aggression, 0, 1);
this.personality_diplomatic = o.default.clamp(this.personality_diplomatic, 0, 1);
this.personality_administration = o.default.clamp(this.personality_administration, 0, 1);
this.personality_rationality = o.default.clamp(this.personality_rationality, 0, 1);
};
return t;
}();
i.default = a;
cc._RF.pop();
}, {
"../../../../framework/lib/prototype/MathUtils": void 0
} ],
Beehive: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "f7e5cJ51IpJcaGLnRGqMT8l", "Beehive");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
});
Object.defineProperty(i, "__esModule", {
value: !0
});
var r = function(t) {
a(e, t);
function e() {
var e = null !== t && t.apply(this, arguments) || this;
e.honey = 0;
e.timeoutTest = 0;
e.intervalTest = 1;
e.timerCalcFlowers = 0;
e.list_flowers = [];
return e;
}
e.prototype.create = function() {
t.prototype.create.call(this);
};
e.prototype.logicUpdate = function(e) {
t.prototype.logicUpdate.call(this, e);
if (this.timerCalcFlowers > 0) this.timerCalcFlowers -= e; else {
this.timerCalcFlowers = 10;
this.recalcFlowers();
}
this.timeoutTest > 0 ? this.timeoutTest -= e : this.timeoutTest = this.intervalTest;
};
e.prototype.recalcFlowers = function() {
var t = this;
this.list_flowers.clear();
var e = this.building.currentTile;
this.checkChunk(e.chunk);
e.chunk.neighboursAll.forEach(function(e) {
t.checkChunk(e);
});
};
e.prototype.checkChunk = function(t) {
var e = this;
t.tiles.forEach(function(t) {
t.type.flowers && e.list_flowers.push(t);
});
this.list_flowers.shuffle();
};
return e;
}(t("../base/BaseBuilding").BaseBuildingComponent);
i.default = r;
cc._RF.pop();
}, {
"../base/BaseBuilding": "BaseBuilding"
} ],
Bee: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "2918arebyRP3Yvu6Pna08ZI", "Bee");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
}), r = this && this.__decorate || function(t, e, i, o) {
var a, r = arguments.length, n = r < 3 ? e : null === o ? o = Object.getOwnPropertyDescriptor(e, i) : o;
if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) n = Reflect.decorate(t, e, i, o); else for (var s = t.length - 1; s >= 0; s--) (a = t[s]) && (n = (r < 3 ? a(n) : r > 3 ? a(e, i, n) : a(e, i)) || n);
return r > 3 && n && Object.defineProperty(e, i, n), n;
};
Object.defineProperty(i, "__esModule", {
value: !0
});
var n = t("../../base/BaseActorComponent"), s = t("../HoverModule"), l = cc._decorator, c = l.ccclass, u = (l.property, 
function(t) {
a(e, t);
function e() {
var e = null !== t && t.apply(this, arguments) || this;
e.pollen = 0;
e.hoverModule = null;
return e;
}
e.prototype.create = function() {
t.prototype.create.call(this);
this.hoverModule = this.getComponent(s.default);
};
e.prototype.logicUpdate = function(e) {
t.prototype.logicUpdate.call(this, e);
if (this.actor.is_moving || !this.actor.ai.task || "pollinate" != this.actor.ai.task.id) {
this.hoverModule.hoverState = s.HoverState.Up;
this.actor.moveJumpOffset.y < this.actor.stats.hovering_max && this.actor.changeMoveJumpOffset(3 * e);
} else {
this.hoverModule.hoverState = s.HoverState.Down;
this.actor.changeMoveJumpOffset(3 * (0 - e));
}
};
return r([ c ], e);
}(n.default));
i.default = u;
cc._RF.pop();
}, {
"../../base/BaseActorComponent": "BaseActorComponent",
"../HoverModule": "HoverModule"
} ],
BehActiveCrabDangerCheck: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "e591f87XC9IMbw+CqNJc/jU", "BehActiveCrabDangerCheck");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
});
Object.defineProperty(i, "__esModule", {
value: !0
});
var r = t("../../behaviour/BehaviourActionBase"), n = t("../../common/ToolBox"), s = function(t) {
a(e, t);
function e() {
var e = t.call(this) || this;
e.id = "BehActiveCrabDangerCheck";
return e;
}
e.prototype.execute = function(t) {
var e;
if ((null === (e = t.data) || void 0 === e ? void 0 : e.hunger) < 50) return r.BehResult.Continue;
n.Toolbox.findNotSameRaceInChunkAround(t.currentTile.chunk, t.race.id);
if (n.Toolbox.temp_list_units.length > 0) {
t.cancelAllBeh();
t.stopMovement();
t.ai.setJob("crab_burrow");
}
return r.BehResult.Continue;
};
return e;
}(t("./BehaviourActionActor").default);
i.default = s;
cc._RF.pop();
}, {
"../../behaviour/BehaviourActionBase": "BehaviourActionBase",
"../../common/ToolBox": "ToolBox",
"./BehaviourActionActor": "BehaviourActionActor"
} ],
BehAngleAnimation: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "c4084cxZJdHzZCJ8RNW5ouM", "BehAngleAnimation");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
});
Object.defineProperty(i, "__esModule", {
value: !0
});
var r = t("../../behaviour/BehaviourActionBase"), n = function(t) {
a(e, t);
function e(e, i, o) {
void 0 === i && (i = 0);
void 0 === o && (o = 40);
var a = t.call(this) || this;
a.target = "";
a.timer_action = 0;
a.angle = 0;
a.id = "BehAngleAnimation";
a.angle = o;
a.target = e;
a.timer_action = i;
"tile_target" == a.target ? a.null_check_tile_target = !0 : "building_target" == a.target && (a.null_check_building_target = !0);
return a;
}
e.prototype.execute = function(t) {
var e;
if ("tile_target" == this.target) t.punchTargetAnimation(t.beh_tile_target.posV3, t.beh_tile_target, !1, !1, this.angle); else if ("building_target" == this.target) if (null === (e = t.beh_building_target) || void 0 === e ? void 0 : e.base_data) {
t.punchTargetAnimation(t.beh_building_target.currentTile.posV3, t.beh_building_target.currentTile, !0, !1, this.angle);
t.beh_building_target.startShake(.3);
} else t.cancelAllBeh();
t.timer_action = this.timer_action;
return r.BehResult.Continue;
};
return e;
}(t("./BehaviourActionActor").default);
i.default = n;
cc._RF.pop();
}, {
"../../behaviour/BehaviourActionBase": "BehaviourActionBase",
"./BehaviourActionActor": "BehaviourActionActor"
} ],
BehAnimalCheckHungry: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "ca8acUE9FdO37Sb0oAxTQRC", "BehAnimalCheckHungry");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
});
Object.defineProperty(i, "__esModule", {
value: !0
});
var r = t("../../behaviour/BehaviourActionBase"), n = function(t) {
a(e, t);
function e() {
var e = t.call(this) || this;
e.id = "BehAnimalCheckHungry";
return e;
}
e.prototype.execute = function(t) {
var e;
return (null === (e = t.data) || void 0 === e ? void 0 : e.hunger) > 50 ? r.BehResult.Stop : r.BehResult.Continue;
};
return e;
}(t("./BehaviourActionActor").default);
i.default = n;
cc._RF.pop();
}, {
"../../behaviour/BehaviourActionBase": "BehaviourActionBase",
"./BehaviourActionActor": "BehaviourActionActor"
} ],
BehAnimalFindTile: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "20be8RkmuRCAZEBNpOeiaPS", "BehAnimalFindTile");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
});
Object.defineProperty(i, "__esModule", {
value: !0
});
var r = t("../../behaviour/BehaviourActionBase"), n = t("../../common/ToolBox"), s = function(t) {
a(e, t);
function e() {
var e = t.call(this) || this;
e.id = "BehAnimalFindTile";
return e;
}
e.prototype.execute = function(t) {
if (n.Toolbox.randomChance(.8)) {
n.Toolbox.findSameUnitInChunkAround(t.currentTile.chunk, "druid");
if (0 != n.Toolbox.temp_list_units.length) {
var e = n.Toolbox.temp_list_units.getRandom();
t.beh_tile_target = e.currentTile.region.tiles.getRandom();
return r.BehResult.Continue;
}
}
var i = t.currentTile.region;
i.neighbours.length > 0 && n.Toolbox.randomBool() && (i = i.neighbours.getRandom());
if (i.tiles.length > 0) {
t.beh_tile_target = i.tiles.getRandom();
return r.BehResult.Continue;
}
return r.BehResult.Stop;
};
return e;
}(t("./BehaviourActionActor").default);
i.default = s;
cc._RF.pop();
}, {
"../../behaviour/BehaviourActionBase": "BehaviourActionBase",
"../../common/ToolBox": "ToolBox",
"./BehaviourActionActor": "BehaviourActionActor"
} ],
BehAttackActorTarget: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "c97bekttDFDBKqZyCDnyVQn", "BehAttackActorTarget");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
});
Object.defineProperty(i, "__esModule", {
value: !0
});
var r = t("../../behaviour/BehaviourActionBase"), n = function(t) {
a(e, t);
function e() {
var e = t.call(this) || this;
e.id = "BehAttackActorTarget";
e.null_check_actor_target = !0;
return e;
}
e.prototype.execute = function(t) {
var e, i, o, a, n;
if (!(null === (i = null === (e = t.beh_actor_target) || void 0 === e ? void 0 : e.base_data) || void 0 === i ? void 0 : i.alive)) {
t.clearBeh();
return r.BehResult.Continue;
}
t.isInAttackRange(t.beh_actor_target) && t.tryToAttack(t.beh_actor_target);
return (null === (n = null === (a = null === (o = t.beh_actor_target) || void 0 === o ? void 0 : o.a) || void 0 === a ? void 0 : a.data) || void 0 === n ? void 0 : n.alive) ? r.BehResult.RestartTask : r.BehResult.Continue;
};
return e;
}(t("./BehaviourActionActor").default);
i.default = n;
cc._RF.pop();
}, {
"../../behaviour/BehaviourActionBase": "BehaviourActionBase",
"./BehaviourActionActor": "BehaviourActionActor"
} ],
BehBabymakingTime: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "609eeIYLT1JApCDP7vtFuDD", "BehBabymakingTime");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
});
Object.defineProperty(i, "__esModule", {
value: !0
});
var r = t("../../behaviour/BehaviourActionBase"), n = t("../../common/ToolBox"), s = function(t) {
a(e, t);
function e() {
var e = t.call(this) || this;
e.id = "BehBabymakingTime";
e.null_check_actor_target = !0;
return e;
}
e.prototype.execute = function(t) {
var e;
if (!(null === (e = t.beh_actor_target) || void 0 === e ? void 0 : e.a)) {
t.clearBeh();
return r.BehResult.Continue;
}
if (n.Toolbox.distTile(t.currentTile, t.beh_actor_target.currentTile) > 1) return r.BehResult.Stop;
t.beh_actor_target.a.startShake();
t.startShake();
t.beh_actor_target.a.timer_action = 2;
return r.BehResult.Continue;
};
return e;
}(t("./BehaviourActionActor").default);
i.default = s;
cc._RF.pop();
}, {
"../../behaviour/BehaviourActionBase": "BehaviourActionBase",
"../../common/ToolBox": "ToolBox",
"./BehaviourActionActor": "BehaviourActionActor"
} ],
BehBeeCheckHome: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "0f197RYWh1MupEH4/5SbjDY", "BehBeeCheckHome");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
});
Object.defineProperty(i, "__esModule", {
value: !0
});
var r = t("../../actors/ActorStatus"), n = t("../../assetLibrary/AssetManager"), s = t("../../behaviour/BehaviourActionBase"), l = t("../../map/tile/TileType"), c = t("../../MapBox"), u = function(t) {
a(e, t);
function e() {
var e = t.call(this) || this;
e.id = "BehBeeCheckHome";
return e;
}
e.prototype.execute = function(t) {
var e, i;
if (!(null === (i = null === (e = t.homeBuilding) || void 0 === e ? void 0 : e.data) || void 0 === i ? void 0 : i.alive)) {
t.setHomeBuilding(null);
return s.BehResult.Stop;
}
if (!t.homeBuilding && t.currentTile.type.canGrowFlowers) {
c.default.inst.terraformTile2(t.currentTile, l.TileType.get(t.currentTile.type.flowersTypeID), n.default.terraform.get("flash"));
t.killHimself(!0, r.AttackType.None, !1);
return s.BehResult.Stop;
}
return s.BehResult.Continue;
};
return e;
}(t("./BehaviourActionActor").default);
i.default = u;
cc._RF.pop();
}, {
"../../MapBox": "MapBox",
"../../actors/ActorStatus": "ActorStatus",
"../../assetLibrary/AssetManager": "AssetManager",
"../../behaviour/BehaviourActionBase": "BehaviourActionBase",
"../../map/tile/TileType": "TileType",
"./BehaviourActionActor": "BehaviourActionActor"
} ],
BehBeeCheckReturnHome: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "29aafwrWOZG/bZM4LI5bdfV", "BehBeeCheckReturnHome");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
});
Object.defineProperty(i, "__esModule", {
value: !0
});
var r = t("../../behaviour/BehaviourActionBase"), n = function(t) {
a(e, t);
function e() {
var e = t.call(this) || this;
e.id = "BehBeeCheckReturnHome";
return e;
}
e.prototype.execute = function(t) {
if (t.homeBuilding) {
t.beh_building_target = t.homeBuilding;
return r.BehResult.Continue;
}
return r.BehResult.Stop;
};
return e;
}(t("./BehaviourActionActor").default);
i.default = n;
cc._RF.pop();
}, {
"../../behaviour/BehaviourActionBase": "BehaviourActionBase",
"./BehaviourActionActor": "BehaviourActionActor"
} ],
BehBeePollinate: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "6a48bbPPgxLvq2Zr1PXhMWD", "BehBeePollinate");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
});
Object.defineProperty(i, "__esModule", {
value: !0
});
var r = t("../../actors/other/Bee"), n = t("../../behaviour/BehaviourActionBase"), s = t("../../common/ToolBox"), l = function(t) {
a(e, t);
function e() {
var e = t.call(this) || this;
e.id = "BehBeePollinate";
return e;
}
e.prototype.execute = function(t) {
var e = t.getComponent(r.default);
if (t.currentTile.type.flowers) {
e.pollen++;
t.currentTile.pollinate();
}
t.timer_action = s.Toolbox.randomFloat(4, 10);
return n.BehResult.Continue;
};
return e;
}(t("./BehaviourActionActor").default);
i.default = l;
cc._RF.pop();
}, {
"../../actors/other/Bee": "Bee",
"../../behaviour/BehaviourActionBase": "BehaviourActionBase",
"../../common/ToolBox": "ToolBox",
"./BehaviourActionActor": "BehaviourActionActor"
} ],
BehBeeReturnHome: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "b877bWc2G9PgZEFnDgB5sTR", "BehBeeReturnHome");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
});
Object.defineProperty(i, "__esModule", {
value: !0
});
var r = t("../../actors/other/Bee"), n = t("../../behaviour/BehaviourActionBase"), s = t("../../building/Beehive"), l = t("../../common/ToolBox"), c = function(t) {
a(e, t);
function e() {
var e = t.call(this) || this;
e.id = "BehBeeReturnHome";
return e;
}
e.prototype.execute = function(t) {
var e, i;
if (!(null === (i = null === (e = t.homeBuilding) || void 0 === e ? void 0 : e.data) || void 0 === i ? void 0 : i.alive)) {
t.setHomeBuilding(null);
return n.BehResult.Stop;
}
var o = t.getComponent(r.default);
if (l.Toolbox.distTile(t.currentTile, t.homeBuilding.currentTile) > 3) return n.BehResult.Stop;
if (3 == o.pollen && t.currentTile.building == t.homeBuilding) {
o.pollen = 0;
t.homeBuilding.getComponent(s.default).honey++;
t.timer_action = 3;
}
return n.BehResult.Continue;
};
return e;
}(t("./BehaviourActionActor").default);
i.default = c;
cc._RF.pop();
}, {
"../../actors/other/Bee": "Bee",
"../../behaviour/BehaviourActionBase": "BehaviourActionBase",
"../../building/Beehive": "Beehive",
"../../common/ToolBox": "ToolBox",
"./BehaviourActionActor": "BehaviourActionActor"
} ],
BehBoatCheckFishingRepeat: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "5452f1VPphH/qV1RA471Qpd", "BehBoatCheckFishingRepeat");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
});
Object.defineProperty(i, "__esModule", {
value: !0
});
var r = t("../../behaviour/BehaviourActionBase"), n = function(t) {
a(e, t);
function e() {
var e = t.call(this) || this;
e.id = "BehBoatCheckFishingRepeat";
return e;
}
e.prototype.execute = function(t) {
return t.inventory.getResource("fish") <= 10 ? r.BehResult.RestartTask : this.forceTask(t, "boat_return_to_dock");
};
return e;
}(t("./BehaviourActionActor").default);
i.default = n;
cc._RF.pop();
}, {
"../../behaviour/BehaviourActionBase": "BehaviourActionBase",
"./BehaviourActionActor": "BehaviourActionActor"
} ],
BehBoatCheckHomeDocks: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "3c9e7SS/wBDd4WB7TfP7Z12", "BehBoatCheckHomeDocks");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
});
Object.defineProperty(i, "__esModule", {
value: !0
});
var r = t("../../behaviour/BehaviourActionBase"), n = function(t) {
a(e, t);
function e() {
var e = t.call(this) || this;
e.id = "BehBoatCheckHomeDocks";
return e;
}
e.prototype.execute = function(t) {
this.checkHomeDocks(t);
return t.homeBuilding ? r.BehResult.Continue : r.BehResult.Stop;
};
return e;
}(t("./BehBoat").default);
i.default = n;
cc._RF.pop();
}, {
"../../behaviour/BehaviourActionBase": "BehaviourActionBase",
"./BehBoat": "BehBoat"
} ],
BehBoatCollectFish: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "963ceIMF5JNSZi+AKHPu6vP", "BehBoatCollectFish");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
});
Object.defineProperty(i, "__esModule", {
value: !0
});
var r = t("../../behaviour/BehaviourActionBase"), n = function(t) {
a(e, t);
function e() {
var e = t.call(this) || this;
e.id = "BehBoatCollectFish";
return e;
}
e.prototype.execute = function(t) {
t.inventory.add("fish", 1);
return r.BehResult.Continue;
};
return e;
}(t("./BehaviourActionActor").default);
i.default = n;
cc._RF.pop();
}, {
"../../behaviour/BehaviourActionBase": "BehaviourActionBase",
"./BehaviourActionActor": "BehaviourActionActor"
} ],
BehBoatDamageCheck: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "5312bI1v7hM8YOIc9MI2zVZ", "BehBoatDamageCheck");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
});
Object.defineProperty(i, "__esModule", {
value: !0
});
var r = t("../../behaviour/BehaviourActionBase"), n = function(t) {
a(e, t);
function e() {
var e = t.call(this) || this;
e.id = "BehBoatDamageCheck";
return e;
}
e.prototype.execute = function(t) {
var e, i;
if ((null === (e = t.data) || void 0 === e ? void 0 : e.health) < .8 * (null === (i = t.curStats) || void 0 === i ? void 0 : i.health)) {
t.cancelAllBeh();
t.stopMovement();
return this.forceTask(t, "boat_return_to_dock");
}
return r.BehResult.Continue;
};
return e;
}(t("./BehaviourActionActor").default);
i.default = n;
cc._RF.pop();
}, {
"../../behaviour/BehaviourActionBase": "BehaviourActionBase",
"./BehaviourActionActor": "BehaviourActionActor"
} ],
BehBoatDangerCheck: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "f82a4Bnl01OCoZQG+Of5u2Z", "BehBoatDangerCheck");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
});
Object.defineProperty(i, "__esModule", {
value: !0
});
var r = t("../../behaviour/BehaviourActionBase"), n = function(t) {
a(e, t);
function e() {
var e = t.call(this) || this;
e.id = "BehBoatDangerCheck";
return e;
}
e.prototype.execute = function(t) {
var e, i;
if ((null === (e = t.data) || void 0 === e ? void 0 : e.alive) && t.attackedBy) {
if (t.data.health < .25 * (null === (i = t.curStats) || void 0 === i ? void 0 : i.health)) {
t.cancelAllBeh();
t.stopMovement();
return this.forceTask(t, "boat_return_to_dock");
}
return r.BehResult.Continue;
}
return r.BehResult.Stop;
};
return e;
}(t("./BehaviourActionActor").default);
i.default = n;
cc._RF.pop();
}, {
"../../behaviour/BehaviourActionBase": "BehaviourActionBase",
"./BehaviourActionActor": "BehaviourActionActor"
} ],
BehBoatFindRequest: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "b48c5+IbelHIKd/UXbbVWWi", "BehBoatFindRequest");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
});
Object.defineProperty(i, "__esModule", {
value: !0
});
var r = t("../../actors/other/boat/TaxiManager"), n = t("../../behaviour/BehaviourActionBase"), s = function(t) {
a(e, t);
function e() {
var e = t.call(this) || this;
e.id = "BehBoatFindRequest";
return e;
}
e.prototype.execute = function(t) {
var e = this.getBoat(t);
e.taxiRequest = r.default.getNewRequestForBoat(t);
if (!e.taxiRequest) return n.BehResult.Stop;
e.taxiRequest.assign(e);
return this.forceTask(t, "boat_transport_go_load");
};
return e;
}(t("./BehBoat").default);
i.default = s;
cc._RF.pop();
}, {
"../../actors/other/boat/TaxiManager": "TaxiManager",
"../../behaviour/BehaviourActionBase": "BehaviourActionBase",
"./BehBoat": "BehBoat"
} ],
BehBoatFindTargetForTrade: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "73353/U/ElAkLhEDpnVXbNX", "BehBoatFindTargetForTrade");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
});
Object.defineProperty(i, "__esModule", {
value: !0
});
var r = t("../../actors/ActorTool"), n = t("../../behaviour/BehaviourActionBase"), s = function(t) {
a(e, t);
function e() {
var e = t.call(this) || this;
e.id = "BehBoatFindTargetForTrade";
return e;
}
e.prototype.execute = function(t) {
var e = r.default.getDockTradeTarget(t);
if (e) {
t.beh_building_target = e.building;
return n.BehResult.Continue;
}
return n.BehResult.Stop;
};
return e;
}(t("./BehBoat").default);
i.default = s;
cc._RF.pop();
}, {
"../../actors/ActorTool": "ActorTool",
"../../behaviour/BehaviourActionBase": "BehaviourActionBase",
"./BehBoat": "BehBoat"
} ],
BehBoatFindTileInDock: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "83907FegXFEWoKfRGY0lQGC", "BehBoatFindTileInDock");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
});
Object.defineProperty(i, "__esModule", {
value: !0
});
var r = t("../../base/BaseBuilding"), n = t("../../behaviour/BehaviourActionBase"), s = t("../../building/Docks"), l = function(t) {
a(e, t);
function e() {
var e = t.call(this) || this;
e.id = "BehBoatFindTileInDock";
e.check_building_target_non_usable = !0;
e.null_check_building_target = !0;
return e;
}
e.prototype.execute = function(t) {
var e, i;
if ((null === (i = null === (e = t.beh_building_target) || void 0 === e ? void 0 : e.data) || void 0 === i ? void 0 : i.state) != r.BuildingState.CivKingdom) return n.BehResult.Stop;
var o = t.beh_building_target.getComponent(s.default).getWaterTileInSameOcean(t.currentTile);
if (!o) return n.BehResult.Stop;
t.beh_tile_target = o;
return n.BehResult.Continue;
};
return e;
}(t("./BehBoat").default);
i.default = l;
cc._RF.pop();
}, {
"../../base/BaseBuilding": "BaseBuilding",
"../../behaviour/BehaviourActionBase": "BehaviourActionBase",
"../../building/Docks": "Docks",
"./BehBoat": "BehBoat"
} ],
BehBoatFindWaterNeutralTile: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "b99b8fZHflOKrSfVQYnrRjC", "BehBoatFindWaterNeutralTile");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
});
Object.defineProperty(i, "__esModule", {
value: !0
});
var r = t("../../actors/ActorTool"), n = t("../../actors/other/boat/Boat"), s = t("../../behaviour/BehaviourActionBase"), l = t("../../building/Docks"), c = function(t) {
a(e, t);
function e() {
var e = t.call(this) || this;
e.id = "BehBoatFindWaterNeutralTile";
return e;
}
e.prototype.execute = function(t) {
this.checkHomeDocks(t);
if (null == t ? void 0 : t.homeBuilding) {
if (t.getComponent(n.default).isNearDock()) return s.BehResult.Stop;
var e = t.homeBuilding.getComponent(l.default).getWaterTileInSameOcean(t.currentTile);
if (e) {
t.beh_tile_target = e;
return s.BehResult.Continue;
}
}
var i = r.default.getRandomTileForBoat(t);
if (!i) return s.BehResult.Stop;
if (i.zone.city && i.zone.city.kingdom.isEnemy(t.kingdom)) return s.BehResult.Stop;
t.beh_tile_target = i;
return s.BehResult.Continue;
};
return e;
}(t("./BehBoat").default);
i.default = c;
cc._RF.pop();
}, {
"../../actors/ActorTool": "ActorTool",
"../../actors/other/boat/Boat": "Boat",
"../../behaviour/BehaviourActionBase": "BehaviourActionBase",
"../../building/Docks": "Docks",
"./BehBoat": "BehBoat"
} ],
BehBoatFindWaterTile: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "b53a8c9MPxFRr8cZuq8mPGu", "BehBoatFindWaterTile");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
});
Object.defineProperty(i, "__esModule", {
value: !0
});
var r = t("../../actors/ActorTool"), n = t("../../behaviour/BehaviourActionBase"), s = function(t) {
a(e, t);
function e() {
var e = t.call(this) || this;
e.id = "BehBoatFindWaterTile";
return e;
}
e.prototype.execute = function(t) {
t.beh_tile_target = r.default.getRandomTileForBoat(t);
return n.BehResult.Continue;
};
return e;
}(t("./BehaviourActionActor").default);
i.default = s;
cc._RF.pop();
}, {
"../../actors/ActorTool": "ActorTool",
"../../behaviour/BehaviourActionBase": "BehaviourActionBase",
"./BehaviourActionActor": "BehaviourActionActor"
} ],
BehBoatFishing: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "b4dceiWoV1L9o4jIdHftkbK", "BehBoatFishing");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
});
Object.defineProperty(i, "__esModule", {
value: !0
});
var r = t("../../../../../framework/lib/prototype/MathUtils"), n = t("../../behaviour/BehaviourActionBase"), s = t("../../common/ToolBox"), l = t("../../MapBox"), c = function(t) {
a(e, t);
function e() {
var e = t.call(this) || this;
e.id = "BehBoatFishing";
return e;
}
e.prototype.execute = function(t) {
this.spawnFishnet(t);
return n.BehResult.Continue;
};
e.prototype.spawnFishnet = function(t) {
if (!l.default.inst.qualityChanger.lowRes) {
var e = s.Toolbox.randomPointOnCircle(3, 4), i = l.default.inst.getTile(t.currentTile.pos.x + r.default.intCast(e.x), t.currentTile.pos.y + r.default.intCast(e.y));
i && i.type.water && l.default.inst.stackEffects.get("fx_fishnet").spawnAt(i, t.stats.baseStats.scale);
}
};
return e;
}(t("./BehaviourActionActor").default);
i.default = c;
cc._RF.pop();
}, {
"../../../../../framework/lib/prototype/MathUtils": void 0,
"../../MapBox": "MapBox",
"../../behaviour/BehaviourActionBase": "BehaviourActionBase",
"../../common/ToolBox": "ToolBox",
"./BehaviourActionActor": "BehaviourActionActor"
} ],
BehBoatMakeTrade: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "2dc01vjNZBOIr4jzwVLtVzr", "BehBoatMakeTrade");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
});
Object.defineProperty(i, "__esModule", {
value: !0
});
var r = t("../../behaviour/BehaviourActionBase"), n = function(t) {
a(e, t);
function e() {
var e = t.call(this) || this;
e.id = "BehBoatMakeTrade";
e.special_inside_object = !0;
return e;
}
e.prototype.execute = function(t) {
t.inventory.add("gold", 5);
return r.BehResult.Continue;
};
return e;
}(t("./BehaviourActionActor").default);
i.default = n;
cc._RF.pop();
}, {
"../../behaviour/BehaviourActionBase": "BehaviourActionBase",
"./BehaviourActionActor": "BehaviourActionActor"
} ],
BehBoatSetHomeDockTarget: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "4797ftpHD9OS5uXaRxwk12E", "BehBoatSetHomeDockTarget");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
});
Object.defineProperty(i, "__esModule", {
value: !0
});
var r = t("../../behaviour/BehaviourActionBase"), n = function(t) {
a(e, t);
function e() {
var e = t.call(this) || this;
e.id = "BehBoatSetHomeDockTarget";
return e;
}
e.prototype.execute = function(t) {
this.checkHomeDocks(t);
if (!t.homeBuilding) return r.BehResult.Stop;
t.beh_building_target = t.homeBuilding;
return r.BehResult.Continue;
};
return e;
}(t("./BehBoat").default);
i.default = n;
cc._RF.pop();
}, {
"../../behaviour/BehaviourActionBase": "BehaviourActionBase",
"./BehBoat": "BehBoat"
} ],
BehBoatTransportCheck: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "37a90t0BLdCqZUaxr+SLHBo", "BehBoatTransportCheck");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
});
Object.defineProperty(i, "__esModule", {
value: !0
});
var r = t("../../behaviour/BehaviourActionBase"), n = function(t) {
a(e, t);
function e() {
var e = t.call(this) || this;
e.id = "BehBoatTransportCheck";
return e;
}
e.prototype.execute = function(t) {
var e, i, o;
this.checkHomeDocks(t);
var a = this.getBoat(t);
if (a.unitsInside.size > 0) {
var n = null;
a.unitsInside.size > 5 && (null === (e = t.city) || void 0 === e ? void 0 : e.attackZone) && (n = null === (i = t.city) || void 0 === i ? void 0 : i.attackZone.centerTile);
n || (n = null === (o = t.city) || void 0 === o ? void 0 : o.getTile());
if (n) {
a.taxiTarget = n;
t.beh_tile_target = n;
return this.forceTask(t, "boat_transport_go_unload", !1);
}
return r.BehResult.Stop;
}
return this.forceTask(t, "boat_transport_check_taxi");
};
return e;
}(t("./BehBoat").default);
i.default = n;
cc._RF.pop();
}, {
"../../behaviour/BehaviourActionBase": "BehaviourActionBase",
"./BehBoat": "BehBoat"
} ],
BehBoatTransportDoLoading: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "bb39fkhGqhP9qnq77NmzlV4", "BehBoatTransportDoLoading");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
});
Object.defineProperty(i, "__esModule", {
value: !0
});
var r = t("../../actors/other/boat/TaxiRequest"), n = t("../../behaviour/BehaviourActionBase"), s = function(t) {
a(e, t);
function e() {
var e = t.call(this) || this;
e.id = "BehBoatTransportDoLoading";
return e;
}
e.prototype.execute = function(t) {
var e = this.getBoat(t);
if (!e.taxiRequest) {
e.cancelWork(t);
return n.BehResult.Stop;
}
var i = !0;
e.passengerWaitCounter > 4 || e.unitsInside.size >= 100 ? i = !1 : e.taxiRequest.everyoneEmbarked() && (i = !1);
if (i) {
e.taxiRequest.setState(r.TaxiRequestState.Loading);
t.timer_action = 12;
e.passengerWaitCounter++;
return n.BehResult.RepeatStep;
}
if (0 == e.unitsInside.size) {
e.cancelWork(t);
return n.BehResult.Stop;
}
e.taxiRequest.cancelForLatePassengers();
e.taxiTarget = e.taxiRequest.target;
return n.BehResult.Continue;
};
return e;
}(t("./BehBoat").default);
i.default = s;
cc._RF.pop();
}, {
"../../actors/other/boat/TaxiRequest": "TaxiRequest",
"../../behaviour/BehaviourActionBase": "BehaviourActionBase",
"./BehBoat": "BehBoat"
} ],
BehBoatTransportFindTilePickUp: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "69837u32+5IQImqODv0zOSd", "BehBoatTransportFindTilePickUp");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
});
Object.defineProperty(i, "__esModule", {
value: !0
});
var r = t("../../actors/ActorTool"), n = t("../../behaviour/BehaviourActionBase"), s = t("../../building/Docks"), l = t("../../common/WaterHelper"), c = function(t) {
a(e, t);
function e() {
var e = t.call(this) || this;
e.id = "BehBoatTransportFindTilePickUp";
return e;
}
e.prototype.execute = function(t) {
var e, i = this.getBoat(t);
if (!i.taxiRequest || !i.taxiRequest.isStillLegit()) {
i.cancelWork(t);
return n.BehResult.Stop;
}
i.pickup_near_dock = !1;
r.default.checkHomeDocks(t);
if (t.homeBuilding) {
var o = t.homeBuilding.getComponent(s.default).getWaterTileInSameOcean(t.currentTile);
if (o && o.isSameIsland(i.taxiRequest.requestTile)) {
i.pickup_near_dock = !0;
if (i.isNearDock()) {
i.passengerWaitCounter = 0;
t.beh_tile_target = t.currentTile;
return n.BehResult.Continue;
}
t.beh_tile_target = o;
return n.BehResult.Continue;
}
}
if (!(e = l.default.findTileForBoat(t.currentTile, i.taxiRequest.requestTile))) {
i.cancelWork(t);
return n.BehResult.Stop;
}
i.passengerWaitCounter = 0;
t.beh_tile_target = e;
return n.BehResult.Continue;
};
return e;
}(t("./BehBoat").default);
i.default = c;
cc._RF.pop();
}, {
"../../actors/ActorTool": "ActorTool",
"../../behaviour/BehaviourActionBase": "BehaviourActionBase",
"../../building/Docks": "Docks",
"../../common/WaterHelper": "WaterHelper",
"./BehBoat": "BehBoat"
} ],
BehBoatTransportFindTileUnload: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "2d790IwuHFK07bl6t3QbXcS", "BehBoatTransportFindTileUnload");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
});
Object.defineProperty(i, "__esModule", {
value: !0
});
var r = t("../../behaviour/BehaviourActionBase"), n = t("../../common/WaterHelper"), s = function(t) {
a(e, t);
function e() {
var e = t.call(this) || this;
e.id = "BehBoatTransportFindTileUnload";
return e;
}
e.prototype.execute = function(t) {
var e = this.getBoat(t);
if (!e.taxiTarget) return r.BehResult.Stop;
var i = n.default.findTileForBoat(t.currentTile, e.taxiTarget);
if (!i) {
e.cancelWork(t);
return r.BehResult.Stop;
}
t.beh_tile_target = i;
return r.BehResult.Continue;
};
return e;
}(t("./BehBoat").default);
i.default = s;
cc._RF.pop();
}, {
"../../behaviour/BehaviourActionBase": "BehaviourActionBase",
"../../common/WaterHelper": "WaterHelper",
"./BehBoat": "BehBoat"
} ],
BehBoatTransportUnloadUnits: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "694d2E6CKhI6pJLvvDncdWv", "BehBoatTransportUnloadUnits");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
});
Object.defineProperty(i, "__esModule", {
value: !0
});
var r = t("../../actors/other/boat/TaxiManager"), n = t("../../behaviour/BehaviourActionBase"), s = t("../../common/PathfinderTools"), l = function(t) {
a(e, t);
function e() {
var e = t.call(this) || this;
e.id = "BehBoatTransportUnloadUnits";
return e;
}
e.prototype.execute = function(t) {
var e = this.getBoat(t), i = s.default.raycastTileForUnitLandingFromWater(t.currentTile, e.taxiTarget);
e.unloadUnits(i);
if (e.taxiRequest) {
r.default.finish(e.taxiRequest);
e.taxiRequest = null;
e.cancelWork(t);
}
return n.BehResult.Continue;
};
return e;
}(t("./BehBoat").default);
i.default = l;
cc._RF.pop();
}, {
"../../actors/other/boat/TaxiManager": "TaxiManager",
"../../behaviour/BehaviourActionBase": "BehaviourActionBase",
"../../common/PathfinderTools": "PathfinderTools",
"./BehBoat": "BehBoat"
} ],
BehBoat: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "5a3beB9qOdKCoCydw77Ilni", "BehBoat");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
});
Object.defineProperty(i, "__esModule", {
value: !0
});
var r = t("../../actors/ActorTool"), n = t("../../actors/other/boat/Boat"), s = t("../../behaviour/BehaviourActionBase"), l = function(t) {
a(e, t);
function e() {
var e = t.call(this) || this;
e.id = "BehBoat";
return e;
}
e.prototype.checkHomeDocks = function(t) {
r.default.checkHomeDocks(t);
};
e.prototype.execute = function() {
return s.BehResult.Continue;
};
e.prototype.getBoat = function(t) {
return t.getComponent(n.default);
};
return e;
}(t("./BehaviourActionActor").default);
i.default = l;
cc._RF.pop();
}, {
"../../actors/ActorTool": "ActorTool",
"../../actors/other/boat/Boat": "Boat",
"../../behaviour/BehaviourActionBase": "BehaviourActionBase",
"./BehaviourActionActor": "BehaviourActionActor"
} ],
BehBuildTargetProgress: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "25b4bNAYDtFu4/jK/wfgM7b", "BehBuildTargetProgress");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
});
Object.defineProperty(i, "__esModule", {
value: !0
});
var r = t("../../behaviour/BehaviourActionBase"), n = t("../../game/audio/GameAudio"), s = function(t) {
a(e, t);
function e() {
var e = t.call(this) || this;
e.id = "BehBuildTargetProgress";
e.check_building_target_non_usable = !0;
e.null_check_city = !0;
e.null_check_tile_target = !0;
return e;
}
e.prototype.execute = function(t) {
var e, i;
if (!(null === (i = null === (e = t.beh_building_target) || void 0 === e ? void 0 : e.data) || void 0 === i ? void 0 : i.underConstruction)) return r.BehResult.Stop;
n.default.playHammer1(t.node.position);
t.beh_building_target.updateBuild();
return r.BehResult.Continue;
};
return e;
}(t("./BehaviourActionActor").default);
i.default = s;
cc._RF.pop();
}, {
"../../behaviour/BehaviourActionBase": "BehaviourActionBase",
"../../game/audio/GameAudio": "GameAudio",
"./BehaviourActionActor": "BehaviourActionActor"
} ],
BehBurnTumorTiles: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "17897WXjAlJKIZxt/83Dk81", "BehBurnTumorTiles");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
}), r = this && this.__values || function(t) {
var e = "function" == typeof Symbol && Symbol.iterator, i = e && t[e], o = 0;
if (i) return i.call(t);
if (t && "number" == typeof t.length) return {
next: function() {
t && o >= t.length && (t = void 0);
return {
value: t && t[o++],
done: !t
};
}
};
throw new TypeError(e ? "Object is not iterable." : "Symbol.iterator is not defined.");
};
Object.defineProperty(i, "__esModule", {
value: !0
});
var n = t("../../assetLibrary/AssetManager"), s = t("../../behaviour/BehaviourActionBase"), l = t("../../common/ToolBox"), c = function(t) {
a(e, t);
function e() {
var e = t.call(this) || this;
e.id = "BehBurnTumorTiles";
return e;
}
e.prototype.execute = function(t) {
var i, o, a, c;
if (!l.Toolbox.randomChance(.7)) return s.BehResult.Stop;
if (!(null === (c = null === (a = t.currentTile) || void 0 === a ? void 0 : a.type) || void 0 === c ? void 0 : c.ground)) return s.BehResult.Stop;
var u = null;
e.tiles.clear();
this.checkRegion(t.currentTile.region);
if (0 != e.tiles.length) u = e.tiles.getRandom(); else try {
for (var d = r(t.currentTile.region.neighbours), h = d.next(); !h.done; h = d.next()) {
var p = h.value;
this.checkRegion(p);
if (0 != e.tiles.length) {
u = e.tiles.getRandom();
break;
}
}
} catch (t) {
i = {
error: t
};
} finally {
try {
h && !h.done && (o = d.return) && o.call(d);
} finally {
if (i) throw i.error;
}
}
if (!u) return s.BehResult.Stop;
n.default.spells.get("fire").action.do(null, u);
t.doCastAnimation();
return s.BehResult.Continue;
};
e.prototype.checkRegion = function(t) {
t.tiles.forEach(function(t) {
t.type.creep && e.tiles.push(t);
});
};
e.tiles = [];
return e;
}(t("./BehaviourActionActor").default);
i.default = c;
cc._RF.pop();
}, {
"../../assetLibrary/AssetManager": "AssetManager",
"../../behaviour/BehaviourActionBase": "BehaviourActionBase",
"../../common/ToolBox": "ToolBox",
"./BehaviourActionActor": "BehaviourActionActor"
} ],
BehCheckBuildCity: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "b678edOyllBFLFXIXw0MB/H", "BehCheckBuildCity");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
});
Object.defineProperty(i, "__esModule", {
value: !0
});
var r = t("../../behaviour/BehaviourActionBase"), n = t("../../MapBox"), s = t("../../ui/log/WorldLog"), l = function(t) {
a(e, t);
function e() {
var e = t.call(this) || this;
e.id = "BehCheckBuildCity";
return e;
}
e.prototype.execute = function(t) {
var e = t.kingdom;
if (!e.isNomads()) {
if (!e.isCiv()) return r.BehResult.Stop;
if (!n.default.inst.worldLaws.world_law_kingdom_expansion.boolVal) return r.BehResult.Stop;
}
var i = t.currentTile.zone.city, o = t.currentTile.zone;
if (!o.goodForNewCity) return r.BehResult.Stop;
(null == e ? void 0 : e.isNomads()) && (e = null);
if (!(i = n.default.inst.buildNewCity(o, null, t.race, !1, e))) return r.BehResult.Stop;
i.newCityEvent();
i.race = t.race;
var a = t.city;
if (a) {
a.kingdom.newCityBuiltEvent(i);
a.removeCitizen(t);
t.removeFromCity();
}
t.becomeCitizen(i);
s.default.logNewCity(i);
return r.BehResult.Continue;
};
return e;
}(t("./BehaviourActionActor").default);
i.default = l;
cc._RF.pop();
}, {
"../../MapBox": "MapBox",
"../../behaviour/BehaviourActionBase": "BehaviourActionBase",
"../../ui/log/WorldLog": "WorldLog",
"./BehaviourActionActor": "BehaviourActionActor"
} ],
BehCheckCitizenJob: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "e2212zqhvJBOqBPzOjOESHx", "BehCheckCitizenJob");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
});
Object.defineProperty(i, "__esModule", {
value: !0
});
var r = t("../../behaviour/BehaviourActionBase"), n = function(t) {
a(e, t);
function e() {
var e = t.call(this) || this;
e.id = "BehCheckCitizenJob";
return e;
}
e.prototype.execute = function(t) {
if (t.city) {
t.ai.setJob("citizen");
return r.BehResult.Continue;
}
return r.BehResult.Stop;
};
return e;
}(t("./BehaviourActionActor").default);
i.default = n;
cc._RF.pop();
}, {
"../../behaviour/BehaviourActionBase": "BehaviourActionBase",
"./BehaviourActionActor": "BehaviourActionActor"
} ],
BehCheckCityArmyGroup: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "e66a2kLim9JUKkzTs1YC4rE", "BehCheckCityArmyGroup");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
});
Object.defineProperty(i, "__esModule", {
value: !0
});
var r = t("../../behaviour/BehaviourActionBase"), n = function(t) {
a(e, t);
function e() {
var e = t.call(this) || this;
e.id = "BehCheckCityArmyGroup";
e.null_check_city = !0;
return e;
}
e.prototype.execute = function(t) {
var e, i;
if (!t.city.army) return r.BehResult.Stop;
if (null !== (i = null === (e = t.unitGroup) || void 0 === e ? void 0 : e.isAlive()) && void 0 !== i && i) return r.BehResult.Stop;
t.kingdom.isCiv() || (t.unitGroup = null);
t.city.army && t.city.army.addUnit(t);
return r.BehResult.Continue;
};
return e;
}(t("./BehaviourActionActor").default);
i.default = n;
cc._RF.pop();
}, {
"../../behaviour/BehaviourActionBase": "BehaviourActionBase",
"./BehaviourActionActor": "BehaviourActionActor"
} ],
BehCheckCure: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "1d26fTjD8tInIeJ57wrdG8P", "BehCheckCure");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
});
Object.defineProperty(i, "__esModule", {
value: !0
});
var r = t("../../actors/ActorTool"), n = t("../../assetLibrary/AssetManager"), s = t("../../behaviour/BehaviourActionBase"), l = t("../../common/ToolBox"), c = t("../../map/map/MapLayer"), u = t("../../MapBox"), d = function(t) {
a(e, t);
function e() {
var e = t.call(this) || this;
e.id = "BehCheckCure";
return e;
}
e.prototype.execute = function(t) {
var e, i;
if (!l.Toolbox.randomChance(.9)) return s.BehResult.Stop;
if (!(null === (i = null === (e = t.currentTile) || void 0 === e ? void 0 : e.type) || void 0 === i ? void 0 : i.ground)) return s.BehResult.Stop;
u.default.inst.getObjectsInChunks(t.currentTile, 0, c.MapObjectType.Actor);
for (var o = null, a = 0; a < u.default.inst.temp_map_objects.length; a++) {
var d = u.default.inst.temp_map_objects[a];
if (r.default.canBeCuredFromTraits(d)) {
o = d;
break;
}
}
if (!o) return s.BehResult.Stop;
n.default.spells.get("cure").action.do(o, o.currentTile);
t.doCastAnimation();
return s.BehResult.Continue;
};
return e;
}(t("./BehaviourActionActor").default);
i.default = d;
cc._RF.pop();
}, {
"../../MapBox": "MapBox",
"../../actors/ActorTool": "ActorTool",
"../../assetLibrary/AssetManager": "AssetManager",
"../../behaviour/BehaviourActionBase": "BehaviourActionBase",
"../../common/ToolBox": "ToolBox",
"../../map/map/MapLayer": "MapLayer",
"./BehaviourActionActor": "BehaviourActionActor"
} ],
BehCheckHunger: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "a247dFwumJH/I4ufMkuK3wv", "BehCheckHunger");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
});
Object.defineProperty(i, "__esModule", {
value: !0
});
var r = t("../../behaviour/BehaviourActionBase"), n = t("./BehaviourActionActor"), s = function(t) {
a(e, t);
function e() {
var e = t.call(this) || this;
e.id = "BehCheckHunger";
return e;
}
e.prototype.execute = function(t) {
var e, i, o;
if (!(null === (e = t.data) || void 0 === e ? void 0 : e.alive) || (null === (i = t.data) || void 0 === i ? void 0 : i.hunger) > (null === (o = t.stats) || void 0 === o ? void 0 : o.maxHunger) / 2) return r.BehResult.Stop;
n.default.temp_tasks.clear();
t.stats.diet_berries && n.default.temp_tasks.push("eat_fruits");
t.stats.diet_flowers && n.default.temp_tasks.push("eat_flowers");
t.stats.diet_crops && n.default.temp_tasks.push("eat_crops");
t.stats.diet_grass && n.default.temp_tasks.push("eat_grass");
(t.stats.diet_meat || t.stats.diet_meat_insect) && n.default.temp_tasks.push("hunting_attack");
if (n.default.temp_tasks.length > 0) {
t.diet_index >= n.default.temp_tasks.length && (t.diet_index = 0);
return this.forceTask(t, n.default.temp_tasks[t.diet_index++]);
}
return r.BehResult.Continue;
};
return e;
}(n.default);
i.default = s;
cc._RF.pop();
}, {
"../../behaviour/BehaviourActionBase": "BehaviourActionBase",
"./BehaviourActionActor": "BehaviourActionActor"
} ],
BehCheckIfInWater: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "91fe5dALKRMTaWTkogL9yrs", "BehCheckIfInWater");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
});
Object.defineProperty(i, "__esModule", {
value: !0
});
var r = t("../../behaviour/BehaviourActionBase"), n = function(t) {
a(e, t);
function e() {
var e = t.call(this) || this;
e.id = "BehCheckIfInWater";
return e;
}
e.prototype.execute = function(t) {
return t.isInWater() ? r.BehResult.Continue : r.BehResult.Stop;
};
return e;
}(t("./BehaviourActionActor").default);
i.default = n;
cc._RF.pop();
}, {
"../../behaviour/BehaviourActionBase": "BehaviourActionBase",
"./BehaviourActionActor": "BehaviourActionActor"
} ],
BehCheckIfOnGround: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "f3e08mL28NK17i17PImO53S", "BehCheckIfOnGround");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
});
Object.defineProperty(i, "__esModule", {
value: !0
});
var r = t("../../behaviour/BehaviourActionBase"), n = function(t) {
a(e, t);
function e() {
var e = t.call(this) || this;
e.id = "BehCheckIfOnGround";
return e;
}
e.prototype.execute = function(t) {
return t.isInWater() ? r.BehResult.Stop : r.BehResult.Continue;
};
return e;
}(t("./BehaviourActionActor").default);
i.default = n;
cc._RF.pop();
}, {
"../../behaviour/BehaviourActionBase": "BehaviourActionBase",
"./BehaviourActionActor": "BehaviourActionActor"
} ],
BehCheckIfOnSmallLand: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "1d4bdWJpNFKF4vasSIR32oB", "BehCheckIfOnSmallLand");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
});
Object.defineProperty(i, "__esModule", {
value: !0
});
var r = t("../../behaviour/BehaviourActionBase"), n = function(t) {
a(e, t);
function e() {
var e = t.call(this) || this;
e.id = "BehCheckIfOnSmallLand";
return e;
}
e.prototype.execute = function(t) {
var e, i;
return (null === (i = null === (e = t.currentTile) || void 0 === e ? void 0 : e.region) || void 0 === i ? void 0 : i.island.getTileCount()) > 5 ? r.BehResult.Stop : r.BehResult.Continue;
};
return e;
}(t("./BehaviourActionActor").default);
i.default = n;
cc._RF.pop();
}, {
"../../behaviour/BehaviourActionBase": "BehaviourActionBase",
"./BehaviourActionActor": "BehaviourActionActor"
} ],
BehChuckTargetBuildProgress: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "8936069YnpK6LuYMtkBWI3B", "BehChuckTargetBuildProgress");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
});
Object.defineProperty(i, "__esModule", {
value: !0
});
var r = t("../../behaviour/BehaviourActionBase"), n = function(t) {
a(e, t);
function e() {
var e = t.call(this) || this;
e.id = "BehChuckTargetBuildProgress";
e.check_building_target_non_usable = !0;
e.null_check_city = !0;
e.null_check_tile_target = !0;
return e;
}
e.prototype.execute = function(t) {
var e, i;
return (null === (i = null === (e = t.beh_building_target) || void 0 === e ? void 0 : e.data) || void 0 === i ? void 0 : i.underConstruction) ? r.BehResult.RestartTask : r.BehResult.Continue;
};
return e;
}(t("./BehaviourActionActor").default);
i.default = n;
cc._RF.pop();
}, {
"../../behaviour/BehaviourActionBase": "BehaviourActionBase",
"./BehaviourActionActor": "BehaviourActionActor"
} ],
BehCityCheckAttack: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "b7705Q89KNCn6BCJr8mXl0P", "BehCityCheckAttack");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
});
Object.defineProperty(i, "__esModule", {
value: !0
});
var r = t("../../behaviour/BehaviourActionBase"), n = function(t) {
a(e, t);
function e() {
var e = t.call(this) || this;
e.id = "BehCityCheckAttack";
return e;
}
e.prototype.execute = function(t) {
if (!t.city.attackZone) return r.BehResult.Stop;
if (t.city.attackZone.centerTile.isSameIsland(t.currentTile)) {
t.beh_tile_target = t.city.attackZone.tiles.getRandom();
return r.BehResult.Continue;
}
return r.BehResult.Stop;
};
return e;
}(t("./BehCity").default);
i.default = n;
cc._RF.pop();
}, {
"../../behaviour/BehaviourActionBase": "BehaviourActionBase",
"./BehCity": "BehCity"
} ],
BehCityCreateRoad: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "be42bOznEhIgYnYce63e7yZ", "BehCityCreateRoad");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
});
Object.defineProperty(i, "__esModule", {
value: !0
});
var r = t("../../behaviour/BehaviourActionBase"), n = t("../../MapBox"), s = function(t) {
a(e, t);
function e() {
var e = t.call(this) || this;
e.id = "BehCityCreateRoad";
e.null_check_tile_target = !0;
return e;
}
e.prototype.execute = function(t) {
n.default.inst.createRoad2(t.beh_tile_target);
return r.BehResult.Continue;
};
return e;
}(t("./BehCity").default);
i.default = s;
cc._RF.pop();
}, {
"../../MapBox": "MapBox",
"../../behaviour/BehaviourActionBase": "BehaviourActionBase",
"./BehCity": "BehCity"
} ],
BehCityFindBuilding: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "201c4s5nXRHpYQE4eOv3H3o", "BehCityFindBuilding");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
});
Object.defineProperty(i, "__esModule", {
value: !0
});
var r = t("../../actors/ActorTool"), n = t("../../behaviour/BehaviourActionBase"), s = function(t) {
a(e, t);
function e(e) {
var i = t.call(this) || this;
i.type = "";
i.types = [];
i.id = "BehCityFindBuilding";
i.type = e;
i.id = e;
e.includes(",") && (i.types = e.split(","));
return i;
}
e.prototype.execute = function(t) {
if (this.types.length > 0) {
this.type = this.types.getRandom();
this.id = this.type;
}
t.beh_building_target = r.default.findNewBuildingTarget(t, this.type);
return n.BehResult.Continue;
};
return e;
}(t("./BehCity").default);
i.default = s;
cc._RF.pop();
}, {
"../../actors/ActorTool": "ActorTool",
"../../behaviour/BehaviourActionBase": "BehaviourActionBase",
"./BehCity": "BehCity"
} ],
BehCityFindFireZone: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "df901Pj1PpLnqn+EcWZoZvZ", "BehCityFindFireZone");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
}), r = this && this.__values || function(t) {
var e = "function" == typeof Symbol && Symbol.iterator, i = e && t[e], o = 0;
if (i) return i.call(t);
if (t && "number" == typeof t.length) return {
next: function() {
t && o >= t.length && (t = void 0);
return {
value: t && t[o++],
done: !t
};
}
};
throw new TypeError(e ? "Object is not iterable." : "Symbol.iterator is not defined.");
};
Object.defineProperty(i, "__esModule", {
value: !0
});
var n = t("../../behaviour/BehaviourActionBase"), s = t("../../common/ToolBox"), l = function(t) {
a(e, t);
function e() {
var e = t.call(this) || this;
e.id = "BehCityFindFireZone";
return e;
}
e.prototype.execute = function(t) {
var i, o;
e.chosenTile = null;
e.tNewTile = null;
e.tAllZones.clear();
e.tAllZones.addRange(t.city.zones);
e.tAllZones.addRange(t.city.neighbourZones);
try {
for (var a = r(e.tAllZones), l = a.next(); !l.done; l = a.next()) {
var c = l.value;
if (0 != c.tilesOnFire) {
e.tNewTile = c.centerTile;
if (e.chosenTile) {
e.newDist = s.Toolbox.dist(t.currentTile.pos.x, t.currentTile.pos.y, e.tNewTile.pos.x, e.tNewTile.pos.y);
e.chosenTile = e.tNewTile;
e.chosenDist = e.newDist;
} else {
e.chosenTile = e.tNewTile;
e.chosenDist = s.Toolbox.dist(t.currentTile.pos.x, t.currentTile.pos.y, e.chosenTile.pos.x, e.chosenTile.pos.y);
}
}
}
} catch (t) {
i = {
error: t
};
} finally {
try {
l && !l.done && (o = a.return) && o.call(a);
} finally {
if (i) throw i.error;
}
}
if (!e.chosenTile) return n.BehResult.Stop;
e.chosenTile = s.Toolbox.getClosestTile(e.chosenTile.zone.tiles, t.currentTile);
if (e.chosenTile.data.fire || e.chosenTile.building) for (var u = 0; u < 10; u++) {
e.chosenTile = s.Toolbox.getRandom(e.chosenTile.zone.tiles);
if (!e.chosenTile.data.fire && !e.chosenTile.building) break;
}
t.beh_tile_target = e.chosenTile;
return n.BehResult.Continue;
};
e.tAllZones = [];
e.chosenTile = null;
e.tNewTile = null;
e.chosenDist = 0;
e.newDist = 0;
return e;
}(t("./BehCity").default);
i.default = l;
cc._RF.pop();
}, {
"../../behaviour/BehaviourActionBase": "BehaviourActionBase",
"../../common/ToolBox": "ToolBox",
"./BehCity": "BehCity"
} ],
BehCityFindNewJob: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "f7702Gh3URN5YG81GGrTqE3", "BehCityFindNewJob");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
});
Object.defineProperty(i, "__esModule", {
value: !0
});
var r = t("../../behaviour/BehaviourActionBase"), n = function(t) {
a(e, t);
function e() {
var e = t.call(this) || this;
e.id = "BehCityFindNewJob";
return e;
}
e.prototype.execute = function(t) {
if (t.isInCityIsland()) {
t.city.findNewJob(t);
return r.BehResult.Continue;
}
return r.BehResult.Stop;
};
return e;
}(t("./BehCity").default);
i.default = n;
cc._RF.pop();
}, {
"../../behaviour/BehaviourActionBase": "BehaviourActionBase",
"./BehCity": "BehCity"
} ],
BehCityFindStorage: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "3ac8bSxulNE3JPMnu7Uumvh", "BehCityFindStorage");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
});
Object.defineProperty(i, "__esModule", {
value: !0
});
var r = t("../../behaviour/BehaviourActionBase"), n = function(t) {
a(e, t);
function e() {
var e = t.call(this) || this;
e.id = "BehCityFindStorage";
return e;
}
e.prototype.execute = function(t) {
if (t.city) {
var e = t.city.getStorageNear(t.currentTile);
if (e) {
t.beh_building_target = e;
return r.BehResult.Continue;
}
}
return r.BehResult.Stop;
};
return e;
}(t("./BehCity").default);
i.default = n;
cc._RF.pop();
}, {
"../../behaviour/BehaviourActionBase": "BehaviourActionBase",
"./BehCity": "BehCity"
} ],
BehCityGetRandomZoneTile: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "1adccwCEXpP25FIEMPY5EEA", "BehCityGetRandomZoneTile");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
});
Object.defineProperty(i, "__esModule", {
value: !0
});
var r = t("../../behaviour/BehaviourActionBase"), n = t("../../common/ToolBox"), s = function(t) {
a(e, t);
function e() {
var e = t.call(this) || this;
e.id = "BehCityGetRandomZoneTile";
return e;
}
e.prototype.execute = function(t) {
if (!t.city || 0 == t.city.zones.length) return r.BehResult.Stop;
var e = null;
if (t.currentTile.zone.city != t.city || n.Toolbox.randomChance(.2)) {
if (!(e = t.city.zones.getRandom().tiles.getRandom()).isSameIsland(t.currentTile)) return r.BehResult.Stop;
} else e = t.currentTile.region.tiles.getRandom();
t.beh_tile_target = e;
return r.BehResult.Continue;
};
return e;
}(t("./BehCity").default);
i.default = s;
cc._RF.pop();
}, {
"../../behaviour/BehaviourActionBase": "BehaviourActionBase",
"../../common/ToolBox": "ToolBox",
"./BehCity": "BehCity"
} ],
BehCityRemoveFire: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "31117RlOiBOI5wz0+ioekIW", "BehCityRemoveFire");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
});
Object.defineProperty(i, "__esModule", {
value: !0
});
var r = t("../../behaviour/BehaviourActionBase"), n = function(t) {
a(e, t);
function e() {
var e = t.call(this) || this;
e.id = "BehCityRemoveFire";
e.null_check_tile_target = !0;
return e;
}
e.prototype.execute = function(t) {
t.currentTile.zone.tilesOnFire > 0 && t.currentTile.zone.tiles.forEach(function(t) {
t.data.fire && t.stopFire();
t.building && t.building.stopFire();
});
return r.BehResult.Continue;
};
return e;
}(t("./BehCity").default);
i.default = n;
cc._RF.pop();
}, {
"../../behaviour/BehaviourActionBase": "BehaviourActionBase",
"./BehCity": "BehCity"
} ],
BehCitySettlerFindTileSameIsland: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "500b9BRuSVL3az8v9uwq5r8", "BehCitySettlerFindTileSameIsland");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
});
Object.defineProperty(i, "__esModule", {
value: !0
});
var r = t("../../behaviour/BehaviourActionBase"), n = function(t) {
a(e, t);
function e() {
var e = t.call(this) || this;
e.id = "BehCitySettlerFindTileSameIsland";
return e;
}
e.prototype.execute = function(t) {
var e, i;
if (!(null === (e = t.city) || void 0 === e ? void 0 : e.settleTarget)) return r.BehResult.Stop;
if (null === (i = t.currentTile) || void 0 === i ? void 0 : i.isSameIsland(t.city.settleTarget.centerTile)) {
t.beh_tile_target = t.city.settleTarget.centerTile;
return r.BehResult.Continue;
}
return r.BehResult.Stop;
};
return e;
}(t("./BehCity").default);
i.default = n;
cc._RF.pop();
}, {
"../../behaviour/BehaviourActionBase": "BehaviourActionBase",
"./BehCity": "BehCity"
} ],
BehCitySettlerTaxiCheck: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "0ad22tJAjhHC49ym+vQLt/s", "BehCitySettlerTaxiCheck");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
});
Object.defineProperty(i, "__esModule", {
value: !0
});
var r = t("../../actors/other/boat/TaxiManager"), n = t("../../behaviour/BehaviourActionBase"), s = function(t) {
a(e, t);
function e() {
var e = t.call(this) || this;
e.id = "BehCitySettlerTaxiCheck";
return e;
}
e.prototype.execute = function(t) {
var e;
if (!(null === (e = t.city) || void 0 === e ? void 0 : e.settleTarget)) return n.BehResult.Stop;
if (!t.city.settleTarget.centerTile.isSameIsland(t.currentTile)) {
r.default.newRequest(t, t.city.settleTarget.centerTile);
return n.BehResult.Continue;
}
return n.BehResult.Stop;
};
return e;
}(t("./BehCity").default);
i.default = s;
cc._RF.pop();
}, {
"../../actors/other/boat/TaxiManager": "TaxiManager",
"../../behaviour/BehaviourActionBase": "BehaviourActionBase",
"./BehCity": "BehCity"
} ],
BehCityWarriorTaxiCheck: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "50b3eW5fVRG/a2Q5JuxaFm2", "BehCityWarriorTaxiCheck");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
});
Object.defineProperty(i, "__esModule", {
value: !0
});
var r = t("../../actors/other/boat/TaxiManager"), n = t("../../behaviour/BehaviourActionBase"), s = function(t) {
a(e, t);
function e() {
var e = t.call(this) || this;
e.id = "BehCityWarriorTaxiCheck";
return e;
}
e.prototype.execute = function(t) {
var e, i;
if ((null === (i = null === (e = t.city) || void 0 === e ? void 0 : e.attackZone) || void 0 === i ? void 0 : i.centerTile) && !t.city.attackZone.centerTile.isSameIsland(t.currentTile)) {
r.default.newRequest(t, t.city.attackZone.centerTile);
return n.BehResult.Continue;
}
return n.BehResult.Stop;
};
return e;
}(t("./BehCity").default);
i.default = s;
cc._RF.pop();
}, {
"../../actors/other/boat/TaxiManager": "TaxiManager",
"../../behaviour/BehaviourActionBase": "BehaviourActionBase",
"./BehCity": "BehCity"
} ],
BehCity: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "535151v/ktNf4Gc2/gdBXmx", "BehCity");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
});
Object.defineProperty(i, "__esModule", {
value: !0
});
var r = function(t) {
a(e, t);
function e() {
var e = t.call(this) || this;
e.id = "BehCity";
e.null_check_city = !0;
return e;
}
return e;
}(t("./BehaviourActionActor").default);
i.default = r;
cc._RF.pop();
}, {
"./BehaviourActionActor": "BehaviourActionActor"
} ],
BehConsumeActorTarget: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "40d1dlHHSZPM62sPqsrKpSm", "BehConsumeActorTarget");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
});
Object.defineProperty(i, "__esModule", {
value: !0
});
var r = t("../../actors/ActorStatus"), n = t("../../behaviour/BehaviourActionBase"), s = t("../../common/ToolBox"), l = t("../../MapBox"), c = function(t) {
a(e, t);
function e() {
var e = t.call(this) || this;
e.id = "BehConsumeActorTarget";
e.null_check_actor_target = !0;
return e;
}
e.prototype.execute = function(t) {
var e, i, o, a;
if (s.Toolbox.distTile(t.currentTile, t.beh_actor_target.currentTile) > 1) return this.forceTask(t, "hunting_attack", !1);
this.consume(t, null === (e = t.beh_actor_target) || void 0 === e ? void 0 : e.a);
return (null === (a = null === (o = null === (i = t.beh_actor_target) || void 0 === i ? void 0 : i.a) || void 0 === o ? void 0 : o.data) || void 0 === a ? void 0 : a.alive) ? n.BehResult.RepeatStep : n.BehResult.Continue;
};
e.prototype.consume = function(t, e) {
t.timer_action = .3;
if (e) {
if (t.node.x > e.node.x) {
if (e.targetAngle.z > -45) {
e.targetAngle.z -= 100 * l.default.inst.elapsed;
e.targetAngle.z < -90 && (e.targetAngle.z = -90);
e.rotationCooldown = 1;
}
} else if (e.targetAngle.z < 45) {
e.targetAngle.z += 100 * l.default.inst.elapsed;
e.rotationCooldown = 1;
}
if (0 == t.targetAngle.z) {
t.punchTargetAnimation(e.node.position, t.currentTile, !1);
e.getHit(t.curStats.damage, !0, r.AttackType.Eaten, t, !1);
e.startShake(.2);
t.restoreStatsFromEating(t.curStats.damage);
}
e.cancelAllBeh();
e.timer_action = s.Toolbox.randomFloat(1, 2);
}
};
return e;
}(t("./BehaviourActionActor").default);
i.default = c;
cc._RF.pop();
}, {
"../../MapBox": "MapBox",
"../../actors/ActorStatus": "ActorStatus",
"../../behaviour/BehaviourActionBase": "BehaviourActionBase",
"../../common/ToolBox": "ToolBox",
"./BehaviourActionActor": "BehaviourActionActor"
} ],
BehConsumeFlowers: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "264d0ypUfdEVIgEmgZExYNS", "BehConsumeFlowers");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
});
Object.defineProperty(i, "__esModule", {
value: !0
});
var r = t("../../behaviour/BehaviourActionBase"), n = function(t) {
a(e, t);
function e() {
var e = t.call(this) || this;
e.id = "BehConsumeFlowers";
e.null_check_tile_target = !0;
return e;
}
e.prototype.execute = function(t) {
var e, i;
if (!(null === (i = null === (e = t.beh_tile_target) || void 0 === e ? void 0 : e.type) || void 0 === i ? void 0 : i.flowers)) return r.BehResult.Stop;
t.punchTargetAnimation(t.beh_tile_target.posV3, t.beh_tile_target, !1);
t.restoreStatsFromEating();
t.beh_tile_target.eatGreens();
return r.BehResult.Continue;
};
return e;
}(t("./BehaviourActionActor").default);
i.default = n;
cc._RF.pop();
}, {
"../../behaviour/BehaviourActionBase": "BehaviourActionBase",
"./BehaviourActionActor": "BehaviourActionActor"
} ],
BehConsumeGrass: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "3ae03PRW39CsLfSq6OI2A7w", "BehConsumeGrass");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
});
Object.defineProperty(i, "__esModule", {
value: !0
});
var r = t("../../behaviour/BehaviourActionBase"), n = function(t) {
a(e, t);
function e() {
var e = t.call(this) || this;
e.id = "BehConsumeGrass";
e.null_check_tile_target = !0;
return e;
}
e.prototype.execute = function(t) {
var e, i;
if (!(null === (i = null === (e = t.beh_tile_target) || void 0 === e ? void 0 : e.type) || void 0 === i ? void 0 : i.grass)) return r.BehResult.Stop;
t.punchTargetAnimation(t.beh_tile_target.posV3, t.beh_tile_target, !1);
t.restoreStatsFromEating();
t.beh_tile_target.eatGreens();
return r.BehResult.Continue;
};
return e;
}(t("./BehaviourActionActor").default);
i.default = n;
cc._RF.pop();
}, {
"../../behaviour/BehaviourActionBase": "BehaviourActionBase",
"./BehaviourActionActor": "BehaviourActionActor"
} ],
BehConsumeTargetBuilding: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "93ac2cFTv9JIpgU1eIopqMn", "BehConsumeTargetBuilding");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
});
Object.defineProperty(i, "__esModule", {
value: !0
});
var r = t("../../behaviour/BehaviourActionBase"), n = function(t) {
a(e, t);
function e() {
var e = t.call(this) || this;
e.id = "BehConsumeTargetBuilding";
e.null_check_building_target = !0;
return e;
}
e.prototype.execute = function(t) {
var e, i, o, a, n, s, l, c, u, d;
if (!(null === (e = t.data) || void 0 === e ? void 0 : e.alive) || !(null === (o = null === (i = t.beh_building_target) || void 0 === i ? void 0 : i.data) || void 0 === o ? void 0 : o.alive)) return r.BehResult.Stop;
if ("fruits" == (null === (n = null === (a = t.beh_building_target) || void 0 === a ? void 0 : a.stats) || void 0 === n ? void 0 : n.type)) {
if (t.beh_building_target.haveResources) {
t.beh_building_target.extractResources();
t.restoreStatsFromEating();
}
} else if ("crops" == (null === (l = null === (s = t.beh_building_target) || void 0 === s ? void 0 : s.stats) || void 0 === l ? void 0 : l.type) && (null === (u = null === (c = t.beh_building_target) || void 0 === c ? void 0 : c.data) || void 0 === u ? void 0 : u.alive)) {
t.beh_building_target.startDestroyBuilding(!0);
t.restoreStatsFromEating();
}
var h = null === (d = t.beh_building_target) || void 0 === d ? void 0 : d.currentTile;
t.punchTargetAnimation(h.posV3, h, !1);
return r.BehResult.Continue;
};
return e;
}(t("./BehaviourActionActor").default);
i.default = n;
cc._RF.pop();
}, {
"../../behaviour/BehaviourActionBase": "BehaviourActionBase",
"./BehaviourActionActor": "BehaviourActionActor"
} ],
BehConvertOre: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "92380uaB6xH/JewWsV6fngh", "BehConvertOre");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
});
Object.defineProperty(i, "__esModule", {
value: !0
});
var r = t("../../behaviour/BehaviourActionBase"), n = function(t) {
a(e, t);
function e() {
var e = t.call(this) || this;
e.id = "BehConvertOre";
e.special_inside_object = !0;
return e;
}
e.prototype.execute = function(t) {
var e;
if (!(null === (e = t.city) || void 0 === e ? void 0 : e.data) || 0 == t.city.data.storage.get("ore")) return r.BehResult.Stop;
t.city.data.storage.change("ore", -1);
t.inventory.add("metals", 1);
return r.BehResult.Continue;
};
return e;
}(t("./BehCity").default);
i.default = n;
cc._RF.pop();
}, {
"../../behaviour/BehaviourActionBase": "BehaviourActionBase",
"./BehCity": "BehCity"
} ],
BehCrabBurrow: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "b5e44iu7mZNn58TsPb619pt", "BehCrabBurrow");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
});
Object.defineProperty(i, "__esModule", {
value: !0
});
var r = t("../../behaviour/BehaviourActionBase"), n = t("../../common/ToolBox"), s = function(t) {
a(e, t);
function e() {
var e = t.call(this) || this;
e.id = "BehCrabBurrow";
e.forceAnimation = "burrow";
e.special_inside_object = !0;
return e;
}
e.prototype.execute = function(t) {
var e;
if (!(null === (e = t.data) || void 0 === e ? void 0 : e.alive) || t.data.hunger < 50) {
t.ai.setJob(null);
return r.BehResult.Stop;
}
n.Toolbox.findNotSameRaceInChunkAround(t.currentTile.chunk, t.race.id);
if (0 == n.Toolbox.temp_list_units.length) {
t.ai.setJob(null);
return r.BehResult.Stop;
}
t.timer_action = n.Toolbox.randomFloat(10, 20);
return r.BehResult.RepeatStep;
};
return e;
}(t("./BehaviourActionActor").default);
i.default = s;
cc._RF.pop();
}, {
"../../behaviour/BehaviourActionBase": "BehaviourActionBase",
"../../common/ToolBox": "ToolBox",
"./BehaviourActionActor": "BehaviourActionActor"
} ],
BehEndJob: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "ec1eacJjTZDJbOxv+suofDX", "BehEndJob");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
});
Object.defineProperty(i, "__esModule", {
value: !0
});
var r = t("../../behaviour/BehaviourActionBase"), n = function(t) {
a(e, t);
function e() {
var e = t.call(this) || this;
e.id = "BehEndJob";
return e;
}
e.prototype.execute = function(t) {
t.ai.setJob(null);
return r.BehResult.Continue;
};
return e;
}(t("./BehaviourActionActor").default);
i.default = n;
cc._RF.pop();
}, {
"../../behaviour/BehaviourActionBase": "BehaviourActionBase",
"./BehaviourActionActor": "BehaviourActionActor"
} ],
BehExitBuilding: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "fa595yps/dNpIJaJ+KpnEvK", "BehExitBuilding");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
});
Object.defineProperty(i, "__esModule", {
value: !0
});
var r = t("../../behaviour/BehaviourActionBase"), n = function(t) {
a(e, t);
function e() {
var e = t.call(this) || this;
e.id = "BehExitBuilding";
e.null_check_building_target = !0;
e.check_building_target_non_usable = !0;
e.special_inside_object = !0;
return e;
}
e.prototype.execute = function(t) {
var e;
t.exitHouse();
null === (e = t.beh_building_target) || void 0 === e || e.startShake(.01);
return r.BehResult.Continue;
};
return e;
}(t("./BehCity").default);
i.default = n;
cc._RF.pop();
}, {
"../../behaviour/BehaviourActionBase": "BehaviourActionBase",
"./BehCity": "BehCity"
} ],
BehExtractResourcesFromBuilding: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "87b1cV688ZCu7N/yI1Cc3YG", "BehExtractResourcesFromBuilding");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
});
Object.defineProperty(i, "__esModule", {
value: !0
});
var r = t("../../behaviour/BehaviourActionBase"), n = function(t) {
a(e, t);
function e() {
var e = t.call(this) || this;
e.id = "BehExtractResourcesFromBuilding";
e.null_check_building_target = !0;
e.check_building_target_non_usable = !0;
return e;
}
e.prototype.execute = function(t) {
var e;
if (null === (e = t.beh_building_target) || void 0 === e ? void 0 : e.stats) {
t.beh_building_target.extractResources(t.beh_building_target.stats.resources_given);
t.inventory.add(t.beh_building_target.stats.resource_id, t.beh_building_target.stats.resources_given);
} else t.cancelAllBeh();
return r.BehResult.Continue;
};
return e;
}(t("./BehaviourActionActor").default);
i.default = n;
cc._RF.pop();
}, {
"../../behaviour/BehaviourActionBase": "BehaviourActionBase",
"./BehaviourActionActor": "BehaviourActionActor"
} ],
BehFightCheckEnemyIsOk: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "63a02tq/wJEGJmNw8t0EZbo", "BehFightCheckEnemyIsOk");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
});
Object.defineProperty(i, "__esModule", {
value: !0
});
var r = t("../../behaviour/BehaviourActionBase"), n = t("../../common/ToolBox"), s = function(t) {
a(e, t);
function e() {
var e = t.call(this) || this;
e.id = "BehFightCheckEnemyIsOk";
return e;
}
e.prototype.execute = function(t) {
var e, i;
if (!(null === (i = null === (e = t.attackTarget) || void 0 === e ? void 0 : e.base_data) || void 0 === i ? void 0 : i.alive)) {
t.attackTarget = null;
return r.BehResult.Stop;
}
if (!t.kingdom.isEnemy(t.attackTarget.kingdom)) {
t.attackTarget = null;
return r.BehResult.Stop;
}
if (!t.canAttackTarget(t.attackTarget)) {
t.targetsToIgnore.add(t.attackTarget);
t.attackTarget = null;
return r.BehResult.Stop;
}
if (!t.isInAttackRange(t.attackTarget)) if (t.stats.waterCreature) {
if (t.attackTarget.isInAir() || !t.attackTarget.isInWater()) {
t.targetsToIgnore.add(t.attackTarget);
t.attackTarget = null;
return r.BehResult.Stop;
}
} else if (t.attackTarget.isInWater() || t.attackTarget.isInAir()) {
t.targetsToIgnore.add(t.attackTarget);
t.attackTarget = null;
return r.BehResult.Stop;
}
if (n.Toolbox.dist(t.currentTile.chunk.x, t.currentTile.chunk.y, t.attackTarget.currentTile.chunk.x, t.attackTarget.currentTile.chunk.y) > 2 && !t.currentTile.chunk.neighboursAll.includes(t.attackTarget.currentTile.chunk)) {
t.attackTarget = null;
return r.BehResult.Stop;
}
t.beh_actor_target = t.attackTarget;
return r.BehResult.Continue;
};
return e;
}(t("./BehaviourActionActor").default);
i.default = s;
cc._RF.pop();
}, {
"../../behaviour/BehaviourActionBase": "BehaviourActionBase",
"../../common/ToolBox": "ToolBox",
"./BehaviourActionActor": "BehaviourActionActor"
} ],
BehFindBuilding: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "36d58svjNpMtpwqJfDHcABH", "BehFindBuilding");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
});
Object.defineProperty(i, "__esModule", {
value: !0
});
var r = t("../../behaviour/BehaviourActionBase"), n = t("../../common/ToolBox"), s = function(t) {
a(e, t);
function e(e) {
var i = t.call(this) || this;
i.type = "";
i.id = "BehFindBuilding";
i.type = e;
return i;
}
e.prototype.execute = function(t) {
t.beh_building_target = e.findBuildingType(t, this.type);
return t.beh_building_target ? r.BehResult.Continue : r.BehResult.Stop;
};
e.findBuildingType = function(t, e) {
var i = null;
n.Toolbox.temp_list_buildings_2.clear();
n.Toolbox.addToTempChunksBuildingsType(t.currentTile.chunk, e);
t.currentTile.chunk.neighboursAll.forEach(function(t) {
n.Toolbox.addToTempChunksBuildingsType(t, e);
});
if (0 == n.Toolbox.temp_list_buildings_2.length) return null;
n.Toolbox.temp_list_buildings_2.shuffle();
n.Toolbox.temp_list_buildings_2.forEach(function(e) {
var o;
(null === (o = e.currentTile) || void 0 === o ? void 0 : o.isSameIsland(t.currentTile)) && (i = e);
});
i || (i = n.Toolbox.temp_list_buildings_2.getRandom());
return i;
};
return e;
}(t("./BehaviourActionActor").default);
i.default = s;
cc._RF.pop();
}, {
"../../behaviour/BehaviourActionBase": "BehaviourActionBase",
"../../common/ToolBox": "ToolBox",
"./BehaviourActionActor": "BehaviourActionActor"
} ],
BehFindConstructionTile: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "ab7f2jtCA5P1ZhY0xOBUvFG", "BehFindConstructionTile");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
});
Object.defineProperty(i, "__esModule", {
value: !0
});
var r = t("../../behaviour/BehaviourActionBase"), n = function(t) {
a(e, t);
function e() {
var e = t.call(this) || this;
e.id = "BehFindConstructionTile";
e.null_check_building_target = !0;
return e;
}
e.prototype.execute = function(t) {
var e;
t.beh_tile_target = null === (e = t.beh_building_target) || void 0 === e ? void 0 : e.getConstructionTile();
return r.BehResult.Continue;
};
return e;
}(t("./BehaviourActionActor").default);
i.default = n;
cc._RF.pop();
}, {
"../../behaviour/BehaviourActionBase": "BehaviourActionBase",
"./BehaviourActionActor": "BehaviourActionActor"
} ],
BehFindEmptyNearbyCity: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "4b725qxXIpKMJlP23UeKdeo", "BehFindEmptyNearbyCity");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
});
Object.defineProperty(i, "__esModule", {
value: !0
});
var r = t("../../behaviour/BehaviourActionBase"), n = t("../../common/ToolBox"), s = t("../../MapBox"), l = t("./BehaviourActionActor"), c = function(t) {
a(e, t);
function e() {
var e = t.call(this) || this;
e.id = "BehFindEmptyNearbyCity";
return e;
}
e.prototype.execute = function(t) {
var i = e.getEmptyCity(t.currentTile, t.race);
if (i) {
t.becomeCitizen(i);
return r.BehResult.Continue;
}
return r.BehResult.Stop;
};
e.getEmptyCity = function(t, e) {
l.default.temp_cities.clear();
s.default.inst.citiesList.forEach(function(i) {
var o;
i.race == e && i.status && i.status.population <= 40 && (i.status.population <= 5 || 0 != i.status.homesFree) && (null === (o = i.getTile()) || void 0 === o ? void 0 : o.isSameIsland(t)) && l.default.temp_cities.push(i);
});
return n.Toolbox.getRandom(l.default.temp_cities);
};
return e;
}(l.default);
i.default = c;
cc._RF.pop();
}, {
"../../MapBox": "MapBox",
"../../behaviour/BehaviourActionBase": "BehaviourActionBase",
"../../common/ToolBox": "ToolBox",
"./BehaviourActionActor": "BehaviourActionActor"
} ],
BehFindFarmField: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "d0d9flldXxBy5DXLf6GP4fD", "BehFindFarmField");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
}), r = this && this.__values || function(t) {
var e = "function" == typeof Symbol && Symbol.iterator, i = e && t[e], o = 0;
if (i) return i.call(t);
if (t && "number" == typeof t.length) return {
next: function() {
t && o >= t.length && (t = void 0);
return {
value: t && t[o++],
done: !t
};
}
};
throw new TypeError(e ? "Object is not iterable." : "Symbol.iterator is not defined.");
};
Object.defineProperty(i, "__esModule", {
value: !0
});
var n = t("../../behaviour/BehaviourActionBase"), s = t("../../common/ToolBox"), l = t("../../map/tile/TileTypeShortcut"), c = function(t) {
a(e, t);
function e() {
var e = t.call(this) || this;
e.id = "BehFindFarmField";
return e;
}
e.prototype.execute = function(t) {
var e, i, o, a, c, u;
if (!(null === (o = t.data) || void 0 === o ? void 0 : o.alive) || !(null === (a = t.city) || void 0 === a ? void 0 : a.alive) || 0 == (null === (u = null === (c = t.city) || void 0 === c ? void 0 : c.zones) || void 0 === u ? void 0 : u.length)) return n.BehResult.Stop;
t.city.zones.shuffle();
var d = 0, h = 0, p = null, f = 0;
try {
for (var m = r(t.city.zones), y = m.next(); !y.done; y = m.next()) {
var _ = y.value.tileTypes.get(l.default.field);
if (0 != _.length) {
_.forEach(function(e) {
var i;
if (!e.targetedBy && (null === (i = t.currentTile) || void 0 === i ? void 0 : i.isSameIsland(e)) && !e.building) {
d = s.Toolbox.distTile(t.currentTile, e);
if (!p || d < h) {
h = d;
p = e;
}
}
});
if (++f > 3 && p) break;
}
}
} catch (t) {
e = {
error: t
};
} finally {
try {
y && !y.done && (i = m.return) && i.call(m);
} finally {
if (e) throw e.error;
}
}
if (!p) return n.BehResult.Stop;
t.beh_tile_target = p;
return n.BehResult.Continue;
};
return e;
}(t("./BehCity").default);
i.default = c;
cc._RF.pop();
}, {
"../../behaviour/BehaviourActionBase": "BehaviourActionBase",
"../../common/ToolBox": "ToolBox",
"../../map/tile/TileTypeShortcut": "TileTypeShortcut",
"./BehCity": "BehCity"
} ],
BehFindGoldenBrain: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "10fcd4gYZFAooBPSuRvYsys", "BehFindGoldenBrain");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
});
Object.defineProperty(i, "__esModule", {
value: !0
});
var r = t("../../behaviour/BehaviourActionBase"), n = t("../../common/ToolBox"), s = t("../../MapBox"), l = function(t) {
a(e, t);
function e() {
var e = t.call(this) || this;
e.id = "BehFindGoldenBrain";
return e;
}
e.prototype.execute = function(t) {
if (s.default.inst.worldLaws.world_law_peaceful_monsters.boolVal) return r.BehResult.Stop;
var e = null, i = 0, o = 0;
s.default.inst.kingdoms.getKingdomByID("goldenBrain").buildings.forEach(function(a) {
var r;
if (null === (r = a.currentTile) || void 0 === r ? void 0 : r.isSameIsland(t.currentTile)) {
i = n.Toolbox.distTile(a.currentTile, t.currentTile);
if (!e || i < o) {
e = a;
o = i;
}
}
});
if (!e) return r.BehResult.Stop;
t.beh_building_target = e;
e && t.goTo(t.beh_building_target.currentTile);
return r.BehResult.Continue;
};
return e;
}(t("./BehaviourActionActor").default);
i.default = l;
cc._RF.pop();
}, {
"../../MapBox": "MapBox",
"../../behaviour/BehaviourActionBase": "BehaviourActionBase",
"../../common/ToolBox": "ToolBox",
"./BehaviourActionActor": "BehaviourActionActor"
} ],
BehFindMeatSource: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "4642f7XIydLhJr4L18B3MbM", "BehFindMeatSource");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
});
Object.defineProperty(i, "__esModule", {
value: !0
});
var r = t("../../behaviour/BehaviourActionBase"), n = t("../../common/ToolBox"), s = t("../../map/map/MapLayer"), l = t("../../MapBox"), c = t("./BehaviourActionActor"), u = function(t) {
a(e, t);
function e() {
var e = t.call(this) || this;
e.id = "BehFindMeatSource";
return e;
}
e.prototype.execute = function(t) {
if (!t.stats.diet_meat && !t.stats.diet_meat_insect) return r.BehResult.Stop;
if (t.beh_actor_target && this.isTargetOk(t, t.beh_actor_target.a)) return r.BehResult.Continue;
t.beh_actor_target = this.getClosestMeatActor(t);
t.beh_actor_target && t.data.hunger < 20 && (t.beh_actor_target = this.getClosestMeatActor(t, 0, !0));
return t.beh_actor_target ? r.BehResult.Continue : r.BehResult.Stop;
};
e.prototype.getClosestMeatActor = function(t, e, i) {
void 0 === e && (e = 0);
void 0 === i && (i = !1);
c.default.temp_actors.clear();
l.default.inst.getObjectsInChunks(t.currentTile, 10, s.MapObjectType.Actor);
for (var o = 0; o < l.default.inst.temp_map_objects.length; o++) {
var a = l.default.inst.temp_map_objects[o];
if (this.isTargetOk(t, a)) {
if (t.stats.diet_meat) {
if (!a.stats.source_meat) continue;
} else if (t.stats.diet_meat_insect && !a.stats.source_meat_insect) continue;
if (i) {
if (!t.stats.diet_meat_same_race && a.isRace(t)) continue;
} else if (a.isRace(t)) continue;
(e <= 0 || a.data.age >= e) && c.default.temp_actors.push(a);
}
}
return n.Toolbox.getClosestActor(c.default.temp_actors, t.currentTile);
};
e.prototype.isTargetOk = function(t, e) {
var i;
return !(e == t || !t.canAttackTarget(e) || e.stats.actorSize > t.stats.actorSize || null === (i = e.currentTile) || void 0 === i || !i.isSameIsland(t.currentTile));
};
return e;
}(c.default);
i.default = u;
cc._RF.pop();
}, {
"../../MapBox": "MapBox",
"../../behaviour/BehaviourActionBase": "BehaviourActionBase",
"../../common/ToolBox": "ToolBox",
"../../map/map/MapLayer": "MapLayer",
"./BehaviourActionActor": "BehaviourActionActor"
} ],
BehFindRandomCivBuildingTile: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "1690eKlwRZI9LAjG8qcssUY", "BehFindRandomCivBuildingTile");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
});
Object.defineProperty(i, "__esModule", {
value: !0
});
var r = t("../../base/BaseBuilding"), n = t("../../behaviour/BehaviourActionBase"), s = t("../../common/ToolBox"), l = t("../../map/map/MapLayer"), c = t("../../MapBox"), u = function(t) {
a(e, t);
function e() {
var e = t.call(this) || this;
e.id = "BehFindRandomCivBuildingTile";
return e;
}
e.prototype.execute = function(t) {
var e, i = t.currentTile.region;
if (s.Toolbox.randomChance(.65) && i.tiles.length > 0) {
t.beh_tile_target = i.tiles.getRandom();
return n.BehResult.Continue;
}
c.default.inst.getObjectsInChunks(t.currentTile, 0, l.MapObjectType.Building);
var o = null;
c.default.inst.temp_map_objects.shuffle();
for (var a = 0; a < c.default.inst.temp_map_objects.length; a++) {
var u = c.default.inst.temp_map_objects[a];
if ((null === (e = u.currentTile) || void 0 === e ? void 0 : e.isSameIsland(t.currentTile)) && u.stats.cityBuilding && u.data.state == r.BuildingState.CivKingdom) {
o = u;
break;
}
}
if (!o) {
if (i.tiles.length > 0) {
t.beh_tile_target = i.tiles.getRandom();
return n.BehResult.Continue;
}
return n.BehResult.Stop;
}
t.beh_tile_target = o.currentTile.region.tiles.getRandom();
return n.BehResult.Continue;
};
return e;
}(t("./BehaviourActionActor").default);
i.default = u;
cc._RF.pop();
}, {
"../../MapBox": "MapBox",
"../../base/BaseBuilding": "BaseBuilding",
"../../behaviour/BehaviourActionBase": "BehaviourActionBase",
"../../common/ToolBox": "ToolBox",
"../../map/map/MapLayer": "MapLayer",
"./BehaviourActionActor": "BehaviourActionActor"
} ],
BehFindRandomFrontBuildingTile: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "b0676mV0V9Kup6tidmnMN8W", "BehFindRandomFrontBuildingTile");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
});
Object.defineProperty(i, "__esModule", {
value: !0
});
var r = t("../../behaviour/BehaviourActionBase"), n = function(t) {
a(e, t);
function e() {
var e = t.call(this) || this;
e.id = "BehFindRandomFrontBuildingTile";
e.null_check_building_target = !0;
return e;
}
e.prototype.execute = function(t) {
t.beh_tile_target = t.beh_building_target && t.beh_building_target.currentTile;
return r.BehResult.Continue;
};
return e;
}(t("./BehaviourActionActor").default);
i.default = n;
cc._RF.pop();
}, {
"../../behaviour/BehaviourActionBase": "BehaviourActionBase",
"./BehaviourActionActor": "BehaviourActionActor"
} ],
BehFindRandomTile: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "6a360Pp3Q9LTIUYwYppcpib", "BehFindRandomTile");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
});
Object.defineProperty(i, "__esModule", {
value: !0
});
var r = t("../../behaviour/BehaviourActionBase"), n = t("../../common/ToolBox"), s = function(t) {
a(e, t);
function e() {
var e = t.call(this) || this;
e.id = "BehFindRandomTile";
return e;
}
e.prototype.execute = function(t) {
var e = t.currentTile.region;
if (n.Toolbox.randomChance(.65) && e.tiles.length > 0) {
t.beh_tile_target = e.tiles.getRandom();
return r.BehResult.Continue;
}
e.neighbours.length > 0 && n.Toolbox.randomBool() && (e = e.neighbours.getRandom());
if (e.tiles.length > 0) {
t.beh_tile_target = e.tiles.getRandom();
return r.BehResult.Continue;
}
return r.BehResult.Stop;
};
return e;
}(t("./BehaviourActionActor").default);
i.default = s;
cc._RF.pop();
}, {
"../../behaviour/BehaviourActionBase": "BehaviourActionBase",
"../../common/ToolBox": "ToolBox",
"./BehaviourActionActor": "BehaviourActionActor"
} ],
BehFindSameRaceActor: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "de3bcauT6FAko8VAW2UZyrJ", "BehFindSameRaceActor");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
});
Object.defineProperty(i, "__esModule", {
value: !0
});
var r = t("../../behaviour/BehaviourActionBase"), n = function(t) {
a(e, t);
function e() {
var e = t.call(this) || this;
e.id = "BehFindSameRaceActor";
return e;
}
e.prototype.execute = function(t) {
var e = null;
t.currentTile.region.island.actors.shuffle();
t.currentTile.region.island.actors.forEach(function(i) {
var o, a;
i != t && (null === (o = i.data) || void 0 === o ? void 0 : o.alive) && (null === (a = i.currentTile) || void 0 === a ? void 0 : a.isSameIsland(t.currentTile)) && i.isRace(t) && i.data.bornTime <= t.data.bornTime && (e = i);
});
t.beh_actor_target = e;
return t.beh_actor_target ? r.BehResult.Continue : r.BehResult.Stop;
};
return e;
}(t("./BehaviourActionActor").default);
i.default = n;
cc._RF.pop();
}, {
"../../behaviour/BehaviourActionBase": "BehaviourActionBase",
"./BehaviourActionActor": "BehaviourActionActor"
} ],
BehFindTargetForHunter: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "1cc5a2wFfBMloqTIWJgbfXI", "BehFindTargetForHunter");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
});
Object.defineProperty(i, "__esModule", {
value: !0
});
var r = t("../../behaviour/BehaviourActionBase"), n = t("../../common/ToolBox"), s = t("../../map/map/MapLayer"), l = t("../../MapBox"), c = t("./BehaviourActionActor"), u = function(t) {
a(e, t);
function e() {
var e = t.call(this) || this;
e.id = "BehFindTargetForHunter";
return e;
}
e.prototype.execute = function(t) {
if (t.beh_actor_target && this.isTargetOk(t, t.beh_actor_target.a)) return r.BehResult.Continue;
t.beh_actor_target = this.getClosestMeatActor(t, 3);
return t.beh_actor_target ? r.BehResult.Continue : r.BehResult.Stop;
};
e.prototype.getClosestMeatActor = function(t, e, i) {
var o = this;
void 0 === e && (e = 0);
void 0 === i && (i = !1);
c.default.temp_actors.clear();
l.default.inst.getObjectsInChunks(t.currentTile, 10, s.MapObjectType.Actor);
l.default.inst.temp_map_objects.forEach(function(i) {
var a = i;
o.isTargetOk(t, a) && a.stats.source_meat && (e <= 0 || a.data.age >= e) && c.default.temp_actors.push(a);
});
return n.Toolbox.getClosestActor(c.default.temp_actors, t.currentTile);
};
e.prototype.isTargetOk = function(t, e) {
var i;
return e != t && !!t.canAttackTarget(e) && !(null === (i = e.currentTile) || void 0 === i || !i.isSameIsland(t.currentTile));
};
return e;
}(t("./BehCity").default);
i.default = u;
cc._RF.pop();
}, {
"../../MapBox": "MapBox",
"../../behaviour/BehaviourActionBase": "BehaviourActionBase",
"../../common/ToolBox": "ToolBox",
"../../map/map/MapLayer": "MapLayer",
"./BehCity": "BehCity",
"./BehaviourActionActor": "BehaviourActionActor"
} ],
BehFindTileBeach: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "9b9b9G1e7ZP/4gzLNy+PPQi", "BehFindTileBeach");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
}), r = this && this.__values || function(t) {
var e = "function" == typeof Symbol && Symbol.iterator, i = e && t[e], o = 0;
if (i) return i.call(t);
if (t && "number" == typeof t.length) return {
next: function() {
t && o >= t.length && (t = void 0);
return {
value: t && t[o++],
done: !t
};
}
};
throw new TypeError(e ? "Object is not iterable." : "Symbol.iterator is not defined.");
};
Object.defineProperty(i, "__esModule", {
value: !0
});
var n = t("../../behaviour/BehaviourActionBase"), s = t("./BehaviourActionActor"), l = function(t) {
a(e, t);
function e() {
var e = t.call(this) || this;
e.id = "BehFindTileBeach";
return e;
}
e.prototype.execute = function(t) {
var e = this;
s.default.possible_moves.clear();
this.findCornersInRegion(t.currentTile.region);
0 == s.default.possible_moves.length && t.currentTile.region.neighbours.forEach(function(t) {
e.findCornersInRegion(t);
});
if (0 == s.default.possible_moves.length) return n.BehResult.Stop;
t.beh_tile_target = s.default.possible_moves.getRandom();
return n.BehResult.Continue;
};
e.prototype.findCornersInRegion = function(t) {
var e, i;
t.getTileCorners().shuffle();
try {
for (var o = r(t.getTileCorners()), a = o.next(); !a.done; a = o.next()) {
var n = a.value;
if (n.type.water) {
s.default.possible_moves.push(n);
break;
}
}
} catch (t) {
e = {
error: t
};
} finally {
try {
a && !a.done && (i = o.return) && i.call(o);
} finally {
if (e) throw e.error;
}
}
};
return e;
}(s.default);
i.default = l;
cc._RF.pop();
}, {
"../../behaviour/BehaviourActionBase": "BehaviourActionBase",
"./BehaviourActionActor": "BehaviourActionActor"
} ],
BehFindTileForCity: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "a609alpanJGn56iTbO9ke6k", "BehFindTileForCity");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
}), r = this && this.__values || function(t) {
var e = "function" == typeof Symbol && Symbol.iterator, i = e && t[e], o = 0;
if (i) return i.call(t);
if (t && "number" == typeof t.length) return {
next: function() {
t && o >= t.length && (t = void 0);
return {
value: t && t[o++],
done: !t
};
}
};
throw new TypeError(e ? "Object is not iterable." : "Symbol.iterator is not defined.");
};
Object.defineProperty(i, "__esModule", {
value: !0
});
var n = t("../../behaviour/BehaviourActionBase"), s = t("../../common/ToolBox"), l = t("../../MapBox"), c = function(t) {
a(e, t);
function e() {
var e = t.call(this) || this;
e.id = "BehFindTileForCity";
return e;
}
e.prototype.execute = function(t) {
var e, i, o;
if (0 == l.default.inst.cityPlaceFinder.zones.length) return n.BehResult.Stop;
if (l.default.inst.goodForCity(t.currentTile.zone)) return n.BehResult.Continue;
var a = null, c = 1e5, u = 1e5;
l.default.inst.cityPlaceFinder.zones.shuffle();
var d = null;
try {
for (var h = r(l.default.inst.cityPlaceFinder.zones), p = h.next(); !p.done; p = h.next()) {
var f = p.value;
if (f.goodForNewCity && f.tiles[0].isSameIsland(t.currentTile)) {
d = f;
if (!(null === (o = t.kingdom) || void 0 === o ? void 0 : o.capital)) {
t.beh_tile_target = s.Toolbox.getRandom(d.tiles);
return n.BehResult.Continue;
}
if (c > (u = s.Toolbox.distVec3(t.kingdom.capital.cityCenter, f.centerTile.posV3))) {
c = u;
a = f;
}
}
}
} catch (t) {
e = {
error: t
};
} finally {
try {
p && !p.done && (i = h.return) && i.call(h);
} finally {
if (e) throw e.error;
}
}
if (a) {
t.beh_tile_target = s.Toolbox.getRandom(a.tiles);
return n.BehResult.Continue;
}
if (d) {
t.beh_tile_target = s.Toolbox.getRandom(d.tiles);
return n.BehResult.Continue;
}
var m = l.default.inst.islandsCalculator.getRandomIslandGround();
if (!m) return n.BehResult.Stop;
t.beh_tile_target = m.getRandomTile();
return n.BehResult.Continue;
};
return e;
}(t("./BehaviourActionActor").default);
i.default = c;
cc._RF.pop();
}, {
"../../MapBox": "MapBox",
"../../behaviour/BehaviourActionBase": "BehaviourActionBase",
"../../common/ToolBox": "ToolBox",
"./BehaviourActionActor": "BehaviourActionActor"
} ],
BehFindTileForFarm: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "74f60ZNXDpPi4EKfoFcoJsm", "BehFindTileForFarm");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
}), r = this && this.__values || function(t) {
var e = "function" == typeof Symbol && Symbol.iterator, i = e && t[e], o = 0;
if (i) return i.call(t);
if (t && "number" == typeof t.length) return {
next: function() {
t && o >= t.length && (t = void 0);
return {
value: t && t[o++],
done: !t
};
}
};
throw new TypeError(e ? "Object is not iterable." : "Symbol.iterator is not defined.");
};
Object.defineProperty(i, "__esModule", {
value: !0
});
var n = t("../../behaviour/BehaviourActionBase"), s = t("../../map/tile/TileTypeShortcut"), l = t("./BehaviourActionActor"), c = function(t) {
a(e, t);
function e() {
var e = t.call(this) || this;
e.id = "BehFindTileForFarm";
return e;
}
e.prototype.execute = function(t) {
if (t.city.tasks.wheats > 0) return n.BehResult.Stop;
t.city.zones.shuffle();
l.default.possible_moves.clear();
t.city.zones.forEach(function(e) {
var i, o;
try {
for (var a = r(e.canBeFarms), n = a.next(); !n.done; n = a.next()) {
var c = n.value, u = e.tileTypes.get(c);
u.shuffle();
0 != u.length && u.forEach(function(i) {
var o;
!i.targetedBy && (null === (o = t.currentTile) || void 0 === o ? void 0 : o.isSameIsland(i)) && i.zone == e && !i.building && i.isTypeAround(s.default.field) && l.default.possible_moves.push(i);
});
}
} catch (t) {
i = {
error: t
};
} finally {
try {
n && !n.done && (o = a.return) && o.call(a);
} finally {
if (i) throw i.error;
}
}
});
0 == l.default.possible_moves.length && t.city.zones.forEach(function(e) {
e.canBeFarms.forEach(function(i) {
e.tileTypes.get(i).forEach(function(e) {
var i;
!e.building && !e.targetedBy && (null === (i = t.currentTile) || void 0 === i ? void 0 : i.isSameIsland(e)) && l.default.possible_moves.push(e);
});
});
});
if (0 == l.default.possible_moves.length) return n.BehResult.Stop;
t.beh_tile_target = l.default.possible_moves.getRandom();
return n.BehResult.Continue;
};
return e;
}(t("./BehCity").default);
i.default = c;
cc._RF.pop();
}, {
"../../behaviour/BehaviourActionBase": "BehaviourActionBase",
"../../map/tile/TileTypeShortcut": "TileTypeShortcut",
"./BehCity": "BehCity",
"./BehaviourActionActor": "BehaviourActionActor"
} ],
BehFindTileNearbyGroupLeader: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "28ea6sRioRPDLVaRpKwtVIs", "BehFindTileNearbyGroupLeader");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
});
Object.defineProperty(i, "__esModule", {
value: !0
});
var r = t("../../behaviour/BehaviourActionBase"), n = function(t) {
a(e, t);
function e() {
var e = t.call(this) || this;
e.id = "BehFindTileNearbyGroupLeader";
return e;
}
e.prototype.execute = function(t) {
var e;
if (!t.unitGroup) return r.BehResult.Stop;
if (null === (e = t.unitGroup.groupLeader) || void 0 === e ? void 0 : e.currentTile) {
t.beh_tile_target = t.unitGroup.groupLeader.currentTile.region.tiles.getRandom();
return r.BehResult.Continue;
}
return r.BehResult.Stop;
};
return e;
}(t("./BehaviourActionActor").default);
i.default = n;
cc._RF.pop();
}, {
"../../behaviour/BehaviourActionBase": "BehaviourActionBase",
"./BehaviourActionActor": "BehaviourActionActor"
} ],
BehFindTileWhenOnFire: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "382b8W5WfFIxruUvYN8lvGg", "BehFindTileWhenOnFire");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
}), r = this && this.__values || function(t) {
var e = "function" == typeof Symbol && Symbol.iterator, i = e && t[e], o = 0;
if (i) return i.call(t);
if (t && "number" == typeof t.length) return {
next: function() {
t && o >= t.length && (t = void 0);
return {
value: t && t[o++],
done: !t
};
}
};
throw new TypeError(e ? "Object is not iterable." : "Symbol.iterator is not defined.");
};
Object.defineProperty(i, "__esModule", {
value: !0
});
var n = t("../../behaviour/BehaviourActionBase"), s = t("../../map/tile/TileType"), l = function(t) {
a(e, t);
function e() {
var e = t.call(this) || this;
e.id = "BehFindTileWhenOnFire";
return e;
}
e.prototype.execute = function(t) {
var e, i, o = this.findWaterIn(t.currentTile.chunk);
if (!o) try {
for (var a = r(t.currentTile.chunk.neighboursAll), s = a.next(); !s.done; s = a.next()) {
var l = s.value;
if (o = this.findWaterIn(l)) break;
}
} catch (t) {
e = {
error: t
};
} finally {
try {
s && !s.done && (i = a.return) && i.call(a);
} finally {
if (e) throw e.error;
}
}
if (!o) return n.BehResult.Stop;
t.beh_tile_target = o;
return n.BehResult.Continue;
};
e.prototype.findWaterIn = function(t) {
var e, i;
t.tiles.shuffle();
try {
for (var o = r(t.regions), a = o.next(); !a.done; a = o.next()) {
var n = a.value;
if (n.type == s.TileLayerType.Water) return n.tiles.getRandom();
}
} catch (t) {
e = {
error: t
};
} finally {
try {
a && !a.done && (i = o.return) && i.call(o);
} finally {
if (e) throw e.error;
}
}
return null;
};
return e;
}(t("./BehaviourActionActor").default);
i.default = l;
cc._RF.pop();
}, {
"../../behaviour/BehaviourActionBase": "BehaviourActionBase",
"../../map/tile/TileType": "TileType",
"./BehaviourActionActor": "BehaviourActionActor"
} ],
BehFindTile: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "f5191o3++5DBIMJg2X1+giU", "BehFindTile");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
});
Object.defineProperty(i, "__esModule", {
value: !0
});
var r = t("../../behaviour/BehaviourActionBase"), n = t("../../common/ToolBox"), s = t("./BehaviourActionActor"), l = function(t) {
a(e, t);
function e(e) {
var i = t.call(this) || this;
i.type = "";
i.id = "BehFindTile";
i.type = e;
return i;
}
e.prototype.execute = function(t) {
s.default.possible_moves.clear();
if ("new_road" == this.type) {
var e = t.city.getRoadTileToBuild(t);
e && s.default.possible_moves.push(e);
} else this.findInChunks(t);
if (0 == s.default.possible_moves.length) return r.BehResult.Stop;
t.beh_tile_target = n.Toolbox.getRandom(s.default.possible_moves);
return r.BehResult.Continue;
};
e.prototype.findInChunks = function(t) {
var e = this;
n.Toolbox.getAllChunksFromTile(t.currentTile).forEach(function(i) {
i.regions.forEach(function(i) {
for (var o = 0; o < i.tiles.length; o++) {
var a = i.tiles[o];
switch (e.type) {
case "sand":
if (!a.type.sand) continue;
break;

case "water":
if (a.targetedBy || !a.type.water) continue;
break;

case "grass":
if (!a.isSameIsland(t.currentTile) || a.targetedBy || !a.type.grass || a.building) continue;
break;

case "flowers":
if (!a.isSameIsland(t.currentTile) || a.targetedBy || !a.type.flowers || a.building) continue;
break;

default:
if (!a.isSameIsland(t.currentTile)) continue;
}
s.default.possible_moves.push(a);
}
});
});
};
return e;
}(s.default);
i.default = l;
cc._RF.pop();
}, {
"../../behaviour/BehaviourActionBase": "BehaviourActionBase",
"../../common/ToolBox": "ToolBox",
"./BehaviourActionActor": "BehaviourActionActor"
} ],
BehFindWheat: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "f90ealHgSROe6EY0VeH5Br1", "BehFindWheat");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
}), r = this && this.__values || function(t) {
var e = "function" == typeof Symbol && Symbol.iterator, i = e && t[e], o = 0;
if (i) return i.call(t);
if (t && "number" == typeof t.length) return {
next: function() {
t && o >= t.length && (t = void 0);
return {
value: t && t[o++],
done: !t
};
}
};
throw new TypeError(e ? "Object is not iterable." : "Symbol.iterator is not defined.");
};
Object.defineProperty(i, "__esModule", {
value: !0
});
var n = t("../../behaviour/BehaviourActionBase"), s = t("../../common/ToolBox"), l = t("../../map/tile/TileTypeShortcut"), c = function(t) {
a(e, t);
function e() {
var e = t.call(this) || this;
e.id = "BehFindWheat";
return e;
}
e.prototype.execute = function(t) {
var e, i;
t.city.zones.shuffle();
var o = 0, a = 0, c = null, u = 0;
try {
for (var d = r(t.city.zones), h = d.next(); !h.done; h = d.next()) {
var p = h.value.tileTypes.get(l.default.field);
if (0 != p.length) {
o = 0;
a = 0;
c = null;
p.forEach(function(e) {
if (e.building && e.building.stats.canBeHarvested && e.isSameIsland(t.currentTile) && !e.targetedBy) {
o = s.Toolbox.distTile(t.currentTile, e);
if (!c || o < a) {
a = o;
c = e;
}
}
});
if (++u > 3 && c) break;
}
}
} catch (t) {
e = {
error: t
};
} finally {
try {
h && !h.done && (i = d.return) && i.call(d);
} finally {
if (e) throw e.error;
}
}
if (!c) return n.BehResult.Stop;
t.beh_tile_target = c;
t.beh_building_target = t.beh_tile_target.building;
return n.BehResult.Continue;
};
return e;
}(t("./BehCity").default);
i.default = c;
cc._RF.pop();
}, {
"../../behaviour/BehaviourActionBase": "BehaviourActionBase",
"../../common/ToolBox": "ToolBox",
"../../map/tile/TileTypeShortcut": "TileTypeShortcut",
"./BehCity": "BehCity"
} ],
BehGetResourcesFromMine: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "090afY9iqZA6rbRNa4t+ilj", "BehGetResourcesFromMine");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
});
Object.defineProperty(i, "__esModule", {
value: !0
});
var r = t("../../assetLibrary/AssetManager"), n = t("../../behaviour/BehaviourActionBase"), s = function(t) {
a(e, t);
function e() {
var e = t.call(this) || this;
e.special_inside_object = !0;
return e;
}
e.prototype.execute = function(t) {
var e = r.default.resources.poolMine.getRandom();
t.haveTrait("miner") && "stone" == e.id && (e = r.default.resources.poolMine.getRandom());
t.inventory.add(e.id, 1);
return n.BehResult.Continue;
};
return e;
}(t("./BehaviourActionActor").default);
i.default = s;
cc._RF.pop();
}, {
"../../assetLibrary/AssetManager": "AssetManager",
"../../behaviour/BehaviourActionBase": "BehaviourActionBase",
"./BehaviourActionActor": "BehaviourActionActor"
} ],
BehGoOrSwimToTileTarget: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "986a6I9uKFBjJNA1eI2mQs4", "BehGoOrSwimToTileTarget");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
});
Object.defineProperty(i, "__esModule", {
value: !0
});
var r = function(t) {
a(e, t);
function e() {
var e = t.call(this) || this;
e.id = "BehGoOrSwimToTileTarget";
e.walkOnWater = !0;
return e;
}
return e;
}(t("./BehGoToTileTarget").default);
i.default = r;
cc._RF.pop();
}, {
"./BehGoToTileTarget": "BehGoToTileTarget"
} ],
BehGoToActorTarget: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "c6357ouwRtPEKUpH6rkSpJg", "BehGoToActorTarget");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
});
Object.defineProperty(i, "__esModule", {
value: !0
});
var r = t("../../actors/ActorMove"), n = t("../../behaviour/BehaviourActionBase"), s = function(t) {
a(e, t);
function e(e, i) {
void 0 === e && (e = "sameTile");
void 0 === i && (i = !1);
var o = t.call(this) || this;
o.type = "";
o.pathOnWater = !1;
o.pathOnWater = i;
o.type = e;
o.id = "BehGoToActorTarget";
o.null_check_actor_target = !0;
return o;
}
e.prototype.execute = function(t) {
var e = t.beh_actor_target.currentTile, i = this.type;
"sameTile" != i ? "sameRegion" == i && (e = t.beh_actor_target.currentTile.region.tiles.getRandom()) : e = t.beh_actor_target.currentTile;
if (t.goTo(e, this.pathOnWater) == r.ExecuteEvent.True) return n.BehResult.Continue;
t.targetsToIgnore.has(t.beh_actor_target) || t.targetsToIgnore.add(t.beh_actor_target);
return n.BehResult.Stop;
};
return e;
}(t("./BehaviourActionActor").default);
i.default = s;
cc._RF.pop();
}, {
"../../actors/ActorMove": "ActorMove",
"../../behaviour/BehaviourActionBase": "BehaviourActionBase",
"./BehaviourActionActor": "BehaviourActionActor"
} ],
BehGoToBuildingTarget: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "3c702/TjkRO64qFx/pxNg52", "BehGoToBuildingTarget");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
});
Object.defineProperty(i, "__esModule", {
value: !0
});
var r = t("../../behaviour/BehaviourActionBase"), n = function(t) {
a(e, t);
function e(e) {
void 0 === e && (e = !1);
var i = t.call(this) || this;
i.pathOnWater = !1;
i.id = "BehGoToBuildingTarget";
i.pathOnWater = e;
i.null_check_building_target = !0;
return i;
}
e.prototype.execute = function(t) {
this.goToBuilding(t);
return r.BehResult.Continue;
};
e.prototype.goToBuilding = function(t) {
var e, i = null === (e = t.beh_building_target) || void 0 === e ? void 0 : e.currentTile;
i ? t.goTo(i, this.pathOnWater) : t.clearBeh();
};
return e;
}(t("./BehaviourActionActor").default);
i.default = n;
cc._RF.pop();
}, {
"../../behaviour/BehaviourActionBase": "BehaviourActionBase",
"./BehaviourActionActor": "BehaviourActionActor"
} ],
BehGoToTileTarget: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "2aac513iglDsY1GeRXX2sG0", "BehGoToTileTarget");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
});
Object.defineProperty(i, "__esModule", {
value: !0
});
var r = t("../../actors/ActorMove"), n = t("../../behaviour/BehaviourActionBase"), s = function(t) {
a(e, t);
function e(e, i) {
void 0 === e && (e = !1);
void 0 === i && (i = !1);
var o = t.call(this) || this;
o.walkOnWater = !1;
o.walkOnBlocks = !1;
o.id = "BehGoToTileTarget";
o.walkOnWater = e;
o.walkOnBlocks = i;
o.null_check_tile_target = !0;
return o;
}
e.prototype.execute = function(t) {
return t.beh_tile_target && t.goTo(t.beh_tile_target, this.walkOnWater, this.walkOnBlocks) == r.ExecuteEvent.False ? n.BehResult.Stop : n.BehResult.Continue;
};
return e;
}(t("./BehaviourActionActor").default);
i.default = s;
cc._RF.pop();
}, {
"../../actors/ActorMove": "ActorMove",
"../../behaviour/BehaviourActionBase": "BehaviourActionBase",
"./BehaviourActionActor": "BehaviourActionActor"
} ],
BehHeal: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "bb8e7pUBkRMsIUsE8aJXRbV", "BehHeal");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
});
Object.defineProperty(i, "__esModule", {
value: !0
});
var r = t("../../assetLibrary/AssetManager"), n = t("../../behaviour/BehaviourActionBase"), s = function(t) {
a(e, t);
function e() {
var e = t.call(this) || this;
e.id = "BehHeal";
return e;
}
e.prototype.execute = function(t) {
if (t.data.health == t.curStats.health) return n.BehResult.Stop;
r.default.spells.get("bloodRain").action.do(t, t.currentTile);
t.doCastAnimation();
return n.BehResult.Continue;
};
return e;
}(t("./BehaviourActionActor").default);
i.default = s;
cc._RF.pop();
}, {
"../../assetLibrary/AssetManager": "AssetManager",
"../../behaviour/BehaviourActionBase": "BehaviourActionBase",
"./BehaviourActionActor": "BehaviourActionActor"
} ],
BehJoinCity: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "17bc4+x/8JJz6CWehUmRlq6", "BehJoinCity");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
});
Object.defineProperty(i, "__esModule", {
value: !0
});
var r = t("../../behaviour/BehaviourActionBase"), n = function(t) {
a(e, t);
function e() {
var e = t.call(this) || this;
e.id = "BehJoinCity";
return e;
}
e.prototype.execute = function(t) {
var e = t.currentTile.zone.city;
if (!e) return r.BehResult.Stop;
if (e == t.city) return r.BehResult.Stop;
if (e.kingdom == t.kingdom || t.kingdom.isNomads() && t.race == e.race) {
var i = null;
if (t.city) {
i = t.city;
t.city.removeCitizen(t);
t.removeFromCity();
}
t.becomeCitizen(e);
i && i.checkSettleTarget();
return r.BehResult.Continue;
}
return r.BehResult.Stop;
};
return e;
}(t("./BehaviourActionActor").default);
i.default = n;
cc._RF.pop();
}, {
"../../behaviour/BehaviourActionBase": "BehaviourActionBase",
"./BehaviourActionActor": "BehaviourActionActor"
} ],
BehJumpingAnimation: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "92543pr5KRBKpvfZv9dT1Yt", "BehJumpingAnimation");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
});
Object.defineProperty(i, "__esModule", {
value: !0
});
var r = t("../../behaviour/BehaviourActionBase"), n = function(t) {
a(e, t);
function e(e) {
var i = t.call(this) || this;
i.timer_action = 0;
i.id = "BehJumpingAnimation";
i.timer_action = e;
i.null_check_tile_target = !0;
return i;
}
e.prototype.execute = function(t) {
t.timer_jump_animation = this.timer_action;
t.timer_action = this.timer_action;
return r.BehResult.Continue;
};
return e;
}(t("./BehaviourActionActor").default);
i.default = n;
cc._RF.pop();
}, {
"../../behaviour/BehaviourActionBase": "BehaviourActionBase",
"./BehaviourActionActor": "BehaviourActionActor"
} ],
BehLookAtTarget: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "fd8008J12BB05fFKNC/8Y/r", "BehLookAtTarget");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
});
Object.defineProperty(i, "__esModule", {
value: !0
});
var r = t("../../behaviour/BehaviourActionBase"), n = function(t) {
a(e, t);
function e(e) {
var i = t.call(this) || this;
i.type = "";
i.id = "BehLookAtTarget";
i.type = e;
i.null_check_building_target = !0;
return i;
}
e.prototype.execute = function(t) {
var e, i;
(null === (e = t.beh_building_target) || void 0 === e ? void 0 : e.currentTile) || t.clearBeh();
"building_target" == this.type && t.stats.flipAnimation && (null === (i = t.beh_building_target) || void 0 === i ? void 0 : i.currentTile) && (t.node.x < t.beh_building_target.currentTile.x ? t.setFlip(!0) : t.setFlip(!1));
t.timer_action = .3;
return r.BehResult.Continue;
};
return e;
}(t("./BehaviourActionActor").default);
i.default = n;
cc._RF.pop();
}, {
"../../behaviour/BehaviourActionBase": "BehaviourActionBase",
"./BehaviourActionActor": "BehaviourActionActor"
} ],
BehMagicMakeSkeleton: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "1e50esVV79OEJBIlmOe0emB", "BehMagicMakeSkeleton");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
});
Object.defineProperty(i, "__esModule", {
value: !0
});
var r = t("../../behaviour/BehaviourActionBase"), n = t("../../common/ToolBox"), s = t("../../MapBox"), l = function(t) {
a(e, t);
function e() {
var e = t.call(this) || this;
e.id = "BehMagicMakeSkeleton";
return e;
}
e.prototype.execute = function(t) {
var e, i;
n.Toolbox.findSameUnitInChunkAround(t.currentTile.chunk, "skeleton");
if (n.Toolbox.temp_list_units.length > 6) return r.BehResult.Stop;
var o = null === (i = null === (e = t.currentTile) || void 0 === e ? void 0 : e.region) || void 0 === i ? void 0 : i.tiles.getRandom();
if (!o) return r.BehResult.Stop;
if (o.units.length > 0) return r.BehResult.Stop;
var a = s.default.inst.stackEffects.get("fx_create_skeleton").spawnAt(o.posV3, t.stats.baseStats.scale);
t.doCastAnimation();
a.setCallback(19, function() {
s.default.inst.createNewUnit("skeleton", o).makeWait(1);
});
return r.BehResult.Continue;
};
return e;
}(t("./BehaviourActionActor").default);
i.default = l;
cc._RF.pop();
}, {
"../../MapBox": "MapBox",
"../../behaviour/BehaviourActionBase": "BehaviourActionBase",
"../../common/ToolBox": "ToolBox",
"./BehaviourActionActor": "BehaviourActionActor"
} ],
BehMakeBaby: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "a64f8FzpbpKfqso301WNQ5r", "BehMakeBaby");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
}), r = this && this.__values || function(t) {
var e = "function" == typeof Symbol && Symbol.iterator, i = e && t[e], o = 0;
if (i) return i.call(t);
if (t && "number" == typeof t.length) return {
next: function() {
t && o >= t.length && (t = void 0);
return {
value: t && t[o++],
done: !t
};
}
};
throw new TypeError(e ? "Object is not iterable." : "Symbol.iterator is not defined.");
};
Object.defineProperty(i, "__esModule", {
value: !0
});
var n = t("../../../../common/src/data/AchievData"), s = t("../../behaviour/BehaviourActionBase"), l = t("../../MapBox"), c = function(t) {
a(e, t);
function e() {
var e = t.call(this) || this;
e.id = "BehMakeBaby";
e.null_check_actor_target = !0;
return e;
}
e.prototype.execute = function(t) {
t.beh_actor_target ? this.makeBaby(t, t.beh_actor_target.a) : t.clearBeh();
return s.BehResult.Continue;
};
e.prototype.makeBaby = function(t, e) {
var i, o;
if (!l.default.inst.reachCreatureMaxLimit()) {
t.startBabymakingTimeout();
e.startBabymakingTimeout();
t.data.children++;
e.data.children++;
var a = null;
try {
for (var s = r(t.currentTile.neighbours), c = s.next(); !c.done; c = s.next()) {
var u = c.value;
if (u != t.currentTile && u != t.currentTile && !u.type.liquid) {
a = u;
break;
}
}
} catch (t) {
i = {
error: t
};
} finally {
try {
c && !c.done && (o = s.return) && o.call(s);
} finally {
if (i) throw i.error;
}
}
a || (a = t.currentTile);
var d = l.default.inst.createNewUnit(t.stats.id, a, null, 6);
d.justBorn();
d.data.hunger = d.stats.maxHunger / 2;
l.default.inst.gameStats.creaturesBorn++;
if (d.stats.animal) {
n.default.update(9);
n.default.update(68);
}
}
};
return e;
}(t("./BehaviourActionActor").default);
i.default = c;
cc._RF.pop();
}, {
"../../../../common/src/data/AchievData": void 0,
"../../MapBox": "MapBox",
"../../behaviour/BehaviourActionBase": "BehaviourActionBase",
"./BehaviourActionActor": "BehaviourActionActor"
} ],
BehMakeFarm: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "d55f2axbYdOaYdqVm0Ywi0o", "BehMakeFarm");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
});
Object.defineProperty(i, "__esModule", {
value: !0
});
var r = t("../../../../common/src/data/AchievData"), n = t("../../assetLibrary/AssetManager"), s = t("../../behaviour/BehaviourActionBase"), l = t("../../map/tile/TileTypeShortcut"), c = t("../../MapBox"), u = function(t) {
a(e, t);
function e() {
var e = t.call(this) || this;
e.id = "BehMakeFarm";
e.null_check_tile_target = !0;
return e;
}
e.prototype.execute = function(t) {
if (t.beh_tile_target.type.canBeFarmField && !t.beh_tile_target.building) {
r.default.update(5);
c.default.inst.terraformTile2(t.beh_tile_target, l.default.field, n.default.terraform.get("flash"));
return s.BehResult.Continue;
}
return s.BehResult.Stop;
};
return e;
}(t("./BehCity").default);
i.default = u;
cc._RF.pop();
}, {
"../../../../common/src/data/AchievData": void 0,
"../../MapBox": "MapBox",
"../../assetLibrary/AssetManager": "AssetManager",
"../../behaviour/BehaviourActionBase": "BehaviourActionBase",
"../../map/tile/TileTypeShortcut": "TileTypeShortcut",
"./BehCity": "BehCity"
} ],
BehMakeItem: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "f881cF6oflBoagCj1l28S+I", "BehMakeItem");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
});
Object.defineProperty(i, "__esModule", {
value: !0
});
var r = t("../../behaviour/BehaviourActionBase"), n = function(t) {
a(e, t);
function e() {
var e = t.call(this) || this;
e.id = "BehMakeItem";
e.special_inside_object = !0;
return e;
}
e.prototype.execute = function(t) {
t.city.tryProduceItem(t);
return r.BehResult.Continue;
};
return e;
}(t("./BehCity").default);
i.default = n;
cc._RF.pop();
}, {
"../../behaviour/BehaviourActionBase": "BehaviourActionBase",
"./BehCity": "BehCity"
} ],
BehMoveAwayFromBlock: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "3563b0DktVFQ6M3nVXgRjwJ", "BehMoveAwayFromBlock");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
}), r = this && this.__values || function(t) {
var e = "function" == typeof Symbol && Symbol.iterator, i = e && t[e], o = 0;
if (i) return i.call(t);
if (t && "number" == typeof t.length) return {
next: function() {
t && o >= t.length && (t = void 0);
return {
value: t && t[o++],
done: !t
};
}
};
throw new TypeError(e ? "Object is not iterable." : "Symbol.iterator is not defined.");
};
Object.defineProperty(i, "__esModule", {
value: !0
});
var n = t("../../behaviour/BehaviourActionBase"), s = t("../../common/ToolBox"), l = t("../../map/tile/TileType"), c = function(t) {
a(e, t);
function e() {
var e = t.call(this) || this;
e.id = "BehMoveAwayFromBlock";
return e;
}
e.prototype.execute = function(t) {
var i, o;
if (t.currentTile.region.island.type != l.TileLayerType.Block) return n.BehResult.Stop;
var a = null, c = 0, u = 0, d = t.currentTile.region.island;
try {
for (var h = r(d.regionsCorners), p = h.next(); !p.done; p = h.next()) {
var f = p.value;
0 != f.getTileCorners().length && f.getTileCorners().forEach(function(i) {
if (e.isGoodTileRegion(i.region, t) && i.region.island != d && i.region.island.getTileCount() >= 5) {
c = s.Toolbox.distTile(t.currentTile, i);
if (!a || c < u) {
a = i;
u = c;
}
}
});
}
} catch (t) {
i = {
error: t
};
} finally {
try {
p && !p.done && (o = h.return) && o.call(h);
} finally {
if (i) throw i.error;
}
}
if (a) {
t.beh_tile_target = a;
return n.BehResult.Continue;
}
return n.BehResult.Stop;
};
e.isGoodTileRegion = function(t, e) {
return !(t.type == l.TileLayerType.Water && e.stats.dieInWater || t.type == l.TileLayerType.Lava && e.stats.dieInLava);
};
return e;
}(t("./BehaviourActionActor").default);
i.default = c;
cc._RF.pop();
}, {
"../../behaviour/BehaviourActionBase": "BehaviourActionBase",
"../../common/ToolBox": "ToolBox",
"../../map/tile/TileType": "TileType",
"./BehaviourActionActor": "BehaviourActionActor"
} ],
BehPlantCrops: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "3339bC5CZJBuL1MPZ/X4kf8", "BehPlantCrops");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
});
Object.defineProperty(i, "__esModule", {
value: !0
});
var r = t("../../behaviour/BehaviourActionBase"), n = t("../../map/tile/TileTypeShortcut"), s = t("../../MapBox"), l = function(t) {
a(e, t);
function e() {
var e = t.call(this) || this;
e.id = "BehPlantCrops";
e.null_check_tile_target = !0;
return e;
}
e.prototype.execute = function(t) {
if (t.beh_tile_target.type == n.default.field && !t.beh_tile_target.building) {
s.default.inst.addBuilding("0wheat", t.beh_tile_target);
return r.BehResult.Continue;
}
return r.BehResult.Stop;
};
return e;
}(t("./BehCity").default);
i.default = l;
cc._RF.pop();
}, {
"../../MapBox": "MapBox",
"../../behaviour/BehaviourActionBase": "BehaviourActionBase",
"../../map/tile/TileTypeShortcut": "TileTypeShortcut",
"./BehCity": "BehCity"
} ],
BehRandomSwim: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "37262m7zOxOsLzscCihDtlS", "BehRandomSwim");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
});
Object.defineProperty(i, "__esModule", {
value: !0
});
var r = t("../../behaviour/BehaviourActionBase"), n = t("../../common/ToolBox"), s = t("./BehaviourActionActor"), l = function(t) {
a(e, t);
function e() {
var e = t.call(this) || this;
e.id = "BehRandomSwim";
return e;
}
e.prototype.execute = function(t) {
s.default.possible_moves.clear();
t.currentTile.neighboursAll.forEach(function(t) {
t.type.liquid && s.default.possible_moves.push(t);
});
s.default.possible_moves.length > 0 && t.moveTo(n.Toolbox.getRandom(s.default.possible_moves));
return r.BehResult.Continue;
};
return e;
}(s.default);
i.default = l;
cc._RF.pop();
}, {
"../../behaviour/BehaviourActionBase": "BehaviourActionBase",
"../../common/ToolBox": "ToolBox",
"./BehaviourActionActor": "BehaviourActionActor"
} ],
BehRandomTeleport: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "73997e14zJENo5BxLZ/DQHE", "BehRandomTeleport");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
});
Object.defineProperty(i, "__esModule", {
value: !0
});
var r = t("../../assetLibrary/AssetManager"), n = t("../../behaviour/BehaviourActionBase"), s = t("../../common/ToolBox"), l = function(t) {
a(e, t);
function e() {
var e = t.call(this) || this;
e.id = "BehRandomTeleport";
return e;
}
e.prototype.execute = function(t) {
if (t.data.health < t.curStats.health) return n.BehResult.Stop;
if (!s.Toolbox.randomChance(.3)) return n.BehResult.Stop;
if (r.default.spells.get("teleportRandom").action.do(t, t.currentTile)) {
t.doCastAnimation();
return n.BehResult.Continue;
}
return n.BehResult.Stop;
};
return e;
}(t("./BehaviourActionActor").default);
i.default = l;
cc._RF.pop();
}, {
"../../assetLibrary/AssetManager": "AssetManager",
"../../behaviour/BehaviourActionBase": "BehaviourActionBase",
"../../common/ToolBox": "ToolBox",
"./BehaviourActionActor": "BehaviourActionActor"
} ],
BehRandomWait: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "16385tOZ/5JX49xnPrDldZk", "BehRandomWait");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
});
Object.defineProperty(i, "__esModule", {
value: !0
});
var r = t("../../behaviour/BehaviourActionBase"), n = t("../../common/ToolBox"), s = function(t) {
a(e, t);
function e(e, i) {
void 0 === e && (e = 0);
void 0 === i && (i = 1);
var o = t.call(this) || this;
o.min = 0;
o.max = 0;
o.min = e;
o.max = i;
o.id = "BehRandomWait";
return o;
}
e.prototype.execute = function(t) {
t.timer_action = n.Toolbox.randomFloat(this.min, this.max);
return r.BehResult.Continue;
};
return e;
}(t("./BehaviourActionActor").default);
i.default = s;
cc._RF.pop();
}, {
"../../behaviour/BehaviourActionBase": "BehaviourActionBase",
"../../common/ToolBox": "ToolBox",
"./BehaviourActionActor": "BehaviourActionActor"
} ],
BehRemoveRuins: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "34b42WeZRlNm7tgElMO8Zcv", "BehRemoveRuins");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
});
Object.defineProperty(i, "__esModule", {
value: !0
});
var r = t("../../behaviour/BehaviourActionBase"), n = function(t) {
a(e, t);
function e() {
var e = t.call(this) || this;
e.id = "BehRemoveRuins";
e.null_check_building_target = !0;
return e;
}
e.prototype.execute = function(t) {
t.beh_building_target.startRemove();
return r.BehResult.Continue;
};
return e;
}(t("./BehaviourActionActor").default);
i.default = n;
cc._RF.pop();
}, {
"../../behaviour/BehaviourActionBase": "BehaviourActionBase",
"./BehaviourActionActor": "BehaviourActionActor"
} ],
BehRepairInDock: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "0a4a39EjbdLvpXk+Shxw7ca", "BehRepairInDock");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
});
Object.defineProperty(i, "__esModule", {
value: !0
});
var r = t("../../behaviour/BehaviourActionBase"), n = function(t) {
a(e, t);
function e() {
var e = t.call(this) || this;
e.id = "BehRepairInDock";
e.special_inside_object = !0;
e.check_building_target_non_usable = !0;
e.null_check_building_target = !0;
return e;
}
e.prototype.execute = function(t) {
if (t.curStats.health <= t.data.health) return r.BehResult.Continue;
var e = t.curStats.health - t.data.health;
e = e > 100 ? 100 : e;
t.restoreHealth(e);
var i = e / 25;
t.timer_action = Math.ceil(i);
t.stayInBuilding(t.beh_building_target);
t.beh_tile_target = null;
t.beh_building_target.startShake(.5);
return t.curStats.health > t.data.health ? r.BehResult.RepeatStep : r.BehResult.Continue;
};
return e;
}(t("./BehCity").default);
i.default = n;
cc._RF.pop();
}, {
"../../behaviour/BehaviourActionBase": "BehaviourActionBase",
"./BehCity": "BehCity"
} ],
BehReplenishHunger: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "32b37h0uEFHN5B+u27bFkrO", "BehReplenishHunger");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
});
Object.defineProperty(i, "__esModule", {
value: !0
});
var r = t("../../behaviour/BehaviourActionBase"), n = function(t) {
a(e, t);
function e() {
var e = t.call(this) || this;
e.id = "BehReplenishHunger";
return e;
}
e.prototype.execute = function(t) {
t.restoreStatsFromEating(t.stats.maxHunger);
return r.BehResult.Continue;
};
return e;
}(t("./BehaviourActionActor").default);
i.default = n;
cc._RF.pop();
}, {
"../../behaviour/BehaviourActionBase": "BehaviourActionBase",
"./BehaviourActionActor": "BehaviourActionActor"
} ],
BehResourceGatheringAnimation: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "c6919npmEZAr64z+8H7nh0T", "BehResourceGatheringAnimation");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
});
Object.defineProperty(i, "__esModule", {
value: !0
});
var r = t("../../behaviour/BehaviourActionBase"), n = t("../../MapBox"), s = function(t) {
a(e, t);
function e(e) {
var i = t.call(this) || this;
i.timer_action = 0;
i.id = "BehResourceGatheringAnimation";
i.timer_action = e;
i.null_check_building_target = !0;
i.check_building_target_non_usable = !0;
return i;
}
e.prototype.execute = function(t) {
if ("fruits" == t.beh_building_target.stats.type && !t.beh_building_target.haveResources) return r.BehResult.Stop;
t.beh_building_target.getConstructionTile();
t.punchTargetAnimation(t.beh_building_target.currentTile.posV3, t.beh_building_target.currentTile);
t.beh_building_target.resourceGathering(n.default.inst.elapsed);
t.timer_action = this.timer_action;
return r.BehResult.Continue;
};
return e;
}(t("./BehaviourActionActor").default);
i.default = s;
cc._RF.pop();
}, {
"../../MapBox": "MapBox",
"../../behaviour/BehaviourActionBase": "BehaviourActionBase",
"./BehaviourActionActor": "BehaviourActionActor"
} ],
BehRestartTask: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "a04e38Yu/RPH5u+Wl7Tz+ic", "BehRestartTask");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
});
Object.defineProperty(i, "__esModule", {
value: !0
});
var r = t("../../behaviour/BehaviourActionBase"), n = function(t) {
a(e, t);
function e() {
var e = t.call(this) || this;
e.id = "BehRestartTask";
return e;
}
e.prototype.execute = function() {
return r.BehResult.RestartTask;
};
return e;
}(t("./BehCity").default);
i.default = n;
cc._RF.pop();
}, {
"../../behaviour/BehaviourActionBase": "BehaviourActionBase",
"./BehCity": "BehCity"
} ],
BehSetNextTask: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "101f2820JBI257b48pydivo", "BehSetNextTask");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
});
Object.defineProperty(i, "__esModule", {
value: !0
});
var r = function(t) {
a(e, t);
function e(e, i) {
void 0 === i && (i = !0);
var o = t.call(this) || this;
o.clean = !1;
o.task_id = "";
o.id = "BehSetNextTask";
o.task_id = e;
o.clean = i;
return o;
}
e.prototype.execute = function(t) {
return this.forceTask(t, this.task_id, this.clean);
};
return e;
}(t("./BehaviourActionActor").default);
i.default = r;
cc._RF.pop();
}, {
"./BehaviourActionActor": "BehaviourActionActor"
} ],
BehShortRandomMove: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "c7e4bvkVApGlKOYIfAG1QkG", "BehShortRandomMove");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
}), r = this && this.__values || function(t) {
var e = "function" == typeof Symbol && Symbol.iterator, i = e && t[e], o = 0;
if (i) return i.call(t);
if (t && "number" == typeof t.length) return {
next: function() {
t && o >= t.length && (t = void 0);
return {
value: t && t[o++],
done: !t
};
}
};
throw new TypeError(e ? "Object is not iterable." : "Symbol.iterator is not defined.");
};
Object.defineProperty(i, "__esModule", {
value: !0
});
var n = t("../../behaviour/BehaviourActionBase"), s = function(t) {
a(e, t);
function e() {
var e = t.call(this) || this;
e.id = "BehShortRandomMove";
return e;
}
e.prototype.execute = function(t) {
var e, i, o = null;
t.currentTile.neighboursAll.shuffle();
try {
for (var a = r(t.currentTile.neighboursAll), s = a.next(); !s.done; s = a.next()) {
var l = s.value;
if (l.type.layerType == t.currentTile.type.layerType) {
o = l;
break;
}
}
} catch (t) {
e = {
error: t
};
} finally {
try {
s && !s.done && (i = a.return) && i.call(a);
} finally {
if (e) throw e.error;
}
}
if (!o) return n.BehResult.Stop;
t.beh_tile_target = o;
return n.BehResult.Continue;
};
return e;
}(t("./BehaviourActionActor").default);
i.default = s;
cc._RF.pop();
}, {
"../../behaviour/BehaviourActionBase": "BehaviourActionBase",
"./BehaviourActionActor": "BehaviourActionActor"
} ],
BehSitInsideBoat: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "40e6am3RolFYpPtrF5BCpwp", "BehSitInsideBoat");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
});
Object.defineProperty(i, "__esModule", {
value: !0
});
var r = function(t) {
a(e, t);
function e() {
var e = t.call(this) || this;
e.id = "BehSitInsideBoat";
e.special_inside_object = !0;
return e;
}
return e;
}(t("./BehaviourActionActor").default);
i.default = r;
cc._RF.pop();
}, {
"./BehaviourActionActor": "BehaviourActionActor"
} ],
BehSkeletonFindTile: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "d5d5fuGwn5APYwLXnE3QOXy", "BehSkeletonFindTile");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
});
Object.defineProperty(i, "__esModule", {
value: !0
});
var r = t("../../behaviour/BehaviourActionBase"), n = t("../../common/ToolBox"), s = function(t) {
a(e, t);
function e() {
var e = t.call(this) || this;
e.id = "BehSkeletonFindTile";
return e;
}
e.prototype.execute = function(t) {
n.Toolbox.findSameUnitInChunkAround(t.currentTile.chunk, "necromancer");
if (0 != n.Toolbox.temp_list_units.length) {
var e = n.Toolbox.temp_list_units.getRandom();
t.beh_tile_target = e.currentTile.region.tiles.getRandom();
return r.BehResult.Continue;
}
var i = t.currentTile.region;
i.neighbours.length > 0 && n.Toolbox.randomBool() && (i = i.neighbours.getRandom());
if (i.tiles.length > 0) {
t.beh_tile_target = i.tiles.getRandom();
return r.BehResult.Continue;
}
return r.BehResult.Stop;
};
return e;
}(t("./BehaviourActionActor").default);
i.default = s;
cc._RF.pop();
}, {
"../../behaviour/BehaviourActionBase": "BehaviourActionBase",
"../../common/ToolBox": "ToolBox",
"./BehaviourActionActor": "BehaviourActionActor"
} ],
BehSpawnSeeds: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "38788j0YrRFmI9RDDKOyL2c", "BehSpawnSeeds");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
});
Object.defineProperty(i, "__esModule", {
value: !0
});
var r = t("../../assetLibrary/AssetManager"), n = t("../../behaviour/BehaviourActionBase"), s = t("../../common/ToolBox"), l = function(t) {
a(e, t);
function e() {
var e = t.call(this) || this;
e.id = "BehSpawnSeeds";
return e;
}
e.prototype.execute = function(t) {
if (!s.Toolbox.randomChance(.3)) return n.BehResult.Stop;
if (!t.currentTile.type.ground) return n.BehResult.Stop;
var i = r.default.spells.get("spawnSeeds");
e._tiles.clear();
t.currentTile.region.tiles.forEach(function(t) {
(t.type.grass || t.type.canGrowGreens || t.type.canGrowFlowers) && e._tiles.push(t);
});
if (0 == e._tiles.length) return n.BehResult.Stop;
i.action.do(t, e._tiles.getRandom());
t.doCastAnimation();
return n.BehResult.Continue;
};
e._tiles = [];
return e;
}(t("./BehaviourActionActor").default);
i.default = l;
cc._RF.pop();
}, {
"../../assetLibrary/AssetManager": "AssetManager",
"../../behaviour/BehaviourActionBase": "BehaviourActionBase",
"../../common/ToolBox": "ToolBox",
"./BehaviourActionActor": "BehaviourActionActor"
} ],
BehSpecialRat: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "204f8h7wF5G9brtrMSarDac", "BehSpecialRat");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
});
Object.defineProperty(i, "__esModule", {
value: !0
});
var r = t("../../behaviour/BehaviourActionBase"), n = t("../../common/ToolBox"), s = t("../../map/map/MapLayer"), l = t("../../MapBox"), c = function(t) {
a(e, t);
function e() {
var e = t.call(this) || this;
e.id = "BehSpecialRat";
return e;
}
e.prototype.execute = function(t) {
if (t.haveTrait("rat") && n.Toolbox.randomChance(.7)) {
var e = this.findNearbyRatKingTile(t);
if (e) {
t.beh_tile_target = e;
return r.BehResult.Continue;
}
}
var i = t.currentTile.region;
i.neighbours.length > 0 && n.Toolbox.randomBool() && (i = i.neighbours.getRandom());
if (i.tiles.length > 0) {
t.beh_tile_target = i.tiles.getRandom();
return r.BehResult.Continue;
}
return r.BehResult.Stop;
};
e.prototype.findNearbyRatKingTile = function(t) {
if (0 == l.default.inst.kingdoms.getKingdomByID("ratKings").units.length) return null;
var e = this.findRatKing(t);
return e && n.Toolbox.getRandom(e.currentTile.neighboursAll) || null;
};
e.prototype.findRatKing = function(t) {
l.default.inst.getObjectsInChunks(t.currentTile, 10, s.MapObjectType.Actor);
for (var e = 0; e < l.default.inst.temp_map_objects.length; e++) {
var i = l.default.inst.temp_map_objects[e];
if (i != t && i.haveTrait("ratKing")) return i;
}
return null;
};
return e;
}(t("./BehaviourActionActor").default);
i.default = c;
cc._RF.pop();
}, {
"../../MapBox": "MapBox",
"../../behaviour/BehaviourActionBase": "BehaviourActionBase",
"../../common/ToolBox": "ToolBox",
"../../map/map/MapLayer": "MapLayer",
"./BehaviourActionActor": "BehaviourActionActor"
} ],
BehStayInBuildingTarget: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "aa60aamV3dE9LJTyh8rHm3H", "BehStayInBuildingTarget");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
});
Object.defineProperty(i, "__esModule", {
value: !0
});
var r = t("../../behaviour/BehaviourActionBase"), n = t("../../common/ToolBox"), s = function(t) {
a(e, t);
function e(e, i) {
void 0 === e && (e = 0);
void 0 === i && (i = 1);
var o = t.call(this) || this;
o.min = 0;
o.max = 0;
o.min = e;
o.max = i;
o.id = "BehStayInBuildingTarget";
o.special_inside_object = !0;
o.check_building_target_non_usable = !0;
o.null_check_building_target = !0;
return o;
}
e.prototype.execute = function(t) {
if (t.beh_building_target) {
t.timer_action = n.Toolbox.randomFloat(this.min, this.max);
t.stayInBuilding(t.beh_building_target);
t.beh_tile_target = null;
t.beh_building_target.startShake(.5);
}
return r.BehResult.Continue;
};
return e;
}(t("./BehCity").default);
i.default = s;
cc._RF.pop();
}, {
"../../behaviour/BehaviourActionBase": "BehaviourActionBase",
"../../common/ToolBox": "ToolBox",
"./BehCity": "BehCity"
} ],
BehSwimToIsland: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "7f3b9vjfYFAQbThUIw3NV5F", "BehSwimToIsland");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
}), r = this && this.__values || function(t) {
var e = "function" == typeof Symbol && Symbol.iterator, i = e && t[e], o = 0;
if (i) return i.call(t);
if (t && "number" == typeof t.length) return {
next: function() {
t && o >= t.length && (t = void 0);
return {
value: t && t[o++],
done: !t
};
}
};
throw new TypeError(e ? "Object is not iterable." : "Symbol.iterator is not defined.");
};
Object.defineProperty(i, "__esModule", {
value: !0
});
var n = t("../../behaviour/BehaviourActionBase"), s = t("../../common/ToolBox"), l = t("../../map/tile/TileType"), c = t("../../MapBox"), u = function(t) {
a(e, t);
function e() {
var e = t.call(this) || this;
e.id = "BehSwimToIsland";
return e;
}
e.prototype.execute = function(t) {
var i, o;
if (e.isGoodIsland(t.currentTile.region.island, t)) return n.BehResult.Stop;
e.best_region = null;
e.dist = 0;
e.best_dist = 0;
var a = t.currentTile.region.island;
e.best_region = e.findIslandNearby(t);
if (e.best_region) {
t.beh_tile_target = e.best_region.tiles.getRandom();
return n.BehResult.Continue;
}
try {
for (var l = r(c.default.inst.islandsCalculator.islands), u = l.next(); !u.done; u = l.next()) {
var d = u.value;
if (e.checkIsland(a, d, t)) {
var h = d.regionsCorners.getRandom();
if (0 != h.getTileCorners().length) {
e.dist = s.Toolbox.distTile(t.currentTile, h.getTileCorners().getRandom());
if (!e.best_region || e.dist < e.best_dist) {
e.best_region = h;
e.best_dist = e.dist;
}
}
}
}
} catch (t) {
i = {
error: t
};
} finally {
try {
u && !u.done && (o = l.return) && o.call(l);
} finally {
if (i) throw i.error;
}
}
if (s.Toolbox.randomChance(.8) && e.best_region) t.beh_tile_target = e.best_region.tiles.getRandom(); else {
var p = s.Toolbox.randomChance(.5) ? t.currentTile.region : s.Toolbox.getRandom(t.currentTile.region.neighbours);
p && (t.beh_tile_target = s.Toolbox.getRandom(p.tiles));
}
return n.BehResult.Continue;
};
e.findIslandNearby = function(t) {
var i = s.Toolbox.getAllChunksFromTile(t.currentTile), o = t.currentTile.region.island;
i.forEach(function(i) {
i.regions.forEach(function(i) {
if (e.checkIsland(o, i.island, t) && 0 != i.getTileCorners().length) {
e.dist = s.Toolbox.distTile(t.currentTile, i.getTileCorners().getRandom());
if (!e.best_region || e.dist < e.best_dist) {
e.best_region = i;
e.best_dist = e.dist;
}
}
});
});
return e.best_region;
};
e.checkIsland = function(t, i, o) {
return t != i && !!e.isGoodIsland(i, o) && !(t.getTileCount() <= i.getTileCount() ? !t.connectedWith(i) : !i.connectedWith(t)) && 0 != i.regionsCorners.length;
};
e.isGoodIsland = function(t) {
return t.type != l.TileLayerType.Block && t.type != l.TileLayerType.Water && t.type != l.TileLayerType.Lava && !(t.getTileCount() <= 5);
};
e.best_region = null;
e.dist = 0;
e.best_dist = 0;
return e;
}(t("./BehaviourActionActor").default);
i.default = u;
cc._RF.pop();
}, {
"../../MapBox": "MapBox",
"../../behaviour/BehaviourActionBase": "BehaviourActionBase",
"../../common/ToolBox": "ToolBox",
"../../map/tile/TileType": "TileType",
"./BehaviourActionActor": "BehaviourActionActor"
} ],
BehTaxiCheck: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "7ea3drEr9lB8L4CSN6piv4d", "BehTaxiCheck");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
});
Object.defineProperty(i, "__esModule", {
value: !0
});
var r = t("../../actors/other/boat/TaxiManager"), n = t("../../behaviour/BehaviourActionBase"), s = function(t) {
a(e, t);
function e() {
var e = t.call(this) || this;
e.id = "BehTaxiCheck";
return e;
}
e.prototype.execute = function(t) {
var e, i;
if (!(null === (e = null == t ? void 0 : t.data) || void 0 === e ? void 0 : e.alive) || !t.city || !t.currentTile) return n.BehResult.Stop;
var o = t.city.getTile();
if (!o) return n.BehResult.Stop;
var a = !1;
t.isCurrentJob("attacker") ? t.currentTile.isSameIsland(o) || t.city.attackZone && t.city.attackZone.centerTile.isSameIsland(t.currentTile) || (a = !0) : t.isCurrentJob("settler") ? (null === (i = t.city) || void 0 === i ? void 0 : i.settleTarget) || o.isSameIsland(t.currentTile) || (a = !0) : t.currentTile.isSameIsland(o) || (a = !0);
if (!a) return n.BehResult.Stop;
r.default.newRequest(t, o);
return n.BehResult.Continue;
};
return e;
}(t("./BehCity").default);
i.default = s;
cc._RF.pop();
}, {
"../../actors/other/boat/TaxiManager": "TaxiManager",
"../../behaviour/BehaviourActionBase": "BehaviourActionBase",
"./BehCity": "BehCity"
} ],
BehTaxiEmbark: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "d21015TRGRFn6gtWbEFIC5s", "BehTaxiEmbark");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
});
Object.defineProperty(i, "__esModule", {
value: !0
});
var r = t("../../actors/other/boat/Boat"), n = t("../../actors/other/boat/TaxiManager"), s = t("../../actors/other/boat/TaxiRequest"), l = t("../../behaviour/BehaviourActionBase"), c = t("../../common/ToolBox"), u = function(t) {
a(e, t);
function e() {
var e = t.call(this) || this;
e.id = "BehTaxiEmbark";
e.special_inside_object = !0;
return e;
}
e.prototype.execute = function(t) {
var e = n.default.getRequestForActor(t);
if (!e || !e.taxi || e.state != s.TaxiRequestState.Loading) return l.BehResult.Stop;
var i = e.taxi.actor.getComponent(r.default), o = i.isNearDock();
if (c.Toolbox.distTile(i.actor.currentTile, t.currentTile) < 5 || o) {
t.beh_tile_target = null;
t.embarkInto(e.taxi);
return l.BehResult.Continue;
}
return l.BehResult.Stop;
};
return e;
}(t("./BehCity").default);
i.default = u;
cc._RF.pop();
}, {
"../../actors/other/boat/Boat": "Boat",
"../../actors/other/boat/TaxiManager": "TaxiManager",
"../../actors/other/boat/TaxiRequest": "TaxiRequest",
"../../behaviour/BehaviourActionBase": "BehaviourActionBase",
"../../common/ToolBox": "ToolBox",
"./BehCity": "BehCity"
} ],
BehTaxiFindShipTile: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "50248/ihVhEf7+0qCP28Hv3", "BehTaxiFindShipTile");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
});
Object.defineProperty(i, "__esModule", {
value: !0
});
var r = t("../../actors/other/boat/Boat"), n = t("../../actors/other/boat/TaxiManager"), s = t("../../actors/other/boat/TaxiRequest"), l = t("../../behaviour/BehaviourActionBase"), c = t("../../common/PathfinderTools"), u = function(t) {
a(e, t);
function e() {
var e = t.call(this) || this;
e.id = "BehTaxiFindShipTile";
return e;
}
e.prototype.execute = function(t) {
var e = n.default.getRequestForActor(t);
if (!e || !e.taxi || e.state != s.TaxiRequestState.Loading) return l.BehResult.Stop;
var i = e.taxi.actor.getComponent(r.default), o = null;
if (i.pickup_near_dock) {
var a = i.actor.homeBuilding;
if (a) {
var u = a.getConstructionTile();
u && (o = u.region.tiles.getRandom());
}
}
o || (o = c.default.raycastTileForUnitToEmbark(t.currentTile, e.taxi.actor.currentTile));
if (!o) return l.BehResult.Stop;
t.beh_tile_target = o;
return l.BehResult.Continue;
};
return e;
}(t("./BehCity").default);
i.default = u;
cc._RF.pop();
}, {
"../../actors/other/boat/Boat": "Boat",
"../../actors/other/boat/TaxiManager": "TaxiManager",
"../../actors/other/boat/TaxiRequest": "TaxiRequest",
"../../behaviour/BehaviourActionBase": "BehaviourActionBase",
"../../common/PathfinderTools": "PathfinderTools",
"./BehCity": "BehCity"
} ],
BehTryBabymaking: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "a4dc69TqhhIdaU6A8SWRycI", "BehTryBabymaking");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
}), r = this && this.__values || function(t) {
var e = "function" == typeof Symbol && Symbol.iterator, i = e && t[e], o = 0;
if (i) return i.call(t);
if (t && "number" == typeof t.length) return {
next: function() {
t && o >= t.length && (t = void 0);
return {
value: t && t[o++],
done: !t
};
}
};
throw new TypeError(e ? "Object is not iterable." : "Symbol.iterator is not defined.");
};
Object.defineProperty(i, "__esModule", {
value: !0
});
var n = t("../../behaviour/BehaviourActionBase"), s = t("../../common/ToolBox"), l = t("../../MapBox"), c = function(t) {
a(e, t);
function e() {
var e = t.call(this) || this;
e.id = "BehTryBabymaking";
return e;
}
e.prototype.execute = function(t) {
var e;
if (!(null === (e = t.currentTile) || void 0 === e ? void 0 : e.region.island)) return n.BehResult.Stop;
if (!this.isAvailableForReproduction(t)) return n.BehResult.Stop;
if (!t.timerReproduction.isActive) {
if (this.tryStartBabymaking(t)) return n.BehResult.RepeatStep;
t.timerReproduction.startTimer(20);
}
return n.BehResult.Stop;
};
e.prototype.tryStartBabymaking = function(t) {
if (t.race.units.length > 30) return !1;
s.Toolbox.findSameRaceInChunkAround(t.currentTile.chunk, t.stats.race);
if (s.Toolbox.temp_list_units.length >= 4) return !1;
if (t.stats.layEggs && !t.isAffectedByWater()) {
this.makeEgg(t);
return !0;
}
var e = this.findPartner(t);
if (!e) return !1;
t.ai.setTask("babymaking", !0, !0);
t.beh_actor_target = e;
t.beh_actor_target.a.makeWait();
return !0;
};
e.prototype.findPartner = function(t) {
var e = this, i = 0, o = 0, a = null;
t.race.units.list.forEach(function(r) {
var n;
if (r != t && e.isAvailableForReproduction(r) && (null === (n = r.currentTile) || void 0 === n ? void 0 : n.isSameIsland(t.currentTile)) && !((i = s.Toolbox.distTile(t.currentTile, r.currentTile)) > 50) && (!a || i < o)) {
o = i;
a = r;
}
});
return a;
};
e.prototype.isAvailableForReproduction = function(t) {
var e, i;
return !(null === (e = t.data) || void 0 === e || !e.alive || null === (i = t.stats) || void 0 === i || !i.procreate || t.data.hunger < 60 || t.data.age <= 3 || t.timerReproduction.isActive);
};
e.prototype.makeEgg = function(t) {
var e, i;
t.startBabymakingTimeout();
t.data.children++;
var o = null;
try {
for (var a = r(t.currentTile.neighbours), n = a.next(); !n.done; n = a.next()) {
var s = n.value;
if (s != t.currentTile && s != t.currentTile && !s.type.liquid) {
o = s;
break;
}
}
} catch (t) {
e = {
error: t
};
} finally {
try {
n && !n.done && (i = a.return) && i.call(a);
} finally {
if (e) throw e.error;
}
}
o || (o = t.currentTile);
l.default.inst.createNewUnit(t.stats.eggStatsID, o, null, 6);
};
return e;
}(t("./BehaviourActionActor").default);
i.default = c;
cc._RF.pop();
}, {
"../../MapBox": "MapBox",
"../../behaviour/BehaviourActionBase": "BehaviourActionBase",
"../../common/ToolBox": "ToolBox",
"./BehaviourActionActor": "BehaviourActionActor"
} ],
BehUnloadResources: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "dc687GmHslMNJb+hubxG53h", "BehUnloadResources");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
});
Object.defineProperty(i, "__esModule", {
value: !0
});
var r = t("../../behaviour/BehaviourActionBase"), n = function(t) {
a(e, t);
function e() {
var e = t.call(this) || this;
e.id = "BehUnloadResources";
e.special_inside_object = !0;
return e;
}
e.prototype.execute = function(t) {
if (!t.inventory.resource) return r.BehResult.Continue;
t.city.data.storage.change(t.inventory.resource, t.inventory.amount);
t.inventory.empty();
return r.BehResult.Continue;
};
return e;
}(t("./BehCity").default);
i.default = n;
cc._RF.pop();
}, {
"../../behaviour/BehaviourActionBase": "BehaviourActionBase",
"./BehCity": "BehCity"
} ],
BehWalkIntoWaterCorner: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "5e496LEkW9PV5iUIV95NCJM", "BehWalkIntoWaterCorner");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
});
Object.defineProperty(i, "__esModule", {
value: !0
});
var r = t("../../behaviour/BehaviourActionBase"), n = t("../../common/ToolBox"), s = t("../../map/tile/TileType"), l = function(t) {
a(e, t);
function e() {
var e = t.call(this) || this;
e.id = "BehWalkIntoWaterCorner";
return e;
}
e.prototype.execute = function(t) {
if (e.isGoodIsland(t.currentTile.region.island, t)) return r.BehResult.Stop;
var i = null, o = 0, a = 0;
t.currentTile.region.island.regionsCorners.forEach(function(e) {
e.getTileCorners().forEach(function(e) {
if (e.type.water) {
o = n.Toolbox.distTile(t.currentTile, e);
if (!i || o < a) {
i = e;
a = o;
}
}
});
});
if (!i) return r.BehResult.Stop;
t.beh_tile_target = i;
return r.BehResult.Continue;
};
e.isGoodIsland = function(t, e) {
return !(t.type == s.TileLayerType.Block || t.type == s.TileLayerType.Water || t.type == s.TileLayerType.Lava && e.stats.dieInLava || t.getTileCount() <= 5);
};
return e;
}(t("./BehaviourActionActor").default);
i.default = l;
cc._RF.pop();
}, {
"../../behaviour/BehaviourActionBase": "BehaviourActionBase",
"../../common/ToolBox": "ToolBox",
"../../map/tile/TileType": "TileType",
"./BehaviourActionActor": "BehaviourActionActor"
} ],
BehaviourActionActor: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "4e29dNDUmlOdIL1Nsbq/2mS", "BehaviourActionActor");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
});
Object.defineProperty(i, "__esModule", {
value: !0
});
var r = t("../../behaviour/BehaviourActionBase"), n = function(t) {
a(e, t);
function e() {
var e = t.call(this) || this;
e.null_check_city = !1;
e.null_check_kingdom = !1;
e.null_check_tile_target = !1;
e.null_check_building_target = !1;
e.null_check_actor_target = !1;
e.check_building_target_non_usable = !1;
e.special_inside_object = !1;
e.forceAnimation = null;
e.id = "BehaviourActionActor";
return e;
}
e.prototype.forceTask = function(t, e, i) {
void 0 === i && (i = !0);
t.ai.setTask(e, i);
return r.BehResult.Skip;
};
e.prototype.errorsFound = function(e) {
var i, o, a, r, n;
return null === (i = e.currentTile.region) || void 0 === i || !i.island || !(!this.null_check_city || (null === (o = e.city) || void 0 === o ? void 0 : o.alive)) || !(!this.null_check_actor_target || (null === (r = null === (a = e.beh_actor_target) || void 0 === a ? void 0 : a.base_data) || void 0 === r ? void 0 : r.alive)) || !(!this.null_check_tile_target || e.beh_tile_target) || !(!this.null_check_building_target || e.beh_building_target) || !!(this.check_building_target_non_usable && (null === (n = e.beh_building_target) || void 0 === n ? void 0 : n.isNonUsable())) || t.prototype.errorsFound.call(this, e);
};
e.temp_actors = [];
e.temp_cities = [];
e.temp_tasks = [];
e.possible_moves = [];
return e;
}(r.default);
i.default = n;
cc._RF.pop();
}, {
"../../behaviour/BehaviourActionBase": "BehaviourActionBase"
} ],
BehaviourActionBase: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "612aeEKRCdMo5y0AbQQV1nr", "BehaviourActionBase");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
});
Object.defineProperty(i, "__esModule", {
value: !0
});
i.BehaviourActionTester = i.BehaviourActionKingdom = i.BehResult = void 0;
var r, n = t("../assetLibrary/AssetLibrary");
(function(t) {
t[t.Continue = 0] = "Continue";
t[t.Stop = 1] = "Stop";
t[t.RepeatStep = 2] = "RepeatStep";
t[t.Skip = 3] = "Skip";
t[t.RestartTask = 4] = "RestartTask";
t[t.ActiveTaskReturn = 5] = "ActiveTaskReturn";
})(r = i.BehResult || (i.BehResult = {}));
var s = function(t) {
a(e, t);
function e() {
return t.call(this) || this;
}
e.prototype.startExecute = function(t) {
return this.errorsFound(t) ? r.Stop : this.execute(t);
};
e.prototype.execute = function() {
return r.Continue;
};
e.prototype.errorsFound = function() {
return !1;
};
return e;
}(n.Asset);
i.default = s;
var l = function(t) {
a(e, t);
function e() {
return null !== t && t.apply(this, arguments) || this;
}
return e;
}(s);
i.BehaviourActionKingdom = l;
var c = function(t) {
a(e, t);
function e() {
return null !== t && t.apply(this, arguments) || this;
}
return e;
}(s);
i.BehaviourActionTester = c;
cc._RF.pop();
}, {
"../assetLibrary/AssetLibrary": "AssetLibrary"
} ],
BehaviourActionCity: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "97f635/AB9Es6y3ry83RUHR", "BehaviourActionCity");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
});
Object.defineProperty(i, "__esModule", {
value: !0
});
var r = function(t) {
a(e, t);
function e() {
return null !== t && t.apply(this, arguments) || this;
}
e.prototype.errorsFound = function(e) {
return 0 == e.zones.length || 0 == e.getPopulationTotal() || t.prototype.errorsFound.call(this, e);
};
return e;
}(t("./BehaviourActionBase").default);
i.default = r;
cc._RF.pop();
}, {
"./BehaviourActionBase": "BehaviourActionBase"
} ],
BehaviourTaskActorLibrary: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "4e0e4X5upJF0qybM7hr5ubC", "BehaviourTaskActorLibrary");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
});
Object.defineProperty(i, "__esModule", {
value: !0
});
var r = t("../../ai/behaviours/BehActiveCrabDangerCheck"), n = t("../../ai/behaviours/BehAngleAnimation"), s = t("../../ai/behaviours/BehAnimalCheckHungry"), l = t("../../ai/behaviours/BehAnimalFindTile"), c = t("../../ai/behaviours/BehAttackActorTarget"), u = t("../../ai/behaviours/BehaviourTaskActor"), d = t("../../ai/behaviours/BehBabymakingTime"), h = t("../../ai/behaviours/BehBeeCheckHome"), p = t("../../ai/behaviours/BehBeeCheckReturnHome"), f = t("../../ai/behaviours/BehBeePollinate"), m = t("../../ai/behaviours/BehBeeReturnHome"), y = t("../../ai/behaviours/BehBoatCheckFishingRepeat"), _ = t("../../ai/behaviours/BehBoatCheckHomeDocks"), g = t("../../ai/behaviours/BehBoatCollectFish"), v = t("../../ai/behaviours/BehBoatDamageCheck"), b = t("../../ai/behaviours/BehBoatDangerCheck"), T = t("../../ai/behaviours/BehBoatFindRequest"), w = t("../../ai/behaviours/BehBoatFindTargetForTrade"), B = t("../../ai/behaviours/BehBoatFindTileInDock"), k = t("../../ai/behaviours/BehBoatFindWaterNeutralTile"), A = t("../../ai/behaviours/BehBoatFindWaterTile"), S = t("../../ai/behaviours/BehBoatFishing"), x = t("../../ai/behaviours/BehBoatMakeTrade"), C = t("../../ai/behaviours/BehBoatSetHomeDockTarget"), O = t("../../ai/behaviours/BehBoatTransportCheck"), P = t("../../ai/behaviours/BehBoatTransportDoLoading"), R = t("../../ai/behaviours/BehBoatTransportFindTilePickUp"), M = t("../../ai/behaviours/BehBoatTransportFindTileUnload"), L = t("../../ai/behaviours/BehBoatTransportUnloadUnits"), F = t("../../ai/behaviours/BehBuildTargetProgress"), D = t("../../ai/behaviours/BehBurnTumorTiles"), I = t("../../ai/behaviours/BehCheckBuildCity"), j = t("../../ai/behaviours/BehCheckCitizenJob"), E = t("../../ai/behaviours/BehCheckCityArmyGroup"), N = t("../../ai/behaviours/BehCheckCure"), G = t("../../ai/behaviours/BehCheckHunger"), U = t("../../ai/behaviours/BehCheckIfInWater"), z = t("../../ai/behaviours/BehCheckIfOnGround"), W = t("../../ai/behaviours/BehCheckIfOnSmallLand"), H = t("../../ai/behaviours/BehChuckTargetBuildProgress"), K = t("../../ai/behaviours/BehCityCheckAttack"), V = t("../../ai/behaviours/BehCityCreateRoad"), q = t("../../ai/behaviours/BehCityFindBuilding"), Z = t("../../ai/behaviours/BehCityFindFireZone"), J = t("../../ai/behaviours/BehCityFindNewJob"), Y = t("../../ai/behaviours/BehCityFindStorage"), X = t("../../ai/behaviours/BehCityGetRandomZoneTile"), Q = t("../../ai/behaviours/BehCityRemoveFire"), $ = t("../../ai/behaviours/BehCitySettlerFindTileSameIsland"), tt = t("../../ai/behaviours/BehCitySettlerTaxiCheck"), et = t("../../ai/behaviours/BehCityWarriorTaxiCheck"), it = t("../../ai/behaviours/BehConsumeActorTarget"), ot = t("../../ai/behaviours/BehConsumeFlowers"), at = t("../../ai/behaviours/BehConsumeGrass"), rt = t("../../ai/behaviours/BehConsumeTargetBuilding"), nt = t("../../ai/behaviours/BehConvertOre"), st = t("../../ai/behaviours/BehCrabBurrow"), lt = t("../../ai/behaviours/BehEndJob"), ct = t("../../ai/behaviours/BehExitBuilding"), ut = t("../../ai/behaviours/BehExtractResourcesFromBuilding"), dt = t("../../ai/behaviours/BehFightCheckEnemyIsOk"), ht = t("../../ai/behaviours/BehFindBuilding"), pt = t("../../ai/behaviours/BehFindConstructionTile"), ft = t("../../ai/behaviours/BehFindEmptyNearbyCity"), mt = t("../../ai/behaviours/BehFindFarmField"), yt = t("../../ai/behaviours/BehFindGoldenBrain"), _t = t("../../ai/behaviours/BehFindMeatSource"), gt = t("../../ai/behaviours/BehFindRandomCivBuildingTile"), vt = t("../../ai/behaviours/BehFindRandomFrontBuildingTile"), bt = t("../../ai/behaviours/BehFindRandomTile"), Tt = t("../../ai/behaviours/BehFindSameRaceActor"), wt = t("../../ai/behaviours/BehFindTargetForHunter"), Bt = t("../../ai/behaviours/BehFindTile"), kt = t("../../ai/behaviours/BehFindTileBeach"), At = t("../../ai/behaviours/BehFindTileForCity"), St = t("../../ai/behaviours/BehFindTileForFarm"), xt = t("../../ai/behaviours/BehFindTileNearbyGroupLeader"), Ct = t("../../ai/behaviours/BehFindTileWhenOnFire"), Ot = t("../../ai/behaviours/BehFindWheat"), Pt = t("../../ai/behaviours/BehGetResourcesFromMine"), Rt = t("../../ai/behaviours/BehGoOrSwimToTileTarget"), Mt = t("../../ai/behaviours/BehGoToActorTarget"), Lt = t("../../ai/behaviours/BehGoToBuildingTarget"), Ft = t("../../ai/behaviours/BehGoToTileTarget"), Dt = t("../../ai/behaviours/BehHeal"), It = t("../../ai/behaviours/BehJoinCity"), jt = t("../../ai/behaviours/BehJumpingAnimation"), Et = t("../../ai/behaviours/BehLookAtTarget"), Nt = t("../../ai/behaviours/BehMagicMakeSkeleton"), Gt = t("../../ai/behaviours/BehMakeBaby"), Ut = t("../../ai/behaviours/BehMakeFarm"), zt = t("../../ai/behaviours/BehMakeItem"), Wt = t("../../ai/behaviours/BehMoveAwayFromBlock"), Ht = t("../../ai/behaviours/BehPlantCrops"), Kt = t("../../ai/behaviours/BehRandomSwim"), Vt = t("../../ai/behaviours/BehRandomTeleport"), qt = t("../../ai/behaviours/BehRandomWait"), Zt = t("../../ai/behaviours/BehRemoveRuins"), Jt = t("../../ai/behaviours/BehRepairInDock"), Yt = t("../../ai/behaviours/BehReplenishHunger"), Xt = t("../../ai/behaviours/BehResourceGatheringAnimation"), Qt = t("../../ai/behaviours/BehRestartTask"), $t = t("../../ai/behaviours/BehSetNextTask"), te = t("../../ai/behaviours/BehShortRandomMove"), ee = t("../../ai/behaviours/BehSkeletonFindTile"), ie = t("../../ai/behaviours/BehSpawnSeeds"), oe = t("../../ai/behaviours/BehSpecialRat"), ae = t("../../ai/behaviours/BehStayInBuildingTarget"), re = t("../../ai/behaviours/BehSwimToIsland"), ne = t("../../ai/behaviours/BehTaxiCheck"), se = t("../../ai/behaviours/BehTaxiEmbark"), le = t("../../ai/behaviours/BehTaxiFindShipTile"), ce = t("../../ai/behaviours/BehTryBabymaking"), ue = t("../../ai/behaviours/BehUnloadResources"), de = t("../../ai/behaviours/BehWalkIntoWaterCorner"), he = function(t) {
a(e, t);
function e() {
return null !== t && t.apply(this, arguments) || this;
}
e.prototype.init = function() {
t.prototype.init.call(this);
this.initTasksBoats();
this.initTasksMobs();
var e = new u.default();
e.id = "nothing";
this.add(e);
var i = new u.default();
i.id = "fight";
i.fighting = !0;
this.add(i);
this.t.addBeh(new dt.default());
this.t.addBeh(new Mt.default("sameTile", !0));
this.t.addBeh(new Qt.default());
var o = new u.default();
o.id = "move_from_block";
o.moveFromBlock = !0;
o.ignoreFightCheck = !0;
this.add(o);
this.t.addBeh(new Wt.default());
this.t.addBeh(new Ft.default(!0, !0));
var a = new u.default();
a.id = "swim_to_island";
a.ignoreFightCheck = !0;
a.swim_to_island = !0;
this.add(a);
this.t.addBeh(new re.default());
this.t.addBeh(new Rt.default());
var r = new u.default();
r.id = "check_if_stuck_on_small_land";
r.ignoreFightCheck = !0;
this.add(r);
this.t.addBeh(new W.default());
this.t.addBeh(new de.default());
this.t.addBeh(new Rt.default());
var s = new u.default();
s.id = "pollinate";
this.add(s);
this.t.addBeh(new h.default());
this.t.addBeh(new Bt.default("flowers"));
this.t.addBeh(new Ft.default());
this.t.addBeh(new qt.default(1, 3));
this.t.addBeh(new f.default());
this.t.addBeh(new p.default());
this.t.addBeh(new vt.default());
this.t.addBeh(new Ft.default());
this.t.addBeh(new m.default());
var d = new u.default();
d.id = "random_move";
this.add(d);
this.t.addBeh(new bt.default());
this.t.addBeh(new Ft.default());
this.t.addBeh(new qt.default(1, 6));
var y = new u.default();
y.id = "random_animal_move";
this.add(y);
this.t.addBeh(new l.default());
this.t.addBeh(new Ft.default());
this.t.addBeh(new qt.default(3, 6));
var _ = new u.default();
_.id = "random_move_towards_civ_building";
this.add(_);
this.t.addBeh(new gt.default());
this.t.addBeh(new Ft.default());
this.t.addBeh(new qt.default(1, 4));
var g = new u.default();
g.id = "stay_in_house";
this.add(g);
this.t.addBeh(new q.default("random_house_building"));
this.t.addBeh(new vt.default());
this.t.addBeh(new Ft.default());
this.t.addBeh(new ae.default(10, 60));
this.t.addBeh(new ct.default());
var v = new u.default();
v.id = "random_swim";
this.add(v);
this.t.addBeh(new Kt.default());
this.t.addBeh(new qt.default(0, 2));
var b = new u.default();
b.id = "check_join_city";
this.add(b);
this.t.addBeh(new It.default());
this.t.addBeh(new lt.default());
var T = new u.default();
T.id = "check_join_empty_nearby_city";
this.add(T);
this.t.addBeh(new ft.default());
this.t.addBeh(new lt.default());
var w = new u.default();
w.id = "become_citizen";
this.add(w);
this.t.addBeh(new j.default());
var B = new u.default();
B.id = "end_job";
this.add(B);
this.t.addBeh(new lt.default());
var k = new u.default();
k.id = "build_city_here";
this.add(k);
this.t.addBeh(new I.default());
this.t.addBeh(new lt.default());
var A = new u.default();
A.id = "nomad_try_build_city";
this.add(A);
this.t.addBeh(new qt.default(1, 5));
this.t.addBeh(new At.default());
this.t.addBeh(new Ft.default());
this.t.addBeh(new I.default());
this.t.addBeh(new lt.default());
var S = new u.default();
S.id = "citizen";
this.add(S);
this.t.addBeh(new qt.default(1, 5));
this.t.addBeh(new bt.default());
this.t.addBeh(new Ft.default());
var x = new u.default();
x.id = "city_idle_walking";
this.add(x);
this.t.addBeh(new X.default());
this.t.addBeh(new Ft.default());
this.t.addBeh(new qt.default(3, 6));
var C = new u.default();
C.id = "find_city_job";
this.add(C);
this.t.addBeh(new qt.default(1, 5));
this.t.addBeh(new J.default());
var O = new u.default();
O.id = "look_for_animals";
this.add(O);
this.t.addBeh(new wt.default());
this.t.addBeh(new Mt.default());
this.t.addBeh(new c.default());
var P = new u.default();
P.id = "convert_ore";
this.add(P);
this.t.addBeh(new q.default("random_house_building"));
this.t.addBeh(new vt.default());
this.t.addBeh(new Ft.default());
this.t.addBeh(new ae.default(10, 15));
this.t.addBeh(new nt.default());
this.t.addBeh(new ct.default());
this.t.addBeh(new ue.default());
var R = new u.default();
R.id = "make_items";
this.add(R);
this.t.addBeh(new q.default("random_house_building"));
this.t.addBeh(new vt.default());
this.t.addBeh(new Ft.default());
this.t.addBeh(new ae.default(10, 15));
this.t.addBeh(new zt.default());
this.t.addBeh(new ct.default());
var M = new u.default();
M.id = "cleaning";
M.force_item_sprite = "tool_hammer";
this.add(M);
this.t.addBeh(new q.default("ruins"));
this.t.addBeh(new vt.default());
this.t.addBeh(new Ft.default());
this.t.addBeh(new qt.default(.3, .3));
this.t.addBeh(new Et.default("building_target"));
this.t.addBeh(new n.default("building_target", 1));
this.t.addBeh(new n.default("building_target", 1));
this.t.addBeh(new n.default("building_target", 1));
this.t.addBeh(new n.default("building_target"));
this.t.addBeh(new Zt.default());
this.t.addBeh(new qt.default(1, 2));
var L = new u.default();
L.id = "put_out_fire";
L.force_item_sprite = "tool_bucket";
this.add(L);
this.t.addBeh(new Z.default());
this.t.addBeh(new Ft.default());
this.t.addBeh(new jt.default(1));
this.t.addBeh(new Q.default());
this.t.addBeh(new qt.default(1, 2));
var D = new u.default();
D.id = "build_new_building";
D.force_item_sprite = "tool_hammer";
this.add(D);
this.t.addBeh(new q.default("new_building"));
this.t.addBeh(new pt.default());
this.t.addBeh(new Ft.default());
this.t.addBeh(new Et.default("building_target"));
this.t.addBeh(new n.default("building_target"));
this.t.addBeh(new F.default());
this.t.addBeh(new qt.default(.5));
this.t.addBeh(new H.default());
var N = new u.default();
N.id = "build_road";
N.force_item_sprite = "tool_hammer";
this.add(N);
var G = new Bt.default("new_road");
G.null_check_city = !0;
this.t.addBeh(G);
this.t.addBeh(new Ft.default());
this.t.addBeh(new qt.default(.2));
this.t.addBeh(new n.default("tile_target", 1));
this.t.addBeh(new n.default("tile_target", 1));
this.t.addBeh(new n.default("tile_target", 1));
this.t.addBeh(new n.default("tile_target"));
this.t.addBeh(new V.default());
this.t.addBeh(new qt.default(1, 2));
this.t.addBeh(new Qt.default());
var U = new u.default();
U.id = "collect_fruits";
U.force_item_sprite = "tool_basket";
this.add(U);
this.t.addBeh(new q.default("fruitBush"));
this.t.addBeh(new vt.default());
this.t.addBeh(new Ft.default());
this.t.addBeh(new Et.default("building_target"));
this.t.addBeh(new Xt.default(1));
this.t.addBeh(new Xt.default(1));
this.t.addBeh(new Xt.default(1));
this.t.addBeh(new Xt.default(0));
this.t.addBeh(new ut.default());
this.t.addBeh(new qt.default(2, 3));
this.t.addBeh(new Y.default());
this.t.addBeh(new vt.default());
this.t.addBeh(new Ft.default());
this.t.addBeh(new qt.default(1, 2));
this.t.addBeh(new ue.default());
this.t.addBeh(new qt.default(1, 2));
this.t.addBeh(new Qt.default());
var z = new u.default();
z.id = "chop_trees";
z.force_item_sprite = "tool_axe";
this.add(z);
this.t.addBeh(new q.default("trees"));
this.t.addBeh(new vt.default());
this.t.addBeh(new Ft.default());
this.t.addBeh(new Et.default("building_target"));
this.t.addBeh(new Xt.default(1));
this.t.addBeh(new Xt.default(1));
this.t.addBeh(new Xt.default(1));
this.t.addBeh(new Xt.default(0));
this.t.addBeh(new ut.default());
this.t.addBeh(new Y.default());
this.t.addBeh(new vt.default());
this.t.addBeh(new Ft.default());
this.t.addBeh(new qt.default(1, 2));
this.t.addBeh(new ue.default());
this.t.addBeh(new qt.default(1, 2));
var it = new u.default();
it.id = "mine_deposit";
it.force_item_sprite = "tool_pickaxe";
this.add(it);
this.t.addBeh(new q.default("gold,ore,stone"));
this.t.addBeh(new vt.default());
this.t.addBeh(new Ft.default());
this.t.addBeh(new Et.default("building_target"));
this.t.addBeh(new Xt.default(1));
this.t.addBeh(new Xt.default(1));
this.t.addBeh(new Xt.default(1));
this.t.addBeh(new Xt.default(0));
this.t.addBeh(new ut.default());
this.t.addBeh(new Y.default());
this.t.addBeh(new vt.default());
this.t.addBeh(new Ft.default());
this.t.addBeh(new qt.default(1, 2));
this.t.addBeh(new ue.default());
this.t.addBeh(new qt.default(1, 2));
this.t.addBeh(new Qt.default());
var ot = new u.default();
ot.id = "farming_make_field";
ot.force_item_sprite = "tool_hoe";
this.add(ot);
this.t.addBeh(new St.default());
this.t.addBeh(new Ft.default());
this.t.addBeh(new n.default("tile_target", 1));
this.t.addBeh(new n.default("tile_target", 1));
this.t.addBeh(new n.default("tile_target", 1));
this.t.addBeh(new n.default("tile_target", 1));
this.t.addBeh(new Ut.default());
this.t.addBeh(new qt.default(1, 2));
var at = new u.default();
at.id = "plant_crops";
at.force_item_sprite = "tool_hoe";
this.add(at);
this.t.addBeh(new mt.default());
this.t.addBeh(new Ft.default());
this.t.addBeh(new n.default("tile_target", 1));
this.t.addBeh(new n.default("tile_target", 1));
this.t.addBeh(new n.default("tile_target", 1));
this.t.addBeh(new n.default("tile_target", 1));
this.t.addBeh(new Ht.default());
this.t.addBeh(new qt.default(1, 2));
this.t.addBeh(new Qt.default());
var rt = new u.default();
rt.id = "harvest";
rt.force_item_sprite = "tool_hoe";
this.add(rt);
this.t.addBeh(new Ot.default());
this.t.addBeh(new Lt.default());
this.t.addBeh(new Xt.default(1));
this.t.addBeh(new Xt.default(1));
this.t.addBeh(new Xt.default(1));
this.t.addBeh(new Xt.default(0));
this.t.addBeh(new ut.default());
this.t.addBeh(new qt.default(1, 2));
this.t.addBeh(new Y.default());
this.t.addBeh(new vt.default());
this.t.addBeh(new Ft.default());
this.t.addBeh(new qt.default(1, 2));
this.t.addBeh(new ue.default());
this.t.addBeh(new qt.default(1, 2));
this.t.addBeh(new Qt.default());
var st = new u.default();
st.id = "mine";
st.force_item_sprite = "tool_pickaxe";
this.add(st);
this.t.addBeh(new q.default("mine"));
this.t.addBeh(new Lt.default());
this.t.addBeh(new ae.default(10, 15));
this.t.addBeh(new Pt.default());
this.t.addBeh(new ct.default());
this.t.addBeh(new qt.default(1, 2));
this.t.addBeh(new Y.default());
this.t.addBeh(new vt.default());
this.t.addBeh(new Ft.default());
this.t.addBeh(new qt.default(1, 2));
this.t.addBeh(new ue.default());
this.t.addBeh(new qt.default(1, 2));
this.t.addBeh(new Qt.default());
var ht = new u.default();
ht.id = "try_to_return_home";
this.add(ht);
this.t.addBeh(new ne.default());
this.t.addBeh(new qt.default(1));
this.t.addBeh(new le.default());
this.t.addBeh(new Ft.default());
this.t.addBeh(new se.default());
var yt = new u.default();
yt.id = "warrior_check_city_army_group";
this.add(yt);
this.t.addBeh(new E.default());
this.t.addBeh(new qt.default(1, 2));
var _t = new u.default();
_t.id = "warrior_army_leader_move_random";
this.add(_t);
this.t.addBeh(new bt.default());
this.t.addBeh(new Ft.default());
this.t.addBeh(new qt.default(10, 20));
var Tt = new u.default();
Tt.id = "warrior_army_leader_move_to_attack_target";
this.add(Tt);
this.t.addBeh(new K.default());
this.t.addBeh(new Ft.default());
this.t.addBeh(new qt.default(1, 4));
var kt = new u.default();
kt.id = "warrior_army_follow_leader";
this.add(kt);
this.t.addBeh(new xt.default());
this.t.addBeh(new Ft.default());
this.t.addBeh(new qt.default(1, 2));
var Ct = new u.default();
Ct.id = "check_warrior_transport";
this.add(Ct);
this.t.addBeh(new et.default());
this.t.addBeh(new qt.default(1, 5));
this.t.addBeh(new le.default());
this.t.addBeh(new Ft.default());
this.t.addBeh(new se.default());
var Dt = new u.default();
Dt.id = "settler_same_island";
this.add(Dt);
this.t.addBeh(new qt.default(1));
this.t.addBeh(new $.default());
this.t.addBeh(new Ft.default());
var Nt = new u.default();
Nt.id = "sit_inside_boat";
this.add(Nt);
this.t.addBeh(new se.default());
var Gt = new u.default();
Gt.id = "settler_check_transport";
this.add(Gt);
this.t.addBeh(new tt.default());
this.t.addBeh(new qt.default(1, 5));
this.t.addBeh(new le.default());
this.t.addBeh(new Ft.default());
this.t.addBeh(new se.default());
var Vt = new u.default();
Vt.id = "wait";
this.add(Vt);
this.t.addBeh(new qt.default(1));
var Jt = new u.default();
Jt.id = "wait5";
this.add(Jt);
this.t.addBeh(new qt.default(1, 5));
var Yt = new u.default();
Yt.id = "wait10";
this.add(Yt);
this.t.addBeh(new qt.default(1, 10));
};
e.prototype.initTasksMobs = function() {
var t = new u.default();
t.id = "check_hunger_animal";
this.add(t);
this.t.addBeh(new G.default());
this.t.addBeh(new G.default());
this.t.addBeh(new G.default());
var e = new u.default();
e.id = "eat_fruits";
this.add(e);
this.t.addBeh(new ht.default("fruits"));
this.t.addBeh(new Lt.default());
this.t.addBeh(new Xt.default(1));
this.t.addBeh(new Xt.default(1));
this.t.addBeh(new Xt.default(1));
this.t.addBeh(new Xt.default(1));
this.t.addBeh(new rt.default());
this.t.addBeh(new qt.default(1, 2));
var i = new u.default();
i.id = "eat_flowers";
this.add(i);
this.t.addBeh(new Bt.default("flowers"));
this.t.addBeh(new Ft.default());
this.t.addBeh(new n.default("tile_target", 1));
this.t.addBeh(new n.default("tile_target", 1));
this.t.addBeh(new n.default("tile_target", 1));
this.t.addBeh(new n.default("tile_target", 1));
this.t.addBeh(new ot.default());
this.t.addBeh(new qt.default(1, 2));
var o = new u.default();
o.id = "eat_crops";
this.add(o);
this.t.addBeh(new ht.default("crops"));
this.t.addBeh(new Lt.default());
this.t.addBeh(new Xt.default(1));
this.t.addBeh(new Xt.default(1));
this.t.addBeh(new Xt.default(1));
this.t.addBeh(new Xt.default(1));
this.t.addBeh(new rt.default());
this.t.addBeh(new qt.default(1, 2));
var a = new u.default();
a.id = "eat_grass";
this.add(a);
this.t.addBeh(new Bt.default("grass"));
this.t.addBeh(new Ft.default());
this.t.addBeh(new n.default("tile_target", 1));
this.t.addBeh(new n.default("tile_target", 1));
this.t.addBeh(new n.default("tile_target", 1));
this.t.addBeh(new n.default("tile_target", 1));
this.t.addBeh(new at.default());
this.t.addBeh(new qt.default(1, 2));
var l = new u.default();
l.id = "hunting_attack";
this.add(l);
this.t.addBeh(new _t.default());
this.t.addBeh(new Mt.default());
this.t.addBeh(new it.default());
var c = new u.default();
c.id = "try_babymaking";
this.add(c);
this.t.addBeh(new ce.default());
var h = new u.default();
h.id = "babymaking";
this.add(h);
this.t.addBeh(new Mt.default());
this.t.addBeh(new qt.default(.5));
this.t.addBeh(new d.default());
this.t.addBeh(new qt.default(.5));
this.t.addBeh(new d.default());
this.t.addBeh(new qt.default(.5));
this.t.addBeh(new d.default());
this.t.addBeh(new qt.default(.5));
this.t.addBeh(new Gt.default());
this.t.addBeh(new qt.default(1, 3));
var p = new u.default();
p.id = "follow_same_race";
this.add(p);
this.t.addBeh(new Tt.default());
this.t.addBeh(new Mt.default("sameRegion"));
var f = new u.default();
f.id = "attack_golden_brain";
this.add(f);
this.t.addBeh(new yt.default());
this.t.addBeh(new Lt.default());
var m = new u.default();
m.id = "rat";
this.add(m);
this.t.addBeh(new qt.default(1));
this.t.addBeh(new oe.default());
this.t.addBeh(new Ft.default());
var y = new u.default();
y.id = "crab";
this.add(y);
this.t.addBeh(new s.default());
this.t.addBeh(new qt.default(2, 5));
this.t.addBeh(new kt.default());
this.t.addBeh(new Rt.default());
this.t.addBeh(new n.default("tile_target", 1, 20));
this.t.addBeh(new n.default("tile_target", 1, 20));
this.t.addBeh(new n.default("tile_target", 1, 20));
this.t.addBeh(new n.default("tile_target", 1, 20));
this.t.addBeh(new Yt.default());
var _ = new u.default();
_.id = "crab_danger_check";
this.add(_);
this.t.addBeh(new z.default());
this.t.addBeh(new r.default());
var g = new u.default();
g.id = "water_feeding";
this.add(g);
this.t.addBeh(new s.default());
this.t.addBeh(new Bt.default("water"));
this.t.addBeh(new Rt.default());
this.t.addBeh(new n.default("tile_target", 1, 20));
this.t.addBeh(new n.default("tile_target", 1, 20));
this.t.addBeh(new n.default("tile_target", 1, 20));
this.t.addBeh(new n.default("tile_target", 1, 20));
this.t.addBeh(new Yt.default());
var v = new u.default();
v.id = "crab_burrow";
this.add(v);
this.t.addBeh(new z.default());
this.t.addBeh(new bt.default());
this.t.addBeh(new Ft.default());
this.t.addBeh(new st.default());
var b = new u.default();
b.id = "make_skeleton";
this.add(b);
this.t.addBeh(new Nt.default());
this.t.addBeh(new qt.default(3, 3));
var T = new u.default();
T.id = "skeleton_move";
this.add(T);
this.t.addBeh(new ee.default());
this.t.addBeh(new Ft.default());
this.t.addBeh(new qt.default(3, 6));
var w = new u.default();
w.id = "spawn_seeds";
this.add(w);
this.t.addBeh(new ie.default());
this.t.addBeh(new qt.default(1, 3));
var B = new u.default();
B.id = "check_cure";
this.add(B);
this.t.addBeh(new N.default());
this.t.addBeh(new qt.default(1, 3));
var k = new u.default();
k.id = "burn_tumors";
this.add(k);
this.t.addBeh(new D.default());
this.t.addBeh(new qt.default(1, 3));
var A = new u.default();
A.id = "check_heal";
this.add(A);
this.t.addBeh(new Dt.default());
this.t.addBeh(new qt.default(1, 3));
var S = new u.default();
S.id = "random_teleport";
this.add(S);
this.t.addBeh(new Vt.default());
this.t.addBeh(new qt.default(.5));
var x = new u.default();
x.id = "run_to_water";
this.add(x);
this.t.addBeh(new Ct.default());
this.t.addBeh(new Rt.default());
var C = new u.default();
C.id = "short_move";
this.add(C);
this.t.addBeh(new te.default());
this.t.addBeh(new Ft.default());
};
e.prototype.initTasksBoats = function() {
var t = new u.default();
t.id = "boat_idle";
this.add(t);
this.t.addBeh(new v.default());
this.t.addBeh(new k.default());
this.t.addBeh(new Ft.default());
this.t.addBeh(new qt.default(3, 10));
var e = new u.default();
e.id = "boat_danger_check";
this.add(e);
this.t.addBeh(new U.default());
this.t.addBeh(new b.default());
this.t.addBeh(new A.default());
this.t.addBeh(new Ft.default());
this.t.addBeh(new qt.default(3, 10));
var i = new u.default();
i.id = "boat_transport_check";
this.add(i);
this.t.addBeh(new qt.default());
this.t.addBeh(new O.default());
var o = new u.default();
o.id = "boat_transport_check_taxi";
this.add(o);
this.t.addBeh(new T.default());
var a = new u.default();
a.id = "boat_transport_go_load";
this.add(a);
this.t.addBeh(new R.default());
this.t.addBeh(new Ft.default());
this.t.addBeh(new qt.default());
this.t.addBeh(new P.default());
this.t.addBeh(new $t.default("boat_transport_go_unload", !1));
var r = new u.default();
r.id = "boat_transport_go_unload";
this.add(r);
this.t.addBeh(new qt.default());
this.t.addBeh(new M.default());
this.t.addBeh(new Ft.default(!0));
this.t.addBeh(new qt.default());
this.t.addBeh(new L.default());
this.t.addBeh(new qt.default(3, 10));
this.t.addBeh(new lt.default());
var n = new u.default();
n.id = "boat_trading";
this.add(n);
this.t.addBeh(new _.default());
this.t.addBeh(new w.default());
this.t.addBeh(new B.default());
this.t.addBeh(new Ft.default());
this.t.addBeh(new ae.default(2, 5));
this.t.addBeh(new x.default());
this.t.addBeh(new ct.default());
this.t.addBeh(new $t.default("boat_return_to_dock"));
var s = new u.default();
s.id = "boat_fishing";
this.add(s);
this.t.addBeh(new _.default());
this.t.addBeh(new A.default());
this.t.addBeh(new Ft.default());
this.t.addBeh(new qt.default());
this.t.addBeh(new S.default());
this.t.addBeh(new qt.default(5, 10));
this.t.addBeh(new g.default());
this.t.addBeh(new qt.default(1, 2));
this.t.addBeh(new y.default());
var l = new u.default();
l.id = "boat_return_to_dock";
this.add(l);
this.t.addBeh(new _.default());
this.t.addBeh(new C.default());
this.t.addBeh(new B.default());
this.t.addBeh(new Ft.default());
this.t.addBeh(new qt.default(0, 3));
this.t.addBeh(new ae.default(2, 4));
this.t.addBeh(new ue.default());
this.t.addBeh(new Jt.default());
this.t.addBeh(new ct.default());
this.t.addBeh(new lt.default());
};
return e;
}(t("../AssetLibrary").default);
i.default = he;
cc._RF.pop();
}, {
"../../ai/behaviours/BehActiveCrabDangerCheck": "BehActiveCrabDangerCheck",
"../../ai/behaviours/BehAngleAnimation": "BehAngleAnimation",
"../../ai/behaviours/BehAnimalCheckHungry": "BehAnimalCheckHungry",
"../../ai/behaviours/BehAnimalFindTile": "BehAnimalFindTile",
"../../ai/behaviours/BehAttackActorTarget": "BehAttackActorTarget",
"../../ai/behaviours/BehBabymakingTime": "BehBabymakingTime",
"../../ai/behaviours/BehBeeCheckHome": "BehBeeCheckHome",
"../../ai/behaviours/BehBeeCheckReturnHome": "BehBeeCheckReturnHome",
"../../ai/behaviours/BehBeePollinate": "BehBeePollinate",
"../../ai/behaviours/BehBeeReturnHome": "BehBeeReturnHome",
"../../ai/behaviours/BehBoatCheckFishingRepeat": "BehBoatCheckFishingRepeat",
"../../ai/behaviours/BehBoatCheckHomeDocks": "BehBoatCheckHomeDocks",
"../../ai/behaviours/BehBoatCollectFish": "BehBoatCollectFish",
"../../ai/behaviours/BehBoatDamageCheck": "BehBoatDamageCheck",
"../../ai/behaviours/BehBoatDangerCheck": "BehBoatDangerCheck",
"../../ai/behaviours/BehBoatFindRequest": "BehBoatFindRequest",
"../../ai/behaviours/BehBoatFindTargetForTrade": "BehBoatFindTargetForTrade",
"../../ai/behaviours/BehBoatFindTileInDock": "BehBoatFindTileInDock",
"../../ai/behaviours/BehBoatFindWaterNeutralTile": "BehBoatFindWaterNeutralTile",
"../../ai/behaviours/BehBoatFindWaterTile": "BehBoatFindWaterTile",
"../../ai/behaviours/BehBoatFishing": "BehBoatFishing",
"../../ai/behaviours/BehBoatMakeTrade": "BehBoatMakeTrade",
"../../ai/behaviours/BehBoatSetHomeDockTarget": "BehBoatSetHomeDockTarget",
"../../ai/behaviours/BehBoatTransportCheck": "BehBoatTransportCheck",
"../../ai/behaviours/BehBoatTransportDoLoading": "BehBoatTransportDoLoading",
"../../ai/behaviours/BehBoatTransportFindTilePickUp": "BehBoatTransportFindTilePickUp",
"../../ai/behaviours/BehBoatTransportFindTileUnload": "BehBoatTransportFindTileUnload",
"../../ai/behaviours/BehBoatTransportUnloadUnits": "BehBoatTransportUnloadUnits",
"../../ai/behaviours/BehBuildTargetProgress": "BehBuildTargetProgress",
"../../ai/behaviours/BehBurnTumorTiles": "BehBurnTumorTiles",
"../../ai/behaviours/BehCheckBuildCity": "BehCheckBuildCity",
"../../ai/behaviours/BehCheckCitizenJob": "BehCheckCitizenJob",
"../../ai/behaviours/BehCheckCityArmyGroup": "BehCheckCityArmyGroup",
"../../ai/behaviours/BehCheckCure": "BehCheckCure",
"../../ai/behaviours/BehCheckHunger": "BehCheckHunger",
"../../ai/behaviours/BehCheckIfInWater": "BehCheckIfInWater",
"../../ai/behaviours/BehCheckIfOnGround": "BehCheckIfOnGround",
"../../ai/behaviours/BehCheckIfOnSmallLand": "BehCheckIfOnSmallLand",
"../../ai/behaviours/BehChuckTargetBuildProgress": "BehChuckTargetBuildProgress",
"../../ai/behaviours/BehCityCheckAttack": "BehCityCheckAttack",
"../../ai/behaviours/BehCityCreateRoad": "BehCityCreateRoad",
"../../ai/behaviours/BehCityFindBuilding": "BehCityFindBuilding",
"../../ai/behaviours/BehCityFindFireZone": "BehCityFindFireZone",
"../../ai/behaviours/BehCityFindNewJob": "BehCityFindNewJob",
"../../ai/behaviours/BehCityFindStorage": "BehCityFindStorage",
"../../ai/behaviours/BehCityGetRandomZoneTile": "BehCityGetRandomZoneTile",
"../../ai/behaviours/BehCityRemoveFire": "BehCityRemoveFire",
"../../ai/behaviours/BehCitySettlerFindTileSameIsland": "BehCitySettlerFindTileSameIsland",
"../../ai/behaviours/BehCitySettlerTaxiCheck": "BehCitySettlerTaxiCheck",
"../../ai/behaviours/BehCityWarriorTaxiCheck": "BehCityWarriorTaxiCheck",
"../../ai/behaviours/BehConsumeActorTarget": "BehConsumeActorTarget",
"../../ai/behaviours/BehConsumeFlowers": "BehConsumeFlowers",
"../../ai/behaviours/BehConsumeGrass": "BehConsumeGrass",
"../../ai/behaviours/BehConsumeTargetBuilding": "BehConsumeTargetBuilding",
"../../ai/behaviours/BehConvertOre": "BehConvertOre",
"../../ai/behaviours/BehCrabBurrow": "BehCrabBurrow",
"../../ai/behaviours/BehEndJob": "BehEndJob",
"../../ai/behaviours/BehExitBuilding": "BehExitBuilding",
"../../ai/behaviours/BehExtractResourcesFromBuilding": "BehExtractResourcesFromBuilding",
"../../ai/behaviours/BehFightCheckEnemyIsOk": "BehFightCheckEnemyIsOk",
"../../ai/behaviours/BehFindBuilding": "BehFindBuilding",
"../../ai/behaviours/BehFindConstructionTile": "BehFindConstructionTile",
"../../ai/behaviours/BehFindEmptyNearbyCity": "BehFindEmptyNearbyCity",
"../../ai/behaviours/BehFindFarmField": "BehFindFarmField",
"../../ai/behaviours/BehFindGoldenBrain": "BehFindGoldenBrain",
"../../ai/behaviours/BehFindMeatSource": "BehFindMeatSource",
"../../ai/behaviours/BehFindRandomCivBuildingTile": "BehFindRandomCivBuildingTile",
"../../ai/behaviours/BehFindRandomFrontBuildingTile": "BehFindRandomFrontBuildingTile",
"../../ai/behaviours/BehFindRandomTile": "BehFindRandomTile",
"../../ai/behaviours/BehFindSameRaceActor": "BehFindSameRaceActor",
"../../ai/behaviours/BehFindTargetForHunter": "BehFindTargetForHunter",
"../../ai/behaviours/BehFindTile": "BehFindTile",
"../../ai/behaviours/BehFindTileBeach": "BehFindTileBeach",
"../../ai/behaviours/BehFindTileForCity": "BehFindTileForCity",
"../../ai/behaviours/BehFindTileForFarm": "BehFindTileForFarm",
"../../ai/behaviours/BehFindTileNearbyGroupLeader": "BehFindTileNearbyGroupLeader",
"../../ai/behaviours/BehFindTileWhenOnFire": "BehFindTileWhenOnFire",
"../../ai/behaviours/BehFindWheat": "BehFindWheat",
"../../ai/behaviours/BehGetResourcesFromMine": "BehGetResourcesFromMine",
"../../ai/behaviours/BehGoOrSwimToTileTarget": "BehGoOrSwimToTileTarget",
"../../ai/behaviours/BehGoToActorTarget": "BehGoToActorTarget",
"../../ai/behaviours/BehGoToBuildingTarget": "BehGoToBuildingTarget",
"../../ai/behaviours/BehGoToTileTarget": "BehGoToTileTarget",
"../../ai/behaviours/BehHeal": "BehHeal",
"../../ai/behaviours/BehJoinCity": "BehJoinCity",
"../../ai/behaviours/BehJumpingAnimation": "BehJumpingAnimation",
"../../ai/behaviours/BehLookAtTarget": "BehLookAtTarget",
"../../ai/behaviours/BehMagicMakeSkeleton": "BehMagicMakeSkeleton",
"../../ai/behaviours/BehMakeBaby": "BehMakeBaby",
"../../ai/behaviours/BehMakeFarm": "BehMakeFarm",
"../../ai/behaviours/BehMakeItem": "BehMakeItem",
"../../ai/behaviours/BehMoveAwayFromBlock": "BehMoveAwayFromBlock",
"../../ai/behaviours/BehPlantCrops": "BehPlantCrops",
"../../ai/behaviours/BehRandomSwim": "BehRandomSwim",
"../../ai/behaviours/BehRandomTeleport": "BehRandomTeleport",
"../../ai/behaviours/BehRandomWait": "BehRandomWait",
"../../ai/behaviours/BehRemoveRuins": "BehRemoveRuins",
"../../ai/behaviours/BehRepairInDock": "BehRepairInDock",
"../../ai/behaviours/BehReplenishHunger": "BehReplenishHunger",
"../../ai/behaviours/BehResourceGatheringAnimation": "BehResourceGatheringAnimation",
"../../ai/behaviours/BehRestartTask": "BehRestartTask",
"../../ai/behaviours/BehSetNextTask": "BehSetNextTask",
"../../ai/behaviours/BehShortRandomMove": "BehShortRandomMove",
"../../ai/behaviours/BehSkeletonFindTile": "BehSkeletonFindTile",
"../../ai/behaviours/BehSpawnSeeds": "BehSpawnSeeds",
"../../ai/behaviours/BehSpecialRat": "BehSpecialRat",
"../../ai/behaviours/BehStayInBuildingTarget": "BehStayInBuildingTarget",
"../../ai/behaviours/BehSwimToIsland": "BehSwimToIsland",
"../../ai/behaviours/BehTaxiCheck": "BehTaxiCheck",
"../../ai/behaviours/BehTaxiEmbark": "BehTaxiEmbark",
"../../ai/behaviours/BehTaxiFindShipTile": "BehTaxiFindShipTile",
"../../ai/behaviours/BehTryBabymaking": "BehTryBabymaking",
"../../ai/behaviours/BehUnloadResources": "BehUnloadResources",
"../../ai/behaviours/BehWalkIntoWaterCorner": "BehWalkIntoWaterCorner",
"../../ai/behaviours/BehaviourTaskActor": "BehaviourTaskActor",
"../AssetLibrary": "AssetLibrary"
} ],
BehaviourTaskActor: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "03288fg7K1EbL2D0CFAz6O7", "BehaviourTaskActor");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
});
Object.defineProperty(i, "__esModule", {
value: !0
});
var r = function(t) {
a(e, t);
function e() {
var e = null !== t && t.apply(this, arguments) || this;
e.moveFromBlock = !1;
e.swim_to_island = !1;
e.ignoreFightCheck = !1;
e.fighting = !1;
e.force_item_sprite = "";
return e;
}
return e;
}(t("../../behaviour/BehaviourTaskBase").default);
i.default = r;
cc._RF.pop();
}, {
"../../behaviour/BehaviourTaskBase": "BehaviourTaskBase"
} ],
BehaviourTaskBase: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "48981FuT9FJppRU5k6zHRm5", "BehaviourTaskBase");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
});
Object.defineProperty(i, "__esModule", {
value: !0
});
i.BehaviourTaskTester = i.BehaviourTaskKingdom = i.BehaviourTaskCity = void 0;
var r = function(t) {
a(e, t);
function e() {
var e = null !== t && t.apply(this, arguments) || this;
e.list = [];
return e;
}
e.prototype.get = function(t) {
return this.list[t];
};
e.prototype.addBeh = function(t) {
this.list.push(t);
};
return e;
}(t("../assetLibrary/AssetLibrary").Asset);
i.default = r;
var n = function(t) {
a(e, t);
function e() {
return null !== t && t.apply(this, arguments) || this;
}
return e;
}(r);
i.BehaviourTaskCity = n;
var s = function(t) {
a(e, t);
function e() {
return null !== t && t.apply(this, arguments) || this;
}
return e;
}(r);
i.BehaviourTaskKingdom = s;
var l = function(t) {
a(e, t);
function e() {
return null !== t && t.apply(this, arguments) || this;
}
return e;
}(r);
i.BehaviourTaskTester = l;
cc._RF.pop();
}, {
"../assetLibrary/AssetLibrary": "AssetLibrary"
} ],
BehaviourTaskCityLibrary: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "24b52toWnRBnJSSVzusiQih", "BehaviourTaskCityLibrary");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
});
Object.defineProperty(i, "__esModule", {
value: !0
});
var r = t("../../ai/behaviours/CityBehAddProgress"), n = t("../../ai/behaviours/CityBehBorderGrowth"), s = t("../../ai/behaviours/CityBehBorderSteal"), l = t("../../ai/behaviours/CityBehBuild"), c = t("../../ai/behaviours/CityBehBuildDocks"), u = t("../../ai/behaviours/CityBehCheckArmy"), d = t("../../ai/behaviours/CityBehCheckAttackZone"), h = t("../../ai/behaviours/CityBehCheckCitizenTasks"), p = t("../../ai/behaviours/CityBehCheckPopPoints"), f = t("../../ai/behaviours/CityBehCheckSettleTarget"), m = t("../../ai/behaviours/CityBehFindLeader"), y = t("../../ai/behaviours/CityBehGiveInventoryItem"), _ = t("../../ai/behaviours/CityBehProduceBoat"), g = t("../../ai/behaviours/CityBehProduceResources"), v = t("../../ai/behaviours/CityBehProduceUnit"), b = t("../../ai/behaviours/CityBehRandomWait"), T = t("../../ai/behaviours/CityBehSupplyKingdomCities"), w = t("../../ai/behaviours/CityBehUpgradeRandomBuilding"), B = t("../../behaviour/BehaviourTaskBase"), k = function(t) {
a(e, t);
function e() {
return null !== t && t.apply(this, arguments) || this;
}
e.prototype.init = function() {
t.prototype.init.call(this);
var e = new B.BehaviourTaskCity();
e.id = "nothing";
this.add(e);
var i = new B.BehaviourTaskCity();
i.id = "wait1";
this.add(i);
this.t.addBeh(new b.default());
var o = new B.BehaviourTaskCity();
o.id = "wait5";
this.add(o);
this.t.addBeh(new b.default(5, 5));
var a = new B.BehaviourTaskCity();
a.id = "random_wait_test";
this.add(a);
this.t.addBeh(new b.default(5, 10));
this.t.addBeh(new b.default(5, 10));
this.t.addBeh(new b.default(5, 10));
var k = new B.BehaviourTaskCity();
k.id = "do_checks";
this.add(k);
this.t.addBeh(new m.default());
this.t.addBeh(new b.default(.1));
this.t.addBeh(new d.default());
this.t.addBeh(new b.default(.1));
this.t.addBeh(new f.default());
this.t.addBeh(new b.default(.1));
this.t.addBeh(new h.default());
this.t.addBeh(new b.default(.1));
var A = new B.BehaviourTaskCity();
A.id = "produce_unit";
this.add(A);
this.t.addBeh(new v.default());
var S = new B.BehaviourTaskCity();
S.id = "produce_boat";
this.add(S);
this.t.addBeh(new _.default());
var x = new B.BehaviourTaskCity();
x.id = "border_growth";
this.add(x);
this.t.addBeh(new n.default());
var C = new B.BehaviourTaskCity();
C.id = "border_steal";
this.add(C);
this.t.addBeh(new s.default());
var O = new B.BehaviourTaskCity();
O.id = "give_inventory_item";
this.add(O);
this.t.addBeh(new y.default());
var P = new B.BehaviourTaskCity();
P.id = "add_progress";
this.add(P);
this.t.addBeh(new r.default());
var R = new B.BehaviourTaskCity();
R.id = "build";
this.add(R);
this.t.addBeh(new l.default());
var M = new B.BehaviourTaskCity();
M.id = "build_docks";
this.add(M);
this.t.addBeh(new c.default());
var L = new B.BehaviourTaskCity();
L.id = "upgrade_random_building";
this.add(L);
this.t.addBeh(new w.default());
var F = new B.BehaviourTaskCity();
F.id = "supply_kingdom_cities";
this.add(F);
this.t.addBeh(new T.default());
var D = new B.BehaviourTaskCity();
D.id = "produce_resources";
this.add(D);
this.t.addBeh(new g.default());
var I = new B.BehaviourTaskCity();
I.id = "check_army";
this.add(I);
this.t.addBeh(new u.default());
var j = new B.BehaviourTaskCity();
j.id = "check_pop_points";
this.add(j);
this.t.addBeh(new p.default());
};
return e;
}(t("../AssetLibrary").default);
i.default = k;
cc._RF.pop();
}, {
"../../ai/behaviours/CityBehAddProgress": "CityBehAddProgress",
"../../ai/behaviours/CityBehBorderGrowth": "CityBehBorderGrowth",
"../../ai/behaviours/CityBehBorderSteal": "CityBehBorderSteal",
"../../ai/behaviours/CityBehBuild": "CityBehBuild",
"../../ai/behaviours/CityBehBuildDocks": "CityBehBuildDocks",
"../../ai/behaviours/CityBehCheckArmy": "CityBehCheckArmy",
"../../ai/behaviours/CityBehCheckAttackZone": "CityBehCheckAttackZone",
"../../ai/behaviours/CityBehCheckCitizenTasks": "CityBehCheckCitizenTasks",
"../../ai/behaviours/CityBehCheckPopPoints": "CityBehCheckPopPoints",
"../../ai/behaviours/CityBehCheckSettleTarget": "CityBehCheckSettleTarget",
"../../ai/behaviours/CityBehFindLeader": "CityBehFindLeader",
"../../ai/behaviours/CityBehGiveInventoryItem": "CityBehGiveInventoryItem",
"../../ai/behaviours/CityBehProduceBoat": "CityBehProduceBoat",
"../../ai/behaviours/CityBehProduceResources": "CityBehProduceResources",
"../../ai/behaviours/CityBehProduceUnit": "CityBehProduceUnit",
"../../ai/behaviours/CityBehRandomWait": "CityBehRandomWait",
"../../ai/behaviours/CityBehSupplyKingdomCities": "CityBehSupplyKingdomCities",
"../../ai/behaviours/CityBehUpgradeRandomBuilding": "CityBehUpgradeRandomBuilding",
"../../behaviour/BehaviourTaskBase": "BehaviourTaskBase",
"../AssetLibrary": "AssetLibrary"
} ],
BehaviourTaskKingdomLibrary: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "feb120S3kpDjK1JkO2pSDzp", "BehaviourTaskKingdomLibrary");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
});
Object.defineProperty(i, "__esModule", {
value: !0
});
var r = t("../../ai/behaviours/KingdomBehCheckCapital"), n = t("../../ai/behaviours/KingdomBehCheckKing"), s = t("../../ai/behaviours/KingdomBehRandomWait"), l = t("../../ai/behaviours/KingdomCheckAttackTarget"), c = t("../../ai/behaviours/KingdomCheckDeadKingdom"), u = t("../../ai/behaviours/KingdomCheckDiplomacy"), d = t("../../ai/behaviours/KingdomCheckRevolts"), h = t("../../behaviour/BehaviourTaskBase"), p = function(t) {
a(e, t);
function e() {
return null !== t && t.apply(this, arguments) || this;
}
e.prototype.init = function() {
t.prototype.init.call(this);
var e = new h.BehaviourTaskKingdom();
e.id = "nothing";
this.add(e);
var i = new h.BehaviourTaskKingdom();
i.id = "wait1";
this.add(i);
this.t.addBeh(new s.default());
var o = new h.BehaviourTaskKingdom();
o.id = "wait_random";
this.add(o);
this.t.addBeh(new s.default(0, 5));
var a = new h.BehaviourTaskKingdom();
a.id = "do_checks";
this.add(a);
this.t.addBeh(new r.default());
this.t.addBeh(new n.default());
this.t.addBeh(new s.default());
var p = new h.BehaviourTaskKingdom();
p.id = "check_dead_kingdom";
this.add(p);
this.t.addBeh(new c.default());
var f = new h.BehaviourTaskKingdom();
f.id = "check_attack_target";
this.add(f);
this.t.addBeh(new l.default());
var m = new h.BehaviourTaskKingdom();
m.id = "check_revolts";
this.add(m);
this.t.addBeh(new d.default());
var y = new h.BehaviourTaskKingdom();
y.id = "check_diplomacy";
this.add(y);
this.t.addBeh(new u.default());
};
return e;
}(t("../AssetLibrary").default);
i.default = p;
cc._RF.pop();
}, {
"../../ai/behaviours/KingdomBehCheckCapital": "KingdomBehCheckCapital",
"../../ai/behaviours/KingdomBehCheckKing": "KingdomBehCheckKing",
"../../ai/behaviours/KingdomBehRandomWait": "KingdomBehRandomWait",
"../../ai/behaviours/KingdomCheckAttackTarget": "KingdomCheckAttackTarget",
"../../ai/behaviours/KingdomCheckDeadKingdom": "KingdomCheckDeadKingdom",
"../../ai/behaviours/KingdomCheckDiplomacy": "KingdomCheckDiplomacy",
"../../ai/behaviours/KingdomCheckRevolts": "KingdomCheckRevolts",
"../../behaviour/BehaviourTaskBase": "BehaviourTaskBase",
"../AssetLibrary": "AssetLibrary"
} ],
Boat: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "5813dA4D2JH/Iqo5t1jCJeA", "Boat");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
});
Object.defineProperty(i, "__esModule", {
value: !0
});
i.AnimationDataBoat = i.BoatState = void 0;
var r, n = t("../../../../../../framework/lib/prototype/MathUtils"), s = t("../../../../../common/src/GameCommon"), l = t("../../../animation/ActorAnimationLoader"), c = t("../../../base/BaseActorComponent"), u = t("../../../building/Docks"), d = t("../../../common/ToolBox"), h = t("../../../MapBox"), p = t("../../ActorStatus"), f = t("./TaxiManager");
(function(t) {
t[t.Idle = 0] = "Idle";
t[t.IdleInsideDock = 1] = "IdleInsideDock";
t[t.GoToHomeDock = 2] = "GoToHomeDock";
t[t.StayInDock = 3] = "StayInDock";
t[t.GoTrading = 4] = "GoTrading";
t[t.MakeTrade = 5] = "MakeTrade";
t[t.TransportGoLoading = 6] = "TransportGoLoading";
t[t.TransportDoLoading = 7] = "TransportDoLoading";
t[t.TransportGoUnloading = 8] = "TransportGoUnloading";
t[t.TransportDoUnloading = 9] = "TransportDoUnloading";
})(r = i.BoatState || (i.BoatState = {}));
i.AnimationDataBoat = function() {
this.id = "";
this.dict = new Map();
this.broken = null;
this.normal = null;
};
var m = function(t) {
a(e, t);
function e() {
var e = null !== t && t.apply(this, arguments) || this;
e.curState = r.Idle;
e.animationDataBoat = null;
e.unitsInside = new Set();
e.isTransport = !1;
e.taxiRequest = null;
e.passengerWaitCounter = 0;
e._textureId = "";
e.taxiTarget = null;
e.pickup_near_dock = !1;
e.lastStep = cc.Vec3.ZERO;
return e;
}
e.prototype.create = function() {
t.prototype.create.call(this);
this.actor.callbacks_on_death.push(this.deathAction.bind(this));
this.actor.callbacks_on_death.push(this.updateBoatAnim.bind(this));
this.actor.callbacks_on_death.push(this.spawnBoatExplosion.bind(this));
this.actor.callbacks_landed.push(this.setWaterFrame.bind(this));
this.actor.callbacks_landed.push(this.cancelWork.bind(this));
this.actor.callbacks_added_madness.push(this.madnessAdded.bind(this));
this.actor.callbacks_cancel_path_movement.push(this.cancelPathfinderMovement.bind(this));
this.setState(r.Idle);
};
e.prototype.isNearDock = function() {
var t, e, i;
return !!((null === (t = this.actor) || void 0 === t ? void 0 : t.homeBuilding) && (null === (i = null === (e = this.actor) || void 0 === e ? void 0 : e.homeBuilding) || void 0 === i ? void 0 : i.getComponent(u.default).tiles_water.includes(this.actor.currentTile)));
};
e.prototype.cancelPathfinderMovement = function(t) {
this.cancelWork(t);
};
e.prototype.cancelWork = function() {
this.setState(r.Idle);
this.actor.cancelAllBeh();
if (this.taxiRequest) {
f.default.cancelRequest(this.taxiRequest);
this.taxiRequest = null;
this.taxiTarget = null;
}
};
e.prototype.updateTexture = function() {
this._textureId = "boat_fishing";
if (this.actor.kingdom) {
var t = "";
if (this.actor.kingdom.race) {
t = this.actor.kingdom.race.id;
t = this.actor.kingdom.isCiv() ? this.actor.kingdom.data.raceID : "human";
} else t = "human";
switch (this.actor.stats.id) {
case "boat_fishing":
this._textureId = "boat_fishing";
break;

case "boat_trading":
this._textureId = "boat_trading_" + t;
break;

case "boat_transport":
this._textureId = "boat_transport_" + t;
}
}
this.animationDataBoat = l.default.loadAnimationBoat(this._textureId);
var e = this.animationDataBoat.dict.get(0);
this.actor.spriteAnimation.setFrames(e.frames);
this.actor.spriteAnimation.timeBetweenFrames = e.timeBetweenFrames;
this.actor.spriteAnimation.resetAnim();
};
e.prototype.madnessAdded = function(t) {
t.getHit(1e5);
};
e.prototype.spawnBoatExplosion = function() {
h.default.inst.stackEffects.get("boatExplosion").spawnAt(this.actor.currentPosition, this.actor.stats.baseStats.scale);
};
e.prototype.logicUpdate = function(e) {
t.prototype.logicUpdate.call(this, e);
s.default.isPaused || this.updateBoatAnim();
};
e.prototype.deathAction = function() {
if (this.taxiRequest) {
f.default.finish(this.taxiRequest);
this.taxiRequest = null;
}
this.unloadUnits(this.actor.currentTile, !0);
};
e.prototype.unloadUnits = function(t, e) {
var i = this;
void 0 === e && (e = !1);
this.unitsInside.forEach(function(o) {
var a;
if (null === (a = o.data) || void 0 === a ? void 0 : a.alive) {
o.disembarkTo(i, t);
e && o.applyRandomForce();
}
});
this.unitsInside.clear();
this.taxiTarget = null;
};
e.prototype.removeFromTaxi = function(t) {
this.unitsInside.delete(t);
};
e.prototype.setState = function(t) {
t == r.StayInDock ? this.node.active = !1 : this.node.active = !0;
this.curState = t;
};
e.prototype.isState = function(t) {
return this.curState == t;
};
e.prototype.addUnitInto = function(t) {
this.unitsInside.add(t) && (this.passengerWaitCounter = 0);
};
e.prototype.updateBoatAnim = function(t) {
var e;
void 0 === t && (t = null);
this.animationDataBoat || this.updateTexture();
if (null === (e = this.actor.data) || void 0 === e ? void 0 : e.alive) {
if (0 != this.actor.zPosition.y) this.setFrames(this.animationDataBoat.normal); else if (this.actor.is_moving && this.lastStep != this.actor.nextStepPosition) {
this.lastStep = this.actor.nextStepPosition;
Math.abs(this.actor.currentPosition.x - this.actor.nextStepPosition.x);
Math.abs(this.actor.currentPosition.y - this.actor.nextStepPosition.y);
var i = n.default.intCast(57.29578 * d.Toolbox.getAngle(this.actor.currentPosition.x, this.actor.currentPosition.y, this.actor.nextStepPosition.x, this.actor.nextStepPosition.y));
this.animationDataBoat.dict.has(i) && this.setFrames(this.animationDataBoat.dict.get(i));
}
} else this.setFrames(this.animationDataBoat.broken);
};
e.prototype.setWaterFrame = function() {
var t;
(null === (t = this.actor.data) || void 0 === t ? void 0 : t.alive) && this.setFrames(this.animationDataBoat.dict.get(0));
};
e.prototype.checkBoatLimit = function() {
var t;
if (this.actor.homeBuilding && (null === (t = this.actor.homeBuilding.data) || void 0 === t ? void 0 : t.alive) && this.actor.homeBuilding.getComponent(u.default).isMoreLimit(this.actor.stats)) {
this.actor.homeBuilding.getComponent(u.default).removeBoatFromDock(this.actor);
this.actor.killHimself(!0, p.AttackType.Other, !1, !1);
}
};
e.prototype.setFrames = function(t) {
this.actor.spriteAnimation.setFrames(t.frames);
};
return e;
}(c.default);
i.default = m;
cc._RF.pop();
}, {
"../../../../../../framework/lib/prototype/MathUtils": void 0,
"../../../../../common/src/GameCommon": void 0,
"../../../MapBox": "MapBox",
"../../../animation/ActorAnimationLoader": "ActorAnimationLoader",
"../../../base/BaseActorComponent": "BaseActorComponent",
"../../../building/Docks": "Docks",
"../../../common/ToolBox": "ToolBox",
"../../ActorStatus": "ActorStatus",
"./TaxiManager": "TaxiManager"
} ],
Boulder: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "84862gCk91AJ78/Y245H0Yw", "Boulder");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
}), r = this && this.__decorate || function(t, e, i, o) {
var a, r = arguments.length, n = r < 3 ? e : null === o ? o = Object.getOwnPropertyDescriptor(e, i) : o;
if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) n = Reflect.decorate(t, e, i, o); else for (var s = t.length - 1; s >= 0; s--) (a = t[s]) && (n = (r < 3 ? a(n) : r > 3 ? a(e, i, n) : a(e, i)) || n);
return r > 3 && n && Object.defineProperty(e, i, n), n;
};
Object.defineProperty(i, "__esModule", {
value: !0
});
var n = t("../../../../../framework/lib/prototype/MathUtils"), s = t("../../assetLibrary/AssetManager"), l = t("../../brush/Brush"), c = t("../../common/ToolBox"), u = t("../../game/audio/GameAudio"), d = t("../../MapBox"), h = t("../Actor"), p = t("../ActorStatus"), f = cc._decorator, m = f.ccclass, y = (f.property, 
function(t) {
a(e, t);
function e() {
var e = null !== t && t.apply(this, arguments) || this;
e.currentBounce = 3;
e.dirX = 0;
e.dirY = 0;
e.angle = 0;
e.angleRotation = 0;
e.impactEffect = 0;
return e;
}
e.prototype.create = function() {
t.prototype.create.call(this);
this.angleRotation = c.Toolbox.randomFloat(-200, 200);
};
e.prototype.logicUpdate = function(e) {
t.prototype.logicUpdate.call(this, e);
this.impactEffect > 0 && (this.impactEffect -= e);
if (0 != this.zPosition.y) {
this.angle += this.angleRotation * e;
this.node.angle = this.angle;
}
};
e.prototype.updateForce = function(e) {
t.prototype.updateForce.call(this, e);
};
e.prototype.spawnEffect = function(t) {
if (!(this.impactEffect > 0)) {
this.impactEffect = .8;
var e = this.currentPosition.clone();
e.y -= 2;
d.default.inst.stackEffects.get(t).spawnAt(e, this.node.scaleX);
}
};
e.prototype.actionLanded = function() {
var e;
this._currentTileDirty = !0;
this.findCurrentTile();
this._positionDirty = !0;
this.updatePos();
t.prototype.actionLanded.call(this);
if (this.currentBounce > .3) {
if (this.currentBounce > 1.5) {
var i = this.currentPosition.clone();
i.y -= 2;
null === (e = d.default.inst.stackEffects.get("explosionWave").spawnNew()) || void 0 === e || e.startFlash(i, n.default.intCast(this.currentBounce), 6);
}
3 == this.currentBounce && d.default.inst.startShake();
this.currentBounce *= .7;
this.dirX /= 2;
this.dirY /= 2;
this.addForce(this.dirX, this.dirY, this.currentBounce);
if (this.inMapBorder()) {
if (this.currentTile) {
this.currentTile.type.water ? this.spawnEffect("boulderImpactWater") : this.spawnEffect("boulderImpact");
d.default.inst.drawWithBrush(this.currentTile.pos, l.default.getBrushBySize(5), 0, "boulder");
d.default.inst.applyForce(this.currentTile, 5, .5, !1);
d.default.inst.conwayLayer.checkKillRange(this.currentTile.pos, 5);
}
} else this.spawnEffect("boulderImpactWater");
} else {
this.currentTile.type.water ? this.spawnEffect("boulderImpactWater") : this.spawnEffect("boulderImpact");
this.impactEffect = 0;
this.inMapBorder() && d.default.inst.damageWorld(this.currentTile, 10, s.default.terraform.get("bomb"));
this.spawnEffect("explosionSmall");
u.default.playExplosionMeteorite();
this.killHimself(!0, p.AttackType.None, !1);
}
};
e.prototype.spawnOn = function(e, i) {
void 0 === i && (i = 0);
t.prototype.spawnOn.call(this, e, 0);
this.dirX = c.Toolbox.randomFloat(-3, 3);
this.dirY = c.Toolbox.randomFloat(-3, 3);
this.addForce(this.dirX, this.dirY, this.currentBounce);
this.zPosition.y = 50;
this.forceVector.z = -6;
};
return r([ m ], e);
}(h.default));
i.default = y;
cc._RF.pop();
}, {
"../../../../../framework/lib/prototype/MathUtils": void 0,
"../../MapBox": "MapBox",
"../../assetLibrary/AssetManager": "AssetManager",
"../../brush/Brush": "Brush",
"../../common/ToolBox": "ToolBox",
"../../game/audio/GameAudio": "GameAudio",
"../Actor": "Actor",
"../ActorStatus": "ActorStatus"
} ],
BoxGift: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "01564FlzDJC6Y0lLKnVQvNk", "BoxGift");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
}), r = this && this.__decorate || function(t, e, i, o) {
var a, r = arguments.length, n = r < 3 ? e : null === o ? o = Object.getOwnPropertyDescriptor(e, i) : o;
if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) n = Reflect.decorate(t, e, i, o); else for (var s = t.length - 1; s >= 0; s--) (a = t[s]) && (n = (r < 3 ? a(n) : r > 3 ? a(e, i, n) : a(e, i)) || n);
return r > 3 && n && Object.defineProperty(e, i, n), n;
};
Object.defineProperty(i, "__esModule", {
value: !0
});
var n = t("../../../../../framework/lib/prototype/DateUtils"), s = t("../../../../common/src/advert/AdsManager"), l = t("../../../../common/src/advert/sdk/GameTdd"), c = t("../../../../common/src/data/UserData"), u = t("../../../../common/src/GamePopBase"), d = t("../../../../common/src/MsgCache"), h = t("../../common/ViewController"), p = t("../../ui/UiController"), f = t("./AwardView"), m = cc._decorator, y = m.ccclass, _ = m.property, g = function(t) {
a(e, t);
function e() {
var e = null !== t && t.apply(this, arguments) || this;
e.video = null;
e.btnCancel = null;
return e;
}
e.prototype.onLoad = function() {
this.btnCancel.active = BYTEDANCE_GAME;
this.video.active = !1;
var t = n.default.formatDayTime();
if (c.default.member.BoxGiftNum[t]) this.video.active = BYTEDANCE_GAME || JSB_233; else {
c.default.member.BoxGiftNum = {};
c.default.member.BoxGiftNum[t] = !0;
}
};
e.prototype.clickClose = function(e) {
t.prototype.close.call(this, e);
p.default.inst.showBoxGift();
};
e.prototype.click = function() {
var t = this;
(QQ_GAME || JSB_OPPO || JSB_VIVO || BYTEDANCE_GAME || JSB_233 || JSB_MMY) && (this.video.active ? s.default.showVideoAds(function(e) {
if (1 == e) t.reward(); else {
var i = 0 == e ? "视频播放未完成。" : "视频播放失败，请稍候再试！";
d.default.pushToast(i);
}
}) : this.reward());
};
e.prototype.reward = function() {
h.default.open(h.view_type.AwardView, null, null, !1, function(t) {
t.getComponent(f.default).init(f.Reward_type.boxGift, 17);
if (!BYTEDANCE_GAME && !JSB_233) {
var e = l.default.getData("p1", l.v_type.Number) || .5;
setTimeout(function() {
s.default.showInterstitialAd(function() {});
}, 1e3 * e);
}
}, function() {
p.default.inst.showBoxGift();
});
};
r([ _(cc.Node) ], e.prototype, "video", void 0);
r([ _(cc.Node) ], e.prototype, "btnCancel", void 0);
return r([ y ], e);
}(u.GamePopBase);
i.default = g;
cc._RF.pop();
}, {
"../../../../../framework/lib/prototype/DateUtils": void 0,
"../../../../common/src/GamePopBase": void 0,
"../../../../common/src/MsgCache": void 0,
"../../../../common/src/advert/AdsManager": void 0,
"../../../../common/src/advert/sdk/GameTdd": void 0,
"../../../../common/src/data/UserData": void 0,
"../../common/ViewController": "ViewController",
"../../ui/UiController": "UiController",
"./AwardView": "AwardView"
} ],
BoxMonster: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "eafe1nrEaJCmadlLUc4YE3V", "BoxMonster");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
}), r = this && this.__decorate || function(t, e, i, o) {
var a, r = arguments.length, n = r < 3 ? e : null === o ? o = Object.getOwnPropertyDescriptor(e, i) : o;
if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) n = Reflect.decorate(t, e, i, o); else for (var s = t.length - 1; s >= 0; s--) (a = t[s]) && (n = (r < 3 ? a(n) : r > 3 ? a(e, i, n) : a(e, i)) || n);
return r > 3 && n && Object.defineProperty(e, i, n), n;
};
Object.defineProperty(i, "__esModule", {
value: !0
});
var n = t("../../../../../framework/core/event/GlobalEvent"), s = t("../../../../common/src/advert/AdsManager"), l = t("../../../../common/src/data/UserData"), c = t("../../../../common/src/GamePopBase"), u = t("../../animation/SpriteAnimation"), d = t("../../common/ToolBox"), h = t("../../common/ViewController"), p = t("../../texture/TextureLoader"), f = t("../../world/WorldTimer"), m = t("./AwardView"), y = cc._decorator, _ = y.ccclass, g = y.property, v = function(t) {
a(e, t);
function e() {
var e = null !== t && t.apply(this, arguments) || this;
e.kirbySprite = null;
e.monsterSprite = null;
e.enemySprite = null;
e.hpProgress = null;
e.btnAttack = null;
e.maxHp = 8;
e.currentHp = 0;
e.damagePerClick = 1;
e.recoverPerSecond = 2;
e.monsterDead = !1;
e.clickCount = 0;
e.bannerTimer = -1;
e.bannerShow = !1;
e.shakeTimer = new f.default(.3, !0);
e.shakeOffsetMonster = cc.v3(0, 0);
e.monsterPos = cc.v3(0, 0);
e.shakeOffsetIcon = cc.v3(0, 0);
e.iconPos = cc.v3(0, 0);
e.shakeIntervalMonster = 0;
e.shakeIntervalIcon = 0;
return e;
}
e.prototype.start = function() {
this.currentHp = this.maxHp;
this.bg.getChildByName("btnClose").active = !1;
n.default.on(n.Global_Event_Type.BACKGROUND_TO_GAME, this.onBackToGame, this);
};
e.prototype.onBackToGame = function() {
console.log("banner显示时间：", this.bannerTimer);
if (this.bannerTimer > 0) {
this.bannerTimer = 0;
this.currentHp = 0;
}
};
e.prototype.onClickAttack = function() {
if (!(this.bannerTimer > 0)) {
this.clickCount++;
if (!this.bannerShow && this.clickCount > 5 && d.Toolbox.randomBool()) {
this.bannerShow = !0;
this.bannerTimer = 2;
this.bg.getChildByName("btnClose").active = !0;
var t = this.btnAttack.parent.convertToWorldSpaceAR(this.btnAttack.position);
s.default.moveBanner(t.y);
} else {
this.currentHp -= this.damagePerClick;
this.kirbySprite.isOn = !0;
this.kirbySprite.resetAnim();
this.shakeTimer.startTimer(.5);
}
}
};
e.prototype.update = function(t) {
this.shakeTimer.logicUpdate(t);
this.kirbySprite.logicUpdate(t);
if (this.shakeTimer.isActive) {
this.shakeIntervalMonster -= t;
if (this.shakeIntervalMonster <= 0) {
this.shakeOffsetMonster.x = d.Toolbox.randomRange(-10, 10);
this.shakeOffsetMonster.y = d.Toolbox.randomRange(-10, 10);
this.shakeIntervalMonster = .05;
}
} else this.shakeOffsetMonster = cc.Vec3.ZERO;
if (this.kirbySprite.currentFrameIndex >= 12 && this.kirbySprite.currentFrameIndex < this.kirbySprite.frames.length - 1) {
this.shakeIntervalIcon -= t;
if (this.shakeIntervalIcon <= 0) {
this.shakeOffsetIcon.x = d.Toolbox.randomRange(-5, 5);
this.shakeOffsetIcon.y = d.Toolbox.randomRange(-5, 5);
this.shakeIntervalIcon = .05;
}
} else this.shakeOffsetIcon = cc.Vec3.ZERO;
this.monsterSprite.spriteFrame = this.shakeTimer.isActive ? p.TextureLoader.inst.getSpriteFrame(p.ATLAS_TYPE.UIATLAS, "reward/treasure_box_monster_1") : p.TextureLoader.inst.getSpriteFrame(p.ATLAS_TYPE.UIATLAS, "reward/treasure_box_monster_0");
this.monsterSprite.node.position = this.monsterPos.add(this.shakeOffsetMonster);
this.enemySprite.node.position = this.iconPos.add(this.shakeOffsetIcon);
if (this.bannerTimer >= 0) {
this.bannerTimer -= t;
this.bannerTimer < 0 && s.default.hideBannerAd(!1);
}
if (this.currentHp <= 0) this.doKill(); else if (!this.monsterDead) {
this.currentHp += this.recoverPerSecond * t;
this.currentHp >= this.maxHp && (this.currentHp = this.maxHp);
}
this.hpProgress.progress = this.currentHp / this.maxHp;
};
e.prototype.doKill = function() {
if (!this.monsterDead) {
this.currentHp = 0;
this.monsterDead = !0;
this.btnAttack.getComponent(cc.Button).interactable = !1;
setTimeout(function() {
h.default.open(h.view_type.AwardView, null, null, !1, function(t) {
t.getComponent(m.default).init(m.Reward_type.achiev, [ l.default.getPropConfigByID(1002) ]);
});
}, 1e3);
}
};
r([ g({
type: u.SpriteAnimation,
tooltip: "攻击小人"
}) ], e.prototype, "kirbySprite", void 0);
r([ g({
type: cc.Sprite,
tooltip: "宝箱怪"
}) ], e.prototype, "monsterSprite", void 0);
r([ g({
type: cc.Sprite,
tooltip: "宝箱怪"
}) ], e.prototype, "enemySprite", void 0);
r([ g({
type: cc.ProgressBar,
tooltip: "血量进度条"
}) ], e.prototype, "hpProgress", void 0);
r([ g(cc.Node) ], e.prototype, "btnAttack", void 0);
return r([ _ ], e);
}(c.GamePopBase);
i.default = v;
cc._RF.pop();
}, {
"../../../../../framework/core/event/GlobalEvent": void 0,
"../../../../common/src/GamePopBase": void 0,
"../../../../common/src/advert/AdsManager": void 0,
"../../../../common/src/data/UserData": void 0,
"../../animation/SpriteAnimation": "SpriteAnimation",
"../../common/ToolBox": "ToolBox",
"../../common/ViewController": "ViewController",
"../../texture/TextureLoader": "TextureLoader",
"../../world/WorldTimer": "WorldTimer",
"./AwardView": "AwardView"
} ],
BrushWindow: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "d88bdkRoyVHea/Bntw2MQ/g", "BrushWindow");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
}), r = this && this.__decorate || function(t, e, i, o) {
var a, r = arguments.length, n = r < 3 ? e : null === o ? o = Object.getOwnPropertyDescriptor(e, i) : o;
if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) n = Reflect.decorate(t, e, i, o); else for (var s = t.length - 1; s >= 0; s--) (a = t[s]) && (n = (r < 3 ? a(n) : r > 3 ? a(e, i, n) : a(e, i)) || n);
return r > 3 && n && Object.defineProperty(e, i, n), n;
}, n = this && this.__values || function(t) {
var e = "function" == typeof Symbol && Symbol.iterator, i = e && t[e], o = 0;
if (i) return i.call(t);
if (t && "number" == typeof t.length) return {
next: function() {
t && o >= t.length && (t = void 0);
return {
value: t && t[o++],
done: !t
};
}
};
throw new TypeError(e ? "Object is not iterable." : "Symbol.iterator is not defined.");
};
Object.defineProperty(i, "__esModule", {
value: !0
});
var s = t("../../../../framework/main/Constants"), l = t("../../../common/src/advert/AdsManager"), c = t("../../../common/src/data/UserData"), u = t("../../../common/src/GamePopBase"), d = t("../../../common/src/MsgCache"), h = t("../Config"), p = cc._decorator, f = p.ccclass, m = p.property, y = function(t) {
a(e, t);
function e() {
var e = null !== t && t.apply(this, arguments) || this;
e.guideNode = null;
e.brushs = [];
return e;
}
i = e;
e.prototype.onLoad = function() {
var t, e;
i.inst = this;
try {
for (var o = n(this.brushs), a = o.next(); !a.done; a = o.next()) {
var r = a.value;
r.getChildByName("video").active = !c.default.member.brushUnlock[r.name];
}
} catch (e) {
t = {
error: e
};
} finally {
try {
a && !a.done && (e = o.return) && e.call(o);
} finally {
if (t) throw t.error;
}
}
};
e.prototype.selectBrush = function(t) {
var e = this, i = t.getCurrentTarget(), o = i.getChildByName("video");
if (null == o ? void 0 : o.active) {
s.default.REPORT_ID = "unLockBrush";
l.default.showVideoAds(function(t) {
if (1 == t) {
c.default.member.brushUnlock[i.name] = !0;
c.default.save();
o.active = !1;
e.doSelect(i);
} else {
var a = 0 == t ? "视频播放未完成。" : "视频播放失败，请稍候再试！";
d.default.pushToast(a);
}
});
} else this.doSelect(i);
};
e.prototype.doSelect = function(t) {
h.default.currentBrush = t.name;
this.clickCB && this.clickCB(t);
this.close();
};
var i;
e.inst = null;
r([ m(cc.Node) ], e.prototype, "guideNode", void 0);
r([ m([ cc.Node ]) ], e.prototype, "brushs", void 0);
return i = r([ f ], e);
}(u.GamePopBase);
i.default = y;
cc._RF.pop();
}, {
"../../../../framework/main/Constants": void 0,
"../../../common/src/GamePopBase": void 0,
"../../../common/src/MsgCache": void 0,
"../../../common/src/advert/AdsManager": void 0,
"../../../common/src/data/UserData": void 0,
"../Config": "Config"
} ],
Brush: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "ce81a4rEtZCsrvbY1oXRQoT", "Brush");
var o = this && this.__values || function(t) {
var e = "function" == typeof Symbol && Symbol.iterator, i = e && t[e], o = 0;
if (i) return i.call(t);
if (t && "number" == typeof t.length) return {
next: function() {
t && o >= t.length && (t = void 0);
return {
value: t && t[o++],
done: !t
};
}
};
throw new TypeError(e ? "Object is not iterable." : "Symbol.iterator is not defined.");
};
Object.defineProperty(i, "__esModule", {
value: !0
});
i.BrushData = i.BrushPixelData = void 0;
var a = t("../../../../framework/lib/prototype/MathUtils"), r = t("../common/ToolBox"), n = t("../texture/TextureLoader"), s = function(t, e, i, o) {
this.x = 0;
this.y = 0;
this.dist = 0;
this.percentMode = 0;
this.x = t;
this.y = e;
this.dist = o;
this.percentMode = o / i;
};
i.BrushPixelData = s;
var l = function() {
this.size = 1;
this.pos = [];
this.continuous = !1;
};
i.BrushData = l;
var c = function() {
function t() {}
t.getRandom = function() {
return Array.from(t.dictionary.keys()).getRandom();
};
t.init = function() {
t.addCircle(1, !0);
t.addCircle(2, !0);
t.addCircle(4, !0);
t.addCircle(5, !0);
t.addCircle(10);
t.addCircle(11);
t.addCircle(15);
t.addDot(!0);
t.addSquare(1, !0);
t.addSquare(5, !0);
t.addSquare(10);
t.addSquare(15);
t.addSpecial("diamond_1", -1, !0);
t.addSpecial("diamond_2", -1, !0);
t.addSpecial("diamond_4", -1, !0);
t.addSpecial("diamond_5");
t.addSpecial("diamond_7");
t.addSpecial("special_1");
t.addSpecial("special_2");
t.addSpecial("special_3");
t.addSpecial("special_4", -1, !0);
t.addSpecial("special_5", -1, !0);
};
t.getBrushBySize = function(e, i) {
void 0 === i && (i = "circ_");
if (!t.dictionary.has(i + e)) {
var o = !1;
e <= 5 && (o = !0);
"circ_" == i && t.addCircle(e, o);
}
return t.dictionary.get(i + e);
};
t.getBrushByID = function(e) {
return t.dictionary.get(e);
};
t.addDot = function(e) {
void 0 === e && (e = !1);
var i = new l();
i.continuous = e;
i.size = 1;
i.pos.push(new s(0, 0, 0, 0));
t.add("sqr_0", i);
t.add("circ_0", i);
};
t.addSquare = function(e, i) {
void 0 === i && (i = !1);
var o = new l();
o.continuous = i;
o.size = e;
for (var a = -e; a <= e; a++) for (var r = -e; r <= e; r++) o.pos.push(new s(a, r, e, e));
t.add("sqr_" + e, o);
};
t.add = function(e, i) {
var a, r;
i.pos.shuffle();
var n = 0;
try {
for (var s = o(i.pos), l = s.next(); !l.done; l = s.next()) {
var c = l.value;
if (0 == c.x && 0 == c.y) {
n = i.pos.indexOf(c);
break;
}
}
} catch (t) {
a = {
error: t
};
} finally {
try {
l && !l.done && (r = s.return) && r.call(s);
} finally {
if (a) throw a.error;
}
}
var u = i.pos[0], d = i.pos[n];
i.pos[0] = d;
i.pos[n] = u;
t.dictionary.set(e, i);
};
t.addCircle = function(e, i) {
void 0 === i && (i = !1);
var o = new l();
o.continuous = i;
o.size = e;
for (var n = a.default.intCast(e / 2), c = cc.v2(n, n), u = 0, d = 0, h = -e; h <= e; h++) for (var p = -e; p <= e; p++) {
u = c.x + h;
d = c.y + p;
var f = r.Toolbox.dist(c.x, c.y, u, d);
f > e || o.pos.push(new s(h, p, e, f));
}
t.add("circ_" + e, o);
};
t.addSpecial = function(e, i, o) {
void 0 === i && (i = -1);
void 0 === o && (o = !1);
var r = "brush_" + e, c = new l();
c.continuous = o;
var u = n.TextureLoader.inst.getTexture(n.BIN_TYPE.brushes, r), d = u.width, h = u.height;
-1 == i && (i = d / 2);
c.size = i;
for (var p = cc.v2(a.default.intCast(d / 2), a.default.intCast(h / 2)), f = 0, m = 0, y = 0; y < d; y++) for (var _ = 0; _ < h; _++) if (255 == u.getPixel(y, _).a) {
f = p.x - y;
m = p.y - _;
c.pos.push(new s(f, m, i, i));
}
t.add(e, c);
};
t.dictionary = new Map();
return t;
}();
i.default = c;
cc._RF.pop();
}, {
"../../../../framework/lib/prototype/MathUtils": void 0,
"../common/ToolBox": "ToolBox",
"../texture/TextureLoader": "TextureLoader"
} ],
BuildingAnimationLoader: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "a212czmZFRHoLQQ6KzqEGCm", "BuildingAnimationLoader");
Object.defineProperty(i, "__esModule", {
value: !0
});
var o = t("./BuildingSpritesContainer"), a = function() {
function t() {}
t.init = function() {
t.buildings = t.loadBuildings("buildings/buildings_main");
t.roof_masks = t.loadBuildings("buildings/buildings_roof");
t.shadows = t.loadBuildings("buildings/buildings_shadow");
t.ruins = t.loadBuildings("buildings/buildings_ruins");
};
t.loadBuildings = function(t) {
var e = new o.default();
e.load(t);
return e;
};
t.buildings = null;
t.roof_masks = null;
t.shadows = null;
t.ruins = null;
return t;
}();
i.default = a;
cc._RF.pop();
}, {
"./BuildingSpritesContainer": "BuildingSpritesContainer"
} ],
BuildingEffectSpawnPixel: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "733c8YRGgxCcrObRiARg5rj", "BuildingEffectSpawnPixel");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
});
Object.defineProperty(i, "__esModule", {
value: !0
});
var r = t("../base/BaseBuilding"), n = t("../common/ToolBox"), s = t("../MapBox"), l = function(t) {
a(e, t);
function e() {
var e = null !== t && t.apply(this, arguments) || this;
e.spawnPixelTimer = 0;
return e;
}
e.prototype.logicUpdate = function(t) {
if (this.building.data.spawnPixelActive) if (this.spawnPixelTimer > 0) this.spawnPixelTimer -= t; else {
this.spawnPixelTimer = this.building.stats.spawnPixelInterval;
var e = s.default.inst.getTile(this.building.currentTile.pos.x, this.building.currentTile.pos.y);
e || (e = this.building.currentTile);
s.default.inst.dropManager.spawnBurstPixel(e, this.building.stats.spawnDropID, n.Toolbox.randomFloat(.5, .5), n.Toolbox.randomFloat(1, 1.3), this.building.stats.spawnPixelStartZ);
}
};
return e;
}(r.BaseBuildingComponent);
i.default = l;
cc._RF.pop();
}, {
"../MapBox": "MapBox",
"../base/BaseBuilding": "BaseBuilding",
"../common/ToolBox": "ToolBox"
} ],
BuildingFruitGrowth: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "859cbYse9RNOo4veXnzemnL", "BuildingFruitGrowth");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
});
Object.defineProperty(i, "__esModule", {
value: !0
});
var r = t("../base/BaseBuilding"), n = function(t) {
a(e, t);
function e() {
var e = null !== t && t.apply(this, arguments) || this;
e.resourceResetTime = 0;
return e;
}
e.prototype.logicUpdate = function(t) {
if (this.building.data.state == r.BuildingState.Normal && !this.building.haveResources) {
if (this.resourceResetTime > 0) {
this.resourceResetTime -= t;
return;
}
this.building.setHaveResources(!0);
this.building.setScaleTween(.75);
}
};
return e;
}(r.BaseBuildingComponent);
i.default = n;
cc._RF.pop();
}, {
"../base/BaseBuilding": "BaseBuilding"
} ],
BuildingLibrary: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "1e2f6/o0vdPh4ceL1hC7860", "BuildingLibrary");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
});
Object.defineProperty(i, "__esModule", {
value: !0
});
i.BuildingAsset = i.BuildingFundament = void 0;
var r = t("../../../../../framework/utils/Log"), n = t("../../../../../framework/utils/Tools"), s = t("../../actors/construction/ConstructionLayerDebug"), l = t("../../base/BaseStats"), c = t("../../building/BuildingMapIcon"), u = t("../../texture/TextureLoader"), d = t("../AssetLibrary"), h = t("./ResourceLibrary"), p = function(t, e, i, o) {
this.left = 0;
this.right = 0;
this.top = 0;
this.bottom = 0;
this.left = t;
this.right = e;
this.top = i;
this.bottom = o;
};
i.BuildingFundament = p;
var f = function(t) {
a(e, t);
function e() {
var e = t.call(this) || this;
e.kingdom = "";
e.fundament = null;
e.construction_site_texture = "construction_site_small";
e.ruins = "same_id";
e.destroyedSound = "";
e.isRuin = !1;
e.orderInLayer = 0;
e.mapIconId = "default";
e.resourceType = h.ResourceType.None;
e.resource_id = "";
e.resources_given = 0;
e.canBeHarvested = !1;
e.maxTreesInZone = 0;
e.treeRandomChance = .5;
e.hasKingdomColor = !1;
e.cityBuilding = !1;
e.canBeAbandoned = !1;
e.destroyOnWater = !1;
e.canBeUpgraded = !1;
e.upgradeTo = "";
e.upgradeLevel = 0;
e.type = "";
e.priority = 0;
e.shadow = !0;
e.shadowID = "-";
e.auto_remove_ruin = !1;
e.iceTower = !1;
e.spawnUnits = !1;
e.beehive = !1;
e.spawnUnits_asset = "-";
e.tower = !1;
e.tower_projectile = "";
e.tower_projectile_offset = 0;
e.ignoreOtherBuildingsForUpgrade = !1;
e.randomFlip = !1;
e.cost = null;
e.baseStats = new l.default();
e.ignoredByCities = !1;
e.buildRoadTo = !1;
e.canBeDamagedByTornado = !1;
e.canBePlacedOnWater = !1;
e.canBePlacedOnBlocks = !1;
e.onlyBuildTiles = !1;
e.checkForCloseBuilding = !1;
e.ignoreBuildings = !1;
e.ignoreDemolish = !1;
e.burnable = !1;
e.affectedByLava = !1;
e.affectedByAcid = !1;
e.fireDamage = !1;
e.housing = 0;
e.storage = !1;
e.canBeLivingHouse = !0;
e.canBeLivingPlant = !0;
e.docks = !1;
e.canBePlacedOnlyOn = [];
e.race = "";
e.smoke = !1;
e.smokeInterval = .5;
e.smokeOffset = cc.Vec2.ZERO;
e.spawnPixel = !1;
e.spawnDropID = "";
e.spawnPixelInterval = .3;
e.spawnPixelStartZ = 0;
e.transformTilesTo = "";
e.sfx = "none";
e.spawnRats = !1;
e.needsGrass = !1;
e.fauna = !1;
e.baseStats.health = 100;
e.baseStats.size = 2;
return e;
}
return e;
}(d.Asset);
i.BuildingAsset = f;
var m = function(t) {
a(e, t);
function e() {
var e = null !== t && t.apply(this, arguments) || this;
e.mapIcons = new Map();
return e;
}
e.prototype.init = function() {
var e = this;
t.prototype.init.call(this);
var i = new f();
i.id = "tree";
i.mapIconId = "tree";
i.fundament = new p(1, 0, 1, 0);
i.ruins = "tree_dead";
i.resourceType = h.ResourceType.Tree;
i.resource_id = "wood";
i.type = "trees";
i.resources_given = 3;
i.destroyOnWater = !0;
i.randomFlip = !0;
i.ignoredByCities = !0;
i.ignoreDemolish = !0;
i.burnable = !0;
i.affectedByAcid = !0;
i.maxTreesInZone = 3;
i.affectedByLava = !0;
i.sfx = "spawn_tree";
i.fauna = !0;
i.needsGrass = !0;
i.canBeDamagedByTornado = !0;
i.race = "nature";
i.kingdom = "nature";
i.checkForCloseBuilding = !1;
i.canBePlacedOnlyOn = [ "forest", "forest_soil", "grass", "grass_flowers", "forest_flowers" ];
this.add(i);
this.t.canBeLivingPlant = !0;
this.t.baseStats.health = 10;
this.clone("tree_dead", "tree");
this.t.mapIconId = this.t.id;
this.t.isRuin = !0;
this.t.burnable = !1;
this.t.needsGrass = !1;
this.t.resourceType = h.ResourceType.None;
this.t.ruins = null;
this.t.ignoreBuildings = !0;
this.t.spawnRats = !1;
this.t.baseStats.health = 1e3;
var o = new f();
o.id = "!resource";
o.fundament = new p(1, 1, 1, 0);
o.ruins = null;
o.destroyOnWater = !0;
o.randomFlip = !0;
o.ignoredByCities = !1;
o.ignoreDemolish = !0;
o.burnable = !1;
o.affectedByAcid = !0;
o.affectedByLava = !0;
o.race = "nature";
o.kingdom = "nature";
this.add(o);
this.t.canBePlacedOnBlocks = !1;
this.t.baseStats.health = 10;
this.clone("!rock_temp", "!resource");
this.t.destroyedSound = "buildingDestroyed";
this.t.ignoreBuildings = !0;
this.clone("stone", "!rock_temp");
this.t.mapIconId = "stone";
this.t.resourceType = h.ResourceType.Stone;
this.t.resource_id = "stone";
this.t.destroyOnWater = !1;
this.t.resources_given = 3;
this.t.sfx = "spawn_stone";
this.clone("stone_m", "stone");
this.t.resources_given = 2;
this.clone("stone_s", "stone");
this.t.resources_given = 1;
this.clone("ore_deposit", "!rock_temp");
this.t.mapIconId = "ore_deposit";
this.t.resourceType = h.ResourceType.Ore;
this.t.resource_id = "ore";
this.t.sfx = "spawn_ore_deposit";
this.t.resources_given = 3;
this.clone("ore_deposit_m", "ore_deposit");
this.t.resources_given = 2;
this.clone("ore_deposit_s", "ore_deposit");
this.t.resources_given = 1;
this.clone("gold", "!rock_temp");
this.t.mapIconId = "gold";
this.t.resourceType = h.ResourceType.Gold;
this.t.resource_id = "gold";
this.t.sfx = "spawn_gold";
this.t.resources_given = 3;
this.clone("gold_m", "gold");
this.t.resources_given = 2;
this.clone("gold_s", "gold");
this.t.resources_given = 1;
this.clone("fruit_bush", "!resource");
this.t.canBeLivingPlant = !0;
this.t.mapIconId = this.t.id;
this.t.resourceType = h.ResourceType.Fruits;
this.t.resource_id = "berries";
this.t.resources_given = 3;
this.t.type = "fruits";
this.t.burnable = !0;
this.t.sfx = "spawn_bush";
this.t.fauna = !0;
this.t.needsGrass = !0;
this.t.canBeDamagedByTornado = !0;
this.t.ignoredByCities = !0;
this.t.treeRandomChance = .02;
this.t.canBePlacedOnlyOn = [ "forest", "forest_soil", "grass", "soil", "forest_soil", "grass_flowers", "forest_flowers" ];
this.clone("cacti", "tree");
this.t.mapIconId = this.t.id;
this.t.maxTreesInZone = 1;
this.t.treeRandomChance = .2;
this.t.needsGrass = !1;
this.t.canBePlacedOnlyOn = [ "sand" ];
this.clone("palm", "tree");
this.t.mapIconId = this.t.id;
this.t.maxTreesInZone = 1;
this.t.treeRandomChance = .1;
this.t.needsGrass = !1;
this.t.canBePlacedOnlyOn = [ "sand" ];
this.clone("pine", "tree");
this.t.mapIconId = this.t.id;
this.t.maxTreesInZone = 3;
this.t.treeRandomChance = .5;
this.t.needsGrass = !1;
this.t.canBePlacedOnlyOn = [ "forest_soil_frozen", "forest_soil" ];
var a = new f();
a.id = "0wheat";
a.mapIconId = "0wheat";
a.fundament = new p(0, 0, 0, 0);
a.type = "crops";
a.resource_id = "wheat";
a.resources_given = 3;
a.resourceType = h.ResourceType.Wheat;
a.destroyOnWater = !0;
a.randomFlip = !0;
a.ignoredByCities = !0;
a.ignoreDemolish = !0;
a.burnable = !0;
a.affectedByAcid = !0;
a.affectedByLava = !0;
a.sfx = "spawn_tree";
a.fauna = !0;
a.canBeDamagedByTornado = !0;
a.race = "nature";
a.kingdom = "nature";
a.canBeUpgraded = !0;
a.upgradeTo = "1wheat";
a.orderInLayer = -2;
a.shadow = !1;
a.canBePlacedOnlyOn = [ "field" ];
a.ruins = null;
this.add(a);
this.t.baseStats.health = 10;
this.t.canBeLivingPlant = !1;
this.clone("1wheat", "0wheat");
this.t.mapIconId = this.t.id;
this.t.orderInLayer = 0;
this.t.upgradeTo = "2wheat";
this.clone("2wheat", "1wheat");
this.t.mapIconId = this.t.id;
this.t.upgradeTo = "3wheat";
this.clone("3wheat", "2wheat");
this.t.mapIconId = this.t.id;
this.t.upgradeTo = "4wheat";
this.clone("4wheat", "3wheat");
this.t.mapIconId = this.t.id;
this.t.upgradeTo = "";
this.t.canBeUpgraded = !1;
this.t.canBeLivingPlant = !0;
this.t.canBeHarvested = !0;
var r = new f();
r.id = "!building";
r.fundament = new p(3, 3, 2, 0);
r.destroyedSound = "buildingDestroyed";
r.burnable = !0;
r.destroyOnWater = !0;
r.buildRoadTo = !0;
r.affectedByAcid = !0;
r.affectedByLava = !0;
r.canBeDamagedByTornado = !0;
r.onlyBuildTiles = !0;
r.checkForCloseBuilding = !0;
this.add(r);
this.t.baseStats.health = 100;
this.clone("!city_building", "!building");
this.t.cityBuilding = !0;
this.t.canBeAbandoned = !0;
this.clone("!city_colored_building", "!city_building");
this.t.hasKingdomColor = !0;
this.clone("bonfire", "!city_building");
this.t.canBeAbandoned = !1;
this.t.priority = 1;
this.t.mapIconId = this.t.id;
this.t.type = "bonfire";
this.t.fundament = new p(1, 1, 2, 0);
this.t.cost = new s.ConstructionCost();
this.t.smoke = !0;
this.t.smokeInterval = 2.5;
this.t.smokeOffset = cc.v2(2, 3);
this.t.canBeLivingHouse = !1;
this.clone("well", "!city_building");
this.t.priority = 20;
this.t.mapIconId = this.t.id;
this.t.type = "well";
this.t.fundament = new p(1, 1, 1, 0);
this.t.cost = new s.ConstructionCost(0, 20, 1, 5);
this.t.burnable = !1;
this.clone("statue", "!city_building");
this.t.priority = 20;
this.t.mapIconId = this.t.id;
this.t.type = "statue";
this.t.fundament = new p(1, 1, 2, 0);
this.t.cost = new s.ConstructionCost(0, 5, 0, 25);
this.t.burnable = !1;
this.clone("docks_human", "!city_colored_building");
this.t.construction_site_texture = "construction_site_docks";
this.t.race = "human";
this.t.priority = 20;
this.t.mapIconId = this.t.id;
this.t.type = "docks";
this.t.fundament = new p(2, 2, 4, 0);
this.t.cost = new s.ConstructionCost(10, 6);
this.t.burnable = !1;
this.t.docks = !0;
this.t.canBePlacedOnWater = !0;
this.t.destroyOnWater = !1;
this.t.buildRoadTo = !1;
this.t.onlyBuildTiles = !1;
this.t.shadowID = "docks_human";
this.t.auto_remove_ruin = !0;
this.clone("docks_elf", "docks_human");
this.t.shadowID = "docks_elf";
this.t.race = "elf";
this.clone("docks_dwarf", "docks_human");
this.t.shadowID = "docks_dwarf";
this.t.race = "dwarf";
this.clone("docks_orc", "docks_human");
this.t.shadowID = "docks_orc";
this.t.race = "orc";
this.clone("mine", "!city_building");
this.t.priority = 50;
this.t.mapIconId = this.t.id;
this.t.type = "mine";
this.t.fundament = new p(2, 2, 2, 0);
this.t.cost = new s.ConstructionCost(0, 0, 0, 15);
this.t.burnable = !1;
this.clone("barracks_human", "!city_colored_building");
this.t.priority = 20;
this.t.construction_site_texture = "construction_site_medium";
this.t.mapIconId = this.t.id;
this.t.burnable = !1;
this.t.type = "barracks";
this.t.race = "human";
this.t.fundament = new p(3, 3, 4, 0);
this.t.cost = new s.ConstructionCost(0, 5, 2, 15);
this.clone("barracks_orc", "barracks_human");
this.t.mapIconId = this.t.id;
this.t.race = "orc";
this.clone("barracks_dwarf", "barracks_human");
this.t.mapIconId = this.t.id;
this.t.race = "dwarf";
this.clone("barracks_elf", "barracks_human");
this.t.mapIconId = this.t.id;
this.t.race = "elf";
this.clone("temple_human", "!city_colored_building");
this.t.priority = 20;
this.t.construction_site_texture = "construction_site_medium";
this.t.mapIconId = this.t.id;
this.t.type = "temple";
this.t.fundament = new p(2, 2, 3, 0);
this.t.cost = new s.ConstructionCost(0, 10, 2, 30);
this.t.burnable = !1;
this.t.shadowID = "temple_human";
this.t.race = "human";
this.clone("temple_orc", "temple_human");
this.t.mapIconId = this.t.id;
this.t.shadowID = "temple_orc";
this.t.race = "orc";
this.clone("temple_dwarf", "temple_human");
this.t.mapIconId = this.t.id;
this.t.shadowID = "temple_dwarf";
this.t.race = "dwarf";
this.clone("temple_elf", "temple_human");
this.t.mapIconId = this.t.id;
this.t.shadowID = "temple_elf";
this.t.race = "elf";
this.clone("tent_human", "!city_colored_building");
this.t.mapIconId = this.t.id;
this.t.race = "human";
this.t.type = "house";
this.t.cost = new s.ConstructionCost();
this.t.fundament = new p(2, 2, 2, 0);
this.t.canBeUpgraded = !0;
this.t.housing = 1;
this.t.burnable = !0;
this.t.upgradeTo = "1house_human";
this.t.storage = !0;
this.clone("house_human", "!city_colored_building");
this.t.mapIconId = this.t.id;
this.t.type = "house";
this.t.cost = new s.ConstructionCost(5);
this.t.fundament = new p(1, 1, 2, 0);
this.t.canBeUpgraded = !0;
this.t.housing = 2;
this.t.burnable = !0;
this.t.upgradeTo = "house_human";
this.t.storage = !0;
this.t.race = "human";
this.clone("1house_human", "house_human");
this.t.mapIconId = this.t.id;
this.t.cost = new s.ConstructionCost(4);
this.t.housing = 3;
this.t.upgradeLevel = 1;
this.t.upgradeTo = "2house_human";
this.t.baseStats.health = 150;
this.t.race = "human";
this.clone("2house_human", "1house_human");
this.t.mapIconId = this.t.id;
this.t.cost = new s.ConstructionCost(0, 5);
this.t.housing = 4;
this.t.upgradeLevel = 2;
this.t.burnable = !1;
this.t.upgradeTo = "3house_human";
this.t.baseStats.health = 200;
this.t.race = "human";
this.clone("3house_human", "2house_human");
this.t.mapIconId = this.t.id;
this.t.fundament = new p(2, 2, 2, 0);
this.t.cost = new s.ConstructionCost(0, 10);
this.t.housing = 5;
this.t.upgradeLevel = 3;
this.t.upgradeTo = "4house_human";
this.t.baseStats.health = 250;
this.t.race = "human";
this.clone("4house_human", "3house_human");
this.t.mapIconId = this.t.id;
this.t.fundament = new p(3, 3, 2, 0);
this.t.cost = new s.ConstructionCost(0, 15);
this.t.housing = 5;
this.t.upgradeLevel = 4;
this.t.upgradeTo = "5house_human";
this.t.baseStats.health = 350;
this.t.race = "human";
this.clone("5house_human", "4house_human");
this.t.mapIconId = this.t.id;
this.t.cost = new s.ConstructionCost(0, 20, 2, 10);
this.t.housing = 7;
this.t.upgradeLevel = 5;
this.t.canBeUpgraded = !1;
this.t.baseStats.health = 400;
this.t.race = "human";
this.clone("hall_human", "house_human");
this.t.priority = 100;
this.t.mapIconId = this.t.id;
this.t.type = "hall";
this.t.cost = new s.ConstructionCost(10, 0, 0, 10);
this.t.construction_site_texture = "construction_site_medium";
this.t.fundament = new p(3, 3, 4, 0);
this.t.canBeUpgraded = !0;
this.t.baseStats.health = 200;
this.t.burnable = !0;
this.t.housing = 3;
this.t.upgradeTo = "1hall_human";
this.t.ignoreOtherBuildingsForUpgrade = !0;
this.t.race = "human";
this.clone("1hall_human", "hall_human");
this.t.mapIconId = this.t.id;
this.t.cost = new s.ConstructionCost(0, 10, 1, 20);
this.t.housing = 5;
this.t.upgradeLevel = 1;
this.t.burnable = !1;
this.t.upgradeTo = "2hall_human";
this.t.baseStats.health = 400;
this.t.race = "human";
this.clone("2hall_human", "1hall_human");
this.t.mapIconId = this.t.id;
this.t.cost = new s.ConstructionCost(0, 15, 1, 100);
this.t.housing = 10;
this.t.upgradeLevel = 2;
this.t.canBeUpgraded = !1;
this.t.baseStats.health = 600;
this.t.race = "human";
this.clone("tent_orc", "tent_human");
this.t.mapIconId = this.t.id;
this.t.fundament = new p(2, 2, 2, 0);
this.t.upgradeTo = "house_orc";
this.t.race = "orc";
this.clone("house_orc", "house_human");
this.t.mapIconId = this.t.id;
this.t.fundament = new p(1, 1, 2, 0);
this.t.upgradeTo = "1house_orc";
this.t.race = "orc";
this.clone("1house_orc", "1house_human");
this.t.mapIconId = this.t.id;
this.t.fundament = new p(1, 1, 2, 0);
this.t.upgradeTo = "2house_orc";
this.t.race = "orc";
this.clone("2house_orc", "2house_human");
this.t.mapIconId = this.t.id;
this.t.fundament = new p(1, 1, 2, 0);
this.t.upgradeTo = "3house_orc";
this.t.race = "orc";
this.clone("3house_orc", "3house_human");
this.t.mapIconId = this.t.id;
this.t.fundament = new p(2, 2, 2, 0);
this.t.upgradeTo = "4house_orc";
this.t.race = "orc";
this.clone("4house_orc", "4house_human");
this.t.mapIconId = this.t.id;
this.t.fundament = new p(3, 3, 2, 0);
this.t.upgradeTo = "5house_orc";
this.t.race = "orc";
this.clone("5house_orc", "5house_human");
this.t.mapIconId = this.t.id;
this.t.fundament = new p(3, 3, 2, 0);
this.t.race = "orc";
this.clone("tent_elf", "tent_human");
this.t.mapIconId = this.t.id;
this.t.fundament = new p(2, 2, 2, 0);
this.t.upgradeTo = "house_elf";
this.t.race = "elf";
this.clone("house_elf", "house_human");
this.t.mapIconId = this.t.id;
this.t.fundament = new p(1, 1, 2, 0);
this.t.upgradeTo = "1house_elf";
this.t.race = "elf";
this.clone("1house_elf", "1house_human");
this.t.mapIconId = this.t.id;
this.t.fundament = new p(1, 1, 2, 0);
this.t.upgradeTo = "2house_elf";
this.t.race = "elf";
this.clone("2house_elf", "2house_human");
this.t.mapIconId = this.t.id;
this.t.fundament = new p(1, 1, 2, 0);
this.t.upgradeTo = "3house_elf";
this.t.race = "elf";
this.clone("3house_elf", "3house_human");
this.t.mapIconId = this.t.id;
this.t.fundament = new p(2, 2, 2, 0);
this.t.upgradeTo = "4house_elf";
this.t.race = "elf";
this.clone("4house_elf", "4house_human");
this.t.mapIconId = this.t.id;
this.t.fundament = new p(3, 3, 2, 0);
this.t.upgradeTo = "5house_elf";
this.t.race = "elf";
this.clone("5house_elf", "5house_human");
this.t.mapIconId = this.t.id;
this.t.fundament = new p(3, 3, 2, 0);
this.t.race = "elf";
this.clone("tent_dwarf", "tent_human");
this.t.mapIconId = this.t.id;
this.t.fundament = new p(2, 2, 2, 0);
this.t.upgradeTo = "house_dwarf";
this.t.race = "dwarf";
this.clone("house_dwarf", "house_human");
this.t.mapIconId = this.t.id;
this.t.fundament = new p(1, 1, 2, 0);
this.t.upgradeTo = "1house_dwarf";
this.t.race = "dwarf";
this.clone("1house_dwarf", "1house_human");
this.t.mapIconId = this.t.id;
this.t.fundament = new p(1, 1, 2, 0);
this.t.upgradeTo = "2house_dwarf";
this.t.race = "dwarf";
this.clone("2house_dwarf", "2house_human");
this.t.mapIconId = this.t.id;
this.t.fundament = new p(1, 1, 2, 0);
this.t.upgradeTo = "3house_dwarf";
this.t.race = "dwarf";
this.clone("3house_dwarf", "3house_human");
this.t.mapIconId = this.t.id;
this.t.fundament = new p(2, 2, 2, 0);
this.t.upgradeTo = "4house_dwarf";
this.t.race = "dwarf";
this.t.housing = 6;
this.clone("4house_dwarf", "4house_human");
this.t.mapIconId = this.t.id;
this.t.fundament = new p(3, 3, 2, 0);
this.t.upgradeTo = "5house_dwarf";
this.t.race = "dwarf";
this.t.housing = 8;
this.clone("5house_dwarf", "5house_human");
this.t.mapIconId = this.t.id;
this.t.fundament = new p(3, 3, 2, 0);
this.t.race = "dwarf";
this.t.housing = 10;
this.clone("hall_orc", "hall_human");
this.t.mapIconId = this.t.id;
this.t.fundament = new p(3, 3, 4, 0);
this.t.upgradeTo = "1hall_orc";
this.t.race = "orc";
this.clone("1hall_orc", "1hall_human");
this.t.mapIconId = this.t.id;
this.t.fundament = new p(3, 3, 4, 0);
this.t.upgradeTo = "2hall_orc";
this.t.race = "orc";
this.clone("2hall_orc", "2hall_human");
this.t.fundament = new p(3, 3, 4, 0);
this.t.mapIconId = this.t.id;
this.t.race = "orc";
this.clone("hall_elf", "hall_human");
this.t.mapIconId = this.t.id;
this.t.fundament = new p(3, 3, 4, 0);
this.t.upgradeTo = "1hall_elf";
this.t.race = "elf";
this.clone("1hall_elf", "1hall_human");
this.t.fundament = new p(3, 3, 4, 0);
this.t.mapIconId = this.t.id;
this.t.upgradeTo = "2hall_elf";
this.t.race = "elf";
this.clone("2hall_elf", "2hall_human");
this.t.fundament = new p(3, 3, 4, 0);
this.t.mapIconId = this.t.id;
this.t.race = "elf";
this.clone("hall_dwarf", "hall_human");
this.t.mapIconId = this.t.id;
this.t.fundament = new p(3, 3, 4, 0);
this.t.upgradeTo = "1hall_dwarf";
this.t.race = "dwarf";
this.clone("1hall_dwarf", "1hall_human");
this.t.fundament = new p(3, 3, 4, 0);
this.t.mapIconId = this.t.id;
this.t.upgradeTo = "2hall_dwarf";
this.t.race = "dwarf";
this.clone("2hall_dwarf", "2hall_human");
this.t.fundament = new p(3, 3, 4, 0);
this.t.mapIconId = this.t.id;
this.t.race = "dwarf";
this.clone("tumor", "!building");
this.t.mapIconId = this.t.id;
this.t.transformTilesTo = "soil_creep";
this.t.fundament = new p(1, 1, 1, 0);
this.t.race = "tumor";
this.t.kingdom = "tumor";
this.t.canBePlacedOnBlocks = !1;
this.t.canBePlacedOnWater = !1;
this.t.ignoreBuildings = !0;
this.t.checkForCloseBuilding = !1;
this.t.canBeLivingHouse = !1;
this.t.spawnUnits = !0;
this.t.spawnUnits_asset = "tumor_monster_animal";
this.clone("goldenBrain", "!building");
this.t.baseStats.health = 1e3;
this.t.mapIconId = this.t.id;
this.t.fundament = new p(1, 1, 2, 0);
this.t.race = "goldenBrain";
this.t.kingdom = "goldenBrain";
this.t.canBePlacedOnWater = !1;
this.t.ignoreBuildings = !0;
this.t.checkForCloseBuilding = !1;
this.t.canBeLivingHouse = !0;
this.t.burnable = !1;
this.clone("corruptedBrain", "!building");
this.t.baseStats.health = 1e3;
this.t.mapIconId = this.t.id;
this.t.fundament = new p(1, 1, 2, 0);
this.t.race = "corruptedBrain";
this.t.kingdom = "corruptedBrain";
this.t.canBePlacedOnWater = !1;
this.t.ignoreBuildings = !0;
this.t.checkForCloseBuilding = !1;
this.t.canBeLivingHouse = !0;
this.t.burnable = !1;
this.t.tower = !0;
this.t.tower_projectile = "madness";
this.t.tower_projectile_offset = 6;
this.clone("beehive", "!building");
this.t.baseStats.health = 100;
this.t.mapIconId = this.t.id;
this.t.fundament = new p(1, 0, 1, 0);
this.t.race = "nature";
this.t.kingdom = "nature";
this.t.canBePlacedOnWater = !1;
this.t.ignoreBuildings = !0;
this.t.checkForCloseBuilding = !1;
this.t.canBeLivingHouse = !0;
this.t.burnable = !0;
this.t.spawnUnits = !0;
this.t.beehive = !0;
this.t.canBePlacedOnlyOn = [ "forest", "forest_soil", "grass", "grass_flowers", "forest_flowers" ];
this.t.spawnUnits_asset = "bee";
this.clone("flameTower", "!building");
this.t.baseStats.health = 1e3;
this.t.mapIconId = this.t.id;
this.t.fundament = new p(2, 2, 3, 0);
this.t.race = "demon";
this.t.kingdom = "demons";
this.t.canBePlacedOnWater = !1;
this.t.ignoreBuildings = !0;
this.t.checkForCloseBuilding = !1;
this.t.canBeLivingHouse = !0;
this.t.burnable = !1;
this.t.spawnUnits = !0;
this.t.spawnUnits_asset = "demon";
this.t.tower = !0;
this.t.tower_projectile = "fireball";
this.t.tower_projectile_offset = 10;
this.clone("iceTower", "!building");
this.t.baseStats.health = 1e3;
this.t.mapIconId = this.t.id;
this.t.fundament = new p(3, 3, 4, 0);
this.t.race = "walker";
this.t.kingdom = "walkers";
this.t.canBePlacedOnWater = !1;
this.t.ignoreBuildings = !0;
this.t.checkForCloseBuilding = !1;
this.t.canBeLivingHouse = !0;
this.t.burnable = !1;
this.t.iceTower = !0;
this.t.spawnUnits = !0;
this.t.spawnUnits_asset = "walker";
this.clone("volcano", "!building");
this.t.mapIconId = this.t.id;
this.t.race = "nature";
this.t.kingdom = "nature";
this.t.burnable = !1;
this.t.fundament = new p(2, 2, 2, 0);
this.t.canBePlacedOnBlocks = !0;
this.t.fireDamage = !0;
this.t.destroyOnWater = !1;
this.t.ignoredByCities = !1;
this.t.affectedByLava = !1;
this.t.canBePlacedOnWater = !0;
this.t.smoke = !0;
this.t.smokeInterval = 1.5;
this.t.smokeOffset = cc.v2(2, 2);
this.t.spawnPixel = !0;
this.t.spawnDropID = "lava";
this.t.spawnPixelStartZ = 4;
this.t.spawnPixelInterval = .1;
this.t.canBeDamagedByTornado = !1;
this.t.ignoreBuildings = !0;
this.t.checkForCloseBuilding = !1;
this.t.canBeLivingHouse = !1;
this.clone("geyser", "volcano");
this.t.mapIconId = this.t.id;
this.t.fireDamage = !1;
this.t.smoke = !0;
this.t.smokeInterval = 2.5;
this.t.spawnDropID = "rain";
this.t.spawnPixelStartZ = 3;
this.clone("geyserAcid", "geyser");
this.t.mapIconId = this.t.id;
this.t.smoke = !0;
this.t.smokeInterval = 3.5;
this.t.spawnDropID = "acid";
this.t.affectedByAcid = !1;
this.t.spawnPixelStartZ = 2;
this.list.forEach(function(t) {
u.TextureLoader.inst.getSpriteFrames(u.ATLAS_TYPE.WORLDATLAS, "buildingsmini").get(t.mapIconId) || (t.mapIconId = "default");
e.loadMapIcon(t.mapIconId);
});
};
e.prototype.loadMapIcon = function(t) {
if (!this.mapIcons.has(t)) try {
this.mapIcons.set(t, new c.default(t));
} catch (e) {
r.default.d("ERROR LOADING BUILDING ICON: " + t);
}
};
e.prototype.clone = function(t, e) {
var i = JSON.parse(JSON.stringify(this.get(e))), o = n.default.fromJson(i, new f());
o.id = t;
this.add(o);
return o;
};
return e;
}(d.default);
i.default = m;
cc._RF.pop();
}, {
"../../../../../framework/utils/Log": void 0,
"../../../../../framework/utils/Tools": void 0,
"../../actors/construction/ConstructionLayerDebug": "ConstructionLayerDebug",
"../../base/BaseStats": "BaseStats",
"../../building/BuildingMapIcon": "BuildingMapIcon",
"../../texture/TextureLoader": "TextureLoader",
"../AssetLibrary": "AssetLibrary",
"./ResourceLibrary": "ResourceLibrary"
} ],
BuildingMapIcon: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "98ae3THwzJLRrbKymV7yjyw", "BuildingMapIcon");
Object.defineProperty(i, "__esModule", {
value: !0
});
i.BuildingColorPixel = void 0;
var o = t("../texture/TextureLoader"), a = function() {};
i.BuildingColorPixel = a;
var r = function() {
function t(t) {
this.tex = [];
this.width = 0;
this.height = 0;
var e = o.TextureLoader.inst.getTexture(o.BIN_TYPE.buildingsmini, t);
this.width = e.width;
this.height = e.height;
for (var i = 0; i < this.height; i++) {
for (var r = [], n = 0; n < this.width; n++) {
var s = e.getPixel(n, i);
0 == s.a && (s = cc.Color.TRANSPARENT);
r[n] = new a();
r[n].color = s;
if (0 != s.a) {
var l = e.getPixel(n, i);
l.r *= .7;
l.g *= .7;
l.b *= .7;
r[n].color_ruin = l;
} else r[n].color_ruin = cc.Color.TRANSPARENT;
}
this.tex[i] = r;
}
}
t.prototype.getGrey = function(t) {
return cc.color(.7 * t.r, .7 * t.g, .7 * t.b);
};
t.prototype.getColor = function(t, e, i) {
return t >= this.width || e >= this.height ? cc.Color.TRANSPARENT : i ? this.tex[e][t].color_ruin : this.tex[e][t].color;
};
return t;
}();
i.default = r;
cc._RF.pop();
}, {
"../texture/TextureLoader": "TextureLoader"
} ],
BuildingSmokeEffect: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "b978cQFq8FF/7qvuCgOeC4h", "BuildingSmokeEffect");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
});
Object.defineProperty(i, "__esModule", {
value: !0
});
var r = t("../base/BaseBuilding"), n = t("../MapBox"), s = t("./Building"), l = function(t) {
a(e, t);
function e() {
var e = null !== t && t.apply(this, arguments) || this;
e.smokeTimer = 0;
e.centerTopVec = cc.Vec3.ZERO;
return e;
}
e.prototype.create = function() {
var e, i, o;
t.prototype.create.call(this);
var a = this.building;
this.centerTopVec.x = a.currentTile.pos.x;
this.centerTopVec.y = a.currentTile.pos.y + (null === (o = null === (i = null === (e = a.spriteRenderer) || void 0 === e ? void 0 : e.spriteFrame) || void 0 === i ? void 0 : i.getOriginalSize()) || void 0 === o ? void 0 : o.height) * s.default.defaultScale.y;
};
e.prototype.logicUpdate = function() {
var t, e, i, o;
if ((null === (e = null === (t = this.building) || void 0 === t ? void 0 : t.stats) || void 0 === e ? void 0 : e.smoke) && !(null === (o = null === (i = this.building) || void 0 === i ? void 0 : i.data) || void 0 === o ? void 0 : o.underConstruction)) {
if (this.smokeTimer > 0) {
this.smokeTimer -= cc.director.getDeltaTime();
return;
}
this.smokeTimer = this.building.stats.smokeInterval;
n.default.inst.particlesSmoke.spawn(this.centerTopVec.x, this.centerTopVec.y, !0);
}
};
return e;
}(r.BaseBuildingComponent);
i.default = l;
cc._RF.pop();
}, {
"../MapBox": "MapBox",
"../base/BaseBuilding": "BaseBuilding",
"./Building": "Building"
} ],
BuildingSpritesContainer: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "d959fPVz/pCwLxHBdmB0043", "BuildingSpritesContainer");
Object.defineProperty(i, "__esModule", {
value: !0
});
var o = t("../../../../framework/utils/Log"), a = t("../base/BaseBuilding"), r = t("../texture/TextureLoader"), n = function() {
function t() {
this.dict = new Map();
this.dict_sprites = new Map();
}
t.prototype.getAnim = function(t) {
this.dict.has(t) || o.default.d("NO BUILDING ANIM: " + t);
return this.dict.get(t);
};
t.prototype.load = function(t) {
var e = this;
r.TextureLoader.inst.getSpriteFrames(r.ATLAS_TYPE.WORLDATLAS, t).forEach(function(t, i) {
e.dict_sprites.set(i, t);
e.addBuildingData(i, t);
});
};
t.prototype.addBuildingData = function(t, e) {
var i = t.split("#"), o = i[0], r = i[1].includes("@"), n = null;
if (this.dict.has(o)) n = this.dict.get(o); else {
(n = new a.BuildingAnimationData()).animated = r;
n.idle = new a.BuildingAnimation(.1);
this.dict.set(o, n);
}
n.idle.frames.push(e);
};
return t;
}();
i.default = n;
cc._RF.pop();
}, {
"../../../../framework/utils/Log": void 0,
"../base/BaseBuilding": "BaseBuilding",
"../texture/TextureLoader": "TextureLoader"
} ],
BuildingTower: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "8d6b3nCYlhOEL/snBaSUHBq", "BuildingTower");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
});
Object.defineProperty(i, "__esModule", {
value: !0
});
var r = t("../base/BaseBuilding"), n = t("../common/ToolBox"), s = t("../MapBox"), l = function(t) {
a(e, t);
function e() {
var e = null !== t && t.apply(this, arguments) || this;
e.check_enemies_timeout = 1;
e.check_enemies_interval = 3;
e.chunksInRadius = [];
e.best_target = null;
e.best_dist = 0;
e.cur_dist = 0;
e.testShooting = !1;
return e;
}
e.prototype.create = function() {
t.prototype.create.call(this);
this.chunksInRadius = [];
for (var e = this.building.currentTile.chunk.x - 2, i = this.building.currentTile.chunk.y - 2, o = 0; o < 4; o++) for (var a = 0; a < 4; a++) {
var r = s.default.inst.mapChunkManager.get(e + o, i + a);
r && this.chunksInRadius.push(r);
}
};
e.prototype.logicUpdate = function(e) {
t.prototype.logicUpdate.call(this, e);
if (this.check_enemies_timeout > 0) this.check_enemies_timeout -= e; else {
this.check_enemies_timeout = this.check_enemies_interval + n.Toolbox.randomFloat(0, this.check_enemies_interval);
this.checkEnemies();
}
};
e.prototype.checkEnemies = function() {
var t, e = this;
n.Toolbox.temp_list_objects.clear();
this.best_dist = 1e4;
this.best_target = null;
this.chunksInRadius.forEach(function(t) {
n.Toolbox.findEnemiesOfKingdomInChunk(t, e.building.kingdom);
});
n.Toolbox.temp_list_objects.forEach(function(t) {
t.forEach(function(t) {
e.cur_dist = n.Toolbox.distTile(e.building.currentTile, t.currentTile);
if (!e.best_target || e.cur_dist < e.best_dist) {
e.best_dist = e.cur_dist;
e.best_target = t;
}
});
});
if (null === (t = this.best_target) || void 0 === t ? void 0 : t.currentTile) {
this.building.startShake(.1);
var i = cc.v3(this.building.currentTile.posV3.x, this.building.currentTile.posV3.y);
i.y += this.building.stats.tower_projectile_offset;
s.default.inst.stackEffects.startProjectile(i, this.best_target.currentTile.posV3, this.building.stats.tower_projectile);
}
};
return e;
}(r.BaseBuildingComponent);
i.default = l;
cc._RF.pop();
}, {
"../MapBox": "MapBox",
"../base/BaseBuilding": "BaseBuilding",
"../common/ToolBox": "ToolBox"
} ],
Building: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "5fc317DfkdAbKl12VhAMNTG", "Building");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
}), r = this && this.__decorate || function(t, e, i, o) {
var a, r = arguments.length, n = r < 3 ? e : null === o ? o = Object.getOwnPropertyDescriptor(e, i) : o;
if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) n = Reflect.decorate(t, e, i, o); else for (var s = t.length - 1; s >= 0; s--) (a = t[s]) && (n = (r < 3 ? a(n) : r > 3 ? a(e, i, n) : a(e, i)) || n);
return r > 3 && n && Object.defineProperty(e, i, n), n;
};
Object.defineProperty(i, "__esModule", {
value: !0
});
var n = t("../../../../framework/lib/prototype/MathUtils"), s = t("../../../../framework/utils/iTween"), l = t("../../../../framework/utils/Log"), c = t("../../../common/src/data/AchievData"), u = t("../../../common/src/GameCommon"), d = t("../actors/ActorStatus"), h = t("../animation/BuildingAnimationLoader"), p = t("../animation/MapObjectShadow"), f = t("../animation/SpriteAnimation"), m = t("../assetLibrary/AssetManager"), y = t("../assetLibrary/lib/BuildingLibrary"), _ = t("../assetLibrary/lib/ResourceLibrary"), g = t("../base/BaseBuilding"), v = t("../base/BaseSimObject"), b = t("../common/SmoothLoader"), T = t("../common/ToolBox"), w = t("../Config"), B = t("../game/audio/GameAudio"), k = t("../map/map/MapLayer"), A = t("../map/tile/TileType"), S = t("../MapBox"), x = t("./Beehive"), C = t("./BuildingEffectSpawnPixel"), O = t("./BuildingFruitGrowth"), P = t("./BuildingSmokeEffect"), R = t("./BuildingTower"), M = t("./Docks"), L = t("./IceTower"), F = t("./TumorBuilding"), D = t("./UnitSpawner"), I = t("./Wheat"), j = cc._decorator, E = j.ccclass, N = (j.property, 
function(t) {
a(e, t);
function e() {
var e = null !== t && t.apply(this, arguments) || this;
e.positionDirty = !1;
e.sprite_dirty = !1;
e.data = new g.BuildingData();
e.stats = new y.BuildingAsset();
e.haveResources = !1;
e.tiles = [];
e.frontTiles = [];
e.doorTile = null;
e.animData = null;
e.curTween = null;
e.shakeTimer = .3;
e.shakeOffset = cc.Vec3.ZERO;
e.zones = [];
e.animationState = g.BuildingAnimationState.Normal;
e.untouchableTimer = 4;
e.components = [];
e.roof = null;
e.scaleVal = 0;
e.scale_vector = cc.Vec3.ZERO;
e.lastGlobalScale = -1;
e.tween_scale_start = 0;
e.tween_scale_target = 1;
e.tween_scale_time = 0;
e.tween_scale_duration = 1;
e.tween_value = 1;
e.tween_active = !1;
e.chopped = !1;
e._is_visible = !0;
e._autoRemoveTimer = 0;
e.timerShakeResource = 0;
e.mapIcon = null;
return e;
}
i = e;
e.prototype.create = function() {
t.prototype.create.call(this);
this.setObjectType(k.MapObjectType.Building);
this.tiles = [];
var e = this.node.getChildByName("main");
this.spriteRenderer = e.getComponent(cc.Sprite);
this.spriteAnimation = e.getComponent(f.SpriteAnimation);
};
e.prototype.isBurnable = function() {
return !(this.data.health <= 0) && this.stats.burnable;
};
e.prototype.stopFire = function() {
this.removeStatusEffect("burning");
};
e.prototype.addComp = function(t) {
this.components.push(t);
t.create();
};
e.prototype.setBuilding = function(t, e, o) {
var a, r, n, s;
if (o) {
this.setData(o);
this.setTemplate(e);
this.stats.cityBuilding || (null === (a = this.data) || void 0 === a ? void 0 : a.state) != g.BuildingState.Null || this.setState(g.BuildingState.Normal);
e.resourceType != _.ResourceType.None && this.setHaveResources(!0);
!this.stats.cityBuilding || (null === (r = this.data) || void 0 === r ? void 0 : r.cityID) || (null === (n = this.data) || void 0 === n ? void 0 : n.alive) || this.makeAbandoned();
} else {
this.setData(new g.BuildingData());
this.setTemplate(e);
this.data.objectID = S.default.inst.mapStats.getNextId("building");
this.data.mainX = t.pos.x;
this.data.mainY = t.pos.y;
this.setState(g.BuildingState.Normal);
this.updateStats();
this.data.health = this.curStats.health;
e.resourceType != _.ResourceType.None && this.setHaveResources(!0);
this.data.spawnPixelActive = this.stats.spawnPixel;
}
this.statsDirty = !0;
this.currentTile = t;
this.currentPosition = this.currentTile.posV3;
this.currentTile.tile_down ? this.doorTile = this.currentTile.tile_down : this.doorTile = this.currentTile;
this.node.setScale(cc.v3(i.defaultScale.x, 0, i.defaultScale.z));
this.scale_vector.x = i.defaultScale.x;
this.scale_vector.y = i.defaultScale.y;
this.fillFrontTiles();
this.fillTiles();
this.stats.cityBuilding || (this.data.underConstruction = !1);
if (null === (s = this.data) || void 0 === s ? void 0 : s.underConstruction) this.setSpriteUnderConstruction(); else {
var l = -1;
o && (l = o.frameID);
this.setSpriteMain();
if (-1 != l) {
this.finishScaleTween();
this.spriteAnimation.currentFrameIndex = l;
this.spriteAnimation.forceUpdateFrame();
}
}
this.sprite_dirty = !0;
this.positionDirty = !0;
this.updatePosition();
e.smoke && this.addComp(this.node.addComponent(P.default));
e.spawnPixel && this.addComp(this.node.addComponent(C.default));
"tumor" == e.race && this.addComp(this.node.addComponent(F.default));
e.resourceType == _.ResourceType.Wheat && this.addComp(this.node.addComponent(I.default));
e.resourceType == _.ResourceType.Fruits && this.addComp(this.node.addComponent(O.default));
e.iceTower && this.addComp(this.node.addComponent(L.default));
e.spawnUnits && this.addComp(this.node.addComponent(D.default));
e.beehive && this.addComp(this.node.addComponent(x.default));
e.docks && this.addComp(this.node.addComponent(M.default));
e.tower && this.addComp(this.node.addComponent(R.default));
if (!o && !e.cityBuilding) {
this.setAnimationState(g.BuildingAnimationState.Normal);
this.setScaleTween();
}
this.data.state == g.BuildingState.Ruins && this.setSpriteRuin();
if (this.stats.cityBuilding && !this.kingdom) {
this.setKingdom(S.default.inst.kingdoms.getKingdomByID("abandoned"));
this.setState(g.BuildingState.CivAbandoned);
this.sprite_dirty = !0;
}
};
e.prototype.setData = function(e) {
this.data = e;
t.prototype.setData.call(this, e);
};
e.prototype.setHaveResources = function(t) {
var e;
this.haveResources = t;
switch (null === (e = this.stats) || void 0 === e ? void 0 : e.resourceType) {
case _.ResourceType.Fruits:
for (var i = 0, o = this.spriteAnimation.frames, a = 0; a < o.length && o[a] != this.spriteRenderer.spriteFrame; a++) i++;
this.haveResources ? this.animData = h.default.buildings.dict.get("fruit_bush") : this.animData = h.default.buildings.dict.get("fruit_bush_empty");
this.spriteAnimation.setFrames(this.animData.idle.frames);
i > this.spriteAnimation.frames.length - 1 && (i = 0);
this.spriteRenderer.spriteFrame = this.spriteAnimation.frames[i];
break;

case _.ResourceType.None:
case _.ResourceType.Tree:
case _.ResourceType.Stone:
case _.ResourceType.Ore:
case _.ResourceType.Gold:
}
};
e.prototype.setSpriteUnderConstruction = function() {
var t = this.stats.construction_site_texture;
this.animData = h.default.buildings.dict.get(t);
this.spriteAnimation.isOn = this.animData.animated;
this.spriteAnimation.setFrames(this.animData.idle.frames);
this.spriteAnimation.currentFrameIndex = T.Toolbox.randomInt(0, this.spriteAnimation.frames.length);
this.spriteAnimation.forceUpdateFrame();
this.spriteRenderer.node.color = cc.Color.WHITE;
this.spriteChanged();
this.setScaleTween();
};
e.prototype.setScaleTween = function(t, e) {
void 0 === t && (t = 0);
void 0 === e && (e = .2);
if (b.default.isLoading()) this.finishScaleTween(); else if (this.animationState == g.BuildingAnimationState.Normal) {
this.tween_scale_start = t;
this.tween_scale_target = 1;
this.tween_scale_time = 0;
this.tween_scale_duration = e;
this.tween_active = !0;
}
};
e.prototype.finishScaleTween = function() {
this.setAnimationState(g.BuildingAnimationState.Normal);
this.tween_scale_start = 0;
this.tween_scale_target = 1;
this.tween_scale_duration = 1;
this.tween_scale_time = this.tween_scale_duration;
this.tween_value = 1;
this.tween_active = !1;
this.lastGlobalScale = -1;
this.scale_vector.y = -100;
};
e.prototype.onEnable = function() {
this._is_visible = !0;
};
e.prototype.onDisable = function() {
this._is_visible = !1;
};
e.prototype.canBeUpgraded = function() {
var t, e;
return !((null === (t = this.data) || void 0 === t ? void 0 : t.underConstruction) || null === (e = this.data) || void 0 === e || !e.alive) && this.stats.canBeUpgraded;
};
e.prototype.upgradeBulding = function() {
if (this.canBeUpgraded()) {
var t = m.default.buildings.get(this.stats.upgradeTo);
if (t.fundament.left == this.stats.fundament.left && t.fundament.right == this.stats.fundament.right && t.fundament.top == this.stats.fundament.top && t.fundament.bottom == this.stats.fundament.bottom || this.checkTilesForUpgrade(this.currentTile, t)) {
this.city && this.city.setBuildingDictID(this, !1);
this.setTemplate(t);
this.city && this.city.setBuildingDictID(this, !0);
this.setSpriteMain();
this.updateStats();
this.data.health = this.curStats.health;
this.fillTiles();
this.checkBuildingUpgradeAchievement();
}
}
};
e.prototype.setTemplate = function(t) {
t || cc.log("pTemplate为空");
this.stats = t;
this.data.templateID = this.stats.id;
this.stats.kingdom && this.setKingdom(S.default.inst.kingdoms.dict_hidden.get(this.stats.kingdom));
this.mapIcon = m.default.buildings.mapIcons.get(this.stats.mapIconId);
this.node.name = this.stats.id;
};
e.prototype.setKingdom = function(t, e) {
var i, o, a;
void 0 === e && (e = !0);
if (t) {
if (this.kingdom) {
if (this.kingdom != t) {
this.kingdom.buildings.remove(this);
this.kingdom = t;
this.kingdom.buildings.add(this);
}
} else {
this.kingdom = t;
this.kingdom.buildings.add(this);
}
this.stats.docks && this.kingdom.isCiv() && this.getComponent(M.default).setKingdom(t);
} else {
this.kingdom && this.kingdom.buildings.remove(this);
this.kingdom = null;
this.sprite_dirty = !0;
}
if (this.stats.cityBuilding && (null === (i = this.data) || void 0 === i ? void 0 : i.alive)) if (this.kingdom && this.kingdom.isCiv() && !this.isRuin()) {
this.setState(g.BuildingState.CivKingdom);
this.sprite_dirty = !0;
} else this.setState(g.BuildingState.CivAbandoned);
if (e && this.stats.cityBuilding && !this.kingdom) if ((null === (o = this.data) || void 0 === o ? void 0 : o.state) == g.BuildingState.Ruins) {
this.kingdom = S.default.inst.kingdoms.getKingdomByID("ruins");
this.kingdom.buildings.add(this);
} else if ((null === (a = this.data) || void 0 === a ? void 0 : a.state) == g.BuildingState.CivAbandoned) {
this.kingdom = S.default.inst.kingdoms.getKingdomByID("abandoned");
this.kingdom.buildings.add(this);
}
};
e.prototype.setState = function(t) {
if (this.data.state != g.BuildingState.Removed && this.data.state != g.BuildingState.Ruins) {
if (t == g.BuildingState.Ruins) {
this.data.health = 5 * this.curStats.health;
this.curStats.health = this.data.health;
this.sprite_dirty = !0;
}
this.data.state = t;
}
};
e.prototype.checkTilesForUpgrade = function(t, e) {
for (var i = null, o = t.pos.x - e.fundament.left, a = t.pos.y - e.fundament.bottom, r = e.fundament.right + e.fundament.left + 1, n = e.fundament.top + e.fundament.bottom + 1, s = 0; s < r; s++) for (var l = 0; l < n; l++) {
if (!(i = S.default.inst.getTile(o + s, a + l))) return !1;
if (!i.type.canBuildOn) return !1;
if (i.zone.city != this.city) return !1;
var c = i.building;
if (c && c != this) {
if (c.stats.priority >= this.stats.priority) return !1;
if (c.stats.upgradeLevel >= this.stats.upgradeLevel) return !1;
}
}
return !0;
};
e.prototype.setRandomTemplate = function() {
var t = [];
if ("house" == this.stats.type) if (this.stats.id.includes("human")) {
t.push("tent_human");
t.push("house_human");
t.push("1house_human");
t.push("2house_human");
t.push("3house_human");
t.push("4house_human");
t.push("5house_human");
} else if (this.stats.id.includes("elf")) {
t.push("tent_elf");
t.push("house_elf");
t.push("1house_elf");
t.push("2house_elf");
t.push("3house_elf");
t.push("4house_elf");
t.push("5house_elf");
} else if (this.stats.id.includes("orc")) {
t.push("tent_orc");
t.push("house_orc");
t.push("1house_orc");
t.push("2house_orc");
t.push("3house_orc");
t.push("4house_orc");
t.push("5house_orc");
} else if (this.stats.id.includes("dwarf")) {
t.push("tent_dwarf");
t.push("house_dwarf");
t.push("1house_dwarf");
t.push("2house_dwarf");
t.push("3house_dwarf");
t.push("4house_dwarf");
t.push("5house_dwarf");
}
if ("hall" == this.stats.type) if (this.stats.id.includes("human")) {
t.push("hall_human");
t.push("1hall_human");
t.push("2hall_human");
} else if (this.stats.id.includes("elf")) {
t.push("hall_elf");
t.push("1hall_elf");
t.push("2hall_elf");
} else if (this.stats.id.includes("orc")) {
t.push("hall_orc");
t.push("1hall_orc");
t.push("2hall_orc");
} else if (this.stats.id.includes("dwarf")) {
t.push("hall_dwarf");
t.push("1hall_dwarf");
t.push("2hall_dwarf");
}
if (0 != t.length) {
this.setTemplate(m.default.buildings.get(t.getRandom()));
this.setSpriteMain();
}
};
e.prototype.setSpriteMain = function(t) {
void 0 === t && (t = !0);
var e = this.stats.id;
this.animData = h.default.buildings.getAnim(e);
this.spriteAnimation.isOn = this.animData.animated;
this.spriteAnimation.setFrames(this.animData.idle.frames);
this.animData.animated && (this.spriteAnimation.timeBetweenFrames = this.animData.idle.timeBetweenFrames);
this.spriteAnimation.currentFrameIndex = T.Toolbox.randomInt(0, this.spriteAnimation.frames.length);
this.data.frameID = this.spriteAnimation.currentFrameIndex;
this.spriteAnimation.forceUpdateFrame();
this.spriteChanged();
if (this.stats.randomFlip) {
var i = T.Toolbox.randomBool() ? 1 : -1;
this.node.scaleX *= i;
}
this.sprite_dirty = !0;
!b.default.isLoading() && t && this.setScaleTween();
};
e.prototype.checkSpriteLayers = function() {
this.sprite_dirty = !1;
this.checkRoof();
this.checkShadow();
this.data.state == g.BuildingState.CivAbandoned ? this.spriteRenderer.node.color = T.Toolbox.color_abandoned_building : this.spriteRenderer.node.color = T.Toolbox.color_white;
};
e.prototype.checkShadow = function() {
if (this.stats.shadow) {
this.shadow || (this.shadow = this.node.getChildByName("shadow").getComponent(p.default));
if (this.shadow && this.spriteRenderer.spriteFrame) {
var t = this.getSpriteName(this.spriteRenderer.spriteFrame.name), e = h.default.shadows.dict_sprites.get(t);
e ? this.shadow.spriteRenderer.spriteFrame = e : l.default.d("Sprite is missing: " + this.spriteRenderer.spriteFrame.name);
}
}
};
e.prototype.checkRoof = function() {
if (!this.isAnimationState(g.BuildingAnimationState.OnRuin)) {
this.roof || (this.roof = this.node.getChildByName("roof").getComponent(cc.Sprite));
if (this.stats.hasKingdomColor && this.data.state != g.BuildingState.Ruins) {
this.roof.node.active = !0;
if (this.spriteRenderer.spriteFrame) {
var t = this.getSpriteName(this.spriteRenderer.spriteFrame.name);
this.roof.spriteFrame = h.default.roof_masks.dict_sprites.get(t);
this.roof && (this.kingdom && this.kingdom.isCiv() ? this.roof.node.color = this.kingdom.kingdomColor.colorBorderInside : this.roof.node.color = m.default.raceLibrary.get(this.stats.race).color_abandoned);
}
} else this.roof.node.active = !1;
}
};
e.prototype.getSpriteName = function(t) {
var e = "buildings-buildings_main-";
t.includes("ruins") && (e = "buildings-buildings_ruins-");
return t.substring(e.length);
};
e.prototype.fillFrontTiles = function() {
this.frontTiles = [];
for (var t = this.currentTile.pos.x - this.stats.fundament.left, e = this.stats.fundament.right + this.stats.fundament.left + 1, i = 0; i < e; i++) {
var o = S.default.inst.getTile(t + i, this.doorTile.pos.y);
this.frontTiles.push(o);
}
};
e.prototype.fillTiles = function() {
0 != this.tiles.length && this.clearTiles();
for (var t = this.currentTile.pos.x - this.stats.fundament.left, e = this.currentTile.pos.y - this.stats.fundament.bottom, i = this.stats.fundament.right + this.stats.fundament.left + 1, o = this.stats.fundament.top + this.stats.fundament.bottom + 1, a = 0; a < i; a++) for (var r = 0; r < o; r++) {
var n = S.default.inst.getTile(t + a, e + r);
n && this.setBuildingTile(n, a, r);
}
};
e.prototype.setBuildingTile = function(t, e, i) {
t.building && t.building != this && t.building.startRemove();
S.default.inst.setTileDirty(t);
t.building = this;
t.buildingX = e;
t.buildingY = i;
if (!this.tiles.includes(t)) {
this.tiles.push(t);
if (!this.zones.includes(t.zone)) {
this.zones.push(t.zone);
t.zone.addBuilding(this);
}
}
if (this.stats.transformTilesTo) {
var o = A.TileType.get(this.stats.transformTilesTo);
S.default.inst.terraformTile2(t, o, m.default.terraform.get("nothing"));
}
};
e.prototype.retake = function() {
var t = this;
this.setState(g.BuildingState.CivKingdom);
this.data.alive = !0;
this.sprite_dirty = !0;
this.zones.forEach(function(e) {
e.removeBuilding(t);
e.addBuilding(t);
});
};
e.prototype.makeAbandoned = function() {
var t = this;
this.data && (this.data.cityID = "");
0 != this.zones.length && this.zones.forEach(function(e) {
e.buildings.delete(t);
e.addBuilding(t);
});
this.tiles.forEach(function(t) {
S.default.inst.setTileDirty(t);
});
};
e.prototype.isRuin = function() {
var t, e;
return !(this.stats && (null === (t = this.stats) || void 0 === t || !t.isRuin) && null !== (e = this.data) && void 0 !== e && e.alive && this.data.state != g.BuildingState.Ruins);
};
e.prototype.isAbandoned = function() {
return this.data.state == g.BuildingState.CivAbandoned;
};
e.prototype.isNonUsable = function() {
return !(!this.isRuin() && !this.isAbandoned());
};
e.prototype.startDestroyBuilding = function(t) {
var e, i;
void 0 === t && (t = !1);
this.sprite_dirty = !0;
this.setOnMakeRuin();
this.setState(g.BuildingState.Ruins);
(!(null === (e = this.stats) || void 0 === e ? void 0 : e.ruins) || (null === (i = this.data) || void 0 === i ? void 0 : i.underConstruction)) && (t = !0);
if (t) {
this.setSpriteRuin();
this.startRemove();
} else this.setKingdom(S.default.inst.kingdoms.getKingdomByID("ruins"));
};
e.prototype.clearZoneBuilding = function() {
var t = this;
this.zones.forEach(function(e) {
e.removeBuilding(t);
});
};
e.prototype.kill = function() {
var t, e = this;
if (null === (t = this.data) || void 0 === t ? void 0 : t.alive) {
this.clearZoneBuilding();
this.data.alive = !1;
this.stats.cityBuilding && !this.stats.isRuin && S.default.inst.mapStats.housesDestroyed++;
if (this.city) {
this.city.removeBuilding(this);
this.clearCityZones();
this.setCity(null, !1);
this.setKingdom(S.default.inst.kingdoms.getKingdomByID("ruins"));
}
this.zones.forEach(function(t) {
t.addBuilding(e);
});
}
};
e.prototype.clearCityZones = function() {
var t = this;
this.clearZoneBuilding();
this.city && this.zones.forEach(function(e) {
e.buildings.size <= 0 && t.city.removeZone(e);
});
};
e.prototype.clearZones = function() {
this.clearZoneBuilding();
this.zones = [];
};
e.prototype.setCity = function(t, e) {
var i;
void 0 === e && (e = !0);
this.city = t;
if (t && this.data && (null === (i = this.city) || void 0 === i ? void 0 : i.data)) {
this.data.cityID = this.city.data.cityID;
e && this.setKingdom(t.kingdom);
} else {
this.data && (this.data.cityID = "");
e && this.setKingdom(null);
}
};
e.prototype.setSpriteRuin = function() {
var t, e;
if (null === (t = this.stats) || void 0 === t ? void 0 : t.ruins) {
this.clearZoneBuilding();
this.zones.clear();
this.clearTiles();
if (!(null === (e = this.data) || void 0 === e ? void 0 : e.underConstruction)) {
var i = this.stats.ruins;
if (this.animData.animated) {
this.spriteAnimation.currentFrameIndex = 0;
this.spriteAnimation.forceUpdateFrame();
}
if ("same_id" == this.stats.ruins) {
if (this.spriteRenderer.spriteFrame) {
var o = this.getSpriteName(this.spriteRenderer.spriteFrame.name);
this.spriteRenderer.spriteFrame = h.default.ruins.dict_sprites.get(o);
}
b.default.isLoading() || this.setScaleTween();
} else {
this.setTemplate(m.default.buildings.get(i));
this.setSpriteMain(!1);
}
}
this.fillTiles();
}
};
e.prototype.spriteChanged = function() {
this.spriteAnimation.isOn && !this.getComponent(g.BuildingAnimationUpdated) && this.addComponent(g.BuildingAnimationUpdated);
};
e.prototype.updateStats = function() {
t.prototype.updateStats.call(this);
this.curStats.clear();
this.curStats.addStats(this.stats.baseStats);
};
e.prototype.chopTree = function() {
B.default.playTreeFall(this.node.position);
this.chopped = !0;
this.haveResources = !1;
var t = T.Toolbox.randomBool() ? 90 : -90;
this.curTween = cc.tween(this.node).to(1 / w.default.timeScale, {
angle: t
}, {
easing: "expoIn"
}).to(.5 / w.default.timeScale, {
scaleX: 0
}, {
easing: "expoIn"
}).call(this.finishChop.bind(this)).start();
this.shadow && (this.shadow.node.active = !1);
};
e.prototype.finishChop = function() {
this.startRemove();
this.cancelTween();
};
e.prototype.startRemove = function() {
this.setAnimationState(g.BuildingAnimationState.OnRemove);
this.clearTiles();
};
e.prototype.isAnimationState = function(t) {
return this.animationState == t;
};
e.prototype.setOnMakeRuin = function() {
var t, e, i;
if (!this.isAnimationState(g.BuildingAnimationState.OnRuin) && (null === (t = this.data) || void 0 === t ? void 0 : t.state) != g.BuildingState.Ruins) {
this.setAnimationState(g.BuildingAnimationState.OnRuin);
!(null === (e = this.data) || void 0 === e ? void 0 : e.underConstruction) && (null === (i = this.data) || void 0 === i ? void 0 : i.alive) && B.default.playBuildingDestroyed(this.currentTile.posV3);
}
};
e.prototype.destroyBuilding = function() {
this.setState(g.BuildingState.Removed);
this.cancelTween();
this.setAnimationState(g.BuildingAnimationState.Normal);
this.clearZones();
this.kill();
this.setKingdom(null, !1);
S.default.inst.removeBuildingFully(this);
this.clearTiles();
c.default.update(73, S.default.inst.mapStats.housesDestroyed, !0);
};
e.prototype.clearTiles = function() {
if (this.tiles && this.tiles.length > 0) {
this.tiles.forEach(function(t) {
t.building = null;
S.default.inst.setTileDirty(t);
});
this.tiles.clear();
}
};
e.prototype.cancelTween = function() {
if (this.curTween) {
this.curTween.stop();
this.curTween = null;
}
this.tween_scale_start = 1;
this.tween_scale_target = 1;
};
e.prototype.updateTweens = function() {
if (!this.curTween) switch (this.animationState) {
case g.BuildingAnimationState.OnRuin:
this.cancelTween();
w.default.timeScale > 10 ? this.completeMakingRuin() : this.curTween = cc.tween(this.node).to(.1, {
scaleY: .7 * i.defaultScale.y
}, {
easing: "cubicIn"
}).call(this.completeMakingRuin.bind(this)).start();
break;

case g.BuildingAnimationState.OnRemove:
this.cancelTween();
var t = 0, e = "backIn";
if (this.chopped) {
e = "cubicIn";
t = i.defaultScale.y;
}
this.curTween = cc.tween(this.node).to(.5, {
scaleY: t
}, {
easing: e
}).call(this.destroyBuilding.bind(this)).start();
this.stats.cityBuilding && (this.shakeTimer = .5);
}
};
e.prototype.setAnimationState = function(t) {
this.animationState = t;
};
e.prototype.completeMakingRuin = function() {
this.kill();
this.cancelTween();
this.sprite_dirty = !0;
this.setAnimationState(g.BuildingAnimationState.Normal);
this.setSpriteRuin();
this.node.setScale(i.defaultScale);
this.setScaleTween();
};
e.prototype.forceScale = function(t) {
this._is_visible = !0;
this.lastGlobalScale = t;
this.scaleVal = 0;
if (this.scale_vector.y != this.scaleVal) {
this.scale_vector.x = i.defaultScale.x;
this.scale_vector.y = this.scaleVal;
this.scale_vector.z = i.defaultScale.z;
this.node.setScale(this.scale_vector);
}
};
e.prototype.updateScale = function(t) {
if (this._is_visible && (this.tween_active || S.default.inst.qualityChanger.changeModTween != this.lastGlobalScale)) {
this.lastGlobalScale = S.default.inst.qualityChanger.changeModTween;
if (this.tween_active && this.tween_scale_time < this.tween_scale_duration) {
this.tween_scale_time += t;
if (this.tween_scale_time >= this.tween_scale_duration) {
this.tween_scale_time = this.tween_scale_duration;
this.tween_active = !1;
}
this.tween_scale_time == this.tween_scale_duration ? this.tween_value = 1 : this.tween_value = s.default.easeOutBack(this.tween_scale_start, this.tween_scale_target, this.tween_scale_time / this.tween_scale_duration);
} else this.tween_value = 1;
this.scaleVal = S.default.inst.qualityChanger.tweenBuildings * this.tween_value;
if (this.scale_vector.y != this.scaleVal) {
this.scale_vector.y = this.scaleVal;
this.scale_vector.z = i.defaultScale.z;
this.node.setScale(this.scale_vector);
}
}
};
e.prototype.logicUpdate = function(t) {
var e;
this.node.scaleY < 0 && (this.node.scaleY = Math.abs(this.node.scaleY));
this.base_data.timeExists += t;
this.sprite_dirty && this.checkSpriteLayers();
this.statsDirty && this.updateStats();
!this.stats.auto_remove_ruin || this.data.state != g.BuildingState.Ruins && this.data.state != g.BuildingState.CivAbandoned || (this._autoRemoveTimer < 300 ? this._autoRemoveTimer += t : this.startRemove());
this.shakeTimer > 0 && this.updateShake(t);
this.positionDirty && this.updatePosition();
this.updateTweens();
this.updateScale(t);
this.untouchableTimer > 0 && (this.untouchableTimer -= t);
if (!u.default.isPaused) {
this.updateStatusEffects(t);
(null === (e = this.data) || void 0 === e ? void 0 : e.alive) && this.components.forEach(function(e) {
e.logicUpdate(t);
});
this.timerShakeResource > 0 && (this.timerShakeResource -= t);
this.spriteAnimation.logicUpdate(t);
}
};
e.prototype.updatePosition = function() {
if (this.positionDirty) {
this.positionDirty = !1;
var t = this.currentTile.posV3;
t.z = t.y + .15;
t.z < 0 && (t.z = 0);
this.node.position = t.add(this.shakeOffset);
}
};
e.prototype.spawnBurstSpecial = function(t, e, i) {
void 0 === t && (t = 1);
void 0 === e && (e = 1);
void 0 === i && (i = 1);
for (var o = 0; o < t; o++) S.default.inst.dropManager.spawnBurstPixel(this.currentTile, this.stats.spawnDropID, T.Toolbox.randomFloat(.2, .5 * e), T.Toolbox.randomFloat(1.3, 1 * i));
};
e.prototype.updateBuild = function(t) {
void 0 === t && (t = 1);
this.data.progress += t;
this.shakeTimer = .3;
if (this.data.progress > 10) {
this.data.progress = 10;
this.data.underConstruction = !1;
this.setSpriteMain();
this.setScaleTween(.25);
this.checkBuildingCompleteAchievement();
} else this.setScaleTween(.75);
};
e.prototype.startShake = function(t) {
this.shakeTimer = t;
};
e.prototype.resourceGathering = function() {
var t;
if (!(this.timerShakeResource > 0)) {
this.shakeTimer = .3;
this.timerShakeResource = 1;
switch (null === (t = this.stats) || void 0 === t ? void 0 : t.resourceType) {
case _.ResourceType.Tree:
B.default.playChopping(this.node.position);
break;

case _.ResourceType.Stone:
case _.ResourceType.Ore:
case _.ResourceType.Gold:
B.default.playMining(this.node.position);
break;

case _.ResourceType.None:
case _.ResourceType.Fruits:
}
}
};
e.prototype.updateShake = function(t) {
if (this.shakeTimer > 0) {
this.shakeOffset.set(cc.v3(T.Toolbox.randomFloat(-.2, .2), T.Toolbox.randomFloat(-.2, .2), 0));
this.positionDirty = !0;
this.shakeTimer -= t;
if (this.shakeTimer < 0) {
this.positionDirty = !0;
this.shakeOffset.set(cc.Vec3.ZERO);
}
}
};
e.prototype.getHit = function(t, e, i, o, a) {
void 0 === e && (e = !0);
void 0 === i && (i = d.AttackType.Other);
void 0 === o && (o = null);
void 0 === a && (a = !0);
if (!this.isAnimationState(g.BuildingAnimationState.OnRuin) || !this.curTween) {
this.data.health -= n.default.intCast(t);
this.setScaleTween(.75);
this.shakeTimer = .3;
this.data.health <= 0 && (this.data.state == g.BuildingState.Ruins ? this.startDestroyBuilding(!0) : this.startDestroyBuilding());
}
};
e.prototype.extractResources = function(t) {
var e;
void 0 === t && (t = 1);
this.setScaleTween(.75);
switch (null === (e = this.stats) || void 0 === e ? void 0 : e.resourceType) {
case _.ResourceType.Wheat:
this.startDestroyBuilding(!0);
break;

case _.ResourceType.Tree:
this.chopTree();
break;

case _.ResourceType.Fruits:
this.getComponent(O.default).resourceResetTime = 90;
this.setHaveResources(!1);
}
return t;
};
e.prototype.getColor = function(t) {
var e;
return this.isNonUsable() && !(null === (e = this.stats) || void 0 === e ? void 0 : e.isRuin) ? this.mapIcon.getColor(t.buildingX, t.buildingY, !0) : this.mapIcon.getColor(t.buildingX, t.buildingY, !1);
};
e.prototype.checkResourceAmount = function(t) {
t <= 0 ? this.startRemove() : this.stats.id.includes("_s");
};
e.prototype.changeResourceSprite = function(t) {
var e = this.stats.id;
e = (e = e.replace("_s", "")).replace("_m", "");
e += t;
this.setTemplate(m.default.buildings.get(e));
this.setSpriteMain();
this.setScaleTween(.75);
};
e.prototype.getConstructionTile = function() {
var t, e = this, i = null;
T.Toolbox.temp_list_tiles.clear();
if (null === (t = this.stats) || void 0 === t ? void 0 : t.docks) {
this.checkZoneForDockConstruction(this.currentTile.zone);
this.currentTile.zone.neighboursAll.forEach(function(t) {
e.checkZoneForDockConstruction(t);
});
T.Toolbox.temp_list_tiles.length > 0 && (i = T.Toolbox.temp_list_tiles.getRandom());
} else i = T.Toolbox.getRandom(this.tiles);
return i;
};
e.prototype.checkZoneForDockConstruction = function(t) {
var e = this;
t.city && t.city == this.city && t.tiles.forEach(function(t) {
!t.type.ground || T.Toolbox.distTile(e.currentTile, t) > 7 || T.Toolbox.temp_list_tiles.push(t);
});
};
e.prototype.checkBuildingCompleteAchievement = function() {
"house" == this.stats.type ? "human" == this.stats.race && c.default.update(1) : "mine" == this.stats.type ? c.default.update(27) : "docks" == this.stats.type && c.default.update(30);
};
e.prototype.checkBuildingUpgradeAchievement = function() {
if ("hall" == this.stats.type) if (1 == this.stats.upgradeLevel) c.default.update(25); else if (2 == this.stats.upgradeLevel) {
c.default.update(31);
if (this.kingdom.cities.length >= 10) {
var t = 0;
this.kingdom.cities.forEach(function(e) {
2 == e.getHallLevel() && t++;
});
t == this.kingdom.cities.length && c.default.update(55, 10, !0);
}
}
};
var i;
e.defaultScale = cc.v3(.25, .25, .25);
return i = r([ E ], e);
}(v.default));
i.default = N;
cc._RF.pop();
}, {
"../../../../framework/lib/prototype/MathUtils": void 0,
"../../../../framework/utils/Log": void 0,
"../../../../framework/utils/iTween": void 0,
"../../../common/src/GameCommon": void 0,
"../../../common/src/data/AchievData": void 0,
"../Config": "Config",
"../MapBox": "MapBox",
"../actors/ActorStatus": "ActorStatus",
"../animation/BuildingAnimationLoader": "BuildingAnimationLoader",
"../animation/MapObjectShadow": "MapObjectShadow",
"../animation/SpriteAnimation": "SpriteAnimation",
"../assetLibrary/AssetManager": "AssetManager",
"../assetLibrary/lib/BuildingLibrary": "BuildingLibrary",
"../assetLibrary/lib/ResourceLibrary": "ResourceLibrary",
"../base/BaseBuilding": "BaseBuilding",
"../base/BaseSimObject": "BaseSimObject",
"../common/SmoothLoader": "SmoothLoader",
"../common/ToolBox": "ToolBox",
"../game/audio/GameAudio": "GameAudio",
"../map/map/MapLayer": "MapLayer",
"../map/tile/TileType": "TileType",
"./Beehive": "Beehive",
"./BuildingEffectSpawnPixel": "BuildingEffectSpawnPixel",
"./BuildingFruitGrowth": "BuildingFruitGrowth",
"./BuildingSmokeEffect": "BuildingSmokeEffect",
"./BuildingTower": "BuildingTower",
"./Docks": "Docks",
"./IceTower": "IceTower",
"./TumorBuilding": "TumorBuilding",
"./UnitSpawner": "UnitSpawner",
"./Wheat": "Wheat"
} ],
BurnedTilesLayer: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "66c3ev2l4NCuKPzVj2ZISeU", "BurnedTilesLayer");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
}), r = this && this.__decorate || function(t, e, i, o) {
var a, r = arguments.length, n = r < 3 ? e : null === o ? o = Object.getOwnPropertyDescriptor(e, i) : o;
if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) n = Reflect.decorate(t, e, i, o); else for (var s = t.length - 1; s >= 0; s--) (a = t[s]) && (n = (r < 3 ? a(n) : r > 3 ? a(e, i, n) : a(e, i)) || n);
return r > 3 && n && Object.defineProperty(e, i, n), n;
};
Object.defineProperty(i, "__esModule", {
value: !0
});
var n = t("../../common/ToolBox"), s = t("../map/MapLayer"), l = cc._decorator, c = l.ccclass, u = l.property, d = function(t) {
a(e, t);
function e() {
var e = null !== t && t.apply(this, arguments) || this;
e.color = cc.Color.TRANSPARENT;
e.worldBehaviour = null;
return e;
}
e.prototype.onLoad = function() {
this.colorValues = cc.color(this.color.r, this.color.g, this.color.b, 127.5);
this.colors_amount = 15;
this.autoDisable = !1;
this.enabled = !0;
t.prototype.create.call(this);
};
e.prototype.setTileDirty = function(t) {
this.pixels_to_update.contains(t) || this.pixels_to_update.add(t);
};
e.prototype.updateDirty = function() {
var t = this;
if (!(this.pixels_to_update.length() <= 0)) {
this.pixels_to_update.dict.forEach(function(e, i) {
i.burned_stages > 0 ? t.updateSinglePixel(i.data.tile_id, t.colors[i.burned_stages - 1]) : t.updateSinglePixel(i.data.tile_id, n.Toolbox.clear);
});
this.pixels_to_update.clear();
this.updatePixels();
}
};
r([ u(cc.Color) ], e.prototype, "color", void 0);
return r([ c ], e);
}(s.default);
i.default = d;
cc._RF.pop();
}, {
"../../common/ToolBox": "ToolBox",
"../map/MapLayer": "MapLayer"
} ],
CachedRaycastIslands: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "cd6ec+vh/hFgroSBbtNZ5hd", "CachedRaycastIslands");
Object.defineProperty(i, "__esModule", {
value: !0
});
i.RaycastResult = void 0;
var o;
(function(t) {
t[t.Possible = 0] = "Possible";
t[t.NotPossible = 1] = "NotPossible";
t[t.NotCalculated = 2] = "NotCalculated";
})(o = i.RaycastResult || (i.RaycastResult = {}));
var a = function() {
function t() {}
t.debug = function() {
return t.hash.size.toString();
};
t.add = function(e, i, a, r) {
var n = t.getID(e, i, a);
r ? t.hash.set(n, o.Possible) : t.hash.set(n, o.NotPossible);
};
t.getResult = function(e, i, a) {
var r = t.getID(e, i, a);
return t.hash.has(r) ? t.hash.get(r) : o.NotCalculated;
};
t.getID = function(t, e, i) {
return t.chunk.x + "_" + t.chunk.y + "_" + t.region.island.id + "_" + e.region.island.id + "_" + i.dieInLava.toString() + "_" + i.dieInWater.toString() + "_" + i.isBoat.toString();
};
t.clear = function() {
t.hash.clear();
};
t.hash = new Map();
return t;
}();
i.default = a;
cc._RF.pop();
}, {} ],
CensusInfo: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "8098fV78fhNMa/QBAXieDyx", "CensusInfo");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
}), r = this && this.__decorate || function(t, e, i, o) {
var a, r = arguments.length, n = r < 3 ? e : null === o ? o = Object.getOwnPropertyDescriptor(e, i) : o;
if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) n = Reflect.decorate(t, e, i, o); else for (var s = t.length - 1; s >= 0; s--) (a = t[s]) && (n = (r < 3 ? a(n) : r > 3 ? a(e, i, n) : a(e, i)) || n);
return r > 3 && n && Object.defineProperty(e, i, n), n;
}, n = this && this.__values || function(t) {
var e = "function" == typeof Symbol && Symbol.iterator, i = e && t[e], o = 0;
if (i) return i.call(t);
if (t && "number" == typeof t.length) return {
next: function() {
t && o >= t.length && (t = void 0);
return {
value: t && t[o++],
done: !t
};
}
};
throw new TypeError(e ? "Object is not iterable." : "Symbol.iterator is not defined.");
};
Object.defineProperty(i, "__esModule", {
value: !0
});
i.CensusInfo = void 0;
var s = t("../../../../common/src/GamePopBase"), l = t("../../common/StatsHelper"), c = cc._decorator, u = c.ccclass, d = c.property, h = function(t) {
a(e, t);
function e() {
var e = null !== t && t.apply(this, arguments) || this;
e.valueNode = null;
return e;
}
e.prototype.start = function() {
this.showValues();
};
e.prototype.showValues = function() {
var t, e;
try {
for (var i = n(this.valueNode.children), o = i.next(); !o.done; o = i.next()) {
var a = o.value, r = l.default.getStatistic(a.name);
a.getComponent(cc.RichText).string = r;
}
} catch (e) {
t = {
error: e
};
} finally {
try {
o && !o.done && (e = i.return) && e.call(i);
} finally {
if (t) throw t.error;
}
}
};
r([ d(cc.Node) ], e.prototype, "valueNode", void 0);
return r([ u ], e);
}(s.GamePopBase);
i.CensusInfo = h;
cc._RF.pop();
}, {
"../../../../common/src/GamePopBase": void 0,
"../../common/StatsHelper": "StatsHelper"
} ],
CityBehAddProgress: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "8ec23PTjqdBga6pfNfDydGh", "CityBehAddProgress");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
});
Object.defineProperty(i, "__esModule", {
value: !0
});
var r = t("../../behaviour/BehaviourActionBase"), n = function(t) {
a(e, t);
function e() {
var e = t.call(this) || this;
e.id = "CityBehAddProgress";
return e;
}
e.prototype.execute = function(t) {
t.addProgress(1);
return r.BehResult.Continue;
};
return e;
}(t("../../behaviour/BehaviourActionCity").default);
i.default = n;
cc._RF.pop();
}, {
"../../behaviour/BehaviourActionBase": "BehaviourActionBase",
"../../behaviour/BehaviourActionCity": "BehaviourActionCity"
} ],
CityBehBorderGrowth: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "1433aQh6mBPdLxaqWA6zit6", "CityBehBorderGrowth");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
}), r = this && this.__values || function(t) {
var e = "function" == typeof Symbol && Symbol.iterator, i = e && t[e], o = 0;
if (i) return i.call(t);
if (t && "number" == typeof t.length) return {
next: function() {
t && o >= t.length && (t = void 0);
return {
value: t && t[o++],
done: !t
};
}
};
throw new TypeError(e ? "Object is not iterable." : "Symbol.iterator is not defined.");
};
Object.defineProperty(i, "__esModule", {
value: !0
});
var n = t("../../behaviour/BehaviourActionBase"), s = t("../../behaviour/BehaviourActionCity"), l = t("../../common/ToolBox"), c = t("../../Config"), u = function(t) {
a(e, t);
function e() {
var e = t.call(this) || this;
e.id = "CityBehBorderGrowth";
return e;
}
e.prototype.execute = function(t) {
var e, i, o, a;
if (0 == t.getPopulationTotal()) return n.BehResult.Stop;
if (t.zones.length >= t.status.maximumZones) return n.BehResult.Stop;
t.data.storage.culture++;
c.default.fastCities && (t.data.storage.culture += 100);
t.zones.shuffle();
var s = null, u = t.cityCenter, d = t.getBuildingType("bonfire");
d && (u = d.currentTile.posV3);
var h = 0, p = 0;
try {
for (var f = r(t.zones), m = f.next(); !m.done; m = f.next()) {
var y = m.value;
if (y.haveBuildingOf(t)) try {
for (var _ = (o = void 0, r(y.neighboursAll)), g = _.next(); !g.done; g = _.next()) {
var v = g.value;
if (v.city) v.city.race != t.race && (t.cityEnemy = v.city); else if (v.goodForExpansion() && v != s) {
p = l.Toolbox.distVec3(v.centerTile.posV3, u);
if (!s || p < h) {
s = v;
h = p;
}
break;
}
}
} catch (t) {
o = {
error: t
};
} finally {
try {
g && !g.done && (a = _.return) && a.call(_);
} finally {
if (o) throw o.error;
}
}
}
} catch (t) {
e = {
error: t
};
} finally {
try {
m && !m.done && (i = f.return) && i.call(f);
} finally {
if (e) throw e.error;
}
}
if (!s) return n.BehResult.Stop;
if (!t.zones.includes(s)) {
t.addZone(s);
t.data.storage.culture = 0;
t.addProgress(3);
}
return n.BehResult.Continue;
};
return e;
}(s.default);
i.default = u;
cc._RF.pop();
}, {
"../../Config": "Config",
"../../behaviour/BehaviourActionBase": "BehaviourActionBase",
"../../behaviour/BehaviourActionCity": "BehaviourActionCity",
"../../common/ToolBox": "ToolBox"
} ],
CityBehBorderSteal: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "59847LSKwJDdoAdGTiGfwbu", "CityBehBorderSteal");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
}), r = this && this.__values || function(t) {
var e = "function" == typeof Symbol && Symbol.iterator, i = e && t[e], o = 0;
if (i) return i.call(t);
if (t && "number" == typeof t.length) return {
next: function() {
t && o >= t.length && (t = void 0);
return {
value: t && t[o++],
done: !t
};
}
};
throw new TypeError(e ? "Object is not iterable." : "Symbol.iterator is not defined.");
};
Object.defineProperty(i, "__esModule", {
value: !0
});
var n = t("../../behaviour/BehaviourActionBase"), s = t("../../behaviour/BehaviourActionCity"), l = t("../../MapBox"), c = function(t) {
a(e, t);
function e() {
var e = t.call(this) || this;
e.id = "CityBehBorderSteal";
return e;
}
e.prototype.execute = function(t) {
if (!l.default.inst.worldLaws.world_law_border_stealing.boolVal) return n.BehResult.Stop;
if (0 == t.getPopulationTotal()) return n.BehResult.Stop;
if (t.zones.length >= t.status.maximumZones) return n.BehResult.Stop;
if (0 == t.buildings.length) return n.BehResult.Stop;
for (var e = 0; e < 3 && !this.tryStealZone(t); e++) ;
return n.BehResult.Continue;
};
e.prototype.tryStealZone = function(t) {
var i, o, a, n, s, l;
e._zones.clear();
var c = null === (l = null === (s = null === (n = null === (a = null == t ? void 0 : t.buildings) || void 0 === a ? void 0 : a.getRandom()) || void 0 === n ? void 0 : n.currentTile) || void 0 === s ? void 0 : s.zone) || void 0 === l ? void 0 : l.neighbours;
if (!c || 0 == c.length) return !1;
try {
for (var u = r(c), d = u.next(); !d.done; d = u.next()) {
var h = d.value;
if (h.city && h.city != t && h.buildings.size <= 0 && h.city.kingdom.isEnemy(t.kingdom)) {
this.stealZone(h, t);
return !0;
}
}
} catch (t) {
i = {
error: t
};
} finally {
try {
d && !d.done && (o = u.return) && o.call(u);
} finally {
if (i) throw i.error;
}
}
return !1;
};
e.prototype.stealZone = function(t, e) {
t.city && t.city.removeZone(t);
e.addZone(t);
};
e._zones = [];
return e;
}(s.default);
i.default = c;
cc._RF.pop();
}, {
"../../MapBox": "MapBox",
"../../behaviour/BehaviourActionBase": "BehaviourActionBase",
"../../behaviour/BehaviourActionCity": "BehaviourActionCity"
} ],
CityBehBuildDocks: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "cd69aL71A9CSpNlvOG2fyTL", "CityBehBuildDocks");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
});
Object.defineProperty(i, "__esModule", {
value: !0
});
var r = t("../../behaviour/BehaviourActionBase"), n = t("../../behaviour/BehaviourActionCity"), s = t("../../MapBox"), l = t("./CityBehBuild"), c = function(t) {
a(e, t);
function e() {
var e = t.call(this) || this;
e.id = "CityBehBuildDocks";
return e;
}
e.prototype.execute = function(t) {
var e = l.default.getDockTile(t);
if (!e) return r.BehResult.Continue;
s.default.inst.flashEffects.flashPixel(e, 10);
l.default.tryToBuild(t, "docks_" + t.race.id);
return r.BehResult.Continue;
};
return e;
}(n.default);
i.default = c;
cc._RF.pop();
}, {
"../../MapBox": "MapBox",
"../../behaviour/BehaviourActionBase": "BehaviourActionBase",
"../../behaviour/BehaviourActionCity": "BehaviourActionCity",
"./CityBehBuild": "CityBehBuild"
} ],
CityBehBuild: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "4785aJXdchP1JxlyfuMNLWF", "CityBehBuild");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
}), r = this && this.__values || function(t) {
var e = "function" == typeof Symbol && Symbol.iterator, i = e && t[e], o = 0;
if (i) return i.call(t);
if (t && "number" == typeof t.length) return {
next: function() {
t && o >= t.length && (t = void 0);
return {
value: t && t[o++],
done: !t
};
}
};
throw new TypeError(e ? "Object is not iterable." : "Symbol.iterator is not defined.");
};
Object.defineProperty(i, "__esModule", {
value: !0
});
var n = t("../../assetLibrary/AssetManager"), s = t("../../base/BaseBuilding"), l = t("../../behaviour/BehaviourActionBase"), c = t("../../behaviour/BehaviourActionCity"), u = t("../../city/CityBuildOrder"), d = t("../../common/ToolBox"), h = t("../../common/WaterHelper"), p = t("../../Config"), f = t("../../game/audio/GameAudio"), m = t("../../map/tile/TileType"), y = t("../../MapBox"), _ = function(t) {
a(e, t);
function e() {
var e = t.call(this) || this;
e.id = "CityBehBuild";
return e;
}
e.prototype.execute = function(t) {
e.buildTick(t);
return l.BehResult.Continue;
};
e.buildTick = function(t) {
var i, o, a, s, l;
if (t.race.civ_buildRoads && t.buildings.length > 2) {
var c = t.buildings.getRandom();
c && e.makeRoadsBuildings(t, c);
}
if (!(t.tasks.fire > 0)) {
if (!t.underConstructionBuilding) try {
for (var d = r(t.buildings.list), h = d.next(); !h.done; h = d.next()) {
var f = h.value;
if (null === (l = f.data) || void 0 === l ? void 0 : l.underConstruction) {
t.underConstructionBuilding = f;
break;
}
}
} catch (t) {
i = {
error: t
};
} finally {
try {
h && !h.done && (o = d.return) && o.call(d);
} finally {
if (i) throw i.error;
}
}
if (!t.underConstructionBuilding) {
t._debug_nextPlannedBuilding = null;
var m = "";
try {
for (var y = r(u.default.list), _ = y.next(); !_.done; _ = y.next()) {
var g = _.value, v = g.buildingID;
g.addRace && (v = v + "_" + t.race.id);
if (!g.usedByRacesCheck || g.usedByRaces.includes(t.race.id)) {
var b = n.default.buildings.get(v);
t._debug_nextPlannedBuilding = b.type;
if (!(g.checkFullVillage && 0 != t.status.homesFree || 0 != g.limitID && t.countBuildingsID(v) >= g.limitID || 0 != g.limitType && t.countBuildingsType(b.type) >= g.limitType || t.status.population < g.requiredPop || t.buildings.length < g.requiredBuildings)) if (t.haveEnoughResourcesFor(b.cost)) {
if (!b.docks || e.getDockTile(t)) {
m = v;
break;
}
} else if (g.waitForResources) return;
}
}
} catch (t) {
a = {
error: t
};
} finally {
try {
_ && !_.done && (s = y.return) && s.call(y);
} finally {
if (a) throw a.error;
}
}
if (m) {
var T = e.tryToBuild(t, m);
if (T) {
if (p.default.fastCities) {
T && T.updateBuild(1e3);
t.underConstructionBuilding = null;
}
t.race.civ_buildRoads && T && e.makeRoadsBuildings(t, T);
}
}
}
}
};
e.tryToBuild = function(t, i) {
var o, a, s = n.default.buildings.get(i);
if (!t.haveEnoughResourcesFor(s.cost)) return null;
var l = null;
e._zones_with_buildings.clear();
e._zones_no_buildings.clear();
if (s.docks) l = e.getDockTile(t); else {
try {
for (var c = r(t.zones), u = c.next(); !u.done; u = c.next()) {
var d = u.value;
if (0 != d.buildings.size) {
d.neighboursAll.forEach(function(t) {
e._zones_with_buildings.push(t);
});
e._zones_with_buildings.push(d);
} else e._zones_no_buildings.push(d);
}
} catch (t) {
o = {
error: t
};
} finally {
try {
u && !u.done && (a = c.return) && a.call(c);
} finally {
if (o) throw o.error;
}
}
e._zones_with_buildings.shuffle();
if (!(l = e.tryToBuildInZones(e._zones_with_buildings, s, t))) {
e._zones_no_buildings.shuffle();
l = e.tryToBuildInZones(e._zones_no_buildings, s, t);
}
}
if (!l) return null;
var h = y.default.inst.addBuilding(s.id, l);
t.addBuilding(h);
t.underConstructionBuilding = h;
h.data.underConstruction = !0;
h.setSpriteUnderConstruction();
t.spendResourcesFor(s.cost);
f.default.playConstructing(h.node.position);
t.addProgress(2);
return h;
};
e.tryToBuildInZones = function(t, i, o) {
var a, n, l, c, u = null;
try {
for (var h = r(t), p = h.next(); !p.done; p = h.next()) {
var f = p.value;
f.tiles.shuffle();
if (o.race.buildingPlacements == s.BuildingPlacements.Random || i.docks) try {
for (var m = (l = void 0, r(f.tiles)), y = m.next(); !y.done; y = m.next()) {
var _ = y.value;
if (e.isGoodTileForBuilding(_, i, o)) return u = _;
}
} catch (t) {
l = {
error: t
};
} finally {
try {
y && !y.done && (c = m.return) && c.call(m);
} finally {
if (l) throw l.error;
}
} else if (o.race.buildingPlacements == s.BuildingPlacements.Center && e.isGoodTileForBuilding(f.centerTile, i, o)) {
u = f.centerTile;
return d.Toolbox.randomChance(.8) ? u.neighboursAll.getRandom() : u;
}
}
} catch (t) {
a = {
error: t
};
} finally {
try {
p && !p.done && (n = h.return) && n.call(h);
} finally {
if (a) throw a.error;
}
}
return u;
};
e.isGoodTileForBuilding = function(t, e, i) {
return !!t.canBuildOn(e) && y.default.inst.canBuildFrom(t, e, i);
};
e.debugRoards = function(t, i) {
e.makeRoadsBuildings(t, i);
};
e.makeRoadsBuildings = function(t, e) {
var i, o;
if (!(t.roadTilesToBuild.length > 0) && (null === (i = null == e ? void 0 : e.stats) || void 0 === i ? void 0 : i.buildRoadTo)) {
var a = e.currentTile;
if (null === (o = a.type) || void 0 === o || !o.liquid) {
var r = [];
t.buildings.list.forEach(function(t) {
var i, o, a;
t != e && (null === (i = null == t ? void 0 : t.stats) || void 0 === i ? void 0 : i.buildRoadTo) && !(null === (o = t.currentTile) || void 0 === o ? void 0 : o.type.liquid) && (null === (a = t.currentTile) || void 0 === a ? void 0 : a.isSameIsland(e.currentTile)) && r.push(t.currentTile);
});
if (0 != r.length) {
var n = !1;
p.default.fastCities && (n = !0);
var s = d.Toolbox.getClosestTile(r, a);
if (s) {
r.remove(s);
y.default.inst.makeRoadBetween(s, a, t, n);
}
if (s = d.Toolbox.getClosestTile(r, a)) {
r.remove(s);
y.default.inst.makeRoadBetween(s, a, t, n);
}
}
}
}
};
e.getDockTile = function(t) {
var e, i, o, a, s, l, c = n.default.buildings.get("docks_" + t.race.id), u = null;
h.default.clearWaterPools();
h.default.saveWaterPoolsWithDocks(t);
if (!t.getTile()) return null;
try {
for (var d = r(t.zones), p = d.next(); !p.done; p = d.next()) {
var f = p.value, _ = f.centerTile.chunk;
if (!(0 == f.tilesWithWater || _.regions.length <= 1)) {
var g = !1;
try {
for (var v = (o = void 0, r(_.regions)), b = v.next(); !b.done; b = v.next()) {
var T = b.value;
if (T.type == m.TileLayerType.Water) {
if (!h.default.goodForNewDock(T.tiles[0])) continue;
g = !0;
}
}
} catch (t) {
o = {
error: t
};
} finally {
try {
b && !b.done && (a = v.return) && a.call(v);
} finally {
if (o) throw o.error;
}
}
if (g && g) {
f.tiles.shuffle();
try {
for (var w = (s = void 0, r(f.tiles)), B = w.next(); !B.done; B = w.next()) {
var k = B.value;
if (k.type.water && y.default.inst.canBuildFrom(k, c, t)) {
u = k;
break;
}
}
} catch (t) {
s = {
error: t
};
} finally {
try {
B && !B.done && (l = w.return) && l.call(w);
} finally {
if (s) throw s.error;
}
}
if (u) return u;
}
}
}
} catch (t) {
e = {
error: t
};
} finally {
try {
p && !p.done && (i = d.return) && i.call(d);
} finally {
if (e) throw e.error;
}
}
return u;
};
e._zones_with_buildings = [];
e._zones_no_buildings = [];
return e;
}(c.default);
i.default = _;
cc._RF.pop();
}, {
"../../Config": "Config",
"../../MapBox": "MapBox",
"../../assetLibrary/AssetManager": "AssetManager",
"../../base/BaseBuilding": "BaseBuilding",
"../../behaviour/BehaviourActionBase": "BehaviourActionBase",
"../../behaviour/BehaviourActionCity": "BehaviourActionCity",
"../../city/CityBuildOrder": "CityBuildOrder",
"../../common/ToolBox": "ToolBox",
"../../common/WaterHelper": "WaterHelper",
"../../game/audio/GameAudio": "GameAudio",
"../../map/tile/TileType": "TileType"
} ],
CityBehCheckArmy: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "34bd6nj+vpHkbwXL1nAI1tt", "CityBehCheckArmy");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
});
Object.defineProperty(i, "__esModule", {
value: !0
});
var r = t("../../behaviour/BehaviourActionBase"), n = t("../../behaviour/BehaviourActionCity"), s = t("../../MapBox"), l = function(t) {
a(e, t);
function e() {
var e = t.call(this) || this;
e.id = "CityBehCheckArmy";
return e;
}
e.prototype.execute = function(t) {
if (0 == t.getArmy()) return r.BehResult.Continue;
t.army && !t.army.isAlive() && (t.army = null);
if (t.army) return r.BehResult.Continue;
t.army = s.default.inst.unitGroupManager.createNewGroup(t);
return r.BehResult.Continue;
};
return e;
}(n.default);
i.default = l;
cc._RF.pop();
}, {
"../../MapBox": "MapBox",
"../../behaviour/BehaviourActionBase": "BehaviourActionBase",
"../../behaviour/BehaviourActionCity": "BehaviourActionCity"
} ],
CityBehCheckAttackZone: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "a9d46jDjgNHM6LsDVBJLTho", "CityBehCheckAttackZone");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
});
Object.defineProperty(i, "__esModule", {
value: !0
});
var r = t("../../behaviour/BehaviourActionBase"), n = function(t) {
a(e, t);
function e() {
var e = t.call(this) || this;
e.id = "CityBehCheckAttackZone";
return e;
}
e.prototype.execute = function(t) {
var e, i;
(null === (i = null === (e = t.attackZone) || void 0 === e ? void 0 : e.city) || void 0 === i ? void 0 : i.alive) && t.attackZone.city.kingdom.isEnemy(t.kingdom) || (t.attackZone = null);
if (t.attackZone) return r.BehResult.Continue;
if (t.kingdom.target_kingdom) {
t.kingdom.checkTarget();
if (t.kingdom.target_city) {
if (t.kingdom.target_city.buildings.length > 0) {
var o = t.kingdom.target_city.buildings.getRandom();
t.attackZone = o.currentTile.zone;
}
} else t.kingdom.clearTarget();
} else t.attackZone = null;
return r.BehResult.Continue;
};
return e;
}(t("../../behaviour/BehaviourActionCity").default);
i.default = n;
cc._RF.pop();
}, {
"../../behaviour/BehaviourActionBase": "BehaviourActionBase",
"../../behaviour/BehaviourActionCity": "BehaviourActionCity"
} ],
CityBehCheckCitizenTasks: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "c1cadbHTlZDlKryyS5++roH", "CityBehCheckCitizenTasks");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
});
Object.defineProperty(i, "__esModule", {
value: !0
});
var r = t("../../../../../framework/lib/prototype/MathUtils"), n = t("../../actors/ActorStatus"), s = t("../../assetLibrary/lib/ResourceLibrary"), l = t("../../behaviour/BehaviourActionBase"), c = t("../../behaviour/BehaviourActionCity"), u = t("../../map/tile/TileTypeShortcut"), d = t("../../MapBox"), h = function(t) {
a(e, t);
function e() {
var e = t.call(this) || this;
e.id = "CityBehCheckCitizenTasks";
return e;
}
e.prototype.execute = function(t) {
var e = t.tasks, i = t.jobs, o = t.status;
i.clearTasks();
e.trees = 0;
e.stone = 0;
e.ore = 0;
e.mine = 0;
e.gold = 0;
e.bushes = 0;
e.ruins = 0;
e.farmFields = 0;
e.canBeFarms = 0;
e.roads = 0;
e.wheats = 0;
e.fire = 0;
e.metal = t.data.storage.get("ore");
t.neighbourZones.forEach(function(t) {
e.fire += t.tilesOnFire;
});
t.zones.forEach(function(t) {
e.fire += t.tilesOnFire;
e.trees += t.trees.size;
e.stone += t.stone.size;
e.ore += t.ore.size;
e.gold += t.gold.size;
e.ruins += t.ruins.size;
e.canBeFarms += t.countCanBeFarms();
t.food.forEach(function(t) {
t.haveResources && e.bushes++;
});
t.tileTypes.get(u.default.field).forEach(function(t) {
var i;
t.building ? (null === (i = t.building.stats) || void 0 === i ? void 0 : i.resourceType) != s.ResourceType.Wheat || t.building.canBeUpgraded() || e.wheats++ : e.farmFields++;
});
});
if (t.haveBuildingType("mine")) {
e.mine = o.population / 20;
i.jobs.set("miner", e.mine);
}
e.fire > 0 && i.addJob("fireman", e.fire);
var a = 0;
e.stone > 0 && t.data.storage.get("stone") < 999 && (a += e.stone);
e.gold > 0 && t.data.storage.get("gold") < 999 && (a += e.gold);
e.ore > 0 && t.data.storage.get("ore") < 999 && (a += e.ore);
a > o.population / 10 && (a = o.population / 10);
a > 0 && i.addJob("miner_deposit", a);
e.metal > 0 && i.addJob("metalworker", o.population / 20, t.data.storage.get("ore"));
o.population > 60 ? i.addJob("blacksmith", 3) : o.population > 30 ? i.addJob("blacksmith", 2) : o.population > 15 && i.addJob("blacksmith", 1);
if (t.settleTarget) if (d.default.inst.worldLaws.world_law_kingdom_expansion.boolVal && o.population > 30 && d.default.inst.cityPlaceFinder.zones.length > 0 || o.population > 30 && o.homesFree < 5) {
var c = o.population / 20 + 1;
c > 7 && (c = 7);
i.jobs.set("settler", c);
} else i.jobs.set("settler", 0);
if (o.population > 20) {
var h = o.population / 20 + 1;
h > 3 && (h = 3);
i.jobs.set("hunter", h);
}
e.bushes > 0 && i.jobs.set("gatherer", r.default.clamp(o.population / 10 + 1, 1, 3));
if (t.roadTilesToBuild.length > 0) {
e.roads = 1;
i.jobs.set("road_builder", 1);
}
e.ruins > 0 && i.jobs.set("cleaner", 1);
if (e.trees > 0 && t.data.storage.get("wood") < 100) {
var p = r.default.clamp(e.trees, 1, 3);
i.jobs.set("woodcutter", r.default.clamp(o.population / 10 + 1, 1, p));
}
t.getBuildingToBuild() && i.jobs.set("builder", r.default.clamp(o.population / 10 + 1, 1, 3));
var f = o.population / 5 + 1;
e.farmFields < f && f < 128 && i.jobs.set("farmer_plower", 1);
var m = f / 2 + 1;
(e.wheats > 0 || e.farmFields > 0) && i.jobs.set("farmer", m);
i.occupied.clear();
t.units.list.forEach(function(t) {
if (t.ai.job && t.ai.job.cityJob) {
i.occupied.has(t.ai.job.id) || i.occupied.set(t.ai.job.id, 0);
var e = i.occupied.get(t.ai.job.id) + 1;
i.occupied.set(t.ai.job.id, e);
}
});
if (o.populationAdults > 15) {
o.populationAdults < 50 ? o.warriorSlots = r.default.intCast(.4 * o.populationAdults + 1) : o.warriorSlots = r.default.intCast(.85 * o.populationAdults + 1);
o.warriorSlots > t.getArmyMaxLeader() && (o.warriorSlots = t.getArmyMaxLeader());
i.jobs.set("attacker", 7 * o.warriorSlots / 10);
i.jobs.set("attacker", o.warriorSlots);
}
o.warriorCurrent = t.countProfession(n.UnitProfession.Warrior);
return l.BehResult.Continue;
};
return e;
}(c.default);
i.default = h;
cc._RF.pop();
}, {
"../../../../../framework/lib/prototype/MathUtils": void 0,
"../../MapBox": "MapBox",
"../../actors/ActorStatus": "ActorStatus",
"../../assetLibrary/lib/ResourceLibrary": "ResourceLibrary",
"../../behaviour/BehaviourActionBase": "BehaviourActionBase",
"../../behaviour/BehaviourActionCity": "BehaviourActionCity",
"../../map/tile/TileTypeShortcut": "TileTypeShortcut"
} ],
CityBehCheckPopPoints: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "64e47SGTsBC6o8xKr0qwuDP", "CityBehCheckPopPoints");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
}), r = this && this.__values || function(t) {
var e = "function" == typeof Symbol && Symbol.iterator, i = e && t[e], o = 0;
if (i) return i.call(t);
if (t && "number" == typeof t.length) return {
next: function() {
t && o >= t.length && (t = void 0);
return {
value: t && t[o++],
done: !t
};
}
};
throw new TypeError(e ? "Object is not iterable." : "Symbol.iterator is not defined.");
};
Object.defineProperty(i, "__esModule", {
value: !0
});
var n = t("../../behaviour/BehaviourActionBase"), s = t("../../behaviour/BehaviourActionCity"), l = t("../../city/City"), c = function(t) {
a(e, t);
function e() {
var e = t.call(this) || this;
e.id = "CityBehCheckPopPoints";
return e;
}
e.prototype.execute = function(t) {
var i, o, a, s, c, u;
if (0 == t.data.popPoints.length) return n.BehResult.Continue;
e._temp_actors.clear();
e._temp_buildings.clear();
var d = t.getPopulationUnits(), h = 0, p = 0;
t.jobs.jobs.forEach(function(e, i) {
h = e;
t.jobs.occupied.has(i) && t.jobs.occupied.get(i);
p += h;
});
if (p <= d) return n.BehResult.Continue;
var f = p - d;
if (f < 0) return n.BehResult.Continue;
e._temp_actors.clear();
var m = t.buildings.getSimpleList();
m.shuffle();
try {
for (var y = r(m), _ = y.next(); !_.done; _ = y.next()) {
var g = _.value;
if (!(null === (a = g.data) || void 0 === a ? void 0 : a.underConstruction) && (null === (s = g.data) || void 0 === s ? void 0 : s.alive) && !(null === (c = g.stats) || void 0 === c ? void 0 : c.isRuin) && 0 != (null === (u = g.stats) || void 0 === u ? void 0 : u.housing)) {
e._temp_buildings.push(g);
if (e._temp_buildings.length > f) break;
}
}
} catch (t) {
i = {
error: t
};
} finally {
try {
_ && !_.done && (o = y.return) && o.call(y);
} finally {
if (i) throw i.error;
}
}
if (0 == e._temp_buildings.length) return n.BehResult.Continue;
f > 10 && (f = 10);
for (var v = 0; v < f; v++) {
var b = l.default.getActorDataPopPoint(t);
if (!b) break;
var T = e._temp_buildings.getRandom();
t.spawnPopPoint(b, T.currentTile);
}
return n.BehResult.Continue;
};
e._temp_actors = [];
e._temp_buildings = [];
return e;
}(s.default);
i.default = c;
cc._RF.pop();
}, {
"../../behaviour/BehaviourActionBase": "BehaviourActionBase",
"../../behaviour/BehaviourActionCity": "BehaviourActionCity",
"../../city/City": "City"
} ],
CityBehCheckSettleTarget: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "fc520BSAVNHtaaGDD+FJCwj", "CityBehCheckSettleTarget");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
}), r = this && this.__values || function(t) {
var e = "function" == typeof Symbol && Symbol.iterator, i = e && t[e], o = 0;
if (i) return i.call(t);
if (t && "number" == typeof t.length) return {
next: function() {
t && o >= t.length && (t = void 0);
return {
value: t && t[o++],
done: !t
};
}
};
throw new TypeError(e ? "Object is not iterable." : "Symbol.iterator is not defined.");
};
Object.defineProperty(i, "__esModule", {
value: !0
});
var n = t("../../behaviour/BehaviourActionBase"), s = t("../../behaviour/BehaviourActionCity"), l = t("../../common/ToolBox"), c = t("../../MapBox"), u = function(t) {
a(e, t);
function e() {
var e = t.call(this) || this;
e.id = "CityBehCheckSettleTarget";
return e;
}
e.prototype.execute = function(t) {
var e, i, o;
if (!(null == t ? void 0 : t.alive)) return n.BehResult.Stop;
if (t.status.population < 30) {
t.settleTarget = null;
return n.BehResult.Continue;
}
if (t.settlerTargetTimer > 0) return n.BehResult.Continue;
t.settleTarget = null;
var a = t.getTile();
if (!a) return n.BehResult.Continue;
var s = null, u = 0, d = 0;
if (!s) {
t.kingdom.cities.shuffle();
try {
for (var h = r(t.kingdom.cities), p = h.next(); !p.done; p = h.next()) {
var f = p.value;
if (f != t && f.status.population < 30) {
s = null === (o = f.getTile()) || void 0 === o ? void 0 : o.zone;
break;
}
}
} catch (t) {
e = {
error: t
};
} finally {
try {
p && !p.done && (i = h.return) && i.call(h);
} finally {
if (e) throw e.error;
}
}
}
if (!s && c.default.inst.cityPlaceFinder.zones.length > 0) {
c.default.inst.cityPlaceFinder.zones.forEach(function(t) {
if (t.centerTile.isSameIsland(a)) {
d = l.Toolbox.distTile(t.centerTile, a);
if (!s || d < u) {
u = d;
s = t;
}
}
});
s || c.default.inst.cityPlaceFinder.zones.forEach(function(t) {
d = l.Toolbox.distTile(t.centerTile, a);
if (!s || d < u) {
u = d;
s = t;
}
});
}
if (!s) return n.BehResult.Continue;
t.settlerTargetTimer = l.Toolbox.randomFloat(100, 400);
t.settleTarget = s;
return n.BehResult.Continue;
};
return e;
}(s.default);
i.default = u;
cc._RF.pop();
}, {
"../../MapBox": "MapBox",
"../../behaviour/BehaviourActionBase": "BehaviourActionBase",
"../../behaviour/BehaviourActionCity": "BehaviourActionCity",
"../../common/ToolBox": "ToolBox"
} ],
CityBehFindLeader: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "34c91c0MmZGIoJH2Cr+zed0", "CityBehFindLeader");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
});
Object.defineProperty(i, "__esModule", {
value: !0
});
var r = t("../../actors/ActorStatus"), n = t("../../actors/ActorTool"), s = t("../../behaviour/BehaviourActionBase"), l = t("../../behaviour/BehaviourActionCity"), c = t("../../city/City"), u = function(t) {
a(e, t);
function e() {
var e = t.call(this) || this;
e.id = "CityBehFindLeader";
return e;
}
e.prototype.execute = function(t) {
if (t.units.length < 10) return s.BehResult.Continue;
if (t.leader) return s.BehResult.Continue;
if (t.captureTicks > 0) return s.BehResult.Continue;
var e = null, i = 0, o = 0;
t.units.list.forEach(function(t) {
if (t.data.profession == r.UnitProfession.Unit) {
i = n.default.attributeDice(t, 1);
if (!e || i > o) {
e = t;
o = i;
}
}
});
e && c.default.makeLeader(e, t);
return s.BehResult.Continue;
};
return e;
}(l.default);
i.default = u;
cc._RF.pop();
}, {
"../../actors/ActorStatus": "ActorStatus",
"../../actors/ActorTool": "ActorTool",
"../../behaviour/BehaviourActionBase": "BehaviourActionBase",
"../../behaviour/BehaviourActionCity": "BehaviourActionCity",
"../../city/City": "City"
} ],
CityBehGiveInventoryItem: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "c520ax7l9JDVJNBEqTgU0Or", "CityBehGiveInventoryItem");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
}), r = this && this.__values || function(t) {
var e = "function" == typeof Symbol && Symbol.iterator, i = e && t[e], o = 0;
if (i) return i.call(t);
if (t && "number" == typeof t.length) return {
next: function() {
t && o >= t.length && (t = void 0);
return {
value: t && t[o++],
done: !t
};
}
};
throw new TypeError(e ? "Object is not iterable." : "Symbol.iterator is not defined.");
};
Object.defineProperty(i, "__esModule", {
value: !0
});
var n = t("../../actors/ActorEquipment"), s = t("../../actors/ActorStatus"), l = t("../../behaviour/BehaviourActionBase"), c = t("../../behaviour/BehaviourActionCity"), u = t("../../city/City"), d = function(t) {
a(e, t);
function e() {
var e = t.call(this) || this;
e.id = "CityBehGiveInventoryItem";
return e;
}
e.prototype.execute = function(t) {
var i, o, a = n.default.getList(t.data.storage.itemStorage);
if (0 == a.length) return l.BehResult.Stop;
e._list.clear();
t.units.putInSimpleList(e._list);
try {
for (var c = r(a), d = c.next(); !d.done; d = c.next()) {
var h = d.value;
if (!(t.kingdom.king && u.default.giveItem(t.kingdom.king, h, t) || t.leader && u.default.giveItem(t.leader, h, t))) {
if (0 == e._list.length) break;
if (t.countProfession(s.UnitProfession.Warrior) > 0) {
e._list = t.professionsDict.get(s.UnitProfession.Warrior);
u.default.giveItem(e._list.getRandom(), h, t);
}
}
}
} catch (t) {
i = {
error: t
};
} finally {
try {
d && !d.done && (o = c.return) && o.call(c);
} finally {
if (i) throw i.error;
}
}
return l.BehResult.Continue;
};
e._list = [];
return e;
}(c.default);
i.default = d;
cc._RF.pop();
}, {
"../../actors/ActorEquipment": "ActorEquipment",
"../../actors/ActorStatus": "ActorStatus",
"../../behaviour/BehaviourActionBase": "BehaviourActionBase",
"../../behaviour/BehaviourActionCity": "BehaviourActionCity",
"../../city/City": "City"
} ],
CityBehProduceBoat: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "a6fc2jmoK1EPKoyo3rOqbkh", "CityBehProduceBoat");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
});
Object.defineProperty(i, "__esModule", {
value: !0
});
var r = t("../../actors/other/boat/Boat"), n = t("../../behaviour/BehaviourActionBase"), s = t("../../behaviour/BehaviourActionCity"), l = t("../../building/Docks"), c = function(t) {
a(e, t);
function e() {
var e = t.call(this) || this;
e.id = "CityBehProduceBoat";
return e;
}
e.prototype.execute = function(t) {
if (t.boatBuildTimer > 0) return n.BehResult.Stop;
if (!t.haveBuildingType("docks")) return n.BehResult.Stop;
var e = t.getBuildingType("docks", !0, !0);
if (!e) return n.BehResult.Stop;
var i = e.getComponent(l.default).buildBoatFromHere(t);
if (!i) return n.BehResult.Stop;
i.setKingdom(t.kingdom);
i.getComponent(r.default).updateTexture();
i.setCity(t);
t.boatBuildTimer = 10;
return n.BehResult.Continue;
};
return e;
}(s.default);
i.default = c;
cc._RF.pop();
}, {
"../../actors/other/boat/Boat": "Boat",
"../../behaviour/BehaviourActionBase": "BehaviourActionBase",
"../../behaviour/BehaviourActionCity": "BehaviourActionCity",
"../../building/Docks": "Docks"
} ],
CityBehProduceResources: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "0dd26fGepBEdLQ67qAB3b4V", "CityBehProduceResources");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
}), r = this && this.__values || function(t) {
var e = "function" == typeof Symbol && Symbol.iterator, i = e && t[e], o = 0;
if (i) return i.call(t);
if (t && "number" == typeof t.length) return {
next: function() {
t && o >= t.length && (t = void 0);
return {
value: t && t[o++],
done: !t
};
}
};
throw new TypeError(e ? "Object is not iterable." : "Symbol.iterator is not defined.");
};
Object.defineProperty(i, "__esModule", {
value: !0
});
var n = t("../../../../../framework/lib/prototype/MathUtils"), s = t("../../assetLibrary/AssetManager"), l = t("../../behaviour/BehaviourActionBase"), c = function(t) {
a(e, t);
function e() {
var e = t.call(this) || this;
e.workers = 0;
e.id = "CityBehProduceResources";
return e;
}
e.prototype.execute = function(t) {
var e = this;
t.race.production.shuffle();
t.race.production.forEach(function(i) {
e.workers = n.default.intCast(t.status.population / 10 + 1);
e.tryToProduce(i, t);
});
return l.BehResult.Continue;
};
e.prototype.tryToProduce = function(t, e) {
for (var i, o, a = s.default.resources.get(t), n = 0; n < this.workers; n++) {
if (e.data.storage.get(t) == a.maximum) return !1;
var l = a.ingredients;
try {
for (var c = (i = void 0, r(l)), u = c.next(); !u.done; u = c.next()) {
var d = u.value;
if (e.data.storage.get(d) < a.ingredientsAmount) return !1;
}
} catch (t) {
i = {
error: t
};
} finally {
try {
u && !u.done && (o = c.return) && o.call(c);
} finally {
if (i) throw i.error;
}
}
(l = a.ingredients).forEach(function(t) {
e.data.storage.change(t, -a.ingredientsAmount);
});
e.data.storage.change(t);
}
return !0;
};
return e;
}(t("../../behaviour/BehaviourActionCity").default);
i.default = c;
cc._RF.pop();
}, {
"../../../../../framework/lib/prototype/MathUtils": void 0,
"../../assetLibrary/AssetManager": "AssetManager",
"../../behaviour/BehaviourActionBase": "BehaviourActionBase",
"../../behaviour/BehaviourActionCity": "BehaviourActionCity"
} ],
CityBehProduceUnit: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "b9a8fUkK1NB2q3OAtF6DyW2", "CityBehProduceUnit");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
});
Object.defineProperty(i, "__esModule", {
value: !0
});
var r = t("../../actors/ActorBase"), n = t("../../actors/ActorStatus"), s = t("../../behaviour/BehaviourActionBase"), l = t("../../behaviour/BehaviourActionCity"), c = t("../../common/ToolBox"), u = function(t) {
a(e, t);
function e() {
var e = t.call(this) || this;
e.unitProduced = !1;
e.id = "CityBehProduceUnit";
return e;
}
e.prototype.execute = function(t) {
if (!t.getFoodItem()) return s.BehResult.Stop;
this.unitProduced = !1;
var i = t.status.population / 10 + 1;
i > 10 && (i = 10);
var o = t.units.getSimpleList();
o.shuffle();
e.parent_index = 0;
for (var a = 0; a < i; a++) 0 != a && c.Toolbox.randomChance(.3) || this.tryToProduceUnit(t, o);
return this.unitProduced ? s.BehResult.Continue : s.BehResult.Stop;
};
e.prototype.tryToProduceUnit = function(t, e) {
if (t.getFoodItem() && 0 != t.status.homesFree) {
var i = t.getBuildingType("house");
i && this.produceNewCitizen(i, t, e) && (this.unitProduced = !0);
}
};
e.prototype.produceNewCitizen = function(t, i, o) {
var a = e.getRandomParent(o);
if (!a) return !1;
if (a.haveTrait("infected") && c.Toolbox.randomBool()) return !1;
var s = e.getRandomParent(o, a);
a.data.children++;
var l = i.getFoodItem();
i.eatFoodItem(l.id);
i.status.homesFree--;
i.data.born++;
i.kingdom && i.kingdom.data.born++;
i.addProgress(1);
var u = a.stats, d = new n.ActorData();
d.cityID = i.data.cityID;
d.status = new n.default();
d.status.statsID = u.id;
r.default.generateCivUnit(a.stats, d.status, a.race);
d.status.generateTraits(u, a.race);
d.status.inheritTraits(a.data.traits);
d.status.hunger = u.maxHunger / 2;
if (s) {
d.status.inheritTraits(s.data.traits);
s.data.children++;
}
i.data.popPoints.push(d);
return !0;
};
e.getRandomParent = function(t, i) {
void 0 === i && (i = null);
e.parent_index >= t.length && (e.parent_index = 0);
for (var o = e.parent_index; o < t.length; o++) {
var a = t[o];
if (a != i && !a.haveTrait("plague") && a.data.age > 18) {
e.parent_index = o;
return a;
}
}
return null;
};
e.parent_index = 0;
return e;
}(l.default);
i.default = u;
cc._RF.pop();
}, {
"../../actors/ActorBase": "ActorBase",
"../../actors/ActorStatus": "ActorStatus",
"../../behaviour/BehaviourActionBase": "BehaviourActionBase",
"../../behaviour/BehaviourActionCity": "BehaviourActionCity",
"../../common/ToolBox": "ToolBox"
} ],
CityBehRandomWait: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "b7aa43dVWNOAoeL4uVNPMzp", "CityBehRandomWait");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
});
Object.defineProperty(i, "__esModule", {
value: !0
});
var r = t("../../behaviour/BehaviourActionBase"), n = t("../../behaviour/BehaviourActionCity"), s = t("../../common/ToolBox"), l = function(t) {
a(e, t);
function e(e, i) {
void 0 === e && (e = 0);
void 0 === i && (i = 1);
var o = t.call(this) || this;
o.min = 0;
o.max = 0;
o.min = e;
o.max = i;
o.id = "CityBehRandomWait";
return o;
}
e.prototype.execute = function(t) {
t.timer_action = s.Toolbox.randomFloat(this.min, this.max);
return r.BehResult.Continue;
};
return e;
}(n.default);
i.default = l;
cc._RF.pop();
}, {
"../../behaviour/BehaviourActionBase": "BehaviourActionBase",
"../../behaviour/BehaviourActionCity": "BehaviourActionCity",
"../../common/ToolBox": "ToolBox"
} ],
CityBehSupplyKingdomCities: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "4a891JKvGNIBYZsPYykAoOD", "CityBehSupplyKingdomCities");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
}), r = this && this.__values || function(t) {
var e = "function" == typeof Symbol && Symbol.iterator, i = e && t[e], o = 0;
if (i) return i.call(t);
if (t && "number" == typeof t.length) return {
next: function() {
t && o >= t.length && (t = void 0);
return {
value: t && t[o++],
done: !t
};
}
};
throw new TypeError(e ? "Object is not iterable." : "Symbol.iterator is not defined.");
};
Object.defineProperty(i, "__esModule", {
value: !0
});
var n = t("../../behaviour/BehaviourActionBase"), s = function(t) {
a(e, t);
function e() {
var e = t.call(this) || this;
e._resources = [];
e.id = "CityBehSupplyKingdomCities";
return e;
}
e.prototype.execute = function(t) {
var e, i, o, a, s = this;
if (t.data.timer_supply > 0) return n.BehResult.Stop;
this._resources.clear();
t.data.storage.resources.forEach(function(e, i) {
var o = t.data.storage.resources.get(i);
o.amount > o.asset.supplyBoundGive && s._resources.push(o);
});
if (0 == this._resources.length) return n.BehResult.Stop;
this._resources.shuffle();
if (1 == t.kingdom.cities.length) return n.BehResult.Stop;
t.kingdom.cities.shuffle();
try {
for (var l = r(t.kingdom.cities), c = l.next(); !c.done; c = l.next()) {
var u = c.value;
if (u != t) try {
for (var d = (o = void 0, r(this._resources)), h = d.next(); !h.done; h = d.next()) {
var p = h.value;
if (u.data.storage.get(p.id) < p.asset.supplyBoundTake) {
this.shareResource(t, u, p);
this.updateSupplyTimer(t);
return n.BehResult.Continue;
}
}
} catch (t) {
o = {
error: t
};
} finally {
try {
h && !h.done && (a = d.return) && a.call(d);
} finally {
if (o) throw o.error;
}
}
}
} catch (t) {
e = {
error: t
};
} finally {
try {
c && !c.done && (i = l.return) && i.call(l);
} finally {
if (e) throw e.error;
}
}
return n.BehResult.Continue;
};
e.prototype.updateSupplyTimer = function(t) {
var e = 30;
t.leader && (e *= t.leader.curStats.mod_supply_timer);
e < 10 && (e = 10);
t.data.timer_supply = e;
};
e.prototype.shareResource = function(t, e, i) {
t.data.storage.change(i.id, -i.asset.supplyGive);
e.data.storage.change(i.id, i.asset.supplyGive);
};
return e;
}(t("../../behaviour/BehaviourActionCity").default);
i.default = s;
cc._RF.pop();
}, {
"../../behaviour/BehaviourActionBase": "BehaviourActionBase",
"../../behaviour/BehaviourActionCity": "BehaviourActionCity"
} ],
CityBehUpgradeRandomBuilding: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "8ac80Xg3htC76TvT+ivWAEr", "CityBehUpgradeRandomBuilding");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
}), r = this && this.__values || function(t) {
var e = "function" == typeof Symbol && Symbol.iterator, i = e && t[e], o = 0;
if (i) return i.call(t);
if (t && "number" == typeof t.length) return {
next: function() {
t && o >= t.length && (t = void 0);
return {
value: t && t[o++],
done: !t
};
}
};
throw new TypeError(e ? "Object is not iterable." : "Symbol.iterator is not defined.");
};
Object.defineProperty(i, "__esModule", {
value: !0
});
var n = t("../../assetLibrary/AssetManager"), s = t("../../behaviour/BehaviourActionBase"), l = t("../../behaviour/BehaviourActionCity"), c = t("../../common/ToolBox"), u = function(t) {
a(e, t);
function e() {
var e = t.call(this) || this;
e.id = "CityBehUpgradeRandomBuilding";
return e;
}
e.prototype.execute = function(t) {
c.Toolbox.randomBool() && this.upgradeRandomBuilding(t);
return s.BehResult.Continue;
};
e.prototype.upgradeRandomBuilding = function(t) {
var e, i;
if (0 != t.buildings.length) {
var o = t.buildings.getSimpleList();
o.shuffle();
var a = null;
try {
for (var s = r(o), l = s.next(); !l.done; l = s.next()) {
var c = l.value;
if (c.canBeUpgraded()) {
a = c;
break;
}
}
} catch (t) {
e = {
error: t
};
} finally {
try {
l && !l.done && (i = s.return) && i.call(s);
} finally {
if (e) throw e.error;
}
}
if (a) {
var u = a.stats.upgradeTo, d = n.default.buildings.get(u);
if (t.haveEnoughResourcesFor(d.cost)) {
t.spendResourcesFor(d.cost);
a.upgradeBulding();
}
}
}
};
return e;
}(l.default);
i.default = u;
cc._RF.pop();
}, {
"../../assetLibrary/AssetManager": "AssetManager",
"../../behaviour/BehaviourActionBase": "BehaviourActionBase",
"../../behaviour/BehaviourActionCity": "BehaviourActionCity",
"../../common/ToolBox": "ToolBox"
} ],
CityBuildOrder: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "7d668iuQ6BFAoCuP0UutQy2", "CityBuildOrder");
Object.defineProperty(i, "__esModule", {
value: !0
});
i.CityBuildOrderElement = void 0;
var o = function() {
this.buildingID = "";
this.limitType = 0;
this.limitID = 0;
this.priority = 0;
this.addRace = !1;
this.requiredPop = 0;
this.requiredBuildings = 0;
this.waitForResources = !0;
this.usedByRacesCheck = !1;
this.usedByRaces = "human,orc,elf,dwarf";
this.checkFullVillage = !1;
};
i.CityBuildOrderElement = o;
var a = function() {
function t() {}
t.init = function() {
t.list = [];
var e = new o();
e.buildingID = "bonfire";
e.priority = 100;
e.limitType = 1;
t.add(e);
var i = new o();
i.buildingID = "docks";
i.priority = 100;
i.addRace = !0;
i.limitType = 5;
i.waitForResources = !1;
t.add(i);
var a = new o();
a.buildingID = "well";
a.requiredBuildings = 10;
a.requiredPop = 20;
a.waitForResources = !1;
a.limitType = 1;
t.add(a);
var r = new o();
r.buildingID = "tent";
r.addRace = !0;
r.limitID = 5;
r.checkFullVillage = !0;
t.add(r);
var n = new o();
n.buildingID = "hall";
n.priority = 90;
n.limitType = 1;
n.addRace = !0;
n.requiredBuildings = 10;
n.requiredPop = 20;
n.waitForResources = !0;
t.add(n);
var s = new o();
s.buildingID = "mine";
s.limitType = 1;
s.requiredBuildings = 10;
s.requiredPop = 20;
s.waitForResources = !1;
t.add(s);
var l = new o();
l.buildingID = "barracks";
l.addRace = !0;
l.limitType = 1;
l.requiredBuildings = 10;
l.requiredPop = 30;
l.waitForResources = !1;
t.add(l);
var c = new o();
c.buildingID = "temple";
c.addRace = !0;
c.limitType = 1;
c.requiredBuildings = 40;
c.requiredPop = 150;
c.waitForResources = !0;
t.add(c);
var u = new o();
u.buildingID = "statue";
u.limitType = 1;
u.requiredBuildings = 20;
u.requiredPop = 170;
u.waitForResources = !1;
u.usedByRacesCheck = !0;
u.usedByRaces = "human,dwarf";
t.add(u);
};
t.addTent = function(e) {
var i = new o();
i.buildingID = "tent", i.addRace = !0, i.limitType = e;
t.add(i);
};
t.add = function(e) {
t.list.push(e);
};
t.list = [];
return t;
}();
i.default = a;
cc._RF.pop();
}, {} ],
CityInfoElement: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "45a29K0/khLeqLuq4jHUUQM", "CityInfoElement");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
}), r = this && this.__decorate || function(t, e, i, o) {
var a, r = arguments.length, n = r < 3 ? e : null === o ? o = Object.getOwnPropertyDescriptor(e, i) : o;
if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) n = Reflect.decorate(t, e, i, o); else for (var s = t.length - 1; s >= 0; s--) (a = t[s]) && (n = (r < 3 ? a(n) : r > 3 ? a(e, i, n) : a(e, i)) || n);
return r > 3 && n && Object.defineProperty(e, i, n), n;
};
Object.defineProperty(i, "__esModule", {
value: !0
});
var n = t("../../common/ViewController"), s = t("../../Config"), l = cc._decorator, c = l.ccclass, u = l.property, d = function(t) {
a(e, t);
function e() {
var e = null !== t && t.apply(this, arguments) || this;
e.cityName = null;
e.population = null;
e.diplomacy = null;
e.buttonLeader = null;
e.capitalIcon = null;
e.city = null;
return e;
}
i = e;
e.prototype.initItem = function(t) {
this.city = t;
this.city.isCapitalCity() && (this.node.color = i.capitalColor);
this.buttonLeader.active = null != t.leader;
this.cityName.string = t.data.cityName;
this.population.string = "" + t.getPopulationTotal();
this.capitalIcon.active = this.city.kingdom.capital == this.city;
var e = this.city.getRelationRating();
this.diplomacy.string = "" + e;
this.diplomacy.node.color = e > 0 ? cc.Color.GREEN : cc.Color.RED;
};
e.prototype.clickLeader = function() {
s.default.selectedCity = this.city;
s.default.selectedUnit = this.city.leader;
s.default.selectedUnit && n.default.open(n.view_type.CreatureInfo);
};
e.prototype.clickCity = function() {
s.default.selectedCity = this.city;
n.default.open(n.view_type.CityWindow);
};
var i;
e.capitalColor = new cc.Color(178.5, 178.5, 178.5);
r([ u(cc.Label) ], e.prototype, "cityName", void 0);
r([ u(cc.Label) ], e.prototype, "population", void 0);
r([ u(cc.Label) ], e.prototype, "diplomacy", void 0);
r([ u(cc.Node) ], e.prototype, "buttonLeader", void 0);
r([ u(cc.Node) ], e.prototype, "capitalIcon", void 0);
return i = r([ c ], e);
}(cc.Component);
i.default = d;
cc._RF.pop();
}, {
"../../Config": "Config",
"../../common/ViewController": "ViewController"
} ],
CityJobLibrary: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "8e554MpKD5NL5QzTq4tWpsX", "CityJobLibrary");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
});
Object.defineProperty(i, "__esModule", {
value: !0
});
var r = t("../../actors/ActorJob"), n = function(t) {
a(e, t);
function e() {
return null !== t && t.apply(this, arguments) || this;
}
e.prototype.init = function() {
t.prototype.init.call(this);
var e = new r.JobCityAsset();
e.id = "city";
this.add(e);
this.t.addTask("build");
this.t.addTask("wait1");
this.t.addTask("check_army");
this.t.addTask("wait1");
this.t.addTask("do_checks");
this.t.addTask("wait1");
this.t.addTask("border_growth");
this.t.addTask("wait1");
this.t.addTask("border_steal");
this.t.addTask("wait1");
this.t.addTask("produce_unit");
this.t.addTask("wait1");
this.t.addTask("give_inventory_item");
this.t.addTask("wait5");
this.t.addTask("add_progress");
this.t.addTask("produce_boat");
this.t.addTask("wait1");
this.t.addTask("upgrade_random_building");
this.t.addTask("wait1");
this.t.addTask("supply_kingdom_cities");
this.t.addTask("wait1");
this.t.addTask("produce_resources");
this.t.addTask("wait1");
this.t.addTask("check_pop_points");
};
return e;
}(t("../AssetLibrary").default);
i.default = n;
cc._RF.pop();
}, {
"../../actors/ActorJob": "ActorJob",
"../AssetLibrary": "AssetLibrary"
} ],
CityJobs: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "66736LGkG9OCJAJyD9+BLkb", "CityJobs");
Object.defineProperty(i, "__esModule", {
value: !0
});
var o = t("../../../../framework/lib/prototype/MathUtils"), a = function() {
function t() {
this.jobs = new Map();
this.occupied = new Map();
}
t.prototype.clearTasks = function() {
this.total = 0;
this.jobs.clear();
};
t.prototype.addJob = function(t, e, i) {
void 0 === i && (i = 0);
this.jobs.has(t) || this.jobs.set(t, 0);
0 != i ? this.jobs.set(t, o.default.clamp(e, 1, i)) : this.jobs.set(t, e);
};
t.prototype.continueJob = function(t) {
return !!this.jobs.has(t);
};
t.prototype.countOccupied = function(t) {
return this.occupied.has(t) ? this.occupied.get(t) : 0;
};
t.prototype.haveJob = function(t) {
return !(!this.jobs.has(t) || 0 == this.jobs.get(t) || this.occupied.has(t) && this.occupied.get(t) >= this.jobs.get(t));
};
t.prototype.takeJob = function(t) {
if (this.occupied.has(t)) {
var e = this.occupied.get(t);
this.occupied.set(t, e++);
} else this.occupied.set(t, 1);
};
t.prototype.freeJob = function(t) {
if (this.occupied.has(t)) {
var e = this.occupied.get(t);
this.occupied.set(t, e--);
this.occupied.get(t) < 0 && this.occupied.set(t, 0);
} else this.occupied.set(t, 0);
};
return t;
}();
i.default = a;
cc._RF.pop();
}, {
"../../../../framework/lib/prototype/MathUtils": void 0
} ],
CityPlaceFinder: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "08c73t+YO1D0ZWko9U5CDRR", "CityPlaceFinder");
Object.defineProperty(i, "__esModule", {
value: !0
});
var o = t("../MapBox"), a = function() {
function t() {
this.dirty = !1;
this.zones = [];
this.nextWave = [];
this.wave = [];
this.timer = 2;
this._curWave = 2;
this.tilesForCity = 2;
}
t.prototype.logicUpdate = function(t) {
if (this.timer >= 0) {
this.timer -= t;
this.dirty && this.calculate();
}
};
t.prototype.calculate = function() {
var t = this;
this.dirty = !1;
this.zones.clear();
o.default.inst.zoneCalculator.zones.forEach(function(t) {
t.goodForNewCity = !1;
t.cityChecked = !1;
!t.city && t.tilesWithGround >= 64 && t.countCanBeFarms() > 5 && (t.goodForNewCity = !0);
});
o.default.inst.citiesList.forEach(function(e) {
t.checkCity(e);
});
o.default.inst.zoneCalculator.zones.forEach(function(e) {
e.goodForNewCity && t.zones.push(e);
});
this.zones.shuffle();
};
t.prototype.checkCity = function(t) {
var e = this;
this._curWave = 0;
this.wave.clear();
this.nextWave.clear();
t.zones.forEach(function(t) {
e.wave.push(t);
});
for (;this.wave.length > 0 && this._curWave < 5; ) {
this._curWave++;
this.countWave();
if (this.nextWave.length > 0) {
this.wave.addRange(this.nextWave);
this.nextWave.clear();
}
}
};
t.prototype.countWave = function() {
for (var t = this, e = null; this.wave.length > 0; ) {
(e = this.wave.pop()).cityChecked = !0;
e.goodForNewCity = !1;
e.neighbours.forEach(function(i) {
if (!i.cityChecked && !i.city && i.tilesWithGround >= 10) {
e.cityChecked = !0;
t.nextWave.push(i);
}
});
}
};
t.prototype.setDirty = function() {
this.dirty = !0;
this.timer <= 0 && (this.timer = 1);
};
return t;
}();
i.default = a;
cc._RF.pop();
}, {
"../MapBox": "MapBox"
} ],
CityStorage: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "cc5c25sRlJE0YbIwbAaInQW", "CityStorage");
var o = this && this.__values || function(t) {
var e = "function" == typeof Symbol && Symbol.iterator, i = e && t[e], o = 0;
if (i) return i.call(t);
if (t && "number" == typeof t.length) return {
next: function() {
t && o >= t.length && (t = void 0);
return {
value: t && t[o++],
done: !t
};
}
};
throw new TypeError(e ? "Object is not iterable." : "Symbol.iterator is not defined.");
};
Object.defineProperty(i, "__esModule", {
value: !0
});
i.CityStorageSlot = void 0;
var a = t("../../../../framework/utils/Tools"), r = t("../../../common/src/data/AchievData"), n = t("../actors/ActorEquipment"), s = t("../assetLibrary/AssetManager"), l = t("../assetLibrary/lib/ResourceLibrary"), c = function() {
function t() {
this.id = "";
this.amount = 0;
this.asset = null;
Object.defineProperty(this, "asset", {
enumerable: !1
});
}
t.prototype.create = function() {
this.asset = s.default.resources.get(this.id);
};
return t;
}();
i.CityStorageSlot = c;
var u = function() {
function t() {
this.itemStorage = new n.default();
this.resources = new Map();
this.resourcesFood = new Map();
this.listFood = [];
this.savedResources = [];
this.savedItems = [];
this.culture = 0;
Object.defineProperty(this, "itemStorage", {
enumerable: !1
});
Object.defineProperty(this, "resources", {
enumerable: !1
});
Object.defineProperty(this, "resourcesFood", {
enumerable: !1
});
Object.defineProperty(this, "listFood", {
enumerable: !1
});
}
t.prototype.loadFromSave = function() {
var t = this;
if (this.savedItems) {
this.itemStorage = new n.default();
this.itemStorage.load(this.savedItems);
}
this.savedResources && this.savedResources.forEach(function(e) {
"food" == (e = a.default.fromJson(e, new c())).id && (e.id = "wheat");
if (s.default.resources.get(e.id) && e.amount >= 0) {
e.create();
t.putToDict(e);
}
});
};
t.prototype.getRandomFood = function() {
var t, e;
if (0 == this.listFood.length) return null;
this.listFood.sort(function(t, e) {
return t.amount - e.amount;
});
try {
for (var i = o(this.listFood), a = i.next(); !a.done; a = i.next()) {
var r = a.value;
if (r.amount > 0) return r.asset;
}
} catch (e) {
t = {
error: e
};
} finally {
try {
a && !a.done && (e = i.return) && e.call(i);
} finally {
if (t) throw t.error;
}
}
return null;
};
t.prototype.save = function() {
var t = this;
this.savedResources = [];
this.resources.forEach(function(e) {
0 != e.amount && t.savedResources.push(e);
});
this.savedItems = this.itemStorage.getDataForSave();
};
t.prototype.getMaterialForItem = function(t, e, i, o) {
void 0 === o && (o = !0);
for (var a = e.list.length - 1; a >= 0; a--) {
var r = e.list[a];
if (t.materials.includes(r.id) && (!o || r.level <= i && r.cost_gold <= this.get("gold") && ("none" == r.cost_resource_id_1 || r.cost_resource_1 <= this.get(r.cost_resource_id_1)) && this.get(r.cost_resource_id_1) >= 15 && ("none" == r.cost_resource_id_2 || r.cost_resource_2 <= this.get(r.cost_resource_id_2)))) return r;
}
return null;
};
t.prototype.get = function(t) {
return this.resources.has(t) ? this.resources.get(t).amount : 0;
};
t.prototype.addNew = function(t, e) {
var i = new c();
i.id = t;
i.amount = e;
i.create();
this.putToDict(i);
};
t.prototype.putToDict = function(t) {
if (!this.resources.has(t.id)) {
this.resources.set(t.id, t);
if (t.asset.type == l.ResType.Food) {
this.resourcesFood.set(t.id, t);
this.listFood.push(t);
}
}
};
t.prototype.set = function(t, e) {
this.resources.has(t) ? this.resources.get(t).amount = e : this.addNew(t, e);
};
t.prototype.change = function(t, e) {
void 0 === e && (e = 1);
if (this.resources.has(t)) {
var i = this.resources.get(t);
i.amount += e;
i.amount > i.asset.maximum && (i.amount = i.asset.maximum);
"wood" == t && r.default.update(3, i.amount, !0);
"gold" != t && "metals" != t || r.default.update(24, i.amount, !0);
} else this.addNew(t, e);
};
return t;
}();
i.default = u;
cc._RF.pop();
}, {
"../../../../framework/utils/Tools": void 0,
"../../../common/src/data/AchievData": void 0,
"../actors/ActorEquipment": "ActorEquipment",
"../assetLibrary/AssetManager": "AssetManager",
"../assetLibrary/lib/ResourceLibrary": "ResourceLibrary"
} ],
CityTaskList: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "2a445kU+sBJ35zVgd6OEnl/", "CityTaskList");
Object.defineProperty(i, "__esModule", {
value: !0
});
i.CityTasksData = void 0;
i.CityTasksData = function() {
this.trees = 0;
this.stone = 0;
this.ore = 0;
this.metal = 0;
this.gold = 0;
this.mine = 0;
this.bushes = 0;
this.farmFields = 0;
this.canBeFarms = 0;
this.wheats = 0;
this.ruins = 0;
this.roads = 0;
this.fire = 0;
};
var o = function() {
function t() {}
t.init = function() {
t.jobsUnit = [];
t.jobsWarrior = [];
t.initTaskList();
};
t.prepare = function(e, i) {
t.city = e;
t.taskUnit = i;
};
t.initTaskList = function() {
t.jobsUnit.push("builder");
t.jobsUnit.push("gatherer");
t.jobsUnit.push("farmer_plower");
t.jobsUnit.push("farmer");
t.jobsUnit.push("hunter");
t.jobsUnit.push("woodcutter");
t.jobsUnit.push("miner");
t.jobsUnit.push("miner_deposit");
t.jobsUnit.push("blacksmith");
t.jobsUnit.push("road_builder");
t.jobsUnit.push("cleaner");
t.jobsUnit.push("settler");
t.jobsWarrior.push("attacker");
};
t.checkJob = function(e) {
if (t.city.jobs.haveJob(e)) {
t.city.jobs.takeJob(e);
t.taskUnit.ai.setJob(e);
return !0;
}
return !1;
};
t.jobsUnit = [];
t.jobsWarrior = [];
t.taskUnit = null;
t.city = null;
return t;
}();
i.default = o;
cc._RF.pop();
}, {} ],
CityWindow: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "7a0f40aNIFEkbMqS04eXV/g", "CityWindow");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
}), r = this && this.__decorate || function(t, e, i, o) {
var a, r = arguments.length, n = r < 3 ? e : null === o ? o = Object.getOwnPropertyDescriptor(e, i) : o;
if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) n = Reflect.decorate(t, e, i, o); else for (var s = t.length - 1; s >= 0; s--) (a = t[s]) && (n = (r < 3 ? a(n) : r > 3 ? a(e, i, n) : a(e, i)) || n);
return r > 3 && n && Object.defineProperty(e, i, n), n;
}, n = this && this.__values || function(t) {
var e = "function" == typeof Symbol && Symbol.iterator, i = e && t[e], o = 0;
if (i) return i.call(t);
if (t && "number" == typeof t.length) return {
next: function() {
t && o >= t.length && (t = void 0);
return {
value: t && t[o++],
done: !t
};
}
};
throw new TypeError(e ? "Object is not iterable." : "Symbol.iterator is not defined.");
};
Object.defineProperty(i, "__esModule", {
value: !0
});
var s = t("../../../../common/src/GamePopBase"), l = t("../../assetLibrary/AssetManager"), c = t("../../common/MoveCamera"), u = t("../../common/StatsHelper"), d = t("../../common/ViewController"), h = t("../../Config"), p = t("../../texture/TextureLoader"), f = t("../tip/ToolTip"), m = cc._decorator, y = m.ccclass, _ = m.property, g = function(t) {
a(e, t);
function e() {
var e = null !== t && t.apply(this, arguments) || this;
e.parentResources = null;
e.txtName = null;
e.army = null;
e.population = null;
e.territory = null;
e.buildings = null;
e.icon = null;
e.buttonKingdom = null;
e.buttonLeader = null;
e.valueNode = null;
e.temp_res = [];
e.tempNode = null;
return e;
}
e.prototype.onLoad = function() {
this.tempNode = cc.instantiate(this.parentResources.children[0]);
};
e.prototype.start = function() {
if (h.default.selectedCity) {
var t = h.default.selectedCity;
this.icon.spriteFrame = p.TextureLoader.inst.getSpriteFrame(p.ATLAS_TYPE.UIATLAS, "icons/" + t.race.icon);
this.txtName.string = t.data.cityName;
this.population.string = t.getPopulationTotal() + "/" + t.status.homesTotal;
this.territory.string = t.zones.length + "/" + t.status.maximumZones;
this.army.string = t.getArmy() + "/" + t.getArmyMaxCity();
this.buildings.string = t.buildings.length <= 0 ? "0" : "" + t.buildings.length;
null == t.kingdom ? this.buttonKingdom.active = !1 : this.buttonKingdom.active = !0;
null == t.leader ? this.buttonLeader.active = !1 : this.buttonLeader.active = !0;
this.clearPrevButtons();
this.loadResources();
this.showValues();
}
};
e.prototype.loadResources = function() {
var t = this;
this.temp_res.clear();
this.temp_res.push(l.default.resources.get("gold"));
l.default.resources.list.forEach(function(e) {
"gold" != e.id && t.tryToAdd(e);
});
var e = 0, i = this.temp_res.length;
this.temp_res.forEach(function(o) {
t.loadResource(o, e, i);
e++;
});
};
e.prototype.tryToAdd = function(t) {
h.default.selectedCity.data.storage.get(t.id) > 0 && this.temp_res.push(t);
};
e.prototype.loadResource = function(t) {
var e = cc.instantiate(this.tempNode);
e.y = 10;
e.attr({
data: t
});
e.parent = this.parentResources;
e.getComponent(cc.Sprite).spriteFrame = t.getSprite();
e.addComponent(cc.Button);
e.on("click", this.clickResource, this);
e.getChildByName("label").getComponent(cc.Label).string = "" + h.default.selectedCity.data.storage.get(t.id);
};
e.prototype.showValues = function() {
var t, e;
try {
for (var i = n(this.valueNode.children), o = i.next(); !o.done; o = i.next()) {
var a = o.value, r = u.default.getStatistic(a.name);
a.getComponent(cc.RichText).string = r;
}
} catch (e) {
t = {
error: e
};
} finally {
try {
o && !o.done && (e = i.return) && e.call(i);
} finally {
if (t) throw t.error;
}
}
};
e.prototype.clearPrevButtons = function() {
this.parentResources.destroyAllChildren();
};
e.prototype.onDisable = function() {
h.default.selectedCity && (h.default.selectedCity = null);
t.prototype.onDisable.call(this);
};
e.prototype.clickAttribute = function(t, e) {
var i = t.getCurrentTarget();
f.default.info_tip = i.name;
f.default.inst.show(i, "tip", i.name, e);
};
e.prototype.clickResource = function(t) {
var e = t.node.data;
f.default.info_resource = e;
f.default.inst.show(t.node, "resource");
};
e.prototype.clickKingdom = function(t) {
h.default.selectedKingdom = h.default.selectedCity.kingdom;
d.default.open(d.view_type.KingdomWindow, null, t);
};
e.prototype.clickLeader = function(t) {
h.default.selectedUnit = h.default.selectedCity.leader;
d.default.open(d.view_type.CreatureInfo, null, t);
};
e.prototype.clickLocate = function() {
this.close();
c.MoveCamera.inst.focusOn(h.default.selectedCity.cityCenter);
};
r([ _(cc.Node) ], e.prototype, "parentResources", void 0);
r([ _(cc.Label) ], e.prototype, "txtName", void 0);
r([ _(cc.Label) ], e.prototype, "army", void 0);
r([ _(cc.Label) ], e.prototype, "population", void 0);
r([ _(cc.Label) ], e.prototype, "territory", void 0);
r([ _(cc.Label) ], e.prototype, "buildings", void 0);
r([ _(cc.Sprite) ], e.prototype, "icon", void 0);
r([ _(cc.Node) ], e.prototype, "buttonKingdom", void 0);
r([ _(cc.Node) ], e.prototype, "buttonLeader", void 0);
r([ _(cc.Node) ], e.prototype, "valueNode", void 0);
return r([ y ], e);
}(s.GamePopBase);
i.default = g;
cc._RF.pop();
}, {
"../../../../common/src/GamePopBase": void 0,
"../../Config": "Config",
"../../assetLibrary/AssetManager": "AssetManager",
"../../common/MoveCamera": "MoveCamera",
"../../common/StatsHelper": "StatsHelper",
"../../common/ViewController": "ViewController",
"../../texture/TextureLoader": "TextureLoader",
"../tip/ToolTip": "ToolTip"
} ],
City: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "17275YKkqNDpYVh8Vluv8Ow", "City");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
}), r = this && this.__decorate || function(t, e, i, o) {
var a, r = arguments.length, n = r < 3 ? e : null === o ? o = Object.getOwnPropertyDescriptor(e, i) : o;
if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) n = Reflect.decorate(t, e, i, o); else for (var s = t.length - 1; s >= 0; s--) (a = t[s]) && (n = (r < 3 ? a(n) : r > 3 ? a(e, i, n) : a(e, i)) || n);
return r > 3 && n && Object.defineProperty(e, i, n), n;
}, n = this && this.__values || function(t) {
var e = "function" == typeof Symbol && Symbol.iterator, i = e && t[e], o = 0;
if (i) return i.call(t);
if (t && "number" == typeof t.length) return {
next: function() {
t && o >= t.length && (t = void 0);
return {
value: t && t[o++],
done: !t
};
}
};
throw new TypeError(e ? "Object is not iterable." : "Symbol.iterator is not defined.");
};
Object.defineProperty(i, "__esModule", {
value: !0
});
i.CityStatus = i.CityIcon = i.CityData = void 0;
var s = t("../../../../framework/lib/prototype/MathUtils"), l = t("../../../../framework/utils/Tools"), c = t("../../../common/src/data/AchievData"), u = t("../../../common/src/GameCommon"), d = t("../actors/ActorBase"), h = t("../actors/ActorEquipment"), p = t("../actors/ActorEquipmentSlot"), f = t("../actors/ActorStatus"), m = t("../actors/other/Baby"), y = t("../ai/AiSystem"), _ = t("../assetLibrary/AssetManager"), g = t("../assetLibrary/lib/ItemLibrary"), v = t("../base/BaseBuilding"), b = t("../base/BaseMapObject"), T = t("../common/Globals"), w = t("../common/ItemTools"), B = t("../common/ToolBox"), k = t("../map/generator/ItemGenerator"), A = t("../map/generator/NameGenerator"), S = t("../MapBox"), x = t("../ui/log/WorldLog"), C = t("./CityJobs"), O = t("./CityStorage"), P = t("./CityTaskList"), R = function() {
this.cityName = "NEW_CITY";
this.storage = new O.default();
this.cityID = "";
this.kingdomID = "";
this.leaderID = "";
this.zones = [];
this.race = "null";
this.age = 0;
this.deaths = 0;
this.born = 0;
this.progress = 0;
this.level = 0;
this.timer_supply = 0;
this.timer_trade = 0;
this.timer_revolt = 0;
this.popPoints = [];
};
i.CityData = R;
var M = function(t) {
a(e, t);
function e() {
var e = null !== t && t.apply(this, arguments) || this;
e.text = null;
e.tip_id = "?";
return e;
}
return e;
}(cc.Component);
i.CityIcon = M;
var L = function() {
this.populationAdults = 0;
this.population = 0;
this.homesTotal = 0;
this.homesFree = 0;
this.homesOccupied = 0;
this.warriorSlots = 0;
this.warriorCurrent = 0;
this.hungry = 0;
this.maximumZones = 0;
};
i.CityStatus = L;
var F = cc._decorator, D = F.ccclass, I = (F.property, function(t) {
a(e, t);
function e() {
var e = null !== t && t.apply(this, arguments) || this;
e.professionsDict = new Map();
e.units = new d.ActorContainer();
e.buildings = new v.BuildingContainer();
e.buildings_dict_type = new Map();
e.buildings_dict_id = new Map();
e.tasks = new P.CityTasksData();
e.jobs = new C.default();
e.status = new L();
e.data = new R();
e.mapText = null;
e.cityStatusDirty = !1;
e.race = null;
e.kingdom = null;
e.leader = null;
e.army = null;
e.zones = [];
e.neighbourZones = [];
e.alive = !0;
e.underConstructionBuilding = null;
e.cityTickTimer = 0;
e.cityTickInterval = 6;
e.settlerTargetTimer = 15;
e.boatBuildTimer = 10;
e.roadTilesToBuild = [];
e.tilesToRemove = [];
e.cityEnemy = null;
e.lastPopulationCheck = 0;
e.samePopulationTicks = 0;
e.settleTarget = null;
e.attackZone = null;
e._cityTile = null;
e.timer_action = 0;
e._debug_nextPlannedBuilding = "";
e.capturingBy = null;
e.captureTicks = 0;
e.captureTimer = 0;
e.blacksmith = null;
e.cityCenter = cc.Vec3.ZERO;
e.lastCityCenter = cc.Vec3.ZERO;
e.ai = null;
e._unitsDirty = !1;
e.timer_warrior = 0;
e.currentTaskID_unit = 0;
e.currentTaskID_warrior = 0;
e._opinion_king = 0;
e._opinion_leader = 0;
e._opinion_population = 0;
e._opinion_zones = 0;
e._opinion_distance = 0;
e._opinion_capital = 0;
e._opinion_loyalty_traits = 0;
e._opinion_loyalty_mood = 0;
e._opinion_new_city = 0;
e._opinion_new_kingdom = 0;
e._opinion_cities = 0;
e._opinion_superior_enemies = 0;
e._opinion_close_to_capital = 0;
e._opinion_world_law = 0;
e._opinion_total = 0;
e.gold_in_tax = 0;
e.gold_out_army = 0;
e.gold_out_buildigs = 0;
e.gold_out_homeless = 0;
e.gold_change = 0;
e.capturingUnits = new Map();
e.bonfire = null;
return e;
}
i = e;
e.prototype.create = function() {
t.prototype.create.call(this);
this.createAI();
this.cityStatusDirty = !0;
};
e.prototype.createAI = function() {
this.ai = new y.AiSystemCity(this);
this.ai.nextJobDelegate = this.getNextJob;
this.ai.jobs_library = _.default.job_city;
this.ai.task_library = _.default.tasks_city;
};
e.prototype.getTile = function() {
return this._cityTile;
};
e.prototype.recalculateCityTile = function() {
var t, e, i, o;
this._cityTile = null;
var a = this.getBuildingType("bonfire");
if (a) this._cityTile = a.currentTile; else {
var r = this.buildings.getSimpleList();
r.shuffle();
try {
for (var s = n(r), l = s.next(); !l.done; l = s.next()) {
var c = l.value;
if (!c.stats.docks && !c.currentTile.type.water) {
this._cityTile = c.currentTile;
return;
}
}
} catch (e) {
t = {
error: e
};
} finally {
try {
l && !l.done && (e = s.return) && e.call(s);
} finally {
if (t) throw t.error;
}
}
if (0 != this.zones.length) try {
for (var u = n(this.zones), d = u.next(); !d.done; d = u.next()) {
var h = d.value;
if (!h.centerTile.type.water) {
this._cityTile = h.centerTile;
break;
}
}
} catch (t) {
i = {
error: t
};
} finally {
try {
d && !d.done && (o = u.return) && o.call(u);
} finally {
if (i) throw i.error;
}
}
}
};
e.prototype.countInHouses = function() {
var t = 0;
this.units.list.forEach(function(e) {
e.insideBuilding && t++;
});
return t;
};
e.prototype.setKingdom = function(t) {
var e = this;
this.kingdom = t;
if (this.kingdom) {
this.data.kingdomID = t.data.id;
this.kingdom.addCity(this);
} else this.data.kingdomID = null;
this.units.list.forEach(function(t) {
var i;
t.setKingdom(e.kingdom);
(null === (i = t.data) || void 0 === i ? void 0 : i.profession) == f.UnitProfession.King && t.setProfession(f.UnitProfession.Unit);
});
};
e.prototype.getStorageNear = function(t) {
var e = null, i = 0, o = 0;
this.buildings.list.forEach(function(a) {
var r, n;
if ((null === (r = a.stats) || void 0 === r ? void 0 : r.storage) && !(null === (n = a.data) || void 0 === n ? void 0 : n.underConstruction)) {
i = B.Toolbox.distVec2(a.currentTile.pos, t.pos);
if (!e || i < o) {
o = i;
e = a;
}
}
});
return e || null;
};
e.prototype.getRoadTileToBuild = function() {
var t = this;
this.tilesToRemove.clear();
this.roadTilesToBuild.forEach(function(e) {
e.type.road && t.tilesToRemove.push(e);
});
this.tilesToRemove.forEach(function(e) {
t.roadTilesToBuild.remove(e);
});
return this.roadTilesToBuild.length > 0 ? this.roadTilesToBuild[0] : null;
};
e.prototype.getNextJob = function() {
return "city";
};
e.prototype.checkSettleTarget = function() {
this.settleTarget && (this.settleTarget.city == this ? this.settleTarget = null : this.settleTarget.city && (this.settleTarget.city.kingdom != this.kingdom ? this.settleTarget = null : this.settleTarget.city.getPopulationTotal() >= 30 && (this.settleTarget = null)));
};
e.prototype.createNewCity = function() {
this.data.cityID = S.default.inst.mapStats.getNextId("city");
};
e.prototype.generateName = function() {
this.data.cityName = A.default.getName(this.race.name_template_city);
this.node.name = this.data.cityName;
};
e.prototype.setRace = function(t) {
this.race = t;
this.data.race = t.id;
};
e.prototype.loadLeader = function() {
this.data.leaderID && i.makeLeader(S.default.inst.getActorByID(this.data.leaderID), this);
};
e.prototype.newCityEvent = function() {
this.recalculateCityTile();
this.generateName();
};
e.prototype.loadCity = function(t) {
this.data = t;
this.data.storage.loadFromSave();
this.race = _.default.raceLibrary.dict.get(this.data.race);
this.node.name = this.data.cityName;
this.updateCityStatus();
};
e.prototype.addNewUnit = function(t, e, i) {
void 0 === e && (e = !0);
void 0 === i && (i = !0);
this._unitsDirty = !0;
t.setCity(this);
this.units.add(t);
this.cityStatusDirty = !0;
e && t.setKingdom(this.kingdom);
};
e.prototype.updateCityStatus = function() {
var t = this;
this.cityStatusDirty = !1;
this.recalculateCityTile();
this.recalculateNeighbourZones();
this.status.maximumZones = this.race.civ_baseZones;
this.status.maximumZones += 3 * this.buildings.length;
this.leader && (this.status.maximumZones += this.leader.curStats.zones);
this.status.population = this.getPopulationTotal();
this.status.populationAdults = this.getPopulationTotal() - this.countProfession(f.UnitProfession.Baby);
this.status.hungry = 0;
this.status.homesTotal = 0;
this.status.homesFree = 0;
this.status.homesOccupied = 0;
this.blacksmith = null;
this.units.list.forEach(function(e) {
e.data.hunger <= 10 && t.status.hungry++;
e.isCurrentJob("blacksmith") && (t.blacksmith = e);
});
this.buildings.list.forEach(function(e) {
var i, o;
(null === (i = e.data) || void 0 === i ? void 0 : i.underConstruction) || (t.status.homesTotal += null === (o = null == e ? void 0 : e.stats) || void 0 === o ? void 0 : o.housing);
});
this.status.population > this.status.homesTotal ? this.status.homesOccupied = this.status.homesTotal : this.status.homesOccupied = this.status.population;
this.status.homesFree = this.status.homesTotal - this.status.homesOccupied;
};
e.prototype.recalculateNeighbourZones = function() {
var t = this;
this.neighbourZones.clear();
this.zones.forEach(function(e) {
e.neighboursAll.forEach(function(e) {
e.city || t.neighbourZones.includes(e) || t.neighbourZones.push(e);
});
});
};
e.prototype.removeCitizen = function(t, e, o) {
var a, r, n, s;
void 0 === e && (e = !1);
void 0 === o && (o = f.AttackType.Other);
null === (a = this.units) || void 0 === a || a.remove(t);
this.cityStatusDirty = !0;
if (this.data) {
if (e) {
this.data.deaths++;
this.kingdom && this.kingdom.data.deaths++;
}
this.leader == t && this.removeLeader();
if ((null === (r = this.kingdom) || void 0 === r ? void 0 : r.king) == t) {
this.kingdom.removeKing();
if (o != f.AttackType.Age && o != f.AttackType.Plague && o != f.AttackType.Hunger && (null === (n = null == t ? void 0 : t.attackedBy) || void 0 === n ? void 0 : n.a)) {
x.default.logKingMurder(this.kingdom, t, null === (s = null == t ? void 0 : t.attackedBy) || void 0 === s ? void 0 : s.a);
t.attackedBy.a.addTrait("kingslayer");
} else x.default.logKingDead(this.kingdom, t);
}
o == f.AttackType.Age && i.giveItemsToCity(this, t);
}
};
e.giveItemsToCity = function(t, e) {
h.default.getList(e.equipment).forEach(function(e) {
var i = t.data.storage.itemStorage.getSlot(e.type);
if (i.isEmpty()) i.setItem(e.data); else {
w.default.calcItemValues(i.data);
var o = w.default.s_value;
w.default.calcItemValues(e.data);
w.default.s_value > o && i.setItem(e.data);
}
});
};
e.prototype.removeLeader = function() {
this.leader = null;
this.data.leaderID = null;
};
e.prototype.updateNamePosition = function() {
S.default.inst.showCityNames() && this.mapText && this.mapText.updateFromCity();
};
e.prototype.logicUpdate = function(e) {
t.prototype.logicUpdate.call(this, e);
this.buildings.checkAddRemove();
this.units.checkAddRemove();
this.data.timer_supply > 0 && (this.data.timer_supply -= e);
this.data.timer_trade > 0 && (this.data.timer_trade -= e);
this.data.timer_revolt > 0 && (this.data.timer_revolt -= e);
this.timer_warrior > 0 && (this.timer_warrior -= e);
this.mapText && this.mapText.updateFromCity();
this.data.age >= 1 && (0 == this.zones.length || 0 == this.getPopulationTotal()) && S.default.inst.destroyCity(this);
this.leader && !this.leader.curStats && this.removeLeader();
this.cityStatusDirty && this.updateCityStatus();
this.updateNamePosition();
if (!u.default.isPaused) {
this.settlerTargetTimer > 0 && (this.settlerTargetTimer -= e);
this.boatBuildTimer > 0 && (this.boatBuildTimer -= e);
this._unitsDirty && this.updateCitizens();
if (this.cityTickTimer > 0) this.cityTickTimer -= e; else {
this.cityTickTimer = this.cityTickInterval;
this.updateTasks();
}
this.ai && (this.timer_action > 0 ? this.timer_action -= e : this.ai.logicUpdate(e));
this.updateCapture(e);
}
};
e.prototype.updateCapture = function(t) {
var e = this;
if (this.captureTimer > 0) this.captureTimer -= t; else {
this.captureTimer = .1;
var i = null;
this.capturingUnits.forEach(function(t, o) {
i ? e.capturingUnits.get(o) > e.capturingUnits.get(i) && (i = o) : i = o;
});
if (i) if (this.kingdom == i && this.capturingBy) {
this.captureTicks -= 1;
this.captureTicks <= 0 && this.clearCapture();
} else {
if (!i.isEnemy(this.kingdom)) return;
if (this.capturingBy && this.capturingBy != i) if (i.isEnemy(this.capturingBy)) {
this.captureTicks -= .5;
this.captureTicks <= 0 && this.clearCapture();
} else {
this.captureTicks += 1;
this.captureTicks >= 100 && this.checkConquestBy(this.capturingBy);
} else {
this.captureTicks += 1;
this.capturingBy = i;
this.captureTicks >= 100 && this.checkConquestBy(i);
}
} else {
this.captureTicks -= .5;
this.captureTicks <= 0 && this.clearCapture();
}
}
};
e.prototype.clearCapture = function() {
this.captureTicks = 0;
this.capturingBy = null;
};
e.prototype.updateCitizens = function() {
var t, e, i, o, a;
this.professionsDict.forEach(function(t) {
t.clear();
});
var r = [];
try {
for (var s = n(this.units.list), l = s.next(); !l.done; l = s.next()) if (!(d = l.value).stats.baby) if (null === (a = d.data) || void 0 === a ? void 0 : a.alive) {
this.professionsDict.has(d.data.profession) || this.professionsDict.set(d.data.profession, []);
this.professionsDict.get(d.data.profession).push(d);
} else r.push(d);
} catch (e) {
t = {
error: e
};
} finally {
try {
l && !l.done && (e = s.return) && e.call(s);
} finally {
if (t) throw t.error;
}
}
try {
for (var c = n(r), u = c.next(); !u.done; u = c.next()) {
var d = u.value;
this.units.remove(d);
}
} catch (t) {
i = {
error: t
};
} finally {
try {
u && !u.done && (o = c.return) && o.call(c);
} finally {
if (i) throw i.error;
}
}
};
e.prototype.updateTasks = function() {};
e.prototype.needMoreAttackers = function(t) {
if (this.jobs.countOccupied("attacker") < this.jobs.countOccupied("defender")) {
this.jobs.freeJob("defender");
this.jobs.takeJob("attacker");
t.ai.setJob("attacker");
return !0;
}
return !1;
};
e.prototype.countProfession = function(t) {
return this.professionsDict.has(t) ? this.professionsDict.get(t).length : 0;
};
e.prototype.addProgress = function(t) {
if (10 != this.data.level) {
this.data.progress += t;
if (this.data.progress >= 100 + 20 * this.data.level) {
this.data.progress = 0;
this.data.level++;
this.data.level > 10 && (this.data.level = 10);
}
}
};
e.prototype.destroyCity = function() {
this.alive = !1;
this.buildings.checkAddRemove();
this.units.checkAddRemove();
this.mapText && this.mapText.remove();
this.kingdom && this.kingdom.removeCity(this);
this.units.list.forEach(function(t) {
t.removeFromCity();
});
this.zones.forEach(function(t) {
t.setCity(null);
});
this.buildings.list.forEach(function(t) {
var e, i;
t.setCity(null);
t.object_destroyed || ((null === (e = t.data) || void 0 === e ? void 0 : e.underConstruction) || !(null === (i = t.stats) || void 0 === i ? void 0 : i.canBeAbandoned) ? t.startDestroyBuilding() : t.makeAbandoned());
});
this.buildings.clear();
this.buildings_dict_id.clear();
this.buildings_dict_type.clear();
this.zones.clear();
this.units.clear();
};
e.prototype.removeBuilding = function(t) {
this.cityStatusDirty = !0;
this.buildings.remove(t);
this.setBuildingDictType(t, !1);
if ((null == t ? void 0 : t.stats) && t.stats.housing > 0 && this.data.popPoints.length > 0) {
this.killRandomPopPoints();
this.spawnRandomPopPoints(t.stats.housing, t.currentTile);
}
this.underConstructionBuilding == t && (this.underConstructionBuilding = null);
0 == this.buildings.length && S.default.inst.destroyCity(this);
this.shrinkZones(!1);
};
e.getActorDataPopPoint = function(t) {
if (0 == t.data.popPoints.length) return null;
var e = t.data.popPoints.getRandom();
t.data.popPoints.remove(e);
return e;
};
e.prototype.spawnPopPoint = function(t, e) {
if ((null == t ? void 0 : t.status) && !S.default.inst.reachCreatureMaxLimit()) {
t.status.actorID = S.default.inst.mapStats.getNextId("unit");
if (t.status.age <= 8) {
t.status.statsID = t.status.statsID.replace("unit_", "baby_");
t.status.profession = f.UnitProfession.Baby;
}
_.default.unitStats.get(t.status.statsID).traits.forEach(function(e) {
t.status.traits.includes(e) || t.status.traits.push(e);
});
var i = S.default.inst.spawnAndLoadUnit(t.status.statsID, t, e);
if (i.stats.baby) {
i.getComponent(m.default).timerGrow = i.stats.timeToGrow;
"human" == i.race.id && c.default.update(10);
}
}
};
e.prototype.spawnRandomPopPoints = function(t, e) {
for (var o = 0; o < t; o++) {
var a = i.getActorDataPopPoint(this);
if (!a) break;
this.spawnPopPoint(a, e);
}
};
e.prototype.killHalfPopPoints = function() {
this.killRandomPopPoints(this.data.popPoints.length / 2 + 1);
};
e.prototype.killRandomPopPoints = function(t) {
void 0 === t && (t = 1);
var e = t;
1 == e && (this.data.popPoints.length > 1e3 ? e += this.data.popPoints.length / 100 : this.data.popPoints.length > 100 && (e += this.data.popPoints.length / 10));
this.data.popPoints.shuffle();
for (var i = 0; i < e && 0 != this.data.popPoints.length; i++) this.data.popPoints.splice(this.data.popPoints.length - 1, 1);
};
e.prototype.spendResourcesFor = function(t) {
this.data.storage.change("wood", -t.wood);
this.data.storage.change("gold", -t.gold);
this.data.storage.change("stone", -t.stone);
this.data.storage.change("metals", -t.metals);
};
e.prototype.haveEnoughResourcesFor = function(t) {
return !(T.default.BUILDINGS_USE_RESOURCES && (this.data.storage.get("wood") < t.wood || this.data.storage.get("metals") < t.metals || this.data.storage.get("stone") < t.stone || this.data.storage.get("gold") < t.gold));
};
e.prototype.getHallLevel = function() {
var t = this.buildings_dict_type.get("hall");
return t ? t[0].stats.upgradeLevel : 0;
};
e.prototype.getBuildingToBuild = function() {
var t, e, i, o;
(null === (e = null === (t = this.underConstructionBuilding) || void 0 === t ? void 0 : t.data) || void 0 === e ? void 0 : e.underConstruction) && (null === (o = null === (i = this.underConstructionBuilding) || void 0 === i ? void 0 : i.data) || void 0 === o ? void 0 : o.alive) || (this.underConstructionBuilding = null);
return this.underConstructionBuilding;
};
e.prototype.setBuildingDictType = function(t, e) {
this.buildings_dict_type.has(t.stats.type) || this.buildings_dict_type.set(t.stats.type, []);
e ? this.buildings_dict_type.get(t.stats.type).push(t) : this.buildings_dict_type.get(t.stats.type).remove(t);
this.setBuildingDictID(t, e);
};
e.prototype.setBuildingDictID = function(t, e) {
this.buildings_dict_id.has(t.stats.id) || this.buildings_dict_id.set(t.stats.id, []);
e ? this.buildings_dict_id.get(t.stats.id).push(t) : this.buildings_dict_id.get(t.stats.id).remove(t);
};
e.prototype.addBuilding = function(t) {
t.setCity(this);
this.buildings.add(t);
this.setBuildingDictType(t, !0);
this.cityStatusDirty = !0;
c.default.update(4, this.buildings.length, !0);
return t;
};
e.prototype.countBuildingsType = function(t) {
return this.buildings_dict_type.has(t) ? this.buildings_dict_type.get(t).length : 0;
};
e.prototype.countBuildingsID = function(t) {
return this.buildings_dict_id.has(t) ? this.buildings_dict_id.get(t).length : 0;
};
e.prototype.haveBuildingType = function(t, e) {
var i;
void 0 === e && (e = !0);
if (!this.buildings_dict_type.has(t) || 0 == this.buildings_dict_type.get(t).length) return !1;
var o = this.buildings_dict_type.get(t)[0];
return !(e && (null === (i = o.data) || void 0 === i ? void 0 : i.underConstruction));
};
e.prototype.getBuildingType = function(t, e, i) {
var o;
void 0 === e && (e = !0);
void 0 === i && (i = !1);
if (!this.buildings_dict_type.has(t) || 0 == this.buildings_dict_type.get(t).length) return null;
var a = i ? this.buildings_dict_type.get(t).getRandom() : this.buildings_dict_type.get(t)[0];
return e && (null === (o = a.data) || void 0 === o ? void 0 : o.underConstruction) ? null : a;
};
e.prototype.addRoads = function(t) {
var e = this;
t.forEach(function(t) {
t.type.road || e.roadTilesToBuild.includes(t) || e.roadTilesToBuild.push(t);
});
};
e.prototype.tryToMakeWarrior = function(t) {
if (this.status.warriorSlots <= this.status.warriorCurrent) return !1;
if (!this.blacksmith) return !1;
this.data.storage.itemStorage.weapon.data || this.tryProduceItem(this.blacksmith, g.ItemProductionOrder.Weapon);
if (!this.data.storage.itemStorage.weapon.data && t.equipment.weapon.isEmpty()) return !1;
t.setProfession(f.UnitProfession.Warrior);
t.equipment.weapon.isEmpty() && i.giveItem(t, this.data.storage.itemStorage.weapon, this);
this.status.warriorCurrent++;
c.default.update(28, this.status.warriorCurrent, !0);
this.timer_warrior = 30;
if (this.leader) {
var e = this.leader.curStats.warfare / 2;
this.timer_warrior -= e;
this.timer_warrior < 1 && (this.timer_warrior = 1);
}
this.haveBuildingType("barracks") && (this.timer_warrior /= 2);
return !0;
};
e.prototype.findNewJob = function(t) {
if (0 == this.captureTicks) if (t.isProfession(f.UnitProfession.Warrior)) {
if (this.status.warriorSlots < this.status.warriorCurrent) {
t.setProfession(f.UnitProfession.Unit);
this.status.warriorCurrent--;
}
} else if (this.timer_warrior <= 0 && t.isProfession(f.UnitProfession.Unit) && this.data.storage.get("gold") > 10 && this.tryToMakeWarrior(t)) return;
P.default.prepare(this, t);
if (!(P.default.checkJob("fireman") || P.default.checkJob("builder") || !this.getFoodItem() && P.default.checkJob("gatherer"))) for (var e = t.isProfession(f.UnitProfession.Warrior) ? P.default.jobsWarrior : P.default.jobsUnit, i = 0; i < e.length; i++) {
var o = "";
if (t.isProfession(f.UnitProfession.Warrior)) {
this.currentTaskID_warrior++;
this.currentTaskID_warrior > e.length - 1 && (this.currentTaskID_warrior = 0);
o = e[this.currentTaskID_warrior];
} else {
this.currentTaskID_unit++;
this.currentTaskID_unit > e.length - 1 && (this.currentTaskID_unit = 0);
o = e[this.currentTaskID_unit];
}
if (("settler" != o || t != this.leader && t != this.kingdom.king) && P.default.checkJob(o)) break;
}
};
e.prototype.tryProduceItem = function(t, e) {
void 0 === e && (e = g.ItemProductionOrder.Both);
switch (e) {
case g.ItemProductionOrder.Random:
var i = h.default.getList(this.data.storage.itemStorage, !0);
if (0 != i.length) {
var o = i.getRandom();
this.produceItem(t.data.firstName, o);
}
break;

case g.ItemProductionOrder.Weapon:
this.data.storage.itemStorage.weapon.data || this.produceItem(t.data.firstName, this.data.storage.itemStorage.weapon);
break;

case g.ItemProductionOrder.Both:
this.tryProduceItem(t, g.ItemProductionOrder.Random);
this.tryProduceItem(t, g.ItemProductionOrder.Weapon);
}
};
e.prototype.produceItem = function(t, e) {
var i = null;
switch (e.type) {
case p.EquipmentType.Weapon:
i = _.default.items_material_weapon;
break;

case p.EquipmentType.Helmet:
case p.EquipmentType.Armor:
case p.EquipmentType.Boots:
i = _.default.items_material_armor;
break;

case p.EquipmentType.Ring:
case p.EquipmentType.Amulet:
i = _.default.items_material_accessory;
}
var o = _.default.items.getEquipmentID(e.type);
"weapon" == o && (o = this.race.preferred_weapons.getRandom());
var a = _.default.items.get(o), r = this.data.storage.getMaterialForItem(a, i, this.data.level);
if (r) {
k.default.generateItem(a, r.id, e, S.default.inst.mapStats.year, this.kingdom.data.name, t);
this.data.storage.change("gold", -r.cost_gold);
"none" != r.cost_resource_id_1 && this.data.storage.change(r.cost_resource_id_1, -r.cost_resource_1);
"none" != r.cost_resource_id_2 && this.data.storage.change(r.cost_resource_id_2, -r.cost_resource_2);
}
};
e.prototype.getFoodItem = function(t) {
void 0 === t && (t = "");
return t && this.data.storage.get(t) > 0 ? _.default.resources.get(t) : this.data.storage.getRandomFood();
};
e.prototype.eatFoodItem = function(t) {
t && this.data.storage.change(t, -1);
};
e.prototype.removeZone = function(t) {
t.setCity(null);
this.zones.remove(t) && S.default.inst.cityPlaceFinder.setDirty();
this.updateCityCenter();
};
e.prototype.addZone = function(t) {
var e, i, o = this;
if (!this.zones.includes(t)) {
this.zones.push(t);
c.default.update(22, this.zones.length, !0);
t.setCity(this);
this.updateCityCenter();
S.default.inst.cityPlaceFinder.zones.length > 0 && S.default.inst.cityPlaceFinder.setDirty();
this.cityStatusDirty = !0;
B.Toolbox.temp_list_buildings_2 = [];
B.Toolbox.temp_list_buildings_2.addRange(Array.from(t.abandoned));
B.Toolbox.temp_list_buildings_2.forEach(function(t) {
if (t.stats.cityBuilding && (!t.stats.race || t.stats.race == o.kingdom.race.id) && t.data.state == v.BuildingState.CivAbandoned) {
o.addBuilding(t);
t.retake();
}
});
var a = 0;
try {
for (var r = n(this.kingdom.cities), s = r.next(); !s.done; s = r.next()) a += s.value.zones.length;
} catch (t) {
e = {
error: t
};
} finally {
try {
s && !s.done && (i = r.return) && i.call(r);
} finally {
if (e) throw e.error;
}
}
var l = Math.floor(a / S.default.inst.zoneCalculator.length * 100);
c.default.update(62, l, !0);
1 == S.default.inst.kingdoms.length && l >= 60 && c.default.update(39, l, !0);
}
};
e.prototype.getRelationRating = function() {
this._opinion_king = 0;
this._opinion_leader = 0;
this._opinion_population = 0;
this._opinion_zones = 0;
this._opinion_distance = 0;
this._opinion_capital = 0;
this._opinion_loyalty_traits = 0;
this._opinion_loyalty_mood = 0;
this._opinion_cities = 0;
this._opinion_superior_enemies = 0;
this._opinion_close_to_capital = 0;
this._opinion_world_law = 0;
if (!S.default.inst.worldLaws.world_law_rebellions.boolVal) {
this._opinion_world_law = 100;
this._opinion_total = 100;
return this._opinion_total;
}
if (this.isCapitalCity()) {
this._opinion_total = 100;
this._opinion_capital = 100;
return this._opinion_total;
}
this.kingdom.capital && i.nearbyBorders(this.kingdom.capital, this) && (this._opinion_close_to_capital = 15);
this.data.age <= 25 ? this._opinion_new_city = 25 - this.data.age : this._opinion_new_city = 0;
this.kingdom.data.age <= 30 ? this._opinion_new_kingdom = 30 - this.kingdom.data.age : this._opinion_new_kingdom = 0;
if (this.kingdom.civs_enemies.size > 0) {
var t = 0;
this.kingdom.civs_enemies.forEach(function(e, i) {
t += i.power;
});
this._opinion_superior_enemies = (t - this.kingdom.power) / 2;
this._opinion_superior_enemies < 0 ? this._opinion_superior_enemies = 0 : this._opinion_superior_enemies > 50 && (this._opinion_superior_enemies = 50);
}
this.kingdom.king && (this._opinion_king = this.kingdom.king.curStats.diplomacy);
var e = this.kingdom.getMaxCities();
this.kingdom.cities.length > e && (this._opinion_cities = 25 * (e - this.kingdom.cities.length));
if (this.leader) {
this._opinion_leader = -this.leader.curStats.diplomacy;
this._opinion_loyalty_traits = this.leader.curStats.loyalty_traits;
}
if (this.leader && this.kingdom.king) {
var o = _.default.traits.checkTraitsMod(this.leader, this.kingdom.king);
this._opinion_loyalty_traits += o;
}
if (this.kingdom.capital) {
var a = Math.abs(this.status.population - this.kingdom.capital.status.population) / 3;
a > 30 && (a = 30);
this.status.population > this.kingdom.capital.status.population ? this._opinion_population = -a : this._opinion_population = a;
var r = Math.abs(this.zones.length - this.kingdom.capital.zones.length) / 20;
r > 5 && (r = 5);
this.zones.length > this.kingdom.capital.zones.length ? this._opinion_zones = -r : this._opinion_zones = r;
if (this.cityCenter.x != T.default.POINT_IN_VOID.x && this.kingdom.capital.cityCenter.x != T.default.POINT_IN_VOID.x) {
var n = s.default.intCast(B.Toolbox.distVec3(this.cityCenter, this.kingdom.capital.cityCenter) / 10);
this._opinion_distance = -n;
}
} else this._opinion_capital = -20;
this.leader && (this._opinion_loyalty_mood = this.leader.curStats.loyalty_mood);
this._opinion_total = this._opinion_king + this._opinion_leader + this._opinion_population + this._opinion_zones + this._opinion_distance + this._opinion_capital + this._opinion_loyalty_traits + this._opinion_loyalty_mood + this._opinion_new_kingdom + this._opinion_cities + this._opinion_superior_enemies + this._opinion_close_to_capital + this._opinion_new_city;
return this._opinion_total;
};
e.prototype.isCapitalCity = function() {
return !!this.kingdom && this == this.kingdom.capital;
};
e.prototype.updateAge = function() {
this.data.age++;
this.gold_in_tax = this.getPopulationTotal() / 2;
this.gold_out_homeless = this.getPopulationTotal() - this.status.homesTotal;
this.gold_out_homeless < 0 && (this.gold_out_homeless = 0);
this.gold_out_army = this.countProfession(f.UnitProfession.Warrior) / 2;
this.gold_out_buildigs = this.buildings.length / 2;
this.gold_change = this.gold_in_tax - this.gold_out_army - this.gold_out_buildigs - this.gold_out_homeless;
var t = this.gold_change;
t < 0 && (t = 0);
this.data.storage.change("gold", t);
this.updatePopPoints();
};
e.prototype.updatePopPoints = function() {
if (0 != this.data.popPoints.length) for (var t = 0; t < this.data.popPoints.length; ) {
var e = this.data.popPoints[t];
e && e.status && !e.status.updateAge && (e.status = l.default.fromJson(e.status, new f.default()));
e.status.updateAge(this.race) ? t++ : this.data.popPoints.splice(t, 1);
}
};
e.prototype.updateCityCenter = function() {
var t = this;
if (0 != this.zones.length) {
var e = 0, i = 0, o = 0, a = 0, r = null;
this.zones.forEach(function(t) {
e += t.centerTile.posV3.x;
i += t.centerTile.posV3.y;
});
this.cityCenter.x = e / this.zones.length;
this.cityCenter.y = i / this.zones.length;
this.zones.forEach(function(e) {
o = B.Toolbox.dist(e.centerTile.x, e.centerTile.y, t.cityCenter.x, t.cityCenter.y);
if (!r || o < a) {
r = e;
a = o;
}
});
this.cityCenter.x = r.centerTile.posV3.x;
this.cityCenter.y = r.centerTile.posV3.y + 2;
this.lastCityCenter = this.cityCenter;
} else this.cityCenter = T.default.POINT_IN_VOID;
};
e.prototype.removeFromCurrentKingdom = function() {
var t = this;
this.kingdom.cities.forEach(function(t) {
t.zones.forEach(function(t) {
S.default.inst.zoneCalculator.setDirty(t);
});
});
this.kingdom.removeCity(this);
this.units.list.forEach(function(e) {
t.kingdom.removeUnit(e);
});
};
e.prototype.switchedKingdom = function() {
var t = this;
this.kingdom.cities.forEach(function(t) {
t.zones.forEach(function(t) {
S.default.inst.zoneCalculator.setDirty(t);
});
});
this.buildings.list.forEach(function(e) {
e.data.state != v.BuildingState.Removed && e.setKingdom(t.kingdom);
});
};
e.prototype.useInspire = function() {
var t = this.kingdom;
this.makeOwnKingdom();
S.default.inst.kingdoms.diplomacyManager.startWar(this.kingdom, t, !0);
};
e.prototype.clearCurrentCaptureAmounts = function() {
this.capturingUnits.clear();
};
e.prototype.updateConquest = function(t) {
if (t.kingdom.isCiv() && t.kingdom.race == this.kingdom.race && (t.kingdom == this.kingdom || t.kingdom.isEnemy(this.kingdom))) if (this.capturingUnits.has(t.kingdom)) {
var e = this.capturingUnits.get(t.kingdom);
this.capturingUnits.set(t.kingdom, e++);
} else this.capturingUnits.set(t.kingdom, 1);
};
e.prototype.checkConquestBy = function(t) {
this.clearCapture();
this.joinAnotherKingdom(t);
c.default.update(29);
};
e.prototype.getMaximumZones = function() {
return this.status.maximumZones;
};
e.prototype.shrinkZones = function(t) {
var e, i, o, a;
void 0 === t && (t = !0);
if (!(t && B.Toolbox.randomChance(.2) || 0 == this.zones.length)) {
var r = null, s = 0, l = 0;
try {
for (var c = n(this.zones), u = c.next(); !u.done; u = c.next()) {
var d = u.value;
if (!(d.buildings.size > 0)) {
s = B.Toolbox.distVec2(d.centerTile.pos, cc.v2(this.cityCenter));
if (!r || s > l) {
var h = !0;
try {
for (var p = (o = void 0, n(d.neighbours)), f = p.next(); !f.done; f = p.next()) if (f.value.city != this) {
h = !1;
break;
}
} catch (t) {
o = {
error: t
};
} finally {
try {
f && !f.done && (a = p.return) && a.call(p);
} finally {
if (o) throw o.error;
}
}
if (!h) {
r = d;
l = s;
}
}
}
}
} catch (t) {
e = {
error: t
};
} finally {
try {
u && !u.done && (i = c.return) && i.call(c);
} finally {
if (e) throw e.error;
}
}
if (r) {
this.removeZone(r);
this.cityStatusDirty = !0;
}
}
};
e.prototype.makeOwnKingdom = function() {
this.removeFromCurrentKingdom();
var t = S.default.inst.kingdoms.makeNewCivKingdom(this);
this.switchedKingdom();
return t;
};
e.prototype.getPopulationTotal = function() {
return this.units.length + this.data.popPoints.length;
};
e.prototype.getPopulationPopPoints = function() {
return this.data.popPoints.length;
};
e.prototype.getPopulationUnits = function() {
return this.units.length;
};
e.prototype.joinAnotherKingdom = function(t) {
var e = this.kingdom;
this.removeFromCurrentKingdom();
this.setKingdom(t);
this.switchedKingdom();
t.data.timer_event = 0;
this.data.timer_revolt = 150;
t.capturedFrom(e);
};
e.prototype.forceSettleTarget = function(t) {
this.settlerTargetTimer = 500;
this.settleTarget = null;
t != this && t.getTile() && (this.settleTarget = t.getTile().zone);
};
e.prototype.getArmy = function() {
return this.countProfession(f.UnitProfession.Warrior);
};
e.prototype.getArmyMaxLeader = function() {
var t = this.race.civ_baseArmy;
this.leader && (t += this.leader.curStats.army);
return (t = s.default.clamp(t, 10, 65)) + this.getPopulationTotal() * t / 100;
};
e.prototype.getArmyMaxCity = function() {
return this.status.warriorSlots;
};
e.makeLeader = function(t, e) {
if (t && e.kingdom.king != t) {
e.leader = t;
e.leader.setProfession(f.UnitProfession.Leader);
e.data.leaderID = t.data.actorID;
}
};
e.nearbyBorders = function(t, e) {
var i, o, a, r, s = null, l = null;
if (t.zones.length > e.zones.length) {
s = e;
l = t;
} else {
s = t;
l = e;
}
try {
for (var c = n(s.zones), u = c.next(); !u.done; u = c.next()) {
var d = u.value;
try {
for (var h = (a = void 0, n(d.neighboursAll)), p = h.next(); !p.done; p = h.next()) if (p.value.city == l) return !0;
} catch (t) {
a = {
error: t
};
} finally {
try {
p && !p.done && (r = h.return) && r.call(h);
} finally {
if (a) throw a.error;
}
}
}
} catch (t) {
i = {
error: t
};
} finally {
try {
u && !u.done && (o = c.return) && o.call(c);
} finally {
if (i) throw i.error;
}
}
return !1;
};
e.giveItem = function(t, e) {
var i = t.equipment.getSlot(e.type);
if (i.data) {
w.default.calcItemValues(i.data);
var o = w.default.s_value;
w.default.calcItemValues(e.data);
if (w.default.s_value > o) {
var a = i.data;
i.setItem(e.data);
e.setItem(a);
t.statsDirty = !0;
}
return !1;
}
i.setItem(e.data);
e.emptySlot();
t.statsDirty = !0;
return !0;
};
var i;
return i = r([ D ], e);
}(b.default));
i.default = I;
cc._RF.pop();
}, {
"../../../../framework/lib/prototype/MathUtils": void 0,
"../../../../framework/utils/Tools": void 0,
"../../../common/src/GameCommon": void 0,
"../../../common/src/data/AchievData": void 0,
"../MapBox": "MapBox",
"../actors/ActorBase": "ActorBase",
"../actors/ActorEquipment": "ActorEquipment",
"../actors/ActorEquipmentSlot": "ActorEquipmentSlot",
"../actors/ActorStatus": "ActorStatus",
"../actors/other/Baby": "Baby",
"../ai/AiSystem": "AiSystem",
"../assetLibrary/AssetManager": "AssetManager",
"../assetLibrary/lib/ItemLibrary": "ItemLibrary",
"../base/BaseBuilding": "BaseBuilding",
"../base/BaseMapObject": "BaseMapObject",
"../common/Globals": "Globals",
"../common/ItemTools": "ItemTools",
"../common/ToolBox": "ToolBox",
"../map/generator/ItemGenerator": "ItemGenerator",
"../map/generator/NameGenerator": "NameGenerator",
"../ui/log/WorldLog": "WorldLog",
"./CityJobs": "CityJobs",
"./CityStorage": "CityStorage",
"./CityTaskList": "CityTaskList"
} ],
CloudController: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "3ffb1lyOYhGpqgOvuvTARbc", "CloudController");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
}), r = this && this.__decorate || function(t, e, i, o) {
var a, r = arguments.length, n = r < 3 ? e : null === o ? o = Object.getOwnPropertyDescriptor(e, i) : o;
if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) n = Reflect.decorate(t, e, i, o); else for (var s = t.length - 1; s >= 0; s--) (a = t[s]) && (n = (r < 3 ? a(n) : r > 3 ? a(e, i, n) : a(e, i)) || n);
return r > 3 && n && Object.defineProperty(e, i, n), n;
}, n = this && this.__values || function(t) {
var e = "function" == typeof Symbol && Symbol.iterator, i = e && t[e], o = 0;
if (i) return i.call(t);
if (t && "number" == typeof t.length) return {
next: function() {
t && o >= t.length && (t = void 0);
return {
value: t && t[o++],
done: !t
};
}
};
throw new TypeError(e ? "Object is not iterable." : "Symbol.iterator is not defined.");
};
Object.defineProperty(i, "__esModule", {
value: !0
});
i.CloudController = void 0;
var s = t("../../../common/src/data/AchievData"), l = t("../common/ToolBox"), c = t("../natural/Cloud"), u = t("./BaseEffectController"), d = cc._decorator, h = d.ccclass, p = (d.property, 
function(t) {
a(e, t);
function e() {
return null !== t && t.apply(this, arguments) || this;
}
e.prototype.onLoad = function() {
t.prototype.create.call(this);
this.timer_interval = 15;
};
e.prototype.getNext = function() {
var t, e, i = this.getObject();
i.created || i.create();
var o = 0;
try {
for (var a = n(this.list), r = a.next(); !r.done; r = a.next()) r.value.getComponent(c.default).type != c.CloudType.normal && o++;
} catch (e) {
t = {
error: e
};
} finally {
try {
r && !r.done && (e = a.return) && e.call(a);
} finally {
if (t) throw t.error;
}
}
s.default.update(41, o, !0);
return i;
};
e.prototype.spawnCloud = function(t, e) {
this.getNext().init(t, e);
};
e.prototype.spawn = function() {
this.getNext().init();
};
e.prototype.checkTile = function(t, e) {
var i, o;
try {
for (var a = n(this.list), r = a.next(); !r.done; r = a.next()) {
var s = r.value;
if (!(l.Toolbox.dist(s.x, s.y, t.pos.x, t.pos.y) > e)) {
s.getComponent(c.default).startToDie();
break;
}
}
} catch (t) {
i = {
error: t
};
} finally {
try {
r && !r.done && (o = a.return) && o.call(a);
} finally {
if (i) throw i.error;
}
}
};
return r([ h ], e);
}(u.default));
i.CloudController = p;
cc._RF.pop();
}, {
"../../../common/src/data/AchievData": void 0,
"../common/ToolBox": "ToolBox",
"../natural/Cloud": "Cloud",
"./BaseEffectController": "BaseEffectController"
} ],
Cloud: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "f226dylhHNKBovoy7uJ+4ie", "Cloud");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
}), r = this && this.__decorate || function(t, e, i, o) {
var a, r = arguments.length, n = r < 3 ? e : null === o ? o = Object.getOwnPropertyDescriptor(e, i) : o;
if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) n = Reflect.decorate(t, e, i, o); else for (var s = t.length - 1; s >= 0; s--) (a = t[s]) && (n = (r < 3 ? a(n) : r > 3 ? a(e, i, n) : a(e, i)) || n);
return r > 3 && n && Object.defineProperty(e, i, n), n;
};
Object.defineProperty(i, "__esModule", {
value: !0
});
i.CloudType = void 0;
var n, s = t("../../../../framework/lib/prototype/MathUtils"), l = t("../../../common/src/GameCommon"), c = t("../base/BaseEffect"), u = t("../common/ToolBox"), d = t("../Config"), h = t("../map/map/QualityChanger"), p = t("../MapBox"), f = t("../world/WorldTimer"), m = cc._decorator, y = m.ccclass, _ = m.property;
(function(t) {
t[t.normal = 0] = "normal";
t[t.rain = 1] = "rain";
t[t.lava = 2] = "lava";
t[t.acid = 3] = "acid";
t[t.snow = 4] = "snow";
})(n = i.CloudType || (i.CloudType = {}));
var g = function(t) {
a(e, t);
function e() {
var e = null !== t && t.apply(this, arguments) || this;
e.colorNormal = cc.color(255, 255, 255);
e.colorRain = cc.color(160, 160, 160);
e.colorLava = cc.color(238, 105, 0);
e.colorAcid = cc.color(60, 231, 65);
e.colorSnow = cc.color(60, 231, 65);
e.cloudSprites = [];
e.sprShadow = null;
e.offset = cc.v2(0, -20);
e.shadowColor = cc.color(38, 37, 65);
e.maxAlpha = 76.5;
e.speedMax = 6;
e.speed = 1;
e._type = n.normal;
e.timerFallingPixels = null;
e.dropID = "";
e.fadeMultiplier = 51;
return e;
}
Object.defineProperty(e.prototype, "type", {
get: function() {
return this._type;
},
enumerable: !1,
configurable: !0
});
e.prototype.init = function(e, i) {
void 0 === e && (e = null);
void 0 === i && (i = "normal");
this.timerFallingPixels || (this.timerFallingPixels = new f.default(.05, this.cloudAction.bind(this)));
e || (e = cc.v3(u.Toolbox.randomRange(-50, 30), u.Toolbox.randomRange(0, 240)));
t.prototype.prepare.call(this, e, .2);
this.node.scaleX *= u.Toolbox.randomBool() ? 1 : -1;
this.speed = u.Toolbox.randomFloat(1, this.speedMax);
this.loadTexture(this.cloudSprites.getRandom());
this.setType(i);
this.setAlpha(0);
};
e.prototype.loadTexture = function(t) {
this.sprRenderer || (this.sprRenderer = this.node.getChildByName("cloud").getComponent(cc.Sprite));
this.sprRenderer.spriteFrame = t;
this.sprShadow.spriteFrame = t;
};
e.prototype.cloudAction = function() {
if (!(this.type == n.normal || this.alpha < .1)) {
var t = .08 * this.sprRenderer.spriteFrame.getOriginalSize().width, e = .04 * this.sprRenderer.spriteFrame.getOriginalSize().height, i = s.default.intCast(this.node.x), o = s.default.intCast(this.node.y);
i += s.default.intCast(u.Toolbox.randomFloat(0 - t, t));
o += s.default.intCast(u.Toolbox.randomFloat(0 - e + this.offset.y, e + this.offset.y));
var a = p.default.inst.getTile(i, o);
if (a) {
p.default.inst.dropManager.spawn(a, this.dropID, 10);
if (this.type == n.rain && u.Toolbox.randomChance(.01)) {
i += s.default.intCast(u.Toolbox.randomFloat(.5 * t, t));
o += s.default.intCast(u.Toolbox.randomFloat(0 - e + this.offset.y, e + this.offset.y));
(a = p.default.inst.getTile(i, o)) && p.default.spawnLightning(a, .15);
}
}
}
};
e.prototype.setType = function(t) {
if ("cloudRain" == t) {
this._type = n.rain;
this.sprRenderer.node.color = this.colorRain;
this.maxAlpha = 204;
this.dropID = "rain";
} else if ("cloudAcid" == t) {
this._type = n.acid;
this.sprRenderer.node.color = this.colorAcid;
this.maxAlpha = 204;
this.dropID = "acid";
} else if ("cloudLava" == t) {
this._type = n.lava;
this.sprRenderer.node.color = this.colorLava;
this.maxAlpha = 204;
this.dropID = "lava";
} else if ("cloudSnow" == t) {
this._type = n.snow;
this.sprRenderer.node.color = this.colorSnow;
this.maxAlpha = 204;
this.dropID = "snow";
} else {
this._type = n.normal;
this.sprRenderer.node.color = this.colorNormal;
this.maxAlpha = 127.5;
this.dropID = null;
}
};
e.prototype.logicUpdate = function(t) {
d.default.timeScale > 10 ? this.fadeMultiplier = 12.75 : this.fadeMultiplier = 51;
if (!l.default.isPaused) {
this.node.x += this.speed * t;
this.timerFallingPixels.logicUpdate(t);
}
this.node.x > p.default.width && this.startToDie();
var e = this.maxAlpha;
e *= h.default.inst.changeMod;
switch (this.state) {
case 1:
if (this.alpha < e) {
this.alpha += t * this.fadeMultiplier;
this.alpha >= e && (this.alpha = e);
} else if (this.alpha > e) {
this.alpha -= t * this.fadeMultiplier;
this.alpha <= e && (this.alpha = e);
} else this.alpha = e;
this.setAlpha(this.alpha);
break;

case 2:
if (this.alpha > 0) this.alpha -= t * this.fadeMultiplier; else {
this.alpha = 0;
this.controller.killObject(this);
}
this.setAlpha(this.alpha);
}
};
r([ _(cc.Color) ], e.prototype, "colorNormal", void 0);
r([ _(cc.Color) ], e.prototype, "colorRain", void 0);
r([ _(cc.Color) ], e.prototype, "colorLava", void 0);
r([ _(cc.Color) ], e.prototype, "colorAcid", void 0);
r([ _(cc.Color) ], e.prototype, "colorSnow", void 0);
r([ _([ cc.SpriteFrame ]) ], e.prototype, "cloudSprites", void 0);
r([ _(cc.Sprite) ], e.prototype, "sprShadow", void 0);
r([ _(cc.Vec2) ], e.prototype, "offset", void 0);
r([ _(cc.Color) ], e.prototype, "shadowColor", void 0);
return r([ y ], e);
}(c.default);
i.default = g;
cc._RF.pop();
}, {
"../../../../framework/lib/prototype/MathUtils": void 0,
"../../../common/src/GameCommon": void 0,
"../Config": "Config",
"../MapBox": "MapBox",
"../base/BaseEffect": "BaseEffect",
"../common/ToolBox": "ToolBox",
"../map/map/QualityChanger": "QualityChanger",
"../world/WorldTimer": "WorldTimer"
} ],
CondGroupLeader: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "2d522Nyi9VMTJdrhI2BtWkk", "CondGroupLeader");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
});
Object.defineProperty(i, "__esModule", {
value: !0
});
var r = function(t) {
a(e, t);
function e() {
return null !== t && t.apply(this, arguments) || this;
}
e.prototype.check = function(t) {
var e;
return !!t.kingdom.isCiv() && (null === (e = t.unitGroup) || void 0 === e ? void 0 : e.groupLeader) == t;
};
return e;
}(t("../../base/BaseCondition").BehaviourActorCondition);
i.default = r;
cc._RF.pop();
}, {
"../../base/BaseCondition": "BaseCondition"
} ],
CondHaveAttackTarget: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "649d5OonhBKApCuuSo53LmD", "CondHaveAttackTarget");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
});
Object.defineProperty(i, "__esModule", {
value: !0
});
var r = function(t) {
a(e, t);
function e() {
return null !== t && t.apply(this, arguments) || this;
}
e.prototype.check = function(t) {
var e;
return !!t.kingdom.isCiv() && (null === (e = t.unitGroup) || void 0 === e ? void 0 : e.groupLeader) == t && !!t.city && !!t.city.attackZone;
};
return e;
}(t("../../base/BaseCondition").BehaviourActorCondition);
i.default = r;
cc._RF.pop();
}, {
"../../base/BaseCondition": "BaseCondition"
} ],
CondHaveUnitGroup: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "46b3cZ67NFKla/MlTx/JNnh", "CondHaveUnitGroup");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
});
Object.defineProperty(i, "__esModule", {
value: !0
});
var r = function(t) {
a(e, t);
function e() {
return null !== t && t.apply(this, arguments) || this;
}
e.prototype.check = function(t) {
var e;
if (!(null === (e = t.unitGroup) || void 0 === e ? void 0 : e.isAlive())) {
t.unitGroup = null;
return !1;
}
return !0;
};
return e;
}(t("../../base/BaseCondition").BehaviourActorCondition);
i.default = r;
cc._RF.pop();
}, {
"../../base/BaseCondition": "BaseCondition"
} ],
CondNoAttackTarget: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "9d7c4rXYT9Gx7A9YPARqsg0", "CondNoAttackTarget");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
});
Object.defineProperty(i, "__esModule", {
value: !0
});
var r = function(t) {
a(e, t);
function e() {
return null !== t && t.apply(this, arguments) || this;
}
e.prototype.check = function(t) {
var e;
return !!t.kingdom.isCiv() && (null === (e = t.unitGroup) || void 0 === e ? void 0 : e.groupLeader) == t && !!t.city && !t.city.attackZone;
};
return e;
}(t("../../base/BaseCondition").BehaviourActorCondition);
i.default = r;
cc._RF.pop();
}, {
"../../base/BaseCondition": "BaseCondition"
} ],
CondNoUnitGroup: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "94de3eSk3xJppzuPNWsokhW", "CondNoUnitGroup");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
});
Object.defineProperty(i, "__esModule", {
value: !0
});
var r = function(t) {
a(e, t);
function e() {
return null !== t && t.apply(this, arguments) || this;
}
e.prototype.check = function(t) {
var e;
if (!(null === (e = t.unitGroup) || void 0 === e ? void 0 : e.isAlive())) {
t.unitGroup = null;
return !0;
}
return !1;
};
return e;
}(t("../../base/BaseCondition").BehaviourActorCondition);
i.default = r;
cc._RF.pop();
}, {
"../../base/BaseCondition": "BaseCondition"
} ],
CondNotGroupLeader: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "5b794Z6srVMWqwUCFvfzeX/", "CondNotGroupLeader");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
});
Object.defineProperty(i, "__esModule", {
value: !0
});
var r = function(t) {
a(e, t);
function e() {
return null !== t && t.apply(this, arguments) || this;
}
e.prototype.check = function(t) {
var e;
return !!t.kingdom.isCiv() && (null === (e = t.unitGroup) || void 0 === e ? void 0 : e.groupLeader) != t;
};
return e;
}(t("../../base/BaseCondition").BehaviourActorCondition);
i.default = r;
cc._RF.pop();
}, {
"../../base/BaseCondition": "BaseCondition"
} ],
Config: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "130d8S7Ni9NrJzwjgJEDArE", "Config");
Object.defineProperty(i, "__esModule", {
value: !0
});
i.PerformanceConfig = void 0;
var o = t("./common/MoveCamera"), a = function() {
function t() {}
t.gv = "worldbox";
t.controllableUnit = null;
t.newRender = !0;
t.WORLD_SAVE_VERSION = 8;
t.customMapSize = "standard";
t.customZoneX = 0;
t.customZoneY = 0;
t.customPerlinScale = 10;
t.customRandomShapes = 10;
t.customWaterLevel = 10;
t.ZONE_AMOUNT_X = 4;
t.ZONE_AMOUNT_Y = 4;
t.customMapSizeDefault = "standard";
t.ZONE_AMOUNT_X_DEFAULT = 3;
t.ZONE_AMOUNT_Y_DEFAULT = 4;
t.timeScale = 1;
t.fastCities = !1;
t.actorFastMode = 1;
t.LOAD_TIME_CREATE = 0;
t.LOAD_TIME_GENERATE = 0;
t.gameLoaded = !1;
t.greyGooDamaged = !1;
t.fireDamage = 0;
t.currentSlot = 0;
t.currentBrush = "circ_5";
t.selectedCity = null;
t.selectedKingdom = null;
t.selectedUnit = null;
t.selectedProp = 0;
t.selectedPowerid = "";
t.propUseCount = 0;
t.showCityInfo = !1;
t.showCityZones = !1;
t.showkingsAndLeadersInfo = !1;
t.showmarks_boatsInfo = !1;
t.showHistoryLog = !1;
t.maxFreeSaveSlotId = 1;
t.spectatorMode = function() {
return null != o.MoveCamera.focusUnit;
};
t.controllingUnit = function() {
return null != t.controllableUnit;
};
t.maxSlotCount = 6;
t.quickSaveSlotId = 0;
return t;
}();
i.default = a;
var r = function() {
function t() {}
t.intervalOfAutoSave = 900;
t.intervalOfSortActors = .3;
t.maxBuildings = 500;
t.maxCreatures = 150;
return t;
}();
i.PerformanceConfig = r;
cc._RF.pop();
}, {
"./common/MoveCamera": "MoveCamera"
} ],
ConstructionLayerDebug: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "58dc3YAsktA5p4maTwUs8MK", "ConstructionLayerDebug");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
});
Object.defineProperty(i, "__esModule", {
value: !0
});
i.ConstructionData = i.ConstructionCost = i.ConstructionTileData = i.ConstructionPlacement = i.WorldConstructionState = void 0;
var r = t("../../map/map/MapLayer"), n = t("../../MapBox");
(function(t) {
t[t.None = 0] = "None";
t[t.UnderConstruction = 1] = "UnderConstruction";
t[t.Built = 2] = "Built";
t[t.Destroyed = 3] = "Destroyed";
})(i.WorldConstructionState || (i.WorldConstructionState = {}));
(function(t) {
t[t.OnlyGround = 0] = "OnlyGround";
t[t.OnlyWater = 1] = "OnlyWater";
t[t.Everywhere = 2] = "Everywhere";
})(i.ConstructionPlacement || (i.ConstructionPlacement = {}));
i.ConstructionTileData = function() {
this.x = 0;
this.y = 0;
this.color = "";
};
i.ConstructionCost = function(t, e, i, o) {
void 0 === t && (t = 0);
void 0 === e && (e = 0);
void 0 === i && (i = 0);
void 0 === o && (o = 0);
this.wood = 0;
this.stone = 0;
this.metals = 0;
this.gold = 0;
this.wood = t;
this.stone = e;
this.metals = i;
this.gold = o;
};
i.ConstructionData = function() {
this.cornerX = 0;
this.cornerY = 0;
this.mainX = 0;
this.mainY = 0;
this.templateID = "";
this.cityID = "";
this.underConstruction = !1;
this.tileData = [];
this.objectID = "";
this.health = 1;
};
var s = function(t) {
a(e, t);
function e() {
return null !== t && t.apply(this, arguments) || this;
}
e.prototype.create = function() {
t.prototype.create.call(this);
n.default.inst.mapLayers.push(this);
};
e.prototype.clear = function() {
this.createTextureNew();
};
e.prototype.updateDirty = function() {
var t = this;
if (e.dirty) {
e.dirty = !1;
this.created || this.create();
this.getTextureData() || this.createTextureNew();
n.default.inst.tilesList.forEach(function(e) {
e.building ? t.updateSinglePixel(e.data.tile_id, cc.Color.RED) : t.updateSinglePixel(e.data.tile_id, cc.Color.TRANSPARENT);
});
this.updatePixels();
}
};
e.dirty = !1;
return e;
}(r.default);
i.default = s;
cc._RF.pop();
}, {
"../../MapBox": "MapBox",
"../../map/map/MapLayer": "MapLayer"
} ],
ConwayLife: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "b571dfyLE9FF5M5ev1TgzMG", "ConwayLife");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
}), r = this && this.__decorate || function(t, e, i, o) {
var a, r = arguments.length, n = r < 3 ? e : null === o ? o = Object.getOwnPropertyDescriptor(e, i) : o;
if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) n = Reflect.decorate(t, e, i, o); else for (var s = t.length - 1; s >= 0; s--) (a = t[s]) && (n = (r < 3 ? a(n) : r > 3 ? a(e, i, n) : a(e, i)) || n);
return r > 3 && n && Object.defineProperty(e, i, n), n;
}, n = this && this.__values || function(t) {
var e = "function" == typeof Symbol && Symbol.iterator, i = e && t[e], o = 0;
if (i) return i.call(t);
if (t && "number" == typeof t.length) return {
next: function() {
t && o >= t.length && (t = void 0);
return {
value: t && t[o++],
done: !t
};
}
};
throw new TypeError(e ? "Object is not iterable." : "Symbol.iterator is not defined.");
};
Object.defineProperty(i, "__esModule", {
value: !0
});
i.ConwayType = void 0;
var s, l = t("../../../../common/src/GameCommon"), c = t("../../assetLibrary/AssetManager"), u = t("../../common/ToolBox"), d = t("../../Config"), h = t("../../MapBox"), p = t("../map/MapLayer"), f = t("../tile/TileDictionary");
(function(t) {
t[t.Eater = 0] = "Eater";
t[t.Creator = 1] = "Creator";
t[t.None = 2] = "None";
})(s = i.ConwayType || (i.ConwayType = {}));
var m = cc._decorator, y = m.ccclass, _ = m.property, g = function(t) {
a(e, t);
function e() {
var e = null !== t && t.apply(this, arguments) || this;
e.makeFlash = !0;
e.newList = new f.TileDictionary();
e.nextTickTimer = 0;
e.nextTickInterval = .05;
e.decreaseTick = 0;
e.toRemove = [];
return e;
}
i = e;
e.prototype.onLoad = function() {
i.colorCreator = u.Toolbox.makeColor("#3BCC55");
this.tileDictionary = new f.TileDictionary();
t.prototype.create.call(this);
};
e.prototype.logicUpdate = function(e) {
t.prototype.logicUpdate.call(this, e);
};
e.prototype.updateDirty = function(t) {
this.updateVisual();
if (!l.default.isPaused) if (this.nextTickTimer > 0) this.nextTickTimer -= t; else {
this.nextTickTimer = this.nextTickInterval;
for (var e = 0; e < d.default.timeScale; e++) this.updateTick();
}
};
e.prototype.updateVisual = function() {
var t = this;
if (0 != this.pixels_to_update.length()) {
this.pixels_to_update.dict.forEach(function(e, o) {
if (t.tileDictionary.contains(o)) o.data.conwayType == s.Eater ? t.updateSinglePixel(o.data.tile_id, i.colorEater) : o.data.conwayType == s.Creator ? t.updateSinglePixel(o.data.tile_id, i.colorCreator) : t.updateSinglePixel(o.data.tile_id, u.Toolbox.clear); else {
o.data.conwayType = s.None;
t.updateSinglePixel(o.data.tile_id, u.Toolbox.clear);
}
});
this.pixels_to_update.clear();
this.updatePixels();
}
};
e.prototype.remove = function(t) {
this.tileDictionary.remove(t);
this.pixels_to_update.add(t);
t.data.conwayType = s.None;
};
e.prototype.add = function(t, e) {
t.data.conwayType = "conway" == e ? s.Eater : s.Creator;
this.tileDictionary.add(t);
this.pixels_to_update.add(t);
};
e.prototype.updateTick = function() {
var t = this;
this.decreaseTick-- <= 0 && (this.decreaseTick = 5);
if (!(this.tileDictionary.length() <= 0 && this.newList.length() <= 0)) {
this.newList.clear();
this.tileDictionary.dict.forEach(function(e, i) {
t.checkCell(i);
i.neighboursAll.forEach(function(e) {
t.checkCell(e);
});
});
var e = this.tileDictionary;
this.tileDictionary = this.newList;
this.newList = e;
this.updateVisual();
}
};
e.prototype.makeAlive = function(t) {
5 == this.decreaseTick && (t.data.conwayType == s.Eater ? t.type.decreaseTo && h.default.inst.terraformTile2(t, t.type.decreaseTo, c.default.terraform.get("destroy_no_flash")) : t.type.increaseTo && h.default.inst.terraformTile2(t, t.type.increaseTo, c.default.terraform.get("destroy_no_flash")));
this.newList.add(t);
this.makeFlash && this.makeFlashh(t, 25);
};
e.prototype.makeFlashh = function(t) {
t.data.conwayType, s.None;
};
e.prototype.clear = function() {
t.prototype.clear.call(this);
this.newList.clear();
this.tileDictionary.clear();
};
e.prototype.checkCell = function(t) {
var e, i, o = this;
if (!this.pixels_to_update.contains(t)) {
var a = 0, r = 0, l = 0;
this.pixels_to_update.add(t);
t.data.conwayType == s.Eater && r++;
t.data.conwayType == s.Creator && l++;
if (this.tileDictionary.contains(t)) {
try {
for (var c = n(t.neighboursAll), u = c.next(); !u.done; u = c.next()) {
var d = u.value;
if (this.tileDictionary.contains(d)) {
a++;
d.data.conwayType == s.Creator ? l++ : d.data.conwayType == s.Eater && r++;
}
if (a >= 4) {
this.makeFlash && this.makeFlashh(t, 15);
t.data.conwayType = s.None;
return;
}
}
} catch (t) {
e = {
error: t
};
} finally {
try {
u && !u.done && (i = c.return) && i.call(c);
} finally {
if (e) throw e.error;
}
}
if (2 == a || 3 == a) {
t.data.conwayType != s.None || 0 == r && 0 == l || (t.data.conwayType = r >= l ? s.Eater : s.Creator);
this.makeAlive(t);
} else t.data.conwayType = s.None;
} else {
t.neighboursAll.forEach(function(t) {
o.tileDictionary.contains(t) && a++;
t.data.conwayType == s.Eater && r++;
t.data.conwayType == s.Creator && l++;
});
if (3 == a) {
t.data.conwayType != s.None || 0 == r && 0 == l || (t.data.conwayType = r >= l ? s.Eater : s.Creator);
this.makeAlive(t);
}
}
}
};
e.prototype.checkKillRange = function(t, e) {
var i = this;
if (0 != this.tileDictionary.dict.size) {
this.toRemove.clear();
this.tileDictionary.dict.forEach(function(o, a) {
if (u.Toolbox.distVec2(a.pos, t) <= e) {
a.data.conwayType = s.None;
i.toRemove.push(a);
}
});
this.toRemove.forEach(function(t) {
i.remove(t);
});
}
};
var i;
e.colorEater = cc.color(255, 51, 255);
e.colorCreator = cc.Color.TRANSPARENT;
r([ _ ], e.prototype, "makeFlash", void 0);
return i = r([ y ], e);
}(p.default);
i.default = g;
cc._RF.pop();
}, {
"../../../../common/src/GameCommon": void 0,
"../../Config": "Config",
"../../MapBox": "MapBox",
"../../assetLibrary/AssetManager": "AssetManager",
"../../common/ToolBox": "ToolBox",
"../map/MapLayer": "MapLayer",
"../tile/TileDictionary": "TileDictionary"
} ],
CreatureInfo: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "8bdf3CKYYxKoJ9U9FcL8i/s", "CreatureInfo");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
}), r = this && this.__decorate || function(t, e, i, o) {
var a, r = arguments.length, n = r < 3 ? e : null === o ? o = Object.getOwnPropertyDescriptor(e, i) : o;
if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) n = Reflect.decorate(t, e, i, o); else for (var s = t.length - 1; s >= 0; s--) (a = t[s]) && (n = (r < 3 ? a(n) : r > 3 ? a(e, i, n) : a(e, i)) || n);
return r > 3 && n && Object.defineProperty(e, i, n), n;
}, n = this && this.__values || function(t) {
var e = "function" == typeof Symbol && Symbol.iterator, i = e && t[e], o = 0;
if (i) return i.call(t);
if (t && "number" == typeof t.length) return {
next: function() {
t && o >= t.length && (t = void 0);
return {
value: t && t[o++],
done: !t
};
}
};
throw new TypeError(e ? "Object is not iterable." : "Symbol.iterator is not defined.");
};
Object.defineProperty(i, "__esModule", {
value: !0
});
var s = t("../../../../../framework/lib/prototype/MathUtils"), l = t("../../../../common/src/GamePopBase"), c = t("../../../../common/src/text/LocalizedTextManager"), u = t("../../actors/other/boat/Boat"), d = t("../../animation/UnitAvatarLoader"), h = t("../../assetLibrary/AssetManager"), p = t("../../common/MoveCamera"), f = t("../../common/ToolBox"), m = t("../../common/ViewController"), y = t("../../Config"), _ = t("../../texture/TextureLoader"), g = t("../tip/ToolTip"), v = t("../tip/WorldTip"), b = cc._decorator, T = b.ccclass, w = b.property, B = function(t) {
a(e, t);
function e() {
var e = null !== t && t.apply(this, arguments) || this;
e.txtName = null;
e.favoriteFoodBg = null;
e.favoriteFoodSpr = null;
e.moodBG = null;
e.traitsParent = null;
e.equipmentParent = null;
e.health = null;
e.hunger = null;
e.damage = null;
e.armor = null;
e.speed = null;
e.crit = null;
e.attackSpeed = null;
e.diplomacy = null;
e.warfare = null;
e.stewardship = null;
e.avatarLoader = null;
e.iconFavorite = null;
e.buttonKingdom = null;
e.buttonCity = null;
e.text_description = null;
e.text_values = null;
e.temp_equipment = [];
return e;
}
e.prototype.start = function() {
this.showUser();
cc.tween(this.favoriteFoodBg).by(1.3, {
angle: 90
}).repeatForever().start();
};
e.prototype.close = function() {
v.default.inst.hide();
t.prototype.close.call(this);
};
e.prototype.showUser = function() {
var t, e, i, o, a, r, n, l, d, p, f, m, _;
if ((null === (e = null === (t = y.default.selectedUnit) || void 0 === t ? void 0 : t.data) || void 0 === e ? void 0 : e.alive) && (null === (i = y.default.selectedUnit) || void 0 === i ? void 0 : i.stats)) {
var g = y.default.selectedUnit;
this.txtName.string = g.data.firstName;
this.health.progress = g.data.health / g.curStats.health;
this.health.node.getChildByName("label").getComponent(cc.Label).string = g.data.health + "/" + g.curStats.health;
if (g.stats.needFood || g.stats.unit) {
this.hunger.node.parent.active = !0;
var v = s.default.intCast(g.data.hunger / g.stats.maxHunger * 100);
this.hunger.progress = v / 100;
this.hunger.node.getChildByName("label").getComponent(cc.Label).string = v + "%";
} else this.hunger.node.parent.active = !1;
this.damage.active = !0;
this.armor.active = !0;
this.speed.active = !0;
this.attackSpeed.active = !0;
this.crit.active = !0;
this.diplomacy.active = !0;
this.warfare.active = !0;
this.stewardship.active = !0;
if (!g.stats.unit) {
this.diplomacy.active = !1;
this.warfare.active = !1;
this.stewardship.active = !1;
}
if (!g.stats.inspect_stats) {
this.damage.active = !1;
this.armor.active = !1;
this.speed.active = !1;
this.diplomacy.active = !1;
this.attackSpeed.active = !1;
this.crit.active = !1;
}
this.damage.getChildByName("richText").getComponent(cc.RichText).string = "" + g.curStats.damage;
this.armor.getChildByName("richText").getComponent(cc.RichText).string = Math.floor(100 * g.curStats.armor) / 100 + "%";
this.speed.getChildByName("richText").getComponent(cc.RichText).string = "" + g.curStats.speed;
this.crit.getChildByName("richText").getComponent(cc.RichText).string = Math.floor(100 * g.curStats.crit) / 100 + "%";
this.attackSpeed.getChildByName("richText").getComponent(cc.RichText).string = "" + g.curStats.attackSpeed;
this.showAttribute(this.diplomacy.getChildByName("richText").getComponent(cc.RichText), g.curStats.diplomacy);
this.showAttribute(this.stewardship.getChildByName("richText").getComponent(cc.RichText), g.curStats.stewardship);
this.showAttribute(this.warfare.getChildByName("richText").getComponent(cc.RichText), g.curStats.warfare);
this.avatarLoader.load(g);
this.iconFavorite.parent.active = !g.stats.hideFavoriteIcon;
this.text_description.string = "";
this.text_values.string = "";
this.showStat("creature_statistics_age", "" + y.default.selectedUnit.data.age);
g.stats.inspect_kills && this.showStat("creature_statistics_kills", "" + y.default.selectedUnit.data.kills);
g.stats.inspect_experience && this.showStat("creature_statistics_character_experience", y.default.selectedUnit.data.experience + "/" + y.default.selectedUnit.getExpToLevelup());
g.stats.inspect_experience && this.showStat("creature_statistics_character_level", "" + y.default.selectedUnit.data.level);
g.stats.inspect_children && this.showStat("creature_statistics_children", "" + y.default.selectedUnit.data.children);
this.moodBG.active = !1;
this.favoriteFoodBg.active = !1;
this.favoriteFoodSpr.node.active = !1;
if (g.stats.unit && !g.stats.baby) {
var b = "??";
if (y.default.selectedUnit.data.favoriteFood) {
b = c.LocalizedTextManager.getText(y.default.selectedUnit.data.favoriteFood);
this.favoriteFoodBg.active = !0;
this.favoriteFoodSpr.node.active = !0;
this.favoriteFoodSpr.spriteFrame = h.default.resources.get(y.default.selectedUnit.data.favoriteFood).getSprite();
}
this.showStat("creature_statistics_favorite_food", b);
}
if (g.stats.unit) {
this.moodBG.active = !0;
this.showStat("creature_statistics_mood", c.LocalizedTextManager.getText("mood_" + g.data.mood));
var T = h.default.moods.get(g.data.mood);
this.moodBG.getChildByName("icon").getComponent(cc.Sprite).spriteFrame = T.getSprite();
g.s_personality && this.showStat("creature_statistics_personality", c.LocalizedTextManager.getText("personality_" + g.s_personality.id));
}
this.text_description.string += "\n";
this.text_values.string += "\n";
g.stats.inspect_home && this.showStat("creature_statistics_homeVillage", (null === (a = null === (o = y.default.selectedUnit.city) || void 0 === o ? void 0 : o.data) || void 0 === a ? void 0 : a.cityName) || "??", null === (n = null === (r = y.default.selectedUnit.kingdom) || void 0 === r ? void 0 : r.kingdomColor) || void 0 === n ? void 0 : n.colorBorderOut);
(null === (l = y.default.selectedUnit.kingdom) || void 0 === l ? void 0 : l.isCiv()) && this.showStat("kingdom", (null === (p = null === (d = y.default.selectedUnit.kingdom) || void 0 === d ? void 0 : d.data) || void 0 === p ? void 0 : p.name) || "??", null === (m = null === (f = y.default.selectedUnit.kingdom) || void 0 === f ? void 0 : f.kingdomColor) || void 0 === m ? void 0 : m.colorBorderOut);
if (y.default.selectedUnit.stats.isBoat) {
var w = y.default.selectedUnit.getComponent(u.default);
this.showStat("passengers", "" + w.unitsInside.size);
w.isState(u.BoatState.TransportDoLoading) && this.showStat("status", c.LocalizedTextManager.getText("status_waiting_for_passengers"));
}
g.city ? this.buttonCity.active = !0 : this.buttonCity.active = !1;
(null === (_ = g.kingdom) || void 0 === _ ? void 0 : _.isCiv()) ? this.buttonKingdom.active = !0 : this.buttonKingdom.active = !1;
this.updateFavoriteIconFor(g);
this.clearPrevButtons();
this.loadTraits();
this.loadEquipment();
}
};
e.prototype.showAttribute = function(t, e) {
var i = "" + e;
e < 4 ? i = f.Toolbox.coloredText(i, f.Toolbox.color_negative) : e >= 20 && (i = f.Toolbox.coloredText(i, f.Toolbox.color_positive));
t.string = i;
};
e.prototype.showStat = function(t, e, i) {
void 0 === i && (i = null);
var o = this.text_description;
o.string = o.string + c.LocalizedTextManager.getText(t) + "\n";
var a = this.text_values;
a.string = i ? a.string + f.Toolbox.coloredString(e, i.toHEX()) + "\n" : a.string + e + "\n";
};
e.prototype.clearPrevButtons = function() {
this.traitsParent.destroyAllChildren();
this.equipmentParent.destroyAllChildren();
};
e.prototype.loadTraits = function() {
var t, e, i = y.default.selectedUnit, o = 0, a = i.data.traits.length;
if (i.data.traits) try {
for (var r = n(i.data.traits), s = r.next(); !s.done; s = r.next()) {
var l = s.value;
this.loadTraitButton(l, o, a);
o++;
}
} catch (e) {
t = {
error: e
};
} finally {
try {
s && !s.done && (e = r.return) && e.call(r);
} finally {
if (t) throw t.error;
}
}
};
e.prototype.loadEquipment = function() {
var t, e, i = y.default.selectedUnit;
this.temp_equipment.clear();
this.equipmentParent.parent.active = !1;
if (i.equipment) {
this.equipmentParent.parent.active = !0;
i.equipment.weapon.data && this.temp_equipment.push(i.equipment.weapon);
i.equipment.helmet.data && this.temp_equipment.push(i.equipment.helmet);
i.equipment.armor.data && this.temp_equipment.push(i.equipment.armor);
i.equipment.boots.data && this.temp_equipment.push(i.equipment.boots);
i.equipment.ring.data && this.temp_equipment.push(i.equipment.ring);
i.equipment.amulet.data && this.temp_equipment.push(i.equipment.amulet);
var o = 0, a = this.temp_equipment.length;
if (this.temp_equipment.length > 0) try {
for (var r = n(this.temp_equipment), s = r.next(); !s.done; s = r.next()) {
var l = s.value;
this.loadEquipmentButton(l, o, a);
o++;
}
} catch (e) {
t = {
error: e
};
} finally {
try {
s && !s.done && (e = r.return) && e.call(r);
} finally {
if (t) throw t.error;
}
}
}
};
e.prototype.loadEquipmentButton = function(t) {
var e = new cc.Node();
e.scale = 1.6;
e.parent = this.equipmentParent;
e.attr({
data: t
});
var i = "icons/items/icon_" + t.data.id;
"base" != t.data.material && (i = i + "_" + t.data.material);
e.addComponent(cc.Sprite).spriteFrame = _.TextureLoader.inst.getSpriteFrame(_.ATLAS_TYPE.UIATLAS, i);
e.addComponent(cc.Button);
e.on("click", this.clickEquipment, this);
};
e.prototype.loadTraitButton = function(t) {
var e = h.default.traits.get(t);
if (e) {
var i = new cc.Node();
i.scale = 1.6;
i.parent = this.traitsParent;
i.attr({
data: e
});
i.addComponent(cc.Sprite).spriteFrame = _.TextureLoader.inst.getSpriteFrame(_.ATLAS_TYPE.UIATLAS, "icons/" + e.icon);
i.addComponent(cc.Button);
i.on("click", this.clickTrait, this);
}
};
e.prototype.updateFavoriteIconFor = function(t) {
this.iconFavorite.opacity = t.data.favorite ? 255 : 127;
};
e.prototype.pressFavorite = function() {
if (y.default.selectedUnit) {
var t = y.default.selectedUnit;
t.data.favorite = !t.data.favorite;
this.updateFavoriteIconFor(t);
t.data.favorite && v.default.inst.show("tip_favorite_icon", !0, "top");
}
};
e.prototype.onDisable = function() {
y.default.selectedUnit && (y.default.selectedUnit = null);
t.prototype.onDisable.call(this);
};
e.prototype.clickAvatar = function() {
var t = null;
y.default.selectedUnit ? t = y.default.selectedUnit.race : y.default.selectedCity ? t = y.default.selectedCity.race : y.default.selectedKingdom && (t = y.default.selectedKingdom.race);
if (t) {
var e = f.Toolbox.randomInt(1, 3), i = "click_" + t.id + "_" + e;
c.LocalizedTextManager.contains(i) && v.default.inst.show(i, !0, "cursor");
}
};
e.prototype.clickKingdom = function(t) {
y.default.selectedKingdom = y.default.selectedUnit.kingdom;
m.default.open(m.view_type.KingdomWindow, null, t);
};
e.prototype.clickVillage = function(t) {
y.default.selectedCity = y.default.selectedUnit.city;
m.default.open(m.view_type.CityWindow, null, t);
};
e.prototype.clickFollow = function() {
this.close();
p.MoveCamera.inst.focusOnAndFollow(y.default.selectedUnit);
};
e.prototype.clickEquipment = function(t) {
var e = t.node.data;
g.default.info_equipment_slot = e;
g.default.inst.show(t.node, "equipment");
};
e.prototype.clickTrait = function(t) {
var e = t.node.data, i = "trait_" + e.id, o = "trait_" + e.id + "_info";
c.LocalizedTextManager.contains(o) || (o = "");
g.default.inst.show(t.node, "normal", i, o);
};
e.prototype.clickAttribute = function(t, e) {
var i = t.getCurrentTarget();
g.default.info_tip = i.name;
g.default.inst.show(i, "tip", i.name, e);
};
r([ w(cc.Label) ], e.prototype, "txtName", void 0);
r([ w(cc.Node) ], e.prototype, "favoriteFoodBg", void 0);
r([ w(cc.Sprite) ], e.prototype, "favoriteFoodSpr", void 0);
r([ w(cc.Node) ], e.prototype, "moodBG", void 0);
r([ w(cc.Node) ], e.prototype, "traitsParent", void 0);
r([ w(cc.Node) ], e.prototype, "equipmentParent", void 0);
r([ w(cc.ProgressBar) ], e.prototype, "health", void 0);
r([ w(cc.ProgressBar) ], e.prototype, "hunger", void 0);
r([ w(cc.Node) ], e.prototype, "damage", void 0);
r([ w(cc.Node) ], e.prototype, "armor", void 0);
r([ w(cc.Node) ], e.prototype, "speed", void 0);
r([ w(cc.Node) ], e.prototype, "crit", void 0);
r([ w(cc.Node) ], e.prototype, "attackSpeed", void 0);
r([ w(cc.Node) ], e.prototype, "diplomacy", void 0);
r([ w(cc.Node) ], e.prototype, "warfare", void 0);
r([ w(cc.Node) ], e.prototype, "stewardship", void 0);
r([ w(d.default) ], e.prototype, "avatarLoader", void 0);
r([ w(cc.Node) ], e.prototype, "iconFavorite", void 0);
r([ w(cc.Node) ], e.prototype, "buttonKingdom", void 0);
r([ w(cc.Node) ], e.prototype, "buttonCity", void 0);
r([ w(cc.RichText) ], e.prototype, "text_description", void 0);
r([ w(cc.RichText) ], e.prototype, "text_values", void 0);
return r([ T ], e);
}(l.GamePopBase);
i.default = B;
cc._RF.pop();
}, {
"../../../../../framework/lib/prototype/MathUtils": void 0,
"../../../../common/src/GamePopBase": void 0,
"../../../../common/src/text/LocalizedTextManager": void 0,
"../../Config": "Config",
"../../actors/other/boat/Boat": "Boat",
"../../animation/UnitAvatarLoader": "UnitAvatarLoader",
"../../assetLibrary/AssetManager": "AssetManager",
"../../common/MoveCamera": "MoveCamera",
"../../common/ToolBox": "ToolBox",
"../../common/ViewController": "ViewController",
"../../texture/TextureLoader": "TextureLoader",
"../tip/ToolTip": "ToolTip",
"../tip/WorldTip": "WorldTip"
} ],
CumulativeReward: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "5e0ceqekbxAFLSqqi4HNktT", "CumulativeReward");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
}), r = this && this.__decorate || function(t, e, i, o) {
var a, r = arguments.length, n = r < 3 ? e : null === o ? o = Object.getOwnPropertyDescriptor(e, i) : o;
if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) n = Reflect.decorate(t, e, i, o); else for (var s = t.length - 1; s >= 0; s--) (a = t[s]) && (n = (r < 3 ? a(n) : r > 3 ? a(e, i, n) : a(e, i)) || n);
return r > 3 && n && Object.defineProperty(e, i, n), n;
};
Object.defineProperty(i, "__esModule", {
value: !0
});
var n = t("../../../../../framework/main/Constants"), s = t("../../../../common/src/data/RewardData"), l = t("../../../../common/src/data/UserData"), c = t("../../common/ViewController"), u = t("./AwardView"), d = cc._decorator, h = d.ccclass, p = d.property, f = function(t) {
a(e, t);
function e() {
var e = null !== t && t.apply(this, arguments) || this;
e.progressBar = null;
e.num = null;
e.closeNode = null;
e.openNode = null;
return e;
}
e.prototype.onLoad = function() {
this.showProgress();
cc.director.on("updateVideoCount", this.updateCount, this);
};
e.prototype.onDestroy = function() {
cc.director.off("updateVideoCount");
};
e.prototype.updateCount = function() {
l.default.member.videoCount++;
l.default.member.videoCount > 5 && (l.default.member.videoCount = 5);
l.default.save();
this.showProgress();
};
e.prototype.showProgress = function() {
this.progressBar.progress = l.default.member.videoCount / 5;
this.num.string = l.default.member.videoCount + " / 5";
this.closeNode.active = l.default.member.videoCount < 5;
this.openNode.active = 5 == l.default.member.videoCount;
};
e.prototype.click = function(t) {
var e = this;
c.default.open(c.view_type.AwardView, null, t, !0, function(t) {
t.getComponent(u.default).init(u.Reward_type.cumulative, n.default.MODE == n.MODE_TYPE.LOCK ? s.default.getLockPropConfig(2) : 1);
l.default.member.videoCount = 0;
l.default.save();
e.updateCount();
});
};
r([ p(cc.ProgressBar) ], e.prototype, "progressBar", void 0);
r([ p(cc.Label) ], e.prototype, "num", void 0);
r([ p(cc.Node) ], e.prototype, "closeNode", void 0);
r([ p(cc.Node) ], e.prototype, "openNode", void 0);
return r([ h ], e);
}(cc.Component);
i.default = f;
cc._RF.pop();
}, {
"../../../../../framework/main/Constants": void 0,
"../../../../common/src/data/RewardData": void 0,
"../../../../common/src/data/UserData": void 0,
"../../common/ViewController": "ViewController",
"./AwardView": "AwardView"
} ],
DebugConfig: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "7bc1cdwtDhAQ6EAtVlNQQ42", "DebugConfig");
Object.defineProperty(i, "__esModule", {
value: !0
});
var o = function() {
function t() {}
t.Prop_infinite = !1;
t.UnCkeck_Address = !1;
t.UnitPathfinding = !0;
t.UseGlobalPathLock = !0;
t.CheckGoodForBoat = !1;
t.SystemSplitAstar = !0;
t.UseCacheForRegionPath = !0;
t.LastPath = !1;
return t;
}();
i.default = o;
cc._RF.pop();
}, {} ],
DiplomacyManager: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "92f9btRiHpO94pSHFsap7Gy", "DiplomacyManager");
Object.defineProperty(i, "__esModule", {
value: !0
});
var o = t("../../../common/src/data/AchievData"), a = t("../MapBox"), r = t("../ui/log/WorldLog"), n = t("./DiplomacyRelation"), s = function() {
function t(t) {
this.kingdoms = null;
this.relations_dict = new Map();
this.relations_civs = new Map();
this._tempKingdoms = [];
this.temp_arr = [];
this.diplomacyTick = 0;
this.kingdoms = t;
}
t.prototype.save = function() {
var t = this, e = [];
this.relations_civs.forEach(function(i) {
i.kingdom1 = t.kingdoms.getKingdomByID(i.data.kingdom1_id);
i.kingdom2 = t.kingdoms.getKingdomByID(i.data.kingdom2_id);
i.kingdom1 && i.kingdom2 && e.push(i.data);
});
return e;
};
t.prototype.load = function(t) {
var e = this;
t.forEach(function(t) {
var i = n.default.initWithData(t);
i.kingdom1 = e.kingdoms.getKingdomByID(t.kingdom1_id);
i.kingdom2 = e.kingdoms.getKingdomByID(t.kingdom2_id);
i.kingdom1 && i.kingdom2 && e.addToDicts(i);
});
};
t.prototype.addToDicts = function(t) {
this.relations_dict.has(t.data.id) || this.relations_dict.set(t.data.id, t);
t.kingdom1.isCiv() && t.kingdom2.isCiv() && !this.relations_civs.has(t.data.id) && this.relations_civs.set(t.data.id, t);
};
t.prototype.logicUpdate = function(t) {
if (this.diplomacyTick > 0) this.diplomacyTick -= t; else {
this.diplomacyTick = 2;
this.newDiplomacyTick();
}
};
t.prototype.updateAge = function() {
this.relations_civs.forEach(function(t) {
t.data.stateChanged++;
});
};
t.prototype.newDiplomacyTick = function() {
this.findSupremeKingdom();
};
t.prototype.findSupremeKingdom = function() {
t.kingdom_supreme = null;
if (0 != this.kingdoms.list_civs.length) {
this.kingdoms.list_civs.forEach(function(t) {
t.power = 2 * t.countArmy() + 5 * t.cities.length;
});
this.kingdoms.list_civs.sort(function(t, e) {
return t.power - e.power;
});
t.kingdom_supreme = this.kingdoms.list_civs[0];
this.kingdoms.list_civs.length > 1 ? t.kingdom_second = this.kingdoms.list_civs[1] : t.kingdom_second = null;
}
};
t.prototype.startWar = function(t, e, i) {
void 0 === i && (i = !1);
i || r.default.logNewWar(t, e);
this.kingdoms.setDiplomacyState(t, e, n.DiplomacyState.War);
var o = this.getRelation(t, e);
o.data.warSince = a.default.inst.mapStats.year;
o.data.stateChanged = 0;
};
t.prototype.startPeace = function(t, e, i) {
void 0 === i && (i = !1);
if (!i) {
r.default.logNewPeace(t, e);
a.default.inst.spawnPeaceFireworks(t);
a.default.inst.spawnPeaceFireworks(e);
}
this.kingdoms.setDiplomacyState(t, e, n.DiplomacyState.Ally);
var o = this.getRelation(t, e);
o.data.peaceSince = a.default.inst.mapStats.year;
o.data.stateChanged = 0;
};
t.prototype.eventSpite = function(t) {
var e = this;
if (0 != t.civs_allies.size) {
this._tempKingdoms = [];
t.civs_allies.forEach(function(t, i) {
e._tempKingdoms.push(i);
});
this.startWar(t, this._tempKingdoms.getRandom());
4 == this.kingdoms.length && o.default.update(38, 4, !0);
}
};
t.prototype.eventFriendship = function(t) {
var e = this;
if (0 != t.civs_enemies.size) {
this._tempKingdoms = [];
t.civs_enemies.forEach(function(t, i) {
e._tempKingdoms.push(i);
});
this.startPeace(t, this._tempKingdoms.getRandom());
}
};
t.prototype.getOpinion = function(t, e) {
return this.getRelation(t, e).getOpinion(t, e);
};
t.prototype.getRelation = function(t, e) {
var i = this;
this.temp_arr[0] = t;
this.temp_arr[1] = e;
this.temp_arr.sort(function(t, e) {
return i.stringCompare(t.data.id, e.data.id);
});
var o = this.temp_arr[0].data.id + "_" + this.temp_arr[1].data.id;
if (this.relations_dict.has(o)) return this.relations_dict.get(o);
var a = new n.default();
a.data.id = o;
a.data.kingdom1_id = this.temp_arr[0].data.id;
a.data.kingdom2_id = this.temp_arr[1].data.id;
a.kingdom1 = t;
a.kingdom2 = e;
this.addToDicts(a);
return a;
};
t.prototype.stringCompare = function(t, e) {
return t === e ? 0 : -1;
};
t.prototype.makeAllFriendlyTo = function(t) {
var e = this;
this.kingdoms.list_civs.forEach(function(i) {
i != t && t.isEnemy(i) && e.startPeace(t, i, !0);
});
};
t.prototype.allPeace = function() {
var t = this;
this.kingdoms.list_civs.forEach(function(e) {
t.makeAllFriendlyTo(e);
});
};
t.prototype.clear = function() {
this.relations_dict.clear();
this.relations_civs.clear();
};
t.prototype.removeRelations = function(t) {
var e = this;
this.relations_dict.forEach(function(i) {
if (i.kingdom1 == t || i.kingdom2 == t) {
e.relations_dict.delete(i.data.id);
e.relations_civs.delete(i.data.id);
}
});
};
t.kingdom_supreme = null;
t.kingdom_second = null;
return t;
}();
i.default = s;
cc._RF.pop();
}, {
"../../../common/src/data/AchievData": void 0,
"../MapBox": "MapBox",
"../ui/log/WorldLog": "WorldLog",
"./DiplomacyRelation": "DiplomacyRelation"
} ],
DiplomacyRelation: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "9c8a8EVVFBJ9rWizFqPzoCA", "DiplomacyRelation");
Object.defineProperty(i, "__esModule", {
value: !0
});
i.DiplomacyData = i.DiplomacyState = void 0;
var o, a = t("./KingdomOpinion");
(function(t) {
t[t.War = 0] = "War";
t[t.Ally = 1] = "Ally";
t[t.Clear = 2] = "Clear";
})(o = i.DiplomacyState || (i.DiplomacyState = {}));
var r = function() {
this.id = "";
this.kingdom1_id = "";
this.kingdom2_id = "";
this.stateChanged = 0;
this.peaceSince = 0;
this.warSince = 0;
this.state = o.Ally;
};
i.DiplomacyData = r;
var n = function() {
function t() {
this.data = new r();
this.kingdom1 = null;
this.kingdom2 = null;
this.opinion_k1 = null;
this.opinion_k2 = null;
}
t.initWithData = function(e) {
var i = new t();
i.data = e;
return i;
};
t.prototype.getOpinion = function(t, e) {
return this.opinion_k1.target == e ? this.opinion_k1 : this.opinion_k2;
};
t.prototype.recalculate = function() {
if (!this.opinion_k1) {
this.opinion_k1 = new a.default(this.kingdom1, this.kingdom2);
this.opinion_k2 = new a.default(this.kingdom2, this.kingdom1);
}
this.opinion_k1.calculate(this.kingdom1, this.kingdom2, this);
this.opinion_k2.calculate(this.kingdom2, this.kingdom1, this);
};
return t;
}();
i.default = n;
cc._RF.pop();
}, {
"./KingdomOpinion": "KingdomOpinion"
} ],
DisasterLibrary: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "a0c48UcjX5HsaXSnoUNlArP", "DisasterLibrary");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
});
Object.defineProperty(i, "__esModule", {
value: !0
});
i.DisasterAsset = i.DisasterType = void 0;
var r, n = t("../../common/ToolBox"), s = t("../../game/audio/GameAudio"), l = t("../../MapBox"), c = t("../../natural/Earthquake"), u = t("../../ui/log/WorldLog"), d = t("../AssetLibrary"), h = t("../AssetManager");
(function(t) {
t[t.Nature = 0] = "Nature";
t[t.Other = 1] = "Other";
})(r = i.DisasterType || (i.DisasterType = {}));
var p = function(t) {
a(e, t);
function e() {
var e = null !== t && t.apply(this, arguments) || this;
e.action = null;
e.rate = 1;
e.chance = 1;
e.world_log = "";
e.world_log_icon = "";
e.min_world_population = 0;
e.premium_only = !1;
e.type = r.Other;
return e;
}
return e;
}(d.Asset);
i.DisasterAsset = p;
var f = function(t) {
a(e, t);
function e() {
var e = null !== t && t.apply(this, arguments) || this;
e._random_pool = [];
return e;
}
e.prototype.init = function() {
t.prototype.init.call(this);
var e = new p();
e.id = "rain_cloud";
e.rate = 40;
e.chance = .5;
e.world_log = "";
e.type = r.Nature;
this.add(e);
this.t.action = this.spawnRainCloud;
var i = new p();
i.id = "tornado";
i.rate = 5;
i.chance = .5;
i.world_log = "worldlog_disaster_tornado";
i.world_log_icon = "iconTornado";
i.min_world_population = 100;
i.type = r.Nature;
this.add(i);
this.t.action = this.spawnTornado;
var o = new p();
o.id = "small_meteorite";
o.rate = 5;
o.chance = .5;
o.world_log = "worldlog_disaster_meteorite";
o.world_log_icon = "iconMeteorite";
o.min_world_population = 400;
o.premium_only = !0;
o.type = r.Nature;
this.add(o);
this.t.action = this.spawnMeteorite;
var a = new p();
a.id = "small_earthquake";
a.rate = 3;
a.chance = .4;
a.world_log = "worldlog_disaster_earthquake";
a.world_log_icon = "iconEarthquake";
a.min_world_population = 400;
a.type = r.Nature;
this.add(a);
this.t.action = this.spawnSmallEarthquake;
var n = new p();
n.id = "hellspawn";
n.rate = 2;
n.chance = .9;
n.world_log = "worldlog_disaster_hellspawn";
n.world_log_icon = "iconDemon";
n.min_world_population = 300;
n.premium_only = !0;
this.add(n);
this.t.action = this.spawnHellSpawn;
var s = new p();
s.id = "wild_mage";
s.rate = 1;
s.chance = .8;
s.world_log = "worldlog_disaster_evil_mage";
s.world_log_icon = "iconEvilMage";
s.min_world_population = 400;
s.premium_only = !0;
this.add(s);
this.t.action = this.spawnEvilMage;
var l = new p();
l.id = "underground_necromancer";
l.rate = 2;
l.chance = .9;
l.world_log = "worldlog_disaster_underground_necromancer";
l.world_log_icon = "iconNecromancer";
l.min_world_population = 200;
l.premium_only = !0;
this.add(l);
this.t.action = this.spawnNecromancer;
var c = new p();
c.id = "mad_thoughts";
c.rate = 2;
c.chance = .7;
c.world_log = "worldlog_disaster_mad_thoughts";
c.world_log_icon = "iconMadness";
c.min_world_population = 150;
this.add(c);
this.t.action = this.spawnMadThought;
var u = new p();
u.id = "greg_abominations";
u.rate = 1;
u.chance = .5;
u.world_log = "worldlog_disaster_greg_abominations";
u.world_log_icon = "iconGreg";
u.min_world_population = 2e3;
this.add(u);
this.t.action = this.spawnGreg;
};
e.prototype.getRandomAssetFromPool = function() {
var t = this;
if (null == this._random_pool || 0 == this._random_pool.length) {
this._random_pool = [];
this.list.forEach(function(e) {
for (var i = 0; i < e.rate; i++) t._random_pool.push(e);
});
}
var e = this._random_pool.getRandom();
if (e.type == r.Nature) {
if (!l.default.inst.worldLaws.world_law_disasters_nature.boolVal) return null;
} else if (e.type == r.Other && !l.default.inst.worldLaws.world_law_disasters_other.boolVal) return null;
return e.min_world_population <= l.default.inst.getCivWorldPopulation() ? e : null;
};
e.prototype.spawnMadThought = function(t) {
var e = l.default.inst.citiesList.getRandom();
if (e && !(e.getPopulationUnits() < 50) && e.getTile()) {
var i = [], o = e.units.getSimpleList();
o.shuffle();
o.forEach(function(t) {
n.Toolbox.randomChance(.2) && i.push(t);
});
i.forEach(function(t) {
t.addTrait("madness");
});
u.default.logDisaster(t, e.getTile(), null, e);
}
};
e.prototype.spawnGreg = function(t) {
if (!(h.default.raceLibrary.get("greg").units.length >= 1)) {
var e = l.default.inst.citiesList.getRandom(), i = e.getBuildingType("mine");
if (i) {
var o = i.currentTile, a = l.default.inst.createNewUnit("greg", o, "");
u.default.logDisaster(t, o, a.data.firstName, e, a);
for (var r = n.Toolbox.randomInt(5, 25), s = 0; s < r; s++) l.default.inst.createNewUnit("greg", o.region.tiles.getRandom(), "");
}
}
};
e.prototype.spawnNecromancer = function(t) {
if (!(h.default.raceLibrary.get("necromancer").units.length >= 1)) {
var e = l.default.inst.citiesList.getRandom(), i = e.getBuildingType("mine");
if (i) {
var o = i.currentTile, a = l.default.inst.createNewUnit("necromancer", o, "");
u.default.logDisaster(t, o, a.data.firstName, e, a);
for (var r = n.Toolbox.randomInt(5, 25), s = 0; s < r; s++) l.default.inst.createNewUnit("skeleton", o.region.tiles.getRandom(), "");
}
}
};
e.prototype.spawnEvilMage = function(t) {
if (h.default.raceLibrary.get("evilMage").units.length < 1) {
var e = l.default.inst.islandsCalculator.getRandomIslandGround();
if (e) {
var i = e.getRandomTile(), o = l.default.inst.createNewUnit("evilMage", i, "");
u.default.logDisaster(t, i, o.data.firstName, null, o);
}
}
};
e.prototype.spawnSmallEarthquake = function(t) {
var e = l.default.inst.tilesList.getRandom();
l.default.inst.earthquakeManager.startQuake(e, c.EarthquakeType.SmallDisaster);
u.default.logDisaster(t, e);
};
e.prototype.spawnHellSpawn = function(t) {
if (!(h.default.raceLibrary.get("demon").units.length > 20)) {
var e = l.default.inst.islandsCalculator.getRandomIslandGround();
if (e) {
var i = e.getRandomTile(), o = h.default.powers.get("demons");
o.showSpawnEffect && l.default.inst.stackEffects.startSpawnEffect(i, o.showSpawnEffect);
l.default.inst.createNewUnit(o.actorStatsId, i, "", o.actorSpawnHeight);
for (var a = n.Toolbox.randomInt(5, 30), r = 0; r < a; r++) {
var s = i.neighbours.getRandom();
l.default.inst.createNewUnit(o.actorStatsId, s, "", o.actorSpawnHeight);
}
u.default.logDisaster(t, i);
}
}
};
e.prototype.spawnRainCloud = function() {
var t = h.default.powers.get("cloudRain"), e = l.default.inst.tilesList.getRandom();
l.default.inst.cloudController.spawnCloud(e.posV3, t.id);
};
e.prototype.spawnTornado = function(t) {
var e = h.default.powers.get("tornado");
e.spawnSound && s.default.play(e.spawnSound);
var i = l.default.inst.tilesList.getRandom();
l.default.inst.createNewUnit(e.actorStatsId, i, "", e.actorSpawnHeight);
u.default.logDisaster(t, i);
};
e.prototype.spawnMeteorite = function(t) {
var e = l.default.inst.tilesList.getRandom();
l.default.inst.spawnMeteorite(e);
u.default.logDisaster(t, e);
};
return e;
}(d.default);
i.default = f;
cc._RF.pop();
}, {
"../../MapBox": "MapBox",
"../../common/ToolBox": "ToolBox",
"../../game/audio/GameAudio": "GameAudio",
"../../natural/Earthquake": "Earthquake",
"../../ui/log/WorldLog": "WorldLog",
"../AssetLibrary": "AssetLibrary",
"../AssetManager": "AssetManager"
} ],
Docks: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "bf97ce+NYxOy4cZrY63/KoE", "Docks");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
}), r = this && this.__values || function(t) {
var e = "function" == typeof Symbol && Symbol.iterator, i = e && t[e], o = 0;
if (i) return i.call(t);
if (t && "number" == typeof t.length) return {
next: function() {
t && o >= t.length && (t = void 0);
return {
value: t && t[o++],
done: !t
};
}
};
throw new TypeError(e ? "Object is not iterable." : "Symbol.iterator is not defined.");
};
Object.defineProperty(i, "__esModule", {
value: !0
});
var n = t("../assetLibrary/AssetManager"), s = t("../base/BaseBuilding"), l = t("../MapBox"), c = function(t) {
a(e, t);
function e() {
var e = null !== t && t.apply(this, arguments) || this;
e.limit = 1;
e.boats_trading = [];
e.boats_transport = [];
e.boats_fishing = [];
e.tiles_water = [];
return e;
}
e.prototype.create = function() {
t.prototype.create.call(this);
};
e.prototype.getIsland = function() {
var t;
return this.building.city ? null === (t = this.building.city.getTile()) || void 0 === t ? void 0 : t.region.island : null;
};
e.prototype.getWaterTileInSameOcean = function(t) {
var e, i;
try {
for (var o = r(this.tiles_water), a = o.next(); !a.done; a = o.next()) {
var n = a.value;
if (n.isSameIsland(t)) return n;
}
} catch (t) {
e = {
error: t
};
} finally {
try {
a && !a.done && (i = o.return) && i.call(o);
} finally {
if (e) throw e.error;
}
}
return null;
};
e.prototype.checkWaterTiles = function() {
this.recalculateWaterTiles();
return 0 != this.tiles_water.length;
};
e.prototype.recalculateWaterTiles = function() {
this.tiles_water.clear();
var t = l.default.inst.getTile(this.building.currentTile.x - 4, this.building.currentTile.y);
t && t.isGoodForBoat() && this.tiles_water.push(t);
(t = l.default.inst.getTile(this.building.currentTile.x + 5, this.building.currentTile.y)) && t.isGoodForBoat() && this.tiles_water.push(t);
(t = l.default.inst.getTile(this.building.currentTile.x, this.building.currentTile.y - 4)) && t.isGoodForBoat() && this.tiles_water.push(t);
(t = l.default.inst.getTile(this.building.currentTile.x, this.building.currentTile.y + 7)) && t.isGoodForBoat() && this.tiles_water.push(t);
this.tiles_water.shuffle();
0 == this.tiles_water.length && this.building.startRemove();
};
e.prototype.isDockGood = function() {
return !1;
};
e.prototype.logicUpdate = function(e) {
t.prototype.logicUpdate.call(this, e);
};
e.prototype.haveFreeSlot = function(t) {
var e = this.getList(t);
return !(this.limit <= e.length);
};
e.prototype.isMoreLimit = function(t) {
return this.getList(t).length > this.limit;
};
e.prototype.buildBoatFromHere = function(t) {
var i = n.default.unitStats.get(e.boat_types.getRandom());
this.getList(i);
if (!this.haveFreeSlot(i)) return null;
if (!t.haveEnoughResourcesFor(i.cost)) return null;
if (0 == this.tiles_water.length) {
this.recalculateWaterTiles();
return null;
}
if (this.tiles_water.getRandom().region.island.getTileCount() < 2500) return null;
var o = l.default.inst.createNewUnit(i.id, this.tiles_water.getRandom());
if (!o) return null;
this.addBoatToDock(o);
t.spendResourcesFor(i.cost);
return o;
};
e.prototype.getList = function(t) {
switch (t.id) {
case "boat_transport":
return this.boats_transport;

case "boat_fishing":
return this.boats_fishing;

case "boat_trading":
return this.boats_trading;

default:
return [];
}
};
e.prototype.setKingdom = function(t) {
this.setKingdomToBoats(t, this.boats_transport);
this.setKingdomToBoats(t, this.boats_fishing);
this.setKingdomToBoats(t, this.boats_trading);
};
e.prototype.setKingdomToBoats = function(t, e) {
e.forEach(function(e) {
e.setKingdom(t);
});
};
e.prototype.addBoatToDock = function(t) {
t.setHomeBuilding(this.building);
this.getList(t.stats).push(t);
t.setCity(t.homeBuilding.city);
t.callbacks_on_death.push(this.callbackUnitDied.bind(this));
};
e.prototype.removeBoatFromDock = function(t) {
var e;
null === (e = this.getList(t.stats)) || void 0 === e || e.remove(t);
};
e.prototype.callbackUnitDied = function(t) {
this.removeBoatFromDock(t);
};
e.boat_types = [ "boat_fishing", "boat_trading", "boat_transport" ];
return e;
}(s.BaseBuildingComponent);
i.default = c;
cc._RF.pop();
}, {
"../MapBox": "MapBox",
"../assetLibrary/AssetManager": "AssetManager",
"../base/BaseBuilding": "BaseBuilding"
} ],
DragonAsset: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "dae999kgz1H9o+mZt0m8J1t", "DragonAsset");
var o, a, r = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
}), n = this && this.__decorate || function(t, e, i, o) {
var a, r = arguments.length, n = r < 3 ? e : null === o ? o = Object.getOwnPropertyDescriptor(e, i) : o;
if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) n = Reflect.decorate(t, e, i, o); else for (var s = t.length - 1; s >= 0; s--) (a = t[s]) && (n = (r < 3 ? a(n) : r > 3 ? a(e, i, n) : a(e, i)) || n);
return r > 3 && n && Object.defineProperty(e, i, n), n;
};
Object.defineProperty(i, "__esModule", {
value: !0
});
i.DragonAssetContainer = i.DragonState = void 0;
(function(t) {
t[t.Fly = 0] = "Fly";
t[t.LandAttack = 1] = "LandAttack";
t[t.Death = 2] = "Death";
t[t.SleepStart = 3] = "SleepStart";
t[t.SleepLoop = 4] = "SleepLoop";
t[t.SleepUp = 5] = "SleepUp";
t[t.Landing = 6] = "Landing";
t[t.Slide = 7] = "Slide";
t[t.Up = 8] = "Up";
t[t.Idle = 9] = "Idle";
})(a = i.DragonState || (i.DragonState = {}));
var s = cc._decorator, l = s.ccclass, c = s.property, u = function() {
function t() {
this.name = "";
this.id = a.Fly;
this.frames = [];
this.states = [];
this.speed = .1;
}
n([ c({
type: cc.Enum(a)
}) ], t.prototype, "id", void 0);
n([ c({
type: [ cc.SpriteFrame ]
}) ], t.prototype, "frames", void 0);
n([ c({
type: [ cc.Enum(a) ]
}) ], t.prototype, "states", void 0);
n([ c() ], t.prototype, "speed", void 0);
return n([ l("DragonAssetContainer") ], t);
}();
i.DragonAssetContainer = u;
var d = function(t) {
r(e, t);
function e() {
var e = null !== t && t.apply(this, arguments) || this;
e.dict = null;
e.list = [];
return e;
}
e.prototype.getAsset = function(t) {
var e = this;
if (null == this.dict) {
this.dict = new Map();
this.list.forEach(function(t) {
e.dict.set(t.id, t);
});
}
return this.dict.get(t);
};
n([ c({
type: [ u ]
}) ], e.prototype, "list", void 0);
return n([ l ], e);
}(cc.Component);
i.default = d;
cc._RF.pop();
}, {} ],
Dragon: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "b7f00uUrddLG44Sh6n/J8HH", "Dragon");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
}), r = this && this.__decorate || function(t, e, i, o) {
var a, r = arguments.length, n = r < 3 ? e : null === o ? o = Object.getOwnPropertyDescriptor(e, i) : o;
if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) n = Reflect.decorate(t, e, i, o); else for (var s = t.length - 1; s >= 0; s--) (a = t[s]) && (n = (r < 3 ? a(n) : r > 3 ? a(e, i, n) : a(e, i)) || n);
return r > 3 && n && Object.defineProperty(e, i, n), n;
}, n = this && this.__values || function(t) {
var e = "function" == typeof Symbol && Symbol.iterator, i = e && t[e], o = 0;
if (i) return i.call(t);
if (t && "number" == typeof t.length) return {
next: function() {
t && o >= t.length && (t = void 0);
return {
value: t && t[o++],
done: !t
};
}
};
throw new TypeError(e ? "Object is not iterable." : "Symbol.iterator is not defined.");
};
Object.defineProperty(i, "__esModule", {
value: !0
});
var s = t("../../../../../../framework/utils/Log"), l = t("../../../animation/SpriteAnimation"), c = t("../../../base/BaseActorComponent"), u = t("../../../common/ToolBox"), d = t("../../../common/UnusedLibrary"), h = t("../../../game/audio/GameAudio"), p = t("../../../MapBox"), f = t("./DragonAsset"), m = cc._decorator, y = m.ccclass, _ = (m.property, 
function(t) {
a(e, t);
function e() {
var e = null !== t && t.apply(this, arguments) || this;
e.ignoredKingdoms = [];
e.dragonAsset = null;
e.state = f.DragonState.Idle;
e.animationDoneOnce = !1;
e.actionTime = 0;
e.landAttacks = 0;
e.attacksForCity = 0;
e.cityToAttack = null;
e.actorToAttack = null;
e._justGotHit = !1;
e._canSleep = !1;
e.sleepy = 0;
e._died = !1;
e.spriteAnimation = null;
return e;
}
i = e;
e.prototype.create = function() {
t.prototype.create.call(this);
this.spriteAnimation = this.getComponent(l.SpriteAnimation);
if (this.actor.haveTrait("zombie")) {
this.ignoredKingdoms = [ "undead" ];
this.dragonAsset = d.default.inst.zombieDragonAsset;
} else {
this.ignoredKingdoms = [ "dragons" ];
this.dragonAsset = d.default.inst.dragonAsset;
}
this.actor.callbacks_get_hit.add(this.getHit.bind(this));
this.setState(f.DragonState.Fly);
};
e.prototype.setFlying = function(t) {
this.actor.flying = t;
this.actor.hitboxZ = t ? 8 : 2;
};
e.prototype.setState = function(t) {
var e, i, o, a, r, n, s, l, c, d, m, y = this;
this.state = t;
var _ = this.dragonAsset.getAsset(t);
this.animationDoneOnce = !1;
this.setFlying(!1);
var g = null;
this.actor.haveTrait("zombie") || this.sleepy++;
switch (this.state) {
case f.DragonState.Fly:
this.setFlying(!0);
(null === (i = null === (e = this.actorToAttack) || void 0 === e ? void 0 : e.data) || void 0 === i ? void 0 : i.alive) || (this.actorToAttack = null);
if (this.actor.haveTrait("zombie") && !this.actorToAttack && !this.cityToAttack && p.default.inst.kingdoms.getKingdomByID("goldenBrain").buildings.length > 0) {
var v = 0, b = 0;
p.default.inst.kingdoms.getKingdomByID("goldenBrain").buildings.list.forEach(function(t) {
v = u.Toolbox.distTile(t.currentTile, y.actor.currentTile);
if (!g || v < b) {
g = t.currentTile;
b = v;
}
});
if (g && g == this.actor.currentTile) {
this.setState(f.DragonState.Landing);
return;
}
}
if ((null === (a = null === (o = this.actorToAttack) || void 0 === o ? void 0 : o.data) || void 0 === a ? void 0 : a.alive) && this.actorToAttack.currentTile && !this.shouldFly() && this.actor.currentTile == this.actorToAttack.currentTile) {
this.setState(f.DragonState.Landing);
return;
}
if (this.attacksForCity > 0 && (null === (r = this.cityToAttack) || void 0 === r ? void 0 : r.buildings)) if (0 == this.cityToAttack.buildings.length) this.cityToAttack = null; else {
g = null === (m = null === (d = null === (c = null === (l = null === (s = null === (n = this.cityToAttack) || void 0 === n ? void 0 : n.buildings) || void 0 === s ? void 0 : s.getRandom()) || void 0 === l ? void 0 : l.currentTile) || void 0 === c ? void 0 : c.zone) || void 0 === d ? void 0 : d.tiles) || void 0 === m ? void 0 : m.getRandom();
this.attacksForCity--;
}
if (!g) {
var T = 50;
g = p.default.inst.islandsCalculator.getRandomGround();
for (;u.Toolbox.dist(this.actor.currentTile.pos.x, this.actor.currentTile.pos.y, g.pos.x, g.pos.y) > 100; ) {
g = p.default.inst.islandsCalculator.getRandomGround();
if (--T <= 0) break;
}
}
this.actor.moveTo(g);
break;

case f.DragonState.LandAttack:
h.default.playDragonAttack(this.node.position);
break;

case f.DragonState.Death:
this.spriteAnimation.looped = !1;
break;

case f.DragonState.SleepStart:
this.sleepy = 0;
this.actor.setFlip(!1);
break;

case f.DragonState.SleepLoop:
this.sleepy = 0;
this.actor.setFlip(!1);
this.actionTime = u.Toolbox.randomFloat(10, 80);
break;

case f.DragonState.SleepUp:
this.sleepy = 0;
this.actor.setFlip(!1);
break;

case f.DragonState.Landing:
if (this.shouldFly()) {
this.setState(f.DragonState.Up);
return;
}
break;

case f.DragonState.Slide:
h.default.playDragonSwoop(this.node.position);
this.setFlying(!0);
break;

case f.DragonState.Up:
this.landAttacks = 0;
this.actionTime = 0;
this.setFlying(!0);
break;

case f.DragonState.Idle:
this.actionTime = u.Toolbox.randomFloat(1, 3);
}
this.spriteAnimation.setFrames(_.frames);
this.spriteAnimation.timeBetweenFrames = _.speed;
this.spriteAnimation.resetAnim();
};
e.prototype.shouldFly = function() {
var t, e, i;
return (null === (e = null === (t = this.actor.currentTile) || void 0 === t ? void 0 : t.type) || void 0 === e || !e.ground) && !0 === (null === (i = this.actor.data) || void 0 === i ? void 0 : i.alive);
};
e.prototype.attackTile = function(t) {
if (t) if (this.actor.haveTrait("zombie")) {
t.setAcid();
u.Toolbox.randomBool() && p.default.inst.dropManager.spawnBurstPixel(t, "acid", u.Toolbox.randomFloat(.05, .5), u.Toolbox.randomFloat(.05, .75));
} else {
t.setFire(!0);
t.building && t.building.getHit(10);
u.Toolbox.randomBool() && p.default.inst.dropManager.spawnBurstPixel(t, "fire", u.Toolbox.randomFloat(.05, .5), u.Toolbox.randomFloat(.05, .75));
}
};
e.prototype.hasTargetsForSlide = function() {
var t, e;
if (p.default.inst.worldLaws.world_law_peaceful_monsters.boolVal) return !1;
var i = this.attackRange(this.actor.flip);
try {
for (var o = n(i), a = o.next(); !a.done; a = o.next()) {
var r = a.value;
if (this.hasTarget(r)) return !0;
}
} catch (e) {
t = {
error: e
};
} finally {
try {
a && !a.done && (e = o.return) && e.call(o);
} finally {
if (t) throw t.error;
}
}
return !1;
};
e.prototype.attackRange = function(t) {
void 0 === t && (t = !1);
var e, i = [];
e = t ? -25 : 20;
for (var o = 0; o < 4; o++) for (var a = 0; a < 35; a++) {
var r = p.default.inst.getTile(this.actor.currentTile.x + a - 15 + e, this.actor.currentTile.y - o + 2);
r && i.push(r);
}
return i;
};
e.prototype.hasTarget = function(t) {
var e, i, o, a, r, s, l, c;
if (p.default.inst.worldLaws.world_law_peaceful_monsters.boolVal) return !1;
if ((null === (s = null === (r = t.building) || void 0 === r ? void 0 : r.data) || void 0 === s ? void 0 : s.alive) && !t.building.isRuin()) return !0;
if (t.units.length > 0) try {
for (var u = n(t.units), d = u.next(); !d.done; d = u.next()) {
var h = d.value;
if ((null === (l = h.data) || void 0 === l ? void 0 : l.alive) && !(h.node.z > 0) && this.ignoredKingdoms) {
var f = !1, m = this.ignoredKingdoms;
try {
for (var y = (o = void 0, n(m)), _ = y.next(); !_.done; _ = y.next()) {
var g = _.value;
if ((null === (c = h.kingdom) || void 0 === c ? void 0 : c.data.id) == g) {
f = !0;
break;
}
}
} catch (t) {
o = {
error: t
};
} finally {
try {
_ && !_.done && (a = y.return) && a.call(y);
} finally {
if (o) throw o.error;
}
}
if (f) continue;
}
}
} catch (t) {
e = {
error: t
};
} finally {
try {
d && !d.done && (i = u.return) && i.call(u);
} finally {
if (e) throw e.error;
}
}
return !1;
};
e.prototype.logicUpdate = function(t) {
var e, i, o = this;
this.spriteAnimation.currentFrameIndex > 0 && (this.animationDoneOnce = !0);
(null === (i = null === (e = this.actor) || void 0 === e ? void 0 : e.data) || void 0 === i ? void 0 : i.alive) || (this.actionTime = -1);
if (this.state == f.DragonState.Slide && 7 == this.spriteAnimation.currentFrameIndex) this.attackRange(this.actor.flip).forEach(function(t) {
if (!u.Toolbox.randomBool()) {
p.default.inst.applyForce(t, 2, o.actor.curStats.knockback, !0, !1, o.actor.curStats.damage, o.ignoredKingdoms, o.actor);
o.attackTile(t);
}
}); else if (this.state == f.DragonState.LandAttack && 5 == this.spriteAnimation.currentFrameIndex) {
this.landAttacks++;
for (var a = 0; a < 12; a++) for (var r = 0; r < 20; r++) if (!u.Toolbox.randomBool()) {
var n = p.default.inst.getTile(this.actor.currentTile.pos.x + r - 10, this.actor.currentTile.pos.y - a + 1);
!n || u.Toolbox.dist(this.actor.currentTile.pos.x, this.actor.currentTile.pos.y, n.pos.x, n.pos.y) > 9 || this.attackTile(n);
}
p.default.inst.applyForce(this.actor.currentTile, 10, this.actor.curStats.knockback, !0, !1, this.actor.curStats.damage, this.ignoredKingdoms, this.actor);
} else if (this.state == f.DragonState.Death && this.spriteAnimation.currentFrameIndex == this.spriteAnimation.frames.length - 1) {
this.actor.updateDeadBlackAnimation();
if (!this._died) {
this._died = !0;
this.actor.haveTrait("acid_blood") && this.acidBloodExplosion();
this.actor.haveTrait("fire_blood") && this.fireBloodExplosion();
}
return;
}
if (!this.actor.is_moving) {
this.shouldFly() && (this.actionTime = 0);
this.actionTime > 0 ? this.actionTime -= t : this.nextAction();
}
};
e.prototype.acidBloodExplosion = function() {
for (var t = 0; t < 25; t++) {
u.Toolbox.randomBool() && p.default.inst.dropManager.spawnBurstPixel(this.actor.currentTile, "acid", u.Toolbox.randomFloat(.05, .5), u.Toolbox.randomFloat(.05, 1));
this.actor.currentTile.neighboursAll.forEach(function(t) {
u.Toolbox.randomBool() && p.default.inst.dropManager.spawnBurstPixel(t, "acid", u.Toolbox.randomFloat(.05, .5), u.Toolbox.randomFloat(.05, 1));
});
}
};
e.prototype.fireBloodExplosion = function() {
for (var t = 0; t < 25; t++) {
u.Toolbox.randomBool() && p.default.inst.dropManager.spawnBurstPixel(this.actor.currentTile, "fire", u.Toolbox.randomFloat(.05, .5), u.Toolbox.randomFloat(.05, 1));
this.actor.currentTile.neighboursAll.forEach(function(t) {
u.Toolbox.randomBool() && p.default.inst.dropManager.spawnBurstPixel(t, "fire", u.Toolbox.randomFloat(.05, .5), u.Toolbox.randomFloat(.05, 1));
});
}
};
e.prototype.nextAction = function() {
var t, e, o, a, r = p.default.inst.worldLaws.world_law_peaceful_monsters.boolVal;
if (0 == this.spriteAnimation.currentFrameIndex && this.animationDoneOnce) if (null === (e = null === (t = this.actor) || void 0 === t ? void 0 : t.data) || void 0 === e ? void 0 : e.alive) {
if (this._justGotHit && !r) {
if (this.state == f.DragonState.Idle || this.state == f.DragonState.SleepUp || this.state == f.DragonState.LandAttack) {
if (this.landAttacks > 2 || this.shouldFly()) {
this.setState(f.DragonState.Up);
return;
}
this._justGotHit = !1;
this.setState(f.DragonState.LandAttack);
return;
}
if (this.state == f.DragonState.Fly || this.state == f.DragonState.Up) {
this.setState(f.DragonState.Slide);
this._justGotHit = !1;
return;
}
}
if (this.state == f.DragonState.Landing) {
if (!r && (null === (a = null === (o = this.actorToAttack) || void 0 === o ? void 0 : o.data) || void 0 === a ? void 0 : a.alive) && this.actor.currentTile && this.actor.currentTile == this.actorToAttack.currentTile && !this.shouldFly()) {
this.setState(f.DragonState.LandAttack);
return;
}
if (!r && this.attacksForCity > 0 && this.cityToAttack && u.Toolbox.randomChance(.2)) {
if (this.shouldFly() && this.hasTargetsForSlide() && u.Toolbox.randomBool()) {
this.setState(f.DragonState.Slide);
this.attacksForCity--;
return;
}
if (!this.shouldFly()) {
this.setState(f.DragonState.LandAttack);
this.attacksForCity--;
return;
}
}
if (this.shouldFly()) {
this.setState(f.DragonState.Fly);
return;
}
}
this._canSleep = !0;
this.actorToAttack || this.cityToAttack ? this._canSleep = !1 : this.actor.currentTile.units.length > 1 && (this._canSleep = !1);
i.possibleActions.clear();
this.state == f.DragonState.SleepStart && i.possibleActions.push(f.DragonState.SleepLoop);
if (this.state == f.DragonState.SleepLoop) {
i.possibleActions.push(f.DragonState.SleepLoop);
i.possibleActions.push(f.DragonState.SleepUp);
}
if (this.state == f.DragonState.SleepUp) {
this._canSleep && i.possibleActions.push(f.DragonState.SleepStart);
i.possibleActions.push(f.DragonState.Up);
i.possibleActions.push(f.DragonState.Idle);
}
if (this.state == f.DragonState.Up || this.state == f.DragonState.Fly || this.state == f.DragonState.Slide) {
if (!this.shouldFly()) {
i.possibleActions.push(f.DragonState.Fly);
this.state != f.DragonState.Up && i.possibleActions.push(f.DragonState.Landing);
}
i.possibleActions.push(f.DragonState.Fly);
i.possibleActions.push(f.DragonState.Fly);
i.possibleActions.push(f.DragonState.Fly);
i.possibleActions.push(f.DragonState.Fly);
i.possibleActions.push(f.DragonState.Fly);
this.state == f.DragonState.Slide || r || i.possibleActions.push(f.DragonState.Slide);
}
if (this.state == f.DragonState.Landing || this.state == f.DragonState.Idle || this.state == f.DragonState.LandAttack) {
i.possibleActions.push(f.DragonState.Up);
r || i.possibleActions.push(f.DragonState.LandAttack);
if (this._canSleep && this.sleepy > 10) {
i.possibleActions.push(f.DragonState.SleepStart);
i.possibleActions.push(f.DragonState.SleepStart);
i.possibleActions.push(f.DragonState.SleepStart);
}
i.possibleActions.push(f.DragonState.Idle);
i.possibleActions.push(f.DragonState.Idle);
i.possibleActions.push(f.DragonState.Idle);
}
if (i.possibleActions.length > 0) {
var n = i.possibleActions.getRandom();
this.setState(n);
} else s.default.d("no possible actions for current state : " + this.state);
i.possibleActions.clear();
} else this.actor.flying ? this.setState(f.DragonState.Landing) : this.state != f.DragonState.Death && this.setState(f.DragonState.Death);
};
e.prototype.clickToWakeup = function() {
this.state != f.DragonState.SleepLoop && this.state != f.DragonState.SleepStart || (this.actionTime = 0);
};
e.prototype.getHit = function() {
var t, e, i;
if (!p.default.inst.worldLaws.world_law_peaceful_monsters.boolVal && (null === (t = this.actor) || void 0 === t ? void 0 : t.attackedBy)) {
this.actor.attackedBy.isActor() && !(null === (i = null === (e = this.actorToAttack) || void 0 === e ? void 0 : e.data) || void 0 === i ? void 0 : i.alive) && (this.actorToAttack = this.actor.attackedBy.a);
this.cityToAttack = this.actor.attackedBy.city;
this.attacksForCity = u.Toolbox.randomInt(4, 12);
}
this._justGotHit = !0;
this.actionTime = 0;
};
var i;
e.possibleActions = [];
return i = r([ y ], e);
}(c.default));
i.default = _;
cc._RF.pop();
}, {
"../../../../../../framework/utils/Log": void 0,
"../../../MapBox": "MapBox",
"../../../animation/SpriteAnimation": "SpriteAnimation",
"../../../base/BaseActorComponent": "BaseActorComponent",
"../../../common/ToolBox": "ToolBox",
"../../../common/UnusedLibrary": "UnusedLibrary",
"../../../game/audio/GameAudio": "GameAudio",
"./DragonAsset": "DragonAsset"
} ],
DropManager: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "5fc60cTyaZE5pZ5Hi4Vbr9P", "DropManager");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
}), r = this && this.__decorate || function(t, e, i, o) {
var a, r = arguments.length, n = r < 3 ? e : null === o ? o = Object.getOwnPropertyDescriptor(e, i) : o;
if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) n = Reflect.decorate(t, e, i, o); else for (var s = t.length - 1; s >= 0; s--) (a = t[s]) && (n = (r < 3 ? a(n) : r > 3 ? a(e, i, n) : a(e, i)) || n);
return r > 3 && n && Object.defineProperty(e, i, n), n;
}, n = this && this.__values || function(t) {
var e = "function" == typeof Symbol && Symbol.iterator, i = e && t[e], o = 0;
if (i) return i.call(t);
if (t && "number" == typeof t.length) return {
next: function() {
t && o >= t.length && (t = void 0);
return {
value: t && t[o++],
done: !t
};
}
};
throw new TypeError(e ? "Object is not iterable." : "Symbol.iterator is not defined.");
};
Object.defineProperty(i, "__esModule", {
value: !0
});
var s = t("../../assetLibrary/AssetManager"), l = t("../../base/BaseMapObject"), c = t("../../common/ToolBox"), u = t("../../MapBox"), d = t("../drop/Drop"), h = cc._decorator, p = h.ccclass, f = h.property, m = function(t) {
a(e, t);
function e() {
var e = null !== t && t.apply(this, arguments) || this;
e.drops = [];
e.timeout_timer = 0;
e.activeIndex = 0;
e.original_drop = null;
e.tDrop = null;
e.pool = new cc.NodePool();
return e;
}
e.prototype.create = function() {
t.prototype.create.call(this);
};
e.prototype.spawn = function(t, e, i, o) {
void 0 === i && (i = -1);
void 0 === o && (o = -1);
var a = s.default.drops.get(e), r = this.getObject();
r.launch(t, a, i);
-1 == o && (o = a.default_scale);
r.node.scale = o;
if (a.random_flip) {
var n = c.Toolbox.randomBool() ? 1 : -1;
r.node.scaleX *= n;
}
return r;
};
e.prototype.spawnBurstPixel = function(t, e, i, o, a, r) {
void 0 === a && (a = 0);
void 0 === r && (r = -1);
var n = this.spawn(t, e, a, r);
n.burst = !0;
n.zPosition.z = a;
n.updatePosition();
var s = c.Toolbox.randomFloat(-Math.PI, Math.PI), l = i * Math.cos(s), u = i * Math.sin(s), d = c.Toolbox.randomFloat(o, 2 * o);
n.addForce(l, u, d);
n.updatePosition();
};
e.prototype.spawnPixel = function(t, e, i) {
void 0 === i && (i = !1);
};
e.prototype.clear = function() {
for (var t = this.drops.length - 1; this.drops.length > 0; ) {
var e = this.drops[t];
this.killObject(e);
t--;
}
this.drops.clear();
};
e.prototype.killObject = function(t) {
t.active = !1;
this.drops.remove(t);
this.pool.put(t.node);
};
e.prototype.landPixel = function(t) {
var e = t.currentTile;
this.killObject(t);
e && u.default.inst.flashEffects.flashPixel(e, 14);
};
e.prototype.getObject = function() {
var t = this.pool.get();
t || (t = cc.instantiate(this.original_drop));
t.parent = this.node;
t.scale = 1;
this.tDrop = t.getComponent(d.default);
this.tDrop.controller = this;
this.drops.push(this.tDrop);
this.tDrop.drop_index = this.drops.length;
this.tDrop.burst = !1;
this.tDrop.createGround = !0;
this.tDrop.forcedTileType = null;
this.tDrop.active = !0;
return this.tDrop;
};
e.prototype.logicUpdate = function(e) {
var i, o;
t.prototype.logicUpdate.call(this, e);
this.timeout_timer > 0 && (this.timeout_timer -= cc.director.getDeltaTime());
try {
for (var a = n(this.drops), r = a.next(); !r.done; r = a.next()) {
var s = r.value;
s.created && s.active && s.logicUpdate(e);
}
} catch (t) {
i = {
error: t
};
} finally {
try {
r && !r.done && (o = a.return) && o.call(a);
} finally {
if (i) throw i.error;
}
}
};
r([ f(cc.Prefab) ], e.prototype, "original_drop", void 0);
return r([ p ], e);
}(l.default);
i.default = m;
cc._RF.pop();
}, {
"../../MapBox": "MapBox",
"../../assetLibrary/AssetManager": "AssetManager",
"../../base/BaseMapObject": "BaseMapObject",
"../../common/ToolBox": "ToolBox",
"../drop/Drop": "Drop"
} ],
DropsLibrary: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "c4aee9yBEpCnpBJFwL8oRmJ", "DropsLibrary");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
});
Object.defineProperty(i, "__esModule", {
value: !0
});
i.DropAsset = void 0;
var r = t("../../../../../framework/lib/prototype/MathUtils"), n = t("../../../../../framework/utils/Tools"), s = t("../../../../common/src/data/AchievData"), l = t("../../actors/ActionLibrary"), c = t("../../actors/ActorStatus"), u = t("../../building/Wheat"), d = t("../../common/ToolBox"), h = t("../../game/audio/GameAudio"), p = t("../../map/map/MapLayer"), f = t("../../map/tile/TileType"), m = t("../../map/tile/TileTypeShortcut"), y = t("../../MapBox"), _ = t("../AssetLibrary"), g = t("../AssetManager"), v = t("./ResourceLibrary"), b = function(t) {
a(e, t);
function e() {
var e = null !== t && t.apply(this, arguments) || this;
e.random_frame = !1;
e.random_flip = !1;
e.animated = !1;
e.animation_speed = .1;
e.animation_speed_random = .1;
e.sound_drop = "";
e.sound_launch = "";
e.action_launch = null;
e.action_landed = null;
e.powerOnLanding = "";
e.constructionTemplate = "";
e.constructionTemplateSound = "";
e.bounce = !1;
e.fallingSpeed = 3.2;
e.fallingSpeedRandom = .5;
e.fallingHeight = cc.v3(15, 20);
e.fallingRandomXMove = !1;
e.particleInterval = 0;
e.texture = "drops/drop_pixel";
e.default_scale = 1;
e.spriteList = [];
return e;
}
return e;
}(_.Asset);
i.DropAsset = b;
var T = function(t) {
a(e, t);
function e() {
return null !== t && t.apply(this, arguments) || this;
}
e.prototype.init = function() {
t.prototype.init.call(this);
var i = new b();
i.id = "tnt";
i.sound_drop = "fallingSand";
i.animated = !0;
i.texture = "drops/drop_tnt";
i.animation_speed = .03;
i.default_scale = .2;
i.action_landed = e.action_tnt;
this.add(i);
var o = new b();
o.id = "tnt_timed";
o.texture = "drops/drop_tnttimed";
o.default_scale = .2;
o.sound_drop = "fallingSand";
o.action_landed = e.action_tnt_timed;
this.add(o);
var a = new b();
a.id = "water_bomb";
a.texture = "drops/drop_waterbomb";
a.default_scale = .2;
a.action_landed = e.action_water_bomb;
this.add(a);
var r = new b();
r.id = "landmine";
r.texture = "drops/drop_landmine";
r.default_scale = .2;
r.sound_drop = "fallingSand";
r.action_landed = e.action_landmine;
this.add(r);
var n = new b();
n.id = "fireworks";
n.texture = "drops/drop_fireworks";
n.random_frame = !0;
n.default_scale = .1;
n.sound_drop = "fallingSand";
n.action_landed = e.action_fireworks;
this.add(n);
var s = new b();
s.id = "inspiration";
s.texture = "drops/drop_fire";
s.default_scale = .2;
s.action_landed = e.action_inspiration;
this.add(s);
var c = new b();
c.id = "friendship";
c.texture = "drops/drop_friendship";
c.random_frame = !0;
c.default_scale = .1;
c.action_landed = e.action_friendship;
this.add(c);
var u = new b();
u.id = "spite";
u.texture = "drops/drop_spite";
u.random_frame = !0;
u.default_scale = .1;
u.action_landed = e.action_spite;
this.add(u);
var d = new b();
d.id = "madness";
d.texture = "drops/drop_madness";
d.random_frame = !0;
d.default_scale = .1;
d.action_landed = e.action_madness;
this.add(d);
var h = new b();
h.id = "blessing";
h.texture = "drops/drop_blessing";
h.animated = !0;
h.animation_speed = .03;
h.default_scale = .1;
h.action_landed = e.action_blessing;
this.add(h);
this.t.action_landed = l.default.action_shrinkTornadoes;
var p = new b();
p.id = "shield";
p.texture = "drops/drop_shield";
p.random_frame = !0;
p.default_scale = .1;
p.action_landed = e.action_shield;
this.add(p);
var f = new b();
f.id = "coffee";
f.texture = "drops/drop_coffee";
f.random_frame = !0;
f.default_scale = .1;
f.action_landed = e.action_coffee;
this.add(f);
var m = new b();
m.id = "curse";
m.texture = "drops/drop_curse";
m.random_frame = !0;
m.default_scale = .1;
m.action_landed = e.action_curse;
this.add(m);
this.t.action_landed = l.default.action_growTornadoes;
var y = new b();
y.id = "zombieInfection";
y.texture = "drops/drop_zombieinfection";
y.random_frame = !0;
y.default_scale = .1;
y.action_landed = e.action_zombieInfection;
this.add(y);
var _ = new b();
_.id = "mushSpores";
_.texture = "drops/drop_mushSpores";
_.random_frame = !0;
_.default_scale = .1;
_.action_landed = e.action_mushSpore;
this.add(_);
var g = new b();
g.id = "plague";
g.texture = "drops/drop_plague";
g.random_frame = !0;
g.default_scale = .1;
g.action_landed = e.action_plague;
this.add(g);
var v = new b();
v.id = "livingPlants";
v.texture = "drops/drop_blessing";
v.animated = !0;
v.default_scale = .1;
v.action_landed = e.action_livingPlants;
this.add(v);
var T = new b();
T.id = "livingHouse";
T.texture = "drops/drop_blessing";
T.animated = !0;
T.default_scale = .1;
T.action_landed = e.action_livingHouse;
this.add(T);
var w = new b();
w.id = "bomb";
w.sound_launch = "bomb fall";
w.sound_drop = "explosion small";
w.texture = "drops/drop_bomb";
w.default_scale = .2;
w.fallingHeight = cc.v3(60, 70), w.action_landed = e.action_bomb;
w.random_flip = !0;
this.add(w);
this.t.action_launch = l.default.increaseDroppedBombsCounter;
var B = new b();
B.id = "grenade";
B.texture = "drops/drop_grenade";
B.animated = !0;
B.default_scale = .2;
B.animation_speed = .03;
B.sound_drop = "explosion small";
B.fallingHeight = cc.v3(60, 70);
B.action_landed = e.action_grenade;
B.random_flip = !0;
this.add(B);
this.t.action_launch = l.default.increaseDroppedBombsCounter;
var k = new b();
k.id = "napalmBomb";
k.texture = "drops/drop_napalmbomb";
k.default_scale = .2;
k.sound_drop = "explosion small";
k.fallingHeight = cc.v3(60, 70);
k.action_landed = e.action_napalmBomb;
k.random_flip = !0;
this.add(k);
this.t.action_launch = l.default.increaseDroppedBombsCounter;
var A = new b();
A.id = "atomicBomb";
A.texture = "drops/drop_atomicbomb";
A.default_scale = .2;
A.sound_launch = "bomb fall";
A.sound_drop = "explosion medium";
A.fallingHeight = cc.v3(60, 70);
A.action_landed = e.action_atomicBomb;
A.random_flip = !0;
this.add(A);
this.t.action_launch = l.default.increaseDroppedBombsCounter;
var S = new b();
S.id = "antimatterBomb";
S.texture = "drops/drop_antimatterbomb";
S.default_scale = .2;
S.fallingHeight = cc.v3(60, 70);
S.action_landed = e.action_antimatterBomb;
this.add(S);
this.t.action_launch = l.default.increaseDroppedBombsCounter;
var x = new b();
x.id = "czarBomba";
x.texture = "drops/drop_czarbomba";
x.default_scale = .2;
x.sound_launch = "bomb fall";
x.sound_drop = "explosion big";
x.fallingHeight = cc.v3(60, 70);
x.action_landed = e.action_czarBomba;
this.add(x);
this.t.action_launch = l.default.increaseDroppedBombsCounter;
var C = new b();
C.id = "rain";
C.texture = "drops/drop_rain";
C.random_frame = !0;
C.default_scale = .2;
C.sound_drop = "fallingWater";
C.fallingHeight = cc.v3(30, 45);
C.action_landed = e.action_rain;
this.add(C);
var O = new b();
O.id = "bouncy_sand";
O.default_scale = .2;
O.random_frame = !0;
this.add(O);
var P = new b();
P.id = "bouncy_soil";
P.default_scale = .2;
P.random_frame = !0;
this.add(P);
var R = new b();
R.id = "bloodRain";
R.texture = "drops/drop_blood";
R.random_frame = !0;
R.default_scale = .1;
R.fallingHeight = cc.v3(30, 45);
R.action_landed = e.action_bloodRain;
this.add(R);
var M = new b();
M.id = "cure";
M.texture = "drops/drop_cure";
M.random_frame = !0;
M.default_scale = .1;
M.fallingHeight = cc.v3(30, 45);
M.action_landed = e.action_cure;
this.add(M);
var L = new b();
L.id = "fire";
L.texture = "drops/drop_fire";
L.animated = !0;
L.animation_speed = .03;
L.default_scale = .2;
L.sound_launch = "fallingFire";
L.fallingHeight = cc.v3(30, 45);
L.fallingRandomXMove = !0;
L.particleInterval = .3;
L.action_landed = e.action_fire;
L.animation_speed_random = .08;
L.random_frame = !0;
L.random_flip = !0;
this.add(L);
var F = new b();
F.id = "snow";
F.texture = "drops/drop_snow";
F.random_frame = !0;
F.default_scale = .2;
F.sound_drop = "snow";
F.fallingSpeed = .3;
F.fallingHeight = cc.v3(30, 45);
F.fallingRandomXMove = !0;
F.particleInterval = .15;
F.action_landed = e.action_snow;
this.add(F);
var D = new b();
D.id = "acid";
D.texture = "drops/drop_acid";
D.random_frame = !0;
D.default_scale = .2;
D.sound_drop = "acid";
D.fallingHeight = cc.v3(30, 45);
D.action_landed = e.action_acid;
this.add(D);
var I = new b();
I.id = "lava";
I.texture = "drops/drop_lava";
I.animated = !0;
I.animation_speed = .03;
I.default_scale = .2;
I.sound_drop = "lava";
I.fallingHeight = cc.v3(30, 45);
I.action_landed = e.action_lava;
this.add(I);
var j = new b();
j.id = "santa_bomb";
j.texture = "drops/drop_santabomb";
j.random_frame = !0;
j.default_scale = .2;
j.sound_launch = "bomb fall";
j.sound_drop = "explosion small";
j.action_landed = e.action_santa_bomb;
this.add(j);
var E = new b();
E.id = "_spawn_building";
E.texture = "drops/drop_stone";
E.random_frame = !0;
E.default_scale = .2;
E.fallingHeight = cc.v3(10, 15);
E.fallingSpeed = 5;
this.add(E);
this.t.action_landed = e.action_spawn_building;
this.clone("seeds", "_spawn_building");
this.t.texture = "drops/drop_seed";
this.t.fallingSpeed = 3;
this.t.action_landed = e.action_seeds;
this.clone("fruitBush", "_spawn_building");
this.t.texture = "drops/drop_seed";
this.t.fallingSpeed = 3;
this.t.action_landed = e.action_fruitBush;
this.clone("stone", "_spawn_building");
this.t.texture = "drops/drop_stone";
this.t.default_scale = .2;
this.t.constructionTemplate = "stone,stone_m,stone_s";
this.t.action_landed = e.action_spawn_building;
this.t.constructionTemplateSound = "stone";
this.clone("ore_deposit", "_spawn_building");
this.t.texture = "drops/drop_metal";
this.t.default_scale = .2;
this.t.constructionTemplate = "ore_deposit,ore_deposit_m,ore_deposit_s";
this.t.action_landed = e.action_spawn_building;
this.t.constructionTemplateSound = "ore_deposit";
this.clone("gold", "_spawn_building");
this.t.texture = "drops/drop_gold";
this.t.default_scale = .2;
this.t.constructionTemplate = "gold,gold_m,gold_s";
this.t.action_landed = e.action_spawn_building;
this.t.constructionTemplateSound = "gold";
this.clone("tumor", "_spawn_building");
this.t.constructionTemplate = this.t.id;
this.t.action_landed = e.action_spawn_building;
this.t.constructionTemplateSound = "spawnTumor";
this.clone("geyser", "_spawn_building");
this.t.constructionTemplate = this.t.id;
this.t.action_landed = e.action_spawn_building;
this.t.constructionTemplateSound = "geyser";
this.clone("geyserAcid", "_spawn_building");
this.t.constructionTemplate = this.t.id;
this.t.action_landed = e.action_spawn_building;
this.t.constructionTemplateSound = "geyserAcid";
this.clone("volcano", "_spawn_building");
this.t.constructionTemplate = this.t.id;
this.t.action_landed = e.action_spawn_building;
this.t.constructionTemplateSound = "spawnVolcano";
this.clone("goldenBrain", "_spawn_building");
this.t.constructionTemplate = this.t.id;
this.t.action_landed = e.action_spawn_building;
this.clone("corruptedBrain", "_spawn_building");
this.t.constructionTemplate = this.t.id;
this.t.action_landed = e.action_spawn_building;
this.clone("iceTower", "_spawn_building");
this.t.constructionTemplate = this.t.id;
this.t.action_landed = e.action_spawn_building;
this.clone("beehive", "_spawn_building");
this.t.constructionTemplate = this.t.id;
this.t.action_landed = e.action_spawn_building;
this.clone("flameTower", "_spawn_building");
this.t.constructionTemplate = this.t.id;
this.t.action_landed = e.action_spawn_building;
};
e.action_seeds = function(t, e) {
void 0 === t && (t = null);
void 0 === e && (e = null);
if (t.type.isType(m.default.field) && !t.building) y.default.inst.addBuilding("0wheat", t); else if (t.type.canGrowGreens) y.default.inst.growGreens(t); else if (y.default.inst.tryGrowPlant(t, !1, !0, !1)) {
s.default.update(2);
t.type.isType(m.default.sand) && s.default.update(19);
}
};
e.action_rain = function(t, i) {
void 0 === t && (t = null);
void 0 === i && (i = null);
e.useWaterOn(t);
t.neighbours.forEach(function(t) {
e.useWaterOn(t);
});
t.zone.tiles.forEach(function(t) {
t.data.fire && t.stopFire();
});
};
e.useWaterOn = function(t) {
var e;
t.stopFire();
t.units.forEach(function(t) {
var e;
(null === (e = t.data) || void 0 === e ? void 0 : e.alive) && t.removeStatusEffect("burning");
});
if (t.building) {
t.building.stopFire();
(null === (e = t.building.stats) || void 0 === e ? void 0 : e.resourceType) == v.ResourceType.Wheat && t.building.getComponent(u.default).growWheat();
}
t.removeBurn();
t.type.canGrowGreens && y.default.inst.growGreens(t);
t.type.canBeFilled && y.default.inst.setWater(t);
t.type.lava && y.default.inst.lavaLayer.putOut(t);
t.type.explodableByWater && y.default.inst.explosionLayer.explodeBomb(t);
};
e.action_acid = function(t, e) {
void 0 === t && (t = null);
void 0 === e && (e = null);
t.setAcid();
};
e.action_fire = function(t, e) {
void 0 === t && (t = null);
void 0 === e && (e = null);
l.default.action_fire(null, t);
};
e.action_fireworks = function(t, e) {
void 0 === t && (t = null);
void 0 === e && (e = null);
y.default.inst.terraformTile2(t, f.TileType.get("fireworks"), g.default.terraform.get("remove"));
};
e.action_tnt = function(t, e) {
void 0 === t && (t = null);
void 0 === e && (e = null);
if (t.type.lava || t.data.fire) {
y.default.inst.terraformTile2(t, f.TileType.get("tnt"), g.default.terraform.get("remove"));
y.default.inst.explosionLayer.explodeBomb(t);
} else y.default.inst.terraformTile2(t, f.TileType.get("tnt"), g.default.terraform.get("remove"));
};
e.action_tnt_timed = function(t, e) {
void 0 === t && (t = null);
void 0 === e && (e = null);
if (t.type.lava || t.data.fire) {
y.default.inst.terraformTile2(t, f.TileType.get("tnt_timed"), g.default.terraform.get("remove"));
y.default.inst.explosionLayer.explodeBomb(t);
} else y.default.inst.terraformTile2(t, f.TileType.get("tnt_timed"), g.default.terraform.get("remove"));
};
e.action_czarBomba = function(t, e) {
void 0 === t && (t = null);
void 0 === e && (e = null);
y.default.inst.stackEffects.spawnNukeFlash(t, "czarBomba");
y.default.inst.startShake();
};
e.action_atomicBomb = function(t, e) {
void 0 === t && (t = null);
void 0 === e && (e = null);
y.default.inst.startShake();
y.default.inst.stackEffects.spawnNukeFlash(t, "atomicBomb");
};
e.action_antimatterBomb = function(t, e) {
void 0 === t && (t = null);
void 0 === e && (e = null);
y.default.inst.startShake();
y.default.inst.stackEffects.spawnAntimatterEffect(t);
};
e.action_napalmBomb = function(t, e) {
void 0 === t && (t = null);
void 0 === e && (e = null);
y.default.inst.startShake();
y.default.inst.stackEffects.spawnNapalmFlash(t, "napalmBomb");
y.default.inst.stackEffects.get("explosionSmall").spawnAtRandomScale(t, .15, .3);
};
e.action_grenade = function(t, e) {
void 0 === t && (t = null);
void 0 === e && (e = null);
y.default.inst.damageWorld(t, 5, g.default.terraform.get("grenade"), c.AttackType.Bomb);
y.default.inst.stackEffects.get("explosionSmall").spawnAtRandomScale(t, .1, .15);
};
e.action_bomb = function(t, e) {
void 0 === t && (t = null);
void 0 === e && (e = null);
y.default.inst.damageWorld(t, 10, g.default.terraform.get("bomb"), c.AttackType.Bomb);
y.default.inst.stackEffects.get("explosionSmall").spawnAtRandomScale(t, .45, .6);
};
e.action_santa_bomb = function(t, e) {
void 0 === t && (t = null);
void 0 === e && (e = null);
y.default.inst.damageWorld(t, 10, g.default.terraform.get("santa_bomb"));
y.default.inst.stackEffects.get("explosionSmall").spawnAtRandomScale(t, .45, .6);
};
e.action_water_bomb = function(t, e) {
void 0 === t && (t = null);
void 0 === e && (e = null);
if (t.type.liquid || t.type.lava || t.data.fire) {
y.default.inst.terraformTile2(t, f.TileType.get("water_bomb"), g.default.terraform.get("remove"));
y.default.inst.explosionLayer.explodeBomb(t);
} else y.default.inst.terraformTile2(t, f.TileType.get("water_bomb"), g.default.terraform.get("remove"));
};
e.action_lava = function(t, e) {
void 0 === t && (t = null);
void 0 === e && (e = null);
y.default.inst.lavaLayer.addLava(t);
};
e.action_snow = function(t, e) {
void 0 === t && (t = null);
void 0 === e && (e = null);
if (!t.type.frozen) {
y.default.inst.freezeTile(t);
y.default.inst.freezeTile(t);
}
for (var i = 0; i < 10; i++) {
var o = t.chunk.tiles.getRandom();
if (!o.type.frozen) {
if (d.Toolbox.distTile(t, o) < 11) break;
y.default.inst.freezeTile(o);
y.default.inst.freezeTile(o);
}
}
};
e.action_cure = function(t, e) {
void 0 === t && (t = null);
void 0 === e && (e = null);
y.default.inst.getObjectsInChunks(t, 4, p.MapObjectType.Actor);
y.default.inst.temp_map_objects.forEach(function(t) {
var e, i = t;
if (null === (e = i.base_data) || void 0 === e ? void 0 : e.alive) {
i.removeTrait("plague");
i.removeTrait("cursed");
i.removeTrait("tumorInfection");
i.removeTrait("mushSpores");
i.removeTrait("infected");
i.startShake();
i.startColorEffect("white");
}
});
};
e.action_bloodRain = function(t, e) {
void 0 === t && (t = null);
void 0 === e && (e = null);
y.default.inst.getObjectsInChunks(t, 3, p.MapObjectType.Actor);
y.default.inst.temp_map_objects.forEach(function(t) {
var e, i = t;
if (null === (e = i.base_data) || void 0 === e ? void 0 : e.alive) {
i.removeStatusEffect("burning");
i.restoreHealth(r.default.intCast(.2 * i.curStats.health));
i.startShake();
i.startColorEffect("white");
}
});
};
e.action_plague = function(t, e) {
void 0 === t && (t = null);
void 0 === e && (e = null);
y.default.inst.getObjectsInChunks(t, 3, p.MapObjectType.Actor);
y.default.inst.temp_map_objects.forEach(function(t) {
var e = t;
e.addTrait("plague");
if (e.haveTrait("plague")) {
e.startShake();
e.startColorEffect("white");
}
});
};
e.action_zombieInfection = function(t, e) {
void 0 === t && (t = null);
void 0 === e && (e = null);
y.default.inst.getObjectsInChunks(t, 3, p.MapObjectType.Actor);
y.default.inst.temp_map_objects.forEach(function(t) {
var e = t;
if (e.stats.canTurnIntoZombie && !e.haveTrait("zombie")) {
e.addTrait("infected");
e.startShake();
e.startColorEffect("white");
}
});
};
e.action_mushSpore = function(t, e) {
void 0 === t && (t = null);
void 0 === e && (e = null);
y.default.inst.getObjectsInChunks(t, 3, p.MapObjectType.Actor);
y.default.inst.temp_map_objects.forEach(function(t) {
var e = t;
if (e.stats.canTurnIntoMush && !e.haveTrait("mushSpores")) {
e.addTrait("mushSpores");
e.startShake();
e.startColorEffect("white");
}
});
};
e.action_curse = function(t, e) {
void 0 === t && (t = null);
void 0 === e && (e = null);
y.default.inst.getObjectsInChunks(t, 3, p.MapObjectType.Actor);
y.default.inst.temp_map_objects.forEach(function(t) {
var e = t;
if (e.addTrait("cursed")) {
e.statsDirty = !0;
e.removeTrait("blessed");
e.startShake();
e.startColorEffect("white");
}
});
};
e.action_shield = function(t, e) {
void 0 === t && (t = null);
void 0 === e && (e = null);
y.default.inst.getObjectsInChunks(t, 3, p.MapObjectType.Actor);
y.default.inst.temp_map_objects.forEach(function(t) {
var e = t;
e.addStatusEffect("shield");
e.isActor() && e.a.startColorEffect("white");
});
};
e.action_coffee = function(t, e) {
void 0 === t && (t = null);
void 0 === e && (e = null);
y.default.inst.getObjectsInChunks(t, 3, p.MapObjectType.Actor);
y.default.inst.temp_map_objects.forEach(function(t) {
var e = t;
e.addStatusEffect("caffeinated");
e.isActor() && e.a.startColorEffect("white");
});
};
e.action_blessing = function(t, e) {
void 0 === t && (t = null);
void 0 === e && (e = null);
y.default.inst.getObjectsInChunks(t, 3, p.MapObjectType.Actor);
y.default.inst.temp_map_objects.forEach(function(t) {
var e = t;
if (e.addTrait("blessed")) {
e.statsDirty = !0;
e.event_full_heal = !0;
}
e.removeTrait("cursed");
e.startShake();
e.startColorEffect("white");
});
};
e.action_madness = function(t, e) {
void 0 === t && (t = null);
void 0 === e && (e = null);
y.default.inst.getObjectsInChunks(t, 3, p.MapObjectType.Actor);
y.default.inst.temp_map_objects.forEach(function(t) {
t.addTrait("madness");
});
};
e.action_inspiration = function(t, e) {
void 0 === t && (t = null);
void 0 === e && (e = null);
t.zone.city && 1 != t.zone.city.kingdom.cities.length && t.zone.city.kingdom.capital != t.zone.city && t.zone.city.useInspire();
};
e.action_spite = function(t, e) {
void 0 === t && (t = null);
void 0 === e && (e = null);
t.zone.city && y.default.inst.kingdoms.diplomacyManager.eventSpite(t.zone.city.kingdom);
};
e.action_friendship = function(t, e) {
void 0 === t && (t = null);
void 0 === e && (e = null);
t.zone.city && y.default.inst.kingdoms.diplomacyManager.eventFriendship(t.zone.city.kingdom);
};
e.action_spawn_building = function(t, e) {
void 0 === t && (t = null);
void 0 === e && (e = null);
var i = g.default.drops.get(e), o = i.constructionTemplate.split(",");
y.default.inst.addBuilding(o.getRandom(), t, null, !0) ? i.constructionTemplateSound && h.default.play(i.constructionTemplateSound) : y.default.inst.stackEffects.get("fx_bad_place").spawnAt(t, .25);
};
e.action_fruitBush = function(t, e) {
void 0 === t && (t = null);
void 0 === e && (e = null);
y.default.inst.tryGrowPlant(t, !1, !0, !1, "fruit_bush");
};
e.action_landmine = function(t, e) {
void 0 === t && (t = null);
void 0 === e && (e = null);
t.type.lava ? y.default.inst.explosionLayer.explodeBomb(t) : y.default.inst.terraformTile2(t, f.TileType.get("landmine"), g.default.terraform.get("remove"));
};
e.action_livingHouse = function(t, i) {
void 0 === t && (t = null);
void 0 === i && (i = null);
e._tempList.clear();
e._tempList.addRange(Array.from(t.zone.buildings));
e._tempList.addRange(Array.from(t.zone.ruins));
e._tempList.addRange(Array.from(t.zone.abandoned));
e._tempList.forEach(function(t) {
var e, i;
if (!t.isRuin() && !(null === (e = t.data) || void 0 === e ? void 0 : e.underConstruction) && (null === (i = t.stats) || void 0 === i ? void 0 : i.canBeLivingHouse)) {
var o = y.default.inst.createNewUnit("livingHouse", t.currentTile);
o.spriteRenderer.spriteFrame = t.spriteRenderer.spriteFrame;
t.destroyBuilding();
o.startColorEffect("white");
}
});
};
e.action_livingPlants = function(t, i) {
void 0 === t && (t = null);
void 0 === i && (i = null);
e.checkListForLivingPlants(t.zone.food, t);
e.checkListForLivingPlants(t.zone.trees, t);
e.checkListForLivingPlants(t.zone.wheat, t);
};
e.checkListForLivingPlants = function(t) {
e._tempList.clear();
e._tempList.addRange(Array.from(t));
e._tempList.forEach(function(t) {
var e, i, o;
if ((null === (e = t.data) || void 0 === e ? void 0 : e.alive) && (null === (i = t.stats) || void 0 === i ? void 0 : i.canBeLivingPlant) && !t.chopped && !t.isRuin() && !(null === (o = t.data) || void 0 === o ? void 0 : o.underConstruction)) {
var a = y.default.inst.createNewUnit("livingPlants", t.currentTile);
a.spriteRenderer.spriteFrame = t.spriteRenderer.spriteFrame;
t.destroyBuilding();
a.startColorEffect("white");
}
});
};
e.prototype.clone = function(t, e) {
var i = JSON.parse(JSON.stringify(this.get(e))), o = n.default.fromJson(i, new b());
o.id = t;
this.add(o);
return o;
};
e._tempList = [];
return e;
}(_.default);
i.default = T;
cc._RF.pop();
}, {
"../../../../../framework/lib/prototype/MathUtils": void 0,
"../../../../../framework/utils/Tools": void 0,
"../../../../common/src/data/AchievData": void 0,
"../../MapBox": "MapBox",
"../../actors/ActionLibrary": "ActionLibrary",
"../../actors/ActorStatus": "ActorStatus",
"../../building/Wheat": "Wheat",
"../../common/ToolBox": "ToolBox",
"../../game/audio/GameAudio": "GameAudio",
"../../map/map/MapLayer": "MapLayer",
"../../map/tile/TileType": "TileType",
"../../map/tile/TileTypeShortcut": "TileTypeShortcut",
"../AssetLibrary": "AssetLibrary",
"../AssetManager": "AssetManager",
"./ResourceLibrary": "ResourceLibrary"
} ],
Drop: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "8d5c8XExDVDBoRRd4Kl889t", "Drop");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
}), r = this && this.__decorate || function(t, e, i, o) {
var a, r = arguments.length, n = r < 3 ? e : null === o ? o = Object.getOwnPropertyDescriptor(e, i) : o;
if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) n = Reflect.decorate(t, e, i, o); else for (var s = t.length - 1; s >= 0; s--) (a = t[s]) && (n = (r < 3 ? a(n) : r > 3 ? a(e, i, n) : a(e, i)) || n);
return r > 3 && n && Object.defineProperty(e, i, n), n;
};
Object.defineProperty(i, "__esModule", {
value: !0
});
var n = t("../../../../../framework/lib/prototype/MathUtils"), s = t("../../animation/SpriteAnimation"), l = t("../../base/BaseMapObject"), c = t("../../common/ToolBox"), u = t("../../game/audio/GameAudio"), d = t("../../MapBox"), h = t("../../texture/TextureLoader"), p = cc._decorator, f = p.ccclass, m = (p.property, 
function(t) {
a(e, t);
function e() {
var e = null !== t && t.apply(this, arguments) || this;
e.drop_index = 0;
e.active = !1;
e.controller = null;
e.rnd = null;
e.animation = null;
e.forceVector = cc.Vec3.ZERO;
e.initHeight = 0;
e.forcedTileType = null;
e.asset = null;
e.soundOn = !1;
e.createGround = !1;
e.bounce = !1;
e.burst = !1;
e.falling_speed = 0;
e.prevPos = cc.Vec3.ZERO;
return e;
}
e.prototype.onLoad = function() {
this.rnd = this.getComponent(cc.Sprite);
this.animation = this.getComponent(s.SpriteAnimation);
};
e.prototype.launch = function(t, e, i) {
var o;
void 0 === i && (i = -1);
this.created || this.create();
this.soundOn && e.sound_launch && u.default.play(e.sound_launch);
this.soundOn = !1;
this.asset = e;
(null === (o = this.asset) || void 0 === o ? void 0 : o.action_launch) && this.asset.action_launch(null, null);
this.falling_speed = this.asset.fallingSpeed + c.Toolbox.randomFloat(0, this.asset.fallingSpeedRandom);
null != this.asset.spriteList && 0 != this.asset.spriteList.length || (this.asset.spriteList = Array.from(h.TextureLoader.inst.getSpriteFrames(h.ATLAS_TYPE.WORLDATLAS, this.asset.texture).values()));
this.animation.setFrames(this.asset.spriteList);
if (this.asset.animated) {
this.animation.isOn = !0;
this.animation.timeBetweenFrames = this.asset.animation_speed + c.Toolbox.randomFloat(0, this.asset.animation_speed_random);
} else this.animation.isOn = !1;
this.asset.random_frame && this.animation.setRandomFrame();
this.animation.forceUpdateFrame();
this.forceVector.set(cc.v3(0, 0, 0));
this.currentTile = t;
this.zPosition.z = -1 != i ? i : c.Toolbox.randomInt(e.fallingHeight.x, e.fallingHeight.y);
this.currentPosition = cc.v3(t.posV3.x, t.posV3.y, 0);
this.updatePosition();
};
e.prototype.updateFall = function(t) {
var e = 50 * t;
e = this.node.scaleX < 1 ? e * (this.falling_speed / (2 * this.node.scaleX)) : e * this.falling_speed;
this.zPosition.z < 0 && (e = 0);
this.zPosition.z -= e * this.node.scaleX;
e > 0 && this.asset.fallingRandomXMove && Math.random() > .5 && (Math.random() > .5 ? this.currentPosition.x -= 1 * this.node.scaleX : this.currentPosition.x += 1 * this.node.scaleX);
this.updatePosition();
if (this.zPosition.z <= 0 || this.zPosition.z <= 0 && this.forceVector.z <= 0) {
this.zPosition.z = 0;
0 == this.forceVector.z ? this.currentTile = d.default.inst.getTile(n.default.intCast(this.currentPosition.x), n.default.intCast(this.currentPosition.y)) : this.currentTile = d.default.inst.getTile(n.default.intCast(this.node.position.x), n.default.intCast(this.node.position.y));
if (this.currentTile && !this.currentTile.type.liquid && this.bounce) if (Math.abs(this.forceVector.z) > .1) {
this.forceVector.z = .5 * (0 - this.forceVector.z);
this.forceVector.x *= .7;
this.forceVector.y *= .7;
this.initHeight *= .7;
this.forceVector.z = this.initHeight;
} else this.land(); else this.land();
}
};
e.prototype.land = function() {
var t, e;
(null === (t = this.asset) || void 0 === t ? void 0 : t.action_landed) && this.currentTile && this.asset.action_landed(this.currentTile, this.asset.id);
(null === (e = this.asset) || void 0 === e ? void 0 : e.sound_drop) && !this.burst && u.default.play(this.asset.sound_drop);
this.controller.landPixel(this);
};
e.prototype.updateForce = function(t) {
if (0 != this.forceVector.x || 0 != this.forceVector.y || 0 != this.forceVector.z) {
var e = 40 * t, i = this.forceVector.z * e;
0 != this.forceVector.x && (this.currentPosition.x += this.forceVector.x * e);
0 != this.forceVector.y && (this.currentPosition.y += this.forceVector.y * e);
this.zPosition.z += i;
this.forceVector.z -= 5 * t;
}
};
e.prototype.logicUpdate = function() {
var e = cc.director.getDeltaTime();
t.prototype.logicUpdate.call(this, e);
this.animation.logicUpdate(e);
e *= .3;
this.updateForce(e);
this.updateFall(e);
this.updatePosition();
};
e.prototype.updatePosition = function() {
this.node.position = cc.v3(this.currentPosition.x, this.currentPosition.y + this.zPosition.z, 0);
};
e.prototype.addForce = function(t, e, i) {
this.forceVector.x = .6 * t;
this.forceVector.y = .6 * e;
this.forceVector.z = 2 * i;
this.initHeight = this.forceVector.z;
};
e.prototype.findCurrentTile = function() {
var t = Math.floor(this.node.x), e = Math.floor(this.node.y);
t >= d.default.width && (t = d.default.width - 1);
e >= d.default.height && (e = d.default.height - 1);
t < 0 && (t = 0);
e < 0 && (e = 0);
this.currentTile = d.default.inst.getTile(t, e);
};
return r([ f ], e);
}(l.default));
i.default = m;
cc._RF.pop();
}, {
"../../../../../framework/lib/prototype/MathUtils": void 0,
"../../MapBox": "MapBox",
"../../animation/SpriteAnimation": "SpriteAnimation",
"../../base/BaseMapObject": "BaseMapObject",
"../../common/ToolBox": "ToolBox",
"../../game/audio/GameAudio": "GameAudio",
"../../texture/TextureLoader": "TextureLoader"
} ],
Earthquake: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "50982XtJTJFMp3e/pHq4+9R", "Earthquake");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
}), r = this && this.__decorate || function(t, e, i, o) {
var a, r = arguments.length, n = r < 3 ? e : null === o ? o = Object.getOwnPropertyDescriptor(e, i) : o;
if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) n = Reflect.decorate(t, e, i, o); else for (var s = t.length - 1; s >= 0; s--) (a = t[s]) && (n = (r < 3 ? a(n) : r > 3 ? a(e, i, n) : a(e, i)) || n);
return r > 3 && n && Object.defineProperty(e, i, n), n;
};
Object.defineProperty(i, "__esModule", {
value: !0
});
i.EarthquakeType = void 0;
var n, s = t("../assetLibrary/AssetManager"), l = t("../common/ToolBox"), c = t("../game/audio/GameAudio"), u = t("../MapBox");
(function(t) {
t[t.RandomPower = 0] = "RandomPower";
t[t.BigIncrease = 1] = "BigIncrease";
t[t.BigDecrease = 2] = "BigDecrease";
t[t.SmallDisaster = 3] = "SmallDisaster";
})(n = i.EarthquakeType || (i.EarthquakeType = {}));
var d = cc._decorator, h = d.ccclass, p = (d.property, function(t) {
a(e, t);
function e() {
var e = null !== t && t.apply(this, arguments) || this;
e.currentPrint = null;
e.printTick = 0;
e.printTileOrigin = null;
e.timer = 0;
e.interval = .05;
e.quakeActive = !1;
e.type = n.BigDecrease;
e.currentPrintIndex = 0;
return e;
}
e.prototype.startQuake = function(t, e) {
void 0 === e && (e = n.RandomPower);
if (!this.quakeActive) {
c.default.playEarthquake();
this.type = e;
this.quakeActive = !0;
this.currentPrintIndex++;
if (this.currentPrintIndex >= u.default.inst.printLibrary.listQuakes.length) {
u.default.inst.printLibrary.listQuakes.shuffle();
this.currentPrintIndex = 0;
}
this.currentPrint = u.default.inst.printLibrary.listQuakes[this.currentPrintIndex];
this.printTileOrigin = t;
this.printTick = 0;
e == n.RandomPower && (l.Toolbox.randomChance(.5) ? this.type = n.BigDecrease : this.type = n.BigIncrease);
}
};
e.prototype.update = function() {
if (this.quakeActive) if (this.timer > 0) this.timer -= u.default.inst.elapsed; else {
this.timer = this.interval;
for (var t = 0; t < 300; t++) {
if (this.printTick >= this.currentPrint.steps.length) {
this.endQuake();
break;
}
var e = this.currentPrint.steps[this.printTick];
this.printTick++;
var i = u.default.inst.getTile(this.printTileOrigin.pos.x + e.x, this.printTileOrigin.pos.y + e.y);
if (i) {
this.tileAction(i);
if (this.printTick >= this.currentPrint.steps.length) {
this.endQuake();
break;
}
}
}
u.default.inst.startShake();
}
};
e.prototype.tileAction = function(t) {
switch (this.type) {
case n.BigDecrease:
t.type.decreaseTo && u.default.inst.terraformTile2(t, t.type.decreaseTo, s.default.terraform.get("earthquake"));
break;

case n.BigIncrease:
t.type.increaseTo && u.default.inst.terraformTile2(t, t.type.increaseTo, s.default.terraform.get("earthquake"));
break;

case n.SmallDisaster:
u.default.inst.terraformTile2(t, t.type, s.default.terraform.get("earthquakeDisaster"));
}
};
e.prototype.endQuake = function() {
this.quakeActive = !1;
};
return r([ h ], e);
}(cc.Component));
i.default = p;
cc._RF.pop();
}, {
"../MapBox": "MapBox",
"../assetLibrary/AssetManager": "AssetManager",
"../common/ToolBox": "ToolBox",
"../game/audio/GameAudio": "GameAudio"
} ],
EffectDivineLight: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "9e6a9z6n5FGdZM1a35/4CWd", "EffectDivineLight");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
}), r = this && this.__decorate || function(t, e, i, o) {
var a, r = arguments.length, n = r < 3 ? e : null === o ? o = Object.getOwnPropertyDescriptor(e, i) : o;
if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) n = Reflect.decorate(t, e, i, o); else for (var s = t.length - 1; s >= 0; s--) (a = t[s]) && (n = (r < 3 ? a(n) : r > 3 ? a(e, i, n) : a(e, i)) || n);
return r > 3 && n && Object.defineProperty(e, i, n), n;
};
Object.defineProperty(i, "__esModule", {
value: !0
});
i.DivineLightState = void 0;
var n, s = t("../animation/SpriteAnimation"), l = t("../base/BaseAnimatedObject"), c = t("../MapBox");
(function(t) {
t[t.SpawnFirstStage = 0] = "SpawnFirstStage";
t[t.SpawnSecondStage = 1] = "SpawnSecondStage";
t[t.Idle = 2] = "Idle";
t[t.Hide = 3] = "Hide";
})(n = i.DivineLightState || (i.DivineLightState = {}));
var u = cc._decorator, d = u.ccclass, h = u.property, p = function(t) {
a(e, t);
function e() {
var e = null !== t && t.apply(this, arguments) || this;
e.raySpawn = null;
e.rayIdle = null;
e.baseSpawn = null;
e.baseIdle = null;
e.isOn = !1;
e.state = n.Idle;
return e;
}
e.prototype.onLoad = function() {
this.setState(n.SpawnFirstStage);
};
e.prototype.setState = function(t) {
this.state = t;
switch (this.state) {
case n.SpawnFirstStage:
this.raySpawn.node.active = !0;
this.rayIdle.node.active = !1;
this.baseSpawn.node.active = !1;
this.baseIdle.node.active = !1;
break;

case n.SpawnSecondStage:
this.raySpawn.node.active = !1;
this.rayIdle.node.active = !0;
this.baseSpawn.node.active = !0;
this.baseIdle.node.active = !1;
break;

case n.Idle:
this.raySpawn.node.active = !1;
this.rayIdle.node.active = !0;
this.baseSpawn.node.active = !1;
this.baseIdle.node.active = !0;
break;

case n.Hide:
this.raySpawn.node.active = !0;
this.rayIdle.node.active = !1;
this.baseSpawn.node.active = !0;
this.baseIdle.node.active = !1;
}
};
e.prototype.stopEffet = function() {};
e.prototype.useEffect = function() {};
e.prototype.update = function() {
if (this.isOn) {
this.raySpawn.playType = s.AnimPlayType.Forward;
this.baseSpawn.playType = s.AnimPlayType.Forward;
if (this.raySpawn.isLastFrame()) {
this.raySpawn.node.active = !1;
this.rayIdle.node.active = !0;
} else {
this.raySpawn.node.active = !0;
this.rayIdle.node.active = !1;
}
if (this.baseSpawn.isLastFrame()) {
this.baseSpawn.node.active = !1;
this.baseIdle.node.active = !0;
} else {
this.baseSpawn.node.active = !0;
this.baseIdle.node.active = !1;
}
} else {
this.raySpawn.playType = s.AnimPlayType.Backward;
this.baseSpawn.playType = s.AnimPlayType.Backward;
this.rayIdle.node.active = !1;
this.baseIdle.node.active = !1;
this.raySpawn.isFirstFrame() ? this.raySpawn.node.active = !1 : this.raySpawn.node.active = !0;
this.baseSpawn.isFirstFrame() ? this.baseSpawn.node.active = !1 : this.baseSpawn.node.active = !0;
}
this.baseSpawn.node.active && this.baseSpawn.logicUpdate(c.default.inst.elapsed);
this.baseIdle.node.active && this.baseIdle.logicUpdate(c.default.inst.elapsed);
this.raySpawn.node.active && this.raySpawn.logicUpdate(c.default.inst.elapsed);
this.rayIdle.node.active && this.rayIdle.logicUpdate(c.default.inst.elapsed);
this.isOn = !1;
};
e.prototype.playOn = function(t) {
this.node.position = t.posV3;
this.isOn = !0;
};
r([ h({
type: s.SpriteAnimation
}) ], e.prototype, "raySpawn", void 0);
r([ h({
type: s.SpriteAnimation
}) ], e.prototype, "rayIdle", void 0);
r([ h({
type: s.SpriteAnimation
}) ], e.prototype, "baseSpawn", void 0);
r([ h({
type: s.SpriteAnimation
}) ], e.prototype, "baseIdle", void 0);
r([ h ], e.prototype, "isOn", void 0);
return r([ d ], e);
}(l.default);
i.default = p;
cc._RF.pop();
}, {
"../MapBox": "MapBox",
"../animation/SpriteAnimation": "SpriteAnimation",
"../base/BaseAnimatedObject": "BaseAnimatedObject"
} ],
EffectInfinityCoin: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "bb82aScsvxN/oo4RqG+o3gG", "EffectInfinityCoin");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
}), r = this && this.__decorate || function(t, e, i, o) {
var a, r = arguments.length, n = r < 3 ? e : null === o ? o = Object.getOwnPropertyDescriptor(e, i) : o;
if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) n = Reflect.decorate(t, e, i, o); else for (var s = t.length - 1; s >= 0; s--) (a = t[s]) && (n = (r < 3 ? a(n) : r > 3 ? a(e, i, n) : a(e, i)) || n);
return r > 3 && n && Object.defineProperty(e, i, n), n;
}, n = this && this.__values || function(t) {
var e = "function" == typeof Symbol && Symbol.iterator, i = e && t[e], o = 0;
if (i) return i.call(t);
if (t && "number" == typeof t.length) return {
next: function() {
t && o >= t.length && (t = void 0);
return {
value: t && t[o++],
done: !t
};
}
};
throw new TypeError(e ? "Object is not iterable." : "Symbol.iterator is not defined.");
};
Object.defineProperty(i, "__esModule", {
value: !0
});
var s = t("../../../common/src/text/LocalizedTextManager"), l = t("../actors/ActorStatus"), c = t("../base/BaseEffect"), u = t("../MapBox"), d = t("../ui/tip/WorldTip"), h = cc._decorator, p = h.ccclass, f = (h.property, 
function(t) {
a(e, t);
function e() {
var e = null !== t && t.apply(this, arguments) || this;
e.used = !1;
return e;
}
i = e;
e.prototype.create = function() {
t.prototype.create.call(this);
};
e.prototype.prepare = function(e, i) {
void 0 === i && (i = 1);
t.prototype.prepare.call(this, e, i);
this.used = !1;
u.default.inst.startShake(.1, .02, 3);
};
e.prototype.logicUpdate = function(e) {
t.prototype.logicUpdate.call(this, e);
if (this.spriteAnimation.currentFrameIndex >= 32 && !this.used) {
u.default.inst.startShake(.2, .01, 3, !1);
this.used = !0;
var i = this.node.position;
i.y += 2;
var o = u.default.inst.stackEffects.get("boulderImpact").spawnAt(i, this.node.scaleX);
if (o) {
o.autoYZ = !1;
(i = this.node.position).z = this.node.z - 10;
o.node.position = i;
}
u.default.inst.stackEffects.get("explosionWave").spawnNew().startFlash(i, 5);
this.doAction();
}
};
e.prototype.doAction = function() {
var t, e, o, a = 0, r = 0;
u.default.inst.units.list.forEach(function(t) {
var e;
(null === (e = t.data) || void 0 === e ? void 0 : e.alive) && !t.stats.ignoredByInfinityCoin && a++;
});
r = a % 2 != 0 ? a / 2 + 1 : a / 2;
u.default.inst.citiesList.forEach(function(t) {
t.killHalfPopPoints();
});
i.temp_list.clear();
i.temp_list.addRange(u.default.inst.units.list);
i.temp_list.shuffle();
var c = 0;
try {
for (var h = n(i.temp_list), p = h.next(); !p.done; p = h.next()) {
var f = p.value;
if (0 == r) break;
if ((null === (o = f.data) || void 0 === o ? void 0 : o.alive) && !f.stats.ignoredByInfinityCoin) {
c++;
r--;
f.getHit(1e3 * f.data.health + 1, !0, l.AttackType.Other, null, !1);
}
}
} catch (e) {
t = {
error: e
};
} finally {
try {
p && !p.done && (e = h.return) && e.call(h);
} finally {
if (t) throw t.error;
}
}
d.default.inst.show(s.LocalizedTextManager.getText("Infinity Coin Used") + " " + c, !1, "top");
};
var i;
e.temp_list = [];
return i = r([ p ], e);
}(c.default));
i.default = f;
cc._RF.pop();
}, {
"../../../common/src/text/LocalizedTextManager": void 0,
"../MapBox": "MapBox",
"../actors/ActorStatus": "ActorStatus",
"../base/BaseEffect": "BaseEffect",
"../ui/tip/WorldTip": "WorldTip"
} ],
Egg: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "9a8e4ekryxC+6D04CtPF4Qc", "Egg");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
}), r = this && this.__decorate || function(t, e, i, o) {
var a, r = arguments.length, n = r < 3 ? e : null === o ? o = Object.getOwnPropertyDescriptor(e, i) : o;
if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) n = Reflect.decorate(t, e, i, o); else for (var s = t.length - 1; s >= 0; s--) (a = t[s]) && (n = (r < 3 ? a(n) : r > 3 ? a(e, i, n) : a(e, i)) || n);
return r > 3 && n && Object.defineProperty(e, i, n), n;
};
Object.defineProperty(i, "__esModule", {
value: !0
});
var n = t("../../base/BaseActorComponent"), s = t("../../MapBox"), l = t("../ActorStatus"), c = cc._decorator, u = c.ccclass, d = (c.property, 
function(t) {
a(e, t);
function e() {
var e = null !== t && t.apply(this, arguments) || this;
e.timerEgg = 0;
return e;
}
e.prototype.create = function() {
t.prototype.create.call(this);
this.timerEgg = 100;
};
e.prototype.logicUpdate = function(e) {
t.prototype.logicUpdate.call(this, e);
this.timerEgg -= e;
if (this.timerEgg <= 0) {
var i = s.default.inst.createNewUnit(this.actor.stats.growIntoID, this.actor.currentTile, null, 2);
i.data.firstName = this.actor.data.firstName;
i.data.favorite = this.actor.data.favorite;
i.justBorn();
i.data.hunger = i.stats.maxHunger / 2;
s.default.inst.gameStats.creaturesBorn++;
this.actor.killHimself(!0, l.AttackType.None, !1);
}
};
return r([ u ], e);
}(n.default));
i.default = d;
cc._RF.pop();
}, {
"../../MapBox": "MapBox",
"../../base/BaseActorComponent": "BaseActorComponent",
"../ActorStatus": "ActorStatus"
} ],
ExplosionFlash: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "f9d3c0HrqxC1Zq2JYLZIt9t", "ExplosionFlash");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
}), r = this && this.__decorate || function(t, e, i, o) {
var a, r = arguments.length, n = r < 3 ? e : null === o ? o = Object.getOwnPropertyDescriptor(e, i) : o;
if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) n = Reflect.decorate(t, e, i, o); else for (var s = t.length - 1; s >= 0; s--) (a = t[s]) && (n = (r < 3 ? a(n) : r > 3 ? a(e, i, n) : a(e, i)) || n);
return r > 3 && n && Object.defineProperty(e, i, n), n;
};
Object.defineProperty(i, "__esModule", {
value: !0
});
var n = t("../base/BaseEffect"), s = t("../MapBox"), l = cc._decorator, c = l.ccclass, u = (l.property, 
function(t) {
a(e, t);
function e() {
var e = null !== t && t.apply(this, arguments) || this;
e.speed = 0;
return e;
}
e.prototype.startFlash = function(t, e, i) {
void 0 === i && (i = 1);
var o = t instanceof cc.Vec3 ? t : t.posV3;
this.speed = i;
this.node.position = o;
this.setScale(.1);
this.setAlpha(255);
};
e.prototype.logicUpdate = function() {
this.setAlpha(this.alpha - s.default.inst.elapsed * this.speed * 127.5);
this.setScale(this.scale += s.default.inst.elapsed * this.speed * .1);
this.alpha <= 0 && this.kill();
};
return r([ c ], e);
}(n.default));
i.default = u;
cc._RF.pop();
}, {
"../MapBox": "MapBox",
"../base/BaseEffect": "BaseEffect"
} ],
ExplosionsEffects: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "1b9c5NqiNZO8pPQPYwMHKen", "ExplosionsEffects");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
}), r = this && this.__decorate || function(t, e, i, o) {
var a, r = arguments.length, n = r < 3 ? e : null === o ? o = Object.getOwnPropertyDescriptor(e, i) : o;
if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) n = Reflect.decorate(t, e, i, o); else for (var s = t.length - 1; s >= 0; s--) (a = t[s]) && (n = (r < 3 ? a(n) : r > 3 ? a(e, i, n) : a(e, i)) || n);
return r > 3 && n && Object.defineProperty(e, i, n), n;
}, n = this && this.__values || function(t) {
var e = "function" == typeof Symbol && Symbol.iterator, i = e && t[e], o = 0;
if (i) return i.call(t);
if (t && "number" == typeof t.length) return {
next: function() {
t && o >= t.length && (t = void 0);
return {
value: t && t[o++],
done: !t
};
}
};
throw new TypeError(e ? "Object is not iterable." : "Symbol.iterator is not defined.");
};
Object.defineProperty(i, "__esModule", {
value: !0
});
var s = t("../../../../framework/lib/prototype/MathUtils"), l = t("../../../common/src/GameCommon"), c = t("../actors/ActorStatus"), u = t("../assetLibrary/AssetManager"), d = t("../common/ToolBox"), h = t("../game/audio/GameAudio"), p = t("../map/map/MapLayer"), f = t("../map/tile/TileDictionary"), m = t("../map/tile/TileType"), y = t("../MapBox"), _ = cc._decorator, g = _.ccclass, v = _.property, b = function(t) {
a(e, t);
function e() {
var e = null !== t && t.apply(this, arguments) || this;
e.explosionDict = new Map();
e.explosionDictCurrent = new Map();
e.explosionQueue = [];
e.explosionQueueCurrent = [];
e.timerExplosionQueue = 0;
e.interval = .01;
e.nextWave = [];
e.bombDict = new f.TileDictionary();
e.delayedBombs = [];
e.timedBombs = [];
e.tilesToRemove = [];
return e;
}
e.prototype.create = function() {
this.colorValues = cc.Color.WHITE;
this.colors_amount = 60;
t.prototype.create.call(this);
};
e.prototype.clear = function() {
this.explosionQueue.clear();
this.explosionQueueCurrent.clear();
this.explosionDict.clear();
this.explosionDictCurrent.clear();
this.tileDictionary.clear();
this.timedBombs.clear();
t.prototype.clear.call(this);
};
e.prototype.activateDelayedBomb = function(t) {
if (!this.delayedBombs.includes(t)) {
this.delayedBombs.push(t);
t.delayedBombType = t._type.name;
t.delayedTimerBomb = .09;
}
};
e.prototype.addTimedTnt = function(t) {
if (!this.timedBombs.includes(t)) {
t.delayedTimerBomb = 5;
this.timedBombs.push(t);
}
};
e.prototype.explodeBomb = function(t, e) {
var i = this;
void 0 === e && (e = !1);
if (!this.bombDict.contains(t)) if (!t.type.explodableDelayed || e) {
y.default.inst.startShake();
t.units.forEach(function(t) {
t.getHit(100, !0, c.AttackType.Bomb);
});
this.nextWave.clear();
this.nextWave.add(t);
for (var o = function() {
var t = a.nextWave.shift();
a.bombDict.add(t);
if (t.type.explodable && !t.type.explodableDelayed) {
t.explosionWave = t.type.explodeRange;
t.explosionPower = t.type.explodeRange;
}
if (t.explosionWave <= 0) return "continue";
t.neighbours.forEach(function(e) {
if (e.explosionWave > 0 && i.bombDict.contains(e)) e.explosionWave < t.explosionWave && e.type.explodable; else {
i.bombDict.add(e);
e.explosionWave = t.explosionWave - 1;
e.explosionPower = t.explosionPower;
i.nextWave.push(e);
}
});
}, a = this; this.nextWave.length > 0; ) o();
y.default.inst.pixelLimit = 0;
this.bombDict.dict.size < 20 ? h.default.playExplosionSmall() : h.default.playExplosionMedium();
this.bombDict.dict.forEach(function(e, i) {
y.default.inst.explodeTile(i, 10 * (i.explosionPower - i.explosionWave), 10 * i.explosionPower, t, u.default.terraform.get("bomb"));
});
} else this.activateDelayedBomb(t);
};
e.prototype.prepareNewExplosion = function(t) {
if (!this.explosionDict.has(t)) {
this.explosionQueue.push(t);
this.explosionDict.set(t, t.type);
}
};
e.prototype.updateExplosionQueue = function() {
var t = this;
if (this.timerExplosionQueue > 0) this.timerExplosionQueue -= y.default.inst.elapsed; else {
this.timerExplosionQueue = .1;
if (0 != this.explosionQueue.length) {
this.explosionQueue.forEach(function(e) {
t.explosionQueueCurrent.push(e);
t.explosionDictCurrent.set(e, t.explosionDict.get(e));
});
this.explosionQueue.clear();
this.explosionDict.clear();
this.explosionQueueCurrent.forEach(function(e) {
y.default.inst.damageWorld(e, t.explosionDictCurrent.get(e).explodeRange, u.default.terraform.get("bomb"));
h.default.playExplosionMedium(e.posV3);
});
this.explosionQueueCurrent.clear();
this.explosionDictCurrent.clear();
}
}
};
e.prototype.logicUpdate = function(t) {
var e, i, o, a;
this.checkAutoDisable();
this.updateDirty(t);
if (!(this.timedBombs.length <= 0 || l.default.isPaused)) {
var r = [];
try {
for (var s = n(this.timedBombs), c = s.next(); !c.done; c = s.next()) (f = c.value).delayedTimerBomb > 0 ? f.delayedTimerBomb -= t : r.push(f);
} catch (t) {
e = {
error: t
};
} finally {
try {
c && !c.done && (i = s.return) && i.call(s);
} finally {
if (e) throw e.error;
}
}
try {
for (var d = n(r), p = d.next(); !p.done; p = d.next()) {
var f = p.value;
this.timedBombs.remove(f);
if (f.type.explodableTimed) {
y.default.inst.damageWorld(f, f.type.explodeRange, u.default.terraform.get("bomb"));
h.default.playExplosionMedium(f.posV3);
}
}
} catch (t) {
o = {
error: t
};
} finally {
try {
p && !p.done && (a = d.return) && a.call(d);
} finally {
if (o) throw o.error;
}
}
}
};
e.prototype.updateDirty = function() {
var t, e, i, o, a = this;
if (this.delayedBombs.length > 0) {
var r = [];
try {
for (var s = n(this.delayedBombs), l = s.next(); !l.done; l = s.next()) (f = l.value).delayedTimerBomb > 0 ? f.delayedTimerBomb -= y.default.inst.elapsed : r.push(f);
} catch (e) {
t = {
error: e
};
} finally {
try {
l && !l.done && (e = s.return) && e.call(s);
} finally {
if (t) throw t.error;
}
}
try {
for (var c = n(r), p = c.next(); !p.done; p = c.next()) {
var f;
(f = p.value).delayedTimerBomb = -100;
this.delayedBombs.remove(f);
var _ = f.delayedBombType ? m.TileType.get(f.delayedBombType) : m.TileType.get("tnt_timed");
y.default.inst.damageWorld(f, _.explodeRange, u.default.terraform.get("bomb"));
h.default.playExplosionMedium(f.posV3);
}
} catch (t) {
i = {
error: t
};
} finally {
try {
p && !p.done && (o = c.return) && o.call(c);
} finally {
if (i) throw i.error;
}
}
}
if (this.bombDict.length() > 0) {
this.bombDict.dict.forEach(function(t, e) {
e.explosionWave = 0;
e.explosionPower = 0;
});
this.bombDict.clear();
}
if (this.timer > 0) this.timer -= y.default.inst.elapsed; else {
this.timer = this.interval;
if (0 != this.tileDictionary.length()) {
this.tilesToRemove.clear();
this.tileDictionary.dict.forEach(function(t, e) {
if (e.explosionFxStage > 0) {
Math.random() > .5 ? a.updateSinglePixel(e.data.tile_id, d.Toolbox.clear) : a.updateSinglePixel(e.data.tile_id, a.colors[e.explosionFxStage - 1]);
e.explosionFxStage--;
if (e.explosionFxStage <= 0) {
e.explosionFxStage = 0;
a.tilesToRemove.push(e);
}
}
});
this.tilesToRemove.length > 0 && this.tilesToRemove.forEach(function(t) {
a.tileDictionary.remove(t);
});
this.updatePixels();
}
}
};
e.prototype.setDirty = function(t, e, i) {
var o = s.default.intCast(60 * (1 - e / i));
if (0 != o && o >= t.explosionFxStage) {
this.tileDictionary.add(t);
t.explosionFxStage = o;
}
};
r([ v ], e.prototype, "interval", void 0);
return r([ g ], e);
}(p.default);
i.default = b;
cc._RF.pop();
}, {
"../../../../framework/lib/prototype/MathUtils": void 0,
"../../../common/src/GameCommon": void 0,
"../MapBox": "MapBox",
"../actors/ActorStatus": "ActorStatus",
"../assetLibrary/AssetManager": "AssetManager",
"../common/ToolBox": "ToolBox",
"../game/audio/GameAudio": "GameAudio",
"../map/map/MapLayer": "MapLayer",
"../map/tile/TileDictionary": "TileDictionary",
"../map/tile/TileType": "TileType"
} ],
FavoriteElement: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "55a9dV2euxDR7e9X4HWksAK", "FavoriteElement");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
}), r = this && this.__decorate || function(t, e, i, o) {
var a, r = arguments.length, n = r < 3 ? e : null === o ? o = Object.getOwnPropertyDescriptor(e, i) : o;
if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) n = Reflect.decorate(t, e, i, o); else for (var s = t.length - 1; s >= 0; s--) (a = t[s]) && (n = (r < 3 ? a(n) : r > 3 ? a(e, i, n) : a(e, i)) || n);
return r > 3 && n && Object.defineProperty(e, i, n), n;
};
Object.defineProperty(i, "__esModule", {
value: !0
});
var n = t("../../animation/UnitAvatarLoader"), s = t("../../common/ViewController"), l = t("../../Config"), c = t("../log/WorldLog"), u = cc._decorator, d = u.ccclass, h = u.property, p = function(t) {
a(e, t);
function e() {
var e = null !== t && t.apply(this, arguments) || this;
e.actor = null;
e.unitName = null;
e.avatarLoader = null;
e.text_health = null;
e.text_damage = null;
e.text_level = null;
e.text_kills = null;
return e;
}
e.prototype.initItem = function(t) {
this.actor = t;
this.unitName.string = t.data.firstName;
this.avatarLoader.load(t);
this.text_health.string = t.data.health + "/" + t.curStats.health;
this.text_damage.string = "" + t.curStats.damage;
this.text_level.string = "" + t.data.level;
this.text_kills.string = "" + t.data.kills;
};
e.prototype.clickLocate = function() {
c.default.locationFollow(this.actor);
};
e.prototype.clickInspect = function() {
l.default.selectedUnit = this.actor;
l.default.selectedUnit && s.default.open(s.view_type.CreatureInfo);
};
r([ h(cc.Label) ], e.prototype, "unitName", void 0);
r([ h(n.default) ], e.prototype, "avatarLoader", void 0);
r([ h(cc.Label) ], e.prototype, "text_health", void 0);
r([ h(cc.Label) ], e.prototype, "text_damage", void 0);
r([ h(cc.Label) ], e.prototype, "text_level", void 0);
r([ h(cc.Label) ], e.prototype, "text_kills", void 0);
return r([ d ], e);
}(cc.Component);
i.default = p;
cc._RF.pop();
}, {
"../../Config": "Config",
"../../animation/UnitAvatarLoader": "UnitAvatarLoader",
"../../common/ViewController": "ViewController",
"../log/WorldLog": "WorldLog"
} ],
FavoritesWindow: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "36b8bnQ++xFO6jPTQ088KBc", "FavoritesWindow");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
}), r = this && this.__decorate || function(t, e, i, o) {
var a, r = arguments.length, n = r < 3 ? e : null === o ? o = Object.getOwnPropertyDescriptor(e, i) : o;
if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) n = Reflect.decorate(t, e, i, o); else for (var s = t.length - 1; s >= 0; s--) (a = t[s]) && (n = (r < 3 ? a(n) : r > 3 ? a(e, i, n) : a(e, i)) || n);
return r > 3 && n && Object.defineProperty(e, i, n), n;
};
Object.defineProperty(i, "__esModule", {
value: !0
});
var n = t("../../../../common/src/GamePopBase"), s = t("../../MapBox"), l = t("./FavoriteElement"), c = cc._decorator, u = c.ccclass, d = c.property, h = function(t) {
a(e, t);
function e() {
var e = null !== t && t.apply(this, arguments) || this;
e.elementPrefab = null;
e.content = null;
return e;
}
e.prototype.open = function() {
t.prototype.open.call(this);
this.showList();
};
e.prototype.showList = function() {
var t = this;
s.default.inst.units.list.forEach(function(e) {
var i, o;
(null === (i = e.data) || void 0 === i ? void 0 : i.alive) && (null === (o = e.data) || void 0 === o ? void 0 : o.favorite) && t.showElement(e);
});
};
e.prototype.showElement = function(t) {
var e = cc.instantiate(this.elementPrefab);
e.parent = this.content;
e.getComponent(l.default).initItem(t);
};
r([ d(cc.Prefab) ], e.prototype, "elementPrefab", void 0);
r([ d(cc.Node) ], e.prototype, "content", void 0);
return r([ u ], e);
}(n.GamePopBase);
i.default = h;
cc._RF.pop();
}, {
"../../../../common/src/GamePopBase": void 0,
"../../MapBox": "MapBox",
"./FavoriteElement": "FavoriteElement"
} ],
FireLayer: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "414eemTr2BLJIULq3y1WQtg", "FireLayer");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
}), r = this && this.__decorate || function(t, e, i, o) {
var a, r = arguments.length, n = r < 3 ? e : null === o ? o = Object.getOwnPropertyDescriptor(e, i) : o;
if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) n = Reflect.decorate(t, e, i, o); else for (var s = t.length - 1; s >= 0; s--) (a = t[s]) && (n = (r < 3 ? a(n) : r > 3 ? a(e, i, n) : a(e, i)) || n);
return r > 3 && n && Object.defineProperty(e, i, n), n;
};
Object.defineProperty(i, "__esModule", {
value: !0
});
var n = t("../../MapBox"), s = t("../map/MapLayer"), l = cc._decorator, c = l.ccclass, u = l.property, d = function(t) {
a(e, t);
function e() {
var e = null !== t && t.apply(this, arguments) || this;
e.fire_color = cc.Color.TRANSPARENT;
e.worldBehaviour = null;
return e;
}
e.prototype.onLoad = function() {
this.colorValues = this.fire_color;
this.colors_amount = 30;
this.colors.reverse();
this.enabled = !0;
t.prototype.create.call(this);
};
e.prototype.setTileDirty = function(t) {
this.pixels_to_update.contains(t) || this.pixels_to_update.add(t);
};
e.prototype.checkAutoDisable = function() {
this.worldBehaviour || (this.worldBehaviour = n.default.inst.behavioursDict.get("fire"));
this.worldBehaviour.tileDictionary.count() > 0 ? this.sprRnd.enabled || (this.sprRnd.enabled = !0) : this.sprRnd.enabled && (this.sprRnd.enabled = !1);
};
e.prototype.updateDirty = function() {
var t = this;
if (!(this.pixels_to_update.length() <= 0)) {
this.pixels_to_update.dict.forEach(function(e, i) {
var o = i.data.fire_stage;
i.data.fire || (o = t.colors.length - 1);
t.updateSinglePixel(i.data.tile_id, t.colors[o]);
});
this.pixels_to_update.clear();
this.updatePixels();
}
};
r([ u(cc.Color) ], e.prototype, "fire_color", void 0);
return r([ c ], e);
}(s.default);
i.default = d;
cc._RF.pop();
}, {
"../../MapBox": "MapBox",
"../map/MapLayer": "MapLayer"
} ],
GMView: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "5b0be1TuQJGJoA01nUj5V0w", "GMView");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
}), r = this && this.__decorate || function(t, e, i, o) {
var a, r = arguments.length, n = r < 3 ? e : null === o ? o = Object.getOwnPropertyDescriptor(e, i) : o;
if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) n = Reflect.decorate(t, e, i, o); else for (var s = t.length - 1; s >= 0; s--) (a = t[s]) && (n = (r < 3 ? a(n) : r > 3 ? a(e, i, n) : a(e, i)) || n);
return r > 3 && n && Object.defineProperty(e, i, n), n;
};
Object.defineProperty(i, "__esModule", {
value: !0
});
var n = t("../../../../../framework/utils/SaveUtils"), s = t("../../../../common/src/GamePopBase"), l = t("../../DebugConfig"), c = cc._decorator, u = c.ccclass, d = c.property, h = function(t) {
a(e, t);
function e() {
var e = null !== t && t.apply(this, arguments) || this;
e.prop_infinite = null;
e.unCkeck_Address = null;
e.UnitPathfinding = null;
return e;
}
e.prototype.start = function() {
this.prop_infinite.isChecked = l.default.Prop_infinite;
this.unCkeck_Address.isChecked = l.default.UnCkeck_Address;
this.UnitPathfinding.isChecked = l.default.UnitPathfinding;
};
e.prototype.clearCache = function() {
n.default.clear();
};
e.prototype.lateUpdate = function() {
l.default.Prop_infinite = this.prop_infinite.isChecked;
l.default.UnCkeck_Address = this.unCkeck_Address.isChecked;
l.default.UnitPathfinding = this.UnitPathfinding.isChecked;
};
r([ d(cc.Toggle) ], e.prototype, "prop_infinite", void 0);
r([ d(cc.Toggle) ], e.prototype, "unCkeck_Address", void 0);
r([ d(cc.Toggle) ], e.prototype, "UnitPathfinding", void 0);
return r([ u ], e);
}(s.GamePopBase);
i.default = h;
cc._RF.pop();
}, {
"../../../../../framework/utils/SaveUtils": void 0,
"../../../../common/src/GamePopBase": void 0,
"../../DebugConfig": "DebugConfig"
} ],
GameAudio: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "e2c2fDuRt9A2bLBBe+q+Eud", "GameAudio");
Object.defineProperty(i, "__esModule", {
value: !0
});
var o = t("../../../../../framework/manager/AudioMgr"), a = t("../../common/MoveCamera"), r = t("../../common/ToolBox"), n = t("../../MapBox"), s = "res/audio/", l = !0, c = {}, u = {
spawn_tree: "playSpawnTree",
spawn_stone: "playSpawnStone",
spawn_iron: "playSpawnIron",
spawn_gold: "playSpawnGold",
spawn_bush: "playSpawnBush",
spawn_ore_deposit: "playSpawnOreDeposit",
tornado: "playTornado",
"sheep spawn": "playSheepSpawn",
spawnWolf: "playSpawnWolf",
spawnBear: "playSpawnBear",
spawnPiranha: "playSpawnPiranha",
spawnWorm: "playSpawnWorm",
spawnAnt: "playSpawnAnt",
spawnSanta: "playSpawnSanta",
spawnGodFinger: "playSpawnGodFinger",
spawnUFO: "playSpawnUFO",
spawnDragon: "playSpawnDragon",
spawnHuman: "playSpawnHuman",
spawnOrc: "playSpawnOrc",
spawnElf: "playSpawnElf",
spawnDwarf: "playSpawnDwarf",
spawnColdOne: "playSpawnColdOne",
spawnDemon: "playSpawnDemon",
spawnBandit: "playSpawnBandit",
spawnZombie: "playSpawnZombie",
spawnVolcano: "playVolcano",
spawnTumor: "playSpawnTumor",
fallingSand: "playFallingSand",
fallingFire: "playFallingFire",
fallingWater: "playFallingWater",
"bomb fall": "playBombFall",
"explosion small": "playExplosionSmall",
"explosion medium": "playExplosionMedium",
"explosion big": "playExplosionBig",
acid: "playAcid",
lava: "playLava",
snow: "playSnow",
sheep: "playSheep",
penguin: "playPenguin",
turtle: "playTurtle",
crab: "playCrab",
wolf: "playWolf",
gold: "playSpawnGold",
geyser: "playGeyser",
geyserAcid: "playGeyserAcid",
ore_deposit: "playSpawnOreDeposit"
}, d = function() {
function t() {}
t.allowPlayback = function(t) {
t = t.clone().subSelf(cc.v3(n.default.width / 2, n.default.height / 2));
var e = a.MoveCamera.inst.camera.node.position;
return r.Toolbox.distVec3(t, e) <= 20 && cc.audioEngine.getEffectsVolume() >= .2;
};
t.playBGM = function() {
setTimeout(function() {
l ? o.default.playBgMusic(s + "Lighthearted Loop", !1).then(function(e) {
cc.audioEngine.setFinishCallback(e, function() {
t.playBGM();
});
}) : l = !0;
}, 4e4);
};
t.stopBGM = function() {
l = !1;
o.default.stopMusic();
};
t.playClick = function() {
t.doPlay("res/audio/sfx_click", .001);
};
t.play = function(e) {
u[e] && t[u[e]] && t[u[e]]();
};
t.playVortex = function() {
var e = s + [ "sfx_vortex", "vortex8" ].getRandom();
t.doPlay(e, .1);
};
t.playForce = function() {
t.doPlay("res/audio/sfx_force", .05);
};
t.playSpawn = function() {
t.doPlay("res/audio/sfx_vortex", .1);
};
t.playSpawnTumor = function() {
var e = r.Toolbox.randomInt(1, 6), i = s + "Tumor_Spawn0" + e;
t.doPlay(i, .2);
};
t.playTemperatureU = function() {
t.doPlay("res/audio/sfx_temperature_up", .15);
};
t.playTemperatureD = function() {
t.doPlay("res/audio/sfx_temperature_down", .15);
};
t.playVolcano = function() {
t.doPlay("res/audio/sfx_spawn_volcano", 0);
};
t.playGeyser = function() {
t.doPlay("res/audio/sfx_spawn_geyser", 0);
};
t.playGeyserAcid = function() {
t.doPlay("res/audio/geyserAcid", 0);
};
t.playHeatray = function() {
t.doPlay("res/audio/sfx_temperature_up", .1);
};
t.playConway = function() {
t.doPlay("res/audio/sfx_conway", .1);
};
t.playGoo1 = function() {
t.doPlay("res/audio/sfx_goo", .15);
};
t.playLightning = function() {
t.doPlay("res/audio/sfx_lightning", 0);
};
t.playExplosionSmall = function() {
t.doPlay("res/audio/sfx_explosion_small", .1);
};
t.playExplosionBig = function() {
t.doPlay("res/audio/sfx_explosion_big", .1);
};
t.playExplosionMedium = function(e) {
void 0 === e && (e = cc.Vec3.ZERO);
(t.allowPlayback(e) || e.equals(cc.Vec3.ZERO)) && t.doPlay("res/audio/sfx_explosion_medium", .1);
};
t.playExplosionHuge = function() {
t.doPlay("res/audio/sfx_explosion_huge", .22);
};
t.playTornado = function() {
var e = s + [ "sfx_tornado1", "sfx_tornado2", "sfx_tornado3" ].getRandom();
t.doPlay(e, .2);
};
t.playConstructing = function(e) {
var i = s + [ "sfx_constructing1", "sfx_constructing2", "sfx_constructing3", "sfx_constructing4" ].getRandom();
t.allowPlayback(e) && t.doPlay(i, 6);
};
t.playPunch = function(e) {
var i = s + [ "sfx_punch_1", "sfx_punch2" ].getRandom();
t.allowPlayback(e) && t.doPlay(i, .1);
};
t.playWilhelmscream = function() {
t.doPlay("res/audio/sfx_wilhelm_scream", .1);
};
t.playHammer1 = function(e) {
t.allowPlayback(e) && t.doPlay("res/audio/sfx_constructing3", 1);
};
t.playDragonAttack = function(e) {
var i = s + [ "sfx_dragon_firebreath01", "sfx_dragon_firebreath02" ].getRandom();
t.allowPlayback(e) && t.doPlay(i, .1);
};
t.playDragonSwoop = function(e) {
var i = s + [ "sfx_dragon_swoop01", "sfx_dragon_swoop02" ].getRandom();
t.allowPlayback(e) && t.doPlay(i, .1);
};
t.playFallingFire = function() {
t.doPlay("res/audio/sfx_fallingFire", .1);
};
t.playBombFall = function() {
t.doPlay("res/audio/sfx_bomb_fall", .3);
};
t.playFallingSand = function() {
t.doPlay("res/audio/sfx_falling_sand", .1);
};
t.playLava = function() {
t.doPlay("res/audio/lava", .09);
};
t.playFallingWater = function() {
t.doPlay("res/audio/sfx_fallingWater", .08);
};
t.playFireworks = function() {
var e = r.Toolbox.randomInt(1, 4), i = s + "fireworks0" + e;
t.doPlay(i, .3);
};
t.playAcid = function() {
t.doPlay("res/audio/sfx_fallingWater", .1);
};
t.playPrint1 = function(e) {
t.allowPlayback(e) && t.doPlay("res/audio/sfx_print", .1);
};
t.playAntimatterBomb = function() {
t.doPlay("res/audio/sfx_antimatter_bomb", .22);
};
t.playEarthquake = function() {
t.doPlay("res/audio/sfx_earthquake", 0);
};
t.playMeteoriteFall = function() {
t.doPlay("res/audio/sfx_meteorite_fall", .1);
};
t.playExplosionMeteorite = function() {
t.doPlay("res/audio/sfx_explosion_meteorite", .05);
};
t.playBuildingDestroyed = function(e) {
var i = r.Toolbox.randomInt(1, 4), o = s + "Building_Destroyed0" + i;
t.allowPlayback(e) && t.doPlay(o, .1);
};
t.playChopping = function(e) {
var i = r.Toolbox.randomInt(1, 4), o = s + "chop0" + i;
t.allowPlayback(e) && t.doPlay(o, .1);
};
t.playMining = function(e) {
var i = r.Toolbox.randomInt(1, 4), o = s + "mining0" + i;
t.allowPlayback(e) && t.doPlay(o, .1);
};
t.playBowlingBall = function(e) {
t.allowPlayback(e) && t.doPlay("res/audio/bowling_ball01", .1);
};
t.playUfoAttack = function(e) {
t.allowPlayback(e) && t.doPlay("res/audio/ufo_attack", .1);
};
t.playWolf = function() {
t.doPlay("res/audio/sfx_wolf", 20);
};
t.playSnow = function() {};
t.playCow = function() {};
t.playPenguin = function() {};
t.playTurtle = function() {};
t.playCrab = function() {};
t.playSheep = function() {
var e = s + [ "sfx_animal_sheep_baa", "sfx_animals_sheep_bleat_001" ].getRandom();
t.doPlay(e, 15);
};
t.playOrk = function() {
t.doPlay("res/audio/ork", .1);
};
t.playOuch = function() {
t.doPlay("res/audio/ouch", .1);
};
t.playOwww = function() {
t.doPlay("res/audio/owww", .1);
};
t.playCloudRain = function() {
t.doPlay("res/audio/cloud_rain", .1);
};
t.playCloudAcid = function() {
t.doPlay("res/audio/cloud_acid", .1);
};
t.playCloudLava = function() {
t.doPlay("res/audio/cloud_lava", .1);
};
t.playTreeFall = function(e) {
var i = r.Toolbox.randomInt(1, 4), o = s + "Tree_Fall0" + i;
t.allowPlayback(e) && t.doPlay(o, .1);
};
t.playSpawnTree = function() {
var e = r.Toolbox.randomInt(1, 4), i = s + "seed0" + e;
t.doPlay(i, .1);
};
t.playSpawnStone = function() {
t.doPlay("res/audio/spawn_stone01", .1);
};
t.playSpawnIron = function() {
t.doPlay("res/audio/spawn_iron01", .1);
};
t.playSpawnGold = function() {
t.doPlay("res/audio/spawn_gold01", .1);
};
t.playSpawnBush = function() {
t.doPlay("res/audio/spawn_bush01", .1);
};
t.playSpawnOreDeposit = function() {
t.doPlay("res/audio/spawn_ore_deposit01", .1);
};
t.playSheepSpawn = function() {
var e = s + [ "sfx_animal_sheep_baa", "sfx_animals_sheep_bleat_001" ].getRandom();
t.doPlay(e, .7);
};
t.playSpawnWolf = function() {
var e = r.Toolbox.randomInt(1, 3), i = s + "Wolf_Spawn_Growl0" + e;
t.doPlay(i, .2);
};
t.playSpawnBear = function() {
var e = r.Toolbox.randomInt(1, 3), i = s + "Bear_Spawn0" + e;
t.doPlay(i, .2);
};
t.playSpawnPiranha = function() {
t.doPlay("res/audio/Pirhana_Spawn01", .2);
};
t.playSpawnWorm = function() {
var e = r.Toolbox.randomInt(1, 3), i = s + "Worm_Spawn0" + e;
t.doPlay(i, .2);
};
t.playSpawnAnt = function() {
var e = r.Toolbox.randomInt(1, 3), i = s + "Insect_Spawn0" + e;
t.doPlay(i, .2);
};
t.playSpawnSanta = function() {
t.doPlay("res/audio/Santa_Spawn_Rev01", .5);
};
t.playSpawnGodFinger = function() {
t.doPlay("res/audio/God_Finger_Spawn01", .2);
};
t.playSpawnDragon = function() {
var e = s + [ "sfx_dragon_spawn01", "swf_dragon_spawn02", "sfx_spawn_dragon03" ].getRandom();
t.doPlay(e, .2);
};
t.playSpawnUFO = function() {
t.doPlay("res/audio/UFO_Spawn01", .1);
};
t.playSpawnHuman = function() {
var e = r.Toolbox.randomInt(1, 6), i = s + "Human_Spawn_3rdRev0" + e;
t.doPlay(i, .1);
};
t.playSpawnOrc = function() {
var e = r.Toolbox.randomInt(1, 6), i = s + "Orc_Spawn0" + e;
t.doPlay(i, .1);
};
t.playSpawnElf = function() {
var e = r.Toolbox.randomInt(1, 6), i = s + "Elf_Spawn0" + e;
t.doPlay(i, .1);
};
t.playSpawnDwarf = function() {
var e = r.Toolbox.randomInt(1, 6), i = s + "Dwarf_Spawn0" + e;
t.doPlay(i, .1);
};
t.playSpawnColdOne = function() {
var e = r.Toolbox.randomInt(1, 3), i = s + "ColdOnes_Spawn0" + e;
t.doPlay(i, .2);
};
t.playSpawnDemon = function() {
var e = r.Toolbox.randomInt(1, 3), i = s + "Demon_Spawn0" + e;
t.doPlay(i, .2);
};
t.playSpawnBandit = function() {
var e = r.Toolbox.randomInt(1, 5), i = s + "bandit0" + e;
t.doPlay(i, .1);
};
t.playSpawnZombie = function() {
var e = r.Toolbox.randomInt(1, 6), i = s + "Zombie_Spawn0" + e;
t.doPlay(i, .2);
};
t.doPlay = function(t, e) {
if (!c[t]) {
c[t] = !0;
o.default.playEffect(t);
setTimeout(function() {
c[t] = !1;
}, 1e3 * e);
}
};
return t;
}();
i.default = d;
cc._RF.pop();
}, {
"../../../../../framework/manager/AudioMgr": void 0,
"../../MapBox": "MapBox",
"../../common/MoveCamera": "MoveCamera",
"../../common/ToolBox": "ToolBox"
} ],
GameUtils: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "02fc6kPpKtIsLSMSNfyrqho", "GameUtils");
Object.defineProperty(i, "__esModule", {
value: !0
});
var o = t("../../../../framework/utils/UiUtil"), a = t("../../../common/src/GameCommon"), r = t("../ui/UiController"), n = function() {
function t() {}
t.prototype.allowPopUi = function() {
return !a.default.isPaused && o.UiUtil.allowOpenModule() && !r.default.inst.isDoRecord;
};
t.inst = new t();
return t;
}();
i.default = n.inst;
cc._RF.pop();
}, {
"../../../../framework/utils/UiUtil": void 0,
"../../../common/src/GameCommon": void 0,
"../ui/UiController": "UiController"
} ],
GeneratorTool: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "41c4dPY8vBMirObe2f+jDG3", "GeneratorTool");
var o = this && this.__awaiter || function(t, e, i, o) {
return new (i || (i = Promise))(function(a, r) {
function n(t) {
try {
l(o.next(t));
} catch (t) {
r(t);
}
}
function s(t) {
try {
l(o.throw(t));
} catch (t) {
r(t);
}
}
function l(t) {
t.done ? a(t.value) : (e = t.value, e instanceof i ? e : new i(function(t) {
t(e);
})).then(n, s);
var e;
}
l((o = o.apply(t, e || [])).next());
});
}, a = this && this.__generator || function(t, e) {
var i, o, a, r, n = {
label: 0,
sent: function() {
if (1 & a[0]) throw a[1];
return a[1];
},
trys: [],
ops: []
};
return r = {
next: s(0),
throw: s(1),
return: s(2)
}, "function" == typeof Symbol && (r[Symbol.iterator] = function() {
return this;
}), r;
function s(t) {
return function(e) {
return l([ t, e ]);
};
}
function l(r) {
if (i) throw new TypeError("Generator is already executing.");
for (;n; ) try {
if (i = 1, o && (a = 2 & r[0] ? o.return : r[0] ? o.throw || ((a = o.return) && a.call(o), 
0) : o.next) && !(a = a.call(o, r[1])).done) return a;
(o = 0, a) && (r = [ 2 & r[0], a.value ]);
switch (r[0]) {
case 0:
case 1:
a = r;
break;

case 4:
n.label++;
return {
value: r[1],
done: !1
};

case 5:
n.label++;
o = r[1];
r = [ 0 ];
continue;

case 7:
r = n.ops.pop();
n.trys.pop();
continue;

default:
if (!(a = n.trys, a = a.length > 0 && a[a.length - 1]) && (6 === r[0] || 2 === r[0])) {
n = 0;
continue;
}
if (3 === r[0] && (!a || r[1] > a[0] && r[1] < a[3])) {
n.label = r[1];
break;
}
if (6 === r[0] && n.label < a[1]) {
n.label = a[1];
a = r;
break;
}
if (a && n.label < a[2]) {
n.label = a[2];
n.ops.push(r);
break;
}
a[2] && n.ops.pop();
n.trys.pop();
continue;
}
r = e.call(t, n);
} catch (t) {
r = [ 6, t ];
o = 0;
} finally {
i = a = 0;
}
if (5 & r[0]) throw r[1];
return {
value: r[0] ? r[1] : void 0,
done: !0
};
}
};
Object.defineProperty(i, "__esModule", {
value: !0
});
i.GeneratorTool = i.GeneratorTarget = void 0;
var r, n = t("../../../../../framework/lib/Perlin"), s = t("../../../../../framework/lib/prototype/MathUtils"), l = t("../../common/ToolBox"), c = t("../../MapBox"), u = t("../../texture/TextureLoader"), d = t("../../texture/TextureRotator"), h = t("../../texture/TextureScale"), p = t("../tile/TileType"), f = t("../tile/WorldTile");
(function(t) {
t[t.Height = 0] = "Height";
t[t.Temperature = 1] = "Temperature";
})(r = i.GeneratorTarget || (i.GeneratorTarget = {}));
var m = function() {
function t() {}
t.init = function() {
t.loadGenShapeTextures();
};
t.applyRandomShape = function(e, i, o) {
void 0 === e && (e = 2);
void 0 === i && (i = .7);
void 0 === o && (o = !1);
var a = null, r = 0, n = 0;
if (t.randomTextures.length < t.maxRandomTextureCount) {
a = l.Toolbox.getRandom(t.textures).clone();
t.randomTextures.push(a);
r = s.default.intCast(a.width * l.Toolbox.randomRange(.3, 2));
n = s.default.intCast(a.height * l.Toolbox.randomRange(.3, 2));
a = d.TextureRotator.rotate(a, l.Toolbox.randomRange(0, 360));
h.TextureScale.bilinear(a, r, n);
} else a = l.Toolbox.getRandom(t.randomTextures);
r = a.width;
n = a.height;
var u = s.default.intCast(c.default.width / 2 - r / 2 - s.default.intCast(l.Toolbox.randomRange(-r * e, r * e))), p = s.default.intCast(c.default.height / 2 - n / 2 - s.default.intCast(l.Toolbox.randomRange(-n * e, n * e)));
u < 0 && (u = 0);
p < 0 && (p = 0);
u + r > c.default.width && (u = c.default.width - r);
p + n > c.default.height && (p = c.default.height - n);
for (var f = i, m = 0; m < a.width; m++) for (var y = 0; y < a.height; y++) {
var _ = c.default.inst.getTile(u + m, p + y);
if (_) {
var g = a.getPixel(m, y).a, v = s.default.intCast(g * f);
o && (v = -v);
_.Height += v;
}
}
};
t.loadGenShapeTextures = function() {
return o(this, void 0, void 0, function() {
return a(this, function() {
if (t.textures.length > 0) return [ 2 ];
t.textures = Array.from(u.TextureLoader.inst.getTextures(u.BIN_TYPE.gen_shapes).values());
return [ 2 ];
});
});
};
t.applyWaterLevel = function(t, e, i) {
for (var o = 0; o < t; o++) for (var a = 0; a < e; a++) c.default.inst.getTile(o, a).Height -= i;
};
t.applyPerlinNoice = function(t, e, i, o, a, s, l, u) {
void 0 === l && (l = !1);
void 0 === u && (u = r.Height);
var d = 255 * a, h = 1, p = 1;
t > e ? h = t / e : p = e / t;
for (var f = 0; f < t; f++) for (var m = 0; m < e; m++) {
var y = c.default.inst.getTile(f, m), _ = i + f / t * s * h, g = o + m / e * s * p, v = Math.floor(n.default.noiseNormalized(_, g) * d);
l && (v = -v);
u == r.Height && (y.Height += v);
}
};
t.generateTileNeighbours = function() {
c.default.inst.tilesList.forEach(function(t) {
var e = c.default.inst.getTile(t.x - 1, t.y);
t.addNeighbour(e, f.TileDirection.Left);
e = c.default.inst.getTile(t.x + 1, t.y);
t.addNeighbour(e, f.TileDirection.Right);
e = c.default.inst.getTile(t.x, t.y - 1);
t.addNeighbour(e, f.TileDirection.Down);
e = c.default.inst.getTile(t.x, t.y + 1);
t.addNeighbour(e, f.TileDirection.Up);
e = c.default.inst.getTile(t.x - 1, t.y - 1);
t.addNeighbour(e, f.TileDirection.Null, !0);
e = c.default.inst.getTile(t.x - 1, t.y + 1);
t.addNeighbour(e, f.TileDirection.Null, !0);
e = c.default.inst.getTile(t.x + 1, t.y - 1);
t.addNeighbour(e, f.TileDirection.Null, !0);
e = c.default.inst.getTile(t.x + 1, t.y + 1);
t.addNeighbour(e, f.TileDirection.Null, !0);
});
};
t.applyRingEffect = function() {
for (var t = 0; t < c.default.width; t++) for (var e = 0; e < c.default.height; e++) for (var i = 0; i < p.TileType.list.length; i++) {
var o = p.TileType.list[i];
if (0 != o.additional_height.length) {
for (var a = !1, r = 0; r < o.additional_height.length; r++) {
var n = c.default.inst.getTile(t, e);
if (n.Height == o.heightMin - o.additional_height[r]) {
n.Height = o.heightMin;
a = !0;
break;
}
}
if (a) break;
}
}
};
t.modifyIsland = function(t) {
var e = l.Toolbox.randomInt(0, 3);
if (0 == e && t.regions.length < 20) t.regions.forEach(function(t) {
t.tiles.forEach(function(t) {
t.type.rocks || t.setTileType("sand");
});
}); else {
if (1 != e) return;
t.regions.forEach(function(t) {
t.tiles.forEach(function(t) {
t.type.rocks && t.setTileType("forest");
});
});
}
};
t.textures = [];
t.randomTextures = [];
t.maxRandomTextureCount = 40;
return t;
}();
i.GeneratorTool = m;
cc._RF.pop();
}, {
"../../../../../framework/lib/Perlin": void 0,
"../../../../../framework/lib/prototype/MathUtils": void 0,
"../../MapBox": "MapBox",
"../../common/ToolBox": "ToolBox",
"../../texture/TextureLoader": "TextureLoader",
"../../texture/TextureRotator": "TextureRotator",
"../../texture/TextureScale": "TextureScale",
"../tile/TileType": "TileType",
"../tile/WorldTile": "WorldTile"
} ],
Globals: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "89fe0G4+m5MR77vk08fBq88", "Globals");
Object.defineProperty(i, "__esModule", {
value: !0
});
var o = function() {
function t() {}
t.CITY_TIMER_SUPPLY_DEFAULT = 30;
t.REGION_UPDATE_TIMEOUT = .5;
t.CITY_POP_FOR_SETTLE_TARGET = 30;
t.CITY_MAXIMUM_ZONES_PER_BUILDING = 3;
t.AI_TEST_ACTIVE = !0;
t.XMAS = !1;
t.DEFAULT_SCALE_UNIT = .1;
t.DEFAULT_SCALE_BUILDING = .25;
t.DIAGNOSTIC = !1;
t.DEBUG_CRAB = !1;
t.TRAILER_MODE = !1;
t.BUILDINGS_USE_RESOURCES = !0;
t.TRAILER_MODE_USE_RESOURCES = !0;
t.TRAILER_MODE_UPGRADE_BUILDINGS = !0;
t.TIPS_AMOUNT = 16;
t.TORNADO_TIMER = 35;
t.CAST_HEIGHT = 15;
t.UNITS_IN_SPAWNER_PER_REGION = 4;
t.PATHFINDER_REGION_LIMIT = 2;
t.ATTRIBUTE_BAD = 4;
t.ATTRIBUTE_NORMAL = 9;
t.ATTRIBUTE_GOOD = 20;
t.maxBushesInZone = 3;
t.maxTreesInZone = 3;
t.MIN_ADS_INTERVAL_MINUTES = 2;
t.ADS_INTERVAL_MINUTES = 5;
t.specialAbstudio = !1;
t.GREY_GOO_DAMAGE = 50;
t.DAMAGE_ACID = 250;
t.DAMAGE_HEAT = 50;
t.DAMAGE_BOULDER = 1e3;
t.CITIZEN_FOOD_COST = 1;
t.ZONES_BETWEEN_CITIES = 5;
t.CIV_ARMY_MAX = 65;
t.CIV_TIMEOUT_YEARS_FOR_DIPLOMACY = 22;
t.FOOD_FROM_FISH = 1;
t.FOOD_FROM_TILE = 1;
t.FOOD_FROM_FARM = 2;
t.ANIMAL_GOOD_FOR_HUNTING_AGE = 3;
t.BOAT_UNITS_LIMIT = 100;
t.TRANSPORT_WAIT_TRY_LIMIT = 4;
t.TIMER_HUNGER = 8;
t.HUNGRY = 50;
t.HUNGRY_UNIT = 10;
t.COLORS_ZONE_ALPHA = .78;
t.ISLAND_TILES_FOR_DOCKS = 2500;
t.FOOD_BUSH_REGROW_TIME = 90;
t.REWARD_MINUTES = 30;
t.DISCORD_MEMBERS = "200000";
t.TIMEOUT_CONQUER = 300;
t.POINT_IN_VOID = cc.v3(-1e6, -1e6);
t.NORMAL = "0";
t.RATE_US_ID = 9;
t.emptyVector = cc.v3(-1e5, -1e4);
return t;
}();
i.default = o;
cc._RF.pop();
}, {} ],
GlowParticles: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "4d460B8tx1IlLmU2pn8xhOs", "GlowParticles");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
}), r = this && this.__decorate || function(t, e, i, o) {
var a, r = arguments.length, n = r < 3 ? e : null === o ? o = Object.getOwnPropertyDescriptor(e, i) : o;
if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) n = Reflect.decorate(t, e, i, o); else for (var s = t.length - 1; s >= 0; s--) (a = t[s]) && (n = (r < 3 ? a(n) : r > 3 ? a(e, i, n) : a(e, i)) || n);
return r > 3 && n && Object.defineProperty(e, i, n), n;
};
Object.defineProperty(i, "__esModule", {
value: !0
});
i.GlowParticles = void 0;
var n = cc._decorator, s = n.ccclass, l = n.property, c = function(t) {
a(e, t);
function e() {
var e = null !== t && t.apply(this, arguments) || this;
e.particles = null;
return e;
}
e.prototype.start = function() {
this.particles || (this.particles = this.getComponent(cc.ParticleSystem));
};
e.prototype.spawn = function(t, e, i) {
void 0 === i && (i = !1);
if (this.enabled) {
i && (this.cooldown = 0);
if (this.cooldown > 0) {
this.cooldown--;
return;
}
this.cooldown = 3;
var o = cc.v2(t + .5, e + .5);
this.particles._simulator.emitParticle(o);
}
};
e.prototype.clear = function() {
this.particles && this.particles.stopSystem();
};
r([ l({
type: cc.ParticleSystem,
tooltip: "如果不填写，就使用当前节点的ParticleSystem组件"
}) ], e.prototype, "particles", void 0);
return r([ s ], e);
}(cc.Component);
i.GlowParticles = c;
cc._RF.pop();
}, {} ],
GodActions: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "f70e6rNLexBHqhjVTxQjLwY", "GodActions");
Object.defineProperty(i, "__esModule", {
value: !0
});
i.GodAction = void 0;
var o = function() {
this.name = "god_action";
this.value = -1;
this.icon = "";
this.hold_action = !0;
};
i.GodAction = o;
var a = function() {
function t() {}
t.init = function() {
t.list = [];
t.dict = new Map();
var e = new o();
e.name = "height";
t.add(e);
var i = new o();
i.name = "temperature";
t.add(i);
var a = new o();
a.name = "rainfall";
t.add(a);
var r = new o();
r.name = "small";
r.value = 3;
t.add(r);
var n = new o();
n.name = "normal";
n.value = 5;
t.add(n);
var s = new o();
s.name = "big";
s.value = 10;
t.add(s);
var l = new o();
l.name = "huge";
l.value = 65;
t.add(l);
var c = new o();
c.name = "draw";
t.add(c);
var u = new o();
u.name = "lightning";
u.hold_action = !1;
t.add(u);
var d = new o();
d.name = "city";
d.hold_action = !1;
t.add(d);
var h = new o();
h.name = "meteorite";
h.hold_action = !1;
t.add(h);
var p = new o();
p.name = "ant";
p.hold_action = !1;
t.add(p);
};
t.add = function(e) {
t.list.push(e);
t.dict.set(e.name, e);
};
t.list = [];
t.dict = new Map();
return t;
}();
i.default = a;
cc._RF.pop();
}, {} ],
GodFinger: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "ebfcdhBd/lG1Y3uVsIu3j1b", "GodFinger");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
}), r = this && this.__decorate || function(t, e, i, o) {
var a, r = arguments.length, n = r < 3 ? e : null === o ? o = Object.getOwnPropertyDescriptor(e, i) : o;
if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) n = Reflect.decorate(t, e, i, o); else for (var s = t.length - 1; s >= 0; s--) (a = t[s]) && (n = (r < 3 ? a(n) : r > 3 ? a(e, i, n) : a(e, i)) || n);
return r > 3 && n && Object.defineProperty(e, i, n), n;
};
Object.defineProperty(i, "__esModule", {
value: !0
});
var n = t("../../../../common/src/data/AchievData"), s = t("../../../../common/src/GameCommon"), l = t("../../animation/SpriteAnimation"), c = t("../../assetLibrary/AssetManager"), u = t("../../base/BaseActorComponent"), d = t("../../brush/Brush"), h = t("../../common/ToolBox"), p = t("../../MapBox"), f = t("../ActorStatus"), m = cc._decorator, y = m.ccclass, _ = (m.property, 
function(t) {
a(e, t);
function e() {
var e = null !== t && t.apply(this, arguments) || this;
e.wait = 0;
e.speedMod = 1;
e.target = cc.Vec3.ZERO;
e.startPos = cc.Vec3.ZERO;
e.randomDirection = cc.Vec3.ZERO;
e.rotateToward1 = cc.Vec3.ZERO;
e.rotateToward2 = cc.Vec3.ZERO;
e.rotateToward3 = cc.Vec3.ZERO;
e.angleDirection = cc.Vec3.ZERO;
e.godPower = null;
e.distanceToTarget = 0;
e.haveTarget = !1;
e.draw = !1;
e.angleHand = 0;
e.powers = [ "tileSand", "tileSoil", "tileForest", "tileHills", "tileMountains" ];
e.fingerTip = null;
return e;
}
e.prototype.create = function() {
t.prototype.create.call(this);
this.godPower = c.default.powers.get(h.Toolbox.getRandom(this.powers));
this.fingerTip = this.node.getChildByName("Tip").getComponent(l.SpriteAnimation);
};
e.prototype.newMove = function() {
this.haveTarget = !0;
this.target = h.Toolbox.getRandom(p.default.inst.tilesList).posV3;
this.rotateToward1 = h.Toolbox.getRandom(p.default.inst.tilesList).posV3;
this.rotateToward2 = h.Toolbox.getRandom(p.default.inst.tilesList).posV3;
this.rotateToward3 = h.Toolbox.getRandom(p.default.inst.tilesList).posV3;
this.randomDirection.x = h.Toolbox.randomFloat(-20, 20);
this.randomDirection.y = h.Toolbox.randomFloat(-20, 20);
this.startPos = this.actor.currentPosition;
this.distanceToTarget = 0;
this.speedMod = h.Toolbox.randomFloat(.1, .4);
this.draw = h.Toolbox.randomBool();
this.draw || (this.speedMod = h.Toolbox.randomFloat(.2, .6));
this.angleDirection.set(cc.Vec3.ZERO);
};
e.prototype.lightAction = function() {
n.default.update(50);
};
e.prototype.logicUpdate = function(t) {
var e;
this.fingerTip.logicUpdate(t);
if (null === (e = this.actor.data) || void 0 === e ? void 0 : e.alive) {
if (s.default.isPaused) return;
if (this.draw) {
this.fingerTip.node.active = !0;
this.angleHand += 20 * t;
this.angleHand > 30 && (this.angleHand = 30);
} else {
this.fingerTip.node.active = !1;
this.angleHand -= 20 * t;
this.angleHand <= 0 && (this.angleHand = 0);
}
if (this.actor.zPosition.y > 0) {
this.haveTarget = !1;
this.distanceToTarget = 0;
this.draw = !1;
return;
}
this.node.eulerAngles = cc.v3(0, 0, this.angleHand);
if (this.wait > 0) {
this.wait -= t;
return;
}
this.haveTarget || this.newMove();
this.distanceToTarget += t * this.speedMod;
if (this.draw) {
this.rotateToward1 = h.Toolbox.moveTowards(this.rotateToward1, this.rotateToward2, 30 * t);
this.rotateToward2 = h.Toolbox.moveTowards(this.rotateToward2, this.rotateToward3, 30 * t);
this.rotateToward3 = h.Toolbox.moveTowards(this.rotateToward3, this.rotateToward1, 30 * t);
this.target = h.Toolbox.moveTowards(this.target, this.rotateToward1, 30 * t);
}
cc.Vec3.lerp(this.actor.currentPosition, this.startPos, this.target, this.distanceToTarget);
this.actor._positionDirty = !0;
this.actor._currentTileDirty = !0;
if (this.draw && this.actor.currentTile && !(this.actor.currentPosition.x > p.default.width) && !(this.actor.currentPosition.y > p.default.height) && !(this.actor.currentPosition.x < 0) && !(this.actor.currentPosition.y < 0)) {
p.default.inst.checkKillRange(this.actor.currentTile.pos, 2, f.AttackType.Other, this.godPower);
p.default.inst.conwayLayer.checkKillRange(this.actor.currentTile.pos, 2);
p.default.inst.drawWithBrush(this.actor.currentTile.pos, d.default.getBrushBySize(2), 1, "tile", this.godPower.tileType, this.godPower);
}
if (this.distanceToTarget >= .9) {
this.haveTarget = !1;
this.distanceToTarget = 0;
this.draw = !1;
h.Toolbox.randomChance(.4) && (this.wait = h.Toolbox.randomFloat(0, 4));
}
} else this.fingerTip.node.active = !1;
};
return r([ y ], e);
}(u.default));
i.default = _;
cc._RF.pop();
}, {
"../../../../common/src/GameCommon": void 0,
"../../../../common/src/data/AchievData": void 0,
"../../MapBox": "MapBox",
"../../animation/SpriteAnimation": "SpriteAnimation",
"../../assetLibrary/AssetManager": "AssetManager",
"../../base/BaseActorComponent": "BaseActorComponent",
"../../brush/Brush": "Brush",
"../../common/ToolBox": "ToolBox",
"../ActorStatus": "ActorStatus"
} ],
GodPower: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "c9f1crdLKRLNatcIF2FT/jj", "GodPower");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
});
Object.defineProperty(i, "__esModule", {
value: !0
});
i.PowerActionType = i.PowerRank = i.BrushSize = void 0;
var r, n, s = t("../../assetLibrary/AssetLibrary");
(function(t) {
t[t.Size0 = 0] = "Size0";
t[t.Size1 = 1] = "Size1";
t[t.Size2 = 2] = "Size2";
t[t.Size3 = 3] = "Size3";
t[t.Size4 = 4] = "Size4";
})(i.BrushSize || (i.BrushSize = {}));
(function(t) {
t[t.Rank0_free = 0] = "Rank0_free";
t[t.Rank1_common = 1] = "Rank1_common";
t[t.Rank2_normal = 2] = "Rank2_normal";
t[t.Rank3_good = 3] = "Rank3_good";
t[t.Rank4_awesome = 4] = "Rank4_awesome";
})(r = i.PowerRank || (i.PowerRank = {}));
(function(t) {
t[t.Special = 0] = "Special";
t[t.SpawnActor = 1] = "SpawnActor";
t[t.Tile = 2] = "Tile";
t[t.Drops = 3] = "Drops";
t[t.Draw = 4] = "Draw";
t[t.Printer = 5] = "Printer";
})(n = i.PowerActionType || (i.PowerActionType = {}));
var l = function(t) {
a(e, t);
function e() {
var e = null !== t && t.apply(this, arguments) || this;
e.name = "DEFAULT NAME";
e.requiresPremium = !1;
e.rank = r.Rank0_free;
e.spawnSound = "";
e.showToolSizes = !1;
e.unselectWhenWindow = !1;
e.removeLife = !1;
e.removeConway = !1;
e.removeTornado = !1;
e.destroyBuilding = !1;
e.removeBuilding = !1;
e.removeLava = !1;
e.showFullKingdomInfo = !1;
e.holdAction = !1;
e.flashPixel = !1;
e.clickInterval = 0;
e.particleInterval = 0;
e.applyForce = !1;
e.forceDamage = 0;
e.fallingPixel = !1;
e.fallingChance = .95;
e.tileType = "";
e.dropID = "";
e.amountPerClick = 1;
e.forceBrush = "";
e.drawLines = !1;
e.actionType = n.Tile;
e.highlight = !1;
e.toggle_name = "";
e.actorStatsId = "?";
e.actorSpawnHeight = 6;
e.showSpawnEffect = "";
e.printersPrint = "";
e.ignoreFastSpawn = !1;
e.tester_enabled = !0;
e.allow_unit_selection = !1;
return e;
}
e.addPower = function(t) {
e.godPowers.set(t.id, t);
};
e.get = function(t) {
return e.godPowers.get(t);
};
e.godPowers = new Map();
return e;
}(s.Asset);
i.default = l;
cc._RF.pop();
}, {
"../../assetLibrary/AssetLibrary": "AssetLibrary"
} ],
GreyGooLayer: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "b5b6915UqNMEZh6q6Q/EWaZ", "GreyGooLayer");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
}), r = this && this.__decorate || function(t, e, i, o) {
var a, r = arguments.length, n = r < 3 ? e : null === o ? o = Object.getOwnPropertyDescriptor(e, i) : o;
if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) n = Reflect.decorate(t, e, i, o); else for (var s = t.length - 1; s >= 0; s--) (a = t[s]) && (n = (r < 3 ? a(n) : r > 3 ? a(e, i, n) : a(e, i)) || n);
return r > 3 && n && Object.defineProperty(e, i, n), n;
};
Object.defineProperty(i, "__esModule", {
value: !0
});
var n = t("../../../../common/src/GameCommon"), s = t("../../assetLibrary/AssetManager"), l = t("../../base/BaseObjectData"), c = t("../../common/ToolBox"), u = t("../../game/audio/GameAudio"), d = t("../../MapBox"), h = t("../tile/TileDictionary"), p = t("../tile/TileType"), f = cc._decorator, m = f.ccclass, y = (f.property, 
function(t) {
a(e, t);
function e() {
var e = null !== t && t.apply(this, arguments) || this;
e.tilesToRemove = [];
e.tilesToAdd = [];
e.toRemove = [];
return e;
}
e.prototype.create = function() {
t.prototype.create.call(this);
this.tileDictionary = new h.TileDictionary();
};
e.prototype.checkKillRange = function(t, e) {
var i = this;
this.toRemove.clear();
this.tileDictionary.dict.forEach(function(o, a) {
c.Toolbox.distVec2(a.pos, t) <= e && i.toRemove.push(a);
});
this.toRemove.forEach(function(t) {
i.remove(t);
});
};
e.prototype.clear = function() {
t.prototype.clear.call(this);
this.tileDictionary.clear();
};
e.prototype.logicUpdate = function(e) {
var i = this;
t.prototype.logicUpdate.call(this, e);
if (0 != this.tileDictionary.length() && !n.default.isPaused) if (this.timer > 0) this.timer -= e; else {
this.timer = .04;
this.tilesToRemove.clear();
this.tilesToAdd.clear();
this.tileDictionary.dict.forEach(function(t, e) {
if (e.type.greyGoo) {
c.Toolbox.randomBool() && e.health--;
5 == e.health && i.checkAroundTiles(e);
if (e.health <= 0) {
e.building && e.building.startDestroyBuilding(!0);
if (c.Toolbox.randomBool()) {
i.terraform(e);
i.tilesToRemove.push(e);
}
}
} else i.tilesToRemove.push(e);
});
this.tilesToRemove.forEach(function(t) {
i.remove(t);
});
this.tilesToAdd.forEach(function(t) {
i.add(t);
});
}
};
e.prototype.checkAroundTiles = function(t) {
var e = this;
t.neighbours.forEach(function(t) {
if (!t.type.isType("pit_deep_ocean") && (!t.type.isType("deep_ocean") || t.building) && !t.type.greyGoo) {
e.makeGoo(t);
e.tilesToAdd.push(t);
}
});
};
e.prototype.makeGoo = function(t) {
d.default.inst.terraformTile2(t, p.TileType.get("grey_goo"), s.default.terraform.get("flash"));
};
e.prototype.terraform = function(t) {
d.default.inst.terraformTile2(t, p.TileType.get("pit_deep_ocean"), s.default.terraform.get("grey_goo"));
u.default.playGoo1();
};
e.prototype.remove = function(t) {
this.tileDictionary.remove(t);
};
e.prototype.add = function(t) {
if (!t.type.isType("pit_deep_ocean") && !t.type.isType("deep_ocean") && !this.tileDictionary.contains(t)) {
this.tileDictionary.add(t);
this.makeGoo(t);
}
};
return r([ m ], e);
}(l.BaseModule));
i.default = y;
cc._RF.pop();
}, {
"../../../../common/src/GameCommon": void 0,
"../../MapBox": "MapBox",
"../../assetLibrary/AssetManager": "AssetManager",
"../../base/BaseObjectData": "BaseObjectData",
"../../common/ToolBox": "ToolBox",
"../../game/audio/GameAudio": "GameAudio",
"../tile/TileDictionary": "TileDictionary",
"../tile/TileType": "TileType"
} ],
GuideController: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "13961XvkPlCYqejNwK6iL7k", "GuideController");
Object.defineProperty(i, "__esModule", {
value: !0
});
i.GUIDE_TYPE = void 0;
var o, a = t("../../../../../framework/main/Constants"), r = t("../../../../../start/src/ShuFenReport"), n = t("../../../../common/src/data/FestivityData"), s = t("../../../../common/src/GameCommon"), l = t("../../../../common/src/module/GuideView"), c = t("../../brush/BrushWindow"), u = t("../../common/MoveCamera"), d = t("../../save/SaveList"), h = t("../../save/SavePopup"), p = t("../../ui/UiController"), f = t("../achiev/AchievementView");
(function(t) {
t.none = "none";
t.novice = "novice";
t.save = "save";
t.cityInfo = "cityInfo";
t.mystery = "mystery";
t.luckyWheel = "luckyWheel";
t.general = "general";
t.online = "online";
t.timeScale = "timeScale";
t.achiev = "achiev";
})(o = i.GUIDE_TYPE || (i.GUIDE_TYPE = {}));
var m = function() {
function t() {
this._step = -1;
this._guiding = !1;
this._type = o.none;
this.doStep = !1;
}
Object.defineProperty(t.prototype, "step", {
get: function() {
return this._step;
},
enumerable: !1,
configurable: !0
});
Object.defineProperty(t.prototype, "isGuiding", {
get: function() {
return this._guiding;
},
enumerable: !1,
configurable: !0
});
t.prototype.initView = function(t) {
var e = cc.instantiate(t);
e.parent = a.default.GLOBAL_NODE;
var i = n.default.getCurrentFestivals(), o = i && 2 == i.id;
e.getComponent(l.default).init(o);
};
t.prototype.begin = function() {
this._guiding = !0;
p.default.inst.closeSelectTip();
p.default.inst.showBanner(!1);
p.default.inst.checkGuideViewHeight();
};
t.prototype.complete = function(t) {
var e = this;
void 0 === t && (t = !1);
l.default.inst.hide(function() {
e.doStep = !1;
e._guiding = !1;
e._type = o.none;
t && p.default.inst.showBanner(!BYTEDANCE_GAME);
});
};
t.prototype.do = function(t) {
if (!this.doStep) {
this.doStep = !0;
this._step++;
this._type = t;
var e = t + "Step" + this._step;
this[e] && this[e]();
}
};
t.prototype.isType = function(t) {
return t == this._type;
};
t.prototype.in = function(t, e) {
return t == this._type && e == this._step;
};
t.prototype.noviceStep0 = function() {
var t = this;
this.begin();
r.default.reportGuide("guide00", !0);
var e = WECHAT_GAME ? [ "欢迎来到沙盒世界盒子，\n这个世界的一切都将由你创造！" ] : [ "欢迎来到上帝模拟器2，\n这个世界的一切都将由你创造！" ];
l.default.inst.enabledTouch(!0);
l.default.inst.showTips(e, 0, null, function() {
t.doStep = !1;
r.default.reportGuide("guide00", !1);
t.do(o.novice);
});
};
t.prototype.noviceStep1 = function() {
var t = this;
r.default.reportGuide("guide01", !0);
l.default.inst.showTips([ "双指可以缩放地图大小，\n我们先放大地图看看。" ], 1, function() {
t.doStep = !1;
l.default.inst.showFingerZoom(!0);
l.default.inst.enabledTouch(!1);
});
};
t.prototype.noviceStep2 = function() {
var t = this;
r.default.reportGuide("guide01", !1);
r.default.reportGuide("guide02", !0);
l.default.inst.showFingerZoom(!1);
l.default.inst.showTips([ "没错就是这样！" ], 2, null, function() {
t.doStep = !1;
t.do(o.novice);
r.default.reportGuide("guide02", !1);
});
};
t.prototype.noviceStep3 = function() {
r.default.reportGuide("guide03", !0);
this.doStep = !1;
var t = p.default.inst.toggleContainer.children[2], e = t.parent.convertToWorldSpaceAR(t.position);
l.default.inst.showFinger(!0, e);
l.default.inst.showFrame(!0, e, t.getContentSize());
l.default.inst.showTips([ '尝试一下创造生物吧，\n点击下方的"人形"分类。' ], 3);
};
t.prototype.noviceStep4 = function() {
r.default.reportGuide("guide03", !1);
r.default.reportGuide("guide04", !0);
this.doStep = !1;
var t = cc.find("checkmark/scrollView/view/HLayout/GLayout0/btn3001", p.default.inst.toggleContainer.children[2]), e = t.parent.convertToWorldSpaceAR(t.position);
l.default.inst.showFinger(!0, e);
l.default.inst.showFrame(!0, e, t.getContentSize());
l.default.inst.showTips([ "选择人类。" ], 4);
};
t.prototype.noviceStep5 = function() {
var t = this;
r.default.reportGuide("guide04", !1);
r.default.reportGuide("guide05", !0);
l.default.inst.showFrame(!1);
l.default.inst.showFinger(!0, cc.v3(cc.winSize.width / 2, .6 * cc.winSize.height), !0);
l.default.inst.showTips([ "点击地图放置人类。" ], 5, function() {
l.default.inst.enabledTouch(!1);
t.doStep = !1;
});
};
t.prototype.noviceStep6 = function() {
var t = this;
r.default.reportGuide("guide05", !1);
r.default.reportGuide("guide06", !0);
l.default.inst.showTips([ "恭喜成功创造一个人类！\n我们来试试创造更多的人类吧！" ], 6, function() {
l.default.inst.enabledTouch(!1);
t.doStep = !1;
});
};
t.prototype.noviceStep7 = function() {
var t = this;
r.default.reportGuide("guide06", !1);
r.default.reportGuide("guide07", !0);
l.default.inst.showTips([ "再放多点，再多点！" ], 7, function() {
l.default.inst.enabledTouch(!1);
t.doStep = !1;
});
};
t.prototype.noviceStep8 = function() {
var t = this;
r.default.reportGuide("guide07", !1);
r.default.reportGuide("guide08", !0);
l.default.inst.showFinger(!1);
l.default.inst.showTips([ "干的漂亮！\n看，人们正在伐木盖房子！" ], 8, null, function() {
t.doStep = !1;
t.do(o.novice);
});
};
t.prototype.noviceStep9 = function() {
var t = this;
r.default.reportGuide("guide08", !1);
r.default.reportGuide("guide09", !0);
l.default.inst.showTips([ "我们再撒些种子，\n看看会发生什么！" ], 9, function() {
t.doStep = !1;
t.do(o.novice);
});
};
t.prototype.noviceStep10 = function() {
r.default.reportGuide("guide09", !1);
r.default.reportGuide("guide10", !0);
this.doStep = !1;
var t = p.default.inst.toggleContainer.children[4], e = t.parent.convertToWorldSpaceAR(t.position);
l.default.inst.showFinger(!0, e);
l.default.inst.showFrame(!0, e, t.getContentSize());
l.default.inst.showTips([ '点击"自然"分类。' ], 10);
};
t.prototype.noviceStep11 = function() {
r.default.reportGuide("guide10", !1);
r.default.reportGuide("guide11", !0);
this.doStep = !1;
var t = cc.find("checkmark/scrollView/view/HLayout/GLayout1/btn5010", p.default.inst.toggleContainer.children[4]), e = t.parent.convertToWorldSpaceAR(t.position);
l.default.inst.showFinger(!0, e);
l.default.inst.showFrame(!0, e, t.getContentSize());
l.default.inst.showTips([ "点击种子。" ], 11);
};
t.prototype.noviceStep12 = function() {
r.default.reportGuide("guide11", !1);
r.default.reportGuide("guide12", !0);
this.doStep = !1;
var t = p.default.inst.mainSizeButton, e = t.parent.convertToWorldSpaceAR(t.position);
l.default.inst.showFinger(!0, e);
l.default.inst.showFrame(!0, e, t.getContentSize());
l.default.inst.showTips([ "部分道具是通过花洒大量放置的，\n点击这里可以调整花洒大小。" ], 12);
};
t.prototype.noviceStep13 = function() {
r.default.reportGuide("guide12", !1);
r.default.reportGuide("guide13", !0);
this.doStep = !1;
var t = c.default.inst.guideNode, e = t.parent.convertToWorldSpaceAR(t.position);
l.default.inst.showFinger(!0, e);
l.default.inst.showFrame(!0, e, t.getContentSize());
l.default.inst.showTips([ "选择这个较大的花洒。" ], 13);
};
t.prototype.noviceStep14 = function() {
var t = this;
r.default.reportGuide("guide13", !1);
r.default.reportGuide("guide14", !0);
this.doStep = !1;
l.default.inst.showFrame(!1);
l.default.inst.showFinger(!0, cc.v3(cc.winSize.width / 2, .6 * cc.winSize.height), !0, l.FINGER_ACTION.leftAndRight);
l.default.inst.showTips([ "在地图上滑动放置种子。" ], 14, function() {
l.default.inst.enabledTouch(!1);
t.doStep = !1;
});
};
t.prototype.noviceStep15 = function() {
var t = this;
r.default.reportGuide("guide14", !1);
r.default.reportGuide("guide15", !0);
p.default.inst.closeSelectTip();
l.default.inst.showFinger(!1);
l.default.inst.showTips([ "现在种子已经成长为树木了。", "尝试使用各种道具，创造属于你的世界吧！" ], 15, function() {
t._step = -1;
t.complete(!0);
r.default.reportGuide("guide15", !1);
p.default.inst.showBoxGift();
});
};
t.prototype.saveStep0 = function() {
var t = this;
this.begin();
l.default.inst.showTips([ '"信息"分类里，有保存功能。' ], 4, null, function() {
t.doStep = !1;
p.default.inst.toggleContainer.children[0].getComponent(cc.Toggle).isChecked && t._step++;
t.do(o.save);
});
};
t.prototype.saveStep1 = function() {
this.doStep = !1;
var t = p.default.inst.toggleContainer.children[0], e = t.parent.convertToWorldSpaceAR(t.position);
l.default.inst.showFinger(!0, e);
l.default.inst.showFrame(!0, e, t.getContentSize());
l.default.inst.showTips([ '点击"信息"分类按钮。' ], 4);
};
t.prototype.saveStep2 = function() {
this.doStep = !1;
var t = cc.find("checkmark/scrollView/view/HLayout/GLayout0/btn1004", p.default.inst.toggleContainer.children[0]), e = t.parent.convertToWorldSpaceAR(t.position);
l.default.inst.showFinger(!0, e);
l.default.inst.showFrame(!0, e, t.getContentSize());
l.default.inst.showTips([ "点击存档按钮。" ], 4);
};
t.prototype.saveStep3 = function() {
this.doStep = !1;
var t = d.default.inst.slotNodes[1], e = t.parent.convertToWorldSpaceAR(t.position);
l.default.inst.showFinger(!0, e);
l.default.inst.showFrame(!0, e, t.getContentSize());
l.default.inst.showTips([ "选择一个存档位置。" ], 4);
};
t.prototype.saveStep4 = function() {
this.doStep = !1;
var t = h.default.inst.buttonSave.node, e = t.parent.convertToWorldSpaceAR(t.position);
l.default.inst.showFinger(!0, e);
l.default.inst.showFrame(!0, e, t.getContentSize());
l.default.inst.showTips([ "点击保存。" ], 4);
};
t.prototype.saveStep5 = function() {
var t = this;
l.default.inst.showFrame(!1);
l.default.inst.showFinger(!1);
l.default.inst.showTips([ "这样下次就能继续玩了，\n退出前千万要记得保存哦！" ], 4, null, function() {
t._step = -1;
t.complete();
});
};
t.prototype.cityInfoStep0 = function() {
var t = this;
this.begin();
s.default.setPause(!0);
cc.tween(u.MoveCamera.inst.camera).to(1.5, {
zoomRatio: u.MoveCamera.inst.minZoomRatio
}).start();
u.MoveCamera.inst.locked = !0;
l.default.inst.showTips([ "有一个好东西忘了告诉你。" ], 4, null, function() {
u.MoveCamera.inst.locked = !1;
t.doStep = !1;
p.default.inst.toggleContainer.children[0].getComponent(cc.Toggle).isChecked && t._step++;
t.do(o.cityInfo);
});
};
t.prototype.cityInfoStep1 = function() {
this.doStep = !1;
var t = p.default.inst.toggleContainer.children[0], e = t.parent.convertToWorldSpaceAR(t.position);
l.default.inst.showFinger(!0, e);
l.default.inst.showFrame(!0, e, t.getContentSize());
l.default.inst.showTips([ '点击"信息"分类按钮' ], 4);
};
t.prototype.cityInfoStep2 = function() {
this.doStep = !1;
var t = cc.find("checkmark/scrollView/view/HLayout/GLayout1/btn1006", p.default.inst.toggleContainer.children[0]), e = t.parent.convertToWorldSpaceAR(t.position);
l.default.inst.showFinger(!0, e);
l.default.inst.showFrame(!0, e, t.getContentSize());
l.default.inst.showTips([ '点击打开"村庄情报"\n开启后显示村庄名称与人口' ], 4);
};
t.prototype.cityInfoStep3 = function() {
this.doStep = !1;
var t = cc.find("checkmark/scrollView/view/HLayout/GLayout1/btn1007", p.default.inst.toggleContainer.children[0]), e = t.parent.convertToWorldSpaceAR(t.position);
l.default.inst.showFinger(!0, e);
l.default.inst.showFrame(!0, e, t.getContentSize());
l.default.inst.showTips([ '点击打开"村庄边界"\n开启后可以看到村庄扩张的情况' ], 4);
};
t.prototype.cityInfoStep4 = function() {
var t = this;
l.default.inst.showFrame(!1);
l.default.inst.showFinger(!1);
l.default.inst.showTips([ "这样就可以更好的观察村庄的状态了" ], 4, null, function() {
t.doStep = !1;
t.do(o.cityInfo);
});
};
t.prototype.cityInfoStep5 = function() {
var t = this;
l.default.inst.showTips([ "再次点击相应按钮\n即可关闭村庄状态的显示" ], 4, null, function() {
t._step = -1;
s.default.setPause(!1);
t.complete(!0);
});
};
t.prototype.mysteryStep0 = function() {
this.begin();
this.doStep = !1;
var t = p.default.inst.node.getChildByName("mysteryGift"), e = t.parent.convertToWorldSpaceAR(t.position);
l.default.inst.showFinger(!0, cc.v3(e.x, e.y - 50));
l.default.inst.showFrame(!0, e, t.getContentSize());
l.default.inst.showTips([ "有一个飞着的宝箱？\n看看里面有什么东西" ], 4);
};
t.prototype.mysteryStep1 = function() {
this._step = -1;
this.complete(!0);
};
t.prototype.generalStep0 = function() {
var t = this;
this.begin();
this.doStep = !1;
l.default.inst.showMaskOpacity(100);
l.default.inst.showTips([ "这是一个关于创造和摧毁的游戏\n(点击任意位置以继续)" ], 4, null, function() {
t.do(o.general);
});
};
t.prototype.generalStep1 = function() {
var t = this;
this.doStep = !1;
l.default.inst.showTips([ "控制方式：用一根手指移动镜头，两个手指控制镜头缩放" ], 4, null, function() {
t.do(o.general);
});
};
t.prototype.generalStep2 = function() {
var t = this;
this.doStep = !1;
l.default.inst.showTips([ "所有的道具都在屏幕的下方\n这里是几个重要的按钮：" ], 4, null, function() {
t.do(o.general);
});
};
t.prototype.generalStep3 = function() {
var t = this;
l.default.inst.interceptHighlightFrameTouch(!0);
var e = cc.find("checkmark/scrollView/view/HLayout/GLayout0/btn1004", p.default.inst.toggleContainer.children[0]), i = e.parent.convertToWorldSpaceAR(e.position);
l.default.inst.showFrame(!0, i, e.getContentSize());
l.default.inst.showTips([ '"存档"按钮\n用它来存储和加载你的世界' ], 4, null, function() {
t.doStep = !1;
t.do(o.general);
});
};
t.prototype.generalStep4 = function() {
var t = this;
this.doStep = !1;
var e = cc.find("checkmark/scrollView/view/HLayout/GLayout0/btn1003", p.default.inst.toggleContainer.children[0]), i = e.parent.convertToWorldSpaceAR(e.position);
l.default.inst.showFrame(!0, i, e.getContentSize());
l.default.inst.showTips([ '"自定义世界"按钮\n用它来创造不同尺寸的世界' ], 4, null, function() {
t.do(o.general);
});
};
t.prototype.generalStep5 = function() {
var t = this;
this.doStep = !1;
l.default.inst.showFrame(!1);
l.default.inst.showTips([ '各种不同的道具\n被整理在了不同的"分类"中' ], 4, null, function() {
t.do(o.general);
});
};
t.prototype.generalStep6 = function() {
var t = this;
this.doStep = !1;
var e = p.default.inst.toggleContainer.children[1], i = e.parent.convertToWorldSpaceAR(e.position);
l.default.inst.showFrame(!0, i, e.getContentSize());
l.default.inst.showTips([ '"地形"分类\n包含了各种修改世界的工具' ], 4, null, function() {
t.do(o.general);
});
};
t.prototype.generalStep7 = function() {
var t = this;
this.doStep = !1;
var e = p.default.inst.toggleContainer.children[2], i = e.parent.convertToWorldSpaceAR(e.position);
l.default.inst.showFrame(!0, i, e.getContentSize());
l.default.inst.showTips([ '"人形"分类\n可以用它来创造村庄' ], 4, null, function() {
t.do(o.general);
});
};
t.prototype.generalStep8 = function() {
var t = this;
this.doStep = !1;
var e = p.default.inst.toggleContainer.children[3], i = e.parent.convertToWorldSpaceAR(e.position);
l.default.inst.showFrame(!0, i, e.getContentSize());
l.default.inst.showTips([ '"生物和怪兽"分类\n想要龙吗？这里就有' ], 4, null, function() {
t.do(o.general);
});
};
t.prototype.generalStep9 = function() {
var t = this;
this.doStep = !1;
var e = p.default.inst.toggleContainer.children[4], i = e.parent.convertToWorldSpaceAR(e.position);
l.default.inst.showFrame(!0, i, e.getContentSize());
l.default.inst.showTips([ '"自然"分类\n这里有一些工具可以帮助你的文明' ], 4, null, function() {
t.do(o.general);
});
};
t.prototype.generalStep10 = function() {
var t = this;
this.doStep = !1;
var e = p.default.inst.toggleContainer.children[5], i = e.parent.convertToWorldSpaceAR(e.position);
l.default.inst.showFrame(!0, i, e.getContentSize());
l.default.inst.showTips([ '"摧毁性物品"分类\n你可以在这里找到炸弹和核武器' ], 4, null, function() {
t.do(o.general);
});
};
t.prototype.generalStep11 = function() {
var t = this;
this.doStep = !1;
l.default.inst.showFrame(!1);
l.default.inst.showTips([ "这里有太多的道具等待你来体验\n尽情去尝试吧" ], 4, null, function() {
t.do(o.general);
});
};
t.prototype.generalStep12 = function() {
l.default.inst.interceptHighlightFrameTouch(!1);
this._step = -1;
this.complete();
};
t.prototype.onlineStep0 = function() {
this.begin();
this.doStep = !1;
var t = cc.find("left/btnOnline", p.default.inst.node), e = t.parent.convertToWorldSpaceAR(t.position);
l.default.inst.showFinger(!0, e);
l.default.inst.showFrame(!0, e, t.getContentSize());
l.default.inst.showTips([ "有在线奖励可以领取哦~" ], 4);
};
t.prototype.onlineStep1 = function() {
this._step = -1;
this.complete(!0);
};
t.prototype.timeScaleStep0 = function() {
var t = this;
this.begin();
l.default.inst.showTips([ "如果你觉得世界运转太慢的话,\n可以使用时间加速功能。" ], 4, null, function() {
t.doStep = !1;
t.do(o.timeScale);
});
};
t.prototype.timeScaleStep1 = function() {
this.doStep = !1;
var t = cc.find("right/btn1002", p.default.inst.node), e = t.parent.convertToWorldSpaceAR(t.position);
l.default.inst.showFinger(!0, e);
l.default.inst.showFrame(!0, e, t.getContentSize());
l.default.inst.showTips([ "点击时间加速按钮。" ], 4);
};
t.prototype.timeScaleStep2 = function() {
var t = this;
l.default.inst.showFrame(!1);
l.default.inst.showFinger(!1);
l.default.inst.showTips([ "现在世界就在加速运转了，\n但是进行加速需要消耗加速时间。" ], 4, null, function() {
t._step = -1;
t.complete(!0);
});
};
t.prototype.achievStep0 = function() {
var t = this;
this.begin();
p.default.inst.checkGuideViewHeight();
l.default.inst.showTips([ "你完成了一项成就，\n可以领取奖励了。" ], 4, null, function() {
t.doStep = !1;
t.do(o.achiev);
});
};
t.prototype.achievStep1 = function() {
this.doStep = !1;
var t = cc.find("right/btnAchiev", p.default.inst.node), e = t.parent.convertToWorldSpaceAR(t.position);
l.default.inst.showFinger(!0, e);
l.default.inst.showFrame(!0, e, t.getContentSize());
l.default.inst.showTips([ "点击这个奖杯图标查看成就。" ], 4);
};
t.prototype.achievStep2 = function() {
this.doStep = !1;
var t = f.default.inst.scrollView.content.children[0].getChildByName("reward"), e = t.parent.convertToWorldSpaceAR(t.position);
l.default.inst.showFinger(!0, e);
l.default.inst.showFrame(!0, e, t.getContentSize());
l.default.inst.showTips([ "来，领取你的成就奖励吧！" ], 4);
};
t.prototype.achievStep3 = function() {
var t = this;
l.default.inst.showFrame(!1);
l.default.inst.showFinger(!1);
l.default.inst.showTips([ "积极完成成就并获取奖励吧。" ], 4, function() {
t._step = -1;
t.complete();
});
};
t.inst = new t();
return t;
}();
i.default = m;
cc._RF.pop();
}, {
"../../../../../framework/main/Constants": void 0,
"../../../../../start/src/ShuFenReport": void 0,
"../../../../common/src/GameCommon": void 0,
"../../../../common/src/data/FestivityData": void 0,
"../../../../common/src/module/GuideView": void 0,
"../../brush/BrushWindow": "BrushWindow",
"../../common/MoveCamera": "MoveCamera",
"../../save/SaveList": "SaveList",
"../../save/SavePopup": "SavePopup",
"../../ui/UiController": "UiController",
"../achiev/AchievementView": "AchievementView"
} ],
HeatRayEffect: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "b723fHuO9BOZKX+k3aEHLZV", "HeatRayEffect");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
}), r = this && this.__decorate || function(t, e, i, o) {
var a, r = arguments.length, n = r < 3 ? e : null === o ? o = Object.getOwnPropertyDescriptor(e, i) : o;
if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) n = Reflect.decorate(t, e, i, o); else for (var s = t.length - 1; s >= 0; s--) (a = t[s]) && (n = (r < 3 ? a(n) : r > 3 ? a(e, i, n) : a(e, i)) || n);
return r > 3 && n && Object.defineProperty(e, i, n), n;
};
Object.defineProperty(i, "__esModule", {
value: !0
});
var n = t("../animation/SpriteAnimation"), s = t("../base/BaseAnimatedObject"), l = t("../MapBox"), c = cc._decorator, u = c.ccclass, d = c.property, h = function(t) {
a(e, t);
function e() {
var e = null !== t && t.apply(this, arguments) || this;
e.ray = null;
e.heat = null;
e.active = !1;
e.ticksActive = 0;
e.touchedGround = !1;
e.rayScaleY = 0;
e.rayWidth = 1;
return e;
}
e.prototype.onLoad = function() {
this.ray.node.setScale(cc.v3(1, 0, 1));
};
e.prototype.update = function() {
this.logicUpdate(l.default.inst.elapsed);
this.ray.logicUpdate(l.default.inst.elapsed);
this.heat.logicUpdate(l.default.inst.elapsed);
this.ticksActive > 0 ? this.ticksActive-- : this.active = !1;
};
e.prototype.isReady = function() {
return this.touchedGround;
};
e.prototype.logicUpdate = function(e) {
t.prototype.logicUpdate.call(this, e);
var i = this.ray.node.position;
i.z = this.node.position.y;
this.ray.node.position = i;
(i = this.heat.node.position).z = this.node.position.y;
this.heat.node.position = i;
if (this.active) {
if (this.rayScaleY < 2e3) {
this.rayScaleY += 7e3 * e;
if (this.rayScaleY >= 2e3) {
this.rayScaleY = 2e3;
this.touchedGround = !0;
}
this.ray.node.setScale(cc.v3(this.rayWidth, this.rayScaleY, 1));
}
} else {
this.touchedGround = !1;
if (this.rayScaleY > 0) {
this.rayScaleY -= 4e3 * e;
if (this.rayScaleY < 0) {
this.rayScaleY = 0;
this.node.active = !1;
}
this.ray.node.setScale(cc.v3(this.rayWidth, this.rayScaleY, 1));
}
}
this.heat.node.active = this.touchedGround;
};
e.prototype.play = function(t, e) {
this.rayWidth = e >= 10 ? 1 : .4;
this.node.position = cc.v3(t.x, t.y);
this.active = !0;
this.ticksActive = 4;
this.node.active = !0;
};
r([ d({
type: n.SpriteAnimation
}) ], e.prototype, "ray", void 0);
r([ d({
type: n.SpriteAnimation
}) ], e.prototype, "heat", void 0);
return r([ u ], e);
}(s.default);
i.default = h;
cc._RF.pop();
}, {
"../MapBox": "MapBox",
"../animation/SpriteAnimation": "SpriteAnimation",
"../base/BaseAnimatedObject": "BaseAnimatedObject"
} ],
Heat: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "dd176vX8rFK7Y9HVKrb514B", "Heat");
Object.defineProperty(i, "__esModule", {
value: !0
});
var o = t("../../../../common/src/data/AchievData"), a = t("../../../../common/src/GameCommon"), r = t("../../MapBox"), n = t("../../ui/power/PowerButtonSelector"), s = t("./TileType"), l = function() {
function t() {
this.tickTimer = 0;
this.tilesToRemove = [];
this.tiles = new Set();
}
t.prototype.clear = function() {
null == this.tiles && (this.tiles = new Set());
this.tiles.forEach(function(t) {
t.heat = 0;
});
this.tiles.clear();
};
t.prototype.addTile = function(t, e) {
var i, a, l, c, u, d;
void 0 === e && (e = 1);
0 == t.heat && this.tiles.add(t);
t.heat += e;
if (t.heat > 5) {
(null === (a = null === (i = t.building) || void 0 === i ? void 0 : i.data) || void 0 === a ? void 0 : a.alive) && t.building.getHit(0);
if (t.type.layerType == s.TileLayerType.Water) {
r.default.inst.removeWater(t);
r.default.inst.particlesSmoke.spawn(t.posV3.x, t.posV3.y);
}
t.type.frozen && r.default.inst.unfreezeTile(t);
t.setBurned();
r.default.inst.setTileDirty(t);
}
if (t.heat > 10) {
if (t.type.burnable) {
(t.type.isType("tnt") || t.type.isType("tnt_timed")) && o.default.update(13);
t.setFire();
}
(null === (c = null === (l = t.building) || void 0 === l ? void 0 : l.data) || void 0 === c ? void 0 : c.alive) && t.building.getHit(0);
t.building && t.setFire();
}
if (t.heat > 20) {
t.type.explodable && 0 == t.explosionWave && r.default.inst.explosionLayer.explodeBomb(t);
t.units.forEach(function(t) {
t.getHit(50);
});
t.building && t.setFire();
t.type.grass && r.default.inst.decreaseTile(t);
}
if (t.heat > 30) {
t.type.lava && r.default.inst.lavaLayer.addLava(t);
(t.type.isType("soil") || t.type.isType("forest_soil")) && t.setTileType("sand");
t.type.road && t.setTileType("sand");
}
var h = null === (d = null === (u = n.PowerButtonSelector.inst.selectedButton) || void 0 === u ? void 0 : u.godPower) || void 0 === d ? void 0 : d.id;
if (t.heat > 100 && t.type.isType("sand")) {
r.default.inst.lavaLayer.addLava(t);
this.checkAchiev(h);
}
if (t.heat > 160) {
if (t.type.isType("mountains")) {
r.default.inst.lavaLayer.addLava(t);
this.checkAchiev(h);
}
if (t.type.isType("hills")) {
r.default.inst.lavaLayer.addLava(t);
this.checkAchiev(h);
}
}
};
t.prototype.checkAchiev = function(t) {
"lightning" == t && o.default.update(34);
"heatray" == t && o.default.update(35);
};
t.prototype.logicUpdate = function(t) {
var e = this;
if (!a.default.isPaused && 0 != this.tiles.size) if (this.tickTimer > 0) this.tickTimer -= t; else {
this.tickTimer = 1;
this.tilesToRemove.clear();
this.tiles.forEach(function(t) {
t.heat--;
t.heat <= 0 && e.tilesToRemove.push(t);
});
this.tilesToRemove.forEach(function(t) {
e.tiles.delete(t);
});
this.tilesToRemove.clear();
}
};
return t;
}();
i.default = l;
cc._RF.pop();
}, {
"../../../../common/src/GameCommon": void 0,
"../../../../common/src/data/AchievData": void 0,
"../../MapBox": "MapBox",
"../../ui/power/PowerButtonSelector": "PowerButtonSelector",
"./TileType": "TileType"
} ],
HistoryHudItem: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "36d11ybReBB/Y43Tj0Iu+1g", "HistoryHudItem");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
}), r = this && this.__decorate || function(t, e, i, o) {
var a, r = arguments.length, n = r < 3 ? e : null === o ? o = Object.getOwnPropertyDescriptor(e, i) : o;
if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) n = Reflect.decorate(t, e, i, o); else for (var s = t.length - 1; s >= 0; s--) (a = t[s]) && (n = (r < 3 ? a(n) : r > 3 ? a(e, i, n) : a(e, i)) || n);
return r > 3 && n && Object.defineProperty(e, i, n), n;
};
Object.defineProperty(i, "__esModule", {
value: !0
});
var n = t("../../../../common/src/GameCommon"), s = t("../../texture/TextureLoader"), l = t("../../ui/power/PowerButtonSelector"), c = t("./WorldLogMessageExtensions"), u = cc._decorator, d = u.ccclass, h = u.property, p = function(t) {
a(e, t);
function e() {
var e = null !== t && t.apply(this, arguments) || this;
e.icon = null;
e.desc = null;
e.message = null;
e.remove_timer = 8;
e.callback = null;
return e;
}
e.prototype.hide = function() {
this.node.stopAllActions();
cc.tween(this.node).sequence(cc.fadeOut(1), cc.callFunc(this.callback)).start();
};
e.prototype.updateItem = function(t, e) {
this.message = t;
this.callback = e;
this.desc.string = c.default.getFormatedText(t, this.desc, !1, !0);
t.icon ? this.icon.spriteFrame = s.TextureLoader.inst.getSpriteFrame(s.ATLAS_TYPE.UIATLAS, "icons/" + t.icon) : this.icon.node.active = !1;
cc.tween(this.node).sequence(cc.delayTime(this.remove_timer), cc.callFunc(this.hide.bind(this))).start();
};
e.prototype.click = function() {
n.default.isPaused || l.PowerButtonSelector.inst.isPowerSelected() || c.default.jumpToLocation(this.message);
};
r([ h(cc.Sprite) ], e.prototype, "icon", void 0);
r([ h(cc.RichText) ], e.prototype, "desc", void 0);
return r([ d ], e);
}(cc.Component);
i.default = p;
cc._RF.pop();
}, {
"../../../../common/src/GameCommon": void 0,
"../../texture/TextureLoader": "TextureLoader",
"../../ui/power/PowerButtonSelector": "PowerButtonSelector",
"./WorldLogMessageExtensions": "WorldLogMessageExtensions"
} ],
HistoryHud: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "928150ouRpCHrVb4HO831Ij", "HistoryHud");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
}), r = this && this.__decorate || function(t, e, i, o) {
var a, r = arguments.length, n = r < 3 ? e : null === o ? o = Object.getOwnPropertyDescriptor(e, i) : o;
if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) n = Reflect.decorate(t, e, i, o); else for (var s = t.length - 1; s >= 0; s--) (a = t[s]) && (n = (r < 3 ? a(n) : r > 3 ? a(e, i, n) : a(e, i)) || n);
return r > 3 && n && Object.defineProperty(e, i, n), n;
};
Object.defineProperty(i, "__esModule", {
value: !0
});
var n = t("../../Config"), s = t("./HistoryHudItem"), l = cc._decorator, c = l.ccclass, u = l.property, d = function(t) {
a(e, t);
function e() {
var e = null !== t && t.apply(this, arguments) || this;
e.container = null;
e.itemPrefab = null;
e.pool = new cc.NodePool();
e.historyItems = [];
e.MAX_HISTORY_ITEMS = 10;
e.ITEM_HEIGHT = 33;
e.count = 0;
return e;
}
i = e;
e.prototype.onLoad = function() {
i.inst = this;
};
e.prototype.clear = function() {
var t = this;
if (this.historyItems.length > 0) {
this.historyItems.forEach(function(e) {
t.pool.put(e.node);
});
this.historyItems = [];
}
};
e.prototype.getObject = function() {
var t = this.pool.get();
t || (t = cc.instantiate(this.itemPrefab));
return t;
};
e.prototype.remove = function(t) {
this.historyItems.remove(t);
this.pool.put(t.node);
0 == this.historyItems.length && (this.count = 0);
};
e.prototype.newHistory = function(t) {
var e = this;
if (n.default.showHistoryLog) {
var i = this.getObject();
i.name = "HistoryItem " + (this.historyItems.length + 1);
i.parent = this.container;
i.opacity = 255;
i.y = -this.ITEM_HEIGHT * this.count;
var o = i.getComponent(s.default);
o.updateItem(t, function() {
e.remove(o);
});
this.historyItems.push(o);
this.count++;
this.historyItems.length > this.MAX_HISTORY_ITEMS && this.historyItems.shift().hide();
}
};
e.prototype.update = function() {
n.default.showHistoryLog || this.clear();
if (0 == this.historyItems.length) 0 != this.container.y && (this.container.y = 0); else {
var t = (this.count - this.historyItems.length) * this.ITEM_HEIGHT;
if (this.container.y < t) {
this.container.y += 2;
this.container.y > t && (this.container.y = t);
}
}
};
var i;
e.inst = null;
r([ u(cc.Node) ], e.prototype, "container", void 0);
r([ u(cc.Prefab) ], e.prototype, "itemPrefab", void 0);
return i = r([ c ], e);
}(cc.Component);
i.default = d;
cc._RF.pop();
}, {
"../../Config": "Config",
"./HistoryHudItem": "HistoryHudItem"
} ],
HoverModule: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "83e6fRTcZRDz4FOWNwT4bUZ", "HoverModule");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
});
Object.defineProperty(i, "__esModule", {
value: !0
});
i.HoverState = void 0;
var r, n = t("../../../common/src/GameCommon"), s = t("../base/BaseActorComponent"), l = t("../common/ToolBox");
(function(t) {
t[t.Hover = 0] = "Hover";
t[t.Up = 1] = "Up";
t[t.Down = 2] = "Down";
})(r = i.HoverState || (i.HoverState = {}));
var c = function(t) {
a(e, t);
function e() {
var e = null !== t && t.apply(this, arguments) || this;
e.timer = 0;
return e;
}
e.prototype.logicUpdate = function(e) {
var i;
t.prototype.logicUpdate.call(this, e);
if (null === (i = this.actor.data) || void 0 === i ? void 0 : i.alive) if (this.timer > 0) this.timer -= e; else {
this.timer = 1 + l.Toolbox.randomFloat(0, 4);
if (!n.default.isPaused) switch (this.hoverState) {
case r.Hover:
l.Toolbox.randomBool() ? this.hoverState = r.Down : this.hoverState = r.Up;
break;

case r.Up:
this.hoverState = r.Hover;
this.actor.moveJumpOffset.y < this.actor.stats.hovering_max && this.actor.changeMoveJumpOffset(3 * e);
break;

case r.Down:
this.hoverState = r.Hover;
this.actor.moveJumpOffset.y > this.actor.stats.hovering_min && this.actor.changeMoveJumpOffset(3 * (0 - e));
}
} else this.actor.changeMoveJumpOffset(10 * (0 - e));
};
return e;
}(s.default);
i.default = c;
cc._RF.pop();
}, {
"../../../common/src/GameCommon": void 0,
"../base/BaseActorComponent": "BaseActorComponent",
"../common/ToolBox": "ToolBox"
} ],
IceTower: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "fb096gGjutBHbG/CWEA+frx", "IceTower");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
});
Object.defineProperty(i, "__esModule", {
value: !0
});
var r = t("../base/BaseBuilding"), n = t("../common/ToolBox"), s = t("../MapBox"), l = function(t) {
a(e, t);
function e() {
var e = null !== t && t.apply(this, arguments) || this;
e.freezeInterval = .3;
e.freezeTimer = 0;
return e;
}
e.prototype.logicUpdate = function(e) {
t.prototype.logicUpdate.call(this, e);
if (this.freezeTimer > 0) this.freezeTimer -= e; else {
this.freezeTimer = this.freezeInterval;
this.freezeRandomTile();
}
};
e.prototype.freezeRandomTile = function() {
var t, e = this.building.currentTile, i = null === (t = e.region) || void 0 === t ? void 0 : t.island;
if (i) {
var o = i.regions.getRandom().tiles.getRandom();
this.freeze(e, o);
}
};
e.prototype.freeze = function(t, e) {
if (!(n.Toolbox.distTile(t, e) > 50)) {
s.default.inst.freezeTile(e);
s.default.inst.freezeTile(e);
}
};
e.prototype.checkChunk = function(t, e) {
var i = e.tiles.getRandom();
if (!(n.Toolbox.distTile(t, i) > 10)) {
s.default.inst.freezeTile(i);
s.default.inst.freezeTile(i);
}
};
return e;
}(r.BaseBuildingComponent);
i.default = l;
cc._RF.pop();
}, {
"../MapBox": "MapBox",
"../base/BaseBuilding": "BaseBuilding",
"../common/ToolBox": "ToolBox"
} ],
InfiniteProp: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "57edbnoHnVDZLt+gnCAAdBt", "InfiniteProp");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
}), r = this && this.__decorate || function(t, e, i, o) {
var a, r = arguments.length, n = r < 3 ? e : null === o ? o = Object.getOwnPropertyDescriptor(e, i) : o;
if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) n = Reflect.decorate(t, e, i, o); else for (var s = t.length - 1; s >= 0; s--) (a = t[s]) && (n = (r < 3 ? a(n) : r > 3 ? a(e, i, n) : a(e, i)) || n);
return r > 3 && n && Object.defineProperty(e, i, n), n;
};
Object.defineProperty(i, "__esModule", {
value: !0
});
var n = t("../../../../../framework/lib/prototype/DateUtils"), s = t("../../../../../framework/main/Constants"), l = t("../../../../common/src/advert/AdsManager"), c = t("../../../../common/src/advert/sdk/GameTdd"), u = t("../../../../common/src/data/UserData"), d = t("../../../../common/src/GamePopBase"), h = t("../../../../common/src/MsgCache"), p = t("../../../../common/src/text/LocalizedTextManager"), f = t("../../common/ToolBox"), m = t("../../common/ViewController"), y = t("../../Config"), _ = t("../../texture/TextureLoader"), g = cc._decorator, v = g.ccclass, b = g.property, T = function(t) {
a(e, t);
function e() {
var e = null !== t && t.apply(this, arguments) || this;
e.prop = [];
e.title = null;
e.btnText = null;
e.btns = [];
e.videoNormal = null;
e.bg_count = null;
e.bg_time = null;
e.bg_unlock = null;
e.data = null;
e.natural = !1;
return e;
}
e.prototype.start = function() {
var t = n.default.formatDayTime();
if (void 0 === u.default.member.firstFreeProp[t]) {
u.default.member.firstFreeProp = {};
u.default.member.firstFreeProp[t] = !0;
u.default.save();
}
this.videoNormal.active = !u.default.member.firstFreeProp[t];
this.videoNormal.active || (this.btnText.x = 0);
this.init();
};
e.prototype.clickClose = function(t) {
var e = c.default.getData("p7", c.v_type.Number);
s.default.MODE == s.MODE_TYPE.LOCK && !this.natural && null != e && f.Toolbox.randomRate(e / 100) ? m.default.open(m.view_type.BoxMonster) : this.close(t);
};
e.prototype.init = function() {
this.data = u.default.getPropConfigByID(y.default.selectedProp);
if (this.data) {
this.natural = 104 == this.data.index || 105 == this.data.index;
if (this.natural) {
var t = c.default.getData("p8", c.v_type.Number);
if (s.default.MODE == s.MODE_TYPE.LOCK && null != t && f.Toolbox.randomRate(t / 100)) {
var e = this.bg.getChildByName("btnClose");
e.active = !1;
var i = cc.find("btnSure/video", this.bg_unlock);
i.active = !1;
var o = c.default.getData("p9", c.v_type.Number) || .1;
this.scheduleOnce(function() {
e.active = !0;
i.active = !0;
}, o);
}
}
var a = u.default.getPropByID(this.data.propID);
this.bg_unlock.active = s.default.MODE != s.MODE_TYPE.COUNT && a.lock;
this.bg_count.active = !this.bg_unlock.active;
this.bg_time.active = !this.bg_unlock.active;
this.title.string = this.bg_unlock.active ? "永久解锁" : "道具耗尽";
for (var r = 0; r < this.prop.length; r++) {
var n = this.prop[r], l = n.getChildByName("rare");
l.active = this.data.rare >= 0 && s.default.MODE != s.MODE_TYPE.LOCK;
var d = _.TextureLoader.inst.getSpriteFrame(_.ATLAS_TYPE.UIATLAS, "reward/rare_" + this.data.rare);
d && (l.getComponent(cc.Sprite).spriteFrame = d);
var h = n.getChildByName("icon"), m = _.TextureLoader.inst.getSpriteFrame(_.ATLAS_TYPE.UIATLAS, "propIcon/icon" + this.data.propID);
m && (h.getComponent(cc.Sprite).spriteFrame = m);
n.getChildByName("name").getComponent(cc.Label).string = this.data.propName;
var g = n.getChildByName("num");
g && (g.getComponent(cc.Label).string = "+" + this.data.reward);
var v = n.getChildByName("time");
if (v) {
var b = this.getInfiniteTime();
v.getComponent(cc.Label).string = b + "秒\n 无限使用";
}
var T = n.getChildByName("desc");
T && (T.getComponent(cc.Label).string = p.LocalizedTextManager.getGodPowerDesc(y.default.selectedPowerid));
}
}
};
e.prototype.click = function(t, e) {
var i = this, o = t.getCurrentTarget().getComponent(cc.Button);
o.interactable = !1;
var a = n.default.formatDayTime();
if ("addPropNum" == e && u.default.member.firstFreeProp[a]) {
u.default.member.firstFreeProp[a] = !1;
this.reward(e);
} else {
s.default.REPORT_ID = e;
l.default.showVideoAds(function(t) {
if (1 == t) i.reward(e); else {
o.interactable = !0;
var a = 0 == t ? "视频播放未完成。" : "视频播放失败，请稍候再试！";
h.default.pushToast(a);
}
});
}
};
e.prototype.reward = function(t) {
var e = u.default.getPropByID(this.data.propID);
if (e) {
if ("addPropNum" == t) e.number += this.data.reward; else if ("addPropTime" == t) {
var i = this.getInfiniteTime();
e.number++;
e.infiniteTime += i;
h.default.pushToast("获得" + i + "秒无限使用<" + e.propName + ">奖励");
} else {
e.lock = !1;
h.default.pushToast("永久解锁<" + e.propName + ">成功");
}
u.default.save();
}
this.close();
};
e.prototype.getInfiniteTime = function() {
return WECHAT_GAME || BYTEDANCE_GAME ? 200 : 100;
};
r([ b([ cc.Node ]) ], e.prototype, "prop", void 0);
r([ b(cc.Label) ], e.prototype, "title", void 0);
r([ b(cc.Node) ], e.prototype, "btnText", void 0);
r([ b([ cc.Button ]) ], e.prototype, "btns", void 0);
r([ b(cc.Node) ], e.prototype, "videoNormal", void 0);
r([ b(cc.Node) ], e.prototype, "bg_count", void 0);
r([ b(cc.Node) ], e.prototype, "bg_time", void 0);
r([ b(cc.Node) ], e.prototype, "bg_unlock", void 0);
return r([ v ], e);
}(d.GamePopBase);
i.default = T;
cc._RF.pop();
}, {
"../../../../../framework/lib/prototype/DateUtils": void 0,
"../../../../../framework/main/Constants": void 0,
"../../../../common/src/GamePopBase": void 0,
"../../../../common/src/MsgCache": void 0,
"../../../../common/src/advert/AdsManager": void 0,
"../../../../common/src/advert/sdk/GameTdd": void 0,
"../../../../common/src/data/UserData": void 0,
"../../../../common/src/text/LocalizedTextManager": void 0,
"../../Config": "Config",
"../../common/ToolBox": "ToolBox",
"../../common/ViewController": "ViewController",
"../../texture/TextureLoader": "TextureLoader"
} ],
IslandsCalculator: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "ef587fhTBlIsJBFZqpWD8pT", "IslandsCalculator");
var o = this && this.__values || function(t) {
var e = "function" == typeof Symbol && Symbol.iterator, i = e && t[e], o = 0;
if (i) return i.call(t);
if (t && "number" == typeof t.length) return {
next: function() {
t && o >= t.length && (t = void 0);
return {
value: t && t[o++],
done: !t
};
}
};
throw new TypeError(e ? "Object is not iterable." : "Symbol.iterator is not defined.");
};
Object.defineProperty(i, "__esModule", {
value: !0
});
var a = t("../../MapBox"), r = t("../tile/TileIsland"), n = t("../tile/TileType"), s = function() {
function t() {
this.islands = [];
this._temp_regions = [];
this._temp_regions_cur_wave = [];
this._temp_regions_next_wave = [];
}
t.prototype.clear = function() {
t.island_id = 0;
this.islands = [];
this._temp_regions = [];
this._temp_regions_cur_wave = [];
this._temp_regions_next_wave = [];
};
t.prototype.logicUpdate = function() {
if (this.timer_updateActors > 0) this.timer_updateActors -= cc.director.getDeltaTime(); else {
this.recalcActors();
this.timer_updateActors = 2;
}
};
t.prototype.getRandomGround = function() {
var t = null;
if (this.islands.length > 0) {
var e = this.getRandomIslandGround();
e && e.regions.length > 0 && (t = e.getRandomTile());
}
t || (t = a.default.inst.tilesList.getRandom());
return t;
};
t.prototype.getRandomIslandGround = function(t) {
var e, i;
void 0 === t && (t = !0);
this.islands.shuffle();
try {
for (var a = o(this.islands), r = a.next(); !r.done; r = a.next()) {
var s = r.value;
if (s.type == n.TileLayerType.Ground && (!t || s.regions.length >= 4)) return s;
}
} catch (t) {
e = {
error: t
};
} finally {
try {
r && !r.done && (i = a.return) && i.call(a);
} finally {
if (e) throw e.error;
}
}
return null;
};
t.prototype.recalcActors = function() {
this.islands.forEach(function(t) {
t.actors = [];
});
a.default.inst.units.list.forEach(function(t) {
var e, i, o;
(null === (e = t.data) || void 0 === e ? void 0 : e.alive) && (null === (o = null === (i = t.currentTile) || void 0 === i ? void 0 : i.region) || void 0 === o ? void 0 : o.island) && t.currentTile.region.island.actors.push(t);
});
};
t.prototype.findIslands = function() {
var t = this;
this._temp_regions = [];
for (var e = 0; e < this.islands.length; ) 0 == this.islands[e].regions.length ? this.islands.splice(e, 1) : e++;
a.default.inst.mapChunkManager.list.forEach(function(e) {
e.regions.forEach(function(e) {
if (!e.island) {
e.isIslandChecked = !1;
t._temp_regions.push(e);
}
});
});
this._temp_regions.forEach(function(e) {
e.island || t.newIslandFrom(e);
});
this.islands.forEach(function(t) {
t.regions.shuffle();
t.countTiles();
});
};
t.prototype.newIslandFrom = function(e) {
t.island_id++;
this._temp_regions_cur_wave = [];
this._temp_regions_next_wave = [];
var i = new r.default(t.island_id);
i.type = e.type;
this.islands.push(i);
this._temp_regions_next_wave.push(e);
t._nextWave = [];
t._nextWave.push(e);
this.startFill(i);
};
t.prototype.startFill = function(e) {
for (var i = 0; i < t._nextWave.length; ) {
var o = t._nextWave[i];
if (!o.isIslandChecked) {
o.island = e;
e.regions.push(o);
}
o.isIslandChecked = !0;
i++;
o.neighbours.forEach(function(i) {
if (!i.isIslandChecked) {
i.isIslandChecked = !0;
i.island = e;
e.regions.push(i);
t._nextWave.push(i);
}
});
}
};
t.island_id = 0;
t._nextWave = [];
return t;
}();
i.default = s;
cc._RF.pop();
}, {
"../../MapBox": "MapBox",
"../tile/TileIsland": "TileIsland",
"../tile/TileType": "TileType"
} ],
ItemAccessoryMaterialLibrary: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "952826xCzdB3YK4caShZ1bR", "ItemAccessoryMaterialLibrary");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
});
Object.defineProperty(i, "__esModule", {
value: !0
});
var r = t("../AssetLibrary"), n = t("./ItemLibrary"), s = function(t) {
a(e, t);
function e() {
return null !== t && t.apply(this, arguments) || this;
}
e.prototype.init = function() {
t.prototype.init.call(this);
var e = new n.ItemAsset();
e.id = "bone";
e.equipment_value = 5;
e.level = 1;
this.add(e);
this.t.setCost(5, "bones", 1, "gems", 1);
this.t.baseStats.crit = 2;
var i = new n.ItemAsset();
i.id = "copper";
i.equipment_value = 10;
i.level = 2;
this.add(i);
this.t.setCost(5, "metals", 1, "gems", 1);
this.t.baseStats.crit = 3;
var o = new n.ItemAsset();
o.id = "bronze";
o.equipment_value = 15;
o.level = 3;
this.add(o);
this.t.setCost(10, "metals", 1, "gems", 1);
this.t.baseStats.crit = 4;
var a = new n.ItemAsset();
a.id = "silver";
a.equipment_value = 20;
a.level = 4;
this.add(a);
this.t.setCost(15, "metals", 2, "gems", 1);
this.t.baseStats.crit = 5;
var r = new n.ItemAsset();
r.id = "iron";
r.equipment_value = 30;
r.level = 5;
this.add(r);
this.t.setCost(20, "metals", 3, "gems", 2);
this.t.baseStats.crit = 6;
var s = new n.ItemAsset();
s.id = "steel";
s.equipment_value = 40;
s.level = 6;
this.add(s);
this.t.setCost(20, "metals", 3, "gems", 3);
this.t.baseStats.crit = 7;
var l = new n.ItemAsset();
l.id = "mythril";
l.equipment_value = 50;
l.level = 7;
this.add(l);
this.t.setCost(50, "metals", 4, "gems", 4);
this.t.baseStats.crit = 8;
var c = new n.ItemAsset();
c.id = "adamantine";
c.equipment_value = 70;
c.level = 8;
this.add(c);
this.t.setCost(100, "metals", 5, "gems", 5);
this.t.baseStats.crit = 10;
};
return e;
}(r.default);
i.default = s;
cc._RF.pop();
}, {
"../AssetLibrary": "AssetLibrary",
"./ItemLibrary": "ItemLibrary"
} ],
ItemArmorMaterialLibrary: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "1ca99qLelxDp5ofKmVORWWm", "ItemArmorMaterialLibrary");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
});
Object.defineProperty(i, "__esModule", {
value: !0
});
var r = t("../AssetLibrary"), n = t("./ItemLibrary"), s = function(t) {
a(e, t);
function e() {
return null !== t && t.apply(this, arguments) || this;
}
e.prototype.init = function() {
t.prototype.init.call(this);
var e = new n.ItemAsset();
e.id = "leather";
e.equipment_value = 5;
e.level = 1;
this.add(e);
this.t.setCost(5, "leather", 1);
this.t.baseStats.armor = 2;
this.t.baseStats.dodge = 5;
this.t.baseStats.speed = 1;
var i = new n.ItemAsset();
i.id = "copper";
i.equipment_value = 10;
i.level = 2;
this.add(i);
this.t.setCost(5, "metals", 1);
this.t.baseStats.armor = 3;
var o = new n.ItemAsset();
o.id = "bronze";
o.equipment_value = 15;
o.level = 3;
this.add(o);
this.t.setCost(5, "metals", 1);
this.t.baseStats.armor = 4;
var a = new n.ItemAsset();
a.id = "silver";
a.equipment_value = 20;
a.level = 4;
this.add(a);
this.t.setCost(10, "metals", 1);
this.t.baseStats.armor = 5;
var r = new n.ItemAsset();
r.id = "iron";
r.equipment_value = 30;
r.level = 5;
this.add(r);
this.t.setCost(15, "metals", 2);
this.t.baseStats.armor = 6;
var s = new n.ItemAsset();
s.id = "steel";
s.equipment_value = 40;
s.level = 6;
this.add(s);
this.t.setCost(20, "metals", 3);
this.t.baseStats.armor = 7;
var l = new n.ItemAsset();
l.id = "mythril";
l.equipment_value = 50;
l.level = 7;
this.add(l);
this.t.setCost(50, "metals", 4);
this.t.baseStats.armor = 8;
var c = new n.ItemAsset();
c.id = "adamantine";
c.equipment_value = 70;
c.level = 8;
this.add(c);
this.t.setCost(100, "metals", 5);
this.t.baseStats.armor = 10;
};
return e;
}(r.default);
i.default = s;
cc._RF.pop();
}, {
"../AssetLibrary": "AssetLibrary",
"./ItemLibrary": "ItemLibrary"
} ],
ItemGenerator: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "1b08eRIT0JChKDCKfoElpDm", "ItemGenerator");
Object.defineProperty(i, "__esModule", {
value: !0
});
var o = t("../../../../../framework/utils/Log"), a = t("../../actors/ActorEquipmentSlot"), r = t("../../assetLibrary/AssetManager"), n = t("../../assetLibrary/lib/ItemLibrary"), s = function() {
function t() {}
t.getPool = function(e) {
if (t.pools.has(e)) return t.pools.get(e);
var i = [];
t.pools.set(e, i);
return i;
};
t.createPools = function(e, i) {
i.forEach(function(i) {
for (var o = i.pool.split(","), a = 0; a < o.length; a++) for (var r = t.getPool(e + "_" + o[a]), n = 0; n < i.rarity; n++) r.push(i.id);
});
};
t.init = function() {
t.createPools("prefix", r.default.items_prefix.list);
t.createPools("suffix", r.default.items_suffix.list);
};
t.generateItemsIDS = function() {
t.list_id_string = "";
r.default.items.weapons_id_range.forEach(function(e) {
t.generateIdsFor(e, "weapon", "range");
});
r.default.items_suffix.list.forEach(function(e) {
var i = e.id;
"0" != i && (t.list_id_string = t.list_id_string + "\nitem_prefix_of_" + i);
});
o.default.d(t.list_id_string);
};
t.generateIdsFor = function(e, i, o) {
for (var a = 0; a < r.default.items_prefix.list.length; a++) {
var n = r.default.items_prefix.list[a];
if (n.pool.includes(o)) {
var s = n.id;
if ("0" == s) {
t.list_id_string = t.list_id_string + "\nitem_" + e;
continue;
}
t.list_id_string = t.list_id_string + "\nitem_" + e + "_" + s;
}
}
};
t.generateItem = function(e, i, o, s, l, c, u) {
void 0 === i && (i = "base");
void 0 === o && (o = null);
void 0 === s && (s = 0);
void 0 === l && (l = "");
void 0 === c && (c = "");
void 0 === u && (u = 1);
var d = new a.ItemData(), h = e.pool, p = "0", f = "0";
if (0 == e.suffixes.length && 0 == e.prefixes.length) {
p = t.getPool("prefix_" + h).getRandom();
var m = r.default.items_prefix.get(p);
if (u > 1) for (;u > 0; ) {
u--;
if ((m = r.default.items_prefix.get(p)).quality == n.ItemQuality.Legendary) break;
}
m.quality > n.ItemQuality.Normal && (f = t.getPool("suffix_" + h).getRandom());
} else {
f = e.suffixes.length > 0 ? e.suffixes.getRandom() : "0";
p = e.prefixes.length > 0 ? e.suffixes.getRandom() : "0";
}
var y = "";
"0" != p && (y = y + p + " ");
y = y + i + " ";
y += e.id;
"0" != f && (y = y + " of " + f);
d.id = e.id;
d.material = i;
d.prefix = p;
d.suffix = f;
d.year = s;
d.by = c;
d.from = l;
d.type = o.type;
o.setItem(d);
t.tString = t.tString + "\n" + y;
};
t.pools = new Map();
t.tString = "";
t.list_id_string = "";
return t;
}();
i.default = s;
cc._RF.pop();
}, {
"../../../../../framework/utils/Log": void 0,
"../../actors/ActorEquipmentSlot": "ActorEquipmentSlot",
"../../assetLibrary/AssetManager": "AssetManager",
"../../assetLibrary/lib/ItemLibrary": "ItemLibrary"
} ],
ItemLibrary: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "4a7a0WXmEBLIJbWxntPK3YA", "ItemLibrary");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
});
Object.defineProperty(i, "__esModule", {
value: !0
});
i.ItemAsset = i.WeaponType = i.ItemProductionOrder = i.ItemQuality = void 0;
var r, n, s = t("../../../../../framework/utils/Tools"), l = t("../../actors/ActionLibrary"), c = t("../../actors/ActorEquipmentSlot"), u = t("../../base/BaseStats"), d = t("../../world/WorldAction"), h = t("../AssetLibrary");
(function(t) {
t[t.Junk = 0] = "Junk";
t[t.Normal = 1] = "Normal";
t[t.Rare = 2] = "Rare";
t[t.Epic = 3] = "Epic";
t[t.Legendary = 4] = "Legendary";
})(r = i.ItemQuality || (i.ItemQuality = {}));
(function(t) {
t[t.Random = 0] = "Random";
t[t.Weapon = 1] = "Weapon";
t[t.Both = 2] = "Both";
})(i.ItemProductionOrder || (i.ItemProductionOrder = {}));
(function(t) {
t[t.Melee = 0] = "Melee";
t[t.Range = 1] = "Range";
})(n = i.WeaponType || (i.WeaponType = {}));
var p = function(t) {
a(e, t);
function e() {
var e = null !== t && t.apply(this, arguments) || this;
e.prefixes = [];
e.suffixes = [];
e.materials = [];
e.cost_gold = 0;
e.cost_resource_1 = 0;
e.cost_resource_id_1 = "none";
e.cost_resource_2 = 0;
e.cost_resource_id_2 = "none";
e.baseStats = new u.default();
e.level = 1;
e.rarity = 1;
e.equipment_value = 0;
e.pool = "";
e.slash = "";
e.projectile = "";
e.attackAction = d.default.create();
e.quality = r.Normal;
e.attackType = n.Melee;
return e;
}
e.prototype.setCost = function(t, e, i, o, a) {
void 0 === e && (e = "none");
void 0 === i && (i = 0);
void 0 === o && (o = "none");
void 0 === a && (a = 0);
this.cost_gold = t;
this.cost_resource_id_1 = e;
this.cost_resource_1 = i;
this.cost_resource_id_2 = o;
this.cost_resource_2 = a;
};
return e;
}(h.Asset);
i.ItemAsset = p;
var f = function(t) {
a(e, t);
function e() {
var e = null !== t && t.apply(this, arguments) || this;
e.weapons_id_melee = [];
e.weapons_id_range = [];
return e;
}
e.prototype.init = function() {
t.prototype.init.call(this);
var e = new p();
e.id = "_equipment";
this.add(e);
this.t.pool = "equipment";
this.t.materials.addRange([ "leather", "copper", "bronze", "silver", "iron", "steel", "mythril", "adamantine" ]);
this.clone("armor", "_equipment");
this.clone("boots", "_equipment");
this.clone("helmet", "_equipment");
var i = new p();
i.id = "_accessory";
this.add(i);
this.t.pool = "equipment";
this.t.materials.addRange([ "bone", "copper", "bronze", "silver", "iron", "steel", "mythril", "adamantine" ]);
this.clone("ring", "_accessory");
this.clone("amulet", "_accessory");
this.clone("_weapon", "_equipment");
this.t.slash = "base";
this.clone("_melee", "_weapon");
this.t.pool = "melee";
this.clone("_range", "_weapon");
this.t.pool = "range";
this.t.attackType = n.Range;
this.t.baseStats.projectiles = 1;
this.clone("base", "_melee");
this.t.slash = "base";
this.clone("hands", "_melee");
this.t.slash = "punch";
this.clone("jaws", "_melee");
this.t.slash = "jaws";
this.clone("claws", "_melee");
this.t.slash = "claws";
this.clone("snowball", "_range");
this.t.slash = "punch";
this.t.baseStats.range = 22;
this.t.baseStats.crit = 10;
this.t.baseStats.damageCritMod = .5;
this.t.projectile = "snowball";
this.t.baseStats.projectiles = 1;
this.t.attackAction.clear();
this.t.attackAction.add(l.default.addFrozenEffectOnTarget20);
this.clone("bow", "_range");
this.t.projectile = "arrow";
this.t.slash = "bow";
this.t.materials.addRange([ "wood", "copper", "bronze", "silver", "iron", "steel", "mythril", "adamantine" ]);
this.t.baseStats.range = 22;
this.t.baseStats.crit = 10;
this.t.baseStats.damageCritMod = .5;
this.clone("flame_sword", "_weapon");
this.t.materials.addRange([ "base" ]);
this.t.suffixes = [ "0", "power", "doom", "terror" ];
this.t.slash = "base";
this.t.baseStats.damage = 30;
this.t.baseStats.attackSpeed = 120;
this.t.baseStats.targets = 2;
this.t.baseStats.damageCritMod = .1;
this.t.equipment_value = 50;
this.t.attackAction.clear();
this.t.attackAction.add(l.default.addBurningEffectOnTarget);
this.clone("necromancer_staff", "_range");
this.t.materials.addRange([ "base" ]);
this.t.suffixes = [ "0", "power", "doom", "terror" ];
this.t.projectile = "bone";
this.t.slash = "punch";
this.t.baseStats.attackSpeed = 20;
this.t.baseStats.range = 22;
this.t.baseStats.crit = 10;
this.t.baseStats.targets = 1;
this.t.baseStats.damageCritMod = .5;
this.t.equipment_value = 50;
this.t.baseStats.damage = 30;
this.clone("evil_staff", "_range");
this.t.materials.addRange([ "base" ]);
this.t.suffixes = [ "0", "power", "doom", "terror" ];
this.t.projectile = "red_orb";
this.t.slash = "punch";
this.t.baseStats.attackSpeed = 20;
this.t.baseStats.range = 22;
this.t.baseStats.crit = 10;
this.t.baseStats.targets = 1;
this.t.baseStats.damageCritMod = .5;
this.t.equipment_value = 50;
this.t.baseStats.projectiles = 20;
this.t.baseStats.damage = 10;
this.clone("white_staff", "_range");
this.t.materials.addRange([ "base" ]);
this.t.suffixes = [ "0", "power", "doom", "terror" ];
this.t.projectile = "freeze_orb";
this.t.slash = "punch";
this.t.baseStats.attackSpeed = 20;
this.t.baseStats.range = 22;
this.t.baseStats.crit = 10;
this.t.baseStats.targets = 1;
this.t.baseStats.damageCritMod = .5;
this.t.baseStats.damage = 35;
this.t.equipment_value = 50;
this.t.attackAction.clear();
this.t.attackAction.add(l.default.addFrozenEffectOnTarget20);
this.clone("plague_doctor_staff", "_weapon");
this.t.materials.addRange([ "base", "health", "protection", "justice", "power" ]);
this.t.suffixes = [ "0", "power" ];
this.t.slash = "punch";
this.t.baseStats.attackSpeed = 20;
this.t.baseStats.crit = 10;
this.t.baseStats.targets = 3;
this.t.baseStats.damageCritMod = .5;
this.t.baseStats.damage = 35;
this.t.equipment_value = 15;
this.clone("druid_staff", "_range");
this.t.materials.addRange([ "base" ]);
this.t.suffixes = [ "0", "power", "doom", "terror" ];
this.t.projectile = "green_orb";
this.t.slash = "punch";
this.t.baseStats.attackSpeed = 35;
this.t.baseStats.range = 22;
this.t.baseStats.crit = 10;
this.t.baseStats.targets = 1;
this.t.baseStats.damageCritMod = .3;
this.t.baseStats.damage = 12;
this.t.equipment_value = 50;
this.t.baseStats.projectiles = 2;
this.t.attackAction.clear();
this.t.attackAction.add(l.default.addSlowEffectOnTarget20);
this.clone("sword", "_melee");
this.t.slash = "sword";
this.t.materials.addRange([ "wood", "stone", "copper", "bronze", "silver", "iron", "steel", "mythril", "adamantine" ]);
this.t.baseStats.damage = 1;
this.t.baseStats.attackSpeed = 40;
this.clone("axe", "_melee");
this.t.slash = "axe";
this.t.materials.addRange([ "wood", "stone", "copper", "bronze", "silver", "iron", "steel", "mythril", "adamantine" ]);
this.t.baseStats.attackSpeed = 20;
this.clone("hammer", "_melee");
this.t.slash = "hammer";
this.t.materials.addRange([ "wood", "stone", "copper", "bronze", "silver", "iron", "steel", "mythril", "adamantine" ]);
this.t.baseStats.attackSpeed = -10;
this.t.baseStats.targets = 1;
this.clone("spear", "_melee");
this.t.slash = "spear";
this.t.materials.addRange([ "wood", "stone", "copper", "bronze", "silver", "iron", "steel", "mythril", "adamantine" ]);
this.t.baseStats.range = 1;
this.t.baseStats.attackSpeed = 15;
this.weapons_id_melee = [];
this.weapons_id_melee.push("sword");
this.weapons_id_melee.push("axe");
this.weapons_id_melee.push("spear");
this.weapons_id_melee.push("hammer");
this.weapons_id_range = [];
this.weapons_id_range.push("bow");
};
e.prototype.getEquipmentID = function(t) {
switch (t) {
case c.EquipmentType.Weapon:
return "weapon";

case c.EquipmentType.Helmet:
return "helmet";

case c.EquipmentType.Armor:
return "armor";

case c.EquipmentType.Boots:
return "boots";

case c.EquipmentType.Ring:
return "ring";

case c.EquipmentType.Amulet:
return "amulet";

default:
return null;
}
};
e.prototype.clone = function(t, e) {
var i = JSON.parse(JSON.stringify(this.get(e))), o = s.default.fromJson(i, new p());
o.attackAction = d.default.create();
o.id = t;
this.add(o);
return o;
};
return e;
}(h.default);
i.default = f;
cc._RF.pop();
}, {
"../../../../../framework/utils/Tools": void 0,
"../../actors/ActionLibrary": "ActionLibrary",
"../../actors/ActorEquipmentSlot": "ActorEquipmentSlot",
"../../base/BaseStats": "BaseStats",
"../../world/WorldAction": "WorldAction",
"../AssetLibrary": "AssetLibrary"
} ],
ItemPrefixLibrary: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "42370C0Gv5K0bgS6yy6FKcw", "ItemPrefixLibrary");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
});
Object.defineProperty(i, "__esModule", {
value: !0
});
var r = t("../AssetLibrary"), n = t("./ItemLibrary"), s = function(t) {
a(e, t);
function e() {
return null !== t && t.apply(this, arguments) || this;
}
e.prototype.init = function() {
t.prototype.init.call(this);
var e = new n.ItemAsset();
e.id = "0";
e.rarity = 60;
e.pool = "melee,range,equipment";
this.add(e);
var i = new n.ItemAsset();
i.id = "uncomfortable";
i.rarity = 30;
i.equipment_value = -10;
i.pool = "equipment";
i.quality = n.ItemQuality.Junk;
this.add(i);
this.t.baseStats.dodge = -10;
var o = new n.ItemAsset();
o.id = "blunt";
o.rarity = 10;
o.equipment_value = -20;
o.pool = "melee";
o.quality = n.ItemQuality.Junk;
this.add(o);
this.t.baseStats.accuracy = -8;
this.t.baseStats.dodge = -5;
var a = new n.ItemAsset();
a.id = "crooked";
a.rarity = 10;
a.equipment_value = -20;
a.pool = "melee";
a.quality = n.ItemQuality.Junk;
this.add(a);
this.t.baseStats.accuracy = -10;
this.t.baseStats.dodge = -10;
this.t.baseStats.armor = -5;
var r = new n.ItemAsset();
r.id = "bad";
r.rarity = 10;
r.equipment_value = -10;
r.pool = "range,melee,equipment";
r.quality = n.ItemQuality.Junk;
this.add(r);
this.t.baseStats.accuracy = -20;
this.t.baseStats.dodge = -5;
this.t.baseStats.attackSpeed = -10;
var s = new n.ItemAsset();
s.id = "ugly";
s.rarity = 5;
s.equipment_value = -30;
s.pool = "melee,equipment";
s.quality = n.ItemQuality.Junk;
this.add(s);
this.t.baseStats.diplomacy = -5;
var l = new n.ItemAsset();
l.id = "broken";
l.rarity = 5;
l.equipment_value = -30;
l.pool = "melee,range,equipment";
l.quality = n.ItemQuality.Junk;
this.add(l);
this.t.baseStats.damage = -3;
this.t.baseStats.accuracy = -3;
this.t.baseStats.attackSpeed = -20;
var c = new n.ItemAsset();
c.id = "good";
c.rarity = 10;
c.equipment_value = 5;
c.pool = "melee,range,equipment";
c.quality = n.ItemQuality.Rare;
this.add(c);
this.t.baseStats.accuracy = 5;
this.t.baseStats.speed = 1;
var u = new n.ItemAsset();
u.id = "fine";
u.rarity = 5;
u.equipment_value = 10;
u.pool = "melee,range,equipment";
u.quality = n.ItemQuality.Rare;
this.add(u);
this.t.baseStats.accuracy = 7;
this.t.baseStats.speed = 1;
this.t.baseStats.damage = 1;
var d = new n.ItemAsset();
d.id = "elegant";
d.rarity = 10, d.equipment_value = 10;
d.pool = "equipment";
d.quality = n.ItemQuality.Rare;
this.add(d);
this.t.baseStats.dodge = 5;
this.t.baseStats.accuracy = 10;
this.t.baseStats.crit = 5;
var h = new n.ItemAsset();
h.id = "sharp";
h.rarity = 5;
h.equipment_value = 10;
h.pool = "melee";
h.quality = n.ItemQuality.Rare;
this.add(h);
this.t.baseStats.damage = 3;
this.t.baseStats.crit = 20;
var p = new n.ItemAsset();
p.id = "huge";
p.rarity = 5;
p.equipment_value = 10;
p.pool = "melee";
p.quality = n.ItemQuality.Rare;
this.add(p);
this.t.baseStats.speed = -2;
this.t.baseStats.damage = 5;
this.t.baseStats.targets = 3;
var f = new n.ItemAsset();
f.id = "great";
f.rarity = 4;
f.equipment_value = 20;
f.pool = "melee,equipment,range";
f.quality = n.ItemQuality.Epic;
this.add(f);
this.t.baseStats.damage = 4;
var m = new n.ItemAsset();
m.id = "perfect";
m.rarity = 3;
m.equipment_value = 20;
m.pool = "melee,equipment,range";
m.quality = n.ItemQuality.Epic;
this.add(m);
this.t.baseStats.health = 20;
this.t.baseStats.damage = 2;
var y = new n.ItemAsset();
y.id = "battle";
y.rarity = 3;
y.equipment_value = 20;
y.pool = "melee";
y.quality = n.ItemQuality.Legendary;
this.add(y);
this.t.baseStats.damage = 5;
this.t.baseStats.crit = 20;
this.t.baseStats.armor = 3;
this.t.baseStats.targets = 1;
var _ = new n.ItemAsset();
_.id = "death";
_.rarity = 3;
_.equipment_value = 30;
_.pool = "melee,range";
_.quality = n.ItemQuality.Legendary;
this.add(_);
this.t.baseStats.damage = 20;
this.t.baseStats.health = -60;
this.t.baseStats.armor = -2;
this.t.baseStats.targets = 1;
var g = new n.ItemAsset();
g.id = "monster";
g.rarity = 3;
g.equipment_value = 40;
g.pool = "melee,range";
g.quality = n.ItemQuality.Legendary;
this.add(g);
this.t.baseStats.health = 100;
this.t.baseStats.damage = 10;
this.t.baseStats.crit = 5;
this.t.baseStats.targets = 2;
var v = new n.ItemAsset();
v.id = "wild";
v.rarity = 3;
v.equipment_value = 30;
v.pool = "melee,range";
v.quality = n.ItemQuality.Legendary;
this.add(v);
this.t.baseStats.speed = 5;
this.t.baseStats.crit = 30;
this.t.baseStats.damage = 6;
this.t.baseStats.targets = 1;
};
return e;
}(r.default);
i.default = s;
cc._RF.pop();
}, {
"../AssetLibrary": "AssetLibrary",
"./ItemLibrary": "ItemLibrary"
} ],
ItemSuffixLibrary: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "86a67jdWj1DS4YVdpCG19M4", "ItemSuffixLibrary");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
});
Object.defineProperty(i, "__esModule", {
value: !0
});
var r = t("../AssetLibrary"), n = t("./ItemLibrary"), s = function(t) {
a(e, t);
function e() {
return null !== t && t.apply(this, arguments) || this;
}
e.prototype.init = function() {
t.prototype.init.call(this);
var e = new n.ItemAsset();
e.id = "0";
e.rarity = 40;
e.pool = "melee,equipment,range";
this.add(e);
var i = new n.ItemAsset();
i.id = "balance";
i.rarity = 2;
i.equipment_value = 5;
i.pool = "melee,range";
i.quality = n.ItemQuality.Rare;
this.add(i);
this.t.baseStats.crit = 30;
var o = new n.ItemAsset();
o.id = "justice";
o.rarity = 1;
o.equipment_value = 10;
o.pool = "melee,equipment,range";
o.quality = n.ItemQuality.Rare;
this.add(o);
this.t.baseStats.armor = 5;
this.t.baseStats.health = 20;
var a = new n.ItemAsset();
a.id = "truth";
a.rarity = 1;
a.equipment_value = 10;
a.pool = "melee,equipment,range";
a.quality = n.ItemQuality.Rare;
this.add(a);
this.t.baseStats.diplomacy = 1;
var r = new n.ItemAsset();
r.id = "speed";
r.rarity = 3;
r.equipment_value = 10;
r.pool = "melee,equipment,range";
r.quality = n.ItemQuality.Rare;
this.add(r);
this.t.baseStats.speed = 6;
var s = new n.ItemAsset();
s.id = "health";
s.rarity = 1;
s.equipment_value = 10;
s.pool = "melee,equipment,range";
s.quality = n.ItemQuality.Epic;
this.add(s);
this.t.baseStats.health = 100;
var l = new n.ItemAsset();
l.id = "protection";
l.rarity = 1;
l.equipment_value = 15;
l.pool = "melee,equipment,range";
l.quality = n.ItemQuality.Epic;
this.add(l);
this.t.baseStats.armor = 6;
var c = new n.ItemAsset();
c.id = "greatness";
c.rarity = 1;
c.equipment_value = 20;
c.pool = "melee,equipment,range";
c.quality = n.ItemQuality.Epic;
this.add(c);
this.t.baseStats.dodge = 10;
var u = new n.ItemAsset();
u.id = "power";
u.rarity = 3;
u.equipment_value = 25;
u.pool = "melee,equipment,range";
u.quality = n.ItemQuality.Epic;
this.add(u);
this.t.baseStats.damage = 5;
var d = new n.ItemAsset();
d.id = "hell";
d.rarity = 1;
d.equipment_value = 30;
d.pool = "melee,equipment";
d.quality = n.ItemQuality.Legendary;
this.add(d);
this.t.baseStats.damage = 10;
var h = new n.ItemAsset();
h.id = "doom";
h.rarity = 1;
h.equipment_value = 31;
h.pool = "melee,equipment,range";
h.quality = n.ItemQuality.Legendary;
this.add(h);
this.t.baseStats.damage = 10;
this.t.baseStats.accuracy = 10;
this.t.baseStats.crit = 20;
var p = new n.ItemAsset();
p.id = "terror";
p.rarity = 1;
p.equipment_value = 35;
p.pool = "melee,equipment,range";
p.quality = n.ItemQuality.Legendary;
this.add(p);
this.t.baseStats.health = 100;
this.t.baseStats.damage = 10;
this.t.baseStats.crit = 30;
this.t.baseStats.attackSpeed = 10;
this.t.baseStats.speed = 10;
this.t.baseStats.armor = 5;
};
return e;
}(r.default);
i.default = s;
cc._RF.pop();
}, {
"../AssetLibrary": "AssetLibrary",
"./ItemLibrary": "ItemLibrary"
} ],
ItemTools: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "1a050wPjSpKbJT78ZbNawyo", "ItemTools");
Object.defineProperty(i, "__esModule", {
value: !0
});
var o = t("../actors/ActorEquipmentSlot"), a = t("../assetLibrary/AssetManager"), r = t("../assetLibrary/lib/ItemLibrary"), n = t("../base/BaseStats"), s = function() {
function t() {}
t.calcItemValues = function(e) {
t.s_stats.clear();
t.s_value = 0;
t.s_quality = r.ItemQuality.Normal;
t.checkStat(t.getItemMaterialLibrary(e.type, e.material));
t.checkStat(a.default.items.get(e.id));
t.checkStat(a.default.items_prefix.get(e.prefix));
t.checkStat(a.default.items_suffix.get(e.suffix));
};
t.checkStat = function(e) {
0 != t.s_quality && (e.quality == r.ItemQuality.Junk ? t.s_quality = r.ItemQuality.Junk : e.quality > t.s_quality && (t.s_quality = e.quality));
t.s_stats.addStats(e.baseStats);
t.s_value += e.equipment_value;
};
t.getItemMaterialLibrary = function(t, e) {
var i = null;
switch (t) {
case o.EquipmentType.Helmet:
case o.EquipmentType.Armor:
case o.EquipmentType.Boots:
i = a.default.items_material_armor.get(e);
break;

case o.EquipmentType.Weapon:
i = a.default.items_material_weapon.get(e);
break;

case o.EquipmentType.Ring:
case o.EquipmentType.Amulet:
i = a.default.items_material_accessory.get(e);
}
return i;
};
t.getItemClass = function(t) {
var e = "";
switch (t) {
case o.EquipmentType.Helmet:
case o.EquipmentType.Armor:
case o.EquipmentType.Boots:
e = "item_class_armor";
break;

case o.EquipmentType.Weapon:
e = "item_class_weapon";
break;

case o.EquipmentType.Ring:
case o.EquipmentType.Amulet:
e = "item_class_accessory";
}
return e;
};
t.s_value = 0;
t.s_quality = r.ItemQuality.Normal;
t.s_stats = new n.default();
return t;
}();
i.default = s;
cc._RF.pop();
}, {
"../actors/ActorEquipmentSlot": "ActorEquipmentSlot",
"../assetLibrary/AssetManager": "AssetManager",
"../assetLibrary/lib/ItemLibrary": "ItemLibrary",
"../base/BaseStats": "BaseStats"
} ],
ItemWeaponMaterialLibrary: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "07711XVKW5Pyp+gIshBDMG0", "ItemWeaponMaterialLibrary");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
});
Object.defineProperty(i, "__esModule", {
value: !0
});
var r = t("../AssetLibrary"), n = t("./ItemLibrary"), s = function(t) {
a(e, t);
function e() {
return null !== t && t.apply(this, arguments) || this;
}
e.prototype.init = function() {
t.prototype.init.call(this);
var e = new n.ItemAsset();
e.id = "base";
this.add(e);
var i = new n.ItemAsset();
i.id = "wood";
i.equipment_value = 1;
i.level = 1;
this.add(i);
this.t.setCost(1, "wood", 1);
this.t.baseStats.damage = 1;
this.t.baseStats.attackSpeed = 1;
var o = new n.ItemAsset();
o.id = "stone";
o.equipment_value = 10;
o.level = 1;
this.add(o);
this.t.setCost(1, "stone", 1);
this.t.baseStats.damage = 3;
this.t.baseStats.speed = -2;
this.t.baseStats.attackSpeed = -10;
var a = new n.ItemAsset();
a.id = "copper";
a.equipment_value = 10;
a.level = 2;
this.add(a);
this.t.setCost(1, "metals", 1);
this.t.baseStats.damage = 3;
this.t.baseStats.attackSpeed = 2;
var r = new n.ItemAsset();
r.id = "bronze";
r.equipment_value = 15;
r.level = 3;
this.add(r);
this.t.setCost(5, "metals", 1);
this.t.baseStats.damage = 4;
this.t.baseStats.attackSpeed = 5;
var s = new n.ItemAsset();
s.id = "silver";
s.equipment_value = 20;
s.level = 4;
this.add(s);
this.t.setCost(10, "metals", 1);
this.t.baseStats.damage = 5;
this.t.baseStats.damage = 1;
this.t.baseStats.attackSpeed = 8;
var l = new n.ItemAsset();
l.id = "iron";
l.equipment_value = 30;
l.level = 5;
this.add(l);
this.t.setCost(15, "metals", 2);
this.t.baseStats.damage = 6;
this.t.baseStats.attackSpeed = 10;
this.t.baseStats.crit = 5;
var c = new n.ItemAsset();
c.id = "steel";
c.equipment_value = 40;
c.level = 6;
this.add(c);
this.t.setCost(20, "metals", 3);
this.t.baseStats.damage = 7;
this.t.baseStats.speed = 1;
this.t.baseStats.attackSpeed = 10;
this.t.baseStats.crit = 5;
var u = new n.ItemAsset();
u.id = "mythril";
u.equipment_value = 50;
u.level = 7;
this.add(u);
this.t.setCost(50, "metals", 4);
this.t.baseStats.damage = 8;
this.t.baseStats.attackSpeed = 10;
this.t.baseStats.crit = 5;
var d = new n.ItemAsset();
d.id = "adamantine";
d.equipment_value = 70;
d.level = 8;
this.add(d);
this.t.setCost(100, "metals", 5);
this.t.baseStats.damage = 10;
this.t.baseStats.speed = 1;
this.t.baseStats.attackSpeed = 15;
this.t.baseStats.crit = 15;
};
return e;
}(r.default);
i.default = s;
cc._RF.pop();
}, {
"../AssetLibrary": "AssetLibrary",
"./ItemLibrary": "ItemLibrary"
} ],
KingdomBehCheckCapital: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "10994Qpas9A5buRhtnozDq7", "KingdomBehCheckCapital");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
});
Object.defineProperty(i, "__esModule", {
value: !0
});
var r = t("../../behaviour/BehaviourActionBase"), n = function(t) {
a(e, t);
function e() {
var e = t.call(this) || this;
e.id = "KingdomBehCheckCapital";
return e;
}
e.prototype.execute = function(t) {
if (0 == t.cities.length) return r.BehResult.Continue;
if (t.capital && t.capital.alive) return r.BehResult.Continue;
t.cities.shuffle();
var e = null;
t.cities.forEach(function(t) {
(!e || t.buildings.length > e.buildings.length) && (e = t);
});
t.capital = e;
t.data.capitalID = t.capital.data.cityID;
t.location = t.capital.cityCenter;
return r.BehResult.Continue;
};
return e;
}(r.BehaviourActionKingdom);
i.default = n;
cc._RF.pop();
}, {
"../../behaviour/BehaviourActionBase": "BehaviourActionBase"
} ],
KingdomBehCheckKing: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "b760bAnosFBzbg8FWSgcbg9", "KingdomBehCheckKing");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
}), r = this && this.__values || function(t) {
var e = "function" == typeof Symbol && Symbol.iterator, i = e && t[e], o = 0;
if (i) return i.call(t);
if (t && "number" == typeof t.length) return {
next: function() {
t && o >= t.length && (t = void 0);
return {
value: t && t[o++],
done: !t
};
}
};
throw new TypeError(e ? "Object is not iterable." : "Symbol.iterator is not defined.");
};
Object.defineProperty(i, "__esModule", {
value: !0
});
var n = t("../../../../../framework/utils/Log"), s = t("../../actors/ActorTool"), l = t("../../behaviour/BehaviourActionBase"), c = t("../../city/City"), u = t("../../MapBox"), d = t("../../ui/log/WorldLog"), h = function(t) {
a(e, t);
function e() {
var e = t.call(this) || this;
e._units = [];
e._new_kingdoms = [];
e.id = "KingdomBehCheckKing";
return e;
}
e.prototype.execute = function(t) {
var e, i, o, a;
if ((null === (i = null === (e = t.king) || void 0 === e ? void 0 : e.data) || void 0 === i ? void 0 : i.alive) || (null === (o = t.data) || void 0 === o ? void 0 : o.timer_new_king) > 0) return l.BehResult.Continue;
this._new_kingdoms.clear();
t.clearKingData();
this._units.clear();
this.findKing(t);
(null === (a = t.capital) || void 0 === a ? void 0 : a.leader) && this._units.remove(t.capital.leader);
this.checkIndependants(t);
return l.BehResult.Continue;
};
e.prototype.findKing = function(t) {
var e = this;
t.cities.forEach(function(t) {
var i, o;
(null === (o = null === (i = t.leader) || void 0 === i ? void 0 : i.data) || void 0 === o ? void 0 : o.alive) && e._units.push(t.leader);
});
if (0 != this._units.length) {
this._units.shuffle();
var i = null, o = 0;
this._units.forEach(function(t) {
var e = s.default.attributeDice(t);
if (!i || e > o) {
o = e;
i = t;
}
});
if (i) {
this._units.remove(i);
i.city.leader == i && i.city.removeLeader();
t.setKing(i);
d.default.logNewKing(t);
}
}
};
e.prototype.checkIndependants = function(t) {
var e = this;
if (u.default.inst.worldLaws.world_law_rebellions.boolVal && u.default.inst.worldLaws.world_law_diplomacy.boolVal && t.data.check_for_independence) {
t.data.check_for_independence = !1;
if (0 != this._units.length && t.king) {
var i = s.default.attributeDice(t.king, 3);
this._units.forEach(function(t) {
var o = s.default.attributeDice(t);
i <= o && e.makeOrJoinKingdom(t);
});
}
}
};
e.prototype.makeOrJoinKingdom = function(t) {
var e, i, o, a, l, u;
if (0 == this._new_kingdoms.length) this.makeOwnKingdom(t); else {
if ((null === (u = null === (l = t.city) || void 0 === l ? void 0 : l.data) || void 0 === u ? void 0 : u.timer_revolt) > 0) return;
this._new_kingdoms.shuffle();
try {
for (var d = r(this._new_kingdoms), h = d.next(); !h.done; h = d.next()) {
var p = h.value;
p.king || n.default.d("HUH");
var f = s.default.attributeDice(p.king);
if (!(s.default.attributeDice(t) > f)) try {
for (var m = (o = void 0, r(p.cities)), y = m.next(); !y.done; y = m.next()) {
var _ = y.value;
if (c.default.nearbyBorders(t.city, _)) {
t.city.joinAnotherKingdom(p);
return;
}
}
} catch (t) {
o = {
error: t
};
} finally {
try {
y && !y.done && (a = m.return) && a.call(m);
} finally {
if (o) throw o.error;
}
}
}
} catch (t) {
e = {
error: t
};
} finally {
try {
h && !h.done && (i = d.return) && i.call(d);
} finally {
if (e) throw e.error;
}
}
this.makeOwnKingdom(t);
}
};
e.prototype.makeOwnKingdom = function(t) {
var e = t.city.makeOwnKingdom();
t.city.removeLeader();
e.setKing(t);
this._new_kingdoms.push(e);
};
return e;
}(l.BehaviourActionKingdom);
i.default = h;
cc._RF.pop();
}, {
"../../../../../framework/utils/Log": void 0,
"../../MapBox": "MapBox",
"../../actors/ActorTool": "ActorTool",
"../../behaviour/BehaviourActionBase": "BehaviourActionBase",
"../../city/City": "City",
"../../ui/log/WorldLog": "WorldLog"
} ],
KingdomBehRandomWait: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "6b1c9bsUB1EsZxJMjV9tdF9", "KingdomBehRandomWait");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
});
Object.defineProperty(i, "__esModule", {
value: !0
});
var r = t("../../behaviour/BehaviourActionBase"), n = t("../../common/ToolBox"), s = function(t) {
a(e, t);
function e(e, i) {
void 0 === e && (e = 0);
void 0 === i && (i = 1);
var o = t.call(this) || this;
o.min = 0;
o.max = 0;
o.min = e;
o.max = i;
o.id = "KingdomBehRandomWait";
return o;
}
e.prototype.execute = function(t) {
t.timer_action = n.Toolbox.randomFloat(this.min, this.max);
return r.BehResult.Continue;
};
return e;
}(r.BehaviourActionKingdom);
i.default = s;
cc._RF.pop();
}, {
"../../behaviour/BehaviourActionBase": "BehaviourActionBase",
"../../common/ToolBox": "ToolBox"
} ],
KingdomCheckAttackTarget: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "6cd1eDVQZZGqJYntb/OrRqY", "KingdomCheckAttackTarget");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
});
Object.defineProperty(i, "__esModule", {
value: !0
});
var r = t("../../behaviour/BehaviourActionBase"), n = t("../../common/ToolBox"), s = t("../../kingdom/Kingdom"), l = function(t) {
a(e, t);
function e() {
var e = t.call(this) || this;
e.id = "KingdomCheckAttackTarget";
return e;
}
e.prototype.execute = function(t) {
if (t.data.timer_attack_target > 0) return r.BehResult.Continue;
t.data.timer_attack_target = 10;
if (0 == t.civs_enemies.size) return r.BehResult.Continue;
if (!t.king) return r.BehResult.Continue;
if (t.target_kingdom && t.target_kingdom.isEnemy(t)) return r.BehResult.Continue;
if (!t.diceAgressionSuccess()) {
t.target_kingdom = null;
return r.BehResult.Continue;
}
var e = null, i = 0, o = 0;
t.civs_enemies.forEach(function(a, r) {
if (0 != r.cities.length) {
i = s.default.distanceBetweenKingdom(t, r);
if (!e || i < o) {
e = r;
o = i;
}
}
});
if (!e) return r.BehResult.Continue;
t.data.timer_attack_target = 300 + n.Toolbox.randomFloat(0, 200);
this.startAttackOn(t, e);
return r.BehResult.Continue;
};
e.prototype.startAttackOn = function(t, e) {
if (0 != e.cities.length && t.capital) {
t.data.eventState = s.KingdomEventState.Wait;
t.target_kingdom = e;
t.findCityTarget();
}
};
return e;
}(r.BehaviourActionKingdom);
i.default = l;
cc._RF.pop();
}, {
"../../behaviour/BehaviourActionBase": "BehaviourActionBase",
"../../common/ToolBox": "ToolBox",
"../../kingdom/Kingdom": "Kingdom"
} ],
KingdomCheckDeadKingdom: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "debd5wccYdGo4T6hPJ03sgX", "KingdomCheckDeadKingdom");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
});
Object.defineProperty(i, "__esModule", {
value: !0
});
var r = t("../../behaviour/BehaviourActionBase"), n = t("../../MapBox"), s = function(t) {
a(e, t);
function e() {
var e = t.call(this) || this;
e.id = "KingdomCheckDeadKingdom";
return e;
}
e.prototype.execute = function(t) {
if (t.data.timer_no_city > 200) {
n.default.inst.kingdoms.destroyKingdom(t);
return r.BehResult.Stop;
}
return r.BehResult.Continue;
};
return e;
}(r.BehaviourActionKingdom);
i.default = s;
cc._RF.pop();
}, {
"../../MapBox": "MapBox",
"../../behaviour/BehaviourActionBase": "BehaviourActionBase"
} ],
KingdomCheckDiplomacy: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "40c7dOmID1NkLILxrly424c", "KingdomCheckDiplomacy");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
}), r = this && this.__values || function(t) {
var e = "function" == typeof Symbol && Symbol.iterator, i = e && t[e], o = 0;
if (i) return i.call(t);
if (t && "number" == typeof t.length) return {
next: function() {
t && o >= t.length && (t = void 0);
return {
value: t && t[o++],
done: !t
};
}
};
throw new TypeError(e ? "Object is not iterable." : "Symbol.iterator is not defined.");
};
Object.defineProperty(i, "__esModule", {
value: !0
});
var n = t("../../behaviour/BehaviourActionBase"), s = t("../../common/ToolBox"), l = t("../../kingdom/DiplomacyManager"), c = t("../../kingdom/DiplomacyRelation"), u = t("../../kingdom/Kingdom"), d = t("../../MapBox"), h = function(t) {
a(e, t);
function e() {
var e = t.call(this) || this;
e.id = "KingdomCheckDiplomacy";
return e;
}
e.prototype.execute = function(t) {
if (!d.default.inst.worldLaws.world_law_diplomacy.boolVal) return n.BehResult.Stop;
if (0 == t.cities.length) return n.BehResult.Stop;
e._tempKingdoms.clear();
this.tryNewPeace(t);
this.tryNewWar(t);
return n.BehResult.Continue;
};
e.prototype.tryNewWar = function(t) {
var e, i, o = t.countArmy();
if (!(o < 10) && t.diceAgressionSuccess()) {
var a = null, n = 0, s = 0, l = Array.from(t.civs_allies.keys());
try {
for (var h = r(l), p = h.next(); !p.done; p = h.next()) {
var f = p.value;
if (!(f == t || o < f.countArmy() && 0 == f.civs_enemies.size)) {
var m = d.default.inst.kingdoms.diplomacyManager.getRelation(t, f);
if (!(m.data.stateChanged < 22)) {
m.recalculate();
if (d.default.inst.kingdoms.diplomacyManager.getOpinion(t, f)._opinion_total <= 0) {
n = u.default.distanceBetweenKingdom(t, f);
if (!a || n < s) {
s = n;
a = f;
}
}
}
}
}
} catch (t) {
e = {
error: t
};
} finally {
try {
p && !p.done && (i = h.return) && i.call(h);
} finally {
if (e) throw e.error;
}
}
a && this.newDiplomacyEvent(t, a, c.DiplomacyState.War);
}
};
e.prototype.tryNewPeace = function(t) {
var i = this;
t.civs_enemies.forEach(function(t, i) {
e._tempKingdoms.push(i);
});
e._tempKingdoms.forEach(function(e) {
i.newDiplomacyEvent(t, e, c.DiplomacyState.Ally);
});
};
e.prototype.newDiplomacyEvent = function(t, e, i) {
if (t.king && 0 != e.cities.length && t != e) {
var o = d.default.inst.kingdoms.diplomacyManager.getRelation(t, e);
if (!(o.data.stateChanged < 22)) {
o.recalculate();
var a = d.default.inst.kingdoms.diplomacyManager.getOpinion(t, e), r = 0;
o.data.state == c.DiplomacyState.War && (r = d.default.inst.mapStats.year - o.data.warSince);
var n = !1;
a._opinion_total < 0 && (n = !0);
t == l.default.kingdom_supreme && e == l.default.kingdom_second && (n = !0);
switch (i) {
case c.DiplomacyState.War:
var u = t.king.curStats.personality_aggression;
if (t.power > e.power) {
t.cities.length > t.getMaxCities() ? u -= .1 * (t.cities.length - t.getMaxCities()) : t.cities.length < t.getMaxCities() && t.diceAgressionSuccess() && (u += .1);
n && (u += .05);
}
t.power < e.power && (u -= e.power / t.power * .2);
t.civs_enemies.size > 0 && (u -= .3 * t.civs_enemies.size);
s.Toolbox.randomChance(u) && d.default.inst.kingdoms.diplomacyManager.startWar(t, e);
break;

case c.DiplomacyState.Ally:
var h = t.king.curStats.personality_diplomatic;
r > 10 && (h += .1);
t.diceAgressionSuccess() || (h += .1);
t.power < e.power && (h += .05);
s.Toolbox.randomChance(h) && d.default.inst.kingdoms.diplomacyManager.startPeace(t, e);
}
}
}
};
e._tempKingdoms = [];
return e;
}(n.BehaviourActionKingdom);
i.default = h;
cc._RF.pop();
}, {
"../../MapBox": "MapBox",
"../../behaviour/BehaviourActionBase": "BehaviourActionBase",
"../../common/ToolBox": "ToolBox",
"../../kingdom/DiplomacyManager": "DiplomacyManager",
"../../kingdom/DiplomacyRelation": "DiplomacyRelation",
"../../kingdom/Kingdom": "Kingdom"
} ],
KingdomCheckRevolts: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "cd333WqAEJBZLB8iuyNMjGb", "KingdomCheckRevolts");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
}), r = this && this.__values || function(t) {
var e = "function" == typeof Symbol && Symbol.iterator, i = e && t[e], o = 0;
if (i) return i.call(t);
if (t && "number" == typeof t.length) return {
next: function() {
t && o >= t.length && (t = void 0);
return {
value: t && t[o++],
done: !t
};
}
};
throw new TypeError(e ? "Object is not iterable." : "Symbol.iterator is not defined.");
};
Object.defineProperty(i, "__esModule", {
value: !0
});
var n = t("../../actors/ActorTool"), s = t("../../behaviour/BehaviourActionBase"), l = t("../../MapBox"), c = t("../../ui/log/WorldLog"), u = function(t) {
a(e, t);
function e() {
var e = t.call(this) || this;
e.id = "KingdomCheckRevolts";
return e;
}
e.prototype.execute = function(t) {
var i, o, a, u, d;
if (!l.default.inst.worldLaws.world_law_diplomacy.boolVal) return s.BehResult.Stop;
if (!l.default.inst.worldLaws.world_law_rebellions.boolVal) return s.BehResult.Stop;
if (t.data.timer_loyalty > 0) return s.BehResult.Stop;
if (!t.king) return s.BehResult.Stop;
e._temp_cities.clear();
t.data.timer_loyalty = n.default.attributeDice(t.king, 10);
var h = 0, p = null;
try {
for (var f = r(t.cities), m = f.next(); !m.done; m = f.next()) {
var y = m.value;
if (y != t.capital && y != (null === (d = t.king) || void 0 === d ? void 0 : d.city)) {
y.getRelationRating();
if (y.leader) if (y._opinion_total >= 0) ; else {
h++;
if (!(y.captureTicks > 0) && !(y.data.timer_revolt > 0) && y.getArmy() >= y.getArmyMaxCity() / 2 && y.getArmy() >= 10) {
e._temp_cities.push(y);
(!p || y._opinion_total < p._opinion_total) && (p = y);
}
}
}
}
} catch (t) {
i = {
error: t
};
} finally {
try {
m && !m.done && (o = f.return) && o.call(f);
} finally {
if (i) throw i.error;
}
}
if (!p) return s.BehResult.Stop;
e._temp_cities.remove(p);
var _ = 4 + this.getBonusDice(p._opinion_total), g = n.default.attributeDice(t.king, 4);
if (n.default.attributeDice(p.leader, _) + 2 * h > g) {
c.default.logCityRevolt(p);
var v = p.kingdom, b = p.makeOwnKingdom();
l.default.inst.kingdoms.diplomacyManager.startWar(b, v, !0);
var T = p.leader.curStats.cities, w = 0;
_ = 4;
try {
for (var B = r(e._temp_cities), k = B.next(); !k.done; k = B.next()) {
var A = k.value;
_ = 4 + this.getBonusDice(p._opinion_total);
g = n.default.attributeDice(t.king, 4);
if (n.default.attributeDice(A.leader, _) + 2 * h + 5 * w > g) {
A.joinAnotherKingdom(b);
if (++w >= T) break;
}
}
} catch (t) {
a = {
error: t
};
} finally {
try {
k && !k.done && (u = B.return) && u.call(B);
} finally {
if (a) throw a.error;
}
}
return s.BehResult.Continue;
}
return s.BehResult.Continue;
};
e.prototype.getBonusDice = function(t) {
return t > 0 ? 0 : Math.abs(t) / 20;
};
e._temp_cities = [];
return e;
}(s.BehaviourActionKingdom);
i.default = u;
cc._RF.pop();
}, {
"../../MapBox": "MapBox",
"../../actors/ActorTool": "ActorTool",
"../../behaviour/BehaviourActionBase": "BehaviourActionBase",
"../../ui/log/WorldLog": "WorldLog"
} ],
KingdomColorContainer: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "c19d3xHrLRKCIZz08m+9rDK", "KingdomColorContainer");
Object.defineProperty(i, "__esModule", {
value: !0
});
var o = t("../common/ToolBox"), a = t("../MapBox"), r = t("./KingdomColor"), n = function() {
function t() {
this.race = "";
this.curColor = 0;
this.list = [];
}
t.prototype.addColor = function(t, e, i, o) {
void 0 === o && (o = "");
var a = new r.default(t, e, i);
a.name = o;
a.id = this.list.length;
this.list.push(a);
};
t.prototype.prepare = function() {
this.curColor = 0;
for (var t = 0; t < this.list.length; t++) if (!this.haveColorInWorld(t)) {
this.curColor = t;
return;
}
this.curColor = o.Toolbox.randomInt(0, this.list.length);
};
t.prototype.haveColorInWorld = function(t) {
for (var e = 0; e < a.default.inst.kingdoms.list_civs.length; e++) {
var i = a.default.inst.kingdoms.list_civs[e];
if (i.data.raceID == this.race && i.data.colorID == t) return !0;
}
return !1;
};
t.prototype.getColor = function(t) {
t > this.list.length - 1 && (t = 0);
return this.list[t];
};
return t;
}();
i.default = n;
cc._RF.pop();
}, {
"../MapBox": "MapBox",
"../common/ToolBox": "ToolBox",
"./KingdomColor": "KingdomColor"
} ],
KingdomColors: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "99c80HxCI5BRL7NnMbA/QIX", "KingdomColors");
Object.defineProperty(i, "__esModule", {
value: !0
});
i.KingdomColorsData = void 0;
var o = t("../../../../framework/manager/ResMgr"), a = t("./KingdomColor"), r = t("./KingdomColorContainer");
i.KingdomColorsData = function() {
this.colors = [];
};
var n = function() {
function t() {}
t.init = function() {
o.default.loadRes("res/json/kingdom_colors", cc.JsonAsset).then(function(e) {
var i = function(i) {
if (Object.prototype.hasOwnProperty.call(e.json.colors, i)) {
var o = e.json.colors[i], a = new r.default();
for (var n in o) a[n] = o[n];
var s = [];
a.list.forEach(function(e) {
var i = t.deserializedKingdomColor(e);
i.initColor();
s.push(i);
});
a.list = s;
t.dict.set(a.race, a);
}
};
for (var o in e.json.colors) i(o);
});
};
t.getColor = function(e, i) {
return t.getContainer(e).getColor(i);
};
t.getContainer = function(e) {
return t.dict.get(e);
};
t.deserializedKingdomColor = function(e) {
var i = new a.default();
i.id = e.id;
i.name = e.name;
i.colorBorderInside = t.buildColor(e.colorBorderInside);
i.colorBorderOut = t.buildColor(e.colorBorderOut);
i.colorBorderBannerIcon = t.buildColor(e.colorBorderBannerIcon);
return i;
};
t.buildColor = function(t) {
return cc.color(255 * t.r, 255 * t.g, 255 * t.b, 255 * t.a);
};
t.dict = new Map();
return t;
}();
i.default = n;
cc._RF.pop();
}, {
"../../../../framework/manager/ResMgr": void 0,
"./KingdomColor": "KingdomColor",
"./KingdomColorContainer": "KingdomColorContainer"
} ],
KingdomColor: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "6891eVepQVMUIeIKmSbTA8N", "KingdomColor");
Object.defineProperty(i, "__esModule", {
value: !0
});
var o = t("../common/ToolBox"), a = function() {
function t(t, e, i) {
void 0 === t && (t = "#FFFFFF");
void 0 === e && (e = "#FFFFFF");
void 0 === i && (i = "#FFFFFF");
this.name = "not_set";
this.colorBorderInside = o.Toolbox.makeColor(t);
this.colorBorderOut = o.Toolbox.makeColor(e);
this.colorBorderBannerIcon = o.Toolbox.makeColor(i);
this.initColor();
}
t.prototype.initColor = function() {
this.colorBorderInsideAlpha = cc.color(this.colorBorderInside.r, this.colorBorderInside.g, this.colorBorderInside.b, 178.5);
};
return t;
}();
i.default = a;
cc._RF.pop();
}, {
"../common/ToolBox": "ToolBox"
} ],
KingdomElement: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "61779/NbJdFf5diN0Ojr4nG", "KingdomElement");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
}), r = this && this.__decorate || function(t, e, i, o) {
var a, r = arguments.length, n = r < 3 ? e : null === o ? o = Object.getOwnPropertyDescriptor(e, i) : o;
if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) n = Reflect.decorate(t, e, i, o); else for (var s = t.length - 1; s >= 0; s--) (a = t[s]) && (n = (r < 3 ? a(n) : r > 3 ? a(e, i, n) : a(e, i)) || n);
return r > 3 && n && Object.defineProperty(e, i, n), n;
}, n = this && this.__values || function(t) {
var e = "function" == typeof Symbol && Symbol.iterator, i = e && t[e], o = 0;
if (i) return i.call(t);
if (t && "number" == typeof t.length) return {
next: function() {
t && o >= t.length && (t = void 0);
return {
value: t && t[o++],
done: !t
};
}
};
throw new TypeError(e ? "Object is not iterable." : "Symbol.iterator is not defined.");
};
Object.defineProperty(i, "__esModule", {
value: !0
});
var s = t("../../common/ToolBox"), l = t("../../common/ViewController"), c = t("../../Config"), u = t("../../texture/TextureLoader"), d = cc._decorator, h = d.ccclass, p = d.property, f = function(t) {
a(e, t);
function e() {
var e = null !== t && t.apply(this, arguments) || this;
e.iconRace = null;
e.textPopulation = null;
e.textArmy = null;
e.textCities = null;
e.textHouses = null;
e.textZones = null;
e.kingdomName = null;
e.buttonCapital = null;
e.buttonKing = null;
e.banner = null;
e.kingdom = null;
return e;
}
e.prototype.initItem = function(t) {
var e, i, o;
this.kingdom = t;
this.kingdomName.string = t.data.name;
this.kingdomName.node.color = null === (o = t.kingdomColor) || void 0 === o ? void 0 : o.colorBorderOut;
this.iconRace.spriteFrame = u.TextureLoader.inst.getSpriteFrame(u.ATLAS_TYPE.UIATLAS, "icons/" + t.race.icon);
var a = 0, r = 0, s = t.cities.length;
try {
for (var l = n(t.cities), c = l.next(); !c.done; c = l.next()) {
var d = c.value;
a += d.zones.length;
r += d.buildings.count;
}
} catch (t) {
e = {
error: t
};
} finally {
try {
c && !c.done && (i = l.return) && i.call(l);
} finally {
if (e) throw e.error;
}
}
this.textPopulation.string = "" + t.getPopulationTotal();
this.textArmy.string = "" + t.countArmy();
this.textZones.string = "" + a;
this.textHouses.string = "" + r;
this.textCities.string = "" + s;
this.buttonKing.active = null != t.king;
this.buttonCapital.active = null != t.capital;
this.showBanner();
};
e.prototype.showBanner = function() {
var t, e = "banners/" + this.kingdom.race.bannerId + "/background/banner_part_background" + s.Toolbox.randomInt(0, 8), i = "banners/" + this.kingdom.race.bannerId + "/icon/banner_part_object" + s.Toolbox.randomInt(0, 8), o = this.banner.getComponent(cc.Sprite);
o.node.color = null === (t = this.kingdom.kingdomColor) || void 0 === t ? void 0 : t.colorBorderOut;
o.spriteFrame = u.TextureLoader.inst.getSpriteFrame(u.ATLAS_TYPE.WORLDATLAS, e);
var a = this.banner.getChildByName("icon").getComponent(cc.Sprite);
a.node.color = this.kingdom.kingdomColor.colorBorderBannerIcon;
a.spriteFrame = u.TextureLoader.inst.getSpriteFrame(u.ATLAS_TYPE.WORLDATLAS, i);
};
e.prototype.clickKingdomElement = function() {
c.default.selectedKingdom = this.kingdom;
l.default.open(l.view_type.KingdomWindow);
};
e.prototype.clickKing = function() {
c.default.selectedKingdom = this.kingdom;
c.default.selectedUnit = this.kingdom.king;
c.default.selectedUnit && l.default.open(l.view_type.CreatureInfo);
};
e.prototype.clickCapital = function() {
c.default.selectedKingdom = this.kingdom;
c.default.selectedCity = this.kingdom.capital;
c.default.selectedCity && l.default.open(l.view_type.CityWindow);
};
r([ p(cc.Sprite) ], e.prototype, "iconRace", void 0);
r([ p(cc.Label) ], e.prototype, "textPopulation", void 0);
r([ p(cc.Label) ], e.prototype, "textArmy", void 0);
r([ p(cc.Label) ], e.prototype, "textCities", void 0);
r([ p(cc.Label) ], e.prototype, "textHouses", void 0);
r([ p(cc.Label) ], e.prototype, "textZones", void 0);
r([ p(cc.Label) ], e.prototype, "kingdomName", void 0);
r([ p(cc.Node) ], e.prototype, "buttonCapital", void 0);
r([ p(cc.Node) ], e.prototype, "buttonKing", void 0);
r([ p(cc.Node) ], e.prototype, "banner", void 0);
return r([ h ], e);
}(cc.Component);
i.default = f;
cc._RF.pop();
}, {
"../../Config": "Config",
"../../common/ToolBox": "ToolBox",
"../../common/ViewController": "ViewController",
"../../texture/TextureLoader": "TextureLoader"
} ],
KingdomJobLibrary: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "4cc8bcmp05IWI8zSW4iR+Rn", "KingdomJobLibrary");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
});
Object.defineProperty(i, "__esModule", {
value: !0
});
var r = t("../../kingdom/Kingdom"), n = function(t) {
a(e, t);
function e() {
return null !== t && t.apply(this, arguments) || this;
}
e.prototype.init = function() {
t.prototype.init.call(this);
var e = new r.KingdomJob();
e.id = "kingdom";
this.add(e);
this.t.addTask("do_checks");
this.t.addTask("wait1");
this.t.addTask("check_dead_kingdom");
this.t.addTask("wait1");
this.t.addTask("check_diplomacy");
this.t.addTask("wait1");
this.t.addTask("check_attack_target");
this.t.addTask("check_revolts");
this.t.addTask("wait_random");
};
return e;
}(t("../AssetLibrary").default);
i.default = n;
cc._RF.pop();
}, {
"../../kingdom/Kingdom": "Kingdom",
"../AssetLibrary": "AssetLibrary"
} ],
KingdomLibrary: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "10081H30nBK95OPktH6zDOf", "KingdomLibrary");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
});
Object.defineProperty(i, "__esModule", {
value: !0
});
i.KingdomAsset = void 0;
var r = t("../AssetLibrary"), n = function(t) {
a(e, t);
function e() {
var e = null !== t && t.apply(this, arguments) || this;
e.civ = !1;
e.nomads = !1;
e.nature = !1;
e.attack_each_other = !1;
e.mobs = !1;
e.mad = !1;
e.brain = !1;
e.friendly_tags = new Set();
e.enemy_tags = new Set();
e.tags = new Set();
return e;
}
e.prototype.addTag = function(t) {
this.tags.add(t);
};
e.prototype.addFriendlyTag = function(t) {
this.friendly_tags.add(t);
};
e.prototype.addEnemyTag = function(t) {
this.enemy_tags.add(t);
};
e.prototype.isFoe = function(t) {
return !this.nature && !t.nature && (this == t ? this.attack_each_other : !!(this.enemy_tags.size > 0 && this.overlaps(this.enemy_tags, t.tags)) || !(this.friendly_tags.size > 0 && this.overlaps(this.friendly_tags, t.tags)));
};
e.prototype.overlaps = function(t, e) {
var i = !1;
t.forEach(function(t) {
e.has(t) && (i = !0);
});
return i;
};
return e;
}(r.Asset);
i.KingdomAsset = n;
var s = function(t) {
a(e, t);
function e() {
return null !== t && t.apply(this, arguments) || this;
}
e.prototype.init = function() {
t.prototype.init.call(this);
var e = new n();
e.id = "human";
e.civ = !0;
this.add(e);
this.t.addTag("civ");
this.t.addTag("human");
this.t.addFriendlyTag("human");
this.t.addFriendlyTag("neutral");
this.t.addFriendlyTag("good");
this.t.addEnemyTag("bandits");
var i = new n();
i.id = "elf";
i.civ = !0;
this.add(i);
this.t.addTag("civ");
this.t.addTag("elf");
this.t.addTag("nature_creature");
this.t.addFriendlyTag("elf");
this.t.addFriendlyTag("nature_creature");
this.t.addFriendlyTag("neutral");
this.t.addFriendlyTag("good");
this.t.addEnemyTag("bandits");
var o = new n();
o.id = "dwarf";
o.civ = !0;
this.add(o);
this.t.addTag("civ");
this.t.addTag("dwarf");
this.t.addFriendlyTag("dwarf");
this.t.addFriendlyTag("neutral");
this.t.addFriendlyTag("good");
this.t.addEnemyTag("bandits");
var a = new n();
a.id = "orc";
a.civ = !0;
this.add(a);
this.t.addTag("orc");
var r = new n();
r.id = "nomads_human";
r.nomads = !0;
r.mobs = !0;
this.add(r);
this.t.addTag("civ");
this.t.addTag("human");
this.t.addFriendlyTag("human");
this.t.addFriendlyTag("neutral");
this.t.addFriendlyTag("good");
this.t.addEnemyTag("bandits");
var s = new n();
s.id = "nomads_elf";
s.nomads = !0;
s.mobs = !0;
this.add(s);
this.t.addTag("civ");
this.t.addTag("elf");
this.t.addTag("nature_creature");
this.t.addFriendlyTag("elf");
this.t.addFriendlyTag("nature_creature");
this.t.addFriendlyTag("neutral");
this.t.addFriendlyTag("good");
this.t.addEnemyTag("bandits");
var l = new n();
l.id = "nomads_orc";
l.nomads = !0;
l.mobs = !0;
this.add(l);
this.t.addTag("civ");
this.t.addTag("orc");
this.t.addFriendlyTag("orc");
this.t.addEnemyTag("bandits");
var c = new n();
c.id = "nomads_dwarf";
c.nomads = !0;
c.mobs = !0;
this.add(c);
this.t.addTag("civ");
this.t.addTag("dwarf");
this.t.addFriendlyTag("dwarf");
this.t.addFriendlyTag("neutral");
this.t.addFriendlyTag("good");
this.t.addEnemyTag("bandits");
var u = new n();
u.id = "nature";
u.nature = !0;
u.mobs = !0;
this.add(u);
var d = new n();
d.id = "ruins";
d.nature = !0;
d.mobs = !0;
this.add(d);
var h = new n();
h.id = "abandoned";
h.nature = !0;
h.mobs = !0;
this.add(h);
var p = new n();
p.id = "goldenBrain";
p.mobs = !0;
p.brain = !0;
this.add(p);
this.t.addTag("neutral");
this.t.addFriendlyTag("bandits");
this.t.addFriendlyTag("neutral");
this.t.addFriendlyTag("civ");
this.t.addFriendlyTag("nature_creature");
this.t.addFriendlyTag("living_houses");
this.t.addFriendlyTag("snowman");
var f = new n();
f.id = "corruptedBrain";
f.mobs = !0;
f.brain = !0;
this.add(f);
this.t.addTag("mad");
var m = new n();
m.id = "tumor";
m.mobs = !0;
this.add(m);
var y = new n();
y.id = "neutral_animals";
y.mobs = !0;
this.add(y);
this.t.addTag("neutral");
this.t.addTag("nature_creature");
this.t.addFriendlyTag("good");
this.t.addFriendlyTag("neutral");
this.t.addFriendlyTag("nature_creature");
this.t.addFriendlyTag("living_houses");
this.t.addFriendlyTag("snowman");
this.t.addFriendlyTag("civ");
var _ = new n();
_.id = "cats";
_.mobs = !0;
this.add(_);
this.t.addTag("cats");
this.t.addTag("neutral");
this.t.addFriendlyTag("neutral");
this.t.addFriendlyTag("nature_creature");
this.t.addFriendlyTag("living_houses");
this.t.addFriendlyTag("snowman");
this.t.addFriendlyTag("civ");
this.t.addEnemyTag("rats");
this.t.addEnemyTag("ratKings");
var g = new n();
g.id = "wolves";
g.mobs = !0;
this.add(g);
this.t.addTag("wolves");
this.t.addTag("nature_creature");
this.t.addFriendlyTag("wolves");
this.t.addFriendlyTag("nature_creature");
this.t.addFriendlyTag("living_houses");
var v = new n();
v.id = "bears";
v.mobs = !0;
this.add(v);
this.t.addTag("bears");
this.t.addTag("nature_creature");
this.t.addFriendlyTag("bears");
this.t.addFriendlyTag("nature_creature");
this.t.addFriendlyTag("living_houses");
var b = new n();
b.id = "demons";
b.mobs = !0;
this.add(b);
var T = new n();
T.id = "walkers";
T.mobs = !0;
this.add(T);
this.t.addTag("snow");
this.t.addFriendlyTag("snow");
var w = new n();
w.id = "dragons";
w.mobs = !0;
this.add(w);
var B = new n();
B.id = "aliens";
B.mobs = !0;
this.add(B);
var k = new n();
k.id = "piranhas";
k.mobs = !0;
this.add(k);
var A = new n();
A.id = "bandits";
A.mobs = !0;
this.add(A);
this.t.addTag("bandits");
this.t.addTag("neutral");
this.t.addFriendlyTag("neutral");
this.t.addEnemyTag("civ");
var S = new n();
S.id = "undead";
S.mobs = !0;
this.add(S);
var x = new n();
x.id = "living_plants";
x.mobs = !0;
this.add(x);
this.t.addTag("nature_creature");
this.t.addTag("living_plants");
this.t.addFriendlyTag("nature_creature");
this.t.addFriendlyTag("good");
this.t.addFriendlyTag("neutral");
this.t.addFriendlyTag("mush");
var C = new n();
C.id = "living_houses";
C.mobs = !0;
this.add(C);
this.t.addTag("living_houses");
this.t.addFriendlyTag("living_houses");
var O = new n();
O.id = "ants";
O.mobs = !0;
this.add(O);
this.t.addTag("nature_creature");
this.t.addFriendlyTag("good");
this.t.addFriendlyTag("neutral");
this.t.addFriendlyTag("nature_creature");
this.t.addFriendlyTag("living_houses");
var P = new n();
P.id = "santa";
P.mobs = !0;
this.add(P);
this.t.addTag("santa");
this.t.addFriendlyTag("snowman");
var R = new n();
R.id = "rats";
R.mobs = !0;
this.add(R);
this.t.addTag("rats");
this.t.addTag("neutral");
this.t.addTag("nature_creature");
this.t.addFriendlyTag("good");
this.t.addFriendlyTag("rats");
this.t.addFriendlyTag("neutral");
this.t.addFriendlyTag("civ");
this.t.addFriendlyTag("nature_creature");
this.t.addEnemyTag("cats");
var M = new n();
M.id = "ratKings";
M.attack_each_other = !0;
M.mobs = !0;
this.add(M);
this.t.addTag("rats");
this.t.addTag("neutral");
this.t.addTag("nature_creature");
this.t.addFriendlyTag("good");
this.t.addFriendlyTag("rats");
this.t.addFriendlyTag("neutral");
this.t.addFriendlyTag("civ");
this.t.addFriendlyTag("nature_creature");
this.t.addEnemyTag("cats");
var L = new n();
L.id = "crab";
L.mobs = !0;
this.add(L);
this.t.addTag("crab");
this.t.addTag("neutral");
this.t.addTag("nature_creature");
this.t.addFriendlyTag("good");
this.t.addFriendlyTag("civ");
this.t.addFriendlyTag("crab");
this.t.addFriendlyTag("neutral");
this.t.addFriendlyTag("nature_creature");
this.t.addFriendlyTag("living_houses");
this.t.addFriendlyTag("snowman");
var F = new n();
F.id = "crabzilla";
F.mobs = !0;
this.add(F);
this.t.addTag("crab");
this.t.addFriendlyTag("crab");
var D = new n();
D.id = "snowman";
D.mobs = !0;
this.add(D);
this.t.addTag("snow");
this.t.addFriendlyTag("good");
this.t.addFriendlyTag("snow");
this.t.addFriendlyTag("santa");
var I = new n();
I.id = "evil";
I.mobs = !0;
this.add(I);
this.t.addTag("evil");
this.t.addFriendlyTag("evil");
var j = new n();
j.id = "druid";
j.mobs = !0;
this.add(j);
this.t.addTag("good");
this.t.addTag("nature_creature");
this.t.addFriendlyTag("good");
this.t.addFriendlyTag("neutral");
this.t.addFriendlyTag("civ");
this.t.addFriendlyTag("neutral");
this.t.addFriendlyTag("nature_creature");
var E = new n();
E.id = "good";
E.mobs = !0;
this.add(E);
this.t.addTag("good");
this.t.addFriendlyTag("neutral");
this.t.addFriendlyTag("civ");
this.t.addFriendlyTag("neutral");
this.t.addFriendlyTag("nature_creature");
this.t.addFriendlyTag("living_houses");
this.t.addFriendlyTag("snowman");
this.t.addEnemyTag("wolves");
this.t.addEnemyTag("bears");
this.t.addEnemyTag("orc");
this.t.addEnemyTag("bandits");
var N = new n();
N.id = "mad";
N.attack_each_other = !0;
N.mobs = !0;
N.mad = !0;
this.add(N);
this.t.addTag("mad");
this.t.addFriendlyTag("mad");
var G = new n();
G.id = "greg";
G.mobs = !0;
this.add(G);
this.t.addTag("greg");
var U = new n();
U.id = "mush";
U.mobs = !0;
this.add(U);
this.t.addTag("mush");
this.t.addFriendlyTag("living_plants");
};
return e;
}(r.default);
i.default = s;
cc._RF.pop();
}, {
"../AssetLibrary": "AssetLibrary"
} ],
KingdomListWindow: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "f16ba3F7KdNt4Tbsq+vzD1s", "KingdomListWindow");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
}), r = this && this.__decorate || function(t, e, i, o) {
var a, r = arguments.length, n = r < 3 ? e : null === o ? o = Object.getOwnPropertyDescriptor(e, i) : o;
if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) n = Reflect.decorate(t, e, i, o); else for (var s = t.length - 1; s >= 0; s--) (a = t[s]) && (n = (r < 3 ? a(n) : r > 3 ? a(e, i, n) : a(e, i)) || n);
return r > 3 && n && Object.defineProperty(e, i, n), n;
}, n = this && this.__values || function(t) {
var e = "function" == typeof Symbol && Symbol.iterator, i = e && t[e], o = 0;
if (i) return i.call(t);
if (t && "number" == typeof t.length) return {
next: function() {
t && o >= t.length && (t = void 0);
return {
value: t && t[o++],
done: !t
};
}
};
throw new TypeError(e ? "Object is not iterable." : "Symbol.iterator is not defined.");
};
Object.defineProperty(i, "__esModule", {
value: !0
});
var s = t("../../../../common/src/GamePopBase"), l = t("../../MapBox"), c = t("./KingdomElement"), u = cc._decorator, d = u.ccclass, h = u.property, p = function(t) {
a(e, t);
function e() {
var e = null !== t && t.apply(this, arguments) || this;
e.kingdomElementPrefab = null;
e.content = null;
return e;
}
e.prototype.open = function() {
t.prototype.open.call(this);
this.showList();
};
e.prototype.showList = function() {
var t, e;
l.default.inst.kingdoms.list_civs.sort(function(t, e) {
return t.getPopulationTotal() - e.getPopulationTotal();
});
try {
for (var i = n(l.default.inst.kingdoms.list_civs), o = i.next(); !o.done; o = i.next()) {
var a = o.value;
this.showElement(a);
}
} catch (e) {
t = {
error: e
};
} finally {
try {
o && !o.done && (e = i.return) && e.call(i);
} finally {
if (t) throw t.error;
}
}
};
e.prototype.showElement = function(t) {
var e = cc.instantiate(this.kingdomElementPrefab);
e.parent = this.content;
e.getComponent(c.default).initItem(t);
};
r([ h(cc.Prefab) ], e.prototype, "kingdomElementPrefab", void 0);
r([ h(cc.Node) ], e.prototype, "content", void 0);
return r([ d ], e);
}(s.GamePopBase);
i.default = p;
cc._RF.pop();
}, {
"../../../../common/src/GamePopBase": void 0,
"../../MapBox": "MapBox",
"./KingdomElement": "KingdomElement"
} ],
KingdomManager: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "dbdc6u9f2pG1phnFOLHqUBP", "KingdomManager");
var o = this && this.__values || function(t) {
var e = "function" == typeof Symbol && Symbol.iterator, i = e && t[e], o = 0;
if (i) return i.call(t);
if (t && "number" == typeof t.length) return {
next: function() {
t && o >= t.length && (t = void 0);
return {
value: t && t[o++],
done: !t
};
}
};
throw new TypeError(e ? "Object is not iterable." : "Symbol.iterator is not defined.");
};
Object.defineProperty(i, "__esModule", {
value: !0
});
var a = t("../../../common/src/data/AchievData"), r = t("../../../common/src/GameCommon"), n = t("../assetLibrary/AssetManager"), s = t("../Config"), l = t("../map/map/MapMarks"), c = t("../MapBox"), u = t("../ui/log/WorldLog"), d = t("../ui/power/PowerButtonSelector"), h = t("./DiplomacyManager"), p = t("./DiplomacyRelation"), f = t("./Kingdom"), m = function() {
function t() {
var t = this;
this.dict_hidden = new Map();
this.list = [];
this.list_civs = [];
this.list_hidden = [];
this.diplomacyManager = null;
this.diplomacyManager = new h.default(this);
n.default.kingdoms.list.forEach(function(e) {
t.newHiddenKingdom(e);
});
}
Object.defineProperty(t.prototype, "length", {
get: function() {
return this.list_civs.length;
},
enumerable: !1,
configurable: !0
});
t.prototype.save = function() {
var t = [];
this.list_civs.forEach(function(e) {
t.push(e.save());
});
return t;
};
t.prototype.setDiplomacyState = function(t, e, i) {
"string" == typeof t && (t = this.getKingdomByID(t));
"string" == typeof e && (e = this.getKingdomByID(e));
this.diplomacyManager.getRelation(t, e).data.state = i;
t.setDiplomacyState(e, p.DiplomacyState.Clear);
e.setDiplomacyState(t, p.DiplomacyState.Clear);
switch (i) {
case p.DiplomacyState.Ally:
case p.DiplomacyState.War:
t.setDiplomacyState(e, i);
e.setDiplomacyState(t, i);
}
c.default.inst.zoneCalculator && c.default.inst.zoneCalculator.allDirty();
};
t.prototype.newHiddenKingdom = function(t) {
var e = new f.default();
e.asset = t;
e.data.id = t.id;
e.data.name = t.id;
this.addKingdom(e);
return e;
};
t.prototype.clear = function() {
this.list_civs = [];
this.list = [];
this.diplomacyManager.clear();
this.list_hidden.forEach(function(t) {
t.clear();
});
this.list.addRange(this.list_hidden);
};
t.prototype.getKingdomByID = function(t) {
if (this.dict_hidden.has(t)) return this.dict_hidden.get(t);
for (var e = 0; e < this.list_civs.length; e++) {
var i = this.list_civs[e];
if (i.data.id == t) return i;
}
return null;
};
t.prototype.checkKingdoms = function() {
var t, e, i, a, r = this, n = [];
try {
for (var s = o(this.list_civs), l = s.next(); !l.done; l = s.next()) 0 == (d = l.value).cities.length && 0 == d.getPopulationTotal() && n.push(d);
} catch (e) {
t = {
error: e
};
} finally {
try {
l && !l.done && (e = s.return) && e.call(s);
} finally {
if (t) throw t.error;
}
}
try {
for (var c = o(n), u = c.next(); !u.done; u = c.next()) {
var d = u.value;
this.list_civs.remove(d);
}
} catch (t) {
i = {
error: t
};
} finally {
try {
u && !u.done && (a = c.return) && a.call(c);
} finally {
if (i) throw i.error;
}
}
this.list_civs.forEach(function(t) {
r.list_civs.forEach(function(e) {
t == e || t.allies.has(e) || r.setDiplomacyState(t, e, p.DiplomacyState.War);
});
});
};
t.prototype.makeNewCivKingdom = function(t, e, i, o) {
void 0 === e && (e = null);
void 0 === i && (i = "");
void 0 === o && (o = !0);
var r = new f.default();
r.createAI();
t && !e && (e = t.race);
e && r.createCiv(e, i);
t && t.setKingdom(r);
this.addKingdom(r, !0);
o && u.default.logNewKingdom(r);
this.diplomacyManager.makeAllFriendlyTo(r);
a.default.update(21, this.list_civs.length, !0);
return r;
};
t.prototype.addKingdom = function(t, e) {
void 0 === e && (e = !1);
this.list.push(t);
if (e) this.list_civs.push(t); else {
this.dict_hidden.set(t.data.id, t);
this.list_hidden.push(t);
}
};
t.prototype.logicUpdate = function(t) {
this.list.forEach(function(e) {
e.logicUpdate(t);
});
if (!r.default.isPaused) {
this.updateCivKingdoms(t);
this.diplomacyManager.logicUpdate(t);
l.default.inst.drawArrows();
}
};
t.prototype.updateCivKingdoms = function(t) {
var e, i, r = new Map();
try {
for (var n = o(this.list_civs), s = n.next(); !s.done; s = n.next()) {
var l = s.value;
l.updateCiv(t);
var c = r.get(l.race.id);
(!c || c < l.units.length) && r.set(l.race.id, l.units.length);
}
} catch (t) {
e = {
error: t
};
} finally {
try {
s && !s.done && (i = n.return) && i.call(n);
} finally {
if (e) throw e.error;
}
}
r.has("human") && r.has("orc") && r.get("human") >= 100 && r.get("orc") >= 100 && a.default.update(57, 100, !0);
if (4 == r.size) {
var u = 0;
r.forEach(function(t) {
t >= 50 && u++;
});
4 == u && a.default.update(56, 50, !0);
}
};
t.prototype.updateAge = function() {
var t, e;
try {
for (var i = o(this.list_civs), a = i.next(); !a.done; a = i.next()) a.value.updateAge();
} catch (e) {
t = {
error: e
};
} finally {
try {
a && !a.done && (e = i.return) && e.call(i);
} finally {
if (t) throw t.error;
}
}
this.diplomacyManager.updateAge();
};
t.prototype.getRandom = function() {
if (0 == this.list_civs.length) return null;
this.list_civs.shuffle();
return this.list_civs[0];
};
t.prototype.destroyKingdom = function(t) {
this.diplomacyManager.removeRelations(t);
this.list.remove(t);
this.list_civs.remove(t);
c.default.inst.isSelectedPower("relations") && s.default.selectedKingdom == t && d.PowerButtonSelector.inst.unselectAll();
if (t.alive) {
t.alive = !1;
u.default.logKingdomDestroyed(t);
}
this.list.forEach(function(e) {
e.enemies.has(t) && e.setDiplomacyState(t, p.DiplomacyState.Clear);
e.allies.has(t) && e.setDiplomacyState(t, p.DiplomacyState.Clear);
});
t.makeSurvivorsToNomads();
};
return t;
}();
i.default = m;
cc._RF.pop();
}, {
"../../../common/src/GameCommon": void 0,
"../../../common/src/data/AchievData": void 0,
"../Config": "Config",
"../MapBox": "MapBox",
"../assetLibrary/AssetManager": "AssetManager",
"../map/map/MapMarks": "MapMarks",
"../ui/log/WorldLog": "WorldLog",
"../ui/power/PowerButtonSelector": "PowerButtonSelector",
"./DiplomacyManager": "DiplomacyManager",
"./DiplomacyRelation": "DiplomacyRelation",
"./Kingdom": "Kingdom"
} ],
KingdomOpinion: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "3c168k4t/hKU5IFEZt5f0qU", "KingdomOpinion");
Object.defineProperty(i, "__esModule", {
value: !0
});
var o = t("../assetLibrary/AssetManager"), a = t("../city/City"), r = t("../MapBox"), n = t("./DiplomacyManager"), s = function() {
function t(t, e) {
this.main = null;
this.target = null;
this._opinion_king = 0;
this._opinion_race = 0;
this._opinion_close_borders = 0;
this._opinion_far_lands = 0;
this._opinion_kings_mood = 0;
this._in_war = 0;
this._opinion_peace_time = 0;
this._opinion_power = 0;
this._opinion_traits = 0;
this._opinion_zones = 0;
this._opinion_same_wars = 0;
this._opinion_is_supreme = 0;
this._opinion_total = 0;
this.main = t;
this.target = e;
}
t.prototype.calculate = function(t, e, i) {
if (t) {
this.main = t;
this.target = e;
var a = t.civs_allies.has(e);
this._opinion_king = 0;
this._opinion_race = 0;
this._opinion_peace_time = 0;
this._opinion_power = 0;
this._opinion_total = 0;
this._opinion_same_wars = 0;
this._opinion_is_supreme = 0;
this._opinion_zones = 0;
this._in_war = 0;
this._opinion_traits = 0;
this._opinion_close_borders = 0;
this._opinion_far_lands = 0;
if (a) {
n.default.kingdom_supreme == e && r.default.inst.kingdoms.list_civs.length >= 3 && (this._opinion_is_supreme = -100);
var s = 5 * t.cities.length + t.getPopulationTotal(), l = 5 * e.cities.length + e.getPopulationTotal() - s;
this._opinion_power = l > 0 ? l / 10 : 0;
e.king && (this._opinion_king += e.king.curStats.diplomacy);
if (e.king && t.king) {
var c = o.default.traits.checkTraitsMod(e.king, t.king);
this._opinion_traits += c;
}
this._opinion_kings_mood = 0;
t.king && (this._opinion_kings_mood = t.king.curStats.opinion);
var u = 0, d = 0;
t.cities.forEach(function(t) {
u += t.zones.length;
});
e.cities.forEach(function(t) {
d += t.zones.length;
});
var h = u - d;
this._opinion_zones = h / 5;
this._opinion_zones > 0 && (this._opinion_zones = 0);
this._opinion_zones < -20 && (this._opinion_zones = -20);
e.civs_enemies.size > 0 && (this._opinion_same_wars = 50);
this.areKingdomsClose(t, e) ? this._opinion_close_borders = -50 : this._opinion_far_lands = 25;
t.race == e.race ? this._opinion_race = 5 : t.race.hateRaces.includes(e.race.id) && (this._opinion_race -= 20);
if (a) {
this._opinion_peace_time = r.default.inst.mapStats.year - i.data.peaceSince;
this._opinion_peace_time > 20 && (this._opinion_peace_time = 20);
this._opinion_peace_time = 0;
}
this._opinion_total = this._opinion_close_borders + this._opinion_far_lands + this._opinion_king + this._opinion_peace_time + this._opinion_power + this._opinion_race + this._opinion_same_wars + this._opinion_zones + this._opinion_is_supreme + this._opinion_kings_mood + this._opinion_traits;
} else {
this._in_war = -100;
this._opinion_total = this._in_war;
}
}
};
t.prototype.areKingdomsClose = function(t, e) {
for (var i = 0; i < t.cities.length; i++) for (var o = t.cities[i], r = 0; r < e.cities.length; r++) {
var n = e.cities[r];
if (a.default.nearbyBorders(o, n)) return !0;
}
return !1;
};
return t;
}();
i.default = s;
cc._RF.pop();
}, {
"../MapBox": "MapBox",
"../assetLibrary/AssetManager": "AssetManager",
"../city/City": "City",
"./DiplomacyManager": "DiplomacyManager"
} ],
KingdomWindow: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "7724crlcpBGSoL6QwbpsTJx", "KingdomWindow");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
}), r = this && this.__decorate || function(t, e, i, o) {
var a, r = arguments.length, n = r < 3 ? e : null === o ? o = Object.getOwnPropertyDescriptor(e, i) : o;
if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) n = Reflect.decorate(t, e, i, o); else for (var s = t.length - 1; s >= 0; s--) (a = t[s]) && (n = (r < 3 ? a(n) : r > 3 ? a(e, i, n) : a(e, i)) || n);
return r > 3 && n && Object.defineProperty(e, i, n), n;
}, n = this && this.__values || function(t) {
var e = "function" == typeof Symbol && Symbol.iterator, i = e && t[e], o = 0;
if (i) return i.call(t);
if (t && "number" == typeof t.length) return {
next: function() {
t && o >= t.length && (t = void 0);
return {
value: t && t[o++],
done: !t
};
}
};
throw new TypeError(e ? "Object is not iterable." : "Symbol.iterator is not defined.");
};
Object.defineProperty(i, "__esModule", {
value: !0
});
var s = t("../../../../common/src/GamePopBase"), l = t("../../../../common/src/text/LocalizedTextManager"), c = t("../../common/ToolBox"), u = t("../../common/ViewController"), d = t("../../Config"), h = t("../../texture/TextureLoader"), p = t("../tip/ToolTip"), f = t("./CityInfoElement"), m = cc._decorator, y = m.ccclass, _ = m.property, g = function(t) {
a(e, t);
function e() {
var e = null !== t && t.apply(this, arguments) || this;
e.prefabCityInfo = null;
e.txtName = null;
e.population = null;
e.army = null;
e.cities = null;
e.territory = null;
e.buildings = null;
e.banner = null;
e.text_description = null;
e.text_values = null;
e.war_layout = null;
e.allies_layout = null;
e.layout_villages = null;
e.buttonCapital = null;
e.buttonKing = null;
e.curKingdom = null;
return e;
}
e.prototype.start = function() {
var t, e, i, o, a, r, s, u, h, p;
if (d.default.selectedKingdom) {
this.curKingdom = d.default.selectedKingdom;
this.showBanner();
this.txtName.string = this.curKingdom.data.name;
var f = 0, m = 0;
try {
for (var y = n(this.curKingdom.cities), _ = y.next(); !_.done; _ = y.next()) {
var g = _.value;
m += g.buildings.count;
f += g.zones.length;
}
} catch (e) {
t = {
error: e
};
} finally {
try {
_ && !_.done && (e = y.return) && e.call(y);
} finally {
if (t) throw t.error;
}
}
this.population.getChildByName("richText").getComponent(cc.RichText).string = "" + this.curKingdom.getPopulationTotal();
this.buildings.getChildByName("richText").getComponent(cc.RichText).string = "" + m;
this.territory.getChildByName("richText").getComponent(cc.RichText).string = "" + f;
this.army.getChildByName("richText").getComponent(cc.RichText).string = this.curKingdom.countArmy() + "/" + this.curKingdom.countArmyMax();
var v = d.default.selectedKingdom.getMaxCities(), b = this.curKingdom.cities.length + "/" + v;
this.curKingdom.cities.length > v && (b = c.Toolbox.coloredText(b, c.Toolbox.color_negative));
this.cities.getChildByName("richText").getComponent(cc.RichText).string = b;
this.curKingdom.king ? this.buttonKing.active = !0 : this.buttonKing.active = !1;
this.curKingdom.capital ? this.buttonCapital.active = !0 : this.buttonCapital.active = !1;
this.layout_villages.destroyAllChildren();
this.curKingdom.cities.sort(this.citiesSorter.bind(this));
try {
for (var T = n(this.curKingdom.cities), w = T.next(); !w.done; w = T.next()) {
var B = w.value;
this.showElement(B);
}
} catch (t) {
i = {
error: t
};
} finally {
try {
w && !w.done && (o = T.return) && o.call(T);
} finally {
if (i) throw i.error;
}
}
var k = 0, A = 0;
try {
for (var S = n(d.default.selectedKingdom.units.list), x = S.next(); !x.done; x = S.next()) {
var C = x.value;
C.haveTrait("infected") ? k++ : C.haveTrait("plague") && k++;
C.data.hunger <= 10 && A++;
}
} catch (t) {
a = {
error: t
};
} finally {
try {
x && !x.done && (r = S.return) && r.call(S);
} finally {
if (a) throw a.error;
}
}
this.text_description.string = "";
this.text_values.string = "";
this.showStat("kingdom_statistics_age", "" + d.default.selectedKingdom.data.age);
this.showStat("kingdom_statistics_born", "" + d.default.selectedKingdom.data.born);
this.showStat("kingdom_statistics_deaths", "" + d.default.selectedKingdom.data.deaths);
k > 0 && this.showStat("kingdom_statistics_infected", "" + k);
A > 0 && this.showStat("statistics_starving_people", "" + A);
this.text_description.string += "\n";
this.text_values.string += "\n";
this.showStat("kingdom_statistics_king", d.default.selectedKingdom.king ? d.default.selectedKingdom.king.data.firstName : "", null === (u = null === (s = d.default.selectedKingdom) || void 0 === s ? void 0 : s.kingdomColor) || void 0 === u ? void 0 : u.colorBorderOut);
if (d.default.selectedKingdom.king) {
this.showStat("creature_statistics_personality", l.LocalizedTextManager.getText("personality_" + d.default.selectedKingdom.king.s_personality.id));
this.showStat("kingdom_statistics_king_ruled", "" + d.default.selectedKingdom.data.lastKingRuledFor);
}
this.showStat("kingdom_statistics_capital", d.default.selectedKingdom.capital ? d.default.selectedKingdom.capital.data.cityName : "", null === (p = null === (h = d.default.selectedKingdom) || void 0 === h ? void 0 : h.kingdomColor) || void 0 === p ? void 0 : p.colorBorderOut);
this.clearOldBanners();
this.loadWarBanners();
this.loadAlliedBanners();
}
};
e.prototype.showBanner = function() {
var t, e, i = "banners/" + this.curKingdom.race.bannerId + "/background/banner_part_background" + c.Toolbox.randomInt(0, 8), o = "banners/" + this.curKingdom.race.bannerId + "/icon/banner_part_object" + c.Toolbox.randomInt(0, 8), a = this.banner.getChildByName("bg").getComponent(cc.Sprite);
a.node.color = null === (t = this.curKingdom.kingdomColor) || void 0 === t ? void 0 : t.colorBorderOut;
a.spriteFrame = h.TextureLoader.inst.getSpriteFrame(h.ATLAS_TYPE.WORLDATLAS, i);
var r = this.banner.getChildByName("icon").getComponent(cc.Sprite);
r.node.color = null === (e = this.curKingdom.kingdomColor) || void 0 === e ? void 0 : e.colorBorderBannerIcon;
r.spriteFrame = h.TextureLoader.inst.getSpriteFrame(h.ATLAS_TYPE.WORLDATLAS, o);
};
e.prototype.showStat = function(t, e, i) {
this.text_description.string += l.LocalizedTextManager.getText(t) + "\n";
this.text_values.string += i ? c.Toolbox.coloredString(e, i.toHEX()) + "\n" : e + "\n";
};
e.prototype.loadWarBanners = function() {
var t = this, e = this.curKingdom.civs_enemies.size;
if (0 != e) {
var i = 0;
this.curKingdom.civs_enemies.forEach(function(o, a) {
t.loadKingdomBannerFor(a, i, e, t.war_layout);
i++;
});
}
};
e.prototype.loadAlliedBanners = function() {
var t = this, e = this.curKingdom.civs_allies.size;
if (0 != e) {
var i = 0;
this.curKingdom.civs_allies.forEach(function(o, a) {
if (a != t.curKingdom) {
t.loadKingdomBannerFor(a, i, e, t.allies_layout);
i++;
}
});
}
};
e.prototype.loadKingdomBannerFor = function(t, e, i, o) {
var a, r, n = "banners/" + t.race.bannerId + "/background/banner_part_background" + c.Toolbox.randomInt(0, 8), s = "banners/" + t.race.bannerId + "/icon/banner_part_object" + c.Toolbox.randomInt(0, 8), l = new cc.Node();
l.parent = o;
l.attr({
data: t
});
l.addComponent(cc.Button);
l.on("click", this.clickBanner, this);
l.color = null === (a = t.kingdomColor) || void 0 === a ? void 0 : a.colorBorderOut;
l.addComponent(cc.Sprite).spriteFrame = h.TextureLoader.inst.getSpriteFrame(h.ATLAS_TYPE.WORLDATLAS, n);
var u = new cc.Node();
u.y = 3;
u.parent = l;
u.color = null === (r = t.kingdomColor) || void 0 === r ? void 0 : r.colorBorderBannerIcon;
u.addComponent(cc.Sprite).spriteFrame = h.TextureLoader.inst.getSpriteFrame(h.ATLAS_TYPE.WORLDATLAS, s);
};
e.prototype.clearOldBanners = function() {
this.war_layout.destroyAllChildren();
this.allies_layout.destroyAllChildren();
};
e.prototype.showElement = function(t) {
var e = cc.instantiate(this.prefabCityInfo);
e.getComponent(f.default).initItem(t);
e.parent = this.layout_villages;
};
e.prototype.citiesSorter = function(t, e) {
return e.isCapitalCity() ? 1 : t.isCapitalCity() ? -1 : t.getPopulationTotal() - e.getPopulationTotal();
};
e.prototype.clickKing = function(t) {
d.default.selectedUnit = d.default.selectedKingdom.king;
u.default.open(u.view_type.CreatureInfo, null, t);
};
e.prototype.clickCapital = function(t) {
d.default.selectedCity = d.default.selectedKingdom.capital;
u.default.open(u.view_type.CityWindow, null, t);
};
e.prototype.clickKingdom = function(t) {
u.default.open(u.view_type.KingdomList, null, t);
};
e.prototype.clickBanner = function(t) {
var e = t.node.data;
p.default.info_kingdom = e;
p.default.info_tip = "kingdom";
p.default.inst.show(t.node, "kingdom");
};
e.prototype.clickAttribute = function(t, e) {
var i = t.getCurrentTarget();
p.default.info_tip = i.name;
p.default.inst.show(i, "tip", i.name, e);
};
r([ _(cc.Prefab) ], e.prototype, "prefabCityInfo", void 0);
r([ _(cc.Label) ], e.prototype, "txtName", void 0);
r([ _(cc.Node) ], e.prototype, "population", void 0);
r([ _(cc.Node) ], e.prototype, "army", void 0);
r([ _(cc.Node) ], e.prototype, "cities", void 0);
r([ _(cc.Node) ], e.prototype, "territory", void 0);
r([ _(cc.Node) ], e.prototype, "buildings", void 0);
r([ _(cc.Node) ], e.prototype, "banner", void 0);
r([ _(cc.RichText) ], e.prototype, "text_description", void 0);
r([ _(cc.RichText) ], e.prototype, "text_values", void 0);
r([ _(cc.Node) ], e.prototype, "war_layout", void 0);
r([ _(cc.Node) ], e.prototype, "allies_layout", void 0);
r([ _(cc.Node) ], e.prototype, "layout_villages", void 0);
r([ _(cc.Node) ], e.prototype, "buttonCapital", void 0);
r([ _(cc.Node) ], e.prototype, "buttonKing", void 0);
return r([ y ], e);
}(s.GamePopBase);
i.default = g;
cc._RF.pop();
}, {
"../../../../common/src/GamePopBase": void 0,
"../../../../common/src/text/LocalizedTextManager": void 0,
"../../Config": "Config",
"../../common/ToolBox": "ToolBox",
"../../common/ViewController": "ViewController",
"../../texture/TextureLoader": "TextureLoader",
"../tip/ToolTip": "ToolTip",
"./CityInfoElement": "CityInfoElement"
} ],
Kingdom: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "5b32a//1eRJxK1+PkzcoKRQ", "Kingdom");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
}), r = this && this.__values || function(t) {
var e = "function" == typeof Symbol && Symbol.iterator, i = e && t[e], o = 0;
if (i) return i.call(t);
if (t && "number" == typeof t.length) return {
next: function() {
t && o >= t.length && (t = void 0);
return {
value: t && t[o++],
done: !t
};
}
};
throw new TypeError(e ? "Object is not iterable." : "Symbol.iterator is not defined.");
};
Object.defineProperty(i, "__esModule", {
value: !0
});
i.KingdomData = i.KingdomJob = i.KingdomEventState = void 0;
var n, s = t("../../../common/src/data/AchievData"), l = t("../actors/ActorBase"), c = t("../actors/ActorJob"), u = t("../actors/ActorStatus"), d = t("../ai/AiSystem"), h = t("../assetLibrary/AssetManager"), p = t("../base/BaseBuilding"), f = t("../common/ToolBox"), m = t("../map/generator/NameGenerator"), y = t("../MapBox"), _ = t("./DiplomacyRelation"), g = t("./KingdomColors");
(function(t) {
t[t.Idle = 0] = "Idle";
t[t.NewAttack = 1] = "NewAttack";
t[t.Wait = 2] = "Wait";
})(n = i.KingdomEventState || (i.KingdomEventState = {}));
var v = function(t) {
a(e, t);
function e() {
return null !== t && t.apply(this, arguments) || this;
}
return e;
}(c.JobAsset);
i.KingdomJob = v;
var b = function() {
this.id = "";
this.name = "";
this.kingID = "";
this.capitalID = "";
this.raceID = "";
this.bannerSeed = -1;
this.age = 0;
this.timer_loyalty = 100;
this.timer_no_city = 0;
this.timer_settle_target = 100;
this.timer_event = 100;
this.timer_attack_target = 100;
this.timer_new_king = 10;
this.colorID = -1;
this.eventState = n.Idle;
this.deaths = 0;
this.born = 0;
this.saved_allies = [];
this.saved_enemies = [];
this.lastKingRuledFor = 0;
this.check_for_independence = !1;
};
i.KingdomData = b;
var T = function() {
function t() {
this.asset = null;
this.data = new b();
this.timer_action = 0;
this.race = null;
this.king = null;
this.cities = [];
this.units = new l.ActorContainer();
this.buildings = new p.BuildingContainer();
this.capital = null;
this.alive = !0;
this.allies = new Map();
this.civs_allies = new Map();
this.enemies = new Map();
this.civs_enemies = new Map();
this.target_kingdom = null;
this.target_city = null;
this.settlerTarget = null;
this.ai = null;
this.location = cc.Vec3.ZERO;
}
t.prototype.createAI = function() {
this.ai = new d.AiSystemKingdom(this);
this.ai.nextJobDelegate = this.getNextJob;
this.ai.jobs_library = h.default.job_kingdom;
this.ai.task_library = h.default.tasks_kingdom;
};
t.initWithData = function(e) {
var i = new t();
i.data = e;
return i;
};
t.prototype.getNextJob = function() {
return "kingdom";
};
t.prototype.isCiv = function() {
return this.asset.civ;
};
t.prototype.isNature = function() {
return this.asset.nature;
};
t.prototype.isNomads = function() {
return this.asset.nomads;
};
t.prototype.save = function() {
var t = this;
this.data.saved_allies = [];
this.data.saved_enemies = [];
this.allies.forEach(function(e, i) {
i.isCiv() && i != t && t.data.saved_allies.push(i.data.id);
});
this.enemies.forEach(function(e, i) {
i.isCiv() && i != t && t.data.saved_enemies.push(i.data.id);
});
return this.data;
};
t.prototype.isEnemy = function(t) {
return !t || (this.isCiv() && t.isCiv() ? t != this && !this.allies.has(t) : !!this.asset.isFoe(t.asset));
};
t.prototype.createCiv = function(e, i) {
void 0 === i && (i = "");
this.race = e;
this.data.raceID = e.id;
this.asset = h.default.kingdoms.get(this.data.raceID);
"" == i && (this.data.id = y.default.inst.mapStats.getNextId("kingdom"));
this.createColors();
t.kingdoms++;
};
t.prototype.logicUpdate = function() {
this.buildings.checkAddRemove();
this.units.checkAddRemove();
};
t.prototype.updateCiv = function(t) {
if (0 == this.cities.length) {
this.data.timer_no_city += t;
0 == this.units.length && (this.data.timer_no_city = 1e3);
} else this.data.timer_no_city = 0;
this.data.timer_attack_target > 0 && (this.data.timer_attack_target -= t);
this.data.timer_settle_target > 0 && (this.data.timer_settle_target -= t);
this.data.timer_loyalty > 0 && (this.data.timer_loyalty -= t);
this.data.timer_new_king > 0 && (this.data.timer_new_king -= t);
if (this.data.timer_event > 0) {
this.checkRelationships();
this.data.timer_event -= t;
if (this.data.timer_event <= 0 && this.data.eventState == n.Wait) {
this.clearTarget();
this.data.eventState = n.Idle;
this.data.timer_event = 200 + f.Toolbox.randomFloat(0, 100);
}
}
this.ai && (this.timer_action > 0 ? this.timer_action -= t : this.ai.logicUpdate(t));
};
t.prototype.checkRelationships = function() {
t._temp_kingdoms = [];
this.civs_allies.forEach(function(e, i) {
0 == i.cities.length && 0 == i.getPopulationTotal() && t._temp_kingdoms.push(i);
});
this.civs_enemies.forEach(function(e, i) {
0 == i.cities.length && 0 == i.getPopulationTotal() && t._temp_kingdoms.push(i);
});
t._temp_kingdoms.forEach(function(t) {
y.default.inst.kingdoms.destroyKingdom(t);
});
};
t.prototype.addUnit = function(t) {
var e;
if (!this.units.has(t)) {
this.units.add(t);
!this.race && t.race.civilization && (this.race = t.race);
switch (null === (e = this.race) || void 0 === e ? void 0 : e.id) {
case "human":
s.default.update(58, this.units.length, !0);
break;

case "orc":
s.default.update(59, this.units.length, !0);
break;

case "dwarf":
s.default.update(60, this.units.length, !0);
break;

case "elf":
s.default.update(61, this.units.length, !0);
}
}
};
t.prototype.removeUnit = function(t) {
this.units.remove(t);
t == this.king && this.removeKing();
this.checkKingdomDead();
};
t.prototype.setKing = function(t) {
this.king = t;
this.king.setProfession(u.UnitProfession.King);
this.data.kingID = this.king.data.actorID;
};
t.prototype.removeKing = function() {
this.king && this.king.setProfession(u.UnitProfession.Unit);
this.king = null;
this.data.kingID = null;
this.data.timer_new_king = f.Toolbox.randomFloat(5, 20);
};
t.prototype.removeCity = function(t) {
if (t.isCapitalCity()) {
this.capital = null;
this.data.capitalID = null;
}
this.cities.remove(t);
this.checkKingdomDead();
};
t.prototype.capturedFrom = function(t) {
y.default.inst.kingdoms.diplomacyManager.getRelation(this, t);
};
t.prototype.addCity = function(t) {
this.cities.push(t);
"" == this.data.name && (this.data.name = m.default.getName(this.race.name_template_kingdom));
t == this.target_city && (this.data.timer_attack_target = 0);
s.default.update(23, this.cities.length, !0);
};
t.prototype.load1 = function() {
-1 == this.data.bannerSeed && (this.data.bannerSeed = f.Toolbox.randomInt(0, 1e6));
this.createColors(this.data.colorID);
if (!this.race && this.data.raceID) {
this.race = h.default.raceLibrary.get(this.data.raceID);
this.asset = h.default.kingdoms.get(this.data.raceID);
}
};
t.prototype.load2 = function() {
var e = this;
t.kingdoms++;
this.capital = y.default.inst.getCityByID(this.data.capitalID);
this.capital && (this.location = this.capital.cityCenter);
this.king = y.default.inst.getActorByID(this.data.kingID);
this.king && this.king.setProfession(u.UnitProfession.King);
this.data.saved_allies.forEach(function(t) {
var i = y.default.inst.kingdoms.getKingdomByID(t);
i && y.default.inst.kingdoms.setDiplomacyState(e, i, _.DiplomacyState.Ally);
});
this.data.saved_enemies.forEach(function(t) {
var i = y.default.inst.kingdoms.getKingdomByID(t);
i && y.default.inst.kingdoms.setDiplomacyState(e, i, _.DiplomacyState.War);
});
this.isCiv() && this.createAI();
};
t.prototype.createColors = function(t) {
void 0 === t && (t = -1);
var e = g.default.getContainer(this.data.raceID);
if (e) {
e.prepare(this);
this.data.colorID = t;
-1 == this.data.colorID && (this.data.colorID = e.curColor);
this.kingdomColor = g.default.getColor(this.data.raceID, this.data.colorID);
-1 == this.data.bannerSeed && (this.data.bannerSeed = f.Toolbox.randomInt(0, 1e6));
}
};
t.prototype.findCityTarget = function() {
var t = this;
if (!(this.target_city && this.target_city.alive && this.target_city.kingdom.isEnemy(this)) && this.capital) {
this.target_city = null;
var e = 0;
this.target_city = null;
this.target_kingdom.cities.forEach(function(i) {
var o = f.Toolbox.distVec3(t.capital.cityCenter, i.cityCenter);
if (0 != i.zones.length && (!t.target_city || o < e)) {
t.target_city = i;
e = o;
}
});
this.target_city || this.clearTarget();
}
};
t.prototype.checkKingdomDead = function() {
this.isCiv() && 0 == this.getPopulationTotal() && 0 == this.cities.length && y.default.inst.kingdoms.destroyKingdom(this);
};
t.distanceBetweenKingdom = function(t, e) {
var i = -1;
t.cities.forEach(function(t) {
e.cities.forEach(function(e) {
var o = f.Toolbox.distVec3(t.cityCenter, e.cityCenter);
(-1 == i || o < i) && (i = o);
});
});
return i;
};
t.prototype.clear = function() {
this.buildings.clear();
this.units.clear();
this.allies.clear();
this.enemies.clear();
this.civs_allies.clear();
this.civs_enemies.clear();
};
t.prototype.setDiplomacyState = function(t, e) {
switch (e) {
case _.DiplomacyState.War:
this.enemies.set(t, !0);
this.isCiv() && t.isCiv() && this.civs_enemies.set(t, !0);
break;

case _.DiplomacyState.Ally:
this.allies.set(t, !0);
this.isCiv() && t.isCiv() && this.civs_allies.set(t, !0);
break;

case _.DiplomacyState.Clear:
this.allies.delete(t);
this.enemies.delete(t);
if (this.isCiv() && t.isCiv()) {
this.civs_allies.delete(t);
this.civs_enemies.delete(t);
}
}
_.DiplomacyState.Ally;
};
t.prototype.hasEnemies = function() {
return this.civs_enemies.size > 0;
};
t.prototype.checkTarget = function() {
if (!this.target_kingdom || this.target_kingdom.isEnemy(this)) {
this.target_city && this.target_city.alive && this.target_city.kingdom != this && this.target_city.kingdom.isEnemy(this) || (this.target_city = null);
this.target_city || this.findCityTarget();
} else this.clearTarget();
};
t.prototype.clearTarget = function() {
this.target_city = null;
this.target_kingdom = null;
};
t.prototype.makeSurvivorsToNomads = function() {
var t, e, i, o;
if (0 != this.units.length) {
try {
for (var a = r(this.units.list), n = a.next(); !n.done; n = a.next()) {
var s = n.value;
if (null === (i = s.data) || void 0 === i ? void 0 : i.alive) {
if ("boat" == (null === (o = s.stats) || void 0 === o ? void 0 : o.race)) {
s.killHimself(!0);
continue;
}
s.cancelAllBeh();
s.removeFromCity();
s.removeFromGroup();
s.setKingdom(y.default.inst.kingdoms.dict_hidden["nomads_" + s.stats.race]);
}
}
} catch (e) {
t = {
error: e
};
} finally {
try {
n && !n.done && (e = a.return) && e.call(a);
} finally {
if (t) throw t.error;
}
}
this.units.clear();
}
};
t.prototype.clearKingData = function() {
this.king = null;
this.data.lastKingRuledFor > 10 && (this.data.check_for_independence = !0);
this.data.lastKingRuledFor = 0;
};
t.prototype.updateAge = function() {
this.data.age++;
this.king && this.data.lastKingRuledFor++;
};
t.prototype.newCityBuiltEvent = function(t) {
this.cities.forEach(function(e) {
e.forceSettleTarget(t);
});
};
t.prototype.getPopulationTotal = function() {
var t = this.units.length;
this.cities.forEach(function(e) {
t += e.getPopulationPopPoints();
});
return t;
};
t.prototype.countArmy = function() {
var t = 0;
this.cities.forEach(function(e) {
t += e.getArmy();
});
return t;
};
t.prototype.countArmyMax = function() {
var t = 0;
this.cities.forEach(function(e) {
t += e.getArmyMaxCity();
});
return t;
};
t.prototype.getMaxCities = function() {
var t = this.race.civ_baseCities;
this.king && (t += this.king.curStats.cities);
return t;
};
t.prototype.diceAgressionSuccess = function() {
return !!this.king && (this.cities.length < this.getMaxCities() || !!(this.cities.length >= this.getMaxCities() && f.Toolbox.randomChance(this.king.curStats.personality_aggression)));
};
t.kingdoms = 0;
t._temp_kingdoms = [];
return t;
}();
i.default = T;
cc._RF.pop();
}, {
"../../../common/src/data/AchievData": void 0,
"../MapBox": "MapBox",
"../actors/ActorBase": "ActorBase",
"../actors/ActorJob": "ActorJob",
"../actors/ActorStatus": "ActorStatus",
"../ai/AiSystem": "AiSystem",
"../assetLibrary/AssetManager": "AssetManager",
"../base/BaseBuilding": "BaseBuilding",
"../common/ToolBox": "ToolBox",
"../map/generator/NameGenerator": "NameGenerator",
"./DiplomacyRelation": "DiplomacyRelation",
"./KingdomColors": "KingdomColors"
} ],
LavaLayer: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "09e47YtpfNKvIh9PMHVSQjM", "LavaLayer");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
}), r = this && this.__decorate || function(t, e, i, o) {
var a, r = arguments.length, n = r < 3 ? e : null === o ? o = Object.getOwnPropertyDescriptor(e, i) : o;
if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) n = Reflect.decorate(t, e, i, o); else for (var s = t.length - 1; s >= 0; s--) (a = t[s]) && (n = (r < 3 ? a(n) : r > 3 ? a(e, i, n) : a(e, i)) || n);
return r > 3 && n && Object.defineProperty(e, i, n), n;
}, n = this && this.__values || function(t) {
var e = "function" == typeof Symbol && Symbol.iterator, i = e && t[e], o = 0;
if (i) return i.call(t);
if (t && "number" == typeof t.length) return {
next: function() {
t && o >= t.length && (t = void 0);
return {
value: t && t[o++],
done: !t
};
}
};
throw new TypeError(e ? "Object is not iterable." : "Symbol.iterator is not defined.");
};
Object.defineProperty(i, "__esModule", {
value: !0
});
var s = t("../../../../common/src/GameCommon"), l = t("../../assetLibrary/AssetManager"), c = t("../../base/BaseObjectData"), u = t("../../common/ToolBox"), d = t("../../MapBox"), h = t("../tile/TileType"), p = cc._decorator, f = p.ccclass, m = p.property, y = function(t) {
a(e, t);
function e() {
var e = null !== t && t.apply(this, arguments) || this;
e.maxLavaLevel = 3;
e.maxTicksToRemove = 15;
e.stopLavaUpdate = !1;
e.lavaTypes = new Map();
e._lavaIslands = [];
return e;
}
e.prototype.onLoad = function() {
this.lavaTypes.set(0, h.TileType.get("lava0"));
this.lavaTypes.set(1, h.TileType.get("lava1"));
this.lavaTypes.set(2, h.TileType.get("lava2"));
this.lavaTypes.set(3, h.TileType.get("lava3"));
t.prototype.create.call(this);
};
e.prototype.loadLavaTile = function(t) {
t.lavaTick = 0;
};
e.prototype.increaseLava = function(t) {
t.type.lavaLevel <= this.maxLavaLevel && (t.type.lavaLevel < this.maxLavaLevel ? this.changeLavaTile(t, this.lavaTypes.get(t.type.lavaLevel + 1)) : this.changeLavaTile(t, this.lavaTypes.get(this.maxLavaLevel)));
};
e.prototype.decreaseLava = function(t) {
t.type.lavaLevel <= this.maxLavaLevel && (t.type.lavaLevel > 0 ? this.changeLavaTile(t, this.lavaTypes.get(t.type.lavaLevel - 1)) : this.putOut(t));
};
e.prototype.addLava = function(t, e) {
void 0 === e && (e = "lava3");
if (t.type.lavaLevel < this.maxLavaLevel) {
t.type.explodable && t.type.burnable && (this.stopLavaUpdate = !0);
t.setFire();
d.default.inst.terraformTile2(t, h.TileType.get(e), l.default.terraform.get("lavaDamage"));
}
};
e.prototype.changeLavaTile = function(t, e) {
var i = "string" == typeof e ? h.TileType.get(e) : e;
t.type != e && d.default.inst.terraformTile2(t, i, l.default.terraform.get("lavaDamage"));
};
e.prototype.lavaEffect = function() {};
e.prototype.logicUpdate = function() {
this.updateLava();
};
e.prototype.updateLava = function() {
var t = this;
if (!s.default.isPaused) if (this.timer > 0) this.timer -= d.default.inst.elapsed; else {
this.stopLavaUpdate = !1;
this.timer = .05;
this._lavaIslands.clear();
d.default.inst.islandsCalculator.islands.forEach(function(e) {
e.type == h.TileLayerType.Lava && t._lavaIslands.push(e);
});
this._lavaIslands.forEach(function(e) {
var i, o, a = e.regions.getRandom();
try {
for (var r = n(a.tiles), s = r.next(); !s.done; s = r.next()) {
var l = s.value;
if (!u.Toolbox.randomBool()) {
l.building && l.building.stats.affectedByLava && l.building.getHit(10);
if (l.type.lavaLevel > 1) {
if (l.lavaTick > 0) l.lavaTick--; else if (u.Toolbox.randomBool()) {
t.moveLava(l);
if (t.stopLavaUpdate) break;
l.flash_state <= 0 && Math.random() > .995 && l.setFire(!0);
}
} else if (1 != l.type.lavaLevel || d.default.inst.worldLaws.world_law_forever_lava.boolVal) if (0 != l.type.lavaLevel || d.default.inst.worldLaws.world_law_forever_lava.boolVal) l.lavaTick = 0; else {
l.lavaTick++;
l.lavaTick > 10 && t.changeLavaTile(l, "hills");
} else {
l.lavaTick++;
l.lavaTick > 5 && t.changeLavaTile(l, t.lavaTypes.get(0));
}
}
}
} catch (t) {
i = {
error: t
};
} finally {
try {
s && !s.done && (o = r.return) && o.call(r);
} finally {
if (i) throw i.error;
}
}
});
}
};
e.prototype.moveLava = function(t) {
var e = this, i = null;
t.neighbours.shuffle();
t.neighbours.forEach(function(o) {
o.type.lava || (o.type.frozen ? d.default.inst.unfreezeTile(o) : o.setFire());
o.type.z <= t.type.z && o.type.lavaLevel != t.type.lavaLevel && (!o.type.lava || o.type.lavaLevel < e.maxLavaLevel) && (!i || i.type.z > o.type.z) && (i = o);
});
if (!i) {
t.lavaTick = 30;
return !1;
}
t.type.lavaLevel > 0 && this.changeLavaTile(t, this.lavaTypes.get(t.type.lavaLevel - 1));
-1 == i.type.lavaLevel ? this.changeLavaTile(i, this.lavaTypes.get(1)) : this.changeLavaTile(i, this.lavaTypes.get(i.type.lavaLevel + 1));
i.lavaTick = 0;
t.lavaTick = 0;
d.default.inst.flashEffects.flashPixel(i, 10);
this.lavaEffect(i);
return !0;
};
e.prototype.putOut = function(t) {
d.default.inst.increaseTile(t);
};
e.prototype.removeLava = function(t) {
d.default.inst.decreaseTile(t);
};
r([ m ], e.prototype, "maxLavaLevel", void 0);
r([ m ], e.prototype, "maxTicksToRemove", void 0);
return r([ f ], e);
}(c.BaseModule);
i.default = y;
cc._RF.pop();
}, {
"../../../../common/src/GameCommon": void 0,
"../../MapBox": "MapBox",
"../../assetLibrary/AssetManager": "AssetManager",
"../../base/BaseObjectData": "BaseObjectData",
"../../common/ToolBox": "ToolBox",
"../tile/TileType": "TileType"
} ],
LuckyWheel: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "5b997plIjNHMoicTcfQtr/X", "LuckyWheel");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
}), r = this && this.__decorate || function(t, e, i, o) {
var a, r = arguments.length, n = r < 3 ? e : null === o ? o = Object.getOwnPropertyDescriptor(e, i) : o;
if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) n = Reflect.decorate(t, e, i, o); else for (var s = t.length - 1; s >= 0; s--) (a = t[s]) && (n = (r < 3 ? a(n) : r > 3 ? a(e, i, n) : a(e, i)) || n);
return r > 3 && n && Object.defineProperty(e, i, n), n;
};
Object.defineProperty(i, "__esModule", {
value: !0
});
var n = t("../../../../../framework/lib/prototype/MathUtils"), s = t("../../../../../framework/main/Constants"), l = t("../../../../common/src/advert/AdsManager"), c = t("../../../../common/src/data/RewardData"), u = t("../../../../common/src/data/UserData"), d = t("../../../../common/src/GamePopBase"), h = t("../../../../common/src/MsgCache"), p = t("../../common/ToolBox"), f = t("../../common/ViewController"), m = t("../../texture/TextureLoader"), y = t("../guide/GuideController"), _ = t("./AwardView"), g = cc._decorator, v = g.ccclass, b = g.property, T = function(t) {
a(e, t);
function e() {
var e = null !== t && t.apply(this, arguments) || this;
e.btnStart = null;
e.videoNode = null;
e.btnClose = null;
e.ruleBg = null;
e.wheelPointer = null;
e.selectFrame = null;
e.rewardParents = [];
e.rewards = [];
e.startIdx = 4;
return e;
}
e.prototype.onLoad = function() {
this.videoNode.active = u.default.member.luckyWheelCount > 0;
this.btnStart.interactable = !1;
};
e.prototype.clickRule = function() {
this.ruleBg.active = !this.ruleBg.active;
};
e.prototype.start = function() {
this.reset();
};
e.prototype.reset = function() {
for (var t = this, e = 0; e < this.rewardParents.length; e++) {
var i = this.rewardParents[e];
this.rewards[e] = c.default.getRewards(this.startIdx + e);
this.fillRewards(this.rewards[e], i);
}
this.scheduleOnce(function() {
t.wheelPointer.angle = 0;
t.btnClose.interactable = !0;
t.btnStart.interactable = !0;
}, .5);
};
e.prototype.fillRewards = function(t, e) {
for (var i = 0; i < t.length; i++) {
var o = e.getChildByName("item" + i);
if (o) {
var a = u.default.getPropConfigByID(t[i].propID), r = o.getChildByName("rare");
r.active = a.rare >= 0 && s.default.MODE != s.MODE_TYPE.LOCK;
if (r.active) {
var n = m.TextureLoader.inst.getSpriteFrame(m.ATLAS_TYPE.UIATLAS, "reward/rare_" + a.rare);
n && (r.getComponent(cc.Sprite).spriteFrame = n);
}
var l = o.getChildByName("icon"), c = m.TextureLoader.inst.getSpriteFrame(m.ATLAS_TYPE.UIATLAS, "propIcon/icon" + t[i].propID);
c && (l.getComponent(cc.Sprite).spriteFrame = c);
o.getChildByName("num").getComponent(cc.Label).string = "X" + t[i].number;
}
}
};
e.prototype.onClickStart = function(t) {
var e = this, i = t.getCurrentTarget().getComponent(cc.Button);
i.interactable = !1;
if (this.videoNode.active) {
s.default.REPORT_ID = "luckyWheel";
l.default.showVideoAds(function(t) {
if (1 == t) e.startTurn(); else {
i.interactable = !0;
var o = 0 == t ? "视频播放未完成。" : "视频播放失败，请稍候再试！";
h.default.pushToast(o);
}
});
} else {
y.default.inst.in(y.GUIDE_TYPE.luckyWheel, 1) && y.default.inst.do(y.GUIDE_TYPE.luckyWheel);
this.startTurn();
}
};
e.prototype.startTurn = function() {
this.btnClose.interactable = !1;
this.btnStart.interactable = !1;
var t = 4 + p.Toolbox.randomFloat(0, 3), e = 1.5 * t, i = this.wheelPointer.angle + 360 * e + p.Toolbox.randomFloat(0, 360);
cc.tween(this.wheelPointer).to(t, {
angle: i
}, {
easing: "sineInOut"
}).call(this.stopTurn.bind(this)).start();
};
e.prototype.stopTurn = function() {
var t = this;
this.wheelPointer.angle %= 360;
var e = this.selectFrame.angle / 60;
e = n.default.clamp(e, 0, 5);
u.default.member.luckyWheelCount++;
u.default.save();
setTimeout(function() {
f.default.open(f.view_type.AwardView, null, null, !0, function(i) {
i.getComponent(_.default).init(_.Reward_type.luckyWheel, t.rewards[e]);
t.reset();
t.videoNode.active = !0;
});
}, 1e3);
};
e.prototype.update = function() {
this.selectFrame.angle = 60 * Math.floor((this.wheelPointer.angle + 30) / 60) % 360;
};
r([ b({
type: cc.Button,
tooltip: "开始按钮"
}) ], e.prototype, "btnStart", void 0);
r([ b(cc.Node) ], e.prototype, "videoNode", void 0);
r([ b(cc.Button) ], e.prototype, "btnClose", void 0);
r([ b({
type: cc.Node,
tooltip: "概率公示窗口"
}) ], e.prototype, "ruleBg", void 0);
r([ b({
type: cc.Node,
tooltip: "轮盘转动指针"
}) ], e.prototype, "wheelPointer", void 0);
r([ b({
type: cc.Node,
tooltip: "选择框"
}) ], e.prototype, "selectFrame", void 0);
r([ b({
type: [ cc.Node ],
tooltip: "奖励item的父节点"
}) ], e.prototype, "rewardParents", void 0);
return r([ v ], e);
}(d.GamePopBase);
i.default = T;
cc._RF.pop();
}, {
"../../../../../framework/lib/prototype/MathUtils": void 0,
"../../../../../framework/main/Constants": void 0,
"../../../../common/src/GamePopBase": void 0,
"../../../../common/src/MsgCache": void 0,
"../../../../common/src/advert/AdsManager": void 0,
"../../../../common/src/data/RewardData": void 0,
"../../../../common/src/data/UserData": void 0,
"../../common/ToolBox": "ToolBox",
"../../common/ViewController": "ViewController",
"../../texture/TextureLoader": "TextureLoader",
"../guide/GuideController": "GuideController",
"./AwardView": "AwardView"
} ],
MapBorder: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "4ed09wfX/VLyIzzK2gz5SRf", "MapBorder");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
}), r = this && this.__decorate || function(t, e, i, o) {
var a, r = arguments.length, n = r < 3 ? e : null === o ? o = Object.getOwnPropertyDescriptor(e, i) : o;
if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) n = Reflect.decorate(t, e, i, o); else for (var s = t.length - 1; s >= 0; s--) (a = t[s]) && (n = (r < 3 ? a(n) : r > 3 ? a(e, i, n) : a(e, i)) || n);
return r > 3 && n && Object.defineProperty(e, i, n), n;
};
Object.defineProperty(i, "__esModule", {
value: !0
});
i.MapBorder = void 0;
var n = t("../../MapBox"), s = t("../../ui/power/PowerButtonSelector"), l = t("../../world/WorldTimer"), c = cc._decorator, u = c.ccclass, d = c.property, h = function(t) {
a(e, t);
function e() {
var e = null !== t && t.apply(this, arguments) || this;
e.currentState = 0;
e.updateTimer = null;
e.alphaTimer = null;
e.curWidth = 0;
e.curHeight = 0;
e.alpha = 0;
e.sprRenderer = null;
return e;
}
e.prototype.start = function() {
this.updateTimer = new l.default(.12, this.updateEffect.bind(this));
this.alphaTimer = new l.default(.02, this.updateAlpha.bind(this));
};
e.prototype.generateTexture = function() {
if (this.curWidth != n.default.width || this.curHeight != n.default.height) {
this.curWidth = n.default.width;
this.curHeight = n.default.height;
this.getComponent(cc.Widget).updateAlignment();
var t = this.curWidth * this.curHeight, e = new Uint8Array(this.curWidth * this.curHeight * 4);
e.fill(0);
for (var i = [], o = [], a = 0, r = 0, s = 0; s < t; s++) {
0 == r && i.indexOf(s) < 0 && o.push(s);
if (++a >= this.curWidth) {
a = 0;
r++;
break;
}
}
i = i.addRange(o);
o = [];
a = 0;
r = 0;
for (var l = 0; l < t; l++) {
a == this.curWidth - 1 && i.indexOf(l) < 0 && o.push(l);
if (++a >= this.curWidth) {
a = 0;
r++;
}
}
i = i.addRange(o);
o = [];
a = 0;
r = 0;
for (var c = 0; c < t; c++) {
r == this.curHeight - 1 && i.indexOf(c) < 0 && o.push(c);
if (++a >= this.curWidth) {
a = 0;
r++;
}
}
i = i.addRange(o);
o = [];
a = 0;
r = 0;
for (var u = 0; u < t; u++) {
0 == a && i.indexOf(u) < 0 && o.push(u);
if (++a >= this.curWidth) {
a = 0;
r++;
}
}
o.reverse();
i = i.addRange(o);
for (var d = 0, h = 0; h < i.length; h++) {
var p = i[h];
if (0 == d || 1 == d || 2 == d) {
e[4 * p] = 255;
e[4 * p + 1] = 255;
e[4 * p + 2] = 255;
e[4 * p + 3] = 255;
d++;
} else d = 0;
}
var f = new cc.Texture2D();
f.initWithData(e, cc.Texture2D.PixelFormat.RGBA8888, n.default.width, n.default.height);
f.setFilters(cc.Texture2D.Filter.NEAREST, cc.Texture2D.Filter.NEAREST);
var m = new cc.SpriteFrame();
m.setTexture(f);
this.sprRenderer.spriteFrame = m;
}
};
e.prototype.update = function() {
this.updateTimer.logicUpdate();
this.alphaTimer.logicUpdate();
};
e.prototype.updateAlpha = function() {
if (s.PowerButtonSelector.inst.selectedButton) {
this.alpha += .02;
this.alpha > .42 && (this.alpha = .42);
} else {
this.alpha -= .02;
this.alpha < 0 && (this.alpha = 0);
}
this.sprRenderer.node.opacity != 255 * this.alpha && this.setAlpha(this.alpha);
};
e.prototype.updateEffect = function() {
if (0 != this.alpha) {
this.currentState++;
this.currentState > 3 && (this.currentState = 0);
switch (this.currentState) {
case 0:
this.sprRenderer.node.scaleX = 1;
this.sprRenderer.node.scaleY = 1;
break;

case 1:
this.sprRenderer.node.scaleX = -1;
this.sprRenderer.node.scaleY = 1;
break;

case 2:
this.sprRenderer.node.scaleX = -1;
this.sprRenderer.node.scaleY = -1;
break;

case 3:
this.sprRenderer.node.scaleX = 1;
this.sprRenderer.node.scaleY = -1;
}
}
};
e.prototype.setAlpha = function(t) {
this.alpha = t;
this.sprRenderer.node.opacity = 255 * t;
};
r([ d(cc.Sprite) ], e.prototype, "sprRenderer", void 0);
return r([ u ], e);
}(cc.Component);
i.MapBorder = h;
cc._RF.pop();
}, {
"../../MapBox": "MapBox",
"../../ui/power/PowerButtonSelector": "PowerButtonSelector",
"../../world/WorldTimer": "WorldTimer"
} ],
MapBox: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "7502c8oTCtK+52mDPECj/kT", "MapBox");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
}), r = this && this.__decorate || function(t, e, i, o) {
var a, r = arguments.length, n = r < 3 ? e : null === o ? o = Object.getOwnPropertyDescriptor(e, i) : o;
if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) n = Reflect.decorate(t, e, i, o); else for (var s = t.length - 1; s >= 0; s--) (a = t[s]) && (n = (r < 3 ? a(n) : r > 3 ? a(e, i, n) : a(e, i)) || n);
return r > 3 && n && Object.defineProperty(e, i, n), n;
}, n = this && this.__values || function(t) {
var e = "function" == typeof Symbol && Symbol.iterator, i = e && t[e], o = 0;
if (i) return i.call(t);
if (t && "number" == typeof t.length) return {
next: function() {
t && o >= t.length && (t = void 0);
return {
value: t && t[o++],
done: !t
};
}
};
throw new TypeError(e ? "Object is not iterable." : "Symbol.iterator is not defined.");
};
Object.defineProperty(i, "__esModule", {
value: !0
});
var s = t("../../../framework/lib/prototype/MathUtils"), l = t("../../../framework/main/Constants"), c = t("../../../framework/utils/Log"), u = t("../../../framework/utils/Tools"), d = t("../../../framework/utils/UiUtil"), h = t("../../common/src/data/AchievData"), p = t("../../common/src/data/UserData"), f = t("../../common/src/GameCommon"), m = t("../../common/src/module/LoadLayer"), y = t("../../common/src/MsgCache"), _ = t("./actors/ActionLibrary"), g = t("./actors/Actor"), v = t("./actors/ActorBag"), b = t("./actors/ActorBase"), T = t("./actors/ActorStatus"), w = t("./actors/AutoTesterBot"), B = t("./actors/other/Ant"), k = t("./actors/other/boat/Boat"), A = t("./actors/other/boat/TaxiManager"), S = t("./actors/other/dragon/Dragon"), x = t("./actors/other/GodFinger"), C = t("./actors/other/Tornado"), O = t("./actors/other/UFO"), P = t("./actors/UnitGroupManager"), R = t("./ai/pathFinding/AStarFinder"), M = t("./ai/pathFinding/AStarParam"), L = t("./ai/pathFinding/RegionPathFinder"), F = t("./ai/pathFinding/StaticGrid"), D = t("./animation/ActorAnimationLoader"), I = t("./animation/BuildingAnimationLoader"), j = t("./animation/MapObjectShadow"), E = t("./assetLibrary/AssetManager"), N = t("./assetLibrary/lib/ResourceLibrary"), G = t("./base/BaseBuilding"), U = t("./base/BaseEffect"), z = t("./behaviour/WorldBehaviour"), W = t("./brush/Brush"), H = t("./building/Building"), K = t("./city/City"), V = t("./city/CityBuildOrder"), q = t("./city/CityPlaceFinder"), Z = t("./city/CityTaskList"), J = t("./common/GameUtils"), Y = t("./common/MoveCamera"), X = t("./common/PrefabLibrary"), Q = t("./common/SmoothLoader"), $ = t("./common/ToolBox"), tt = t("./common/UnusedLibrary"), et = t("./common/ViewController"), it = t("./common/WaterHelper"), ot = t("./Config"), at = t("./DebugConfig"), rt = t("./effect/CloudController"), nt = t("./effect/EffectDivineLight"), st = t("./effect/ExplosionsEffects"), lt = t("./effect/GlowParticles"), ct = t("./effect/HeatRayEffect"), ut = t("./effect/Meteorite"), dt = t("./effect/PixelFlashEffects"), ht = t("./effect/StackEffects"), pt = t("./effect/WaveController"), ft = t("./game/audio/GameAudio"), mt = t("./game/guide/GuideController"), yt = t("./kingdom/KingdomColors"), _t = t("./kingdom/KingdomManager"), gt = t("./map/drop/DropManager"), vt = t("./map/generator/GeneratorTool"), bt = t("./map/generator/NameGenerator"), Tt = t("./map/generator/WorldNameGenerator"), wt = t("./map/layer/BurnedTilesLayer"), Bt = t("./map/layer/ConwayLife"), kt = t("./map/layer/FireLayer"), At = t("./map/layer/GreyGooLayer"), St = t("./map/layer/IslandsCalculator"), xt = t("./map/layer/LavaLayer"), Ct = t("./map/layer/RoadsCalculator"), Ot = t("./map/layer/UnitLayer"), Pt = t("./map/layer/ZoneCalculator"), Rt = t("./map/map/MapBorder"), Mt = t("./map/map/MapChunkManager"), Lt = t("./map/map/MapEdges"), Ft = t("./map/map/MapLayer"), Dt = t("./map/map/MapMarks"), It = t("./map/map/MapNamesManager"), jt = t("./map/map/MapStats"), Et = t("./map/map/PathFindingVisualiser"), Nt = t("./map/map/QualityChanger"), Gt = t("./map/map/RegionLinkHashes"), Ut = t("./map/tile/Heat"), zt = t("./map/tile/TileMover"), Wt = t("./map/tile/TileType"), Ht = t("./map/tile/UnitZones"), Kt = t("./map/tile/WorldTile"), Vt = t("./map/tile/WorldTilemap"), qt = t("./natural/Earthquake"), Zt = t("./natural/PrintLibrary"), Jt = t("./save/SaveManager"), Yt = t("./save/StatsData"), Xt = t("./ui/log/WorldLog"), Qt = t("./ui/power/GodActions"), $t = t("./ui/power/GodPower"), te = t("./ui/power/PowerActionsModule"), ee = t("./ui/power/PowerButtonSelector"), ie = t("./ui/UiController"), oe = t("./world/WorldLaws"), ae = cc._decorator, re = ae.ccclass, ne = ae.property, se = function(t) {
a(e, t);
function e() {
var e = null !== t && t.apply(this, arguments) || this;
e.savedGuideMap = null;
e.prefab_city = null;
e.mapPos = cc.Vec3.ZERO;
e.perlinScale = 5.7;
e.perlinX = 1;
e.perlinY = 1;
e.saveManager = null;
e.gameStats = new Yt.GameStatsData();
e.mapStats = null;
e.worldLaws = new oe.default();
e.tilesList = [];
e.citiesList = [];
e.units = null;
e.buildings = null;
e.kingdoms = null;
e.tilemap = null;
e.sortZIndexTimer = 0;
e.autoSaveTimer = 120;
e.redrawTimer = 0;
e.behaviours = [];
e.behavioursDict = new Map();
e.worldBehaviour_zones = null;
e.worldBehaviour_trees = null;
e.worldBehaviour_water = null;
e.worldBehaviour_soil = null;
e.worldBehaviour_erosion = null;
e.worldBehaviour_fire = null;
e.worldBehaviour_burned = null;
e.temp_map_objects = [];
e.initiated = !1;
e.regionPathFinder = new L.default();
e.stackEffects = null;
e.printLibrary = null;
e.dropManager = null;
e.pathFindingVisualiser = null;
e.worldLayer = null;
e.unitLayer = null;
e.lavaLayer = null;
e.greyGooLayer = null;
e.flashEffects = null;
e.fireLayer = null;
e.islandsCalculator = null;
e.zoneCalculator = null;
e.roadsCalculator = null;
e.burnedLayer = null;
e.explosionLayer = null;
e.conwayLayer = null;
e.earthquakeManager = null;
e.cloudController = null;
e.waveController = null;
e.mapChunkManager = null;
e.mapLayers = [];
e.mapModules = [];
e.wind_direction = cc.Vec2.ZERO;
e.searchGridGround = null;
e.tilesDirty = new Set();
e.tileMover = null;
e.particlesFire = null;
e.particlesSmoke = null;
e.updateWorldBehaviours = !0;
e.hasFocus = !1;
e.heat = null;
e.heatRayFx = null;
e.fxDivineLight = null;
e.mapBorder = null;
e.qualityChanger = null;
e.transformParents = null;
e.transformCreatures = null;
e.transformShadows = null;
e.cityPlaceFinder = null;
e.unitZones = null;
e.worldLog = null;
e.actions = null;
e.timer_hunger = 0;
e.unitGroupManager = null;
e.auto_tester = null;
e._unitSelectEffect = null;
e.pathfindingParam = new M.default();
e.holdPosition = cc.v2(-1, -1);
e.firstClick = !0;
e.lastClickTime = 0;
e.timerSpawnPixels = 0;
e._list_to_clean_effects = [];
e.pixelLimit = 0;
e.shakeTimer = 0;
e.frameIndex = 0;
e.shakeIntervalTimer = 0;
e.shakeIntencity = 1;
e.shakeInterval = .1;
e.shakeX = !0;
e.shakeY = !0;
e.elapsed = 0;
e.results = [];
e.inspectTimerClick = 0;
e.touchTimer = 0;
e.alreadyUsedZoom = !1;
e.alreadyUsedPower = !1;
e.currentTouch = cc.Vec2.ZERO;
e.dirtyTilesLast = 0;
e.isKeyDownCode = -1;
e.guideHumansNum = 0;
e.guideSeedsNum = 0;
e.achievementLightningTimes = [];
e.achievementDestructionKills = new Map();
e.achievementDivineLightKills = new Map();
e.placeBeehive = !1;
return e;
}
i = e;
e.prototype.onLoad = function() {
i.inst = this;
this.initLibs();
this.actions = new te.default();
this.worldLog = new Xt.default();
this.unitGroupManager = new P.default();
this.islandsCalculator = new St.default();
this.unitZones = new Ht.default();
this.cityPlaceFinder = new q.default();
this.transformShadows = this.node.getChildByName("Shadows");
this.tileMover = new zt.default();
this.units = new b.ActorContainer();
this.buildings = new G.BuildingContainer();
this.kingdoms = new _t.default();
this.heat = new Ut.default();
this.wind_direction = cc.v2(-.1, .2);
z.default.init();
this.newBehaviour(80, "disasters");
this.worldBehaviour_zones = this.newBehaviour(.05, "zones");
this.worldBehaviour_trees = this.newBehaviour(2, "trees");
this.worldBehaviour_water = this.newBehaviour(.2, "water");
this.worldBehaviour_soil = this.newBehaviour(.3, "soil");
this.worldBehaviour_fire = this.newBehaviour(.2, "fire");
this.worldBehaviour_burned = this.newBehaviour(.1, "burned_tiles");
this.worldBehaviour_erosion = this.newBehaviour(2.5, "erosion");
this.newBehaviour(OS_IOS ? 5 : 2.5, "animal_spawn");
this.node.on(cc.Node.EventType.TOUCH_START, this.onTouchStart, this);
this.node.on(cc.Node.EventType.TOUCH_END, this.onTouchEnd, this);
this.node.on(cc.Node.EventType.TOUCH_MOVE, this.onTouchMove, this);
};
e.prototype.start = function() {
var t = this;
this.initiated = !0;
this.mapLayers.push(this.worldLayer);
this.mapLayers.push(this.unitLayer);
this.mapLayers.push(this.zoneCalculator);
this.mapLayers.push(this.fireLayer);
this.mapLayers.push(this.burnedLayer);
this.mapLayers.push(this.explosionLayer);
this.mapLayers.push(this.conwayLayer);
this.mapLayers.push(this.pathFindingVisualiser);
this.mapLayers.push(this.flashEffects);
this.mapModules.push(this.roadsCalculator);
this.mapModules.push(this.greyGooLayer);
this.mapModules.push(this.lavaLayer);
this.mapChunkManager = new Mt.default();
this.scheduleOnce(function() {
t.startTheGame();
}, .02);
};
e.prototype.initLibs = function() {
c.default.i("InitLibraries " + ot.default.gv, "initLibs", "st");
$.Toolbox.init();
V.default.init();
bt.default.init();
E.default.init();
yt.default.init();
D.default.init();
I.default.init();
Z.default.init();
Qt.default.init();
vt.GeneratorTool.init();
Wt.TileType.init();
W.default.init();
c.default.i("InitLibraries", "initLibs", "en");
};
e.prototype.startTheGame = function() {
var t = this;
c.default.d("MapBox", "startTheGame", "start");
ot.default.gameLoaded = !0;
ot.default.LOAD_TIME_CREATE = cc.sys.now();
if (FIRST_PLAY && this.savedGuideMap) Jt.default.loadString(this.savedGuideMap.text); else {
this.generateNewMap();
Q.default.add(function() {
t.addBuilding("volcano", t.getTile(i.width / 2, i.height / 2));
}, "add_volcano");
}
ot.default.LOAD_TIME_GENERATE = cc.sys.now();
c.default.d("MapBox", "startTheGame", "end");
};
e.prototype.generateNewMap = function(t) {
void 0 === t && (t = "islands");
if (this.initiated) {
cc.log("MapBox", "generateNewMap", "start");
Q.default.prepare();
"custom" != t && (ot.default.customMapSize = ot.default.customMapSizeDefault);
var e = 2;
switch (ot.default.customMapSize) {
case "tiny":
e = 2;
break;

case "small":
e = 3;
break;

case "standard":
e = 4;
break;

case "large":
e = 5;
break;

case "huge":
e = 6;
break;

case "gigantic":
e = 7;
}
ot.default.ZONE_AMOUNT_X = e;
ot.default.ZONE_AMOUNT_Y = e;
Q.default.add(function() {
i.inst.setMapSize(ot.default.ZONE_AMOUNT_X, ot.default.ZONE_AMOUNT_Y);
}, "Generate New Map (3/3)");
this.generateMap(t);
Q.default.add(function() {
i.inst.finishMakingWorld();
c.default.d("MapBox", "generateNewMap", "end");
}, "gen: Finish Making World", !0);
}
};
e.prototype.generateMap = function(t) {
void 0 === t && (t = "islands");
c.default.d("MapBox", "generateMap", "start");
Q.default.add(function() {
i.inst.clearWorld();
}, "gen: Clearing World", !0);
Q.default.add(function() {
Wt.TileType.setListTo("generator");
i.inst.worldLaws.init();
}, "gen: World Laws");
Q.default.add(function() {
i.inst.mapStats = new jt.default();
i.inst.mapStats.name = Tt.default.generateName();
var t = $.Toolbox.randomInt(10, 1e3);
$.Toolbox.setRandomSeed(t);
}, "gen: Generating Name");
var e = 0, o = 0, a = !1;
switch (t) {
case "archipelago":
case "islands":
a = !0;
o = 20;
}
"archipelago" == t ? this.perlinScale = 20 : "islands" == t && (this.perlinScale = 5);
if ("custom" == t) {
o = ot.default.customRandomShapes;
this.perlinScale = ot.default.customPerlinScale;
e = ot.default.customWaterLevel;
a = !0;
}
if (a) for (var r = 0; r < o; r++) Q.default.add(function() {
vt.GeneratorTool.applyRandomShape();
}, "Perlin Random Shapes (" + (r + 1) + "/" + o + ")");
if (a) {
Q.default.add(function() {
i.inst.perlinX = $.Toolbox.randomRange(0, 15e3);
i.inst.perlinY = $.Toolbox.randomRange(0, 15e3);
var t = i.inst.perlinScale;
vt.GeneratorTool.applyPerlinNoice(i.width, i.height, i.inst.perlinX, i.inst.perlinY, 1, 1 * t);
}, "Perlin Noise", !0);
Q.default.add(function() {
Lt.default.addEdge();
}, "Perlin Edges", !0);
Q.default.add(function() {
var t = i.inst.perlinScale, e = $.Toolbox.randomInt(0, 1e4), o = $.Toolbox.randomInt(0, 1e4);
vt.GeneratorTool.applyPerlinNoice(i.width, i.height, e, o, .2, 4 * t, !0);
}, "Perlin Noise (1/2)");
Q.default.add(function() {
var t = i.inst.perlinScale, e = $.Toolbox.randomInt(0, 1e4), o = $.Toolbox.randomInt(0, 1e4);
vt.GeneratorTool.applyPerlinNoice(i.width, i.height, e, o, .1, 10 * t, !0);
}, "Perlin Noise (2/2)");
for (var n = 0; n < o / 2; n++) Q.default.add(function() {
vt.GeneratorTool.applyRandomShape(2, .7, !0);
}, "Perlin Random Shapes (" + (n + 1) + "/" + o + ")");
Q.default.add(function() {
vt.GeneratorTool.applyWaterLevel(i.width, i.height, e);
}, "Perlin Water", !0);
Q.default.add(function() {
vt.GeneratorTool.applyRingEffect();
}, "Perlin Ring", !0);
}
Q.default.add(function() {
i.inst.updateTileTypes();
}, "Generate Tiles", !0);
Q.default.add(function() {
i.inst.mapChunkManager.allDirty();
}, "Map Chunk Manager (1/2)", !0);
Q.default.add(function() {
i.inst.mapChunkManager.updateDirty();
}, "Map Chunk Manager (2/2)", !0);
this.gameStats.gameTime > 200 && this.islandsCalculator.islands.forEach(function(t) {
$.Toolbox.randomChance(.2) || t.type != Wt.TileLayerType.Ground || Q.default.add(function() {
vt.GeneratorTool.modifyIsland(t);
}, "ModifyIsland");
});
Q.default.add(function() {
i.inst.tilesList.forEach(function(t) {
t.type.isType("mountains") && t.Height > 220 && i.inst.freezeTile(t);
});
}, "FreezeTile");
Q.default.add(function() {
Wt.TileType.setListTo("gameplay");
}, "Add gameplay");
Q.default.add(function() {
for (var t = i.inst.tilesList.length / 2, e = 0; e < t; e++) Q.default.add(function() {
var t = i.inst.tilesList.getRandom();
t.type.ground && t.zone.trees.size < (OS_IOS ? 2 : 3) && i.inst.tryGrowPlant(t, !0);
}, "Add Trees (" + (e + 1) + "/" + t + ")");
t = i.inst.tilesList.length / 20;
for (var o = 0; o < t; o++) Q.default.add(function() {
var t = i.inst.tilesList.getRandom();
t.type.canGrowFlowers && !$.Toolbox.randomChance(.1) && i.inst.terraformTile2(t, Wt.TileType.get(t.type.flowersTypeID), E.default.terraform.get("nothing"));
}, "Add Flowers (" + (o + 1) + "/" + t + ")");
}, "Add Plant");
Q.default.add(function() {
var t = i.inst.tilesList.length / 1e3, e = t / 2, o = e / 2, a = o;
i.inst.spawnResource(t, "stone");
i.inst.spawnResource(o, "gold");
i.inst.spawnResource(e, "ore_deposit");
i.inst.spawnResource(a, "fruit_bush", !1);
i.inst.spawnBeehvies(Math.floor(OS_IOS ? a / 4 : a / 2));
c.default.d("MapBox", "generateMap", "en");
c.default.v("创建世界耗时：", (cc.sys.now() - ot.default.LOAD_TIME_CREATE) / 1e3);
}, "Add Resources");
};
e.prototype.setMapSize = function(t, e) {
ot.default.ZONE_AMOUNT_X = t;
ot.default.ZONE_AMOUNT_Y = e;
i.width = 64 * ot.default.ZONE_AMOUNT_X;
i.height = 64 * ot.default.ZONE_AMOUNT_Y;
this.recreateSizes();
};
e.prototype.finishMakingWorld = function() {
this.mapChunkManager.allDirty();
this.centerCamera();
if (!tt.default.inst) {
d.UiUtil.openModule("res/prefab/UnusedLibrary");
ie.default.inst.initGuideView();
}
this.scheduleOnce(function() {
m.LoadLayer.closeLoading();
FIRST_PLAY || ie.default.inst.showBanner(!BYTEDANCE_GAME);
}, .02);
};
e.prototype.recreateSizes = function() {
this.node.width = i.width;
this.node.height = i.height;
this.getComponent(cc.Widget).updateAlignment();
this.mapPos = cc.v3(-i.width / 2, -i.height / 2);
this.worldLayer.node.width = i.width;
this.worldLayer.node.height = i.height;
this.searchGridGround = new F.default(i.width, i.height);
this.createTiles();
this.mapLayers.forEach(function(t) {
t.createTextureNew();
});
this.tilemap.prepare();
this.mapBorder.generateTexture();
};
e.prototype.getObjectsInChunks = function(t, e, i) {
var o = this;
void 0 === e && (e = 3);
void 0 === i && (i = Ft.MapObjectType.All);
this.temp_map_objects.clear();
this.checkChunk(t.chunk, t, e, i);
t.chunk.neighbours.forEach(function(a) {
o.checkChunk(a, t, e, i);
});
};
e.prototype.checkChunk = function(t, e, i, o) {
var a = this;
void 0 === o && (o = Ft.MapObjectType.All);
t.k_dict_objects.forEach(function(t) {
var r, s, l;
try {
for (var c = n(t), u = c.next(); !u.done; u = c.next()) {
var d = u.value;
if (null === (l = d.base_data) || void 0 === l ? void 0 : l.alive) {
if (d.isActor()) {
if (o == Ft.MapObjectType.Building) continue;
} else if (o == Ft.MapObjectType.Actor) continue;
0 != i && $.Toolbox.distTile(d.currentTile, e) > i || a.temp_map_objects.push(d);
}
}
} catch (t) {
r = {
error: t
};
} finally {
try {
u && !u.done && (s = c.return) && s.call(c);
} finally {
if (r) throw r.error;
}
}
});
};
e.prototype.getBuildingByID = function(t) {
var e, i, o;
try {
for (var a = n(this.buildings.list), r = a.next(); !r.done; r = a.next()) {
var s = r.value;
if (t == (null === (o = s.data) || void 0 === o ? void 0 : o.objectID)) return s;
}
} catch (t) {
e = {
error: t
};
} finally {
try {
r && !r.done && (i = a.return) && i.call(a);
} finally {
if (e) throw e.error;
}
}
return null;
};
e.prototype.getActorByID = function(t) {
var e, i, o;
try {
for (var a = n(this.units.list), r = a.next(); !r.done; r = a.next()) {
var s = r.value;
if ((null === (o = s.data) || void 0 === o ? void 0 : o.actorID) == t) return s;
}
} catch (t) {
e = {
error: t
};
} finally {
try {
r && !r.done && (i = a.return) && i.call(a);
} finally {
if (e) throw e.error;
}
}
return null;
};
e.prototype.getCityByID = function(t) {
var e, i, o;
try {
for (var a = n(this.citiesList), r = a.next(); !r.done; r = a.next()) {
var s = r.value;
if ((null === (o = s.data) || void 0 === o ? void 0 : o.cityID) == t) return s;
}
} catch (t) {
e = {
error: t
};
} finally {
try {
r && !r.done && (i = a.return) && i.call(a);
} finally {
if (e) throw e.error;
}
}
return null;
};
e.prototype.newBehaviour = function(t, e) {
var i = new z.default(t, e);
this.behaviours.push(i);
this.behavioursDict.set(e, i);
return i;
};
e.prototype.updateWalkableTile = function(t) {
t.type.ground ? this.searchGridGround.setWalkableAt(t.x, t.y, !0, t.type.cost) : this.searchGridGround.setWalkableAt(t.x, t.y, !1);
};
e.prototype.makeRoadBetween = function(t, e, o, a) {
void 0 === o && (o = null);
void 0 === a && (a = !1);
if (!(null == t ? void 0 : t.roadIsland) || (null == t ? void 0 : t.roadIsland) != (null == e ? void 0 : e.roadIsland)) {
i.temp_list_tiles.clear();
this.pathfindingParam.resetParam();
this.pathfindingParam.roads = !0;
this.calcPath(t, e, i.temp_list_tiles);
this.createRoad1(i.temp_list_tiles, t, e, a);
o && o.addRoads(i.temp_list_tiles2);
}
};
e.prototype.calcPath = function(t, e, i) {
i.clear();
var o, a = this.searchGridGround, r = M.HeuristicMode.MANHATTAN, n = 2, s = null;
if (this.pathfindingParam.water) {
o = 50;
s = F.DiagonalMovement.OnlyWhenNoObstacles;
} else {
o = this.pathfindingParam.limit ? 500 : -1;
s = F.DiagonalMovement.Always;
}
o = -1;
if (this.pathfindingParam.roads) {
n = 1;
s = F.DiagonalMovement.Never;
r = M.HeuristicMode.EUCLIDEAN;
}
a.reset();
var l = cc.v2(t.pos.x, t.pos.y), c = cc.v2(e.pos.x, e.pos.y);
if (!t.isSameIsland(e) && !this.pathfindingParam.water) {
i.push(t);
i.push(e);
this.pathFindingVisualiser.showPath(a, i);
return !0;
}
this.pathfindingParam.setGrid(a, l, c);
this.pathfindingParam.diagonalMovement = s;
this.pathfindingParam.setHeuristic(r);
this.pathfindingParam.maxOpenList = o;
this.pathfindingParam.weight = n;
R.default.findPath(this.pathfindingParam, i);
this.pathFindingVisualiser.showPath(a, i);
return 0 != i.length;
};
e.prototype.goodForCity = function(t) {
var e, i, o, a;
if (!t.canPlaceCityHere()) return !1;
try {
for (var r = n(t.neighboursAll), s = r.next(); !s.done; s = r.next()) if (s.value.city) return !1;
} catch (t) {
e = {
error: t
};
} finally {
try {
s && !s.done && (i = r.return) && i.call(r);
} finally {
if (e) throw e.error;
}
}
try {
for (var l = n(this.citiesList), c = l.next(); !c.done; c = l.next()) {
var u = c.value;
if ($.Toolbox.distVec3(u.cityCenter, t.centerTile.posV3) < 25) return !1;
}
} catch (t) {
o = {
error: t
};
} finally {
try {
c && !c.done && (a = l.return) && a.call(l);
} finally {
if (o) throw o.error;
}
}
return !0;
};
e.prototype.centerCamera = function() {
Y.MoveCamera.inst.centerCamera();
};
e.prototype.createTiles = function() {
this.tilesList = [];
for (var t = 0, e = 0; e < i.height; e++) for (var o = 0; o < i.width; o++) {
t = e * i.width + o;
var a = new Kt.default(o, e, t);
this.searchGridGround.setTileNode(o, e, a);
this.tilesList.push(a);
}
vt.GeneratorTool.generateTileNeighbours();
this.zoneCalculator.generate();
this.mapChunkManager.prepare();
};
e.prototype.spawnBeehvies = function(t) {
for (var e = 0; e < t; e++) {
var i = this.tilesList.getRandom();
i.type.grass && this.addBuilding("beehive", i, null, !0);
}
};
e.prototype.spawnResource = function(t, e, i) {
void 0 === i && (i = !0);
for (var o = "", a = 0; a < t; a++) {
var r = this.tilesList.getRandom();
if (r.type.ground) {
o = "";
i && ($.Toolbox.randomBool() ? o = "_s" : $.Toolbox.randomBool() && (o = "_m"));
this.addBuilding(e + o, r, null, !0);
}
}
};
e.prototype.tryGrowPlant = function(t, e, i, o, a) {
var r, s;
void 0 === e && (e = !1);
void 0 === i && (i = !1);
void 0 === o && (o = !0);
void 0 === a && (a = "");
var l = null;
if (!t.type.autoGrowPlants) return !1;
a && (l = E.default.buildings.get(a));
if (t.building && !t.building.isNonUsable()) return !1;
if (!l) if (t.type.isType("sand")) if (t.zone.tilesWithWater > 0) {
if ($.Toolbox.randomChance(.7)) return !1;
l = E.default.buildings.get("palm");
} else {
var c = !1;
try {
for (var u = n(t.zone.neighboursAll), d = u.next(); !d.done; d = u.next()) if (d.value.tilesWithWater > 0) {
c = !0;
break;
}
} catch (t) {
r = {
error: t
};
} finally {
try {
d && !d.done && (s = u.return) && s.call(u);
} finally {
if (r) throw r.error;
}
}
if (!c) {
if ($.Toolbox.randomChance(.7)) return !1;
l = E.default.buildings.get("cacti");
}
} else {
if (!t.type.growTypes) return !1;
var p = t.type.growTypes.split(",");
if (0 == p.length) return !1;
l = E.default.buildings.get(p.getRandom());
}
if (!l) return !1;
if (l.resourceType == N.ResourceType.Tree) {
if (t.zone.trees.size > 3) return !1;
} else if (l.resourceType == N.ResourceType.Fruits && t.zone.food.size > 3) return !1;
if ((!o || !(l.treeRandomChance < Math.random())) && this.canBuildFrom(t, l, null)) {
this.addBuilding(l.id, t, null, !1, i);
this.gameStats.treesGrown++;
h.default.update(69, this.gameStats.treesGrown - this.gameStats.treesDeath, !0);
return !0;
}
return !1;
};
e.prototype.buildNewCity = function(t, e, i, o, a) {
var r, s;
void 0 === e && (e = null);
void 0 === i && (i = null);
void 0 === o && (o = !1);
void 0 === a && (a = null);
if (e) {
var l = this.kingdoms.getKingdomByID(e.kingdomID);
l || (l = this.kingdoms.makeNewCivKingdom(null, E.default.raceLibrary.get(e.race), e.kingdomID, !1));
if (!l.isCiv()) return null;
if (!e.race) return null;
} else if (!this.goodForCity(t)) return null;
It.default.setDirty();
var c = cc.instantiate(this.prefab_city).getComponent(K.default);
c.create();
i && c.setRace(i);
e && c.loadCity(e);
if (o) c.setKingdom(this.kingdoms.getKingdomByID(e.kingdomID)); else {
c.setKingdom(a);
c.createNewCity();
}
c.node.parent = cc.find("Cities", this.node);
c.kingdom || this.kingdoms.makeNewCivKingdom(c);
c.addZone(t);
if (!o) {
t.neighboursAll.forEach(function(t) {
t.city || c.addZone(t);
});
try {
for (var u = n(this.citiesList), d = u.next(); !d.done; d = u.next()) if (d.value.race.id != c.race.id) {
h.default.update(26, 2, !0);
break;
}
} catch (t) {
r = {
error: t
};
} finally {
try {
d && !d.done && (s = u.return) && s.call(u);
} finally {
if (r) throw r.error;
}
}
}
this.citiesList.push(c);
return c;
};
e.prototype.getEmptyKingdomCity = function(t, e) {
var i = [];
e.cities.forEach(function(t) {
t.status.population <= 40 && (t.status.population <= 5 || 0 != t.status.homesFree) && i.push(t);
});
return $.Toolbox.getRandom(i);
};
e.prototype.newAttack = function(t, e, i, o) {
var a, r, s, l, c;
if (!i) return !1;
var u = t.curStats.targets;
$.Toolbox.temp_list_objects = [];
$.Toolbox.findEnemiesOfKingdomInChunk(i.chunk, t.kingdom);
0 == $.Toolbox.temp_list_objects.length && $.Toolbox.temp_list_objects.push([]);
$.Toolbox.temp_list_objects[0].push(o);
var d = $.Toolbox.randomChance(t.s_crit_chance), h = !1;
try {
for (var p = n($.Toolbox.temp_list_objects), f = p.next(); !f.done; f = p.next()) {
var m = f.value;
if (0 == u) return h;
m.shuffle();
try {
for (var y = (s = void 0, n(m)), _ = y.next(); !_.done; _ = y.next()) {
var g = _.value;
if (0 == u) break;
if ((null === (c = g.base_data) || void 0 === c ? void 0 : c.alive) && t.canAttackTarget(g) && $.Toolbox.dist(g.currentPosition.x, g.currentPosition.y + g.getZ(), e.x, e.y) < t.curStats.areaOfEffect + g.curStats.size) {
u--;
var v = g.currentPosition;
(v = $.Toolbox.moveTowards(e, g.currentPosition, .9 * g.curStats.size)).y += g.getZ();
d ? this.stackEffects.get("hitCritical").spawnAt(v, .1) : this.stackEffects.get("hit").spawnAt(v, .1);
this.applyAttack(t, g, e, i, d);
h = !0;
}
}
} catch (t) {
s = {
error: t
};
} finally {
try {
_ && !_.done && (l = y.return) && l.call(y);
} finally {
if (s) throw s.error;
}
}
}
} catch (t) {
a = {
error: t
};
} finally {
try {
f && !f.done && (r = p.return) && r.call(p);
} finally {
if (a) throw a.error;
}
}
return h;
};
e.prototype.applyAttack = function(t, e, i, o, a) {
var r, n;
void 0 === a && (a = !1);
var l = t.curStats.damage;
a && (l = s.default.intCast(t.curStats.damage * t.curStats.damageCritMod));
e.getHit(l, !0, T.AttackType.Other, t);
if (t.isActor()) {
t.a.addExperience(2);
var c = t.a.getWeaponAsset();
c.attackAction.isEmpty || c.attackAction.do(e, o);
}
if (e.isActor() && t.isActor()) {
e.a.stats.canTurnIntoZombie && t.a.haveTrait("zombie") && $.Toolbox.randomChance(.3) && e.a.addTrait("infected");
!(null === (r = e.base_data) || void 0 === r ? void 0 : r.alive) && t.a.stats.animal && t.a.stats.diet_meat && e.a.stats.source_meat && t.a.restoreStatsFromEating(70, 0, !0);
}
var u = (null === (n = e.base_data) || void 0 === n ? void 0 : n.health) <= 0 ? .3 * t.curStats.knockback : .2 * t.curStats.knockback;
(u -= u * (e.curStats.knockbackReduction / 100)) < 0 && (u = 0);
if (u > 0 && e.isActor()) {
var d = $.Toolbox.getAngle(e.node.x, e.node.y, i.x, i.y);
e.a.addForce((0 - Math.cos(d)) * u, (0 - Math.sin(d)) * u, u);
}
};
e.prototype.destroyCity = function(t) {
Xt.default.logCityDestroyed(t);
t.destroyCity();
t.node.destroy();
this.citiesList.remove(t);
this.cityPlaceFinder.setDirty();
};
e.prototype.createRoad1 = function(t, e, o, a) {
var r, s;
void 0 === a && (a = !1);
if (!(t.length > 20)) {
i.temp_list_tiles2.clear();
if (!(o.roadIsland && t.length > 20 && o.roadIsland == e.roadIsland)) {
try {
for (var l = n(t), c = l.next(); !c.done; c = l.next()) {
var u = c.value;
if (!u.type.road) {
if (e != u && e.roadIsland && u.roadIsland == o.roadIsland) return;
i.temp_list_tiles2.push(u);
a && this.createRoad2(u);
}
}
} catch (t) {
r = {
error: t
};
} finally {
try {
c && !c.done && (s = l.return) && s.call(l);
} finally {
if (r) throw r.error;
}
}
this.redrawTimer = -1;
}
}
};
e.prototype.clearWorld = function() {
var t, e, i, o, a, r, s, l, u, d, h, p, f, m, y, _, g, v, b, T, w;
c.default.d("MapBox", "clearWorld", "start");
ee.PowerButtonSelector.inst.unselectAll();
this.firstClick = !0;
null === (i = this.worldLog) || void 0 === i || i.clear();
null === (o = this.islandsCalculator) || void 0 === o || o.clear();
null === Gt.default || void 0 === Gt.default || Gt.default.clear();
null === (a = this.unitZones) || void 0 === a || a.clear();
null === (r = It.default.inst) || void 0 === r || r.clear();
null === (s = this.mapChunkManager) || void 0 === s || s.clearAll();
null === (l = this.qualityChanger) || void 0 === l || l.reset();
null === (u = this.tilemap) || void 0 === u || u.clear();
z.default.prepare();
null === (d = this.heat) || void 0 === d || d.clear();
this.tilesList.forEach(function(t) {
null == t || t.clear();
});
try {
for (var B = n(this.citiesList), k = B.next(); !k.done; k = B.next()) k.value.node.destroy();
} catch (e) {
t = {
error: e
};
} finally {
try {
k && !k.done && (e = B.return) && e.call(B);
} finally {
if (t) throw t.error;
}
}
this.behaviours.forEach(function(t) {
null == t || t.clear();
});
this.transformShadows.destroyAllChildren();
null === (h = E.default.unitStats) || void 0 === h || h.clear();
null === (p = E.default.raceLibrary) || void 0 === p || p.clear();
null === (f = this.dropManager) || void 0 === f || f.clear();
null === (m = this.citiesList) || void 0 === m || m.clear();
null === (y = this.kingdoms) || void 0 === y || y.clear();
null === (_ = this.waveController) || void 0 === _ || _.clear();
null === (g = this.cloudController) || void 0 === g || g.clear();
null === (v = this.particlesFire) || void 0 === v || v.clear();
null === (b = this.particlesSmoke) || void 0 === b || b.clear();
null === (T = this.stackEffects) || void 0 === T || T.clear();
this.clearSimObjects();
this.mapLayers.forEach(function(t) {
null == t || t.clear();
});
this.mapModules.forEach(function(t) {
null == t || t.clear();
});
this.tilesDirty.forEach(function(t) {
t.dirty = !1;
});
null === (w = this.tilesDirty) || void 0 === w || w.clear();
c.default.d("MapBox", "clearWorld", "en");
};
e.prototype.clearSimObjects = function() {
var t = this;
this.units.checkAddRemove();
this.buildings.checkAddRemove();
this.units.list.forEach(function(e) {
t.destroyActor(e);
});
this.buildings.list.forEach(function(e) {
t.removeBuildingFully(e);
});
this.units.clear();
this.buildings.clear();
};
e.prototype.updateTileTypes = function() {
this.tilesList.forEach(function(t) {
t.type = Wt.TileType.getTypeByDepth(t);
});
};
e.prototype.getTile = function(t, e) {
if (t % 1 > 0 || e % 1 > 0) throw new Error("use int input!");
return t < 0 || t >= i.width || e < 0 || e >= i.height ? null : this.tilesList[e * i.width + t];
};
e.prototype.getTileSimple = function(t, e) {
if (t % 1 > 0 || e % 1 > 0) throw new Error("use int input!");
return this.tilesList[e * i.width + t];
};
e.prototype.getActorNearCursor = function() {
return _.default.getActorNearPos(this.currentTouch);
};
e.prototype.getMouseTilePos = function() {
return this.getTile(this.currentTouch.x, this.currentTouch.y);
};
e.prototype.clicked = function(t, e, i, o) {
void 0 === i && (i = null);
void 0 === o && (o = null);
if ((i || (i = ee.PowerButtonSelector.inst.selectedButton.godPower)) && this.doPropCheck(i)) {
t.x = s.default.intCast(t.x);
t.y = s.default.intCast(t.y);
var a = this.getTile(t.x, t.y);
if (a) if ("relations" != i.id) {
this.firstPressedType || (this.firstPressedType = a.type);
var r = ot.default.currentBrush;
(null == i ? void 0 : i.forceBrush) && (r = i.forceBrush);
var n = o || W.default.getBrushByID(r);
i.removeConway && this.conwayLayer.checkKillRange(a.pos, n.size);
var l = Math.floor(cc.sys.now() / 1e3);
if ("czarBomba" == i.id) {
var c = cc.sys.os == cc.sys.OS_IOS ? 4 : 2;
if (l - this.lastClickTime < c) return;
this.lastClickTime = l;
} else if ("atomicBomb" == i.id) {
c = cc.sys.os == cc.sys.OS_IOS ? 3 : 1;
if (l - this.lastClickTime < c) return;
this.lastClickTime = l;
} else this.lastClickTime = 0;
ot.default.propUseCount = 1;
if (i.click_action) {
i.click_action(a, i.id);
this.doPropUse(i);
} else {
switch (i.id) {
case "heatray":
this.heatRayFx.play(t, 10);
if (this.heatRayFx.isReady()) {
this.drawWithBrush(t, W.default.getBrushBySize(10), e, "heatray", null, i);
this.checkKillRange(t, 10);
this.conwayLayer.checkKillRange(t, 10);
}
break;

case "divineLight":
this.drawWithBrush(t, n, 1, "divineLight", null, i);
this.fxDivineLight.playOn(a);
break;

case "magnet":
this.actions.magnetAction(!1, a);
break;

case "temperaturePlus":
ft.default.playTemperatureU();
this.drawWithBrush(t, n, 1, "temperaturePlus", null, i);
break;

case "temperatureMinus":
ft.default.playTemperatureD();
this.drawWithBrush(t, n, 1, "temperatureMinus", null, i);
break;

case "rainfallPlus":
case "rainfallMinus":
this.drawWithBrush(t, n, e, "rainfall", null, i);
break;

case "burger":
break;

case "showelPlus":
case "showelMinus":
this.drawWithBrush(t, n, e, i.id, null, i);
break;

case "bucket":
case "sickle":
case "axe":
case "demolish":
this.drawWithBrush(t, n, e, i.id, null, i);
break;

case "crabzilla":
this.alreadyUsedPower = !1;
this.stackEffects.startBigSpawn(a).setEvent("crabzilla", a);
break;

default:
switch (i.actionType) {
case $t.PowerActionType.Printer:
this.stackEffects.startSpawnEffect(a);
this.createNewUnitBySpawning("printer", a, "print").getComponent(B.default).setPrintTemplate(this.printLibrary.dict.get(i.printersPrint));
break;

case $t.PowerActionType.Draw:
this.drawWithBrush(t, n, e, i.id, null, i);
break;

case $t.PowerActionType.Special:
"cloudRain" != i.id && "cloudAcid" != i.id && "cloudLava" != i.id && "cloudSnow" != i.id || this.cloudController.spawnCloud(a.posV3, i.id);
break;

case $t.PowerActionType.SpawnActor:
ft.default.playSpawn();
i.spawnSound && ft.default.play(i.spawnSound);
if ("sheep" == i.id) {
a.type.lava && h.default.update(51);
h.default.update(6);
}
h.default.update(66);
i.showSpawnEffect && this.stackEffects.startSpawnEffect(a, i.showSpawnEffect);
var u = i.actorStatsId.includes(",") ? $.Toolbox.getRandom(i.actorStatsId.split(",")) : i.actorStatsId;
this.createNewUnitBySpawning(u, a, "", i.actorSpawnHeight);
break;

case $t.PowerActionType.Tile:
this.drawWithBrush(t, n, e, "tile", i.tileType, i);
break;

default:
this.drawWithBrush(t, n, e, "draw", null, i);
}
}
this.doPropUse(i);
}
} else if (a.zone.city) if (ot.default.selectedKingdom != a.zone.city.kingdom) {
ot.default.selectedKingdom = a.zone.city.kingdom;
this.zoneCalculator.allDirty();
} else et.default.open(et.view_type.KingdomWindow);
}
};
e.prototype.doPropUse = function(t) {
switch (t.id) {
case "humans":
mt.default.inst.isGuiding && this.guideHumansNum++;
mt.default.inst.in(mt.GUIDE_TYPE.novice, 5) && 1 == this.guideHumansNum && mt.default.inst.do(mt.GUIDE_TYPE.novice);
mt.default.inst.in(mt.GUIDE_TYPE.novice, 6) && this.guideHumansNum >= 1 && mt.default.inst.do(mt.GUIDE_TYPE.novice);
mt.default.inst.in(mt.GUIDE_TYPE.novice, 7) && this.guideHumansNum >= 10 && mt.default.inst.do(mt.GUIDE_TYPE.novice);
break;

case "seeds":
mt.default.inst.isGuiding && (this.guideSeedsNum += ot.default.propUseCount);
mt.default.inst.in(mt.GUIDE_TYPE.novice, 14) && this.guideSeedsNum >= 75 && mt.default.inst.do(mt.GUIDE_TYPE.novice);
}
if (ee.PowerButtonSelector.inst.selectedButton) {
var e = p.default.getPropByID(ot.default.selectedProp);
if (l.default.MODE != l.MODE_TYPE.LOCK && e.number > 0 && 0 == e.infiniteTime && !at.default.Prop_infinite) {
e.number -= ot.default.propUseCount;
e.useNum = ot.default.propUseCount;
e.number < 0 && (e.number = 0);
p.default.save();
}
this.checkAchievementByPower(t.id, e, ot.default.propUseCount);
if (BYTEDANCE_GAME && !ie.default.inst.toggleRec.isChecked && !mt.default.inst.isGuiding) {
ie.default.inst.toggleRec.isChecked = !0;
ie.default.inst.toggleRec.checkEvents[0].emit([ ie.default.inst.toggleRec ]);
}
}
};
e.prototype.doPropCheck = function() {
var t = p.default.getPropByID(ot.default.selectedProp);
if (p.default.getPropConfigByID(ot.default.selectedProp).rare != p.RARE_TYPE.NORMAL && !at.default.Prop_infinite) if (l.default.MODE == l.MODE_TYPE.LOCK) {
if (t.lock) {
l.default.IS_LOCAL || WECHAT_GAME || BYTEDANCE_GAME ? J.default.allowPopUi() && et.default.open(et.view_type.InfiniteProp) : y.default.pushToast("道具未解锁！");
return !1;
}
} else if (l.default.MODE == l.MODE_TYPE.COUNT) {
if (t.number <= 0) {
l.default.IS_LOCAL || WECHAT_GAME || BYTEDANCE_GAME ? J.default.allowPopUi() && et.default.open(et.view_type.InfiniteProp) : y.default.pushToast("道具数量不足！");
return !1;
}
} else if (t.lock || t.number <= 0) {
if (l.default.IS_LOCAL || WECHAT_GAME || BYTEDANCE_GAME) J.default.allowPopUi() && et.default.open(et.view_type.InfiniteProp); else {
var e = t.lock ? "道具未解锁！" : "道具数量不足！";
y.default.pushToast(e);
}
return !1;
}
return !0;
};
e.prototype.useDivineLight = function(t) {
var e, i, o;
try {
for (var a = n(t.units), r = a.next(); !r.done; r = a.next()) {
var s = r.value;
if ((null === (o = s.data) || void 0 === o ? void 0 : o.alive) && s.node.active && !($.Toolbox.distTile(t, s.currentTile) > 4)) {
s.removeTrait("infected");
s.removeTrait("plague");
s.removeTrait("mushSpores");
s.removeTrait("tumorInfection");
"undead" == s.race.id || "demon" == s.race.id ? s.getHit(20, !0, T.AttackType.Divine) : s.startColorEffect("white");
s.haveTrait("crippled") && s.removeTrait("crippled");
s.haveTrait("eyepatch") && s.removeTrait("eyepatch");
s.haveTrait("skin_burns") && s.removeTrait("skin_burns");
if (s.haveTrait("madness")) {
s.removeTrait("madness");
s.stats.unit ? s.setKingdom(this.kingdoms.dict_hidden.get("nomads_" + s.stats.race)) : s.stats.kingdom && s.setKingdom(this.kingdoms.dict_hidden.get(s.stats.kingdom));
}
s.isInWater() || s.cancelAllBeh();
}
}
} catch (t) {
e = {
error: t
};
} finally {
try {
r && !r.done && (i = a.return) && i.call(a);
} finally {
if (e) throw e.error;
}
}
};
e.prototype.loadBuilding = function(t) {
var e = this.getTileSimple(t.mainX, t.mainY), i = this.addBuilding(t.templateID, e, t, !0, !1, G.BuildPlacingType.Load);
if (!i) return null;
if (t.cityID) {
var o = this.getCityByID(t.cityID);
o && o.addBuilding(i);
}
return i;
};
e.prototype.addBuilding = function(t, e, i, o, a, r) {
void 0 === i && (i = null);
void 0 === o && (o = !1);
void 0 === a && (a = !1);
void 0 === r && (r = G.BuildPlacingType.New);
if (o && !this.canBuildFrom(e, E.default.buildings.get(t), null, r)) return null;
var n = cc.instantiate(X.default.inst.building).getComponent(H.default);
n.create();
n.node.parent = this.transformParents;
if (i) {
n.finishScaleTween();
n.spriteAnimation.currentFrameIndex = i.frameID;
n.spriteAnimation.forceUpdateFrame();
}
n.setBuilding(e, E.default.buildings.get(t), i);
n.resetShadow();
this.buildings.add(n);
a && "none" != n.stats.sfx && ft.default.play(n.stats.sfx);
ot.default.timeScale > 10 && n.finishScaleTween();
return n;
};
e.prototype.canBuildFrom = function(t, e, o, a) {
var r, s, l, c;
void 0 === a && (a = G.BuildPlacingType.New);
var u = null, d = t.x - e.fundament.left, h = t.y - e.fundament.bottom, p = e.fundament.right + e.fundament.left + 1, f = e.fundament.top + e.fundament.bottom + 1, m = !1, y = !1;
i.temp_list_tiles.clear();
var _ = null == o ? void 0 : o.getTile();
if (o && !_) return !1;
for (var g = 0; g < p; g++) for (var v = 0; v < f; v++) {
if (!(u = this.getTile(d + g, h + v))) return !1;
i.temp_list_tiles.push(u);
if (e.docks) {
u.type.water && it.default.goodForNewDock(u) && (y = !0);
u.type.ground && (m = !0);
}
if (o && o.getTile()) {
if (!e.docks && !u.isSameIsland(o.getTile())) return !1;
if (u.zone.city != o) return !1;
if (e.onlyBuildTiles && !u.type.canBuildOn) return !1;
}
if (e.canBePlacedOnlyOn.length > 0 && !e.canBePlacedOnlyOn.includes(u.type.name)) return !1;
if (e.fauna && !u.canGrow()) return !1;
if (u.type.liquid && !e.canBePlacedOnWater) return !1;
if (e.destroyOnWater && u.type.water) return !1;
if (e.resourceType == N.ResourceType.Tree && u.building && !u.building.isNonUsable()) return !1;
if (!u.canBuildOn(e)) return !1;
if (e.checkForCloseBuilding && 0 == a) {
if (0 == g) {
if (this.isBuildingNearby(u.tile_left)) return !1;
} else if (g == p - 1 && this.isBuildingNearby(u.tile_right)) return !1;
if (0 == v) {
if (this.isBuildingNearby(u.tile_down)) return !1;
if (u.tile_down && this.isBuildingNearby(u.tile_down.tile_down)) return !1;
} else if (v == f - 1) {
if (this.isBuildingNearby(u.tile_up)) return !1;
if (u.tile_up && this.isBuildingNearby(u.tile_up.tile_up)) return !1;
}
}
}
if (e.docks && a == G.BuildPlacingType.New) {
if (y && !m) try {
for (var b = n(i.temp_list_tiles), T = b.next(); !T.done; T = b.next()) {
var w = T.value;
try {
for (var B = (l = void 0, n(w.neighbours)), k = B.next(); !k.done; k = B.next()) {
var A = k.value;
if (A.type.ground && A.region.island == (null == _ ? void 0 : _.region.island)) return !0;
}
} catch (t) {
l = {
error: t
};
} finally {
try {
k && !k.done && (c = B.return) && c.call(B);
} finally {
if (l) throw l.error;
}
}
}
} catch (t) {
r = {
error: t
};
} finally {
try {
T && !T.done && (s = b.return) && s.call(b);
} finally {
if (r) throw r.error;
}
}
return !1;
}
return !0;
};
e.prototype.isBuildingNearby = function(t) {
return !t || !(!t.building || t.building.isNonUsable() || !t.building.stats.cityBuilding);
};
e.prototype.tryRemoveTornadoFromTile = function(t) {
for (var e, i, o, a = 0; a < t.units.length; ) {
var r = t.units[a++];
(null === (e = r.base_data) || void 0 === e ? void 0 : e.alive) && r.isActor() && "tornado" == (null === (o = null === (i = r.a) || void 0 === i ? void 0 : i.stats) || void 0 === o ? void 0 : o.id) && r.getComponent(C.default).killTornado();
}
};
e.prototype.checkSantaHit = function(t, e) {
this.units.list.forEach(function(i) {
var o;
if ((null === (o = i.data) || void 0 === o ? void 0 : o.alive) && !($.Toolbox.dist(t.x, 0, i.node.x, 0) > e) && !(i.node.y < t.y) && !(i.node.y - 100 > t.y)) if (i.stats.id.includes("santa")) {
i.data.health = 0;
h.default.update(49);
} else if (i.stats.id.includes("UFO")) {
i.getHit(1e4);
i.killHimself(!1, T.AttackType.None, !1);
h.default.update(47);
}
});
};
e.prototype.checkLightningAction = function(t, e) {
var i, o, a, r, s = !1;
try {
for (var l = n(this.units.list), c = l.next(); !c.done; c = l.next()) {
var u = c.value;
if ((null === (a = u.data) || void 0 === a ? void 0 : a.alive) && u.currentTile && $.Toolbox.distVec2(null === (r = u.currentTile) || void 0 === r ? void 0 : r.pos, t) <= e) if ("godFinger" == u.stats.id) u.getComponent(x.default).lightAction(); else if ("tornado" == u.stats.id) {
if (u.getComponent(C.default).split(!0)) break;
} else if (!u.haveTrait("immortal") && !s && $.Toolbox.randomChance(.2)) {
u.addTrait("immortal");
u.addTrait("energized");
s = !0;
}
}
} catch (t) {
i = {
error: t
};
} finally {
try {
c && !c.done && (o = l.return) && o.call(l);
} finally {
if (i) throw i.error;
}
}
};
e.prototype.checkKillRange = function(t, e, i, o) {
var a, r, s;
void 0 === i && (i = T.AttackType.Other);
void 0 === o && (o = null);
try {
for (var l = n(this.units.list), c = l.next(); !c.done; c = l.next()) {
var u = c.value;
if (u.stats.canBeKilledByDrawing || !o || o.actionType != $t.PowerActionType.Tile) {
switch (i) {
case T.AttackType.Fire:
if (u.haveTrait("fire_proof") || u.haveTrait("fire_blood")) continue;
break;

case T.AttackType.Acid:
if (u.haveTrait("acid_proof") || u.haveTrait("acid_blood")) continue;
}
$.Toolbox.distVec2(u.currentTile.pos, t) <= e && (u.stats.canBeKilledByStuff && (null === (s = u.data) || void 0 === s ? void 0 : s.alive) ? u.getHit(1e5) : "tornado" == u.stats.id && o && o.removeTornado && u.getComponent(C.default).killTornado());
}
}
} catch (t) {
a = {
error: t
};
} finally {
try {
c && !c.done && (r = l.return) && r.call(l);
} finally {
if (a) throw a.error;
}
}
};
e.prototype.drawExplosion = function(t, e, o, a, r, n, s) {
var l = this;
void 0 === r && (r = "");
void 0 === n && (n = null);
void 0 === s && (s = !0);
if (this.getTile(t.x, t.y)) {
var c = W.default.getBrushBySize(e);
if (c) {
var u = 0, d = 0;
c.pos.forEach(function(e) {
var o;
u = t.x + e.x;
d = t.y + e.y;
if (u >= 0 && u < i.width && d >= 0 && d < i.height) {
var a = l.getTileSimple(u, d);
null !== (o = null == n ? void 0 : n.flashPixel) && void 0 !== o && o && s && l.flashEffects.flashPixel(a, 10);
}
});
}
}
};
e.prototype.applyLightningEffect = function(t) {
if (t.type.lava && t.heat > 20) {
this.decreaseTile(t);
$.Toolbox.randomChance(.9) && this.dropManager.spawnBurstPixel(t, "lava", $.Toolbox.randomFloat(.2, 1.4), $.Toolbox.randomFloat(.5, 1.6));
}
if (t.type.layerType == Wt.TileLayerType.Water) {
this.removeWater(t);
$.Toolbox.randomChance(.8) && this.dropManager.spawnBurstPixel(t, "rain", $.Toolbox.randomFloat(.2, 1.4), $.Toolbox.randomFloat(.5, 1.6));
}
if (t.building && ("volcano" == t.building.stats.id || "geyser" == t.building.stats.id || "geyserAcid" == t.building.stats.id)) {
t.building.spawnBurstSpecial(10, 4, 1.9);
t.building.data.spawnPixelActive = !t.building.data.spawnPixelActive;
}
};
e.prototype.applyTileDamage = function(t, e, o) {
var a, r;
this.redrawTimer = -1;
var l = W.default.getBrushBySize(s.default.intCast(e));
this.conwayLayer.checkKillRange(t.pos, l.size);
o.removeTornado && this.tryRemoveTornadoFromTile(t);
this.waveController.checkTile(t, l.size);
this.cloudController.checkTile(t, l.size);
var c = function(a) {
var r = t.pos.x + a.x, n = t.pos.y + a.y;
if (r < 0 || r >= i.width || n < 0 || n >= i.height) return "continue";
var s = u.getTileSimple(r, n);
s.type.greyGoo && (ot.default.greyGooDamaged = !0);
o.addBurned && !s.type.liquid && s.setBurned();
o.lightningEffect && u.applyLightningEffect(s);
0 != o.addHeat && u.heat.addTile(s, o.addHeat);
if (s.building && o.damageBuildings) {
var l = !0;
o.ignoreKingdoms && o.ignoreKingdoms.forEach(function(t) {
var e, i, o, a, r, n, c;
(null === (i = null === (e = s.building) || void 0 === e ? void 0 : e.data) || void 0 === i ? void 0 : i.alive) && !(null === (a = null === (o = s.building) || void 0 === o ? void 0 : o.kingdom) || void 0 === a ? void 0 : a.isNature()) && (null === (c = null === (n = null === (r = s.building) || void 0 === r ? void 0 : r.kingdom) || void 0 === n ? void 0 : n.data) || void 0 === c ? void 0 : c.id) == t && (l = !1);
});
l && s.building.getHit(o.damage);
}
o.setFire && s.setFire(!0);
o.explode_tile && u.explodeTile(s, a.dist, e, t, o);
if (s.units.length <= 0 || !o.addTrait) return "continue";
s.units.forEach(function(t) {
var e;
(null === (e = t.data) || void 0 === e ? void 0 : e.alive) && t.addTrait(o.addTrait);
});
}, u = this;
try {
for (var d = n(l.pos), h = d.next(); !h.done; h = d.next()) c(h.value);
} catch (t) {
a = {
error: t
};
} finally {
try {
h && !h.done && (r = d.return) && r.call(d);
} finally {
if (a) throw a.error;
}
}
};
e.prototype.drawWithBrush = function(t, e, o, a, r, s, l) {
var c, u, d, p, f, m, y, g, v, b, T, w, B, k, A, S, x, C, O, P, R, M, L, F, D;
void 0 === r && (r = "");
void 0 === s && (s = null);
void 0 === l && (l = !0);
this.redrawTimer = -1;
var I = this.getTile(t.x, t.y);
this.waveController.checkTile(I, e.size);
this.cloudController.checkTile(I, e.size);
var j = null;
r && (j = Wt.TileType.get(r));
var G = 0, U = 0;
if ("explosion" != a) {
this.pixelLimit = 0;
var z = null;
try {
for (var W = n(e.pos), H = W.next(); !H.done; H = W.next()) {
var K = H.value;
G = t.x + K.x;
U = t.y + K.y;
if (!(G < 0 || G >= i.width || U < 0 || U >= i.height)) {
z = this.getTileSimple(G, U);
null !== (d = null == s ? void 0 : s.flashPixel) && void 0 !== d && d && l && this.flashEffects.flashPixel(z, 25);
s && !(null == s ? void 0 : s.fallingPixel) && (s.removeBuilding ? z.building && (s.destroyBuilding ? z.building.startDestroyBuilding(!0) : z.building.startRemove()) : s.destroyBuilding && z.building && z.building.startDestroyBuilding());
if (s) {
s.removeTornado && this.tryRemoveTornadoFromTile(z);
s.removeLife && this.removeLifeFromTile(z);
}
switch (a) {
case "divineLight":
this.useDivineLight(z);
continue;

case "boulder":
z.units.forEach(function(t) {
t.getHit(1e3);
});
ft.default.playBowlingBall(z.posV3);
z.type.water && $.Toolbox.randomChance(.3) && this.dropManager.spawnBurstPixel(z, "rain", $.Toolbox.randomFloat(.3, .8), $.Toolbox.randomFloat(.6, 1.2));
z.type.lava && $.Toolbox.randomChance(.3) && this.dropManager.spawnBurstPixel(z, "lava", $.Toolbox.randomFloat(.3, .8), $.Toolbox.randomFloat(.6, 1.2));
z.type.isType("sand");
z.type.isType("soil") || z.type.isType("forest");
z.type.decreaseTo && this.terraformTile2(z, z.type.decreaseTo, E.default.terraform.get("destroy"));
continue;

case "worm":
this.wormTile(z, 4);
continue;

case "bucket":
this.removeWater(z);
z.type.lava && this.decreaseTile(z);
continue;

case "axe":
if (z.building) {
(null === (p = z.building.stats) || void 0 === p ? void 0 : p.resourceType) == N.ResourceType.Tree && z.building.haveResources && z.building.chopTree();
"tree_dead" == z.building.stats.id && z.building.chopTree();
}
z.chunk.k_dict_objects.forEach(function(t, e) {
"living_plants" == e.data.name && z.chunk.k_dict_objects.get(e).forEach(function(t) {
var e;
(null === (e = t.base_data) || void 0 === e ? void 0 : e.alive) && t.objectType == Ft.MapObjectType.Actor && t.a.killHimself();
});
});
continue;

case "sickle":
(null === (f = z.type) || void 0 === f ? void 0 : f.grass) && this.removeGreens(z);
(null === (y = null === (m = z.building) || void 0 === m ? void 0 : m.stats) || void 0 === y ? void 0 : y.resourceType) != N.ResourceType.Fruits && (null === (v = null === (g = z.building) || void 0 === g ? void 0 : g.stats) || void 0 === v ? void 0 : v.resourceType) != N.ResourceType.Wheat || z.building.startRemove();
continue;

case "burningFeetEffect":
(null === (b = z.type) || void 0 === b ? void 0 : b.frozen) && $.Toolbox.randomBool() && this.unfreezeTile(z);
continue;

case "temperaturePlus":
if ((null === (T = z.type) || void 0 === T ? void 0 : T.frozen) && $.Toolbox.randomBool()) if (z.health > 0) {
z.health -= o;
z.grassTicksBeforeGrowth = 5;
} else this.unfreezeTile(z);
(null === (w = z.type) || void 0 === w ? void 0 : w.lava) && this.lavaLayer.increaseLava(z);
(null === (k = null === (B = z.building) || void 0 === B ? void 0 : B.stats) || void 0 === k ? void 0 : k.spawnPixel) && (z.building.data.spawnPixelActive = !0);
continue;

case "temperatureMinus":
z.type.lava && this.lavaLayer.decreaseLava(z);
z.data.fire && z.stopFire();
if (!z.type.frozen && $.Toolbox.randomBool()) if (z.health > 0) {
z.health -= o;
z.grassTicksBeforeGrowth = 5;
} else {
this.freezeTile(z);
h.default.update(18);
}
z.units.length > 0 && z.units.forEach(function(t) {
$.Toolbox.randomChance(.1) && _.default.addFrozenEffectOnTarget(t);
});
z.building && _.default.addFrozenEffectOnTarget(z.building);
continue;

case "showelMinus":
case "showelPlus":
z.health > 0 ? z.health-- : o > 0 ? z.type.increaseTo && this.terraformTile2(z, z.type.increaseTo, E.default.terraform.get("destroy")) : z.type.decreaseTo && this.terraformTile2(z, z.type.decreaseTo, E.default.terraform.get("destroy"));
continue;

case "finger":
this.terraformTile2(z, this.firstPressedType, E.default.terraform.get("destroy_no_flash"));
z.type.lava && this.lavaLayer.loadLavaTile(z);
z.type.isType("grey_goo") && this.greyGooLayer.add(z);
continue;

case "tile":
this.terraformTile2(z, j, E.default.terraform.get("destroy_no_flash"));
continue;

case "heatray":
ft.default.playHeatray();
$.Toolbox.randomBool() && this.heat.addTile(z, $.Toolbox.randomInt(1, 3));
continue;

case "conway":
case "conwayInverse":
ft.default.playConway();
Math.random() > .5 && this.conwayLayer.add(z, a);
continue;

case "greyGoo":
ft.default.playGoo1();
this.greyGooLayer.add(z);
continue;

case "napalm":
z.setFire(!0);
continue;

case "demolish":
(null === (S = null === (A = z.building) || void 0 === A ? void 0 : A.stats) || void 0 === S ? void 0 : S.ignoreDemolish) || (null === (C = null === (x = z.building) || void 0 === x ? void 0 : x.stats) || void 0 === C ? void 0 : C.resourceType) != N.ResourceType.None || z.building.startDestroyBuilding(!0);
z.zone.city && z.zone.city.removeZone(z.zone);
z.type.road && this.terraformTile2(z, z.type.decreaseTo, E.default.terraform.get("flash"));
z.chunk.k_dict_objects.forEach(function(t, e) {
"living_houses" == e.data.name && z.chunk.k_dict_objects.get(e).forEach(function(t) {
var e, i = t;
(null === (e = i.data) || void 0 === e ? void 0 : e.alive) && i.killHimself();
});
});
continue;

case "pickaxe":
(null === (P = null === (O = z.building) || void 0 === O ? void 0 : O.stats) || void 0 === P ? void 0 : P.resourceType) != N.ResourceType.Ore && (null === (M = null === (R = z.building) || void 0 === R ? void 0 : R.stats) || void 0 === M ? void 0 : M.resourceType) != N.ResourceType.Stone && (null === (F = null === (L = z.building) || void 0 === L ? void 0 : L.stats) || void 0 === F ? void 0 : F.resourceType) != N.ResourceType.Gold || z.building.startDestroyBuilding(!0);
continue;

case "sponge":
(null === (D = z.building) || void 0 === D ? void 0 : D.isNonUsable()) && z.building.startDestroyBuilding(!0);
z.removeBurn();
continue;
}
if (s && s.fallingPixel) {
var V = !1;
if (0 == e.size) {
if (this.timerSpawnPixels <= 0) {
this.timerSpawnPixels = .5;
V = !0;
}
} else if (2 == e.size && $.Toolbox.randomBool()) {
if (this.timerSpawnPixels > 0) {
this.timerSpawnPixels = .3;
V = !0;
}
} else V = $.Toolbox.randomChance(s.fallingChance);
V && cc.sys.os == cc.sys.OS_IOS && (V = $.Toolbox.randomBool());
if (this.firstClick) {
this.firstClick = !1;
ot.default.propUseCount = 0;
V = !0;
}
if (V) {
ot.default.propUseCount++;
this.dropManager.spawn(z, s.dropID).soundOn = !0;
}
}
}
}
} catch (t) {
c = {
error: t
};
} finally {
try {
H && !H.done && (u = W.return) && u.call(W);
} finally {
if (c) throw c.error;
}
}
} else this.drawExplosion(t, e.size, o, a, r, s, l);
};
e.prototype.createRoad2 = function(t) {
var e = "road_" + t._type.name;
t._type.name.startsWith("road") && (e = t._type.name);
var i = Wt.TileType.get(e);
if (!i) {
c.default.d("missing " + e);
i = Wt.TileType.get("road");
}
this.terraformTile2(t, i, E.default.terraform.get("road"));
};
e.prototype.freezeTile = function(t) {
var e, i;
t.type.freezeTo && this.terraformTile2(t, t.type.freezeTo, E.default.terraform.get("flash"));
(null === (i = null === (e = t.building) || void 0 === e ? void 0 : e.stats) || void 0 === i ? void 0 : i.spawnPixel) && (t.building.data.spawnPixelActive = !1);
};
e.prototype.unfreezeTile = function(t) {
t.type.increaseTo && this.terraformTile2(t, t.type.increaseTo, E.default.terraform.get("flash"));
t.building && t.building.stats.spawnPixel && (t.building.data.spawnPixelActive = !0);
};
e.prototype.setWater = function(t) {
t.type.fillToWater && this.terraformTile2(t, Wt.TileType.get(t.type.fillToWater), E.default.terraform.get("water_fill"));
};
e.prototype.decreaseTile = function(t) {
t.type.decreaseTo && this.terraformTile2(t, t.type.decreaseTo, E.default.terraform.get("flash"));
};
e.prototype.increaseTile = function(t) {
t.type.increaseTo && this.terraformTile2(t, t.type.increaseTo, E.default.terraform.get("flash"));
};
e.prototype.removeWater = function(t) {
if (t.type.liquid) {
this.setTileDirty(t);
this.terraformTile2(t, t.type.decreaseTo, E.default.terraform.get("flash"));
}
};
e.prototype.growGreens = function(t) {
this.terraformTile2(t, Wt.TileType.get(t.type.growTo), E.default.terraform.get("flash"));
};
e.prototype.removeGreens = function(t) {
this.terraformTile2(t, t.type.decreaseTo, E.default.terraform.get("flash"));
};
e.prototype.checkCityZone = function(t) {
var e, i;
if (t.zone.city) {
var o = !1;
try {
for (var a = n(t.zone.buildings), r = a.next(); !r.done; r = a.next()) if (r.value.city == t.zone.city) {
o = !0;
break;
}
} catch (t) {
e = {
error: t
};
} finally {
try {
r && !r.done && (i = a.return) && i.call(a);
} finally {
if (e) throw e.error;
}
}
o || t.zone.city.removeZone(t.zone);
}
};
e.prototype.removeLifeFromTile = function(t) {
this.conwayLayer.remove(t);
t.type.life && this.terraformTile2(t, t.type.decreaseTo, E.default.terraform.get("destroy_life"));
t.units.forEach(function(t) {
var e;
(null === (e = t.base_data) || void 0 === e ? void 0 : e.alive) && t.isActor() && !t.a.stats.kingdom.includes("nature") && t.killHimself();
});
};
e.prototype.spawnFlash = function(t, e) {
var i = this.stackEffects.get("explosionWave").spawnNew();
i && i.startFlash(t, e);
};
e.spawnLightning = function(t, e) {
var o;
void 0 === e && (e = .25);
var a = null === (o = i.inst.stackEffects.get("lightning")) || void 0 === o ? void 0 : o.spawnAt(t, e);
if (a) {
var r = 25 * e;
i.inst.damageWorld(t, r, E.default.terraform.get("lightning"));
ft.default.playLightning();
var n = $.Toolbox.randomBool() ? 1 : -1;
a.sprRenderer.node.scaleX *= n;
i.inst.checkLightningAction(t.pos, r);
i.inst.checkSantaHit(t.pos, r);
}
};
e.prototype.spawnMeteorite = function(t) {
var e = cc.instantiate(tt.default.inst.meteorite).getComponent(ut.default);
e.spawnOn(t);
e.node.parent = this.stackEffects.node;
};
e.prototype.terraformTile2 = function(t, e, i) {
var o, a, r, s, l, c, u, d, h = this;
i.removeWater && t.type.water && (e = t.type.decreaseTo);
i.removeGrass && t.type.grass && (e = t.type.decreaseTo);
i.removeRoads && t.type.road && (e = t.type.decreaseTo);
i.removeFrozen && t.type.frozen && (e = t.type.decreaseTo);
if (t.type.layerType != e.layerType || t.type.rocks != e.rocks) {
this.mapChunkManager.setDirty(t.chunk);
t.chunk.neighboursAll.forEach(function(t) {
h.mapChunkManager.setDirty(t, !1);
});
}
t.type = e;
i.removeTornado && this.tryRemoveTornadoFromTile(t);
(t.burned_stages > 0 && !t.type.canBeBurned || i.removeBurned) && t.removeBurn();
0 != t.type.layerType && this.checkCityZone(t);
this.makeTileChanged(t);
(i.destroyBuildings && 0 == i.destroyOnly.length && i.removeBorders || i.removeBorders) && this.checkCityZone(t);
i.flash && this.flashEffects.flashPixel(t, 20);
if (t.building && (null === (u = t.building.stats.canBePlacedOnlyOn) || void 0 === u ? void 0 : u.length) > 0) {
var p = !1;
t.building.stats.canBePlacedOnlyOn.forEach(function(e) {
t.type.isType(e) && (p = !0);
});
if (!p) {
t.type.liquid || t.type.canBeFilled ? t.building.startDestroyBuilding(!0) : t.building.startDestroyBuilding(i.removeBuilding);
return;
}
}
if (i.destroyBuildings && t.building) {
var f = !1;
if (i.ignoreKingdoms.length > 0) {
f = !0;
try {
for (var m = n(i.ignoreKingdoms), y = m.next(); !y.done; y = m.next()) if (y.value == (null === (d = t.building.kingdom) || void 0 === d ? void 0 : d.data.name)) {
f = !1;
break;
}
} catch (t) {
o = {
error: t
};
} finally {
try {
y && !y.done && (a = m.return) && a.call(m);
} finally {
if (o) throw o.error;
}
}
} else if (i.destroyOnly.length > 0) {
f = !1;
try {
for (var _ = n(i.destroyOnly), g = _.next(); !g.done; g = _.next()) if (g.value == t.building.stats.race) {
f = !0;
break;
}
} catch (t) {
r = {
error: t
};
} finally {
try {
g && !g.done && (s = _.return) && s.call(_);
} finally {
if (r) throw r.error;
}
}
} else if (i.ignoreBuildings.length > 0) try {
for (var v = n(i.ignoreBuildings), b = v.next(); !b.done; b = v.next()) {
var T = b.value;
if (t.building.stats.id != T) {
f = !0;
break;
}
}
} catch (t) {
l = {
error: t
};
} finally {
try {
b && !b.done && (c = v.return) && c.call(v);
} finally {
if (l) throw l.error;
}
} else f = !0;
f && t.building.startDestroyBuilding(i.removeBuilding);
} else t.building && !t.building.stats.canBePlacedOnWater && t.type.liquid && t.building.startDestroyBuilding(!0);
};
e.prototype.wormTile = function(t, e) {
this.flashEffects.flashPixel(t, 20);
t.health -= e;
if (!(t.health > 0)) {
t.health = 0;
if (t.type.increaseTo) {
var i = t.type.increaseTo.name.startsWith("mountain"), o = t.type.increaseTo.name.startsWith("hill");
t.type.name.startsWith("road") || (i || o || t.type.decreaseTo && !$.Toolbox.randomBool() ? t.type.decreaseTo && this.terraformTile2(t, t.type.decreaseTo, E.default.terraform.get("destroy")) : this.terraformTile2(t, t.type.increaseTo, E.default.terraform.get("destroy")));
}
}
};
e.prototype.changeTileHeight = function(t, e, i) {
void 0 === i && (i = "all");
e > 0 ? t.type.increaseTo && (t.type = t.type.increaseTo) : t.type.decreaseTo && (t.type = t.type.decreaseTo);
};
e.prototype.makeTileChanged = function() {
this.redrawTimer = -1;
};
e.prototype.spawnAndLoadUnit = function(t, e, i) {
var o = e.status.health;
if (cc.sys.os == cc.sys.OS_IOS && this.units.count > 200) return null;
var a = this.createNewUnit(t, i, null, 0, e);
if (!a) return null;
!e.status || e.status instanceof T.default || (e.status = u.default.fromJson(e.status, new T.default()));
a.setData(e.status);
if (e.inventory) {
e.inventory instanceof v.default || (e.inventory = u.default.fromJson(e.inventory, new v.default()));
a.inventory = e.inventory;
}
a.stats.use_items && a.equipment.load(e.items);
a.stats.unit && a.reloadInventory();
a.loadFromSave();
a.cancelAllBeh();
a.updateStats();
a.data.health = o;
var r = this.getCityByID(e.cityID);
if (r) if (a.stats.isBoat) {
a.setKingdom(r.kingdom);
a.getComponent(k.default).updateTexture();
a.setCity(r);
} else r.addNewUnit(a);
if ("livingPlants" == a.stats.id || "livingHouse" == a.stats.id) {
var n = e.special.split("#"), s = n[0], l = 0;
n.length > 1 && (l = n[1].IndexOf("@") <= -1 ? parseInt(n[1]) : 0);
I.default.buildings.dict.has(s) ? a.spriteRenderer.spriteFrame = I.default.buildings.dict.get(s).idle.frames[l] : c.default.d("Living texture load error " + e.special);
}
return a;
};
e.prototype.reachCreatureMaxLimit = function() {
return cc.sys.os == cc.sys.OS_IOS && this.units.length >= ot.PerformanceConfig.maxCreatures;
};
e.prototype.createNewUnitBySpawning = function(t, e, i, o) {
var a;
void 0 === i && (i = "");
void 0 === o && (o = 6);
var r = this.createNewUnit(t, e, i, o);
if (null === (a = null == r ? void 0 : r.stats) || void 0 === a ? void 0 : a.unit) {
r.data.age = 18;
r.setKingdom(this.kingdoms.dict_hidden.get("nomads_" + r.stats.race));
}
return r;
};
e.prototype.createNewUnit = function(t, e, i, o, a) {
void 0 === i && (i = "");
void 0 === o && (o = 0);
void 0 === a && (a = null);
var r = E.default.unitStats.get(t);
if (!r) return null;
var n = "p_unit" == r.prefab ? X.default.inst.unit : tt.default.inst.getActorPrefab(r.prefab);
if (!n) return null;
var s = cc.instantiate(n);
s.name = r.id;
s.position = e.posV3;
var l = s.getComponent(g.default);
l.new_creature = !0;
a && (l.new_creature = !1);
l.loadStats(r);
if (a) {
l.data = a.status;
l.professionAsset = E.default.professions.getAsset(a.status.profession);
}
l.new_creature && l.newCreature(this.gameStats.gameTime + this.units.length);
l.spawnOn(e, o);
l.create();
l.stats.kingdom && l.setKingdom(this.kingdoms.dict_hidden.get(l.stats.kingdom));
l.node.parent = l.stats.hideOnMinimap ? this.transformParents : this.transformCreatures;
this.units.add(l);
return l;
};
e.prototype.destroyActor = function(t) {
var e, i;
t.kingdom && t.kingdom.removeUnit(t);
t.city && t.city.removeCitizen(t);
this.units.remove(t);
t.data.alive = !1;
t.base_data.alive = !1;
t.shadow && t.shadow.node.destroy();
this._list_to_clean_effects.clear();
try {
for (var o = n(t.node.children), a = o.next(); !a.done; a = o.next()) {
var r = a.value;
r.getComponent(U.default) && this._list_to_clean_effects.push(r.getComponent(U.default));
}
} catch (t) {
e = {
error: t
};
} finally {
try {
a && !a.done && (i = o.return) && i.call(o);
} finally {
if (e) throw e.error;
}
}
this._list_to_clean_effects.forEach(function(t) {
t.makeParentController();
t.kill();
});
t.object_destroyed = !0;
t.node.destroy();
};
e.prototype.removeBuildingFully = function(t) {
t.data.alive = !1;
this.buildings.remove(t);
t.shadow && t.shadow.node.destroy();
t.object_destroyed = !0;
t.node.destroy();
"trees" == t.stats.type && this.gameStats.treesDeath++;
};
e.prototype.damageWorld = function(t, e, i, o) {
void 0 === o && (o = T.AttackType.Other);
i.shake && this.startShake(i.shake_duration, i.shake_interval, i.shake_intensity);
i.applyForce && this.applyForce(t, e, i.force_power, !0, !1, i.damage, i.ignoreKingdoms, null, o);
this.applyTileDamage(t, e, i);
};
e.prototype.applyForce = function(t, e, i, o, a, r, s, l, c) {
var u, d, h, p, f;
void 0 === e && (e = 10);
void 0 === i && (i = 1.5);
void 0 === o && (o = !0);
void 0 === a && (a = !1);
void 0 === r && (r = 0);
void 0 === s && (s = []);
void 0 === l && (l = null);
void 0 === c && (c = T.AttackType.Other);
var m = [];
$.Toolbox.fillListWithUnitsFromChunk(t.chunk, m);
t.chunk.neighboursAll.forEach(function(t) {
$.Toolbox.fillListWithUnitsFromChunk(t, m);
});
var y = 0, _ = 0;
try {
for (var g = n(m), v = g.next(); !v.done; v = g.next()) {
var b = v.value;
if (b) {
y = $.Toolbox.distVec2(b.currentTile.pos, t.pos);
if ((a || "nature" != b.race.id) && y <= e) {
if (s) {
var w = !1;
try {
for (var B = (h = void 0, n(s)), k = B.next(); !k.done; k = B.next()) {
var A = k.value;
if ((null === (f = b.kingdom) || void 0 === f ? void 0 : f.data.id) == A) {
w = !0;
break;
}
}
} catch (t) {
h = {
error: t
};
} finally {
try {
k && !k.done && (p = B.return) && p.call(B);
} finally {
if (h) throw h.error;
}
}
if (w) continue;
}
b.stats.canBeHurtByPowers && b.getHit(r, !0, c, l);
(_ = i - i * (b.curStats.knockbackReduction / 100)) < 0 && (_ = 0);
if (_ > 0) {
var S = $.Toolbox.getAngle(b.currentTile.x, b.currentTile.y, t.x, t.y);
o ? b.addForce((0 - Math.cos(S)) * _ * 1, (0 - Math.sin(S)) * _ * 1, 1) : b.addForce(Math.cos(S) * _ * 1, Math.sin(S) * _ * 1, 1);
}
}
}
}
} catch (t) {
u = {
error: t
};
} finally {
try {
v && !v.done && (d = g.return) && d.call(g);
} finally {
if (u) throw u.error;
}
}
};
e.prototype.explodeTile = function(t, e, i, o, a) {
var r, n = 1 - (r = e / i), l = s.default.intCast(30 * n);
if (!(l <= 0)) {
var c = t.type.liquid;
if (a.spawnPixels && this.pixelLimit < 30 && Math.random() > .8) {
this.pixelLimit++;
this.dropManager.spawnPixel(t, o, !0);
}
if (t.type.explodable || !(Math.random() > n)) {
this.gameStats.pixelsExploded++;
a.explosion_pixel_effect && this.explosionLayer.setDirty(t, e, i);
l -= s.default.intCast(.5 * l * Math.random() * r);
t.type.explodable && 0 == t.explosionWave && this.explosionLayer.explodeBomb(t);
t.type.explodableDelayed && this.explosionLayer.activateDelayedBomb(t);
t.type.strength <= a.explode_strength && t.type.decreaseTo && this.terraformTile2(t, t.type.decreaseTo, E.default.terraform.get("destroy"));
t.building && t.type.liquid && !t.building.stats.canBePlacedOnWater && t.building.startDestroyBuilding(!0);
if (!c) {
t.setBurned();
a.explode_and_set_random_fire && (Math.random() > .8 ? t.setFire(!0) : t.setFire());
}
}
}
};
e.prototype.stopAttacksFor = function(t) {
this.units.list.forEach(function(e) {
var i, o, a, r, n;
e.attackTarget && ((null === (o = null === (i = e.kingdom) || void 0 === i ? void 0 : i.asset) || void 0 === o ? void 0 : o.mobs) || (null === (n = null === (r = null === (a = e.attackTarget) || void 0 === a ? void 0 : a.kingdom) || void 0 === r ? void 0 : r.asset) || void 0 === n ? void 0 : n.mobs)) == t && e.cancelAllBeh();
});
};
e.prototype.allDirty = function() {
var t = this;
this.tilesList.forEach(function(e) {
e.dirty = !0;
t.tilesDirty.add(e);
});
};
e.prototype.onApplicationFocus = function(t) {
this.hasFocus = t;
};
e.prototype.updateShake = function(t) {
if (0 != this.shakeTimer) {
this.shakeTimer > 0 && (this.shakeTimer -= t);
if (this.shakeTimer <= 0) {
this.shakeTimer = 0;
this.node.position = this.mapPos.clone();
} else if (this.shakeIntervalTimer > 0) this.shakeIntervalTimer -= t; else {
this.shakeIntervalTimer = this.shakeInterval;
this.shakeX && (this.node.x = this.mapPos.x + $.Toolbox.randomRange(0 - this.shakeIntencity, this.shakeIntencity));
this.shakeY && (this.node.y = this.mapPos.y + $.Toolbox.randomRange(0 - this.shakeIntencity, this.shakeIntencity));
}
}
};
e.prototype.startShake = function(t, e, i, o, a) {
void 0 === t && (t = .3);
void 0 === e && (e = .01);
void 0 === i && (i = 2);
void 0 === o && (o = !0);
void 0 === a && (a = !0);
this.shakeTimer = t;
this.shakeInterval = e;
this.shakeIntencity = i;
this.shakeX = o;
this.shakeY = a;
};
e.prototype.updateMapLayers = function(t) {
if (!Q.default.isLoading()) {
this.heat.logicUpdate(t);
this.mapChunkManager.logicUpdate(t);
this.mapLayers.forEach(function(e) {
e.logicUpdate(t);
});
this.mapModules.forEach(function(e) {
e.logicUpdate(t);
});
}
};
e.prototype.switchAutoTester = function() {
if (!this.auto_tester) {
var t = new cc.Node();
this.auto_tester = t.addComponent(w.default);
this.auto_tester.create();
}
this.auto_tester.active = !this.auto_tester.active;
};
e.prototype.getCurElapsed = function() {
return cc.director.getDeltaTime() * ot.default.timeScale;
};
e.prototype.update = function(t) {
var e = this;
if (ot.default.gameLoaded) if (Q.default.isLoading()) Q.default.logicUpdate(t); else {
this.frameIndex++;
this.timerSpawnPixels > 0 && (this.timerSpawnPixels -= t);
this.elapsed = this.getCurElapsed();
E.default.raceLibrary.logicUpdate(this.elapsed);
this.islandsCalculator.logicUpdate(this.elapsed);
this.unitZones.logicUpdate(this.elapsed);
this.cityPlaceFinder.logicUpdate(this.elapsed);
Dt.default.inst.drawMarks();
this.kingdoms.logicUpdate(this.elapsed);
if (!f.default.isPaused) {
this.gameStats.gameTime += this.elapsed;
this.unitGroupManager.logicUpdate(this.elapsed);
this.updateUnitsHunger(this.elapsed);
this.mapStats.updateAge(this.elapsed);
A.default.logicUpdate(this.elapsed);
}
for (var o = 0; o < ot.default.actorFastMode; o++) {
this.updateMapLayers(this.elapsed);
this.updateCities(this.elapsed);
this.updateActors(this.elapsed);
this.updateBuildings(this.elapsed);
this.updateShake(this.elapsed);
this.dropManager.logicUpdate(this.elapsed);
this.behaviours.forEach(function(t) {
t.logicUpdate(e.elapsed);
});
}
this.qualityChanger.logicUpdate(t);
this.stackEffects.logicUpdate(this.elapsed);
this.cloudController.logicUpdate(this.elapsed);
this.waveController.logicUpdate(this.elapsed);
60 == cc.game.getFrameRate() ? this.frameIndex % 1 == 0 && this.updateControls() : this.updateControls();
this.frameIndex %= cc.game.getFrameRate();
this.sortZIndexTimer -= t;
if (this.sortZIndexTimer <= 0) {
this.sortZIndex();
this.sortZIndexTimer = ot.PerformanceConfig.intervalOfSortActors;
}
if (this.autoSaveTimer == Number.NEGATIVE_INFINITY) {
if (J.default.allowPopUi()) {
ot.default.currentSlot = ot.default.quickSaveSlotId;
i.inst.saveManager.saveSlot();
}
this.autoSaveTimer = ot.PerformanceConfig.intervalOfAutoSave;
}
this.autoSaveTimer -= t;
if (this.autoSaveTimer <= 0) {
y.default.pushToast("地图自动存档中...");
this.autoSaveTimer = Number.NEGATIVE_INFINITY;
}
if (this.redrawTimer > 0) this.redrawTimer -= this.elapsed; else {
this.redrawTimer = 1;
this.tilesDirty.size > 0 && this.redrawMap();
}
}
};
e.prototype.sortZIndex = function() {
this.transformParents.children.sort(function(t, e) {
return e.y - t.y;
});
};
e.prototype.updateUnitsHunger = function(t) {
var e;
if (null === (e = this.worldLaws) || void 0 === e ? void 0 : e.world_law_hunger.boolVal) if (this.timer_hunger > 0) this.timer_hunger -= t; else {
this.timer_hunger = 8;
this.units.list.forEach(function(t) {
var e;
t.created && (null === (e = t.stats) || void 0 === e ? void 0 : e.needFood) && t.updateHunger();
});
}
};
e.prototype.updateObjectAge = function() {
var t;
this.units.list.forEach(function(t) {
t.created && t.updateAge();
});
this.citiesList.forEach(function(t) {
t.created && t.updateAge();
});
null === (t = this.kingdoms) || void 0 === t || t.updateAge();
};
e.prototype.updateCities = function(t) {
this.citiesList.forEach(function(e) {
e.created && e.logicUpdate(t);
});
It.default.inst.checkUpdate();
};
e.prototype.updateBuildings = function(t) {
var e = 0;
this.buildings.checkAddRemove();
this.buildings.list.forEach(function(i) {
if (i.created) {
i.logicUpdate(t);
"house" == i.stats.type && e++;
}
});
this.buildings.checkAddRemove();
h.default.update(74, e, !0);
};
e.prototype.updateActors = function(t) {
var e = 0;
this.units.checkAddRemove();
this.units.list.forEach(function(i) {
if (i.created) {
i.updateTimers(t);
i.logicUpdate(t);
i.stats.animal && e++;
}
});
this.units.checkAddRemove();
h.default.update(70, e, !0);
};
e.prototype.onTouchStart = function(t) {
var e, i;
if ((null === (i = null === (e = ee.PowerButtonSelector.inst.selectedButton) || void 0 === e ? void 0 : e.godPower) || void 0 === i ? void 0 : i.holdAction) && 1 === t.getTouches().length) {
this.holdPosition = t.getLocation();
this.isKeyDownCode = 0;
}
};
e.prototype.onTouchMove = function(t) {
var e, i;
if ((null === (i = null === (e = ee.PowerButtonSelector.inst.selectedButton) || void 0 === e ? void 0 : e.godPower) || void 0 === i ? void 0 : i.holdAction) && 1 === t.getTouches().length) {
this.holdPosition = t.getLocation();
this.isKeyDownCode = 1;
}
};
e.prototype.onTouchEnd = function(t) {
this.holdPosition = cc.v2(-1, -1);
this.isKeyDownCode = -1;
if (!(Y.MoveCamera.inst.touchTimer > .2 || Y.MoveCamera.inst.isMoving) && t.getTouches().length > 0 && !Y.MoveCamera.inst.alreadyUsedZoom) if (ee.PowerButtonSelector.inst.selectedButton && ee.PowerButtonSelector.inst.selectedButton.godPower) this.processClick(t.getLocation()); else {
this.currentTouch = this.inputLocationToMapPosition(t.getLocation());
this.checkEmptyClick(this.currentTouch);
}
};
e.prototype.inputLocationToMapPosition = function(t) {
var e = Y.MoveCamera.inst.camera.getScreenToWorldPoint(t), o = this.node.convertToNodeSpaceAR(e);
o.x = Math.max(0, o.x);
o.x = Math.min(i.width - 1, o.x);
o.y = Math.max(0, o.y);
o.y = Math.min(i.height - 1, o.y);
return cc.v2(Math.floor(o.x), Math.floor(o.y));
};
e.prototype.processClick = function(t) {
this.firstClick = !0;
var e = this.inputLocationToMapPosition(t);
this.clicked(e, ee.PowerButtonSelector.inst.selectedButton.godPower.amountPerClick);
};
e.prototype.checkEmptyClick = function(t) {
this.isKeyDownCode < 0 || this.getTile(t.x, t.y) && this.units.list.forEach(function(e) {
if ($.Toolbox.distVec2(e.currentTile.pos, t) <= 10) {
e.stats.id.includes("dragon") && e.getComponent(S.default).clickToWakeup();
e.stats.id.includes("UFO") && e.getComponent(O.default).click();
}
});
};
e.prototype.isActionHappening = function() {
return !!this.earthquakeManager.quakeActive;
};
e.prototype.updateControls = function() {
var t, e, i = null;
(null === (e = null === (t = ee.PowerButtonSelector.inst.selectedButton) || void 0 === t ? void 0 : t.godPower) || void 0 === e ? void 0 : e.holdAction) && (i = ee.PowerButtonSelector.inst.selectedButton.godPower);
if (i && !Y.MoveCamera.inst.isMoving && Y.MoveCamera.inst.touchTimer > .2 && !Y.MoveCamera.inst.alreadyUsedZoom && i.holdAction && -1 != this.holdPosition.x) if (i.actionType == $t.PowerActionType.Drops) 1 == this.frameIndex && this.processClick(this.holdPosition); else {
this.firstPressedType = null;
this.processClick(this.holdPosition);
}
this.actions.magnetAction(!0);
};
e.prototype.setTileDirty = function(t, e) {
void 0 === e && (e = !1);
if (!t.dirty) {
t.dirty = !0;
this.tilesDirty.add(t);
if (ot.default.newRender && !e) {
if (t.tile_up) {
t.tile_up.dirty = !0;
this.tilesDirty.add(t.tile_up);
}
if (t.tile_down) {
t.tile_down.dirty = !0;
this.tilesDirty.add(t.tile_down);
}
}
}
};
e.prototype.zoomUpdated = function(t, e) {
this.qualityChanger.zoomUpdated(t, e);
};
e.prototype.redrawMap = function() {
var t = this;
this.dirtyTilesLast = this.tilesDirty.size;
this.tilemap.updateTileMap();
this.tilesDirty.forEach(function(e) {
t.updateDirtyTile(e);
});
this.tilesDirty.clear();
this.worldLayer.updatePixels();
};
e.prototype.checkBehaviours = function(t) {
var e, i;
(null === (e = t.type) || void 0 === e ? void 0 : e.canBeFilled) ? this.worldBehaviour_water.tileDictionary.add(t) : this.worldBehaviour_water.tileDictionary.remove(t);
(null === (i = t.data) || void 0 === i ? void 0 : i.fire) ? this.worldBehaviour_fire.tileDictionary.add(t) : this.worldBehaviour_fire.tileDictionary.remove(t);
};
e.prototype.updateDirtyTile = function(t) {
var e, i, o, a, r;
if (t.building && 0 != t.building.getColor(t).a) this.worldLayer.updateSinglePixel(t.data.tile_id, t.building.getColor(t)); else if (!t.type.edge_hills || (null === (e = t.tile_down) || void 0 === e ? void 0 : e.type.rocks)) if (t.type.edge_mountains && null !== (o = null === (i = t.tile_down) || void 0 === i ? void 0 : i.type.edge_hills) && void 0 !== o && o) this.worldLayer.updateSinglePixel(t.data.tile_id, Wt.TileType.edge_color_mountain); else {
if (t.type.rocks) {
var n = t.tile_down;
if (n && !n.type.rocks) {
this.worldLayer.updateSinglePixel(t.data.tile_id, Wt.TileType.edge_color_mountain);
return;
}
}
if (null !== (r = null === (a = t.tile_up) || void 0 === a ? void 0 : a.type.ground) && void 0 !== r && r) {
if (t.type.layerType == Wt.TileLayerType.Water) {
this.worldLayer.updateSinglePixel(t.data.tile_id, Wt.TileType.edge_color_water);
return;
}
if (t.type.canBeFilled) {
this.worldLayer.updateSinglePixel(t.data.tile_id, Wt.TileType.edge_color_no_water);
return;
}
}
this.worldLayer.updateSinglePixel(t.data.tile_id, t.getColor());
} else this.worldLayer.updateSinglePixel(t.data.tile_id, Wt.TileType.edge_color_hills);
};
e.prototype.specialPowerAction = function(t) {
t && this.isSelectedPower("relations") && (ot.default.selectedKingdom = this.kingdoms.getRandom());
};
e.prototype.isSelectedPower = function(t) {
var e, i;
return (null === (i = null === (e = ee.PowerButtonSelector.inst.selectedButton) || void 0 === e ? void 0 : e.godPower) || void 0 === i ? void 0 : i.id) == t;
};
e.prototype.isPowerShowKingdomInfo = function() {
var t, e;
return 1 == (null === (e = null === (t = ee.PowerButtonSelector.inst.selectedButton) || void 0 === t ? void 0 : t.godPower) || void 0 === e ? void 0 : e.showFullKingdomInfo);
};
e.prototype.showCityZones = function() {
return !!ot.default.showCityZones || this.isPowerShowKingdomInfo();
};
e.prototype.showCityNames = function() {
return !!ot.default.showCityInfo || this.isPowerShowKingdomInfo();
};
e.prototype.spawnCongratulationFireworks = function() {
var t, e = $.Toolbox.getRandom(this.citiesList);
if (e) {
var i = e.buildings.getRandom();
(null === (t = null == i ? void 0 : i.data) || void 0 === t ? void 0 : t.underConstruction) || this.stackEffects.spawnFireworks(i.currentTile, .2);
}
};
e.prototype.spawnPeaceFireworks = function(t) {
var e, i = t.capital;
if (i) {
var o = null === (e = i.buildings) || void 0 === e ? void 0 : e.getRandom();
(null == o ? void 0 : o.data) && (null == o ? void 0 : o.currentTile) && !o.data.underConstruction && this.stackEffects.spawnFireworks(o.currentTile, .2);
}
};
e.prototype.createShadow = function(t, e) {
void 0 === e && (e = "");
var i = cc.instantiate(X.default.inst.shadow);
i.parent = this.transformShadows;
var o = i.getComponent(j.default);
o.setShadow(e);
return o;
};
e.prototype.getCivWorldPopulation = function() {
var t = 0, e = 0;
this.units.list.forEach(function(e) {
var i;
(null === (i = e.stats) || void 0 === i ? void 0 : i.unit) && t++;
});
this.citiesList.forEach(function(t) {
e += t.getPopulationPopPoints();
});
return t + e;
};
e.prototype.checkAchievementByPower = function(t, e) {
if (e.propID >= 2e3 && e.propID < 3e3) {
h.default.update(12);
e.propID >= 2022 && e.propID <= 2029 && h.default.update(33);
}
if (e.propID > 2e3 && !p.default.member.usedProp.usedAll) {
var i = new Set(p.default.member.usedProp.list);
i.add(e.propID);
if (132 == i.size) {
p.default.member.usedProp.list = [];
p.default.member.usedProp.usedAll = !0;
h.default.update(63);
} else p.default.member.usedProp.list = Array.from(i);
p.default.save();
}
if ("lightning" == t && this.achievementLightningTimes) {
var o = cc.sys.now();
this.achievementLightningTimes.push(o);
if (o - this.achievementLightningTimes[0] > 1e4) this.achievementLightningTimes.shift(); else if (this.achievementLightningTimes.length >= 20) {
h.default.update(32, 20, !0);
this.achievementLightningTimes = null;
}
}
"beehive" == t && (this.placeBeehive = !0);
};
e.prototype.countKillByDestructionPowers = function() {
if (!h.default.isComplete(36)) {
var t = Math.floor(cc.sys.now() / 1e3);
this.achievementDestructionKills.set(t, this.mapStats.deaths_explosion);
if (this.achievementDestructionKills.size >= 5) {
var e = Array.from(this.achievementDestructionKills.keys()), i = this.achievementDestructionKills.get(e[4]) - this.achievementDestructionKills.get(e[0]);
if (i >= 100) {
h.default.update(36, i, !0);
this.achievementDestructionKills = null;
} else this.achievementDestructionKills.delete(e[0]);
}
}
h.default.update(75, this.mapStats.deaths_explosion, !0);
};
e.prototype.countKillByDivineLightPowers = function() {
if (!h.default.isComplete(45)) {
var t = Math.floor(cc.sys.now() / 1e3);
this.achievementDivineLightKills.set(t, this.mapStats.deaths_divine);
if (this.achievementDivineLightKills.size >= 10) {
var e = Array.from(this.achievementDivineLightKills.keys()), i = this.achievementDivineLightKills.get(e[9]) - this.achievementDivineLightKills.get(e[0]);
if (i >= 50) {
h.default.update(45, i, !0);
this.achievementDivineLightKills = null;
} else this.achievementDivineLightKills.delete(e[0]);
}
}
};
var i;
e.inst = null;
e.temp_list_tiles = [];
e.temp_list_tiles2 = [];
r([ ne({
type: cc.TextAsset,
tooltip: "新手引导用的地图"
}) ], e.prototype, "savedGuideMap", void 0);
r([ ne({
type: cc.Prefab,
tooltip: "城市信息预制"
}) ], e.prototype, "prefab_city", void 0);
r([ ne({
type: Jt.default,
tooltip: "地图保存管理"
}) ], e.prototype, "saveManager", void 0);
r([ ne({
type: Vt.default,
tooltip: "地图缩放控制"
}) ], e.prototype, "tilemap", void 0);
r([ ne({
type: ht.default,
tooltip: "特效管理"
}) ], e.prototype, "stackEffects", void 0);
r([ ne({
type: Zt.default,
tooltip: "打印管理"
}) ], e.prototype, "printLibrary", void 0);
r([ ne({
type: gt.default,
tooltip: "掉落管理"
}) ], e.prototype, "dropManager", void 0);
r([ ne({
type: Et.default,
tooltip: "寻路管理"
}) ], e.prototype, "pathFindingVisualiser", void 0);
r([ ne({
type: Ft.default,
tooltip: "缩略地图绘制层"
}) ], e.prototype, "worldLayer", void 0);
r([ ne({
type: Ot.default,
tooltip: "单位绘制层"
}) ], e.prototype, "unitLayer", void 0);
r([ ne({
type: xt.default,
tooltip: "岩浆绘制层"
}) ], e.prototype, "lavaLayer", void 0);
r([ ne({
type: At.default,
tooltip: "灰色粘稠层"
}) ], e.prototype, "greyGooLayer", void 0);
r([ ne({
type: dt.default,
tooltip: "像素掉落绘制层"
}) ], e.prototype, "flashEffects", void 0);
r([ ne({
type: kt.default,
tooltip: "燃烧绘制层"
}) ], e.prototype, "fireLayer", void 0);
r([ ne({
type: Pt.default,
tooltip: "地区计算层"
}) ], e.prototype, "zoneCalculator", void 0);
r([ ne({
type: Ct.default,
tooltip: "道路计算模块"
}) ], e.prototype, "roadsCalculator", void 0);
r([ ne({
type: wt.default,
tooltip: "烧毁绘制层"
}) ], e.prototype, "burnedLayer", void 0);
r([ ne({
type: st.default,
tooltip: "爆炸绘制层"
}) ], e.prototype, "explosionLayer", void 0);
r([ ne({
type: Bt.default,
tooltip: "康威生命绘制层"
}) ], e.prototype, "conwayLayer", void 0);
r([ ne({
type: qt.default,
tooltip: "地震控制制层"
}) ], e.prototype, "earthquakeManager", void 0);
r([ ne({
type: rt.CloudController,
tooltip: "云控制层"
}) ], e.prototype, "cloudController", void 0);
r([ ne({
type: pt.WaveController,
tooltip: "波浪控制层"
}) ], e.prototype, "waveController", void 0);
r([ ne({
type: lt.GlowParticles,
tooltip: "燃烧粒子发射器"
}) ], e.prototype, "particlesFire", void 0);
r([ ne({
type: lt.GlowParticles,
tooltip: "烟雾粒子发射器"
}) ], e.prototype, "particlesSmoke", void 0);
r([ ne({
type: ct.default,
tooltip: "灼热射线绘制层"
}) ], e.prototype, "heatRayFx", void 0);
r([ ne({
type: nt.default,
tooltip: "神光绘制层"
}) ], e.prototype, "fxDivineLight", void 0);
r([ ne({
type: Rt.MapBorder,
tooltip: "地图边界绘制层"
}) ], e.prototype, "mapBorder", void 0);
r([ ne({
type: Nt.default,
tooltip: "地图缩放控制"
}) ], e.prototype, "qualityChanger", void 0);
r([ ne({
type: cc.Node,
tooltip: "所有需要层级排序的元素的父节点"
}) ], e.prototype, "transformParents", void 0);
r([ ne({
type: cc.Node,
tooltip: "不在小地图隐藏的actor父节点"
}) ], e.prototype, "transformCreatures", void 0);
return i = r([ re ], e);
}(cc.Component);
i.default = se;
cc._RF.pop();
}, {
"../../../framework/lib/prototype/MathUtils": void 0,
"../../../framework/main/Constants": void 0,
"../../../framework/utils/Log": void 0,
"../../../framework/utils/Tools": void 0,
"../../../framework/utils/UiUtil": void 0,
"../../common/src/GameCommon": void 0,
"../../common/src/MsgCache": void 0,
"../../common/src/data/AchievData": void 0,
"../../common/src/data/UserData": void 0,
"../../common/src/module/LoadLayer": void 0,
"./Config": "Config",
"./DebugConfig": "DebugConfig",
"./actors/ActionLibrary": "ActionLibrary",
"./actors/Actor": "Actor",
"./actors/ActorBag": "ActorBag",
"./actors/ActorBase": "ActorBase",
"./actors/ActorStatus": "ActorStatus",
"./actors/AutoTesterBot": "AutoTesterBot",
"./actors/UnitGroupManager": "UnitGroupManager",
"./actors/other/Ant": "Ant",
"./actors/other/GodFinger": "GodFinger",
"./actors/other/Tornado": "Tornado",
"./actors/other/UFO": "UFO",
"./actors/other/boat/Boat": "Boat",
"./actors/other/boat/TaxiManager": "TaxiManager",
"./actors/other/dragon/Dragon": "Dragon",
"./ai/pathFinding/AStarFinder": "AStarFinder",
"./ai/pathFinding/AStarParam": "AStarParam",
"./ai/pathFinding/RegionPathFinder": "RegionPathFinder",
"./ai/pathFinding/StaticGrid": "StaticGrid",
"./animation/ActorAnimationLoader": "ActorAnimationLoader",
"./animation/BuildingAnimationLoader": "BuildingAnimationLoader",
"./animation/MapObjectShadow": "MapObjectShadow",
"./assetLibrary/AssetManager": "AssetManager",
"./assetLibrary/lib/ResourceLibrary": "ResourceLibrary",
"./base/BaseBuilding": "BaseBuilding",
"./base/BaseEffect": "BaseEffect",
"./behaviour/WorldBehaviour": "WorldBehaviour",
"./brush/Brush": "Brush",
"./building/Building": "Building",
"./city/City": "City",
"./city/CityBuildOrder": "CityBuildOrder",
"./city/CityPlaceFinder": "CityPlaceFinder",
"./city/CityTaskList": "CityTaskList",
"./common/GameUtils": "GameUtils",
"./common/MoveCamera": "MoveCamera",
"./common/PrefabLibrary": "PrefabLibrary",
"./common/SmoothLoader": "SmoothLoader",
"./common/ToolBox": "ToolBox",
"./common/UnusedLibrary": "UnusedLibrary",
"./common/ViewController": "ViewController",
"./common/WaterHelper": "WaterHelper",
"./effect/CloudController": "CloudController",
"./effect/EffectDivineLight": "EffectDivineLight",
"./effect/ExplosionsEffects": "ExplosionsEffects",
"./effect/GlowParticles": "GlowParticles",
"./effect/HeatRayEffect": "HeatRayEffect",
"./effect/Meteorite": "Meteorite",
"./effect/PixelFlashEffects": "PixelFlashEffects",
"./effect/StackEffects": "StackEffects",
"./effect/WaveController": "WaveController",
"./game/audio/GameAudio": "GameAudio",
"./game/guide/GuideController": "GuideController",
"./kingdom/KingdomColors": "KingdomColors",
"./kingdom/KingdomManager": "KingdomManager",
"./map/drop/DropManager": "DropManager",
"./map/generator/GeneratorTool": "GeneratorTool",
"./map/generator/NameGenerator": "NameGenerator",
"./map/generator/WorldNameGenerator": "WorldNameGenerator",
"./map/layer/BurnedTilesLayer": "BurnedTilesLayer",
"./map/layer/ConwayLife": "ConwayLife",
"./map/layer/FireLayer": "FireLayer",
"./map/layer/GreyGooLayer": "GreyGooLayer",
"./map/layer/IslandsCalculator": "IslandsCalculator",
"./map/layer/LavaLayer": "LavaLayer",
"./map/layer/RoadsCalculator": "RoadsCalculator",
"./map/layer/UnitLayer": "UnitLayer",
"./map/layer/ZoneCalculator": "ZoneCalculator",
"./map/map/MapBorder": "MapBorder",
"./map/map/MapChunkManager": "MapChunkManager",
"./map/map/MapEdges": "MapEdges",
"./map/map/MapLayer": "MapLayer",
"./map/map/MapMarks": "MapMarks",
"./map/map/MapNamesManager": "MapNamesManager",
"./map/map/MapStats": "MapStats",
"./map/map/PathFindingVisualiser": "PathFindingVisualiser",
"./map/map/QualityChanger": "QualityChanger",
"./map/map/RegionLinkHashes": "RegionLinkHashes",
"./map/tile/Heat": "Heat",
"./map/tile/TileMover": "TileMover",
"./map/tile/TileType": "TileType",
"./map/tile/UnitZones": "UnitZones",
"./map/tile/WorldTile": "WorldTile",
"./map/tile/WorldTilemap": "WorldTilemap",
"./natural/Earthquake": "Earthquake",
"./natural/PrintLibrary": "PrintLibrary",
"./save/SaveManager": "SaveManager",
"./save/StatsData": "StatsData",
"./ui/UiController": "UiController",
"./ui/log/WorldLog": "WorldLog",
"./ui/power/GodActions": "GodActions",
"./ui/power/GodPower": "GodPower",
"./ui/power/PowerActionsModule": "PowerActionsModule",
"./ui/power/PowerButtonSelector": "PowerButtonSelector",
"./world/WorldLaws": "WorldLaws"
} ],
MapChunkManager: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "fe04d7Lf3dGr4qqn/e3Lbi/", "MapChunkManager");
Object.defineProperty(i, "__esModule", {
value: !0
});
var o = t("../../common/CachedRaycastIslands"), a = t("../../Config"), r = t("../../MapBox"), n = t("../tile/WorldTile"), s = t("./MapChunk"), l = t("./MapRegion"), c = function() {
function t() {
this.color1 = cc.Color.GRAY;
this.color2 = cc.Color.WHITE;
this.list = [];
this.dirtyChunks = [];
this.m_dirtyChunks = 0;
this.timer = .4;
this.amountX = 0;
this.amountY = 0;
this._temp_tiles = [];
this.edge_first = !1;
this.edge_last = !1;
this._tilesToCheck = [];
}
t.prototype.logicUpdate = function(t) {
this.timer > 0 ? this.timer -= t : this.updateDirty();
};
t.prototype.prepare = function() {
this.list = [];
this.amountX = 4 * a.default.ZONE_AMOUNT_X;
this.amountY = 4 * a.default.ZONE_AMOUNT_Y;
for (var t = 1, e = 0; e < this.amountY; e++) for (var i = 0; i < this.amountX; i++) {
var o = new s.default();
o.id = t++;
o.x = i;
o.y = e;
o.color = (i + e) % 2 == 0 ? this.color1 : this.color2;
this.list.push(o);
this.fill(o);
}
this.generateNeighbours();
};
t.prototype.fill = function(t) {
for (var e = 16 * t.x, i = 16 * t.y, o = null, a = 0; a < 16; a++) for (var n = 0; n < 16; n++) {
(o = r.default.inst.getTile(a + e, n + i)).chunk = t;
t.addTile(o, a, n);
}
for (var s = 0; s < 16; s++) (o = r.default.inst.getTile(s + e, i)) && t.edges_down.push(o);
for (var l = 0; l < 16; l++) (o = r.default.inst.getTile(l + e, i + 16)) && t.edges_up.push(o);
for (var c = 0; c < 16; c++) (o = r.default.inst.getTile(e, i + c)) && t.edges_left.push(o);
for (var u = 0; u < 16; u++) (o = r.default.inst.getTile(e + 16, i + u)) && t.edges_right.push(o);
(o = r.default.inst.getTile(e + 16, i + 16)) && t.edge_special.push(o);
(o = r.default.inst.getTile(e, i)) && t.edge_special_bottom.push(o);
};
t.prototype.generateNeighbours = function() {
var t = this;
this.list.forEach(function(e) {
e.neighbours = [];
e.neighboursAll = [];
var i = t.get(e.x - 1, e.y);
e.addNeighbour(i, n.TileDirection.Left);
i = t.get(e.x + 1, e.y);
e.addNeighbour(i, n.TileDirection.Right);
i = t.get(e.x, e.y - 1);
e.addNeighbour(i, n.TileDirection.Down);
i = t.get(e.x, e.y + 1);
e.addNeighbour(i, n.TileDirection.Up);
i = t.get(e.x - 1, e.y - 1);
e.addNeighbour(i, n.TileDirection.Null, !0);
i = t.get(e.x - 1, e.y + 1);
e.addNeighbour(i, n.TileDirection.Null, !0);
i = t.get(e.x + 1, e.y - 1);
e.addNeighbour(i, n.TileDirection.Null, !0);
i = t.get(e.x + 1, e.y + 1);
e.addNeighbour(i, n.TileDirection.Null, !0);
});
};
t.prototype.get = function(t, e) {
if (t < 0 || t >= this.amountX || e < 0 || e >= this.amountY) return null;
var i = e * this.amountX + t;
return i >= this.list.length ? null : this.list[i];
};
t.prototype.clearAll = function() {
r.default.inst.islandsCalculator.clear();
this.dirtyChunks = [];
this.list.forEach(function(t) {
t.clear();
});
};
t.prototype.setDirty = function(t, e, i) {
void 0 === e && (e = !0);
void 0 === i && (i = !0);
if (!t.dirty_regions || !t.dirty_links) {
var o = t.dirty_regions || t.dirty_links;
e && (t.dirty_regions = e);
i && (t.dirty_links = i);
o || this.dirtyChunks.push(t);
}
};
t.prototype.allDirty = function() {
this.dirtyChunks = [];
this.list.forEach(function(t) {
t.dirty_links = !0;
t.dirty_regions = !0;
});
this.dirtyChunks.addRange(this.list);
this.updateDirty();
};
t.prototype.updateDirty = function() {
var e = this;
if (!r.default.inst.isActionHappening() && 0 != this.dirtyChunks.length) {
this.timer = .4;
this.m_dirtyChunks = this.dirtyChunks.length;
t.m_newRegions = 0;
t.m_newLinks = 0;
t.m_newIslands = 0;
this.dirtyChunks.forEach(function(t) {
t.dirty_regions && t.calculateRegions();
});
this.dirtyChunks.forEach(function(t) {
t.dirty_links && e.calculateLinks(t);
});
this.dirtyChunks.forEach(function(t) {
e.calculateRegionNeighbours(t);
});
r.default.inst.islandsCalculator.findIslands();
r.default.inst.islandsCalculator.islands.forEach(function(t) {
t.regions.forEach(function(t) {
t.calculateCenterRegion();
});
});
this.dirtyChunks.clear();
r.default.inst.cityPlaceFinder.setDirty();
r.default.inst.regionPathFinder.clearCache();
o.default.clear();
}
};
t.prototype.calculateRegionNeighbours = function(t) {
t.regions.forEach(function(t) {
t.calculateNeigbours();
});
};
t.prototype.calculateLinks = function(t) {
t.dirty_links = !1;
this.calculateLink(t.edges_right, l.LinkDirection.Right, l.LinkDirection.LR);
this.calculateLink(t.edges_left, l.LinkDirection.Left, l.LinkDirection.LR);
this.calculateLink(t.edges_up, l.LinkDirection.Up, l.LinkDirection.UD);
this.calculateLink(t.edges_down, l.LinkDirection.Down, l.LinkDirection.UD);
t.edge_special.length > 0 && this.calculateLink(t.edge_special, l.LinkDirection.Up, l.LinkDirection.UD);
t.edge_special_bottom.length > 0 && this.calculateLink(t.edge_special_bottom, l.LinkDirection.Down, l.LinkDirection.UD);
};
t.prototype.calculateLink = function(t, e, i) {
this._temp_tiles.clear();
for (var o = null, a = null, r = 0; r < t.length; r++) {
o = t[r];
if ((a = r + 1 >= t.length ? null : t[r + 1]) && o.type.layerType == a.type.layerType) this._temp_tiles.push(o); else {
this._temp_tiles.push(o);
if (t.length > 1) {
this.edge_first = this._temp_tiles[0] == t[0];
this.edge_last = this._temp_tiles[this._temp_tiles.length - 1] == t[t.length - 1];
} else {
this.edge_first = !1;
this.edge_last = !1;
}
this.findRegionToLink(this._temp_tiles, e, i);
this._temp_tiles = [];
}
}
};
t.prototype.findRegionToLink = function(e, i, o) {
for (var a = this, n = null, s = function(s) {
var u = e[s];
c._tilesToCheck.clear();
n = null;
switch (i) {
case l.LinkDirection.Up:
c._tilesToCheck.push(u.tile_down);
c.edge_first || (n = r.default.inst.getTile(u.x - 1, u.y - 1)) && c._tilesToCheck.push(n);
c.edge_last || (n = r.default.inst.getTile(u.x + 1, u.y - 1)) && c._tilesToCheck.push(n);
break;

case l.LinkDirection.Down:
c._tilesToCheck.push(u);
c.edge_first || (n = r.default.inst.getTile(u.x - 1, u.y + 1)) && c._tilesToCheck.push(n);
c.edge_last || (n = r.default.inst.getTile(u.x + 1, u.y + 1)) && c._tilesToCheck.push(n);
break;

case l.LinkDirection.Left:
c._tilesToCheck.push(u);
c.edge_first || (n = r.default.inst.getTile(u.x - 1, u.y - 1)) && c._tilesToCheck.push(n);
c.edge_last || (n = r.default.inst.getTile(u.x - 1, u.y + 1)) && c._tilesToCheck.push(n);
break;

case l.LinkDirection.Right:
c._tilesToCheck.push(u.tile_left);
c.edge_first || (n = r.default.inst.getTile(u.x + 1, u.y - 1)) && c._tilesToCheck.push(n);
c.edge_last || (n = r.default.inst.getTile(u.x + 1, u.y + 1)) && c._tilesToCheck.push(n);
}
if (0 == c._tilesToCheck.length) return "continue";
c._tilesToCheck.forEach(function(e) {
if (e.type.layerType == u.type.layerType) {
t.m_newLinks++;
e.region.newConnection(a._temp_tiles, i, o);
}
});
}, c = this, u = 0; u < e.length; u++) s(u);
};
t.prototype.calcRegions = function() {
var t = 0;
this.list.forEach(function(e) {
t += e.regions.length;
});
return t;
};
t.m_newRegions = 0;
t.m_newLinks = 0;
t.m_newIslands = 0;
return t;
}();
i.default = c;
cc._RF.pop();
}, {
"../../Config": "Config",
"../../MapBox": "MapBox",
"../../common/CachedRaycastIslands": "CachedRaycastIslands",
"../tile/WorldTile": "WorldTile",
"./MapChunk": "MapChunk",
"./MapRegion": "MapRegion"
} ],
MapChunk: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "c8e97m0lD9FJZUX/SRchPrf", "MapChunk");
var o = this && this.__values || function(t) {
var e = "function" == typeof Symbol && Symbol.iterator, i = e && t[e], o = 0;
if (i) return i.call(t);
if (t && "number" == typeof t.length) return {
next: function() {
t && o >= t.length && (t = void 0);
return {
value: t && t[o++],
done: !t
};
}
};
throw new TypeError(e ? "Object is not iterable." : "Symbol.iterator is not defined.");
};
Object.defineProperty(i, "__esModule", {
value: !0
});
var a = t("../tile/WorldTile"), r = t("./MapChunkManager"), n = t("./MapRegion"), s = function() {
function t() {
this.k_list_objects = [];
this.k_dict_objects = new Map();
this.neighbours = [];
this.neighboursAll = [];
this.tiles = [];
this.regions = [];
this.edges_left = [];
this.edges_up = [];
this.edges_down = [];
this.edges_right = [];
this.edge_special_bottom = [];
this.edge_special = [];
this.world_edge = !1;
this.x = 0;
this.y = 0;
this.id = 0;
this.color = cc.Color.TRANSPARENT;
this.dirty_regions = !1;
this.dirty_links = !1;
this.chunk_up = null;
this.chunk_down = null;
this.chunk_left = null;
this.chunk_right = null;
}
t.prototype.addTile = function(t) {
this.tiles.push(t);
};
t.prototype.addNeighbour = function(t, e, i) {
void 0 === i && (i = !1);
if (t) {
i || this.neighbours.push(t);
this.neighboursAll.push(t);
switch (e) {
case a.TileDirection.Up:
this.chunk_up = t;
break;

case a.TileDirection.Down:
this.chunk_down = t;
break;

case a.TileDirection.Left:
this.chunk_left = t;
break;

case a.TileDirection.Right:
this.chunk_right = t;
}
} else this.world_edge = !0;
};
t.prototype.calculateRegions = function() {
var t, e;
this.dirty_regions = !1;
this.clear();
this.tiles.forEach(function(t) {
t.checkedTile = !1;
t.region = null;
t.edge_region_right = null;
t.edge_region_up = null;
});
var i = !0;
try {
for (var a = o(this.tiles), s = a.next(); !s.done; s = a.next()) {
var l = s.value;
if (!l.region) {
r.default.m_newRegions++;
var c = new n.default();
c.type = l.type.layerType;
c.chunk = this;
var u = this.newRegion(l, l.type.layerType, c, i);
c.id = 100 * c.chunk.id + this.regions.length;
c.tiles.shuffle();
this.regions.push(c);
if (u) break;
i = !1;
}
}
} catch (e) {
t = {
error: e
};
} finally {
try {
s && !s.done && (e = a.return) && e.call(a);
} finally {
if (t) throw t.error;
}
}
};
t.prototype.newRegion = function(e, i, a, r) {
var n, s, l = this;
t._nextWave = [];
t._nextWave.push(e);
if (r) {
var c = !1;
try {
for (var u = o(this.tiles), d = u.next(); !d.done; d = u.next()) if (d.value.type.layerType != i) {
c = !0;
break;
}
} catch (t) {
n = {
error: t
};
} finally {
try {
d && !d.done && (s = u.return) && s.call(u);
} finally {
if (n) throw n.error;
}
}
if (!c) {
this.tiles.forEach(function(t) {
t.region = a;
a.tiles.push(t);
});
return !0;
}
}
for (var h = 0, p = function() {
var e = t._nextWave[h];
e.checkedTile = !0;
e.region = a;
a.tiles.push(e);
h++;
e.neighboursAll.forEach(function(i) {
if (!i.checkedTile && i.type.layerType == e.region.type && i.chunk == l) {
i.checkedTile = !0;
i.region = a;
t._nextWave.push(i);
}
});
}; h < t._nextWave.length; ) p();
return 256 == a.tiles.length;
};
t.prototype.canContinue = function(t, e) {
return !!t && !t.checkedTile && t.type.layerType == e && t.chunk == this;
};
t.prototype.clearObjects = function() {
this.k_dict_objects.clear();
this.k_list_objects = [];
};
t.prototype.addObject = function(e) {
if (e.kingdom) {
t._objectList = this.k_dict_objects.get(e.kingdom);
if (!t._objectList || 0 == t._objectList.length) {
t._objectList = [];
this.k_list_objects.push(e.kingdom);
this.k_dict_objects.set(e.kingdom, t._objectList);
}
t._objectList.push(e);
}
};
t.prototype.clear = function() {
this.regions.forEach(function(t) {
t.island && t.island.clearRegionsFromIsland();
t.clear();
});
this.regions = [];
this.clearObjects();
};
t.debug = !1;
t._nextWave = [];
t._objectList = [];
return t;
}();
i.default = s;
cc._RF.pop();
}, {
"../tile/WorldTile": "WorldTile",
"./MapChunkManager": "MapChunkManager",
"./MapRegion": "MapRegion"
} ],
MapEdges: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "f0194Bq/RdLrbux77Sy8vlr", "MapEdges");
Object.defineProperty(i, "__esModule", {
value: !0
});
var o = t("../../../../../framework/lib/prototype/MathUtils"), a = t("../../MapBox"), r = t("../../texture/TextureLoader"), n = function() {
function t() {}
t.addEdge = function() {
if (!t.textureLeft) {
t.textureLeft = r.TextureLoader.inst.getTexture(r.BIN_TYPE.edges, "edge100xLeft");
t.textureRight = r.TextureLoader.inst.getTexture(r.BIN_TYPE.edges, "edge100xRight");
t.textureUp = r.TextureLoader.inst.getTexture(r.BIN_TYPE.edges, "edge100xUp");
t.textureDown = r.TextureLoader.inst.getTexture(r.BIN_TYPE.edges, "edge100xDown");
}
for (var e = o.default.intCast(a.default.width / t.edgeSize) + 1, i = o.default.intCast(a.default.height / t.edgeSize) + 1, n = 0; n < i; n++) t.fill(0, n, t.textureLeft);
for (var s = 0; s < i; s++) t.fill(e - 2, s, t.textureRight, !0, !1);
for (var l = 0; l < e; l++) t.fill(l, 0, t.textureDown);
for (var c = 0; c < e; c++) t.fill(c, i - 2, t.textureUp, !1, !0);
};
t.fill = function(e, i, o, r, n) {
void 0 === r && (r = !1);
void 0 === n && (n = !1);
for (var s = 0; s < o.height; s++) for (var l = 0; l < o.width; l++) {
var c = o.getPixel(l, s).a, u = r ? a.default.width - t.edgeSize + l : l + e * t.edgeSize, d = n ? a.default.height - t.edgeSize + s : s + i * t.edgeSize, h = a.default.inst.getTile(u, d);
h && (h.Height -= c);
}
};
t.textureLeft = null;
t.textureRight = null;
t.textureUp = null;
t.textureDown = null;
t.edgeSize = 50;
return t;
}();
i.default = n;
cc._RF.pop();
}, {
"../../../../../framework/lib/prototype/MathUtils": void 0,
"../../MapBox": "MapBox",
"../../texture/TextureLoader": "TextureLoader"
} ],
MapLayer: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "4ae0beddDhIh5mhliY15TWw", "MapLayer");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
}), r = this && this.__decorate || function(t, e, i, o) {
var a, r = arguments.length, n = r < 3 ? e : null === o ? o = Object.getOwnPropertyDescriptor(e, i) : o;
if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) n = Reflect.decorate(t, e, i, o); else for (var s = t.length - 1; s >= 0; s--) (a = t[s]) && (n = (r < 3 ? a(n) : r > 3 ? a(e, i, n) : a(e, i)) || n);
return r > 3 && n && Object.defineProperty(e, i, n), n;
};
Object.defineProperty(i, "__esModule", {
value: !0
});
i.MapObjectType = void 0;
var n = t("../../base/BaseMapObject"), s = t("../../MapBox"), l = t("../tile/TileDictionary");
(function(t) {
t[t.Actor = 0] = "Actor";
t[t.Building = 1] = "Building";
t[t.All = 2] = "All";
})(i.MapObjectType || (i.MapObjectType = {}));
var c = cc._decorator, u = c.ccclass, d = c.property, h = function(t) {
a(e, t);
function e() {
var e = null !== t && t.apply(this, arguments) || this;
e.autoDisable = !1;
e.autoDisableCheckPixels = !1;
e.textureID = 0;
e.timer = 0;
e.colorValues = cc.Color.TRANSPARENT;
e.colors_amount = 1;
e.sprRnd = null;
e.texture = new cc.Texture2D();
e.textureData = null;
e.pixels_to_update = new l.TileDictionary();
e.colors = [];
e.tileDictionary = new l.TileDictionary();
e.textureWidth = 0;
e.textureHeight = 0;
return e;
}
e.prototype.getTextureData = function() {
return this.textureData;
};
e.prototype.onLoad = function() {
this.create();
};
e.prototype.create = function() {
this.sprRnd = this.getComponent(cc.Sprite);
this.colors = [];
this.createColors();
this.texture.setFilters(cc.Texture2D.Filter.NEAREST, cc.Texture2D.Filter.NEAREST);
};
e.prototype.checkAutoDisable = function() {
this.autoDisable && (this.autoDisableCheckPixels ? this.sprRnd.enabled = this.pixels_to_update.count() > 0 : this.tileDictionary.count() > 0 ? this.sprRnd.enabled = !0 : this.sprRnd.enabled = !1);
};
e.prototype.createTextureNew = function(t, e) {
void 0 === t && (t = s.default.width);
void 0 === e && (e = s.default.height);
if (t != this.textureWidth || e != this.textureHeight) {
this.textureWidth = t;
this.textureHeight = e;
if (this.sprRnd) {
delete this.textureData;
this.node.width = t;
this.node.height = e;
this.textureData = new Uint8Array(t * e * 4);
this.textureData.fill(0);
this.texture.initWithData(this.textureData, cc.Texture2D.PixelFormat.RGBA8888, t, e);
if (!this.sprRnd.spriteFrame) {
this.sprRnd.spriteFrame = new cc.SpriteFrame();
this.sprRnd.spriteFrame.setTexture(this.texture);
}
}
this.updatePixels();
}
};
e.prototype.contains = function(t) {
return this.pixels_to_update.contains(t);
};
e.prototype.clear = function() {
this.pixels_to_update.clear();
if (this.textureData) {
this.textureData.fill(0);
this.updatePixels();
}
};
e.prototype.setRendererEnabled = function(t) {
this.sprRnd.enabled = t;
};
e.prototype.createColors = function() {
for (var t = 0; t < this.colors_amount; t++) {
var e = t <= 0 ? 0 : 1 / this.colors_amount * t;
this.colors.push(cc.color(this.colorValues.r, this.colorValues.g, this.colorValues.b, e * this.colorValues.a));
}
};
e.prototype.logicUpdate = function(t) {
var e;
this.checkAutoDisable();
(null === (e = this.sprRnd) || void 0 === e ? void 0 : e.enabled) && this.updateDirty(t);
};
e.prototype.updateSinglePixel = function(t, e) {
if (this.texture && this.textureData) {
var i = Math.floor(t / this.textureWidth), o = t - i * this.textureWidth;
this.updateTilePixel(o, i, e);
}
};
e.prototype.updateTilePixel = function(t, e, i) {
if (!(t < 0 || t >= this.textureWidth || e < 0 || e >= this.textureHeight)) {
var o = (this.textureHeight - 1 - e) * this.textureWidth + t;
this.textureData[4 * o + 0] = i.r;
this.textureData[4 * o + 1] = i.g;
this.textureData[4 * o + 2] = i.b;
this.textureData[4 * o + 3] = i.a;
}
};
e.prototype.updatePixels = function() {
var t;
this.texture && this.textureData && (null === (t = this.sprRnd) || void 0 === t ? void 0 : t.enabled) && this.texture.initWithData(this.textureData, cc.Texture2D.PixelFormat.RGBA8888, this.textureWidth, this.textureHeight);
};
e.prototype.updateDirty = function() {};
r([ d ], e.prototype, "autoDisable", void 0);
r([ d ], e.prototype, "autoDisableCheckPixels", void 0);
r([ d ], e.prototype, "textureID", void 0);
return r([ u ], e);
}(n.default);
i.default = h;
cc._RF.pop();
}, {
"../../MapBox": "MapBox",
"../../base/BaseMapObject": "BaseMapObject",
"../tile/TileDictionary": "TileDictionary"
} ],
MapMarks: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "69657hMRY5DtaN3Y2njGRW/", "MapMarks");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
}), r = this && this.__decorate || function(t, e, i, o) {
var a, r = arguments.length, n = r < 3 ? e : null === o ? o = Object.getOwnPropertyDescriptor(e, i) : o;
if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) n = Reflect.decorate(t, e, i, o); else for (var s = t.length - 1; s >= 0; s--) (a = t[s]) && (n = (r < 3 ? a(n) : r > 3 ? a(e, i, n) : a(e, i)) || n);
return r > 3 && n && Object.defineProperty(e, i, n), n;
}, n = this && this.__values || function(t) {
var e = "function" == typeof Symbol && Symbol.iterator, i = e && t[e], o = 0;
if (i) return i.call(t);
if (t && "number" == typeof t.length) return {
next: function() {
t && o >= t.length && (t = void 0);
return {
value: t && t[o++],
done: !t
};
}
};
throw new TypeError(e ? "Object is not iterable." : "Symbol.iterator is not defined.");
};
Object.defineProperty(i, "__esModule", {
value: !0
});
var s = t("../../assetLibrary/AssetManager"), l = t("../../common/ToolBox"), c = t("../../Config"), u = t("../../MapBox"), d = t("./MarkContainer"), h = cc._decorator, p = h.ccclass, f = h.property, m = function(t) {
a(e, t);
function e() {
var e = null !== t && t.apply(this, arguments) || this;
e.pbMapArrow = null;
e.pbMapLeader = null;
e.pbMapKing = null;
e.pbMapArmy = null;
e.pbMapMarkBoat = null;
e.arrows = null;
e.leaders = null;
e.kings = null;
e.army = null;
e.boats = null;
e.maxScale = .4;
return e;
}
i = e;
e.prototype.onLoad = function() {
i.inst = this;
this.arrows = new d.default(this.pbMapArrow);
this.leaders = new d.default(this.pbMapLeader);
this.kings = new d.default(this.pbMapKing);
this.army = new d.default(this.pbMapArmy);
this.boats = new d.default(this.pbMapMarkBoat);
};
e.prototype.drawMarks = function() {
this.kings.clear();
this.leaders.clear();
this.army.clear();
this.boats.clear();
if (u.default.inst.qualityChanger.lowRes) {
c.default.showkingsAndLeadersInfo && this.drawMarksLeaders();
c.default.showmarks_boatsInfo && this.drawMarksBoats();
}
};
e.prototype.drawMarksBoats = function() {
var t, e, i, o, a, r, c = null === (i = s.default.raceLibrary.get("boat")) || void 0 === i ? void 0 : i.units;
if (c && 0 != c.count) try {
for (var u = n(c.list), d = u.next(); !d.done; d = u.next()) {
var h = d.value;
if ((null === (o = null == h ? void 0 : h.data) || void 0 === o ? void 0 : o.alive) && (null === (a = null == h ? void 0 : h.stats) || void 0 === a ? void 0 : a.drawBoatMark)) {
var p = null === (r = h.kingdom) || void 0 === r ? void 0 : r.kingdomColor;
p ? this.drawMark(h.currentTile, null, p.colorBorderOut, this.boats) : this.drawMark(h.currentTile, null, l.Toolbox.color_white, this.boats);
}
}
} catch (e) {
t = {
error: e
};
} finally {
try {
d && !d.done && (e = u.return) && e.call(u);
} finally {
if (t) throw t.error;
}
}
};
e.prototype.drawMarksLeaders = function() {
var t, e, i, o, a, r, s, l, c, d, h, p, f, m, y, _, g;
try {
for (var v = n(u.default.inst.kingdoms.list_civs), b = v.next(); !b.done; b = v.next()) {
var T = b.value;
(null === (l = null === (s = T.king) || void 0 === s ? void 0 : s.data) || void 0 === l ? void 0 : l.alive) && this.drawMark(T.king.currentTile, null, null === (c = T.kingdomColor) || void 0 === c ? void 0 : c.colorBorderOut, this.kings);
}
} catch (e) {
t = {
error: e
};
} finally {
try {
b && !b.done && (e = v.return) && e.call(v);
} finally {
if (t) throw t.error;
}
}
try {
for (var w = n(u.default.inst.kingdoms.list_civs), B = w.next(); !B.done; B = w.next()) {
var k = B.value;
for (var A in k.cities) (null === (h = null === (d = A.leader) || void 0 === d ? void 0 : d.data) || void 0 === h ? void 0 : h.alive) && this.drawMark(A.leader.currentTile, null, null === (p = k.kingdomColor) || void 0 === p ? void 0 : p.colorBorderOut, this.leaders);
}
} catch (t) {
i = {
error: t
};
} finally {
try {
B && !B.done && (o = w.return) && o.call(w);
} finally {
if (i) throw i.error;
}
}
try {
for (var S = n(u.default.inst.unitGroupManager.groups), x = S.next(); !x.done; x = S.next()) {
var C = x.value;
(null === (m = null === (f = C.groupLeader) || void 0 === f ? void 0 : f.data) || void 0 === m ? void 0 : m.alive) && (null === (_ = null === (y = C.groupLeader) || void 0 === y ? void 0 : y.kingdom) || void 0 === _ ? void 0 : _.isCiv()) && this.drawMark(C.groupLeader.currentTile, null, null === (g = C.groupLeader.kingdom.kingdomColor) || void 0 === g ? void 0 : g.colorBorderOut, this.army);
}
} catch (t) {
a = {
error: t
};
} finally {
try {
x && !x.done && (r = S.return) && r.call(S);
} finally {
if (a) throw a.error;
}
}
};
e.prototype.drawArrows = function() {
var t, e, i, o, a, r;
if (this.arrows) {
this.arrows.clear();
if (u.default.inst.qualityChanger.lowRes && c.default.showkingsAndLeadersInfo) {
try {
for (var s = n(u.default.inst.kingdoms.list_civs), d = s.next(); !d.done; d = s.next()) {
var h = d.value;
try {
for (var p = (i = void 0, n(h.cities)), f = p.next(); !f.done; f = p.next()) {
var m = f.value;
if (m.settleTarget) {
var y = m.getTile(), _ = m.settleTarget.centerTile;
y && _ && this.drawMark(y, _, l.Toolbox.color_yellow, this.arrows);
}
}
} catch (t) {
i = {
error: t
};
} finally {
try {
f && !f.done && (o = p.return) && o.call(p);
} finally {
if (i) throw i.error;
}
}
}
} catch (e) {
t = {
error: e
};
} finally {
try {
d && !d.done && (e = s.return) && e.call(s);
} finally {
if (t) throw t.error;
}
}
try {
for (var g = n(u.default.inst.kingdoms.list_civs), v = g.next(); !v.done; v = g.next()) {
var b = v.value;
if (b.target_city && b.capital) {
y = b.capital.getTile(), _ = b.target_city.getTile();
y && _ && this.drawMark(y, _, l.Toolbox.color_red, this.arrows);
}
}
} catch (t) {
a = {
error: t
};
} finally {
try {
v && !v.done && (r = g.return) && r.call(g);
} finally {
if (a) throw a.error;
}
}
}
}
};
e.prototype.drawMark = function(t, e, i, o) {
if (t) {
var a = o.get();
a.node.active = !0;
a.node.position = t.posV3;
a.node.scale = .5;
if (o == this.arrows) {
var r = 57.29578 * l.Toolbox.getAngle(t.posV3.x, t.posV3.y, e.posV3.x, e.posV3.y);
a.node.angle = r;
var n = l.Toolbox.distTile(t, e), s = a.spriteRenderer.node.width;
a.node.scaleX = n / s;
a.spriteRenderer.node.color = i;
} else if (o == this.kings) {
a.spriteRenderer.node.color = i;
a.node.position = t.posV3;
} else if (o == this.leaders) {
a.spriteRenderer.node.color = i;
a.node.position = t.posV3;
} else if (o == this.army) {
a.spriteRenderer.node.color = i;
a.node.position = t.posV3;
} else if (o == this.boats) {
a.spriteRendererSail.node.color = i;
a.node.position = t.posV3;
}
}
};
var i;
e.inst = null;
r([ f(cc.Prefab) ], e.prototype, "pbMapArrow", void 0);
r([ f(cc.Prefab) ], e.prototype, "pbMapLeader", void 0);
r([ f(cc.Prefab) ], e.prototype, "pbMapKing", void 0);
r([ f(cc.Prefab) ], e.prototype, "pbMapArmy", void 0);
r([ f(cc.Prefab) ], e.prototype, "pbMapMarkBoat", void 0);
return i = r([ p ], e);
}(cc.Component);
i.default = m;
cc._RF.pop();
}, {
"../../Config": "Config",
"../../MapBox": "MapBox",
"../../assetLibrary/AssetManager": "AssetManager",
"../../common/ToolBox": "ToolBox",
"./MarkContainer": "MarkContainer"
} ],
MapMark: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "24b04R68/JJmIuNRpaVhz5W", "MapMark");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
}), r = this && this.__decorate || function(t, e, i, o) {
var a, r = arguments.length, n = r < 3 ? e : null === o ? o = Object.getOwnPropertyDescriptor(e, i) : o;
if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) n = Reflect.decorate(t, e, i, o); else for (var s = t.length - 1; s >= 0; s--) (a = t[s]) && (n = (r < 3 ? a(n) : r > 3 ? a(e, i, n) : a(e, i)) || n);
return r > 3 && n && Object.defineProperty(e, i, n), n;
};
Object.defineProperty(i, "__esModule", {
value: !0
});
var n = cc._decorator, s = n.ccclass, l = (n.property, function(t) {
a(e, t);
function e() {
var e = null !== t && t.apply(this, arguments) || this;
e.spriteRenderer = null;
e.spriteRendererSail = null;
return e;
}
e.prototype.onLoad = function() {
this.spriteRenderer = this.node.getComponent(cc.Sprite);
var t = this.node.getChildByName("sail");
t && (this.spriteRendererSail = t.getComponent(cc.Sprite));
};
return r([ s ], e);
}(cc.Component));
i.default = l;
cc._RF.pop();
}, {} ],
MapNamesManager: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "6cbedG573RIQ6eTNmu0zwah", "MapNamesManager");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
}), r = this && this.__decorate || function(t, e, i, o) {
var a, r = arguments.length, n = r < 3 ? e : null === o ? o = Object.getOwnPropertyDescriptor(e, i) : o;
if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) n = Reflect.decorate(t, e, i, o); else for (var s = t.length - 1; s >= 0; s--) (a = t[s]) && (n = (r < 3 ? a(n) : r > 3 ? a(e, i, n) : a(e, i)) || n);
return r > 3 && n && Object.defineProperty(e, i, n), n;
};
Object.defineProperty(i, "__esModule", {
value: !0
});
var n = t("../../MapBox"), s = t("./MapText"), l = cc._decorator, c = l.ccclass, u = l.property, d = function(t) {
a(e, t);
function e() {
var e = null !== t && t.apply(this, arguments) || this;
e.active = [];
e.pool = new cc.NodePool();
e.prefab = null;
e.dirty = !1;
return e;
}
i = e;
e.prototype.onLoad = function() {
i.inst = this;
};
e.setDirty = function() {
i.inst && (i.inst.dirty = !0);
};
e.prototype.updateAllTexts = function() {
this.active.forEach(function(t) {
t.setShowing(!0);
t.updateText();
});
};
e.prototype.updatePositions = function() {
this.active.forEach(function(t) {
t.setShowing(!0);
});
};
e.prototype.checkUpdate = function() {
if (n.default.inst.showCityNames()) {
this.node.active = !0;
this.dirty && this.logicUpdate();
} else if (this.node.active) {
this.clear();
this.node.active = !1;
}
};
e.prototype.logicUpdate = function() {
var t = this;
n.default.inst.citiesList.forEach(function(e) {
e.mapText || t.showTextFor(e);
});
this.updateAllTexts();
this.updatePositions();
this.dirty = !1;
};
e.prototype.showTextFor = function(t) {
var e = null, i = this.pool.get();
i || (i = cc.instantiate(this.prefab));
i.parent = this.node;
(e = i.getComponent(s.default)).manager = this;
this.active.push(e);
e.node.active = !0;
t.mapText = e;
e.city = t;
};
e.prototype.remove = function(t) {
t.node.active = !1;
this.active.remove(t);
this.pool.put(t.node);
};
e.prototype.clear = function() {
var t = this;
this.active.forEach(function(e) {
e.city.mapText = null;
e.city = null;
e.setShowing(!1);
t.pool.put(e.node);
});
this.active.clear();
};
var i;
e.inst = null;
r([ u(cc.Prefab) ], e.prototype, "prefab", void 0);
return i = r([ c ], e);
}(cc.Component);
i.default = d;
cc._RF.pop();
}, {
"../../MapBox": "MapBox",
"./MapText": "MapText"
} ],
MapObjectShadow: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "04852GyG7JGxZSHhpdNYW2m", "MapObjectShadow");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
}), r = this && this.__decorate || function(t, e, i, o) {
var a, r = arguments.length, n = r < 3 ? e : null === o ? o = Object.getOwnPropertyDescriptor(e, i) : o;
if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) n = Reflect.decorate(t, e, i, o); else for (var s = t.length - 1; s >= 0; s--) (a = t[s]) && (n = (r < 3 ? a(n) : r > 3 ? a(e, i, n) : a(e, i)) || n);
return r > 3 && n && Object.defineProperty(e, i, n), n;
};
Object.defineProperty(i, "__esModule", {
value: !0
});
var n = t("../texture/TextureLoader"), s = cc._decorator, l = s.ccclass, c = (s.property, 
function(t) {
a(e, t);
function e() {
var e = null !== t && t.apply(this, arguments) || this;
e.spriteRenderer = null;
e.actor = null;
return e;
}
i = e;
e.prototype.onLoad = function() {
this.spriteRenderer = this.getComponent(cc.Sprite);
};
e.prototype.setShadow = function(t, e) {
void 0 === e && (e = !1);
i.createDict();
this.spriteRenderer = this.getComponent(cc.Sprite);
i.shadowSprites.has(t) || i.addSprite(t);
this.node.scale = 0;
this.spriteRenderer.spriteFrame = i.shadowSprites.get(t);
};
e.createDict = function() {
if (null == i.shadowSprites) {
i.shadowSprites = new Map();
n.TextureLoader.inst.getSpriteFrames(n.ATLAS_TYPE.WORLDATLAS, "shadows/buildingShadows").forEach(function(t, e) {
i.shadowSprites.set(e, t);
});
}
};
e.addSprite = function(t) {
var e = n.TextureLoader.inst.getSpriteFrame(n.ATLAS_TYPE.WORLDATLAS, "shadows/" + t);
i.shadowSprites.set(t, e);
};
var i;
e.shadowSprites = null;
return i = r([ l ], e);
}(cc.Component));
i.default = c;
cc._RF.pop();
}, {
"../texture/TextureLoader": "TextureLoader"
} ],
MapRegion: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "94b1dK4H4ROkpdQn/vRY0Ex", "MapRegion");
Object.defineProperty(i, "__esModule", {
value: !0
});
i.LinkDirection = void 0;
var o, a = t("../../../../../framework/lib/prototype/MathUtils"), r = t("./RegionLinkHashes");
(function(t) {
t[t.Up = 0] = "Up";
t[t.Down = 1] = "Down";
t[t.Left = 2] = "Left";
t[t.Right = 3] = "Right";
t[t.LR = 4] = "LR";
t[t.UD = 5] = "UD";
})(o = i.LinkDirection || (i.LinkDirection = {}));
var n = function() {
function t() {
this.lastGrassGrowth = 0;
this.lastBurnedUpdate = 0;
this.id = 0;
this.usedByPathLock = !1;
this.regionPathID = -1;
this.tiles_corners = [];
this.tiles = [];
this.links = new Set();
this.edges_left = [];
this.edges_up = [];
this.edges_down = [];
this.edges_right = [];
this.island = null;
this.isIslandChecked = !1;
this.isCheckedPath = !1;
this.path_wave_id = -1;
this.regionPath = !1;
this.chunk = null;
this.cornersDirty = !0;
this.centerRegion = !1;
this.neighbours = [];
}
t.prototype.newConnection = function(t, e, i) {
var a = this;
this.newHash(t, t.length, e, i);
t.forEach(function(t) {
switch (e) {
case o.Right:
t.edge_region_right = a;
break;

case o.Up:
t.edge_region_up = a;
}
});
this.checkDebugEdges(t, e);
};
t.prototype.checkDebugEdges = function(t, e) {
var i = [];
switch (e) {
case o.Left:
i = this.edges_left;
break;

case o.Down:
i = this.edges_down;
break;

case o.Right:
i = this.edges_right;
break;

case o.Up:
i = this.edges_up;
}
i.addRange(t);
};
t.prototype.newHash = function(t, e, i, n) {
var s = t[0], l = s.x, c = s.y, u = (199 * l + 7 * c) * e * 1e4 + 1e3 * e + 100 * a.default.intCast(s.type.layerType + 1) + 10 * l + c;
n == o.LR && (u = -u);
r.default.addHash(u, this);
};
t.prototype.clear = function() {
var t = this;
this.links.forEach(function(e) {
r.default.remove(e, t);
});
this.links.clear();
this.regionPathID = -1;
};
t.prototype.calculateNeigbours = function() {
var t = this;
this.neighbours = [];
this.centerRegion = !0;
this.chunk.regions.length > 1 && (this.centerRegion = !1);
this.links.forEach(function(e) {
e.regions.forEach(function(e) {
e == t || t.neighbours.includes(e) || t.neighbours.push(e);
});
});
};
t.prototype.debugLinks = function() {};
t.prototype.calculateCenterRegion = function() {
this.centerRegion = !0;
if (this.chunk.regions.length > 1) this.centerRegion = !1; else for (var t = 0; t < this.chunk.neighboursAll.length; t++) {
var e = this.chunk.neighboursAll[t];
if (e.regions.length > 1) {
this.centerRegion = !1;
break;
}
if (e.regions[0].island != this.island) {
this.centerRegion = !1;
break;
}
}
this.centerRegion || this.island.regionsCorners.push(this);
};
t.prototype.calculateTileCorners = function() {
var t = this;
if (!this.centerRegion && this.cornersDirty) {
this.cornersDirty = !1;
this.tiles.forEach(function(e) {
e.neighboursAll.forEach(function(e) {
e.type.layerType != t.type && t.tiles_corners.push(e);
});
});
this.tiles_corners.shuffle();
}
};
t.prototype.getTileCorners = function() {
this.cornersDirty && this.calculateTileCorners();
return this.tiles_corners;
};
return t;
}();
i.default = n;
cc._RF.pop();
}, {
"../../../../../framework/lib/prototype/MathUtils": void 0,
"./RegionLinkHashes": "RegionLinkHashes"
} ],
MapSetting: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "88d05vco8pKOJu9+JAfzUEv", "MapSetting");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
}), r = this && this.__decorate || function(t, e, i, o) {
var a, r = arguments.length, n = r < 3 ? e : null === o ? o = Object.getOwnPropertyDescriptor(e, i) : o;
if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) n = Reflect.decorate(t, e, i, o); else for (var s = t.length - 1; s >= 0; s--) (a = t[s]) && (n = (r < 3 ? a(n) : r > 3 ? a(e, i, n) : a(e, i)) || n);
return r > 3 && n && Object.defineProperty(e, i, n), n;
};
Object.defineProperty(i, "__esModule", {
value: !0
});
var n = t("../../../../../framework/main/Constants"), s = t("../../../../../start/src/ShuFenReport"), l = t("../../../../common/src/advert/AdsManager"), c = t("../../../../common/src/data/AchievData"), u = t("../../../../common/src/data/UserData"), d = t("../../../../common/src/GamePopBase"), h = t("../../../../common/src/module/LoadLayer"), p = t("../../../../common/src/MsgCache"), f = t("../../Config"), m = t("../../game/audio/GameAudio"), y = cc._decorator, _ = y.ccclass, g = y.property, v = function(t) {
a(e, t);
function e() {
var e = null !== t && t.apply(this, arguments) || this;
e.btnSize = null;
e.btnIsland = null;
e.btnWater = null;
e.btnLarge = null;
e.btnHuge = null;
e.btnSuper = null;
e.texts = {
small: "小",
standard: "标准",
large: "大",
huge: "巨大",
gigantic: "超级大"
};
return e;
}
e.prototype.onLoad = function() {
this.subBg.x = cc.winSize.width;
};
e.prototype.open = function() {
this.btnSize.getChildByName("label").getComponent(cc.Label).string = this.texts[f.default.customMapSize];
this.btnIsland.getChildByName("label").getComponent(cc.Label).string = f.default.customPerlinScale + "";
this.btnWater.getChildByName("label").getComponent(cc.Label).string = f.default.customWaterLevel + "";
this.btnLarge.getChildByName("video").active = !u.default.member.unLockMap[2];
var e = cc.sys.os == cc.sys.OS_IOS || !u.default.member.unLockMap[2];
this.btnHuge.getChildByName("lock").active = e;
this.btnHuge.getChildByName("video").active = !e && !u.default.member.unLockMap[3];
this.btnHuge.getChildByName("label").color = e ? cc.Color.GRAY : cc.Color.WHITE;
t.prototype.open.call(this);
};
e.prototype.click = function(t) {
m.default.playClick();
var e = t.getCurrentTarget(), i = e.getChildByName("layout"), o = !i.active;
i.active = o;
e.getChildByName("mask").active = o;
e.zIndex = o ? 2 : 0;
};
e.prototype.showQuick = function(t, e) {
m.default.playClick();
var i = "1" == e;
this.move(i);
};
e.prototype.clickSize = function(t, e) {
var i = this, o = t.getCurrentTarget(), a = o.getChildByName("lock");
if (null != a && a.active) if (cc.sys.os == cc.sys.OS_IOS) p.default.pushToast("暂未开放"); else {
var r = "btn4" == o.name ? "暂未开放" : "请先解锁上一级尺寸地图";
p.default.pushToast(r);
} else {
m.default.playClick();
var s = o.getChildByName("video");
if (null == s ? void 0 : s.active) {
n.default.REPORT_ID = "unLockMap";
l.default.showVideoAds(function(t) {
if (1 == t) {
f.default.customMapSize = e;
s.active = !1;
o.parent.active = !1;
i.btnSize.zIndex = 0;
i.btnSize.getChildByName("mask").active = !1;
i.btnSize.getChildByName("labelTip").active = !0;
i.btnSize.getChildByName("label").getComponent(cc.Label).string = i.texts[f.default.customMapSize];
"large" == e && (u.default.member.unLockMap[2] = !0);
"huge" == e && (u.default.member.unLockMap[3] = !0);
u.default.save();
var a = cc.sys.os == cc.sys.OS_IOS || !u.default.member.unLockMap[2];
i.btnHuge.getChildByName("lock").active = a;
i.btnHuge.getChildByName("video").active = !a && !u.default.member.unLockMap[3];
i.btnHuge.getChildByName("label").color = a ? cc.Color.GRAY : cc.Color.WHITE;
} else {
var r = 0 == t ? "视频播放未完成。" : "视频播放失败，请稍候再试！";
p.default.pushToast(r);
}
});
} else {
f.default.customMapSize = e;
o.parent.active = !1;
this.btnSize.zIndex = 0;
this.btnSize.getChildByName("mask").active = !1;
this.btnSize.getChildByName("labelTip").active = !1;
this.btnSize.getChildByName("label").getComponent(cc.Label).string = this.texts[f.default.customMapSize];
}
}
};
e.prototype.clickIsland = function(t, e) {
m.default.playClick();
f.default.customPerlinScale = parseInt(e);
this.btnIsland.zIndex = 0;
this.btnIsland.getChildByName("mask").active = !1;
this.btnIsland.getChildByName("layout").active = !1;
this.btnIsland.getChildByName("label").getComponent(cc.Label).string = f.default.customPerlinScale + "";
};
e.prototype.clickWater = function(t, e) {
m.default.playClick();
f.default.customWaterLevel = parseInt(e);
this.btnWater.zIndex = 0;
this.btnWater.getChildByName("mask").active = !1;
this.btnWater.getChildByName("layout").active = !1;
this.btnWater.getChildByName("label").getComponent(cc.Label).string = f.default.customWaterLevel + "";
};
e.prototype.buildMap = function(t, e) {
h.LoadLayer.openLoading();
s.default.reportCustom("buildWorld");
c.default.update(16);
this.close();
this.clickCB && this.clickCB(e);
};
r([ g(cc.Node) ], e.prototype, "btnSize", void 0);
r([ g(cc.Node) ], e.prototype, "btnIsland", void 0);
r([ g(cc.Node) ], e.prototype, "btnWater", void 0);
r([ g(cc.Node) ], e.prototype, "btnLarge", void 0);
r([ g(cc.Node) ], e.prototype, "btnHuge", void 0);
r([ g(cc.Node) ], e.prototype, "btnSuper", void 0);
return r([ _ ], e);
}(d.GamePopBase);
i.default = v;
cc._RF.pop();
}, {
"../../../../../framework/main/Constants": void 0,
"../../../../../start/src/ShuFenReport": void 0,
"../../../../common/src/GamePopBase": void 0,
"../../../../common/src/MsgCache": void 0,
"../../../../common/src/advert/AdsManager": void 0,
"../../../../common/src/data/AchievData": void 0,
"../../../../common/src/data/UserData": void 0,
"../../../../common/src/module/LoadLayer": void 0,
"../../Config": "Config",
"../../game/audio/GameAudio": "GameAudio"
} ],
MapStats: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "07e37hCe6tEprzmSUTJLIx/", "MapStats");
Object.defineProperty(i, "__esModule", {
value: !0
});
var o = t("../../../../../framework/utils/Log"), a = t("../../MapBox"), r = function() {
function t() {
this.name = "WorldBox";
this.month = 0;
this.year = 0;
this.worldTime = 0;
this.deaths = 0;
this.deaths_age = 0;
this.deaths_hunger = 0;
this.deaths_eaten = 0;
this.deaths_plague = 0;
this.deaths_other = 0;
this.deaths_explosion = 0;
this.deaths_divine = 0;
this.housesDestroyed = 0;
this.population = 0;
this.id_unit = 0;
this.id_building = 0;
this.id_kingdom = 0;
this.id_city = 0;
}
t.prototype.updateAge = function(t) {
this.worldTime += t;
if (this.worldTime > 3) {
this.month++;
this.worldTime = 0;
}
if (this.month > 11) {
this.year++;
this.month = 0;
a.default.inst.updateObjectAge();
}
};
t.prototype.getNextId = function(t) {
var e = "";
switch (t) {
case "unit":
e = "u_" + this.id_unit++;
break;

case "building":
e = "b_" + this.id_building++;
break;

case "kingdom":
e = "k_" + this.id_kingdom++;
break;

case "city":
e = "c_" + this.id_city++;
break;

default:
o.default.e("NO pType for id " + t);
}
return e;
};
return t;
}();
i.default = r;
cc._RF.pop();
}, {
"../../../../../framework/utils/Log": void 0,
"../../MapBox": "MapBox"
} ],
MapText: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "90fd5sMg5NB8KfE2VZuenWV", "MapText");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
}), r = this && this.__decorate || function(t, e, i, o) {
var a, r = arguments.length, n = r < 3 ? e : null === o ? o = Object.getOwnPropertyDescriptor(e, i) : o;
if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) n = Reflect.decorate(t, e, i, o); else for (var s = t.length - 1; s >= 0; s--) (a = t[s]) && (n = (r < 3 ? a(n) : r > 3 ? a(e, i, n) : a(e, i)) || n);
return r > 3 && n && Object.defineProperty(e, i, n), n;
};
Object.defineProperty(i, "__esModule", {
value: !0
});
var n = t("../../../../../framework/lib/prototype/MathUtils"), s = t("../../../../common/src/GameCommon"), l = t("../../common/MoveCamera"), c = t("./MapNamesManager"), u = cc._decorator, d = u.ccclass, h = u.property, p = function(t) {
a(e, t);
function e() {
var e = null !== t && t.apply(this, arguments) || this;
e.maxScale = .4;
e.manager = null;
e.city = null;
e.nameText = null;
e.capital = null;
e.conquerContainer = null;
e.conquerText = null;
e.showing = !1;
e.lastPopulation = 0;
e.lastPositionY = 0;
e.lastPositionX = 0;
e.tweenScale = 0;
e.lastTicks = 0;
e.doAction = !1;
return e;
}
e.prototype.onLoad = function() {};
e.prototype.update = function() {
this.doScale();
};
e.prototype.doScale = function() {
if (this.node.active && !this.doAction) {
this.maxScale = 1.1 * Math.min(1 / l.MoveCamera.inst.camera.zoomRatio, .4);
this.node.scale = this.maxScale;
}
};
e.prototype.setShowing = function(t) {
this.showing = t;
if (t) {
this.node.active = !0;
this.doScale();
} else {
this.tweenScale = 0;
this.node.scaleY = 0;
cc.Action;
this.node.active = !1;
}
};
e.prototype.remove = function() {
this.manager.remove(this);
};
e.prototype.updateFromCity = function() {
this.lastPopulation == this.city.getPopulationTotal() && this.lastPositionX == this.city.cityCenter.x && this.lastPositionY != this.city.cityCenter.y || c.default.setDirty();
};
e.prototype.updateText = function() {
var t, e, i, o, a, r, l, c = this;
if (this.showing) {
if (0 == this.tweenScale) {
this.doAction = !0;
this.node.scaleY = 0;
this.tweenScale = this.maxScale;
cc.tween(this.node).to(.3, {
scaleY: this.maxScale
}, {
easing: "backOut"
}).call(function() {
c.doAction = !1;
}).start();
}
this.lastPopulation = this.city.getPopulationTotal();
this.lastPositionX = this.city.cityCenter.x;
this.lastPositionY = this.city.cityCenter.y;
var u = this.city.data.cityName + "  " + this.city.getPopulationTotal();
this.nameText.node.color != (null === (e = null === (t = this.city.kingdom) || void 0 === t ? void 0 : t.kingdomColor) || void 0 === e ? void 0 : e.colorBorderOut) && (this.nameText.node.color = null === (o = null === (i = this.city.kingdom) || void 0 === i ? void 0 : i.kingdomColor) || void 0 === o ? void 0 : o.colorBorderOut);
this.nameText.string = u;
this.node.position = this.city.cityCenter;
(null === (a = this.city.kingdom) || void 0 === a ? void 0 : a.capital) == this.city ? this.capital.active = !0 : this.capital.active = !1;
if (!s.default.isPaused) if (n.default.intCast(this.city.captureTicks) == this.lastTicks) {
this.lastTicks > 100 && (this.lastTicks = 100);
this.lastTicks < 0 && (this.lastTicks = 0);
} else if (n.default.intCast(this.city.captureTicks) > this.lastTicks) {
this.lastTicks++;
this.lastTicks > 100 && (this.lastTicks = 100);
} else {
this.lastTicks--;
this.lastTicks < 0 && (this.lastTicks = 0);
}
if (0 != this.lastTicks) {
this.conquerContainer.active = !0;
this.city.capturingBy && (this.conquerText.node.color = null === (l = null === (r = this.city.capturingBy) || void 0 === r ? void 0 : r.kingdomColor) || void 0 === l ? void 0 : l.colorBorderOut);
this.conquerText.string = this.lastTicks + "%";
} else this.conquerContainer.active = !1;
}
};
r([ h(cc.Label) ], e.prototype, "nameText", void 0);
r([ h(cc.Node) ], e.prototype, "capital", void 0);
r([ h(cc.Node) ], e.prototype, "conquerContainer", void 0);
r([ h(cc.Label) ], e.prototype, "conquerText", void 0);
return r([ d ], e);
}(cc.Component);
i.default = p;
cc._RF.pop();
}, {
"../../../../../framework/lib/prototype/MathUtils": void 0,
"../../../../common/src/GameCommon": void 0,
"../../common/MoveCamera": "MoveCamera",
"./MapNamesManager": "MapNamesManager"
} ],
MarkContainer: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "c72966Wv4FKK4IQdAbVddkz", "MarkContainer");
Object.defineProperty(i, "__esModule", {
value: !0
});
var o = t("./MapMark"), a = t("./MapMarks"), r = function() {
function t(t) {
this.stack = [];
this.active = [];
this.prefab = null;
this.prefab = t;
}
t.prototype.get = function() {
var t = null;
if (0 != this.stack.length) t = this.stack.pop(); else {
var e = cc.instantiate(this.prefab);
t = e.getComponent(o.default);
e.parent = a.default.inst.node;
}
this.active.push(t);
return t;
};
t.prototype.clear = function() {
for (var t = 0; t < this.active.length; t++) {
var e = this.active[t];
e.node.active = !1;
e.node.position = cc.v3(0, 0, 0);
this.stack.push(e);
}
this.active.clear();
};
return t;
}();
i.default = r;
cc._RF.pop();
}, {
"./MapMark": "MapMark",
"./MapMarks": "MapMarks"
} ],
Meteorite: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "f002aB863RNkLrIPmgstMeQ", "Meteorite");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
}), r = this && this.__decorate || function(t, e, i, o) {
var a, r = arguments.length, n = r < 3 ? e : null === o ? o = Object.getOwnPropertyDescriptor(e, i) : o;
if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) n = Reflect.decorate(t, e, i, o); else for (var s = t.length - 1; s >= 0; s--) (a = t[s]) && (n = (r < 3 ? a(n) : r > 3 ? a(e, i, n) : a(e, i)) || n);
return r > 3 && n && Object.defineProperty(e, i, n), n;
};
Object.defineProperty(i, "__esModule", {
value: !0
});
var n = t("../assetLibrary/AssetManager"), s = t("../base/BaseMapObject"), l = t("../common/ToolBox"), c = t("../game/audio/GameAudio"), u = t("../MapBox"), d = cc._decorator, h = d.ccclass, p = d.property, f = function(t) {
a(e, t);
function e() {
var e = null !== t && t.apply(this, arguments) || this;
e.mainSprite = null;
e.shadow = null;
e.rotationSpeed = 150;
e.fallingSpeed = 200;
e.tile = null;
e.radius = 0;
e.alpha = 0;
e.timerSmoke = .01;
e.sqrRemainingDistance = 9999;
return e;
}
e.prototype.create = function() {
t.prototype.create.call(this);
};
e.prototype.spawnOn = function(t) {
this.tile = t;
this.radius = 20;
this.node.position = cc.v3(t.posV3.x, t.posV3.y, t.y);
this.sqrRemainingDistance = cc.v2(t.pos.x, t.pos.y).magSqr();
this.setAlpha(0);
c.default.playMeteoriteFall();
};
e.prototype.update = function() {
this.alpha += 2 * u.default.inst.elapsed;
this.setAlpha(this.alpha);
this.mainSprite.angle = this.rotationSpeed * u.default.inst.elapsed;
this.shadow.angle = this.rotationSpeed * u.default.inst.elapsed;
if (this.timerSmoke > 0) this.timerSmoke -= u.default.inst.getCurElapsed(); else {
u.default.inst.stackEffects.get("fireSmoke").spawnAt(cc.v3(this.mainSprite.x + this.node.x, this.mainSprite.y + this.node.y), 1);
this.timerSmoke = .01;
if (this.sqrRemainingDistance > Number.EPSILON) {
var t = l.Toolbox.moveTowards(this.mainSprite.position, cc.Vec3.ZERO, this.fallingSpeed * u.default.inst.elapsed);
this.mainSprite.position = cc.v3(t);
this.shadow.position = cc.v3(t.x, this.shadow.position.y, this.shadow.position.z);
this.sqrRemainingDistance = t.magSqr();
} else this.explode();
}
};
e.prototype.setAlpha = function(t) {
this.alpha = t;
this.alpha < 0 && (this.alpha = 0);
this.shadow.opacity = this.alpha;
};
e.prototype.explode = function() {
u.default.inst.gameStats.meteoritesLaunched++;
u.default.inst.damageWorld(this.tile, this.radius, n.default.terraform.get("bomb"));
this.node.destroy();
u.default.inst.spawnFlash(this.tile, this.radius);
var t = cc.v3(this.tile.pos.x, this.tile.pos.y - 2), e = l.Toolbox.randomFloat(.8, .9);
u.default.inst.stackEffects.get("explosionSmall").spawnAt(t, e);
c.default.playExplosionMeteorite();
};
r([ p(cc.Node) ], e.prototype, "mainSprite", void 0);
r([ p(cc.Node) ], e.prototype, "shadow", void 0);
return r([ h ], e);
}(s.default);
i.default = f;
cc._RF.pop();
}, {
"../MapBox": "MapBox",
"../assetLibrary/AssetManager": "AssetManager",
"../base/BaseMapObject": "BaseMapObject",
"../common/ToolBox": "ToolBox",
"../game/audio/GameAudio": "GameAudio"
} ],
MoodLibrary: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "31341BS/zVJjZQgJACqmahG", "MoodLibrary");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
});
Object.defineProperty(i, "__esModule", {
value: !0
});
i.MoodAsset = void 0;
var r = t("../../base/BaseStats"), n = t("../../texture/TextureLoader"), s = t("../AssetLibrary"), l = function(t) {
a(e, t);
function e() {
var e = null !== t && t.apply(this, arguments) || this;
e.baseStats = new r.default();
e.icon = "";
e.sprite = null;
return e;
}
e.prototype.getSprite = function() {
this.sprite || (this.sprite = n.TextureLoader.inst.getSpriteFrame(n.ATLAS_TYPE.UIATLAS, "icons/" + this.icon));
return this.sprite;
};
return e;
}(s.Asset);
i.MoodAsset = l;
var c = function(t) {
a(e, t);
function e() {
return null !== t && t.apply(this, arguments) || this;
}
e.prototype.init = function() {
t.prototype.init.call(this);
var e = new l();
e.id = "sad";
e.icon = "iconMoodSad";
this.add(e);
this.t.baseStats.mod_speed = -20;
this.t.baseStats.mod_diplomacy = -10;
this.t.baseStats.mod_attackSpeed = -10;
this.t.baseStats.loyalty_mood = -5;
this.t.baseStats.opinion = -5;
var i = new l();
i.id = "normal";
i.icon = "iconMoodNormal";
this.add(i);
var o = new l();
o.id = "happy";
o.icon = "iconMoodHappy";
this.add(o);
this.t.baseStats.mod_speed = 10;
this.t.baseStats.mod_diplomacy = 10;
this.t.baseStats.mod_attackSpeed = 10;
this.t.baseStats.loyalty_mood = 10;
this.t.baseStats.opinion = 10;
var a = new l();
a.id = "angry";
a.icon = "iconMoodAngry";
this.add(a);
this.t.baseStats.mod_speed = 10;
this.t.baseStats.mod_diplomacy = -30;
this.t.baseStats.mod_attackSpeed = 10;
this.t.baseStats.loyalty_mood = -15;
this.t.baseStats.opinion = -15;
var r = new l();
r.id = "dark";
this.add(r);
this.t.baseStats.loyalty_mood = -20;
this.t.baseStats.opinion = -20;
};
return e;
}(s.default);
i.default = c;
cc._RF.pop();
}, {
"../../base/BaseStats": "BaseStats",
"../../texture/TextureLoader": "TextureLoader",
"../AssetLibrary": "AssetLibrary"
} ],
MoveCamera: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "85ebbTycc1Jn4M83wZoZb7o", "MoveCamera");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
}), r = this && this.__decorate || function(t, e, i, o) {
var a, r = arguments.length, n = r < 3 ? e : null === o ? o = Object.getOwnPropertyDescriptor(e, i) : o;
if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) n = Reflect.decorate(t, e, i, o); else for (var s = t.length - 1; s >= 0; s--) (a = t[s]) && (n = (r < 3 ? a(n) : r > 3 ? a(e, i, n) : a(e, i)) || n);
return r > 3 && n && Object.defineProperty(e, i, n), n;
};
Object.defineProperty(i, "__esModule", {
value: !0
});
i.MoveCamera = void 0;
var n = t("../MapBox"), s = t("../../../../framework/lib/prototype/MathUtils"), l = t("../../../../framework/manager/AudioMgr"), c = t("../../../../framework/utils/iTween"), u = t("../../../common/src/GameCommon"), d = t("../Config"), h = t("../game/guide/GuideController"), p = t("../ui/power/PowerButtonSelector"), f = t("../ui/tip/WorldTip"), m = cc._decorator, y = m.ccclass, _ = m.property, g = function(t) {
a(e, t);
function e() {
var e = null !== t && t.apply(this, arguments) || this;
e.camera = null;
e.minZoomRatio = 1;
e.maxZoomRatio = 22;
e.targetZoom = 1;
e.fingerIncreaseRate = 1;
e.moveOffset = 2;
e.zoomDelta = .1;
e.followUnit = null;
e.locked = !1;
e.lockDrag_ = !1;
e.halfBounds_ = null;
e.touchTimer_ = 0;
e.isMoving_ = !1;
e.alreadyUsedZoom_ = !1;
e.mapTouchList = [];
e.focusZoom = -1e6;
e.focusUnitZoom = -1e6;
e.focusTimer = 0;
e.cameraZoomSpeed = 5;
e.cameraMoveSpeed = .01;
return e;
}
i = e;
Object.defineProperty(e.prototype, "lockDrag", {
get: function() {
return this.lockDrag_;
},
set: function(t) {
this.lockDrag_ = t;
},
enumerable: !1,
configurable: !0
});
Object.defineProperty(e.prototype, "halfBounds", {
set: function(t) {
this.halfBounds_ = t;
t && this.cameraToBounds();
},
enumerable: !1,
configurable: !0
});
Object.defineProperty(e.prototype, "touchTimer", {
get: function() {
return this.touchTimer_;
},
enumerable: !1,
configurable: !0
});
Object.defineProperty(e.prototype, "isMoving", {
get: function() {
return this.isMoving_;
},
enumerable: !1,
configurable: !0
});
Object.defineProperty(e.prototype, "alreadyUsedZoom", {
get: function() {
return this.alreadyUsedZoom_;
},
enumerable: !1,
configurable: !0
});
e.prototype.onLoad = function() {
i.inst = this;
};
e.prototype.start = function() {
this.node.on(cc.Node.EventType.TOUCH_START, this.onTouchStart, this);
this.node.on(cc.Node.EventType.TOUCH_MOVE, this.onTouchMove, this);
this.node.on(cc.Node.EventType.TOUCH_END, this.onTouchEnd, this);
this.node.on(cc.Node.EventType.TOUCH_CANCEL, this.onTouchCancel, this);
this.node.on(cc.Node.EventType.MOUSE_WHEEL, this.onMouseWheel, this);
this.node._touchListener.setSwallowTouches(!1);
this.resetZoom();
};
e.prototype.update = function(t) {
if (0 == this.mapTouchList.length) {
this.isMoving_ = !1;
this.touchTimer_ = 0;
} else 1 == this.mapTouchList.length && (this.touchTimer_ += t);
this.mapTouchList.length < 2 && (this.alreadyUsedZoom_ = !1);
};
e.prototype.centerCamera = function() {
this.resetZoom();
this.camera.node.position = cc.Vec3.ZERO;
};
e.prototype.focusOn = function(t) {
t = t.subSelf(cc.v3(n.default.width / 2, n.default.height / 2));
this.clearFocusUnit();
this.setCameraZoomRatio(18);
this.focusZoom = this.targetZoom;
this.camera.node.position = t;
};
e.prototype.focusOnAndFollow = function(t) {
this.clearFocusUnit();
this.setCameraZoomRatio(18);
this.focusZoom = this.targetZoom;
this.focusUnitZoom = this.targetZoom;
i.focusUnit = t;
this.focusTimer = 0;
f.default.addWordReplacement("$name$", i.focusUnit.coloredName);
f.default.inst.show("tip_following_unit", !0, "top");
p.PowerButtonSelector.inst.clickPowerButton(this.followUnit);
};
e.prototype.resetZoom = function() {
this.halfBounds = cc.v2(n.default.width / 2 + 10, n.default.height / 2 + 10);
this.setCameraZoomRatio(this.minZoomRatio);
};
e.prototype.setCameraZoomRatio = function(t) {
t = Math.max(this.minZoomRatio, t);
t = Math.min(this.maxZoomRatio, t);
if (h.default.inst.in(h.GUIDE_TYPE.novice, 1) && t >= 5) {
t = 13;
h.default.inst.do(h.GUIDE_TYPE.novice);
}
if (t != this.camera.zoomRatio) {
this.targetZoom = t;
this.camera.zoomRatio = t;
this.cameraToBounds();
var e = (t - this.minZoomRatio) / (this.maxZoomRatio - this.minZoomRatio);
l.default.setEffectVolume(e);
}
n.default.inst.zoomUpdated(t, this.maxZoomRatio);
};
e.prototype.onTouchStart = function(t) {
var e = this, i = t.getTouches();
1 == i.length && this.mapTouchList.clear();
i.forEach(function(t) {
0 === e.mapTouchList.filter(function(e) {
return e.id === t.getID();
}).length && (e.mapTouchList[e.mapTouchList.length] = {
id: t.getID(),
touch: t
});
});
};
e.prototype.onTouchMove = function(t) {
var e = this;
if (!this.locked) {
var i = t.getTouches();
i.forEach(function(t) {
0 === e.mapTouchList.filter(function(e) {
return e.id === t.getID();
}).length && (e.mapTouchList[e.mapTouchList.length] = {
id: t.getID(),
touch: t
});
});
i = this.mapTouchList.map(function(t) {
return t.touch;
});
if (!(h.default.inst.isType(h.GUIDE_TYPE.novice) && h.default.inst.step >= 2 && h.default.inst.step <= 9)) if (i.length >= 2) {
this.isMoving_ = !0;
this.alreadyUsedZoom_ = !0;
var o, a = i[0], r = i[1], n = cc.v2(a.getDelta()), s = cc.v2(r.getDelta()), l = cc.v2(a.getLocation()), c = cc.v2(r.getLocation()), u = l.sub(c), d = cc.v2(this.fingerIncreaseRate, this.fingerIncreaseRate), p = n.sub(s).scale(d);
o = Math.abs(u.x) > Math.abs(u.y) ? (u.x + p.x) / u.x : (u.y + p.y) / u.y;
this.setCameraZoomRatio(this.camera.zoomRatio * o);
} else if (1 === i.length && !this.lockDrag_ && (this.isMoving_ || this.canStartMove(i[0]))) {
this.isMoving_ = !0;
var f = cc.v2(i[0].getDelta()).div(this.camera.zoomRatio), m = cc.v3(this.camera.node.position).sub(cc.v3(f));
this.camera.node.position = m;
this.cameraToBounds();
}
}
};
e.prototype.onTouchEnd = function(t) {
this.locked || this.removeTouchFromContent(t, this.mapTouchList);
};
e.prototype.onTouchCancel = function(t) {
this.locked || this.removeTouchFromContent(t, this.mapTouchList);
};
e.prototype.onMouseWheel = function(t) {
if (!(this.locked || h.default.inst.isType(h.GUIDE_TYPE.novice) && h.default.inst.step >= 2 && h.default.inst.step <= 9)) {
var e = t.getScrollY(), i = this.camera.zoomRatio;
i *= 1 + Math.sign(e) * this.zoomDelta;
this.setCameraZoomRatio(i);
}
};
e.prototype.canStartMove = function(t) {
var e = t.getStartLocation(), i = t.getLocation();
return Math.abs(i.x - e.x) > this.moveOffset || Math.abs(i.y - e.y) > this.moveOffset;
};
e.prototype.removeTouchFromContent = function(t, e) {
for (var i = t.getTouches().map(function(t) {
return t.getID();
}), o = e.length - 1; o >= 0; --o) i.indexOf(e[o].id) > -1 && e.splice(o, 1);
};
e.prototype.followFocusUnit = function() {
var t, e, o, a, r;
if (i.focusUnit) if (null === (t = i.focusUnit.data) || void 0 === t ? void 0 : t.alive) if (this.isMoving || this.alreadyUsedZoom) this.focusTimer = 0; else {
var l = i.focusUnit.currentPosition.clone();
l.z = this.camera.node.z;
l = l.subSelf(cc.v3(n.default.width / 2, n.default.height / 2));
if (this.focusTimer <= 1) {
this.focusTimer += cc.director.getDeltaTime();
this.focusTimer = s.default.clamp(this.focusTimer, 0, 1);
l.x = c.default.easeOutCubic(this.camera.node.x, l.x, this.focusTimer);
l.y = c.default.easeOutCubic(this.camera.node.y, l.y, this.focusTimer);
}
this.camera.node.position = l;
} else if (i.focusUnit.attackedBy && (null === (o = null === (e = i.focusUnit) || void 0 === e ? void 0 : e.attackedBy) || void 0 === o ? void 0 : o.a)) {
f.default.addWordReplacement("$name$", i.focusUnit.coloredName);
f.default.addWordReplacement("$killer$", i.focusUnit.attackedBy.a.coloredName);
f.default.inst.show("tip_followed_unit_killed", !0, "top");
var u = null === (r = null === (a = i.focusUnit) || void 0 === a ? void 0 : a.attackedBy) || void 0 === r ? void 0 : r.a;
i.focusUnit.attackedBy = null;
i.focusUnit = u;
this.focusTimer = 0;
} else {
f.default.addWordReplacement("$name$", i.focusUnit.coloredName);
f.default.inst.show("tip_followed_unit_died", !0, "top");
this.clearFocusUnit();
}
};
e.prototype.clearFocus = function() {
this.focusZoom = -1e6;
};
e.prototype.clearFocusUnit = function() {
this.focusUnitZoom = -1e6;
i.focusUnit = null;
this.focusTimer = 0;
p.PowerButtonSelector.inst.isPowerSelected("follow_unit") && p.PowerButtonSelector.inst.unselectAll();
};
e.prototype.lateUpdate = function() {
if (!u.default.isPaused) {
this.targetZoom != this.camera.zoomRatio && this.zoomToBounds();
d.default.spectatorMode() && this.followFocusUnit();
}
};
e.prototype.zoomToBounds = function() {
this.targetZoom = s.default.clamp(this.targetZoom, 10, this.maxZoomRatio);
if (this.camera.zoomRatio != this.targetZoom) {
if (this.targetZoom > this.camera.zoomRatio) {
this.camera.zoomRatio += cc.director.getDeltaTime() * this.cameraZoomSpeed * (Math.abs(this.camera.zoomRatio - this.targetZoom) + 5);
this.camera.zoomRatio > this.targetZoom && (this.camera.zoomRatio = s.default.clamp(this.targetZoom, 10, this.maxZoomRatio));
} else if (this.targetZoom < this.camera.zoomRatio) {
this.camera.zoomRatio -= cc.director.getDeltaTime() * this.cameraZoomSpeed * (Math.abs(this.camera.zoomRatio - this.targetZoom) + 5);
this.camera.zoomRatio < this.targetZoom && (this.camera.zoomRatio = s.default.clamp(this.targetZoom, 10, this.maxZoomRatio));
}
n.default.inst.zoomUpdated(this.camera.zoomRatio, this.maxZoomRatio);
}
};
e.prototype.cameraToBounds = function() {
if (this.halfBounds_) {
var t = this.halfBounds_.x, e = this.halfBounds_.y;
this.camera.node.x > t ? this.camera.node.x = t : this.camera.node.x < -t && (this.camera.node.x = -t);
this.camera.node.y > e ? this.camera.node.y = e : this.camera.node.y < -e && (this.camera.node.y = -e);
}
};
var i;
e.inst = null;
e.focusUnit = null;
r([ _({
type: cc.Camera,
tooltip: "要被操作的Camera节点"
}) ], e.prototype, "camera", void 0);
r([ _({
tooltip: "控制缩小得时候，能缩到多小，数值越小，缩得越小"
}) ], e.prototype, "minZoomRatio", void 0);
r([ _({
tooltip: "控制放大的时候，能放大到多大，数值越大，相机能拉得越近"
}) ], e.prototype, "maxZoomRatio", void 0);
r([ _({
displayName: "双指缩放速率",
max: 10,
min: .001,
tooltip: "双指缩放速率"
}) ], e.prototype, "fingerIncreaseRate", void 0);
r([ _({
tooltip: "单点触摸容忍误差"
}) ], e.prototype, "moveOffset", void 0);
r([ _({
tooltip: "zoomDelta"
}) ], e.prototype, "zoomDelta", void 0);
return i = r([ y ], e);
}(cc.Component);
i.MoveCamera = g;
cc._RF.pop();
}, {
"../../../../framework/lib/prototype/MathUtils": void 0,
"../../../../framework/manager/AudioMgr": void 0,
"../../../../framework/utils/iTween": void 0,
"../../../common/src/GameCommon": void 0,
"../Config": "Config",
"../MapBox": "MapBox",
"../game/guide/GuideController": "GuideController",
"../ui/power/PowerButtonSelector": "PowerButtonSelector",
"../ui/tip/WorldTip": "WorldTip"
} ],
MysteryButton: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "ca6b8JUusFIZotihI3HbHez", "MysteryButton");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
}), r = this && this.__decorate || function(t, e, i, o) {
var a, r = arguments.length, n = r < 3 ? e : null === o ? o = Object.getOwnPropertyDescriptor(e, i) : o;
if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) n = Reflect.decorate(t, e, i, o); else for (var s = t.length - 1; s >= 0; s--) (a = t[s]) && (n = (r < 3 ? a(n) : r > 3 ? a(e, i, n) : a(e, i)) || n);
return r > 3 && n && Object.defineProperty(e, i, n), n;
};
Object.defineProperty(i, "__esModule", {
value: !0
});
var n = t("../../../../../../framework/lib/prototype/MathUtils"), s = t("../../../../../common/src/advert/sdk/GameTdd"), l = t("../../../common/GameUtils"), c = t("../../guide/GuideController"), u = cc._decorator, d = u.ccclass, h = u.property, p = function(t) {
a(e, t);
function e() {
var e = null !== t && t.apply(this, arguments) || this;
e.btn = null;
e._move = !1;
return e;
}
i = e;
Object.defineProperty(e.prototype, "move", {
set: function(t) {
this._move = t;
},
enumerable: !1,
configurable: !0
});
e.prototype.onLoad = function() {
i.inst = this;
};
e.prototype.start = function() {
this.reset();
};
e.prototype.reset = function(t) {
var e = this;
void 0 === t && (t = !1);
t || this.hide();
var i = s.default.getData("p4", s.v_type.Number), o = JSB_233 && null != i ? i : n.default.randomRange(120, 300);
setTimeout(function() {
l.default.allowPopUi() ? e.move = !0 : e.reset(!0);
}, 1e3 * (t ? 5 : o));
};
e.prototype.hide = function() {
this._move = !1;
this.node.x = -cc.winSize.width / 2 - this.node.width;
this.node.y = cc.winSize.height / 2 * .6;
};
e.prototype.update = function() {
var t = this._move && l.default.allowPopUi();
this.btn.interactable = t || c.default.inst.in(c.GUIDE_TYPE.mystery, 0);
this.node.opacity = t || c.default.inst.in(c.GUIDE_TYPE.mystery, 0) ? 255 : 0;
if (t) {
this.node.x += .5;
if (this.node.x > cc.winSize.width / 2 + this.node.width) {
this.move = !1;
this.reset();
}
}
};
var i;
e.inst = null;
r([ h(cc.Button) ], e.prototype, "btn", void 0);
return i = r([ d ], e);
}(cc.Component);
i.default = p;
cc._RF.pop();
}, {
"../../../../../../framework/lib/prototype/MathUtils": void 0,
"../../../../../common/src/advert/sdk/GameTdd": void 0,
"../../../common/GameUtils": "GameUtils",
"../../guide/GuideController": "GuideController"
} ],
MysteryReward: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "ae5a4A6NQVJLrHQWSk3ePzE", "MysteryReward");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
}), r = this && this.__decorate || function(t, e, i, o) {
var a, r = arguments.length, n = r < 3 ? e : null === o ? o = Object.getOwnPropertyDescriptor(e, i) : o;
if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) n = Reflect.decorate(t, e, i, o); else for (var s = t.length - 1; s >= 0; s--) (a = t[s]) && (n = (r < 3 ? a(n) : r > 3 ? a(e, i, n) : a(e, i)) || n);
return r > 3 && n && Object.defineProperty(e, i, n), n;
};
Object.defineProperty(i, "__esModule", {
value: !0
});
var n = t("../../../../../../framework/main/Constants"), s = t("../../../../../common/src/advert/AdsManager"), l = t("../../../../../common/src/advert/sdk/GameTdd"), c = t("../../../../../common/src/data/RewardData"), u = t("../../../../../common/src/data/UserData"), d = t("../../../../../common/src/GamePopBase"), h = t("../../../../../common/src/MsgCache"), p = t("../../../common/ToolBox"), f = t("../../../common/ViewController"), m = t("../../../texture/TextureLoader"), y = t("./MysteryButton"), _ = cc._decorator, g = _.ccclass, v = _.property, b = function(t) {
a(e, t);
function e() {
var e = null !== t && t.apply(this, arguments) || this;
e.rewardID = 3;
e.btnText = null;
e.video = null;
e.rewards = [];
e.data = [];
return e;
}
e.prototype.onLoad = function() {
n.default.MODE == n.MODE_TYPE.LOCK ? this.video.active = !0 : this.video.active = Math.random() < .7;
this.video.active || (this.btnText.x = 0);
this.rewards.forEach(function(t) {
t.active = !1;
});
};
e.prototype.clickClose = function(t) {
var e = l.default.getData("p4", l.v_type.Number);
n.default.MODE == n.MODE_TYPE.LOCK && null != e && p.Toolbox.randomRate(e / 100) ? f.default.open(f.view_type.BoxMonster) : this.close(t);
};
e.prototype.start = function() {
this.showReward();
};
e.prototype.onDestroy = function() {
y.default.inst.reset();
};
e.prototype.showReward = function() {
this.data = n.default.MODE == n.MODE_TYPE.LOCK ? c.default.getLockPropConfig(3) : c.default.getRewards(this.rewardID);
for (var t = 0; t < this.data.length; t++) {
this.rewards[t].active = !0;
this.rewards[t].getChildByName("name").getComponent(cc.Label).string = this.data[t].propName;
var e = this.rewards[t].getChildByName("rare");
e.active = this.data[t].rare >= 0 && n.default.MODE != n.MODE_TYPE.LOCK;
var i = m.TextureLoader.inst.getSpriteFrame(m.ATLAS_TYPE.UIATLAS, "reward/rare_" + this.data[t].rare);
i && (e.getComponent(cc.Sprite).spriteFrame = i);
var o = this.rewards[t].getChildByName("icon"), a = m.TextureLoader.inst.getSpriteFrame(m.ATLAS_TYPE.UIATLAS, "propIcon/icon" + this.data[t].propID);
a && (o.getComponent(cc.Sprite).spriteFrame = a);
var r = this.rewards[t].getChildByName("num");
r.getComponent(cc.Label).string = this.data[t].number.toString();
r.active = 1002 == this.data[t].propID;
var s = u.default.getPropByID(this.data[t].propID);
if (!s) return;
n.default.MODE == n.MODE_TYPE.COUNT ? r.active = !0 : n.default.MODE == n.MODE_TYPE.ALL && (s.lock || (r.active = !0));
}
};
e.prototype.geteReward = function(t) {
var e = this, i = t.getCurrentTarget().getComponent(cc.Button);
if (this.video.active) {
n.default.REPORT_ID = "mystery";
s.default.showVideoAds(function(t) {
if (1 == t) e.doReward(i); else {
var o = 0 == t ? "视频播放未完成。" : "视频播放失败，请稍候再试！";
h.default.pushToast(o);
}
});
} else this.doReward(i);
};
e.prototype.doReward = function(t) {
for (var e = 0; e < this.data.length; e++) {
var i = u.default.getPropByID(this.data[e].propID);
i && (n.default.MODE == n.MODE_TYPE.LOCK ? i.lock = !1 : n.default.MODE == n.MODE_TYPE.ALL && i.lock ? i.lock = !1 : i.number += this.data[e].number);
}
u.default.member.mysteryNum++;
u.default.save();
t.interactable = !1;
h.default.pushToast("恭喜你，领取奖励成功！");
};
r([ v ], e.prototype, "rewardID", void 0);
r([ v(cc.Node) ], e.prototype, "btnText", void 0);
r([ v(cc.Node) ], e.prototype, "video", void 0);
r([ v([ cc.Node ]) ], e.prototype, "rewards", void 0);
return r([ g ], e);
}(d.GamePopBase);
i.default = b;
cc._RF.pop();
}, {
"../../../../../../framework/main/Constants": void 0,
"../../../../../common/src/GamePopBase": void 0,
"../../../../../common/src/MsgCache": void 0,
"../../../../../common/src/advert/AdsManager": void 0,
"../../../../../common/src/advert/sdk/GameTdd": void 0,
"../../../../../common/src/data/RewardData": void 0,
"../../../../../common/src/data/UserData": void 0,
"../../../common/ToolBox": "ToolBox",
"../../../common/ViewController": "ViewController",
"../../../texture/TextureLoader": "TextureLoader",
"./MysteryButton": "MysteryButton"
} ],
NameGeneratorLibrary: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "96d5cVI/StM64mSoB0KSGWj", "NameGeneratorLibrary");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
});
Object.defineProperty(i, "__esModule", {
value: !0
});
i.NameGeneratorAsset = void 0;
var r = t("../../../../../framework/utils/Tools"), n = t("../AssetLibrary"), s = function(t) {
a(e, t);
function e() {
var e = null !== t && t.apply(this, arguments) || this;
e.special1 = [];
e.special2 = [];
e.vowels = [];
e.consonants = [];
e.parts = [];
e.addition_start = [];
e.addition_ending = [];
e.part_groups = [];
e.templates = [];
e.max_vowels_in_row = 1;
e.max_consonanats_in_row = 1;
e.add_addition_chance = .5;
return e;
}
e.vowels_all = [ "a", "e", "i", "o", "u", "y" ];
e.consonants_all = [ "b", "c", "d", "f", "g", "h", "j", "k", "l", "m", "n", "p", "q", "r", "s", "t", "v", "w", "x", "z" ];
return e;
}(n.Asset);
i.NameGeneratorAsset = s;
var l = function(t) {
a(e, t);
function e() {
return null !== t && t.apply(this, arguments) || this;
}
e.prototype.init = function() {
t.prototype.init.call(this);
var e = new s();
e.id = "human_name";
e.vowels = [ "a", "e", "i", "o", "u", "y" ];
e.consonants = [ "b", "c", "d", "g", "h", "ph", "ch", "k", "l", "m", "n", "p", "r", "s", "t", "v", "w", "sh" ];
this.add(e);
this.t.templates.push("Letters#3-8");
this.clone("human_city", "human_name");
this.t.parts = [ "ork", "ah", "ois", "nsin", "ona", "ina", "insk", "ovo", "va", "od", "irsk", "wa", "owo", "irk", "ow", "es", "go", "on", "owa", "dran", "drun", "be", "ka", "ama", "kyo", "ro", "poro", "to" ];
this.t.templates.push("Letters#2-5,part");
this.clone("human_kingdom", "human_name");
this.t.add_addition_chance = .5;
this.t.addition_start = [ "Great", "Holy", "Realm of the", "The" ];
this.t.addition_ending = [ "Empire", "Hegemony", "Kingdom", "Imperium", "of Sun", "of Moon", "Dynasty" ];
this.t.templates.push("addition_start,Letters#2-7,addition_ending");
var i = new s();
i.id = "orc_name";
i.vowels = [ "a", "e", "o" ];
i.consonants = [ "d", "g", "k", "n", "p", "r", "t", "z" ];
i.parts = [ "igh", "ord", "uz", "duz", "rid", "ogh", "agh", "okh", "uh", "dzz", "ez", "az", "oz", "top", "urg" ];
this.add(i);
this.t.templates.push("Letters#3-7");
this.t.templates.push("Part");
this.t.templates.push("Part,part");
this.t.templates.push("Part,space,Part");
this.clone("orc_city", "orc_name");
this.t.templates.push("Part,space,Part");
this.t.templates.push("consonant,letters#3-5");
this.t.templates.push("consonant,letters#3-5,part");
this.t.templates.push("consonant,letters#1-3,space,CONSONANT,letters#2-3");
this.clone("orc_kingdom", "orc_name");
this.t.add_addition_chance = .5;
this.t.addition_start = [ "Bloody", "Clan of", "Axe of", "The", "Blood of", "Bad", "Strong", "Tall", "Red", "Green" ];
this.t.addition_ending = [ "Fighters", "Gang", "Band", "of Death", "Axes", "Clan", "Brothers", "Warriors", "Boyz", "Horde" ];
this.t.templates.push("addition_start,CONSONANT,letters#3-5,part,addition_ending");
this.t.templates.push("addition_start,Part,addition_ending");
this.t.templates.push("addition_start,Part,part,addition_ending");
this.t.templates.push("addition_start,Part,space,Part,addition_ending");
this.t.templates.push("addition_start,CONSONANT,letters#1-3,space,CONSONANT,letters#2-3,addition_ending");
var o = new s();
o.id = "dwarf_name";
o.vowels = [ "a", "e", "o" ];
o.special1 = [ "Dhun", "Dum", "Gor", "Ber", "Ger", "Kog", "Gul", "Ther", "Thor", "Von", "Gil", "Ver", "Vagh", "Gigh", "Deg", "Dig", "Bam", "Von", "Han", "Dhir", "Mugh", "Mul", "Gorn", "Gan", "Bol", "Gal" ];
o.consonants = [ "b", "d", "g", "h", "k", "m", "n", "p", "r", "s", "t" ];
o.parts = [ "ahl", "uhm", "ril", "til", "rim", "dum", "al", "or", "uhr", "ihr", "or" ];
o.max_consonanats_in_row = 1;
o.max_vowels_in_row = 1;
this.add(o);
this.t.templates.push("special1,space,Letters#2-4,part");
this.t.templates.push("special1,space,Letters#2-4,part");
this.t.templates.push("Letters#1-4,part");
this.t.templates.push("Letters#1-4,part");
this.clone("dwarf_city", "dwarf_name");
this.t.templates.push("special1,space,Letters#2-4,part");
this.t.templates.push("letters#2-4,part");
this.t.templates.push("letters#2-4,part");
this.clone("dwarf_kingdom", "dwarf_name");
this.t.add_addition_chance = .5;
this.t.addition_start = [ "Miners of", "Great", "Rocky", "Spears of", "Ancient" ];
this.t.addition_ending = [ "Stones", "Rocks", "Boulders", "Mountain", "Mountains", "Miners", "Kingdom", "Shields", "Picks", "Drunks" ];
this.t.templates.push("addition_start,special1,space,Letters#1-4,part,addition_ending");
this.t.templates.push("addition_start,Letters#1-4,part,addition_ending");
this.t.templates.push("addition_start,Letters#1-4,part,addition_ending");
this.t.templates.push("addition_start,Letters#1-4,part,addition_ending");
var a = new s();
a.id = "elf_name";
a.vowels = [ "a", "e", "o" ];
a.consonants = [ "c", "d", "f", "h", "l", "m", "n", "r", "s", "t" ];
a.special1 = [ "Ylh", "Emy", "Ny", "Ly", "If", "Se", "Am", "Yaa", "Omy", "Na", "Yg", "Yd", "Eo", "Yo", "O", "A" ];
a.special2 = [ "A'", "E'", "O'" ];
a.parts = [ "ua", "ra", "on", "ad", "nor", "ne", "hel", "on", "hil", "ore", "ora", "ona", "era", "eas", "ari", "adi", "ona" ];
a.max_consonanats_in_row = 1;
a.max_vowels_in_row = 1;
this.add(a);
this.t.templates.push("special1,letters#1-4,part");
this.t.templates.push("special2,Letters#1-4,part");
this.t.templates.push("letters#1-4,part");
this.t.templates.push("letters#1-4,part");
this.clone("elf_city", "elf_name");
this.t.templates.push("special1,letters#1-4,part");
this.t.templates.push("special2,Letters#1-4,part");
this.t.templates.push("special1,letters#1-4,space,Letters#1-3,part");
this.t.templates.push("letters#1-4,part");
this.t.templates.push("letters#1-4,part");
this.clone("elf_kingdom", "elf_name");
this.t.add_addition_chance = .5;
this.t.addition_start = [ "Great", "Green", "Arrows of", "Spears of", "Ancient", "Royal" ];
this.t.addition_ending = [ "Keepers", "Forest", "Children", "Brothers", "of Fire", "of Rain", "of Earth", "Kingdom", "Lands" ];
this.t.templates.push("addition_start,special1,letters#1-4,part,addition_ending");
this.t.templates.push("addition_start,special2,Letters#1-4,part,addition_ending");
this.t.templates.push("addition_start,special1,letters#1-4,space,Letters#1-3,part,addition_ending");
this.t.templates.push("addition_start,Letters#1-4,part,addition_ending");
this.t.templates.push("addition_start,Letters#1-4,part,addition_ending");
var r = new s();
r.id = "sheep_name";
this.add(r);
this.t.part_groups.push("b");
this.t.part_groups.push("a,aa,aaa,o,oo,ooo,y,yy,yyy");
this.t.part_groups.push("h");
this.t.templates.push("part_group");
var n = new s();
n.id = "penguin_name";
this.add(n);
this.t.part_groups.push("h,w,d,t");
this.t.part_groups.push("u,uu,uuu,a,aa,aaa");
this.t.part_groups.push("g,gg,d,r,z");
this.t.part_groups.push("o,oo,ooo,a,aa,aaa");
this.t.templates.push("part_group");
var l = new s();
l.id = "wolf_name";
this.add(l);
this.t.part_groups.push("w");
this.t.part_groups.push("o,oo,oo,a,aa,aaa");
this.t.part_groups.push("f");
this.t.templates.push("part_group");
var c = new s();
c.id = "greg";
this.add(c);
this.t.part_groups.push("Greg,Gregis,Gregim,Greges,Gregef,Gregonk,Gregos,Gregaz");
this.t.templates.push("part_group");
var u = new s();
u.id = "chicken_name";
this.add(u);
this.t.part_groups.push("k,g,d,b,ka,ko,go,keke,koko");
this.t.part_groups.push("o,a,a");
this.t.templates.push("part_group");
this.t.templates.push("part_group,part_group");
this.t.templates.push("part_group,space,Part_group");
this.t.templates.push("part_group,part_group");
this.t.templates.push("part_group,space,Part_group,space,Part_group");
this.t.templates.push("part_group,space,Part_group");
var d = new s();
d.id = "cow_name";
d.parts = [ "moo", "oom", "mi" ];
this.add(d);
this.t.part_groups.push("m,l,d,b,mad,daa,moo");
this.t.part_groups.push("i,o,a,y");
this.t.part_groups.push("d,m");
this.t.templates.push("part_group");
this.t.templates.push("Part,space,Part_group");
this.t.templates.push("part_group,space,Part");
this.t.templates.push("part_group,space,Part_group");
this.t.templates.push("part_group,part_group");
this.t.templates.push("part,part_group");
var h = new s();
h.id = "default_name";
this.add(h);
this.t.part_groups.push("ma,ar,a,e,i,b,c");
this.t.part_groups.push("v,m,n,k,rk,x,rt");
this.t.part_groups.push("o,s,a,y,e,i");
this.t.part_groups.push("m,n,a,d");
this.t.templates.push("part_group");
var p = new s();
p.id = "evil_mage_name";
p.vowels = [ "a", "e", "i", "o", "u", "y" ];
p.consonants = [ "b", "c", "d", "g", "h", "ph", "ch", "k", "l", "m", "n", "p", "r", "s", "t", "v", "w", "sh" ];
p.parts = [ "fez", "soh", "doroz", "uru", "hazah", "drah", "wazah", "mah" ];
this.add(p);
this.t.addition_start = [ "Great", "Awe", "Bro", "Lo", "Le", "Blo", "Mago", "Evol", "Fir", "Smol", "Dro" ];
this.t.templates.push("addition_start,Letters#2-6,part");
};
e.prototype.clone = function(t, e) {
var i = JSON.parse(JSON.stringify(this.get(e))), o = r.default.fromJson(i, new s());
o.id = t;
this.add(o);
return o;
};
return e;
}(n.default);
i.default = l;
cc._RF.pop();
}, {
"../../../../../framework/utils/Tools": void 0,
"../AssetLibrary": "AssetLibrary"
} ],
NameGenerator: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "59237GTu9tF7oGyLHpDGX6P", "NameGenerator");
Object.defineProperty(i, "__esModule", {
value: !0
});
var o = t("../../actors/ActorStatus"), a = t("../../common/ToolBox"), r = function() {
function t() {}
t.init = function() {
if (!t.initiated) {
t.initiated = !0;
t.loadProfanityFilter();
}
};
t.loadProfanityFilter = function() {
t.profanity && t.profanity.size;
};
t.getName = function(e, i) {
void 0 === i && (i = o.ActorGender.Male);
var r = 4, n = a.Toolbox.randomInt(0, 100);
n < 30 ? r = 2 : n < 70 && (r = 3);
for (var s = "", l = Array.from(t.nameWords), c = 0; c < r; c++) {
for (var u = l.getRandom(); s.indexOf(u) > 0; ) u = l.getRandom();
s += u;
}
return s;
};
t.nameWords = "玛奎塔埃迪卢克雷蒂娅吉福朱莉安谢菲尔德达西尼亚恩斯特凯文妮洛蕾哈娜马莫卡费利诺基米艾奇俄萨布罗于里乌穆力山大皮帕可薇瑞纳拉巴伦鲁杰茜厄迈莱若勒查多因伊索贝列娃当焦万丽丝爱奥桑莎伯兰苏呐李加珊姗赫曼芙夫琳休绮罕默戴维芭白璧姆档博阿泽蒙科泰托赞明戈欧内黛赖温让翠齐修简森立普赛贾雪儿乐弗林扎汉南瓦提雅姿敏希何海纽格度茵塞丹柔依印第珥登露匹柯商沃乔古蒽房美歌汀佩思单波辛金洁康坦丁仑弥迦堪盖梅典席梦朗琼沙茱霍润缇治撒非喇库替约翰翁邦瑟珀涅耐桃碧比胡泊蕊日舍夏霞威根朵奈门兹察那尤太萝摩本蜜珍纪覃切历诗代蓝蔡资宁劳芬以詹逖帝裘英麦谬望方肖狄亦果唯耳忒高顿朴礼佛黑崔佐道范暂无荔廉谭采都史额坎姬凡婕逊芝亨理圣各法所司旺隆吕母路易从彼得烈拜缪唐琪潘东汤淇什甘鹃华棉甸迭珂刘班彬澳派玻龙倍";
t.curConsonants = 0;
t.curVowels = 0;
t.vowels_all = [ "a", "e", "i", "o", "u", "y" ];
t.consonants_all = [ "b", "c", "d", "f", "g", "h", "j", "k", "l", "m", "n", "p", "q", "r", "s", "t", "v", "w", "x", "z" ];
t.profanity = new Map();
t.initiated = !1;
return t;
}();
i.default = r;
cc._RF.pop();
}, {
"../../actors/ActorStatus": "ActorStatus",
"../../common/ToolBox": "ToolBox"
} ],
NapalmFlash: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "6b177YV5ENH4LRkUnDlmp8V", "NapalmFlash");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
}), r = this && this.__decorate || function(t, e, i, o) {
var a, r = arguments.length, n = r < 3 ? e : null === o ? o = Object.getOwnPropertyDescriptor(e, i) : o;
if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) n = Reflect.decorate(t, e, i, o); else for (var s = t.length - 1; s >= 0; s--) (a = t[s]) && (n = (r < 3 ? a(n) : r > 3 ? a(e, i, n) : a(e, i)) || n);
return r > 3 && n && Object.defineProperty(e, i, n), n;
};
Object.defineProperty(i, "__esModule", {
value: !0
});
var n = t("../assetLibrary/AssetManager"), s = t("../base/BaseEffect"), l = t("../brush/Brush"), c = t("../MapBox"), u = cc._decorator, d = u.ccclass, h = (u.property, 
function(t) {
a(e, t);
function e() {
var e = null !== t && t.apply(this, arguments) || this;
e.killing = !1;
e.bombSpawned = !1;
e.bomb = "";
e.godPower = null;
return e;
}
e.prototype.spawnFlash = function(t, e) {
this.tile = t;
this.godPower = n.default.powers.get(e);
this.bombSpawned = !1;
this.bomb = e;
this.killing = !1;
this.prepare(t, .1);
};
e.prototype.logicUpdate = function() {
if (this.node.scaleX < 1 && !this.killing) {
var t = this.node.scale;
if ((t += .7 * c.default.inst.elapsed) >= .6 && !this.bombSpawned) {
this.bombSpawned = !0;
c.default.inst.drawWithBrush(this.tile.pos, l.default.getBrushBySize(12), 0, "napalm", null, this.godPower);
}
if (t >= .7) {
t = .7;
this.killing = !0;
}
this.node.scale = t;
} else if (this.killing) {
var e = this.node.scaleX;
if ((e -= 1.5 * c.default.inst.elapsed) <= 0) {
e = 0;
this.kill();
}
this.node.scaleX = e;
}
};
return r([ d ], e);
}(s.default));
i.default = h;
cc._RF.pop();
}, {
"../MapBox": "MapBox",
"../assetLibrary/AssetManager": "AssetManager",
"../base/BaseEffect": "BaseEffect",
"../brush/Brush": "Brush"
} ],
NukeFlash: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "29dc9ub16dDbqjILcbishvv", "NukeFlash");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
}), r = this && this.__decorate || function(t, e, i, o) {
var a, r = arguments.length, n = r < 3 ? e : null === o ? o = Object.getOwnPropertyDescriptor(e, i) : o;
if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) n = Reflect.decorate(t, e, i, o); else for (var s = t.length - 1; s >= 0; s--) (a = t[s]) && (n = (r < 3 ? a(n) : r > 3 ? a(e, i, n) : a(e, i)) || n);
return r > 3 && n && Object.defineProperty(e, i, n), n;
};
Object.defineProperty(i, "__esModule", {
value: !0
});
var n = t("../actors/ActorStatus"), s = t("../assetLibrary/AssetManager"), l = t("../base/BaseEffect"), c = t("../Config"), u = t("../MapBox"), d = cc._decorator, h = d.ccclass, p = (d.property, 
function(t) {
a(e, t);
function e() {
var e = null !== t && t.apply(this, arguments) || this;
e.killing = !1;
e.bombSpawned = !1;
e.bomb = "";
e.godPower = null;
return e;
}
e.prototype.spawnFlash = function(t, e) {
this.tile = t;
this.godPower = s.default.powers.get(e);
this.bombSpawned = !1;
this.bomb = e;
this.killing = !1;
this.prepare(t, .1);
};
e.prototype.logicUpdate = function() {
if (this.node.scaleX < 1 && !this.killing) {
c.default.greyGooDamaged = !1;
var t = this.node.scale;
if ((t += 2.5 * u.default.inst.elapsed) >= .8 && !this.bombSpawned) {
this.bombSpawned = !0;
if ("atomicBomb" == this.bomb) {
u.default.inst.damageWorld(this.tile, 30, s.default.terraform.get("bomb"), n.AttackType.Bomb);
u.default.inst.stackEffects.get("explosionNuke").spawnAtRandomScale(this.tile, .8, .9);
} else if ("czarBomba" == this.bomb) {
u.default.inst.damageWorld(this.tile, 70, s.default.terraform.get("bomb"), n.AttackType.Bomb);
u.default.inst.stackEffects.get("explosionNuke").spawnAtRandomScale(this.tile, 1.4, 1.6);
}
}
if (t >= 1) {
t = 1;
this.killing = !0;
}
this.node.scale = t;
} else if (this.killing) {
var e = this.node.scaleX;
if ((e -= 2.5 * u.default.inst.elapsed) <= 0) {
e = 0;
this.kill();
}
this.node.scaleX = e;
}
};
return r([ h ], e);
}(l.default));
i.default = p;
cc._RF.pop();
}, {
"../Config": "Config",
"../MapBox": "MapBox",
"../actors/ActorStatus": "ActorStatus",
"../assetLibrary/AssetManager": "AssetManager",
"../base/BaseEffect": "BaseEffect"
} ],
OnlineReward: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "13263RNItdNhLEqmwJd4nul", "OnlineReward");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
}), r = this && this.__decorate || function(t, e, i, o) {
var a, r = arguments.length, n = r < 3 ? e : null === o ? o = Object.getOwnPropertyDescriptor(e, i) : o;
if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) n = Reflect.decorate(t, e, i, o); else for (var s = t.length - 1; s >= 0; s--) (a = t[s]) && (n = (r < 3 ? a(n) : r > 3 ? a(e, i, n) : a(e, i)) || n);
return r > 3 && n && Object.defineProperty(e, i, n), n;
};
Object.defineProperty(i, "__esModule", {
value: !0
});
var n = t("../../../../../start/src/ShuFenReport"), s = t("../../../../common/src/data/UserData"), l = t("../../common/GameUtils"), c = cc._decorator, u = c.ccclass, d = c.property, h = function(t) {
a(e, t);
function e() {
var e = null !== t && t.apply(this, arguments) || this;
e.label = null;
e.dot = null;
e.rewardID = 2;
return e;
}
e.prototype.start = function() {
var t = s.default.member.onlineTime > 0 && cc.sys.now() - s.default.member.onlineTime > 18e5;
this.setText(t);
};
e.prototype.setText = function(t) {
var e = this;
this.node.stopAllActions();
if (t) {
this.label.string = "可领取";
if (!s.default.member.onlineGuided) {
var i = function() {
if (l.default.allowPopUi()) {
s.default.member.onlineGuided = !0;
s.default.save();
e.label.string;
} else setTimeout(i, 1e4);
};
i();
}
} else {
var o = 200;
this.label.string = "剩余" + o + "秒";
cc.tween(this.node).sequence(cc.delayTime(1), cc.callFunc(function() {
o--;
e.label.string = "剩余" + o + "秒";
})).repeat(200).call(function() {
e.setText(!0);
}).start();
}
this.setEnable(t);
};
e.prototype.setEnable = function(t) {
this.node.getComponent(cc.Button).interactable = t;
this.node.getChildByName("icon").getComponent(cc.Sprite).setMaterial(0, this.node.getComponent(cc.Sprite).getMaterial(0));
};
e.prototype.getReward = function() {
s.default.member.onlineTime = cc.sys.now();
s.default.save();
this.setText(!1);
n.default.reportCustom("online");
};
r([ d(cc.Label) ], e.prototype, "label", void 0);
r([ d(cc.Node) ], e.prototype, "dot", void 0);
r([ d ], e.prototype, "rewardID", void 0);
return r([ u ], e);
}(cc.Component);
i.default = h;
cc._RF.pop();
}, {
"../../../../../start/src/ShuFenReport": void 0,
"../../../../common/src/data/UserData": void 0,
"../../common/GameUtils": "GameUtils"
} ],
PathFindingVisualiser: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "f682fmohARJdLTI8gBzm4gi", "PathFindingVisualiser");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
}), r = this && this.__decorate || function(t, e, i, o) {
var a, r = arguments.length, n = r < 3 ? e : null === o ? o = Object.getOwnPropertyDescriptor(e, i) : o;
if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) n = Reflect.decorate(t, e, i, o); else for (var s = t.length - 1; s >= 0; s--) (a = t[s]) && (n = (r < 3 ? a(n) : r > 3 ? a(e, i, n) : a(e, i)) || n);
return r > 3 && n && Object.defineProperty(e, i, n), n;
};
Object.defineProperty(i, "__esModule", {
value: !0
});
var n = t("../../DebugConfig"), s = t("../../MapBox"), l = t("./MapLayer"), c = cc._decorator, u = c.ccclass, d = (c.property, 
function(t) {
a(e, t);
function e() {
var e = null !== t && t.apply(this, arguments) || this;
e.default_color = cc.color(255, .46 * 255, 48.45, 255);
e.tiles = [];
return e;
}
e.prototype.create = function() {
this.colorValues = this.default_color;
t.prototype.create.call(this);
};
e.prototype.updateDirty = function() {
n.default.LastPath ? this.node.active || (this.node.active = !0) : this.node.active && (this.node.active = !1);
};
e.prototype.clear = function() {
var t = this;
this.tiles.forEach(function(e) {
t.updateSinglePixel(e.data.tile_id, cc.Color.TRANSPARENT);
});
this.tiles.clear();
};
e.prototype.showPath = function(t, e) {
var i = this;
if (n.default.LastPath) {
this.clear();
t && s.default.inst.tilesList.forEach(function(e) {
i.tiles.push(e);
var o = t.getNodeAt(e.pos.x, e.pos.y);
o.isClosed ? i.updateSinglePixel(e.data.tile_id, cc.Color.RED) : o.isOpened ? i.updateSinglePixel(e.data.tile_id, cc.Color.GREEN) : i.updateSinglePixel(e.data.tile_id, cc.Color.TRANSPARENT);
});
e.forEach(function(t) {
i.updateSinglePixel(t.data.tile_id, cc.Color.BLUE);
i.tiles.push(t);
});
this.updatePixels();
}
};
return r([ u ], e);
}(l.default));
i.default = d;
cc._RF.pop();
}, {
"../../DebugConfig": "DebugConfig",
"../../MapBox": "MapBox",
"./MapLayer": "MapLayer"
} ],
PathfinderTools: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "2a10f+4t7xPP5n3Mmlh4cP+", "PathfinderTools");
var o = this && this.__values || function(t) {
var e = "function" == typeof Symbol && Symbol.iterator, i = e && t[e], o = 0;
if (i) return i.call(t);
if (t && "number" == typeof t.length) return {
next: function() {
t && o >= t.length && (t = void 0);
return {
value: t && t[o++],
done: !t
};
}
};
throw new TypeError(e ? "Object is not iterable." : "Symbol.iterator is not defined.");
};
Object.defineProperty(i, "__esModule", {
value: !0
});
var a = t("../../../../framework/lib/prototype/MathUtils"), r = t("../MapBox"), n = t("./ToolBox"), s = function() {
function t() {}
t.raycast = function(e, i) {
t.raycastResult.clear();
var o = .99 * n.Toolbox.distTile(e, i);
t.a.set(cc.v3(e.posV3.x, e.posV3.y, 0));
t.b.set(cc.v3(i.posV3.x, i.posV3.y, 0));
for (var s = null, l = 0; l <= o; l++) {
var c = cc.Vec3.ZERO;
cc.Vec3.lerp(c, t.a, t.b, l / o);
var u = a.default.intCast(c.x), d = a.default.intCast(c.y), h = r.default.inst.getTile(u, d);
if (h && (!s || h != s)) {
t.raycastResult.push(h);
s = h;
}
}
s != i && t.raycastResult.push(i);
return t.raycastResult;
};
t.tryToGetSimplePath = function(e, i, o, a, r) {
t.raycastResult.clear();
for (var s = e, l = 0, c = 0, u = null; ;) {
s.neighboursAll.forEach(function(t) {
l = n.Toolbox.distTile(t, i);
if (!u || l < c) {
u = t;
c = l;
}
});
if (!u || u == s) break;
s = u;
if (!r.block && s.type.block) return !1;
if (!r.lava && s.type.lava) return !1;
if (!r.water && s.type.water) return !1;
if (!r.ground && s.type.ground) return !1;
if (r.boat && !s.isGoodForBoat()) return !1;
t.raycastResult.push(u);
if (u == i) break;
u = null;
}
o.addRange(t.raycastResult);
return !0;
};
t.raycastTileForUnitToEmbark = function(e, i) {
var a, r, n = t.raycast(i, e), s = e.region.island;
try {
for (var l = o(n), c = l.next(); !c.done; c = l.next()) {
var u = c.value;
if (u.region.island == s) return u;
}
} catch (t) {
a = {
error: t
};
} finally {
try {
c && !c.done && (r = l.return) && r.call(l);
} finally {
if (a) throw a.error;
}
}
return null;
};
t.raycastTileForUnitLandingFromWater = function(e, i) {
var a, r, n = t.raycast(e, i), s = i.region.island;
try {
for (var l = o(n), c = l.next(); !c.done; c = l.next()) {
var u = c.value;
if (u.region.island == s) return u;
}
} catch (t) {
a = {
error: t
};
} finally {
try {
c && !c.done && (r = l.return) && r.call(l);
} finally {
if (a) throw a.error;
}
}
return null;
};
t.raycastResult = [];
t.a = cc.Vec3.ZERO;
t.b = cc.Vec3.ZERO;
return t;
}();
i.default = s;
cc._RF.pop();
}, {
"../../../../framework/lib/prototype/MathUtils": void 0,
"../MapBox": "MapBox",
"./ToolBox": "ToolBox"
} ],
PersonalityLibrary: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "18bd6bP+lhBOZYI51P1tOID", "PersonalityLibrary");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
});
Object.defineProperty(i, "__esModule", {
value: !0
});
i.PersonalityAsset = void 0;
var r = t("../../base/BaseStats"), n = t("../AssetLibrary"), s = function(t) {
a(e, t);
function e() {
var e = null !== t && t.apply(this, arguments) || this;
e.baseStats = new r.default();
e.icon = "";
e.sprite = null;
return e;
}
e.prototype.getSprite = function() {
this.sprite;
return this.sprite;
};
return e;
}(n.Asset);
i.PersonalityAsset = s;
var l = function(t) {
a(e, t);
function e() {
return null !== t && t.apply(this, arguments) || this;
}
e.prototype.init = function() {
t.prototype.init.call(this);
var e = new s();
e.id = "administrator";
this.add(e);
this.t.baseStats.personality_diplomatic = .1;
this.t.baseStats.personality_administration = .5;
this.t.baseStats.personality_aggression = .1;
var i = new s();
i.id = "militarist";
this.add(i);
this.t.baseStats.personality_diplomatic = .05;
this.t.baseStats.personality_administration = .1;
this.t.baseStats.personality_aggression = .5;
var o = new s();
o.id = "diplomat";
this.add(o);
this.t.baseStats.personality_diplomatic = .5;
this.t.baseStats.personality_aggression = .05;
this.t.baseStats.personality_administration = .2;
var a = new s();
a.id = "balanced";
this.add(a);
this.t.baseStats.personality_administration = .1;
this.t.baseStats.personality_diplomatic = .1;
this.t.baseStats.personality_aggression = .1;
var r = new s();
r.id = "wildcard";
this.add(r);
this.t.baseStats.personality_rationality = -1;
};
return e;
}(n.default);
i.default = l;
cc._RF.pop();
}, {
"../../base/BaseStats": "BaseStats",
"../AssetLibrary": "AssetLibrary"
} ],
PixelFlashEffects: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "d0f1dsAU3lCs6T594g9f8Wt", "PixelFlashEffects");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
}), r = this && this.__decorate || function(t, e, i, o) {
var a, r = arguments.length, n = r < 3 ? e : null === o ? o = Object.getOwnPropertyDescriptor(e, i) : o;
if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) n = Reflect.decorate(t, e, i, o); else for (var s = t.length - 1; s >= 0; s--) (a = t[s]) && (n = (r < 3 ? a(n) : r > 3 ? a(e, i, n) : a(e, i)) || n);
return r > 3 && n && Object.defineProperty(e, i, n), n;
};
Object.defineProperty(i, "__esModule", {
value: !0
});
i.ColorType = void 0;
var n, s = t("../common/ToolBox"), l = t("../map/layer/ConwayLife"), c = t("../map/map/MapLayer"), u = t("../map/tile/WorldTile");
(function(t) {
t[t.White = 0] = "White";
t[t.Purple = 1] = "Purple";
t[t.Blue = 2] = "Blue";
})(n = i.ColorType || (i.ColorType = {}));
var d = cc._decorator, h = d.ccclass, p = (d.property, function(t) {
a(e, t);
function e() {
var e = null !== t && t.apply(this, arguments) || this;
e.toRemove = [];
e.colorWhite = null;
e.colorPurple = null;
e.colorBlue = null;
e._timer = 0;
return e;
}
e.prototype.onLoad = function() {
this.colors_amount = 30;
this.colorValues = cc.color(255, 255, 255);
this.colorWhite = new u.ColorArray(cc.Color.WHITE, 30, .5);
this.colorPurple = new u.ColorArray(l.default.colorEater, 30);
this.colorBlue = new u.ColorArray(s.Toolbox.makeColor("#3BCC55"), 30);
t.prototype.create.call(this);
this.enabled = !0;
};
e.prototype.flashPixel = function(t, e, i) {
void 0 === e && (e = -1);
void 0 === i && (i = n.White);
-1 == e && (e = this.colors_amount - 1);
if (this.enabled) {
switch (i) {
case n.White:
t.colorArray = this.colorWhite;
break;

case n.Purple:
t.colorArray = this.colorPurple;
break;

case n.Blue:
t.colorArray = this.colorBlue;
}
t.flash_state <= 0 && this.pixels_to_update.add(t);
t.flash_state < e && (t.flash_state = e);
}
};
e.prototype.clear = function() {
t.prototype.clear.call(this);
this.pixels_to_update.clear();
};
e.prototype.updateDirty = function() {
var t = this;
if (this._timer > 0) this._timer -= cc.director.getDeltaTime(); else {
this._timer = .01;
if (!(this.pixels_to_update.length() <= 0)) {
this.toRemove.clear();
this.pixels_to_update.dict.forEach(function(e, i) {
if (i.flash_state < 0) t.toRemove.push(i); else {
t.updateSinglePixel(i.data.tile_id, i.colorArray.colors[i.flash_state]);
i.flash_state--;
}
});
this.toRemove.forEach(function(e) {
t.pixels_to_update.remove(e);
});
this.updatePixels();
}
}
};
return r([ h ], e);
}(c.default));
i.default = p;
cc._RF.pop();
}, {
"../common/ToolBox": "ToolBox",
"../map/layer/ConwayLife": "ConwayLife",
"../map/map/MapLayer": "MapLayer",
"../map/tile/WorldTile": "WorldTile"
} ],
PowerActionsModule: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "07dbeyMlTBGbrr0wc7dElh6", "PowerActionsModule");
var o = this && this.__values || function(t) {
var e = "function" == typeof Symbol && Symbol.iterator, i = e && t[e], o = 0;
if (i) return i.call(t);
if (t && "number" == typeof t.length) return {
next: function() {
t && o >= t.length && (t = void 0);
return {
value: t && t[o++],
done: !t
};
}
};
throw new TypeError(e ? "Object is not iterable." : "Symbol.iterator is not defined.");
};
Object.defineProperty(i, "__esModule", {
value: !0
});
var a = t("../../actors/other/boat/Boat"), r = t("../../brush/Brush"), n = t("../../common/ToolBox"), s = t("../../Config"), l = t("../../MapBox"), c = function() {
function t() {
this.magnetState = 0;
this.magnetLastPos = null;
this.units = [];
this.isPickup = !1;
}
t.prototype.magnetAction = function(t, e) {
var i, a;
void 0 === e && (e = null);
if (!t || 1 == this.magnetState || 3 == this.magnetState) {
e && (this.magnetLastPos = e);
this.updatePickedUnits();
if (e) {
l.default.inst.flashEffects.flashPixel(e, 10);
try {
for (var n = o(r.default.getBrushByID(s.default.currentBrush).pos), c = n.next(); !c.done; c = n.next()) {
var u = c.value, d = this.magnetLastPos.x + u.x, h = this.magnetLastPos.y + u.y;
if (!(d < 0 || d >= l.default.width || h < 0 || h >= l.default.height)) {
var p = l.default.inst.getTileSimple(d, h);
l.default.inst.flashEffects.flashPixel(p, 10);
}
}
} catch (t) {
i = {
error: t
};
} finally {
try {
c && !c.done && (a = n.return) && a.call(n);
} finally {
if (i) throw i.error;
}
}
}
switch (this.magnetState) {
case 0:
if (0 == l.default.inst.isKeyDownCode) {
this.magnetState = 1;
this.isPickup = !1;
}
break;

case 1:
if (!t && !this.isPickup) {
this.pickupUnits(e);
this.isPickup = !0;
console.log("pickupUnits");
}
if (-1 == l.default.inst.isKeyDownCode) {
this.magnetState = 2;
this.dropPickedUnits();
console.log("dropPickedUnits 1");
}
break;

case 2:
if (!t && 0 == l.default.inst.isKeyDownCode) {
this.dropPickedUnits();
console.log("dropPickedUnits 2");
this.magnetState = 0;
}
}
}
};
t.prototype.dropPickedUnits = function() {
var t, e;
try {
for (var i = o(this.units), a = i.next(); !a.done; a = i.next()) {
var r = a.value;
l.default.inst.units.add(r);
r.currentPosition = r.node.position;
r.currentPosition.y -= r.zPosition.y;
r.lastShadowPos.x = -1;
r._currentTileDirty = !0;
r.findCurrentTile();
r.spawnOn(r.currentTile, r.zPosition.y);
}
} catch (e) {
t = {
error: e
};
} finally {
try {
a && !a.done && (e = i.return) && e.call(i);
} finally {
if (t) throw t.error;
}
}
this.units.clear();
};
t.prototype.updatePickedUnits = function() {
var t, e, i;
if (this.magnetLastPos) try {
for (var a = o(this.units), r = a.next(); !r.done; r = a.next()) {
var s = r.value;
if (null === (i = null == s ? void 0 : s.data) || void 0 === i ? void 0 : i.alive) {
var l = n.Toolbox.randomFloat(7, 14), c = cc.v2(n.Toolbox.randomFloat(0, 2.1), n.Toolbox.randomFloat(0, 2.1)), u = this.magnetLastPos.posV3.clone();
u.x += c.x;
u.y = u.y + c.y + l;
s.zPosition.y = l;
s.currentPosition = cc.v3(u.x, u.y - s.zPosition.y);
s.node.position = u;
}
}
} catch (e) {
t = {
error: e
};
} finally {
try {
r && !r.done && (e = a.return) && e.call(a);
} finally {
if (t) throw t.error;
}
}
};
t.prototype.pickupUnits = function(t) {
var e, i, n, c, u, d, h, p;
try {
for (var f = o(r.default.getBrushByID(s.default.currentBrush).pos), m = f.next(); !m.done; m = f.next()) {
var y = m.value, _ = l.default.inst.getTile(y.x + t.x, y.y + t.y);
if (_) try {
for (var g = (n = void 0, o(_.units)), v = g.next(); !v.done; v = g.next()) {
var b = v.value;
if ((null === (u = b.stats) || void 0 === u ? void 0 : u.canBeMovedByPowers) && (null === (d = b.data) || void 0 === d ? void 0 : d.alive) && !b.isInsideSomething()) {
(null === (h = b.stats) || void 0 === h ? void 0 : h.isBoat) && b.getComponent(a.default).updateBoatAnim();
if (-1 == this.units.indexOf(b)) {
b.cancelAllBeh();
l.default.inst.units.remove(b);
this.units.push(b);
if (null === (p = b.actorAnimationData) || void 0 === p ? void 0 : p.walking) {
b.spriteAnimation.setFrames(b.actorAnimationData.walking.frames);
b.updateAnimation(.3, !0);
}
}
}
}
} catch (t) {
n = {
error: t
};
} finally {
try {
v && !v.done && (c = g.return) && c.call(g);
} finally {
if (n) throw n.error;
}
}
}
} catch (t) {
e = {
error: t
};
} finally {
try {
m && !m.done && (i = f.return) && i.call(f);
} finally {
if (e) throw e.error;
}
}
};
return t;
}();
i.default = c;
cc._RF.pop();
}, {
"../../Config": "Config",
"../../MapBox": "MapBox",
"../../actors/other/boat/Boat": "Boat",
"../../brush/Brush": "Brush",
"../../common/ToolBox": "ToolBox"
} ],
PowerButtonSelector: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "5f60a3GSRZNrb5oCaxehnQF", "PowerButtonSelector");
Object.defineProperty(i, "__esModule", {
value: !0
});
i.PowerButtonSelector = void 0;
var o = t("../../../../common/src/text/LocalizedTextManager"), a = t("../../Config"), r = t("./SelectedPowerNameTip"), n = t("../../common/MoveCamera"), s = t("../UiController"), l = function() {
function t() {
this.selectedButton = null;
}
t.prototype.setPower = function(t) {
this.selectedButton = t;
if (null == t ? void 0 : t.godPower) {
t.selected = !0;
n.MoveCamera.inst.lockDrag = t.godPower.holdAction;
}
};
t.prototype.unselectAll = function() {
n.MoveCamera.inst.lockDrag = !1;
if (this.selectedButton) {
this.selectedButton.unselectActivePower();
this.setPower(null);
}
a.default.controllableUnit && a.default.controllableUnit.killHimself(!0);
n.MoveCamera.focusUnit && (n.MoveCamera.focusUnit = null);
};
t.prototype.isPowerSelected = function(t) {
void 0 === t && (t = "");
return !(!this.selectedButton || t && this.selectedButton.godPower.id != t);
};
t.prototype.clickPowerButton = function(t) {
if (this.selectedButton != t) {
this.selectedButton && this.selectedButton.unselectActivePower();
this.setPower(t);
s.default.inst.showSelectTip(t);
o.LocalizedTextManager.contains(t.godPower.name) && r.SelectedPowerNameTip.inst.setText(t.godPower.name);
} else {
this.unselectAll();
s.default.inst.closeSelectTip();
}
};
t.inst = new t();
return t;
}();
i.PowerButtonSelector = l;
cc._RF.pop();
}, {
"../../../../common/src/text/LocalizedTextManager": void 0,
"../../Config": "Config",
"../../common/MoveCamera": "MoveCamera",
"../UiController": "UiController",
"./SelectedPowerNameTip": "SelectedPowerNameTip"
} ],
PowerButton: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "52effFbNhlHY7O1uT790k/G", "PowerButton");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
}), r = this && this.__decorate || function(t, e, i, o) {
var a, r = arguments.length, n = r < 3 ? e : null === o ? o = Object.getOwnPropertyDescriptor(e, i) : o;
if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) n = Reflect.decorate(t, e, i, o); else for (var s = t.length - 1; s >= 0; s--) (a = t[s]) && (n = (r < 3 ? a(n) : r > 3 ? a(e, i, n) : a(e, i)) || n);
return r > 3 && n && Object.defineProperty(e, i, n), n;
};
Object.defineProperty(i, "__esModule", {
value: !0
});
i.PowerButton = i.PowerButtonType = void 0;
var n, s = t("../../../../common/src/data/AchievData"), l = t("../../assetLibrary/AssetManager"), c = t("../../Config"), u = t("../UiController"), d = t("./GodPower"), h = t("./PowerButtonSelector"), p = t("./SelectedPowerNameTip");
(function(t) {
t[t.Library = 0] = "Library";
t[t.Options = 1] = "Options";
t[t.Active = 2] = "Active";
t[t.TimeScale = 3] = "TimeScale";
t[t.Shop = 4] = "Shop";
t[t.Special = 5] = "Special";
})(n = i.PowerButtonType || (i.PowerButtonType = {}));
var f = cc._decorator, m = f.ccclass, y = f.property, _ = function(t) {
a(e, t);
function e() {
var e = null !== t && t.apply(this, arguments) || this;
e.powerName = "";
e.selected = !1;
e.type = n.Active;
e.godPower = null;
return e;
}
e.prototype.start = function() {
var t = this;
this.scheduleOnce(function() {
t.godPower = l.default.powers.dict.get(t.powerName);
(t.type == n.Special || t.type == n.Library || t.type == n.Active && t.godPower) && d.default.addPower(t.godPower, t);
}, .1);
};
e.prototype.click = function() {
this.type == n.Active && this.clickActivePower();
this.type == n.Special && this.clickSpecial();
this.type == n.Options && this.clickOptions();
};
e.prototype.clickSpecial = function() {
if (this.godPower) if ("cityInfo" == this.godPower.id) {
c.default.showCityInfo = !c.default.showCityInfo;
this.node.getChildByName("dot").getComponent(cc.Button).interactable = !c.default.showCityInfo;
if (c.default.showCityInfo) {
p.SelectedPowerNameTip.inst.setText(this.godPower.name);
c.default.showCityZones && s.default.update(14);
}
} else if ("cityZones" == this.godPower.id) {
c.default.showCityZones = !c.default.showCityZones;
this.node.getChildByName("dot").getComponent(cc.Button).interactable = !c.default.showCityZones;
if (c.default.showCityZones) {
p.SelectedPowerNameTip.inst.setText(this.godPower.name);
c.default.showCityInfo && s.default.update(14);
}
} else if ("kingsAndLeaders" == this.godPower.id) {
c.default.showkingsAndLeadersInfo = !c.default.showkingsAndLeadersInfo;
this.node.getChildByName("dot").getComponent(cc.Button).interactable = !c.default.showkingsAndLeadersInfo;
c.default.showkingsAndLeadersInfo && p.SelectedPowerNameTip.inst.setText(this.godPower.name);
} else if ("marks_boats" == this.godPower.id) {
c.default.showmarks_boatsInfo = !c.default.showmarks_boatsInfo;
this.node.getChildByName("dot").getComponent(cc.Button).interactable = !c.default.showmarks_boatsInfo;
c.default.showmarks_boatsInfo && p.SelectedPowerNameTip.inst.setText(this.godPower.name);
} else if ("historyLog" == this.godPower.id) {
c.default.showHistoryLog = !c.default.showHistoryLog;
this.node.getChildByName("dot").getComponent(cc.Button).interactable = !c.default.showHistoryLog;
if (c.default.showHistoryLog) {
p.SelectedPowerNameTip.inst.setText(this.godPower.name);
s.default.update(15);
}
}
};
e.prototype.clickOptions = function() {};
e.prototype.unselectActivePower = function() {
this.selected = !1;
};
e.prototype.clickActivePower = function() {
h.PowerButtonSelector.inst.clickPowerButton(this);
};
e.prototype.update = function() {
var t = this.node.getChildByName("icon");
if (this.selected) {
t.angle = 15;
this.getComponent(cc.Sprite).spriteFrame = u.default.inst.propSprite[1];
} else {
t.angle = 0;
this.getComponent(cc.Sprite).spriteFrame = u.default.inst.propSprite[0];
}
};
r([ y ], e.prototype, "powerName", void 0);
r([ y({
type: cc.Enum(n)
}) ], e.prototype, "type", void 0);
return r([ m ], e);
}(cc.Component);
i.PowerButton = _;
cc._RF.pop();
}, {
"../../../../common/src/data/AchievData": void 0,
"../../Config": "Config",
"../../assetLibrary/AssetManager": "AssetManager",
"../UiController": "UiController",
"./GodPower": "GodPower",
"./PowerButtonSelector": "PowerButtonSelector",
"./SelectedPowerNameTip": "SelectedPowerNameTip"
} ],
PowerLibrary: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "f0f5fDTpMdN+JiAazaQL+p9", "PowerLibrary");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
});
Object.defineProperty(i, "__esModule", {
value: !0
});
var r = t("../../../../../framework/utils/Log"), n = t("../../../../../framework/utils/Tools"), s = t("../../actors/ActionLibrary"), l = t("../../brush/Brush"), c = t("../../Config"), u = t("../../game/audio/GameAudio"), d = t("../../MapBox"), h = t("../../ui/power/GodPower"), p = t("../AssetLibrary"), f = t("../AssetManager"), m = function(t) {
a(e, t);
function e() {
return null !== t && t.apply(this, arguments) || this;
}
e.prototype.init = function() {
t.prototype.init.call(this);
var e = new h.default();
e.id = "citySelect";
e.name = "Select City";
e.showFullKingdomInfo = !0;
e.actionType = h.PowerActionType.Special;
this.add(e);
this.t.tester_enabled = !1;
this.t.click_action = s.default.inspectCity;
var i = new h.default();
i.id = "relations";
i.name = "Relations";
i.showFullKingdomInfo = !0;
i.actionType = h.PowerActionType.Special;
this.add(i);
this.t.tester_enabled = !1;
var o = new h.default();
o.id = "inspect";
o.name = "Inspect";
o.actionType = h.PowerActionType.Special;
this.add(o);
this.t.tester_enabled = !1;
this.t.click_action = s.default.inspectUnit;
this.t.allow_unit_selection = !0;
var a = new h.default();
a.id = "infinityCoin";
a.name = "Infinity Coin";
a.actionType = h.PowerActionType.Special;
this.add(a);
this.t.click_action = this.spawnInfinityCoin;
var r = new h.default();
r.id = "cityInfo";
r.name = "Villages Info";
r.unselectWhenWindow = !0;
r.actionType = h.PowerActionType.Special;
this.add(r);
this.t.tester_enabled = !1;
this.t.toggle_name = "map_city_info";
this.t.toggle_action = this.toggleOption;
var n = new h.default();
n.id = "cityZones";
n.name = "City Zones Info";
n.unselectWhenWindow = !0;
n.actionType = h.PowerActionType.Special;
this.add(n);
this.t.tester_enabled = !1;
this.t.toggle_name = "map_city_zones";
this.t.toggle_action = this.toggleOption;
var l = new h.default();
l.id = "kingsAndLeaders";
l.name = "Kings and Leaders";
l.unselectWhenWindow = !0;
l.actionType = h.PowerActionType.Special;
this.add(l);
this.t.tester_enabled = !1;
this.t.toggle_name = "map_kings_leaders";
this.t.toggle_action = this.toggleOption;
var c = new h.default();
c.id = "marks_boats";
c.name = "Boats";
c.unselectWhenWindow = !0;
c.actionType = h.PowerActionType.Special;
this.add(c);
this.t.tester_enabled = !1;
this.t.toggle_name = "marks_boats";
this.t.toggle_action = this.toggleOption;
var u = new h.default();
u.id = "historyLog";
u.name = "History Log";
u.unselectWhenWindow = !0;
u.actionType = h.PowerActionType.Special;
this.add(u);
this.t.tester_enabled = !1;
this.t.toggle_name = "history_log";
this.t.toggle_action = this.toggleOption;
var d = new h.default();
d.id = "pause";
d.name = "Pause";
d.unselectWhenWindow = !0;
d.actionType = h.PowerActionType.Special;
this.add(d);
this.t.tester_enabled = !1;
var p = new h.default();
p.id = "clock";
p.name = "Clock";
p.unselectWhenWindow = !0;
p.actionType = h.PowerActionType.Special;
p.requiresPremium = !0;
p.rank = h.PowerRank.Rank0_free;
this.add(p);
this.t.tester_enabled = !1;
this.t.allow_unit_selection = !0;
var f = new h.default();
f.id = "follow_unit";
f.name = "Follow Unit";
f.unselectWhenWindow = !0;
f.actionType = h.PowerActionType.Special;
this.add(f);
this.t.tester_enabled = !1;
var m = new h.default();
m.id = "_terraformTiles";
m.drawLines = !0;
m.actionType = h.PowerActionType.Tile;
m.rank = h.PowerRank.Rank0_free;
m.showToolSizes = !0;
m.unselectWhenWindow = !0;
m.removeConway = !0;
m.destroyBuilding = !0;
m.removeBuilding = !0;
m.removeLava = !0;
m.holdAction = !0;
m.flashPixel = !0;
m.amountPerClick = 1;
m.clickInterval = 0;
this.add(m);
this.clone("fuse", "_terraformTiles");
this.t.name = "Fuse";
this.t.tileType = "fuse";
this.clone("tileDeepOcean", "_terraformTiles");
this.t.name = "Deep Ocean";
this.t.tileType = "pit_deep_ocean";
this.clone("tileCloseOcean", "_terraformTiles");
this.t.name = "Close Ocean";
this.t.tileType = "pit_close_ocean";
this.clone("tileShallowWaters", "_terraformTiles");
this.t.name = "Shallow Waters";
this.t.tileType = "pit_shallow_waters";
this.clone("tileSand", "_terraformTiles");
this.t.name = "Sand";
this.t.tileType = "sand";
this.clone("tileSoil", "_terraformTiles");
this.t.name = "Soil";
this.t.tileType = "soil";
this.clone("tileForest", "_terraformTiles");
this.t.name = "Forest";
this.t.tileType = "forest_soil";
this.clone("tileHills", "_terraformTiles");
this.t.name = "Hills";
this.t.tileType = "hills";
this.clone("tileMountains", "_terraformTiles");
this.t.name = "Mountains";
this.t.tileType = "mountains";
this.clone("showelPlus", "_terraformTiles");
this.t.name = "Shovel Plus";
this.t.actionType = h.PowerActionType.Draw;
this.t.amountPerClick = 4;
this.t.clickInterval = .1;
this.clone("showelMinus", "showelPlus");
this.t.name = "Shovel Minus";
this.t.amountPerClick = -4;
this.clone("vortex", "_terraformTiles");
this.t.name = "Vortex";
this.t.actionType = h.PowerActionType.Special;
this.t.click_action = this.useVortex;
this.clone("_drawOnTile", "_terraformTiles");
this.t.actionType = h.PowerActionType.Draw;
this.clone("greyGoo", "_drawOnTile");
this.t.name = "Grey Goo";
this.t.requiresPremium = !0;
this.t.rank = h.PowerRank.Rank3_good;
this.clone("conway", "_drawOnTile");
this.t.removeConway = !1;
this.t.name = "Conway game of Life1";
this.t.destroyBuilding = !0;
this.clone("conwayInverse", "conway");
this.t.name = "Conway game of Life2";
this.clone("finger", "_drawOnTile");
this.t.name = "Finger";
this.clone("lifeEraser", "_drawOnTile");
this.t.name = "Life Eraser";
this.t.destroyBuilding = !1;
this.t.removeBuilding = !1;
this.t.removeLava = !1;
this.t.removeLife = !0;
this.t.removeConway = !0;
this.t.removeTornado = !0;
this.clone("demolish", "_drawOnTile");
this.t.name = "Demolish";
this.t.destroyBuilding = !1;
this.t.removeBuilding = !1;
this.t.removeLava = !1;
this.clone("sponge", "_drawOnTile");
this.t.name = "Sponge";
this.t.removeConway = !1;
this.t.destroyBuilding = !1;
this.t.removeBuilding = !1;
this.t.removeLava = !1;
this.t.removeTornado = !0;
this.clone("sickle", "sponge");
this.t.name = "Sickle";
this.clone("axe", "sponge");
this.t.name = "Axe";
this.clone("bucket", "sponge");
this.t.name = "Bucket";
this.clone("pickaxe", "sponge");
this.t.name = "Pickaxe";
this.clone("divineLight", "sponge");
this.t.name = "Divine Light";
this.t.showToolSizes = !0;
var y = new h.default();
y.id = "_spawnActor";
y.actionType = h.PowerActionType.SpawnActor;
y.rank = h.PowerRank.Rank0_free;
y.unselectWhenWindow = !0;
y.showSpawnEffect = "spawn";
y.actorSpawnHeight = 3;
this.add(y);
this.clone("humans", "_spawnActor");
this.t.name = "Humans";
this.t.spawnSound = "spawnHuman";
this.t.actorStatsId = "unit_human";
this.clone("orcs", "_spawnActor");
this.t.rank = h.PowerRank.Rank4_awesome;
this.t.requiresPremium = !0;
this.t.name = "Orcs";
this.t.spawnSound = "spawnOrc";
this.t.actorStatsId = "unit_orc";
this.clone("elves", "_spawnActor");
this.t.rank = h.PowerRank.Rank4_awesome;
this.t.requiresPremium = !0;
this.t.name = "Elves";
this.t.spawnSound = "spawnElf";
this.t.actorStatsId = "unit_elf";
this.clone("dwarfs", "_spawnActor");
this.t.rank = h.PowerRank.Rank4_awesome;
this.t.requiresPremium = !0;
this.t.name = "Dwarves";
this.t.spawnSound = "spawnDwarf";
this.t.actorStatsId = "unit_dwarf";
this.clone("coldOnes", "_spawnActor");
this.t.name = "Cold Ones";
this.t.requiresPremium = !0;
this.t.rank = h.PowerRank.Rank3_good;
this.t.spawnSound = "spawnColdOne";
this.t.actorStatsId = "walker";
this.clone("demons", "_spawnActor");
this.t.name = "Demon";
this.t.requiresPremium = !0;
this.t.rank = h.PowerRank.Rank3_good;
this.t.spawnSound = "spawnDemon";
this.t.actorStatsId = "demon";
this.clone("necromancer", "_spawnActor");
this.t.name = "Necromancer";
this.t.requiresPremium = !0;
this.t.rank = h.PowerRank.Rank3_good;
this.t.spawnSound = "spawnNecromancer";
this.t.actorStatsId = "necromancer";
this.clone("druid", "_spawnActor");
this.t.name = "Druid";
this.t.requiresPremium = !0;
this.t.rank = h.PowerRank.Rank3_good;
this.t.spawnSound = "spawnDruid";
this.t.actorStatsId = "druid";
this.clone("plagueDoctor", "_spawnActor");
this.t.name = "Plague Doctor";
this.t.spawnSound = "spawnPlagueDoctor";
this.t.actorStatsId = "plagueDoctor";
this.clone("evilMage", "_spawnActor");
this.t.name = "Evil Mage";
this.t.requiresPremium = !0;
this.t.rank = h.PowerRank.Rank3_good;
this.t.spawnSound = "spawnEvilMage";
this.t.actorStatsId = "evilMage";
this.clone("whiteMage", "_spawnActor");
this.t.name = "White Mage";
this.t.requiresPremium = !0;
this.t.rank = h.PowerRank.Rank3_good;
this.t.spawnSound = "spawnWhiteMage";
this.t.actorStatsId = "whiteMage";
this.clone("bandits", "_spawnActor");
this.t.name = "Bandits";
this.t.spawnSound = "spawnBandit";
this.t.actorStatsId = "bandit";
this.clone("snowman", "_spawnActor");
this.t.name = "Snowman";
this.t.actorStatsId = "snowman";
this.clone("zombies", "_spawnActor");
this.t.name = "Zombie";
this.t.requiresPremium = !0;
this.t.rank = h.PowerRank.Rank3_good;
this.t.spawnSound = "spawnZombie";
this.t.actorStatsId = "zombie,zombie_orc,zombie_dwarf,zombie_elf";
this.clone("skeleton", "_spawnActor");
this.t.name = "Skeleton";
this.t.rank = h.PowerRank.Rank0_free;
this.t.actorStatsId = "skeleton";
this.clone("sheep", "_spawnActor");
this.t.name = "Sheeps";
this.t.spawnSound = "sheep spawn";
this.t.actorStatsId = "sheep";
this.clone("cow", "_spawnActor");
this.t.name = "Cow";
this.t.spawnSound = "cow spawn";
this.t.actorStatsId = "cow";
this.clone("turtle", "_spawnActor");
this.t.name = "Turtle";
this.t.spawnSound = "turtle spawn";
this.t.actorStatsId = "turtle";
this.clone("penguin", "_spawnActor");
this.t.name = "Penguin";
this.t.spawnSound = "penguin spawn";
this.t.actorStatsId = "penguin";
this.clone("crab", "_spawnActor");
this.t.name = "Crab";
this.t.spawnSound = "crab spawn";
this.t.actorStatsId = "crab";
this.clone("ratKing", "_spawnActor");
this.t.name = "Rat King";
this.t.actorStatsId = "ratKing";
this.clone("rabbit", "_spawnActor");
this.t.name = "Rabbit";
this.t.spawnSound = "rabbit spawn";
this.t.actorStatsId = "rabbit";
this.clone("cat", "_spawnActor");
this.t.name = "Cat";
this.t.spawnSound = "cat spawn";
this.t.actorStatsId = "cat";
this.clone("chicken", "_spawnActor");
this.t.name = "Chicken";
this.t.spawnSound = "chicken spawn";
this.t.actorStatsId = "chicken";
this.clone("wolf", "_spawnActor");
this.t.name = "Wolfs";
this.t.spawnSound = "spawnWolf";
this.t.actorStatsId = "wolf";
this.clone("bear", "_spawnActor");
this.t.name = "Bear";
this.t.spawnSound = "spawnBear";
this.t.actorStatsId = "bear";
this.clone("piranha", "_spawnActor");
this.t.name = "Piranha";
this.t.spawnSound = "spawnPiranha";
this.t.actorStatsId = "piranha";
this.clone("worm", "_spawnActor");
this.t.name = "Worm";
this.t.spawnSound = "spawnWorm";
this.t.actorStatsId = "worm";
this.clone("sandSpider", "_spawnActor");
this.t.name = "Sand Spider";
this.t.spawnSound = "spawnAnt";
this.t.actorStatsId = "sandSpider";
this.t.holdAction = !0;
this.clone("robotSanta", "_spawnActor");
this.t.name = "Robot Santa";
this.t.spawnSound = "spawnSanta";
this.t.actorStatsId = "santa";
this.clone("godFinger", "_spawnActor");
this.t.requiresPremium = !0;
this.t.rank = h.PowerRank.Rank2_normal;
this.t.name = "God Finger";
this.t.spawnSound = "spawnGodFinger";
this.t.actorStatsId = "godFinger";
this.clone("ufo", "_spawnActor");
this.t.requiresPremium = !0;
this.t.rank = h.PowerRank.Rank4_awesome;
this.t.name = "UFO";
this.t.spawnSound = "spawnUFO";
this.t.actorStatsId = "UFO";
this.clone("dragon", "_spawnActor");
this.t.requiresPremium = !0;
this.t.rank = h.PowerRank.Rank4_awesome;
this.t.name = "Dragon";
this.t.spawnSound = "spawnDragon";
this.t.actorStatsId = "dragon";
this.clone("fairy", "_spawnActor");
this.t.rank = h.PowerRank.Rank2_normal;
this.t.name = "Fairy";
this.t.actorStatsId = "fairy";
this.t.requiresPremium = !0;
this.clone("butterfly", "_spawnActor");
this.t.rank = h.PowerRank.Rank1_common;
this.t.name = "Butterfly";
this.t.actorStatsId = "butterfly";
this.clone("grasshopper", "_spawnActor");
this.t.rank = h.PowerRank.Rank1_common;
this.t.name = "Grasshopper";
this.t.actorStatsId = "grasshopper";
this.clone("fly", "_spawnActor");
this.t.rank = h.PowerRank.Rank1_common;
this.t.name = "Fly";
this.t.actorStatsId = "fly";
this.clone("beetle", "_spawnActor");
this.t.rank = h.PowerRank.Rank1_common;
this.t.name = "Beetle";
this.t.actorStatsId = "beetle";
this.clone("rat", "_spawnActor");
this.t.rank = h.PowerRank.Rank1_common;
this.t.name = "Rat";
this.t.actorStatsId = "rat";
this.t.requiresPremium = !0;
this.clone("antBlue", "_spawnActor");
this.t.name = "Blue Ant";
this.t.spawnSound = "spawnAnt";
this.t.actorStatsId = "antBlue";
this.clone("antGreen", "_spawnActor");
this.t.requiresPremium = !0;
this.t.rank = h.PowerRank.Rank1_common;
this.t.name = "Green Ant";
this.t.spawnSound = "spawnAnt";
this.t.actorStatsId = "antGreen";
this.clone("antBlack", "_spawnActor");
this.t.requiresPremium = !0;
this.t.rank = h.PowerRank.Rank1_common;
this.t.name = "Black Ant";
this.t.spawnSound = "spawnAnt";
this.t.actorStatsId = "antBlack";
this.clone("antRed", "_spawnActor");
this.t.requiresPremium = !0;
this.t.rank = h.PowerRank.Rank1_common;
this.t.name = "Red Ant";
this.t.spawnSound = "spawnAnt";
this.t.actorStatsId = "antRed";
this.clone("bowlingBall", "_spawnActor");
this.t.requiresPremium = !0;
this.t.rank = h.PowerRank.Rank2_normal;
this.t.name = "Bowling Ball";
this.t.actorStatsId = "boulder";
this.t.actorSpawnHeight = 30;
this.t.destroyBuilding = !0;
this.clone("tornado", "_spawnActor");
this.t.requiresPremium = !0;
this.t.rank = h.PowerRank.Rank3_good;
this.t.name = "Tornado";
this.t.actorStatsId = "tornado";
this.t.actorSpawnHeight = 0;
this.t.spawnSound = "tornado";
this.t.removeConway = !0;
this.t.destroyBuilding = !0;
this.t.removeLava = !0;
this.clone("crabzilla", "_spawnActor");
this.t.name = "Crabzilla";
this.t.actionType = h.PowerActionType.Special;
this.t.rank = h.PowerRank.Rank4_awesome;
this.t.requiresPremium = !0;
this.t.actorStatsId = "crabzilla";
this.t.actorSpawnHeight = 0;
this.t.ignoreFastSpawn = !0;
this.t.tester_enabled = !1;
var _ = new h.default();
_.id = "heatray";
_.name = "Heatray";
_.requiresPremium = !0;
_.rank = h.PowerRank.Rank2_normal;
_.actionType = h.PowerActionType.Special;
_.unselectWhenWindow = !0;
_.removeConway = !0;
_.holdAction = !0;
_.flashPixel = !0;
this.add(_);
var g = new h.default();
g.id = "meteorite";
g.name = "Meteorite";
g.actionType = h.PowerActionType.Special;
g.requiresPremium = !0;
g.rank = h.PowerRank.Rank3_good;
g.unselectWhenWindow = !0;
g.destroyBuilding = !0;
g.removeLava = !0;
g.flashPixel = !0;
g.applyForce = !0;
g.forceDamage = 100;
g.showSpawnEffect = "spawn";
this.add(g);
this.t.click_action = this.spawnMeteorite;
var v = new h.default();
v.id = "lightning";
v.name = "Lightning";
v.actionType = h.PowerActionType.Special;
v.unselectWhenWindow = !0;
v.removeConway = !0;
v.applyForce = !0;
v.forceDamage = 30;
this.add(v);
this.t.click_action = this.spawnLightning;
var b = new h.default();
b.id = "earthquake";
b.name = "Earthquake";
b.actionType = h.PowerActionType.Special;
b.unselectWhenWindow = !0;
b.removeConway = !0;
b.removeLava = !0;
b.destroyBuilding = !0;
this.add(b);
this.t.click_action = this.spawnEarthquake;
var T = new h.default();
T.id = "magnet";
T.name = "Magnet";
T.actionType = h.PowerActionType.Special;
T.showToolSizes = !0;
T.holdAction = !0;
T.highlight = !0;
T.unselectWhenWindow = !0;
this.add(T);
var w = new h.default();
w.id = "_spawnSpecial";
w.name = "_spawnSpecial";
w.actionType = h.PowerActionType.Special;
w.unselectWhenWindow = !0;
this.add(w);
this.clone("force", "_spawnSpecial");
this.t.name = "Force";
this.t.click_action = this.spawnForce;
this.clone("cloudRain", "_spawnSpecial");
this.t.name = "Rain Cloud";
this.clone("cloudAcid", "_spawnSpecial");
this.t.name = "Acid Cloud";
this.clone("cloudLava", "_spawnSpecial");
this.t.name = "Lava Cloud";
this.t.requiresPremium = !0;
this.t.rank = h.PowerRank.Rank2_normal;
this.clone("cloudSnow", "_spawnSpecial");
this.t.name = "Snow Cloud";
this.t.requiresPremium = !0;
this.t.rank = h.PowerRank.Rank2_normal;
var B = new h.default();
B.id = "_printer";
B.actionType = h.PowerActionType.Printer;
B.unselectWhenWindow = !0;
B.actorSpawnHeight = 3;
B.showSpawnEffect = "spawn";
this.add(B);
this.clone("printer_hexagon", "_printer");
this.t.name = "Printer - Hexagon";
this.t.printersPrint = "print_hexagon";
this.clone("printer_skull", "_printer");
this.t.name = "Printer - Skull";
this.t.printersPrint = "print_skull";
this.clone("printer_squares", "_printer");
this.t.name = "Printer - Squares";
this.t.printersPrint = "print_squares";
this.clone("printer_yinyang", "_printer");
this.t.name = "Printer - Yin Yang";
this.t.printersPrint = "print_yin_yang";
this.clone("printer_island1", "_printer");
this.t.name = "Printer - Island";
this.t.printersPrint = "print_island1";
this.clone("printer_star", "_printer");
this.t.name = "Printer - Star";
this.t.printersPrint = "print_star";
this.clone("printer_heart", "_printer");
this.t.name = "Printer - Heart";
this.t.printersPrint = "print_heart";
this.clone("printer_diamond", "_printer");
this.t.name = "Printer - Diamond";
this.t.printersPrint = "print_diamond";
var k = new h.default();
k.id = "_drops";
k.actionType = h.PowerActionType.Draw;
k.holdAction = !0;
k.flashPixel = !0;
k.showToolSizes = !0;
k.unselectWhenWindow = !0;
k.fallingPixel = !0;
k.fallingChance = .05;
this.add(k);
this.clone("tnt", "_drops");
this.t.name = "TNT";
this.t.dropID = "tnt";
this.clone("tnt_timed", "_drops");
this.t.name = "Timed TNT";
this.t.requiresPremium = !0;
this.t.rank = h.PowerRank.Rank1_common;
this.t.dropID = "tnt_timed";
this.clone("water_bomb", "_drops");
this.t.name = "Water Bomb";
this.t.dropID = "water_bomb";
this.clone("landmine", "_drops");
this.t.name = "Landmine";
this.t.requiresPremium = !0;
this.t.rank = h.PowerRank.Rank1_common;
this.t.dropID = "landmine";
this.clone("fireworks", "_drops");
this.t.name = "Fireworks";
this.t.dropID = "fireworks";
this.clone("inspiration", "_drops");
this.t.name = "Inspiration";
this.t.dropID = "inspiration";
this.t.fallingChance = .01;
this.clone("friendship", "_drops");
this.t.name = "Friendship";
this.t.dropID = "friendship";
this.t.fallingChance = .01;
this.clone("spite", "_drops");
this.t.name = "Spite";
this.t.dropID = "spite";
this.t.fallingChance = .01;
this.clone("madness", "_drops");
this.t.name = "Madness";
this.t.fallingChance = .01;
this.t.dropID = "madness";
this.clone("blessing", "_drops");
this.t.name = "Blessing";
this.t.dropID = "blessing";
this.t.fallingChance = .01;
this.clone("shield", "_drops");
this.t.name = "Shield";
this.t.dropID = "shield";
this.t.fallingChance = .01;
this.clone("curse", "_drops");
this.t.name = "Curse";
this.t.rank = h.PowerRank.Rank0_free;
this.t.dropID = "curse";
this.t.fallingChance = .01;
this.clone("zombieInfection", "_drops");
this.t.name = "Zombie Infection";
this.t.fallingChance = .01;
this.t.rank = h.PowerRank.Rank3_good;
this.t.dropID = "zombieInfection";
this.t.requiresPremium = !0;
this.clone("mushSpores", "_drops");
this.t.name = "Mush Spores";
this.t.fallingChance = .01;
this.t.rank = h.PowerRank.Rank2_normal;
this.t.dropID = "mushSpores";
this.t.requiresPremium = !0;
this.clone("coffee", "_drops");
this.t.name = "Coffee";
this.t.fallingChance = .01;
this.t.rank = h.PowerRank.Rank1_common;
this.t.dropID = "coffee";
this.t.requiresPremium = !0;
this.clone("plague", "_drops");
this.t.name = "Plague";
this.t.dropID = "plague";
this.t.fallingChance = .01;
this.t.requiresPremium = !0;
this.t.rank = h.PowerRank.Rank3_good;
this.clone("livingPlants", "_drops");
this.t.name = "Living Plants";
this.t.dropID = "livingPlants";
this.t.fallingChance = .01;
this.t.requiresPremium = !0;
this.t.rank = h.PowerRank.Rank2_normal;
this.clone("livingHouse", "_drops");
this.t.name = "Living Houses";
this.t.dropID = "livingHouse";
this.t.fallingChance = .01;
this.t.requiresPremium = !0;
this.t.rank = h.PowerRank.Rank2_normal;
this.clone("bomb", "_drops");
this.t.name = "Bomb";
this.t.dropID = "bomb";
this.t.fallingChance = .005;
this.clone("grenade", "bomb");
this.t.name = "Grenade";
this.t.dropID = "grenade";
this.clone("napalmBomb", "bomb");
this.t.name = "Napalm Bomb";
this.t.dropID = "napalmBomb";
this.t.fallingChance = .003;
this.clone("antimatterBomb", "_drops");
this.t.name = "Antimatter Bomb";
this.t.dropID = "antimatterBomb";
this.t.fallingChance = .002;
this.t.destroyBuilding = !0;
this.t.removeBuilding = !0;
this.clone("atomicBomb", "_drops");
this.t.name = "Atomic Bomb";
this.t.dropID = "atomicBomb";
this.t.fallingChance = .001;
this.t.showToolSizes = !1;
this.t.forceBrush = "circ_1";
this.t.requiresPremium = !0;
this.t.rank = h.PowerRank.Rank3_good;
this.t.destroyBuilding = !0;
this.clone("czarBomba", "_drops");
this.t.name = "Tsar Bomba";
this.t.dropID = "czarBomba";
this.t.requiresPremium = !0;
this.t.rank = h.PowerRank.Rank4_awesome;
this.t.fallingChance = .001;
this.t.showToolSizes = !1;
this.t.forceBrush = "circ_1";
this.t.destroyBuilding = !0;
this.clone("rain", "_drops");
this.t.dropID = "rain";
this.t.name = "Rain";
this.t.fallingChance = .02;
this.clone("bloodRain", "_drops");
this.t.dropID = "bloodRain";
this.t.name = "Blood Rain";
this.t.fallingChance = .02;
this.clone("fire", "_drops");
this.t.dropID = "fire";
this.t.name = "Fire";
this.t.fallingChance = .01;
this.t.particleInterval = .3;
this.clone("snow", "_drops");
this.t.dropID = "snow";
this.t.name = "Snow";
this.t.fallingChance = .03;
this.t.particleInterval = .15;
this.clone("acid", "_drops");
this.t.dropID = "acid";
this.t.name = "Acid";
this.t.fallingChance = .02;
this.t.destroyBuilding = !0;
this.clone("lava", "_drops");
this.t.dropID = "lava";
this.t.name = "Lava";
this.t.requiresPremium = !0;
this.t.rank = h.PowerRank.Rank2_normal;
this.t.fallingChance = .03;
this.t.removeBuilding = !0;
this.clone("seeds", "_drops");
this.t.dropID = "seeds";
this.t.name = "Seeds";
this.clone("fruitBush", "seeds");
this.t.dropID = "fruitBush";
this.t.name = "Fruit Bush";
this.clone("_dropBuilding", "_drops");
this.t.showToolSizes = !1;
this.t.forceBrush = "circ_1";
this.t.fallingChance = .03;
this.t.actionType = h.PowerActionType.Drops;
this.clone("stone", "_dropBuilding");
this.t.dropID = this.t.id;
this.t.name = "Stone";
this.clone("ore_deposit", "_dropBuilding");
this.t.dropID = this.t.id;
this.t.name = "Ore Deposit";
this.clone("gold", "_dropBuilding");
this.t.dropID = this.t.id;
this.t.name = "Gold";
this.clone("tumor", "_dropBuilding");
this.t.name = "Tumor";
this.t.dropID = this.t.id;
this.t.requiresPremium = !0;
this.t.rank = h.PowerRank.Rank3_good;
this.clone("geyser", "_dropBuilding");
this.t.name = "Geyser";
this.t.dropID = this.t.id;
this.clone("geyserAcid", "_dropBuilding");
this.t.name = "Acid Geyser";
this.t.dropID = this.t.id;
this.clone("volcano", "_dropBuilding");
this.t.name = "Volcano";
this.t.dropID = this.t.id;
this.t.requiresPremium = !0;
this.t.rank = h.PowerRank.Rank1_common;
this.clone("goldenBrain", "_dropBuilding");
this.t.name = "Golden Brain";
this.t.requiresPremium = !0;
this.t.dropID = this.t.id;
this.t.rank = h.PowerRank.Rank1_common;
this.clone("corruptedBrain", "_dropBuilding");
this.t.name = "Corrupted Brain";
this.t.requiresPremium = !0;
this.t.dropID = this.t.id;
this.t.rank = h.PowerRank.Rank1_common;
this.clone("iceTower", "_dropBuilding");
this.t.name = "Ice Tower";
this.t.requiresPremium = !0;
this.t.dropID = this.t.id;
this.t.rank = h.PowerRank.Rank3_good;
this.clone("beehive", "_dropBuilding");
this.t.name = "Beehive";
this.t.dropID = this.t.id;
this.t.rank = h.PowerRank.Rank1_common;
this.clone("flameTower", "_dropBuilding");
this.t.name = "Flame Tower";
this.t.requiresPremium = !0;
this.t.dropID = this.t.id;
this.t.rank = h.PowerRank.Rank3_good;
var A = new h.default();
A.id = "temperaturePlus";
A.name = "Temperature";
A.actionType = h.PowerActionType.Draw;
A.holdAction = !0;
A.flashPixel = !0;
A.showToolSizes = !0;
A.unselectWhenWindow = !0;
A.amountPerClick = 30;
this.add(A);
this.clone("temperatureMinus", "temperaturePlus");
this.t.amountPerClick = -30;
};
e.prototype.traceRanks = function() {
for (var t = "", e = "", i = "", o = "", a = "", n = 0; n < this.list.length; n++) {
var s = this.list[n];
switch (s.rank) {
case h.PowerRank.Rank0_free:
t = t + s.name + ", ";
break;

case h.PowerRank.Rank1_common:
e = e + s.name + ", ";
break;

case h.PowerRank.Rank2_normal:
i = i + s.name + ", ";
break;

case h.PowerRank.Rank3_good:
o = o + s.name + ", ";
break;

case h.PowerRank.Rank4_awesome:
a = a + s.name + ", ";
}
}
r.default.d("rank 0: " + t);
r.default.d("rank 1: " + e);
r.default.d("rank 2: " + i);
r.default.d("rank 3: " + o);
r.default.d("rank 4: " + a);
};
e.prototype.spawnLightning = function(t) {
d.default.spawnLightning(t);
return !0;
};
e.prototype.spawnForce = function(t) {
u.default.playForce();
d.default.inst.applyForce(t, 10, 1.5, !0, !0);
d.default.inst.spawnFlash(t, 10);
return !0;
};
e.prototype.spawnInfinityCoin = function(t) {
d.default.inst.stackEffects.get("infinityCoin").spawnAt(cc.v3(t.posV3.x, t.posV3.y - 1), .25);
return !0;
};
e.prototype.spawnEarthquake = function(t) {
d.default.inst.earthquakeManager.startQuake(t);
return !0;
};
e.prototype.spawnMeteorite = function(t) {
d.default.inst.spawnMeteorite(t);
return !0;
};
e.prototype.toggleOption = function(t) {
f.default.powers.get(t);
};
e.prototype.useVortex = function(t) {
u.default.playVortex();
d.default.inst.tileMover.moveTiles(t, l.default.getBrushByID(c.default.currentBrush));
return !0;
};
e.prototype.clone = function(t, e) {
var i = JSON.parse(JSON.stringify(this.get(e))), o = n.default.fromJson(i, new h.default());
o.id = t;
this.add(o);
return o;
};
return e;
}(p.default);
i.default = m;
cc._RF.pop();
}, {
"../../../../../framework/utils/Log": void 0,
"../../../../../framework/utils/Tools": void 0,
"../../Config": "Config",
"../../MapBox": "MapBox",
"../../actors/ActionLibrary": "ActionLibrary",
"../../brush/Brush": "Brush",
"../../game/audio/GameAudio": "GameAudio",
"../../ui/power/GodPower": "GodPower",
"../AssetLibrary": "AssetLibrary",
"../AssetManager": "AssetManager"
} ],
PrefabLibrary: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "ff61aU09ltNeawQnrqkOihN", "PrefabLibrary");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
}), r = this && this.__decorate || function(t, e, i, o) {
var a, r = arguments.length, n = r < 3 ? e : null === o ? o = Object.getOwnPropertyDescriptor(e, i) : o;
if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) n = Reflect.decorate(t, e, i, o); else for (var s = t.length - 1; s >= 0; s--) (a = t[s]) && (n = (r < 3 ? a(n) : r > 3 ? a(e, i, n) : a(e, i)) || n);
return r > 3 && n && Object.defineProperty(e, i, n), n;
};
Object.defineProperty(i, "__esModule", {
value: !0
});
var n = cc._decorator, s = n.ccclass, l = n.property, c = function(t) {
a(e, t);
function e() {
var e = null !== t && t.apply(this, arguments) || this;
e.guide = null;
e.building = null;
e.unit = null;
e.shadow = null;
return e;
}
i = e;
e.prototype.onLoad = function() {
i.inst = this;
};
var i;
e.inst = null;
r([ l({
type: cc.Prefab,
tooltip: "实例化新手引导需要的预制"
}) ], e.prototype, "guide", void 0);
r([ l({
type: cc.Prefab,
tooltip: "实例化building需要的预制"
}) ], e.prototype, "building", void 0);
r([ l({
type: cc.Prefab,
tooltip: "实例化unit需要的预制"
}) ], e.prototype, "unit", void 0);
r([ l({
type: cc.Prefab,
tooltip: "实例化shadow需要的预制"
}) ], e.prototype, "shadow", void 0);
return i = r([ s ], e);
}(cc.Component);
i.default = c;
cc._RF.pop();
}, {} ],
PrintLibrary: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "41496pY39tCNoneDoDe1dP5", "PrintLibrary");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
}), r = this && this.__decorate || function(t, e, i, o) {
var a, r = arguments.length, n = r < 3 ? e : null === o ? o = Object.getOwnPropertyDescriptor(e, i) : o;
if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) n = Reflect.decorate(t, e, i, o); else for (var s = t.length - 1; s >= 0; s--) (a = t[s]) && (n = (r < 3 ? a(n) : r > 3 ? a(e, i, n) : a(e, i)) || n);
return r > 3 && n && Object.defineProperty(e, i, n), n;
}, n = this && this.__values || function(t) {
var e = "function" == typeof Symbol && Symbol.iterator, i = e && t[e], o = 0;
if (i) return i.call(t);
if (t && "number" == typeof t.length) return {
next: function() {
t && o >= t.length && (t = void 0);
return {
value: t && t[o++],
done: !t
};
}
};
throw new TypeError(e ? "Object is not iterable." : "Symbol.iterator is not defined.");
};
Object.defineProperty(i, "__esModule", {
value: !0
});
i.PrintTemplate = void 0;
var s = t("../../../../framework/lib/prototype/MathUtils"), l = t("../common/ToolBox"), c = t("../texture/TextureLoader"), u = t("../texture/TextureRotator"), d = cc._decorator, h = d.ccclass, p = d.property, f = function() {
function t() {
this.name = "";
this.graphics = null;
this.steps = [];
}
r([ p(cc.String) ], t.prototype, "name", void 0);
return r([ h("PrintTemplate") ], t);
}();
i.PrintTemplate = f;
var m = function(t) {
a(e, t);
function e() {
var e = null !== t && t.apply(this, arguments) || this;
e.color0 = cc.Color.TRANSPARENT;
e.color2 = cc.Color.TRANSPARENT;
e.color3 = cc.Color.TRANSPARENT;
e.list = [];
e.dict = null;
e.listQuakes = [];
return e;
}
e.prototype.onLoad = function() {
var t, e;
this.color0 = l.Toolbox.makeColor("#FFFFFF");
this.color2 = l.Toolbox.makeColor("#7F7F7F");
this.color3 = l.Toolbox.makeColor("#000000");
this.dict = new Map();
try {
for (var i = n(this.list), o = i.next(); !o.done; o = i.next()) {
var a = o.value;
a.graphics = c.TextureLoader.inst.getTexture(c.BIN_TYPE.prints, a.name);
this.calcSteps(a);
this.dict.set(a.name, a);
if (a.name.includes("quake")) {
this.listQuakes.push(a);
this.addRotatedQuake(a, 90);
this.addRotatedQuake(a, 180);
this.addRotatedQuake(a, 360);
this.addRotatedQuake(a, -360);
this.addRotatedQuake(a, -90);
this.addRotatedQuake(a, -180);
this.addRotatedQuake(a, -270);
}
}
} catch (e) {
t = {
error: e
};
} finally {
try {
o && !o.done && (e = i.return) && e.call(i);
} finally {
if (t) throw t.error;
}
}
this.list = [];
};
e.prototype.addRotatedQuake = function(t, e) {
var i = new f();
i.name = t.name + "_" + e;
var o = t.graphics.clone();
i.graphics = u.TextureRotator.rotate(o, e);
this.calcSteps(i);
this.listQuakes.push(i);
};
e.prototype.calcSteps = function(t) {
if (t.graphics) {
t.steps = [];
for (var e = t.graphics.width, i = t.graphics.height, o = 1; o < e - 1; o++) for (var a = 1; a < i - 1; a++) {
var r = t.graphics.getPixel(o, a);
if (r.r != this.color0.r) {
var n = cc.v2(o - 1 - s.default.intCast(e / 2), a - 1 - s.default.intCast(i / 2));
t.steps.push(n);
if (r.r == this.color2.r) t.steps.push(n); else if (r.r == this.color3.r) {
t.steps.push(n);
t.steps.push(n);
}
}
}
t.steps.shuffle();
t.stepsPerTick = s.default.intCast(.005 * t.steps.length + 1);
}
};
r([ p([ f ]) ], e.prototype, "list", void 0);
return r([ h ], e);
}(cc.Component);
i.default = m;
cc._RF.pop();
}, {
"../../../../framework/lib/prototype/MathUtils": void 0,
"../common/ToolBox": "ToolBox",
"../texture/TextureLoader": "TextureLoader",
"../texture/TextureRotator": "TextureRotator"
} ],
ProfessionLibrary: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "4bafeOIcZZOaqzYz1Bhy64F", "ProfessionLibrary");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
});
Object.defineProperty(i, "__esModule", {
value: !0
});
i.ProfessionAsset = void 0;
var r = t("../../actors/ActorStatus"), n = t("../AssetLibrary"), s = function(t) {
a(e, t);
function e() {
var e = null !== t && t.apply(this, arguments) || this;
e.profession_id = r.UnitProfession.Null;
e.can_capture = !1;
e.is_civilian = !1;
e.special_skin_path = "";
return e;
}
return e;
}(n.Asset);
i.ProfessionAsset = s;
var l = function(t) {
a(e, t);
function e() {
var e = null !== t && t.apply(this, arguments) || this;
e.dict_profeesion_id = new Map();
return e;
}
e.prototype.init = function() {
t.prototype.init.call(this);
var e = new s();
e.id = "null";
e.profession_id = r.UnitProfession.Null;
this.add(e);
var i = new s();
i.id = "baby";
i.profession_id = r.UnitProfession.Baby;
i.special_skin_path = "unit_child";
i.is_civilian = !0;
this.add(i);
var o = new s();
o.id = "unit";
o.profession_id = r.UnitProfession.Unit;
o.is_civilian = !0;
this.add(o);
var a = new s();
a.id = "warrior";
a.profession_id = r.UnitProfession.Warrior;
a.can_capture = !0;
a.special_skin_path = "unit_warrior";
this.add(a);
var n = new s();
n.id = "king";
n.profession_id = r.UnitProfession.King;
n.can_capture = !0;
n.special_skin_path = "unit_king";
this.add(n);
var l = new s();
l.id = "leader";
l.profession_id = r.UnitProfession.Leader;
l.can_capture = !0;
l.special_skin_path = "unit_leader";
this.add(l);
};
e.prototype.add = function(e) {
this.dict_profeesion_id.set(e.profession_id, e);
return t.prototype.add.call(this, e);
};
e.prototype.getAsset = function(t) {
return this.dict_profeesion_id.get(t);
};
return e;
}(n.default);
i.default = l;
cc._RF.pop();
}, {
"../../actors/ActorStatus": "ActorStatus",
"../AssetLibrary": "AssetLibrary"
} ],
ProjectileLibrary: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "e8afaYtKAZCyIg+uOsc9PF/", "ProjectileLibrary");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
});
Object.defineProperty(i, "__esModule", {
value: !0
});
i.ProjectileAsset = void 0;
var r = t("../../actors/ActionLibrary"), n = t("../../world/WorldAction"), s = t("../AssetLibrary"), l = function(t) {
a(e, t);
function e() {
var e = null !== t && t.apply(this, arguments) || this;
e.texture = "";
e.animated = !1;
e.stayInGround = !1;
e.speed = 10;
e.speed_random = 10;
e.terraformOption = "";
e.terraformRange = 0;
e.endEffect = "";
e.playImpactSound = !1;
e.impactSoundID = "";
e.rotate = !1;
e.smoke = !1;
e.hitFreeze = !1;
e.hitShake = !1;
e._frames = [];
e.startScale = .1;
e.targetScale = .1;
e.parabolic = !1;
e.lookAtTarget = !1;
e.texture_shadow = "";
e.world_actions = n.default.create();
return e;
}
return e;
}(s.Asset);
i.ProjectileAsset = l;
var c = function(t) {
a(e, t);
function e() {
return null !== t && t.apply(this, arguments) || this;
}
e.prototype.init = function() {
t.prototype.init.call(this);
var e = new l();
e.id = "arrow";
e.speed = 18;
e.texture = "arrow";
e.parabolic = !0;
e.lookAtTarget = !0;
e.texture_shadow = "shadow_arrow";
this.add(e);
var i = new l();
i.id = "snowball";
i.texture = "snowball";
i.texture_shadow = "shadow_snowball";
i.speed = 15;
i.parabolic = !0;
i.lookAtTarget = !0;
i.hitFreeze = !0;
this.add(i);
var o = new l();
o.id = "firebomb";
o.speed = 5;
o.texture = "firebomb";
o.parabolic = !0;
o.lookAtTarget = !0;
o.texture_shadow = "shadow_ball";
o.terraformOption = "demon_fireball";
o.endEffect = "fireballExplosion";
o.hitShake = !0;
o.startScale = .075;
o.targetScale = .075;
o.playImpactSound = !0;
o.impactSoundID = "explosion medium";
o.terraformRange = 2;
this.add(o);
var a = new l();
a.id = "torch";
a.speed = 5;
a.texture = "pr_torch";
a.parabolic = !0;
a.lookAtTarget = !0;
a.texture_shadow = "shadow_ball";
a.terraformOption = "torch";
a.startScale = .075;
a.targetScale = .075;
a.terraformRange = 1;
a.playImpactSound = !1;
this.add(a);
var n = new l();
n.id = "dark_orb";
n.speed = 10;
n.lookAtTarget = !0;
n.texture = "dark_orb";
n.texture_shadow = "shadow_ball";
n.parabolic = !0;
n.startScale = .035;
n.targetScale = .1;
this.add(n);
var s = new l();
s.id = "red_orb";
s.speed = 12;
s.speed_random = 5;
s.texture = "pr_red_orb";
s.startScale = .035;
s.targetScale = .2;
this.add(s);
this.t.world_actions.add(r.default.action_fire);
var c = new l();
c.id = "freeze_orb";
c.speed = 12;
c.texture = "pr_freeze_orb";
c.startScale = .035;
c.targetScale = .2;
this.add(c);
var u = new l();
u.id = "green_orb";
u.speed = 20;
u.texture = "pr_green_orb";
u.startScale = .035;
u.targetScale = .2;
this.add(u);
var d = new l();
d.id = "blue_orb_small";
d.speed = 6;
d.texture = "pr_freeze_orb";
d.startScale = .035;
d.targetScale = .1;
d.terraformOption = "demon_fireball";
this.add(d);
var h = new l();
h.id = "bone";
h.speed = 10;
h.lookAtTarget = !0;
h.texture = "pr_bone";
h.texture_shadow = "shadow_ball";
h.parabolic = !0;
h.startScale = .035;
h.targetScale = .05;
this.add(h);
var p = new l();
p.id = "fireball";
p.speed = 15;
p.texture = "fireball";
p.smoke = !0;
p.texture_shadow = "shadow_ball";
p.terraformOption = "demon_fireball";
p.endEffect = "fireballExplosion";
p.terraformRange = 3;
p.startScale = .035;
p.targetScale = .2;
p.parabolic = !0;
p.lookAtTarget = !0;
this.add(p);
var f = new l();
f.id = "madness";
f.speed = 30;
f.texture = "madness_ball";
f.terraformOption = "madness_ball";
f.texture_shadow = "shadow_ball";
f.terraformRange = 3;
f.startScale = .035;
f.targetScale = .2;
f.parabolic = !0;
f.lookAtTarget = !0;
this.add(f);
};
return e;
}(s.default);
i.default = c;
cc._RF.pop();
}, {
"../../actors/ActionLibrary": "ActionLibrary",
"../../world/WorldAction": "WorldAction",
"../AssetLibrary": "AssetLibrary"
} ],
Projectile: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "8def3BwBGFBnbav5eZWorFE", "Projectile");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
}), r = this && this.__decorate || function(t, e, i, o) {
var a, r = arguments.length, n = r < 3 ? e : null === o ? o = Object.getOwnPropertyDescriptor(e, i) : o;
if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) n = Reflect.decorate(t, e, i, o); else for (var s = t.length - 1; s >= 0; s--) (a = t[s]) && (n = (r < 3 ? a(n) : r > 3 ? a(e, i, n) : a(e, i)) || n);
return r > 3 && n && Object.defineProperty(e, i, n), n;
};
Object.defineProperty(i, "__esModule", {
value: !0
});
var n = t("../../../../framework/lib/prototype/MathUtils"), s = t("../animation/SpriteAnimation"), l = t("../assetLibrary/AssetManager"), c = t("../base/BaseEffect"), u = t("../base/BaseStats"), d = t("../common/ToolBox"), h = t("../game/audio/GameAudio"), p = t("../MapBox"), f = t("../texture/TextureLoader"), m = cc._decorator, y = m.ccclass, _ = (m.property, 
function(t) {
a(e, t);
function e() {
var e = null !== t && t.apply(this, arguments) || this;
e.curStats = new u.default();
e.byUnit = null;
e.byBuilding = null;
e.targetObject = null;
e.speed = 0;
e.vecStart = cc.Vec3.ZERO;
e.vecTarget = cc.Vec3.ZERO;
e.vecTargetZ = cc.Vec3.ZERO;
e.curScale = 0;
e.targetScale = 0;
e.asset = null;
e.timeToTarget = 0;
e.timeInAir = 0;
e.target_reached = !1;
e.targetZ = 0;
e.halfHitChecked = !1;
e.t_rotation = 0;
e.timer_smoke = 0;
return e;
}
i = e;
e.prototype.begin = function(t, e, i, o) {
void 0 === o && (o = 0);
this.created || this.create();
this.byUnit = null;
this.byBuilding = null;
this.asset = l.default.projectiles.get(i);
this.spriteAnimation = this.getComponent(s.SpriteAnimation);
if (null == this.asset._frames || 0 == this.asset._frames.length) {
var a = f.TextureLoader.inst.getSpriteFrames(f.ATLAS_TYPE.WORLDATLAS, "effects/projectiles/" + this.asset.texture);
this.asset._frames = Array.from(a.values());
}
this.spriteAnimation.setFrames(this.asset._frames);
var r = cc.v3(t.x, t.y, 0);
this.curScale = this.asset.startScale;
this.targetScale = this.asset.targetScale;
this.node.scale = this.curScale;
this.currentPosition = r;
this.node.position = r;
this.speed = this.asset.speed + d.Toolbox.randomFloat(0, this.asset.speed_random);
this.vecStart = cc.v3(t.x, t.y);
this.vecTarget = cc.v3(e.x, e.y);
this.targetZ = o;
this.target_reached = !1;
this.halfHitChecked = !1;
this.t_rotation = 0;
if (0 != o) {
o < 5 && (o = 20);
this.vecTargetZ = cc.v3(this.vecTarget.x, this.vecTarget.y + o);
var n = d.Toolbox.dist(this.vecStart.x, this.vecStart.y, this.vecTarget.x, this.vecTarget.y);
this.vecTarget = d.Toolbox.getNewPoint(this.vecStart.x, this.vecStart.y, this.vecTarget.x, this.vecTarget.y, 2 * n, !1);
}
this.timeInAir = 0;
this.timeToTarget = (d.Toolbox.distVec3(this.vecStart, this.vecTarget) + o) / this.speed;
o > 0 && this.timeToTarget < .7 && (this.timeToTarget = .7);
};
e.prototype.setStats = function(t) {
this.curStats.clear();
this.curStats.addStats(t);
};
e.prototype.updateShadow = function() {
if (this.asset.texture_shadow) {
if (!this.shadow) {
this.shadow = p.default.inst.createShadow(this, this.asset.texture_shadow);
this.resetShadow();
}
var t = cc.Vec3.ZERO;
cc.Vec3.lerp(t, this.vecStart, this.vecTarget, this.timeInAir / this.timeToTarget);
this.checkShadowPosition(t);
this.shadow.node.angle = d.Toolbox.lookAt2D(t, this.vecTarget);
}
};
e.prototype.getAngle = function() {
var t = 4 * this.timeToTarget;
0 != this.targetZ && (t = this.targetZ);
var e = i.parabola(this.vecStart, this.vecTarget, t, 0), o = i.parabola(this.vecStart, this.vecTarget, t, .1);
return d.Toolbox.lookAt2D(e, o);
};
e.prototype.logicUpdate = function(e) {
if (3 != this.state && this.node.active) {
t.prototype.logicUpdate.call(this, e);
if (!this.target_reached) {
this.timeInAir += e;
if (this.curScale < this.targetScale) {
this.curScale += .2 * e;
this.curScale > this.targetScale && (this.curScale = this.targetScale);
this.node.scale = this.curScale;
}
if (this.asset.rotate) {
this.t_rotation += d.Toolbox.randomFloat(10, 50);
this.node.angle = this.t_rotation;
}
if (this.asset.smoke) if (this.timer_smoke > 0) this.timer_smoke -= e; else {
p.default.inst.stackEffects.get("fireSmoke").spawnAt(this.node.position, .25);
this.timer_smoke = .2;
}
var o = this.timeInAir / this.timeToTarget;
cc.Vec3.lerp(this.currentPosition, this.vecStart, this.vecTarget, o);
if (this.asset.parabolic) {
var a = 4 * this.timeToTarget;
0 != this.targetZ && (a = this.targetZ);
this.currentPosition = i.parabola(this.vecStart, this.vecTarget, a, o);
var r = i.parabola(this.vecStart, this.vecTarget, a, (this.timeInAir + e) / this.timeToTarget);
this.node.angle = d.Toolbox.lookAt2D(this.currentPosition, r);
}
this.node.position = this.currentPosition;
this.updateShadow();
if (!this.halfHitChecked && o >= .5) {
this.halfHitChecked = !0;
if (this.checkHit(this.vecTargetZ)) {
this.targetReached();
return;
}
}
if (this.timeInAir > this.timeToTarget) {
this.checkHit(this.vecTarget) || p.default.inst.stackEffects.get("miss").spawnAt(this.node.position, .1);
this.targetReached();
}
}
}
};
e.parabola = function(t, e, i, o) {
var a, r = cc.v3();
cc.Vec3.lerp(r, t, e, o);
return cc.v3(r.x, -4 * i * (a = o) * a + 4 * i * a + n.default.lerp(t.y, e.y, o), r.z);
};
e.prototype.checkHit = function(t) {
var e, i, o = !1;
(null === (i = null === (e = this.byUnit) || void 0 === e ? void 0 : e.data) || void 0 === i ? void 0 : i.alive) && (o = p.default.inst.newAttack(this.byUnit, t, p.default.inst.getTile(n.default.intCast(this.currentPosition.x), n.default.intCast(this.currentPosition.y)), this.targetObject));
return o;
};
e.prototype.targetReached = function() {
this.target_reached = !0;
this.asset.endEffect && p.default.inst.stackEffects.get(this.asset.endEffect).spawnAt(this.vecTarget, .25);
var t = p.default.inst.getTile(n.default.intCast(this.vecTarget.x), n.default.intCast(this.vecTarget.y));
this.asset.playImpactSound && h.default.play(this.asset.impactSoundID);
if (t) {
this.asset.world_actions.isEmpty || this.asset.world_actions.do(null, t);
if (this.asset.hitFreeze) {
p.default.inst.freezeTile(t);
t.neighbours.forEach(function(t) {
d.Toolbox.randomBool() && p.default.inst.freezeTile(t);
});
}
this.asset.hitShake && p.default.inst.startShake(.01, .01, .25);
this.asset.terraformOption && p.default.inst.damageWorld(t, this.asset.terraformRange, l.default.terraform.get(this.asset.terraformOption));
}
this.kill();
if (this.shadow) {
this.shadow.node.destroy();
this.shadow = null;
}
};
var i;
return i = r([ y ], e);
}(c.default));
i.default = _;
cc._RF.pop();
}, {
"../../../../framework/lib/prototype/MathUtils": void 0,
"../MapBox": "MapBox",
"../animation/SpriteAnimation": "SpriteAnimation",
"../assetLibrary/AssetManager": "AssetManager",
"../base/BaseEffect": "BaseEffect",
"../base/BaseStats": "BaseStats",
"../common/ToolBox": "ToolBox",
"../game/audio/GameAudio": "GameAudio",
"../texture/TextureLoader": "TextureLoader"
} ],
QualityChanger: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "e08186FU4pM8pb8iPjsGQh4", "QualityChanger");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
}), r = this && this.__decorate || function(t, e, i, o) {
var a, r = arguments.length, n = r < 3 ? e : null === o ? o = Object.getOwnPropertyDescriptor(e, i) : o;
if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) n = Reflect.decorate(t, e, i, o); else for (var s = t.length - 1; s >= 0; s--) (a = t[s]) && (n = (r < 3 ? a(n) : r > 3 ? a(e, i, n) : a(e, i)) || n);
return r > 3 && n && Object.defineProperty(e, i, n), n;
};
Object.defineProperty(i, "__esModule", {
value: !0
});
var n = t("../../../../../framework/utils/iTween"), s = t("../../building/Building"), l = t("../../MapBox"), c = cc._decorator, u = c.ccclass, d = c.property, h = function(t) {
a(e, t);
function e() {
var e = null !== t && t.apply(this, arguments) || this;
e.mapRenderer = null;
e.lowRes = !1;
e.changeMod = 0;
e.changeModTween = 0;
e.tweenBuildings = 0;
e.colorAlpha = 1;
return e;
}
i = e;
e.prototype.onLoad = function() {
i.inst = this;
};
e.prototype.reset = function() {
this.lowRes = !1;
this.changeMod = 0;
this.changeModTween = 0;
};
e.prototype.logicUpdate = function(t) {
if (this.colorAlpha != this.changeMod || 0 != this.changeMod && 1 != this.changeMod) {
this.colorAlpha = this.changeMod;
this.mapRenderer.node.opacity = 255 * this.colorAlpha;
l.default.inst.unitLayer.node.opacity = 255 * this.colorAlpha;
this.lowRes, this.changeModTween = n.default.easeInOutCubic(0, 1, this.changeMod);
this.tweenBuildings = s.default.defaultScale.y * (1 - this.changeModTween);
}
if (this.lowRes && this.changeMod < 1) {
this.changeMod += 3 * t;
this.changeMod > 1 && (this.changeMod = 1);
} else if (!this.lowRes && this.changeMod > 0) {
this.changeMod -= 3 * t;
this.changeMod < 0 && (this.changeMod = 0);
}
if (this.lowRes) {
if (1 == this.changeMod) {
l.default.inst.tilemap.enableTiles(!1);
if (l.default.inst.transformShadows.active) {
l.default.inst.transformShadows.active = !1;
l.default.inst.transformParents.scale = 0;
}
}
} else 0 == this.changeMod && l.default.inst.worldLayer.setRendererEnabled(!1);
};
e.prototype.zoomUpdated = function(t) {
var e = t < 11;
if (e != this.lowRes) {
this.lowRes = e;
l.default.inst.buildings.checkAddRemove();
this.lowRes || l.default.inst.buildings.list.forEach(function(t) {
t.forceScale(0);
});
l.default.inst.transformParents.scale = 1;
l.default.inst.transformShadows.active = !0;
l.default.inst.worldLayer.setRendererEnabled(!0);
l.default.inst.tilemap.enableTiles(!0);
}
};
var i;
e.inst = null;
r([ d(cc.Sprite) ], e.prototype, "mapRenderer", void 0);
return i = r([ u ], e);
}(cc.Component);
i.default = h;
cc._RF.pop();
}, {
"../../../../../framework/utils/iTween": void 0,
"../../MapBox": "MapBox",
"../../building/Building": "Building"
} ],
RaceLibrary: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "1aa77yxn7tOHKShtbOxOAnG", "RaceLibrary");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
});
Object.defineProperty(i, "__esModule", {
value: !0
});
var r = t("../../../../../framework/utils/Tools"), n = t("../../actors/ActorBase"), s = t("../../actors/race/Race"), l = t("../../base/BaseBuilding"), c = t("../../common/ToolBox"), u = function(t) {
a(e, t);
function e() {
return null !== t && t.apply(this, arguments) || this;
}
e.prototype.init = function() {
t.prototype.init.call(this);
var e = new s.default();
e.id = "nature";
e.nature = !0;
this.add(e);
this.t = e;
var i = new s.default();
i.id = "human";
i.color = c.Toolbox.makeColor("#00C0FF");
i.color_abandoned = c.Toolbox.makeColor("#697382");
i.civ_buildRoads = !0;
i.icon = "iconHumans";
i.civilization = !0;
i.nameLocale = "Humans";
i.bannerId = "human";
i.production = [ "metals", "bread", "pie" ];
i.civ_baseCities = 3;
i.civ_baseArmy = 10;
i.civ_baseZones = 5;
i.name_template_city = "human_city";
i.name_template_kingdom = "human_kingdom";
this.add(i);
this.setPreferredStatPool("diplomacy#5,warfare#5,stewardship#5");
this.setPreferredFoodPool("berries#5,bread#5,fish#5,meat#2,sushi#2,jam#1,cider#1,ale#2,burger#1,pie#1,tea#2");
this.addPreferredWeapon("sword", 5);
this.addPreferredWeapon("axe", 2);
this.addPreferredWeapon("spear", 2);
this.addPreferredWeapon("bow", 5);
this.clone("orc", "human");
this.t.civ_baseCities = 2;
this.t.civ_baseArmy = 15;
this.t.civ_baseZones = 7;
this.t.color = c.Toolbox.makeColor("#DD2D2D");
this.t.color_abandoned = c.Toolbox.makeColor("#8E7C62");
this.t.civ_buildRoads = !1;
this.t.icon = "iconOrcs";
this.t.nameLocale = "Orcs";
this.t.bannerId = "orc";
this.t.hateRaces = "human,elf,dwarf";
this.t.preferred_weapons.clear();
this.t.production = [ "metals", "bread", "burger", "tea" ];
this.t.name_template_city = "orc_city";
this.t.name_template_kingdom = "orc_kingdom";
this.setPreferredStatPool("diplomacy#1,warfare#5,stewardship#2");
this.setPreferredFoodPool("berries#2,bread#5,fish#5,meat#10,sushi#2,cider#1,ale#5,burger#5,pie#1,tea#10");
this.addPreferredWeapon("axe", 10);
this.addPreferredWeapon("spear", 3);
this.addPreferredWeapon("bow", 5);
this.clone("elf", "human");
this.t.civ_baseCities = 1;
this.t.civ_baseArmy = 8;
this.t.civ_baseZones = 12;
this.t.color = c.Toolbox.makeColor("#94E032");
this.t.color_abandoned = c.Toolbox.makeColor("#556E4F");
this.t.civ_buildRoads = !1;
this.t.icon = "iconElves";
this.t.nameLocale = "Elves";
this.t.bannerId = "elf";
this.t.hateRaces = "orc,dwarf";
this.t.preferred_weapons.clear();
this.t.production = [ "metals", "bread", "jam", "sushi", "cider" ];
this.t.name_template_city = "elf_city";
this.t.name_template_kingdom = "elf_kingdom";
this.setPreferredStatPool("diplomacy#5,warfare#2,stewardship#2");
this.setPreferredFoodPool("berries#5,bread#5,fish#1,sushi#10,cider#10,tea#1");
this.addPreferredWeapon("spear", 5);
this.addPreferredWeapon("bow", 10);
this.addPreferredWeapon("sword", 2);
this.clone("dwarf", "human");
this.t.civ_baseCities = 1;
this.t.civ_baseArmy = 12;
this.t.civ_baseZones = 3;
this.t.color = c.Toolbox.makeColor("#BC00B6");
this.t.color_abandoned = c.Toolbox.makeColor("#7F585A");
this.t.icon = "iconDwarf";
this.t.nameLocale = "Dwarves";
this.t.bannerId = "dwarf";
this.t.hateRaces = "orc,elf";
this.t.preferred_weapons.clear();
this.t.buildingPlacements = l.BuildingPlacements.Center;
this.t.production = [ "metals", "bread", "ale" ];
this.t.name_template_city = "dwarf_city";
this.t.name_template_kingdom = "dwarf_kingdom";
this.setPreferredStatPool("diplomacy#2,warfare#3,stewardship#5");
this.setPreferredFoodPool("berries#1,bread#5,fish#5,meat#5,sushi#1,jam#1,cider#1,ale#10,burger#2,pie#2,tea#1");
this.addPreferredWeapon("hammer", 10);
this.addPreferredWeapon("bow", 3);
this.addPreferredWeapon("sword", 2);
this.list.forEach(function(t) {
t.colorBorder = cc.color(t.color.r, t.color.g, t.color.b, 153);
t.colorBorderOut = cc.color(t.color.r, t.color.g, t.color.b, 255);
});
};
e.prototype.setPreferredStatPool = function(t) {
for (var e = (t = t.replace(" ", "")).split(","), i = 0; i < e.length; i++) for (var o = e[i].split("#"), a = parseInt(o[1]), r = o[0], n = 0; n < a; n++) this.t.preferred_attribute.push(r);
};
e.prototype.setPreferredFoodPool = function(t) {
for (var e = (t = t.replace(" ", "")).split(","), i = 0; i < e.length; i++) for (var o = e[i].split("#"), a = parseInt(o[1]), r = o[0], n = 0; n < a; n++) this.t.preferred_food.push(r);
};
e.prototype.get = function(e) {
if (!this.dict.has(e)) {
var i = new s.default();
i.id = e;
this.t = i;
this.add(i);
}
return t.prototype.get.call(this, e);
};
e.prototype.addPreferredWeapon = function(t, e) {
for (var i = 0; i < e; i++) this.t.preferred_weapons.push(t);
};
e.prototype.logicUpdate = function() {
this.list.forEach(function(t) {
t.units.checkAddRemove();
});
};
e.prototype.clear = function() {
this.list.forEach(function(t) {
t.units.clear();
});
};
e.prototype.clone = function(t, e) {
var i = JSON.parse(JSON.stringify(this.get(e))), o = r.default.fromJson(i, new s.default());
o.units = new n.ActorContainer();
o.id = t;
this.add(o);
return o;
};
return e;
}(t("../AssetLibrary").default);
i.default = u;
cc._RF.pop();
}, {
"../../../../../framework/utils/Tools": void 0,
"../../actors/ActorBase": "ActorBase",
"../../actors/race/Race": "Race",
"../../base/BaseBuilding": "BaseBuilding",
"../../common/ToolBox": "ToolBox",
"../AssetLibrary": "AssetLibrary"
} ],
Race: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "3e11cg7jnhPCoQ9HQdu/31o", "Race");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
});
Object.defineProperty(i, "__esModule", {
value: !0
});
var r = t("../../assetLibrary/AssetLibrary"), n = t("../../base/BaseBuilding"), s = t("../ActorBase"), l = function(t) {
a(e, t);
function e() {
var e = null !== t && t.apply(this, arguments) || this;
e.nameLocale = "";
e.icon = "";
e.production = [];
e.color = cc.Color.BLACK;
e.color_abandoned = cc.Color.BLACK;
e.colorBorder = cc.Color.BLACK;
e.colorBorderOut = cc.Color.BLACK;
e.name_template_kingdom = "";
e.name_template_city = "";
e.nature = !1;
e.civilization = !1;
e.civ_buildRoads = !1;
e.civ_baseCities = 1;
e.civ_baseZones = 5;
e.civ_baseArmy = 1;
e.buildingPlacements = n.BuildingPlacements.Random;
e.preferred_weapons = [];
e.preferred_food = [];
e.preferred_attribute = [];
e.hateRaces = "";
e.bannerId = "";
e.units = new s.ActorContainer();
return e;
}
return e;
}(r.Asset);
i.default = l;
cc._RF.pop();
}, {
"../../assetLibrary/AssetLibrary": "AssetLibrary",
"../../base/BaseBuilding": "BaseBuilding",
"../ActorBase": "ActorBase"
} ],
RecordShare: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "87217aUPONN3L3j/iUeHXFz", "RecordShare");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
}), r = this && this.__decorate || function(t, e, i, o) {
var a, r = arguments.length, n = r < 3 ? e : null === o ? o = Object.getOwnPropertyDescriptor(e, i) : o;
if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) n = Reflect.decorate(t, e, i, o); else for (var s = t.length - 1; s >= 0; s--) (a = t[s]) && (n = (r < 3 ? a(n) : r > 3 ? a(e, i, n) : a(e, i)) || n);
return r > 3 && n && Object.defineProperty(e, i, n), n;
}, n = this && this.__values || function(t) {
var e = "function" == typeof Symbol && Symbol.iterator, i = e && t[e], o = 0;
if (i) return i.call(t);
if (t && "number" == typeof t.length) return {
next: function() {
t && o >= t.length && (t = void 0);
return {
value: t && t[o++],
done: !t
};
}
};
throw new TypeError(e ? "Object is not iterable." : "Symbol.iterator is not defined.");
};
Object.defineProperty(i, "__esModule", {
value: !0
});
var s = t("../../../../../framework/main/Constants"), l = t("../../../../common/src/advert/AdsManager"), c = t("../../../../common/src/data/RewardData"), u = t("../../../../common/src/data/UserData"), d = t("../../../../common/src/GamePopBase"), h = t("../../../../common/src/MsgCache"), p = t("../../texture/TextureLoader"), f = cc._decorator, m = f.ccclass, y = f.property, _ = function(t) {
a(e, t);
function e() {
var e = null !== t && t.apply(this, arguments) || this;
e.rewardItem = [];
e.clickText = null;
e.rewardID = 18;
e.data = [];
return e;
}
e.prototype.start = function() {
var t, e;
try {
for (var i = n(this.rewardItem), o = i.next(); !o.done; o = i.next()) o.value.active = !1;
} catch (e) {
t = {
error: e
};
} finally {
try {
o && !o.done && (e = i.return) && e.call(i);
} finally {
if (t) throw t.error;
}
}
this.clickText.string = "" != l.default.getRecordedVideoPath() ? "分享我的世界" : "邀请朋友一起玩";
this.data = c.default.getRewards(this.rewardID);
this.showReward(this.data);
};
e.prototype.showReward = function(t) {
for (var e = 0; e < t.length; e++) if (this.rewardItem[e]) {
this.rewardItem[e].active = !0;
this.rewardItem[e].getChildByName("name").getComponent(cc.Label).string = t[e].propName;
var i = this.rewardItem[e].getChildByName("rare");
i.active = t[e].rare >= 0 && s.default.MODE != s.MODE_TYPE.LOCK;
var o = p.TextureLoader.inst.getSpriteFrame(p.ATLAS_TYPE.UIATLAS, "reward/rare_" + t[e].rare);
o && (i.getComponent(cc.Sprite).spriteFrame = o);
var a = this.rewardItem[e].getChildByName("icon"), r = p.TextureLoader.inst.getSpriteFrame(p.ATLAS_TYPE.UIATLAS, "propIcon/icon" + t[e].propID);
r && (a.getComponent(cc.Sprite).spriteFrame = r);
var n = this.rewardItem[e].getChildByName("num");
n.getComponent(cc.Label).string = t[e].number.toString();
n.active = !1;
var l = u.default.getPropByID(t[e].propID);
if (!l) return;
s.default.MODE == s.MODE_TYPE.COUNT || 1002 == l.propID ? n.active = !0 : s.default.MODE != s.MODE_TYPE.ALL || l.lock || (n.active = !0);
}
};
e.prototype.share = function() {
var t = this;
"" != l.default.getRecordedVideoPath() ? l.default.shareVideo({
success: function() {
t.reward(!0);
},
fail: function() {
t.reward(!1);
}
}) : l.default.shareAppMessage({
success: function() {
t.reward(!0);
},
fail: function() {
t.reward(!1);
}
});
};
e.prototype.reward = function(t) {
if (t) {
for (var e = 0; e < this.data.length; e++) {
var i = u.default.getPropByID(this.data[e].propID);
if (!i) return;
s.default.MODE == s.MODE_TYPE.LOCK ? i.lock = !1 : s.default.MODE == s.MODE_TYPE.ALL && i.lock ? i.lock = !1 : i.number += this.data[e].number;
1002 == i.propID && (i.number += this.data[e].number);
}
u.default.save();
h.default.pushToast("获得分享奖励成功！");
this.close();
} else h.default.pushToast("分享失败！");
};
r([ y([ cc.Node ]) ], e.prototype, "rewardItem", void 0);
r([ y(cc.Label) ], e.prototype, "clickText", void 0);
r([ y ], e.prototype, "rewardID", void 0);
return r([ m ], e);
}(d.GamePopBase);
i.default = _;
cc._RF.pop();
}, {
"../../../../../framework/main/Constants": void 0,
"../../../../common/src/GamePopBase": void 0,
"../../../../common/src/MsgCache": void 0,
"../../../../common/src/advert/AdsManager": void 0,
"../../../../common/src/data/RewardData": void 0,
"../../../../common/src/data/UserData": void 0,
"../../texture/TextureLoader": "TextureLoader"
} ],
RegionLinkHashes: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "98515J2i2NASII3zc43hC6n", "RegionLinkHashes");
Object.defineProperty(i, "__esModule", {
value: !0
});
i.RegionLink = void 0;
var o = function() {
this.id = 0;
this.regions = new Set();
};
i.RegionLink = o;
var a = function() {
function t() {}
t.addHash = function(e, i) {
var a = t.dict.get(e);
if (!a) {
(a = new o()).id = e;
t.dict.set(a.id, a);
}
a.regions.add(i);
i.links.add(a);
};
t.getCount = function() {
return t.dict.size;
};
t.clear = function() {
t.dict.clear();
};
t.getHash = function(e) {
return t.dict.get(e);
};
t.remove = function(e, i) {
e.regions.delete(i);
0 == e.regions.size && t.dict.delete(e.id);
};
t.debug = function(t) {
t.setText("hashes", this.dict.size);
};
t.dict = new Map();
return t;
}();
i.default = a;
cc._RF.pop();
}, {} ],
RegionPathFinder: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "d6f78MS88NA1IzlPDqcgk9V", "RegionPathFinder");
var o = this && this.__values || function(t) {
var e = "function" == typeof Symbol && Symbol.iterator, i = e && t[e], o = 0;
if (i) return i.call(t);
if (t && "number" == typeof t.length) return {
next: function() {
t && o >= t.length && (t = void 0);
return {
value: t && t[o++],
done: !t
};
}
};
throw new TypeError(e ? "Object is not iterable." : "Symbol.iterator is not defined.");
};
Object.defineProperty(i, "__esModule", {
value: !0
});
var a = t("../../actors/ActorMove"), r = t("../../DebugConfig"), n = function() {
function t() {
this.cachedPaths = new Map();
this._temp_regions_cur_wave = [];
this._temp_regions_next_wave = [];
this._temp_regions_checked = [];
this.last_globalPath = [];
this.currentWave = 0;
this.tileStart = null;
this.tileTarget = null;
}
t.prototype.getGlobalPath = function(t, e, i) {
void 0 === i && (i = !1);
this.last_globalPath = null;
if (t == e) return a.PathFinderResult.SamePlace;
if (t.region == e.region && (256 == t.region.tiles.length || 0 == t.region.tiles.length)) return a.PathFinderResult.SamePlace;
if (t.region == e.region) return a.PathFinderResult.PathFound;
if (t.region.island != e.region.island) return a.PathFinderResult.DifferentIslands;
this.tileStart = t;
this.tileTarget = e;
var o = t.region.id + "_" + e.region.id;
if (r.default.UseCacheForRegionPath && this.cachedPaths.has(o)) {
this.last_globalPath = this.cachedPaths.get(o);
return a.PathFinderResult.PathFound;
}
this.last_globalPath = [];
this.startWave(this.tileTarget.region);
r.default.UseCacheForRegionPath && this.addToCache(o, this.last_globalPath);
return a.PathFinderResult.PathFound;
};
t.prototype.addToCache = function(t, e) {
this.cachedPaths.size > 1e3 && this.cachedPaths.clear();
this.cachedPaths.set(t, e);
};
t.prototype.clearCache = function() {
this.cachedPaths.clear();
};
t.prototype.startWave = function(t) {
this.clearRegions();
this.currentWave = 0;
this._temp_regions_cur_wave.clear();
this._temp_regions_next_wave.clear();
this.addToNext(t);
this.newWave();
};
t.prototype.addToNext = function(t) {
t.isCheckedPath = !0;
this._temp_regions_next_wave.push(t);
this._temp_regions_checked.push(t);
t.path_wave_id = this.currentWave;
};
t.prototype.newWave = function() {
var t, e, i, a;
this.currentWave++;
this._temp_regions_cur_wave.clear();
this._temp_regions_cur_wave.addRange(this._temp_regions_next_wave);
this._temp_regions_next_wave.clear();
try {
for (var r = o(this._temp_regions_cur_wave), n = r.next(); !n.done; n = r.next()) {
var s = n.value;
try {
for (var l = (i = void 0, o(s.neighbours)), c = l.next(); !c.done; c = l.next()) {
var u = c.value;
if (!u.isCheckedPath) {
this.addToNext(u);
if (u == this.tileStart.region) {
this.finalPath(this.tileStart.region);
return;
}
}
}
} catch (t) {
i = {
error: t
};
} finally {
try {
c && !c.done && (a = l.return) && a.call(l);
} finally {
if (i) throw i.error;
}
}
}
} catch (e) {
t = {
error: e
};
} finally {
try {
n && !n.done && (e = r.return) && e.call(r);
} finally {
if (t) throw t.error;
}
}
this._temp_regions_next_wave.length > 0 && this.newWave();
};
t.prototype.finalPath = function(t) {
var e, i;
this.last_globalPath.push(t);
t.regionPath = !0;
if (t != this.tileTarget.region) {
t.neighbours.shuffle();
try {
for (var a = o(t.neighbours), r = a.next(); !r.done; r = a.next()) {
var n = r.value;
if (-1 != n.path_wave_id && n.path_wave_id < t.path_wave_id) {
this.finalPath(n);
break;
}
}
} catch (t) {
e = {
error: t
};
} finally {
try {
r && !r.done && (i = a.return) && i.call(a);
} finally {
if (e) throw e.error;
}
}
}
};
t.prototype.clearRegions = function() {
this._temp_regions_checked.forEach(function(t) {
t.isCheckedPath = !1;
t.path_wave_id = -1;
t.regionPath = !1;
});
this._temp_regions_checked.clear();
};
t.prototype.debug = function() {
return this.cachedPaths.size.toString();
};
return t;
}();
i.default = n;
cc._RF.pop();
}, {
"../../DebugConfig": "DebugConfig",
"../../actors/ActorMove": "ActorMove"
} ],
ResourceLibrary: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "17e939LECtDOI1ZQEofMnvi", "ResourceLibrary");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
});
Object.defineProperty(i, "__esModule", {
value: !0
});
i.ResourceAsset = i.ResType = i.ResourceType = void 0;
var r, n = t("../../texture/TextureLoader"), s = t("../AssetLibrary");
(function(t) {
t[t.None = 0] = "None";
t[t.Tree = 1] = "Tree";
t[t.Stone = 2] = "Stone";
t[t.Ore = 3] = "Ore";
t[t.Gold = 4] = "Gold";
t[t.Fruits = 5] = "Fruits";
t[t.Wheat = 6] = "Wheat";
})(i.ResourceType || (i.ResourceType = {}));
(function(t) {
t[t.Currency = 0] = "Currency";
t[t.Strategic = 1] = "Strategic";
t[t.Ingredient = 2] = "Ingredient";
t[t.Food = 3] = "Food";
})(r = i.ResType || (i.ResType = {}));
var l = function(t) {
a(e, t);
function e() {
var e = null !== t && t.apply(this, arguments) || this;
e.type = r.Ingredient;
e.icon = "";
e.mineRate = 0;
e.maximum = 999;
e.sprite = null;
e.restoreHunger = 0;
e.restoreHealth = 0;
e.ingredientsAmount = 1;
e.ingredients = [];
e.supplyBoundGive = 30;
e.supplyBoundTake = 10;
e.supplyGive = 10;
e.tradeBound = 40;
e.tradeGive = 10;
e.tradeCost = 1;
return e;
}
e.prototype.getSprite = function() {
null == this.sprite && (this.sprite = n.TextureLoader.inst.getSpriteFrame(n.ATLAS_TYPE.UIATLAS, "icons/" + this.icon));
return this.sprite;
};
return e;
}(s.Asset);
i.ResourceAsset = l;
var c = function(t) {
a(e, t);
function e() {
var e = null !== t && t.apply(this, arguments) || this;
e.poolMine = [];
return e;
}
e.prototype.init = function() {
var e = this;
t.prototype.init.call(this);
var i = new l();
i.id = "gold";
i.icon = "iconResGold";
i.maximum = 9999;
i.supplyBoundGive = 600;
i.supplyBoundTake = 10;
i.supplyGive = 100;
i.type = r.Currency;
this.add(i);
var o = new l();
o.id = "berries";
o.type = r.Food;
o.icon = "iconResBerries";
o.restoreHunger = 30;
o.restoreHealth = .05;
o.tradeBound = 50;
o.tradeGive = 5;
this.add(o);
var a = new l();
a.id = "bread";
a.type = r.Food;
a.icon = "iconResBread";
a.restoreHunger = 60;
a.ingredientsAmount = 1;
a.restoreHealth = .1;
a.ingredients = [ "wheat" ];
a.tradeBound = 50;
a.tradeGive = 5;
this.add(a);
var n = new l();
n.id = "fish";
n.type = r.Food;
n.restoreHunger = 50;
n.icon = "iconResFish";
n.restoreHealth = .15;
n.tradeBound = 50;
n.tradeGive = 5;
this.add(n);
var s = new l();
s.id = "meat";
s.type = r.Food;
s.restoreHunger = 60;
s.icon = "iconResMeat";
s.restoreHealth = .15;
s.tradeBound = 50;
s.tradeGive = 5;
this.add(s);
var c = new l();
c.id = "sushi";
c.type = r.Food;
c.icon = "iconResSushi";
c.restoreHunger = 70;
c.restoreHealth = .2;
c.ingredientsAmount = 1;
c.ingredients = [ "fish" ];
c.tradeBound = 50;
c.tradeGive = 5;
this.add(c);
var u = new l();
u.id = "jam";
u.type = r.Food;
u.icon = "iconResJam";
u.restoreHunger = 70;
u.ingredientsAmount = 2;
u.restoreHealth = .3;
u.ingredients = [ "berries" ];
u.tradeBound = 50;
u.tradeGive = 5;
this.add(u);
var d = new l();
d.id = "cider";
d.type = r.Food;
d.icon = "iconResCider";
d.restoreHunger = 100;
d.ingredientsAmount = 3;
d.restoreHealth = .4;
d.ingredients = [ "berries" ];
d.tradeBound = 50;
d.tradeGive = 5;
this.add(d);
var h = new l();
h.id = "ale";
h.type = r.Food;
h.icon = "iconResAle";
h.restoreHunger = 100;
h.ingredientsAmount = 3;
h.restoreHealth = .3;
h.ingredients = [ "wheat" ];
h.tradeBound = 50;
h.tradeGive = 5;
this.add(h);
var p = new l();
p.id = "burger";
p.type = r.Food;
p.icon = "iconResBurger";
p.restoreHunger = 100;
p.ingredientsAmount = 1;
p.restoreHealth = .5;
p.ingredients = [ "meat", "wheat" ];
p.tradeBound = 50;
p.tradeGive = 5;
this.add(p);
var f = new l();
f.id = "pie";
f.type = r.Food;
f.icon = "iconResPie";
f.restoreHunger = 100;
f.ingredientsAmount = 1;
f.restoreHealth = .5;
f.ingredients = [ "meat", "wheat" ];
f.tradeBound = 50;
f.tradeGive = 5;
this.add(f);
var m = new l();
m.id = "tea";
m.type = r.Food;
m.restoreHunger = 100;
m.restoreHealth = .25;
m.icon = "iconResTea";
m.tradeBound = 50;
m.tradeGive = 5;
m.ingredients = [ "wheat" ];
this.add(m);
var y = new l();
y.id = "honey";
y.type = r.Food;
y.restoreHealth = .8;
y.restoreHunger = 100;
y.icon = "iconResHoney";
this.add(y);
var _ = new l();
_.id = "wheat";
_.type = r.Ingredient;
_.icon = "iconResWheat";
_.supplyBoundGive = 100;
_.supplyBoundTake = 20;
this.add(_);
var g = new l();
g.id = "wood";
g.icon = "iconResWood";
g.type = r.Strategic;
this.add(g);
var v = new l();
v.id = "stone";
v.icon = "iconResStone";
v.mineRate = 25;
v.type = r.Strategic;
this.add(v);
var b = new l();
b.id = "ore";
b.icon = "iconResOre";
b.mineRate = 5;
b.type = r.Ingredient;
this.add(b);
var T = new l();
T.id = "metals";
T.icon = "iconResMetals";
T.ingredients = [ "ore" ];
T.type = r.Strategic;
this.add(T);
var w = new l();
w.id = "bones";
w.icon = "iconResBones";
w.type = r.Strategic;
this.add(w);
var B = new l();
B.id = "leather";
B.icon = "iconResLeather";
B.type = r.Strategic;
this.add(B);
var k = new l();
k.id = "gems";
k.icon = "iconResGems";
k.mineRate = 1;
k.type = r.Strategic;
this.add(k);
this.list.forEach(function(t) {
if (0 != t.mineRate) for (var i = 0; i < t.mineRate; i++) e.poolMine.push(t);
});
};
return e;
}(s.default);
i.default = c;
cc._RF.pop();
}, {
"../../texture/TextureLoader": "TextureLoader",
"../AssetLibrary": "AssetLibrary"
} ],
RoadsCalculator: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "97edbs168lMNJvWoRAVdqVl", "RoadsCalculator");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
}), r = this && this.__decorate || function(t, e, i, o) {
var a, r = arguments.length, n = r < 3 ? e : null === o ? o = Object.getOwnPropertyDescriptor(e, i) : o;
if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) n = Reflect.decorate(t, e, i, o); else for (var s = t.length - 1; s >= 0; s--) (a = t[s]) && (n = (r < 3 ? a(n) : r > 3 ? a(e, i, n) : a(e, i)) || n);
return r > 3 && n && Object.defineProperty(e, i, n), n;
};
Object.defineProperty(i, "__esModule", {
value: !0
});
var n = t("../../base/BaseObjectData"), s = t("../tile/TileDictionary"), l = t("../tile/TileIsland"), c = cc._decorator, u = c.ccclass, d = (c.property, 
function(t) {
a(e, t);
function e() {
var e = null !== t && t.apply(this, arguments) || this;
e.islands = [];
e.current_island = 0;
e.dirty = !0;
return e;
}
e.prototype.onLoad = function() {
this.islands = [];
this.tileDictionary = new s.TileDictionary();
t.prototype.create.call(this);
};
e.prototype.setDirty = function(t) {
t.roadIsland && (t.roadIsland.dirty = !0);
if (t.type.road) this.tileDictionary.add(t); else {
this.tileDictionary.remove(t);
t.roadIsland = null;
}
this.dirty = !0;
};
e.prototype.clear = function() {
t.prototype.clear.call(this);
this.tileDictionary.clear();
this.islands.clear();
};
e.prototype.logicUpdate = function(e) {
t.prototype.logicUpdate.call(this, e);
if (this.dirty) {
this.dirty = !1;
this.recalculateIslands();
}
};
e.prototype.recalculateIslands = function() {
for (var t = this, e = 0; e < this.islands.length; ) {
var i = this.islands[e];
if (i.dirty) {
this.islands.splice(e, 1);
i.tiles_roads.dict.forEach(function(t, e) {
e.roadIsland = null;
});
} else e++;
}
this.tileDictionary.dict.forEach(function(e, i) {
if (!i.roadIsland) {
var o = new l.default(t.current_island++);
t.islands.push(o);
t.calcIsland(i, o);
}
});
};
e.prototype.calcIsland = function(t, e) {
for (var i = [ t ]; i.length > 0; ) {
var o = i.shift();
o.roadIsland = e;
e.tiles_roads.add(o);
o.neighboursAll.forEach(function(t) {
if (!t.roadIsland && t.type.road) {
t.roadIsland = e;
i.push(t);
}
});
}
};
return r([ u ], e);
}(n.BaseModule));
i.default = d;
cc._RF.pop();
}, {
"../../base/BaseObjectData": "BaseObjectData",
"../tile/TileDictionary": "TileDictionary",
"../tile/TileIsland": "TileIsland"
} ],
SantaAnimation: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "28613myefBJy5yA63SQPogz", "SantaAnimation");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
}), r = this && this.__decorate || function(t, e, i, o) {
var a, r = arguments.length, n = r < 3 ? e : null === o ? o = Object.getOwnPropertyDescriptor(e, i) : o;
if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) n = Reflect.decorate(t, e, i, o); else for (var s = t.length - 1; s >= 0; s--) (a = t[s]) && (n = (r < 3 ? a(n) : r > 3 ? a(e, i, n) : a(e, i)) || n);
return r > 3 && n && Object.defineProperty(e, i, n), n;
};
Object.defineProperty(i, "__esModule", {
value: !0
});
var n = t("../../../common/src/GameCommon"), s = t("../base/BaseMapObject"), l = t("../common/ToolBox"), c = cc._decorator, u = c.ccclass, d = c.property, h = function(t) {
a(e, t);
function e() {
var e = null !== t && t.apply(this, arguments) || this;
e.shakeX = 2;
e.shakeY = .3;
e.shakeTween = null;
e.originalX = 0;
e.originalY = 0;
return e;
}
e.prototype.start = function() {
this.originalX = this.node.position.x;
this.originalY = this.node.position.y;
this.doTween();
};
e.prototype.logicUpdate = function() {
n.default.isPaused || this.shakeTween || this.doTween();
};
e.prototype.doTween = function() {
var t = this.shakeX * l.Toolbox.randomRange(.3, 1), e = this.shakeY * l.Toolbox.randomRange(.3, 1);
this.shakeTween = cc.tween(this.node).to(.1, {
position: cc.v3(this.originalX + t, this.originalY + e, 0)
}).to(.1, {
position: cc.v3(this.originalX, this.originalY, 0)
}).to(.1, {
position: cc.v3(this.originalX - t, this.originalY - e, 0)
}).to(.1, {
position: cc.v3(this.originalX, this.originalY, 0)
}).call(this.tweenFinished.bind(this)).start();
};
e.prototype.tweenFinished = function() {
this.shakeTween = null;
};
r([ d() ], e.prototype, "shakeX", void 0);
r([ d() ], e.prototype, "shakeY", void 0);
return r([ u ], e);
}(s.default);
i.default = h;
cc._RF.pop();
}, {
"../../../common/src/GameCommon": void 0,
"../base/BaseMapObject": "BaseMapObject",
"../common/ToolBox": "ToolBox"
} ],
Santa: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "0640eWA9GhPjZ2tymNAmNAC", "Santa");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
}), r = this && this.__decorate || function(t, e, i, o) {
var a, r = arguments.length, n = r < 3 ? e : null === o ? o = Object.getOwnPropertyDescriptor(e, i) : o;
if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) n = Reflect.decorate(t, e, i, o); else for (var s = t.length - 1; s >= 0; s--) (a = t[s]) && (n = (r < 3 ? a(n) : r > 3 ? a(e, i, n) : a(e, i)) || n);
return r > 3 && n && Object.defineProperty(e, i, n), n;
};
Object.defineProperty(i, "__esModule", {
value: !0
});
var n = t("../../../../../framework/lib/prototype/MathUtils"), s = t("../../../../common/src/GameCommon"), l = t("../../assetLibrary/AssetManager"), c = t("../../common/ToolBox"), u = t("../../game/audio/GameAudio"), d = t("../../MapBox"), h = t("../Actor"), p = t("../ActorStatus"), f = cc._decorator, m = f.ccclass, y = (f.property, 
function(t) {
a(e, t);
function e() {
var e = null !== t && t.apply(this, arguments) || this;
e.timer = 1;
e.timer_smoke = 0;
return e;
}
e.prototype.create = function() {
t.prototype.create.call(this);
this.timer = 2 + c.Toolbox.randomFloat(0, 2);
};
e.prototype.logicUpdate = function(e) {
var i;
this.colorEffect -= e;
this.colorEffect < 0 && (this.colorEffect = 0);
if (this.data.health > 0) t.prototype.logicUpdate.call(this, e); else {
this.updateFall(e);
this.updatePos();
}
if (this.node.x > 2 * d.default.width) this.killHimself(!0, p.AttackType.None, !1); else {
if (this.data.health > 0) {
this.nextStepPosition.x = 3 * d.default.width;
this.nextStepPosition.y = this.currentPosition.y;
this.is_moving = !0;
if (!s.default.isPaused) {
this.currentPosition.addSelf(cc.v3(.1 * this.curStats.speed, c.Toolbox.randomFloat(-1, 1), 0).mul(d.default.inst.elapsed));
this._positionDirty = !0;
}
} else {
if (this.timer_smoke > 0) this.timer_smoke -= d.default.inst.elapsed; else {
this.timer_smoke = .1;
d.default.inst.stackEffects.get("fireSmoke").spawnAt(this.node.position, 1);
}
this.currentPosition.addSelf(cc.v3(4, c.Toolbox.randomFloat(-1, 1), 0).mul(d.default.inst.elapsed));
this._positionDirty = !0;
}
if (0 == this.zPosition.y) {
u.default.playExplosionMedium();
var o = d.default.inst.getTile(n.default.intCast(this.currentPosition.x), n.default.intCast(this.currentPosition.y));
if (!o) {
this.killHimself(!0);
return;
}
this.killHimself(!0);
d.default.inst.damageWorld(o, 5, l.default.terraform.get("grenade"));
d.default.inst.stackEffects.get("explosionSmall").spawnAtRandomScale(o, .45, .6);
} else {
if (!(null === (i = this.data) || void 0 === i ? void 0 : i.alive) || s.default.isPaused) return;
this.timer -= d.default.inst.elapsed;
if (this.timer > 0) return;
this.timer = 2 + c.Toolbox.randomFloat(0, 2);
if (this.data.health > 0) {
var a = d.default.inst.getTile(n.default.intCast(this.currentPosition.x), n.default.intCast(this.currentPosition.y));
a && (d.default.inst.dropManager.spawn(a, "santa_bomb", this.zPosition.y).soundOn = !0);
}
}
}
};
e.ignoredKingdom = [ "santa" ];
return r([ m ], e);
}(h.default));
i.default = y;
cc._RF.pop();
}, {
"../../../../../framework/lib/prototype/MathUtils": void 0,
"../../../../common/src/GameCommon": void 0,
"../../MapBox": "MapBox",
"../../assetLibrary/AssetManager": "AssetManager",
"../../common/ToolBox": "ToolBox",
"../../game/audio/GameAudio": "GameAudio",
"../Actor": "Actor",
"../ActorStatus": "ActorStatus"
} ],
SaveItem: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "6d913Hp+LZPX4meQRWKvWlO", "SaveItem");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
}), r = this && this.__decorate || function(t, e, i, o) {
var a, r = arguments.length, n = r < 3 ? e : null === o ? o = Object.getOwnPropertyDescriptor(e, i) : o;
if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) n = Reflect.decorate(t, e, i, o); else for (var s = t.length - 1; s >= 0; s--) (a = t[s]) && (n = (r < 3 ? a(n) : r > 3 ? a(e, i, n) : a(e, i)) || n);
return r > 3 && n && Object.defineProperty(e, i, n), n;
};
Object.defineProperty(i, "__esModule", {
value: !0
});
var n = t("../Config"), s = cc._decorator, l = s.ccclass, c = s.property, u = function(t) {
a(e, t);
function e() {
var e = null !== t && t.apply(this, arguments) || this;
e.txtName = null;
e.icon = null;
e.slotId = 0;
e.callback = null;
return e;
}
e.prototype.init = function(t, e, i, o, a) {
void 0 === a && (a = null);
this.slotId = t;
this.callback = a;
this.loadTexture(e, i, o);
this.txtName && (this.txtName.active = t == n.default.quickSaveSlotId);
};
e.prototype.click = function() {
n.default.currentSlot = this.slotId;
this.callback && this.callback();
};
e.prototype.loadTexture = function(t, e, i) {
if (t) {
var o = new cc.Texture2D();
o.initWithData(t, cc.Texture2D.PixelFormat.RGBA8888, e, i);
o.setFilters(cc.Texture2D.Filter.NEAREST, cc.Texture2D.Filter.NEAREST);
var a = new cc.SpriteFrame();
a.setTexture(o);
this.icon.spriteFrame = a;
}
};
r([ c(cc.Node) ], e.prototype, "txtName", void 0);
r([ c(cc.Sprite) ], e.prototype, "icon", void 0);
return r([ l ], e);
}(cc.Component);
i.default = u;
cc._RF.pop();
}, {
"../Config": "Config"
} ],
SaveList: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "a4169BHJnVKEpA0hNNJ8oRf", "SaveList");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
}), r = this && this.__decorate || function(t, e, i, o) {
var a, r = arguments.length, n = r < 3 ? e : null === o ? o = Object.getOwnPropertyDescriptor(e, i) : o;
if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) n = Reflect.decorate(t, e, i, o); else for (var s = t.length - 1; s >= 0; s--) (a = t[s]) && (n = (r < 3 ? a(n) : r > 3 ? a(e, i, n) : a(e, i)) || n);
return r > 3 && n && Object.defineProperty(e, i, n), n;
};
Object.defineProperty(i, "__esModule", {
value: !0
});
var n = t("../../../../framework/lib/base64/Base64"), s = t("../../../common/src/GamePopBase"), l = t("../Config"), c = t("../game/audio/GameAudio"), u = t("../game/guide/GuideController"), d = t("../MapBox"), h = t("./SaveItem"), p = t("./SaveManager"), f = t("./SavePopup"), m = cc._decorator, y = m.ccclass, _ = m.property, g = function(t) {
a(e, t);
function e() {
var e = null !== t && t.apply(this, arguments) || this;
e.listContentNode = null;
e.slotItem = null;
e.slotNodes = [];
e.clicked = !1;
return e;
}
i = e;
e.prototype.onLoad = function() {
i.inst = this;
this.subBg.x = cc.winSize.width;
this.build();
};
e.prototype.open = function() {
t.prototype.open.call(this, function() {
u.default.inst.in(u.GUIDE_TYPE.save, 2) && u.default.inst.do(u.GUIDE_TYPE.save);
});
};
e.prototype.back = function() {
c.default.playClick();
this.clicked = !1;
this.listContentNode.destroyAllChildren();
this.build();
this.move(!1);
};
e.prototype.build = function() {
for (var t = 0; t < l.default.maxSlotCount; t++) {
var e = this.buildItem(t);
if (e) {
e.parent = this.listContentNode;
this.slotNodes.push(e);
}
}
};
e.prototype.buildItem = function(t) {
var e = cc.instantiate(this.slotItem);
if (!e) return null;
e.name = "存档" + t;
var i = 0, o = 0, a = null;
if (t == l.default.quickSaveSlotId) {
a = d.default.inst.worldLayer.getTextureData();
i = d.default.width;
o = d.default.height;
} else if (p.default.slotExists(t)) {
var r = p.default.getPreview(t);
if (r) {
a = n.default.decodeToUnit8Array(r.textureDataBase64);
i = r.width;
o = r.height;
}
}
e.getComponent(h.default).init(t, a, i, o, this.onSlotNodeClicked.bind(this));
return e;
};
e.prototype.onSlotNodeClicked = function() {
if (!this.clicked) {
this.clicked = !0;
this.subBg.getComponent(f.default).init(l.default.currentSlot, this.back.bind(this));
this.move(!0, function() {
u.default.inst.in(u.GUIDE_TYPE.save, 3) && u.default.inst.do(u.GUIDE_TYPE.save);
});
}
};
var i;
e.inst = null;
r([ _({
type: cc.Node,
tooltip: ""
}) ], e.prototype, "listContentNode", void 0);
r([ _({
type: cc.Prefab,
tooltip: "列表的元素"
}) ], e.prototype, "slotItem", void 0);
return i = r([ y ], e);
}(s.GamePopBase);
i.default = g;
cc._RF.pop();
}, {
"../../../../framework/lib/base64/Base64": void 0,
"../../../common/src/GamePopBase": void 0,
"../Config": "Config",
"../MapBox": "MapBox",
"../game/audio/GameAudio": "GameAudio",
"../game/guide/GuideController": "GuideController",
"./SaveItem": "SaveItem",
"./SaveManager": "SaveManager",
"./SavePopup": "SavePopup"
} ],
SaveManager: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "34ccc7TKWhPi5dNfkKX9TPR", "SaveManager");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
}), r = this && this.__decorate || function(t, e, i, o) {
var a, r = arguments.length, n = r < 3 ? e : null === o ? o = Object.getOwnPropertyDescriptor(e, i) : o;
if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) n = Reflect.decorate(t, e, i, o); else for (var s = t.length - 1; s >= 0; s--) (a = t[s]) && (n = (r < 3 ? a(n) : r > 3 ? a(e, i, n) : a(e, i)) || n);
return r > 3 && n && Object.defineProperty(e, i, n), n;
}, n = this && this.__values || function(t) {
var e = "function" == typeof Symbol && Symbol.iterator, i = e && t[e], o = 0;
if (i) return i.call(t);
if (t && "number" == typeof t.length) return {
next: function() {
t && o >= t.length && (t = void 0);
return {
value: t && t[o++],
done: !t
};
}
};
throw new TypeError(e ? "Object is not iterable." : "Symbol.iterator is not defined.");
};
Object.defineProperty(i, "__esModule", {
value: !0
});
var s = t("../../../../framework/lib/base64/Base64"), l = t("../../../../framework/utils/Log"), c = t("../../../../framework/utils/SaveUtils"), u = t("../../../../framework/utils/Tools"), d = t("../actors/ActorStatus"), h = t("../actors/other/boat/Boat"), p = t("../assetLibrary/AssetManager"), f = t("../building/Docks"), m = t("../building/UnitSpawner"), y = t("../city/CityStorage"), _ = t("../common/SmoothLoader"), g = t("../common/ToolBox"), v = t("../Config"), b = t("../kingdom/Kingdom"), T = t("../map/layer/ConwayLife"), w = t("../map/map/MapStats"), B = t("../MapBox"), k = t("../world/WorldLaws"), A = t("./SavedMap"), S = cc._decorator, x = S.ccclass, C = (S.property, 
function(t) {
a(e, t);
function e() {
var e = null !== t && t.apply(this, arguments) || this;
e.data = null;
return e;
}
i = e;
e.prototype.start = function() {};
e.prototype.saveSlot = function() {
this.saveMapData();
this.savePreview();
};
e.prototype.currentWorldToSavedMap = function() {
var t = new A.default();
t.create();
return t;
};
e.deleteSave = function() {
c.default.remove(i.getMetaPath());
c.default.remove(i.getDataPath());
c.default.remove(i.getPreviewPath());
};
e.prototype.saveMapData = function() {
var t = this.currentWorldToSavedMap();
i.saveMetaData(t.getMeta());
c.default.set(i.getDataPath(), t.toZip());
};
e.saveMetaData = function(t, e) {
void 0 === e && (e = -1);
c.default.set(i.getMetaPath(e), t.toJson());
};
e.slotMeta = function(t) {
void 0 === t && (t = -1);
if (i.slotMetaExists(t)) {
var e = c.default.get(i.getMetaPath(t));
return u.default.fromJson(JSON.parse(e), new A.MapMetaData());
}
if (i.slotExists(t)) {
i.saveMetaData(i.getMapForSlot(t).getMeta(), t);
if (i.slotMetaExists(t)) return i.slotMeta(t);
}
return null;
};
e.slotExists = function(t) {
void 0 === t && (t = -1);
return !!c.default.get(i.getDataPath(t));
};
e.slotMetaExists = function(t) {
void 0 === t && (t = -1);
return !!c.default.get(i.getMetaPath(t));
};
e.prototype.savePreview = function() {
var t = s.default.encodeFromUint8Array(B.default.inst.worldLayer.getTextureData()), e = new A.SavedPreview(i.getSlot(), B.default.width, B.default.height, t), o = i.dataToZippedBase64(e);
c.default.set(i.getPreviewPath(), o);
};
e.getPreview = function(t) {
var e = null, o = c.default.get(i.getPreviewPath(t));
if (o) {
var a = i.decodeZippedBase64(o);
e = JSON.parse(a);
}
return e;
};
e.getSlot = function(t) {
void 0 === t && (t = -1);
return -1 == t ? v.default.currentSlot : t;
};
e.getDirPath = function(t) {
void 0 === t && (t = -1);
t = i.getSlot(t);
return i.getSaveDirPath() + "save" + t;
};
e.getSaveDirPath = function() {
return i.persistentDataPath + i.folder_base;
};
e.getDataPath = function(t) {
void 0 === t && (t = -1);
return i.getDirPath(t) + i.dataName;
};
e.getMetaPath = function(t) {
void 0 === t && (t = -1);
return i.getDirPath(t) + i.metaDataName;
};
e.getPreviewPath = function(t) {
void 0 === t && (t = -1);
return i.getDirPath(t) + i.previewName;
};
e.prototype.loadSlot = function(t) {
void 0 === t && (t = -1);
try {
var e = i.getMapForSlot(t);
this.loadData(e);
} catch (e) {
l.default.d("Error during loading of slot " + t);
try {
i.slotMetaExists(t) ? l.default.d(JSON.stringify(i.slotMeta(t))) : l.default.d("No meta data");
} catch (t) {
l.default.d("Failed to load meta data");
}
l.default.e(e);
}
};
e.loadString = function(t) {
var e = i.decodeZippedBase64(t), o = u.default.fromJson(JSON.parse(e), new A.default());
B.default.inst.saveManager.loadData(o);
};
e.loadMapFromResources = function(t) {
i.loadString(c.default.get(t));
};
e.getMapForSlot = function(t) {
void 0 === t && (t = -1);
var e = i.getDataPath(t);
if (c.default.get(e)) {
var o = c.default.get(e), a = i.decodeZippedBase64(o);
return u.default.fromJson(JSON.parse(a), new A.default());
}
return null;
};
e.prototype.startLoadSlot = function(t) {
void 0 === t && (t = -1);
};
e.prototype.loadTiles = function(t) {
var e, i, o = t.split(","), a = v.default.ZONE_AMOUNT_X;
if (this.data.saveVersion < 7) {
for (var r = [], s = 0, l = 0, c = 0; c < B.default.inst.tilesList.length; c++) {
if (l >= 50 * a) {
l = 0;
s += 14 * a;
}
var u = c + s;
if (u <= B.default.inst.tilesList.length) {
r[u] = o[c];
l++;
}
}
o = r;
}
try {
for (var d = n(B.default.inst.tilesList), h = d.next(); !h.done; h = d.next()) {
var p = h.value;
if (p.data.tile_id >= o.length || !o[p.data.tile_id]) p.setTileType("deep_ocean"); else {
var f = o[p.data.tile_id].split(":"), m = 2 == f.length ? f[1] : null, y = f[0];
"waterBomb" == y && (y = "water_bomb");
p.setTileType(y);
p.Height = p.type.heightMin;
p.type.lava && B.default.inst.lavaLayer.loadLavaTile(p);
"grey_goo" == y && B.default.inst.greyGooLayer.add(p);
if (m) {
m.includes("fire") && (p.data.fire = !0);
if (m.includes("conv0")) {
p.data.conwayType = T.ConwayType.Eater;
B.default.inst.conwayLayer.add(p, "conway");
}
if (m.includes("conv1")) {
p.data.conwayType = T.ConwayType.Creator;
B.default.inst.conwayLayer.add(p, "conwayInverse");
}
}
}
}
} catch (t) {
e = {
error: t
};
} finally {
try {
h && !h.done && (i = d.return) && i.call(d);
} finally {
if (e) throw e.error;
}
}
};
e.prototype.loadTileArray = function(t) {
var e;
if (0 != t.tileAmounts.length) {
for (var i = t.width * t.height * 4096, o = 0, a = 0; a < t.tileArray.length; a++) for (var r = 0; r < t.tileArray[a].length; r++) for (var n = null !== (e = t.tileMap[t.tileArray[a][r]]) && void 0 !== e ? e : "deep_ocean", s = 0; s < t.tileAmounts[a][r]; s++) {
var c = B.default.inst.tilesList[o++];
c.setTileType(n);
c.Height = c.type.heightMin;
c.type.lava && B.default.inst.lavaLayer.loadLavaTile(c);
"grey_goo" == n && B.default.inst.greyGooLayer.add(c);
}
for (;o + 1 < i; ) {
l.default.d("deep ocean " + o);
B.default.inst.tilesList[o++].setTileType("deep_ocean");
}
}
};
e.prototype.loadConway = function(t, e) {
if (0 != t.length || 0 != e.length) {
for (var i = 0; i < t.length; i++) {
B.default.inst.tilesList[t[i]].data.conwayType = T.ConwayType.Eater;
B.default.inst.conwayLayer.add(B.default.inst.tilesList[t[i]], "conway");
}
for (var o = 0; o < e.length; o++) {
B.default.inst.tilesList[e[o]].data.conwayType = T.ConwayType.Creator;
B.default.inst.conwayLayer.add(B.default.inst.tilesList[e[o]], "conwayInverse");
}
}
};
e.prototype.loadFire = function(t) {
if (0 != t.length) for (var e = 0; e < t.length; e++) B.default.inst.tilesList[t[e]].data.fire = !0;
};
e.prototype.loadData = function(t) {
var e = this;
this.data = t;
_.default.prepare();
_.default.add(function() {
B.default.inst.clearWorld();
}, "clearWorld");
_.default.add(function() {
B.default.inst.setMapSize(t.width, t.height);
B.default.inst.mapStats = u.default.fromJson(t.mapStats, new w.default());
B.default.inst.worldLaws = u.default.fromJson(t.worldLaws, new k.default());
B.default.inst.worldLaws.check();
}, "setMapSize");
if (t.saveVersion > 0 && t.saveVersion < 8) _.default.add(function() {
e.loadTiles(t.tileString);
}, "loadTiles"); else if (t.saveVersion > 7) {
_.default.add(function() {
e.loadTileArray(t);
}, "loadTileArray");
_.default.add(function() {
e.loadFire(t.fire);
}, "loadFire");
_.default.add(function() {
e.loadConway(t.conwayEater, t.conwayCreator);
}, "loadConway");
} else _.default.add(function() {
t.tiles.forEach(function(t) {
var e = B.default.inst.getTileSimple(t.x, t.y);
e.setTileType(t.type);
e.data = t;
t.conwayType != T.ConwayType.None && B.default.inst.conwayLayer.add(e, "conway");
"grey_goo" == t.type && B.default.inst.greyGooLayer.add(e);
});
}, "loadOldTiles");
_.default.add(function() {
t.kingdoms.forEach(function(i) {
var o = b.default.initWithData(i);
B.default.inst.kingdoms.addKingdom(o, !0);
o.data.raceID || e.tryToFixMissingRace(t);
o.load1();
});
}, "loadKingdoms");
_.default.add(function() {
var i, o;
try {
for (var a = n(t.cities), r = a.next(); !r.done; r = a.next()) {
var s = r.value;
if (0 != s.zones.length) {
s.storage && (s.storage = u.default.fromJson(s.storage, new y.default()));
"ork" == s.race && (s.race = "orc");
var l = B.default.inst.zoneCalculator.getZone(s.zones[0].x, s.zones[0].y);
t.saveVersion < 7 && (l = e.findZoneViaBuilding(s.cityID, t.buildings));
if (l) {
var c = B.default.inst.buildNewCity(l, s, null, !0);
if (c && !(t.saveVersion < 7)) for (var d = 1; d < s.zones.length; d++) {
var h = s.zones[d], p = B.default.inst.zoneCalculator.getZone(h.x, h.y);
p && c.addZone(p);
}
}
}
}
} catch (t) {
i = {
error: t
};
} finally {
try {
r && !r.done && (o = a.return) && o.call(a);
} finally {
if (i) throw i.error;
}
}
}, "loadCities");
_.default.add(function() {
var e, i, o = function(e) {
var i = u.default.fromJson(e, new d.ActorData()), o = B.default.inst.getTile(i.x, i.y);
if (!i.status.alive) return "continue";
"food" == i.inventory.resource && (i.inventory.resource = "wheat");
i.status.gender == d.ActorGender.Unknown && (g.Toolbox.randomBool() ? i.status.gender = d.ActorGender.Male : i.status.gender = d.ActorGender.Female);
var a = B.default.inst.spawnAndLoadUnit(i.status.statsID, i, o);
if (!a || t.saveVersion >= 6) return "continue";
a.stats.traits.forEach(function(t) {
a.addTrait(t);
});
};
try {
for (var a = n(t.actors), r = a.next(); !r.done; r = a.next()) o(r.value);
} catch (t) {
e = {
error: t
};
} finally {
try {
r && !r.done && (i = a.return) && i.call(a);
} finally {
if (e) throw e.error;
}
}
}, "loadActors");
_.default.add(function() {
B.default.inst.units.checkAddRemove();
}, "Finish Loading Actors");
t.saveVersion < 7 && _.default.add(function() {
var e, i;
try {
for (var o = n(t.buildings), a = o.next(); !a.done; a = o.next()) {
var r = a.value, s = B.default.inst.getCityByID(r.cityID);
if (s) {
var l = B.default.inst.getTile(r.mainX, r.mainY);
s.addZone(l.zone);
}
}
} catch (t) {
e = {
error: t
};
} finally {
try {
a && !a.done && (i = o.return) && i.call(o);
} finally {
if (e) throw e.error;
}
}
}, "checkOldCityZones");
_.default.add(function() {
var e, i;
try {
for (var o = n(t.buildings), a = o.next(); !a.done; a = o.next()) {
var r = a.value;
r.templateID.includes("ork") && (r.templateID = r.templateID.replace("ork", "orc"));
p.default.buildings.get(r.templateID) && B.default.inst.loadBuilding(r);
}
} catch (t) {
e = {
error: t
};
} finally {
try {
a && !a.done && (i = o.return) && i.call(o);
} finally {
if (e) throw e.error;
}
}
}, "loadBuildings");
_.default.add(function() {
var t, e;
try {
for (var i = n(B.default.inst.units.list), o = i.next(); !o.done; o = i.next()) {
var a = o.value;
if (a.data.homeBuildingID) {
a.homeBuilding = B.default.inst.getBuildingByID(a.data.homeBuildingID);
if (a.homeBuilding && !a.homeBuilding.isNonUsable()) {
if (a.stats.isBoat) {
var r = B.default.inst.getBuildingByID(a.data.homeBuildingID);
r && r.getComponent(f.default).addBoatToDock(a);
}
a.homeBuilding.getComponent(m.default) && a.homeBuilding.getComponent(m.default).setUnitFromHere(a);
}
}
}
} catch (e) {
t = {
error: e
};
} finally {
try {
o && !o.done && (e = i.return) && e.call(i);
} finally {
if (t) throw t.error;
}
}
B.default.inst.buildings.checkAddRemove();
}, "setHomeBuildings");
_.default.add(function() {
var t, e;
try {
for (var i = n(B.default.inst.kingdoms.list_civs), o = i.next(); !o.done; o = i.next()) o.value.load2();
} catch (e) {
t = {
error: e
};
} finally {
try {
o && !o.done && (e = i.return) && e.call(i);
} finally {
if (t) throw t.error;
}
}
}, "loadCivs02");
_.default.add(function() {
var t, e;
try {
for (var i = n(B.default.inst.citiesList), o = i.next(); !o.done; o = i.next()) o.value.loadLeader();
} catch (e) {
t = {
error: e
};
} finally {
try {
o && !o.done && (e = i.return) && e.call(i);
} finally {
if (t) throw t.error;
}
}
}, "loadLeaders");
_.default.add(function() {
B.default.inst.kingdoms.checkKingdoms();
B.default.inst.kingdoms.diplomacyManager.load(t.relations);
}, "loadDiplomacy");
_.default.add(function() {
var t, e;
try {
for (var i = n(B.default.inst.units.list), o = i.next(); !o.done; o = i.next()) {
var a = o.value;
if (a.data.transportID) {
var r = B.default.inst.getActorByID(a.data.transportID);
if (r) {
a.embarkInto(r.getComponent(h.default));
a.ai.setTask("sit_inside_boat");
a.ai.logicUpdate(cc.director.getDeltaTime());
}
}
}
} catch (e) {
t = {
error: e
};
} finally {
try {
o && !o.done && (e = i.return) && e.call(i);
} finally {
if (t) throw t.error;
}
}
}, "loadBoatStates");
_.default.add(function() {
B.default.inst.finishMakingWorld();
}, "finishMakingWorld");
};
e.prototype.tryToFixMissingRace = function(t) {
var e, i, o, a, r = !1;
try {
for (var s = n(t.kingdoms), l = s.next(); !l.done; l = s.next()) {
var c = l.value;
if (!c.raceID) try {
for (var u = (o = void 0, n(t.cities)), d = u.next(); !d.done; d = u.next()) {
var h = d.value;
if (h.kingdomID == c.id && h.race) {
c.raceID = h.race;
r = !0;
break;
}
}
} catch (t) {
o = {
error: t
};
} finally {
try {
d && !d.done && (a = u.return) && a.call(u);
} finally {
if (o) throw o.error;
}
}
}
} catch (t) {
e = {
error: t
};
} finally {
try {
l && !l.done && (i = s.return) && i.call(s);
} finally {
if (e) throw e.error;
}
}
return r;
};
e.prototype.findZoneViaBuilding = function(t, e) {
var i, o;
try {
for (var a = n(e), r = a.next(); !r.done; r = a.next()) {
var s = r.value;
if (s.cityID == t) return B.default.inst.getTile(s.mainX, s.mainY).zone;
}
} catch (t) {
i = {
error: t
};
} finally {
try {
r && !r.done && (o = a.return) && o.call(a);
} finally {
if (i) throw i.error;
}
}
return null;
};
e.dataToZippedBase64 = function(t) {
var e = JSON.stringify(t), i = pako.deflate(e);
return s.default.encodeFromUint8Array(i);
};
e.decodeZippedBase64 = function(t) {
var e = s.default.decodeToUnit8Array(t);
return pako.inflate(e, {
to: "string"
});
};
var i;
e.folder_base = "/saves/";
e.dataName = "/map.wbox";
e.metaDataName = "/map.meta";
e.previewName = "/preview.txt";
e.persistentDataPath = "worldbox2";
return i = r([ x ], e);
}(cc.Component));
i.default = C;
cc._RF.pop();
}, {
"../../../../framework/lib/base64/Base64": void 0,
"../../../../framework/utils/Log": void 0,
"../../../../framework/utils/SaveUtils": void 0,
"../../../../framework/utils/Tools": void 0,
"../Config": "Config",
"../MapBox": "MapBox",
"../actors/ActorStatus": "ActorStatus",
"../actors/other/boat/Boat": "Boat",
"../assetLibrary/AssetManager": "AssetManager",
"../building/Docks": "Docks",
"../building/UnitSpawner": "UnitSpawner",
"../city/CityStorage": "CityStorage",
"../common/SmoothLoader": "SmoothLoader",
"../common/ToolBox": "ToolBox",
"../kingdom/Kingdom": "Kingdom",
"../map/layer/ConwayLife": "ConwayLife",
"../map/map/MapStats": "MapStats",
"../world/WorldLaws": "WorldLaws",
"./SavedMap": "SavedMap"
} ],
SavePopup: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "e0dbeJtqIlLFaVKXeOzXxGj", "SavePopup");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
}), r = this && this.__decorate || function(t, e, i, o) {
var a, r = arguments.length, n = r < 3 ? e : null === o ? o = Object.getOwnPropertyDescriptor(e, i) : o;
if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) n = Reflect.decorate(t, e, i, o); else for (var s = t.length - 1; s >= 0; s--) (a = t[s]) && (n = (r < 3 ? a(n) : r > 3 ? a(e, i, n) : a(e, i)) || n);
return r > 3 && n && Object.defineProperty(e, i, n), n;
};
Object.defineProperty(i, "__esModule", {
value: !0
});
var n = t("../../../../framework/lib/base64/Base64"), s = t("../../../../framework/main/Constants"), l = t("../../../common/src/advert/AdsManager"), c = t("../../../common/src/data/AchievData"), u = t("../../../common/src/data/UserData"), d = t("../../../common/src/module/LoadLayer"), h = t("../../../common/src/MsgCache"), p = t("../Config"), f = t("../MapBox"), m = t("./SaveItem"), y = t("./SaveManager"), _ = cc._decorator, g = _.ccclass, v = _.property, b = function(t) {
a(e, t);
function e() {
var e = null !== t && t.apply(this, arguments) || this;
e.buttonDelete = null;
e.buttonLoad = null;
e.buttonSave = null;
e.videoNode = null;
e.previewItem = null;
e.titleLabel = null;
e.status = null;
e.population = null;
e.kingdoms = null;
e.cities = null;
e.houses = null;
e.zones = null;
e.slotId = -1;
e.callback = null;
e.clicked = !1;
return e;
}
i = e;
e.prototype.onLoad = function() {
i.inst = this;
};
e.prototype.init = function(t, e) {
this.callback = e;
this.clicked = !1;
var i = null, o = 0, a = 0, r = y.default.getPreview(t);
if (r) {
i = n.default.decodeToUnit8Array(r.textureDataBase64);
o = r.width;
a = r.height;
} else {
i = f.default.inst.worldLayer.getTextureData();
o = f.default.width;
a = f.default.height;
}
this.previewItem.init(t, i, o, a);
t == p.default.quickSaveSlotId ? this.titleLabel.string = "自动存档" : this.titleLabel.string = "存档 " + (t + 1);
this.slotId = t;
var s = y.default.slotExists(t);
this.videoNode.active = !u.default.member.unLockSave[t];
this.buttonDelete.interactable = s && t != p.default.quickSaveSlotId;
this.buttonDelete.node.active = s && t != p.default.quickSaveSlotId;
this.buttonLoad.interactable = s;
this.buttonSave.interactable = t != p.default.quickSaveSlotId;
this.buttonSave.node.active = t != p.default.quickSaveSlotId;
var l = y.default.slotMeta(p.default.currentSlot);
if (l) {
this.status.active = !0;
this.population.string = l.population.toString();
this.kingdoms.string = l.kingdoms.toString();
this.cities.string = l.cities.toString();
this.houses.string = l.buildings.toString();
this.zones.string = l.width.toString();
} else this.status.active = !1;
};
e.prototype.onDeleteClicked = function() {
var t = this;
if (!this.clicked) {
this.clicked = !0;
h.default.showMsgBox("是否删除此存档？", function(e) {
if (1 == e) {
y.default.deleteSave();
h.default.showMsgBox("删除成功！", function() {
t.callback && t.callback();
}, !1);
} else t.clicked = !1;
});
}
};
e.prototype.onLoadClicked = function() {
var t = this, e = this.slotId;
h.default.showMsgBox("是否加载此存档？\n\n警告：当前世界将会消失", function(i) {
if (1 == i) {
t.callback && t.callback();
d.LoadLayer.openLoading().then(function() {
setTimeout(function() {
f.default.inst.saveManager.loadSlot(e);
}, 20);
});
}
});
};
e.prototype.onSaveClicked = function() {
var t = this;
if (!this.clicked) {
this.clicked = !0;
if (y.default.slotExists(this.slotId)) h.default.showMsgBox("是否存储到这个位置？\n此位置的存档将会被覆盖！", function(e) {
1 == e ? t.doSave() : t.clicked = !1;
}); else if (this.videoNode.active) {
s.default.REPORT_ID = "saveWorld";
l.default.showVideoAds(function(e) {
if (1 == e) {
t.doSave();
u.default.member.unLockSave[t.slotId] = !0;
u.default.save();
} else {
t.clicked = !1;
var i = 0 == e ? "视频播放未完成。" : "视频播放失败，请稍候再试！";
h.default.pushToast(i);
}
});
} else this.doSave();
}
};
e.prototype.doSave = function() {
var t = this;
if (!u.default.member.saved) {
u.default.member.saved = !0;
u.default.save();
}
f.default.inst.saveManager.saveSlot();
c.default.update(11);
h.default.showMsgBox("存档成功！", function() {
t.callback && t.callback();
}, !1);
};
var i;
e.inst = null;
r([ v({
type: cc.Button,
tooltip: "删除按钮"
}) ], e.prototype, "buttonDelete", void 0);
r([ v({
type: cc.Button,
tooltip: "加载按钮"
}) ], e.prototype, "buttonLoad", void 0);
r([ v({
type: cc.Button,
tooltip: "保存按钮"
}) ], e.prototype, "buttonSave", void 0);
r([ v({
type: cc.Node,
tooltip: "视频节点"
}) ], e.prototype, "videoNode", void 0);
r([ v({
type: m.default,
tooltip: "预览图"
}) ], e.prototype, "previewItem", void 0);
r([ v({
type: cc.Label,
tooltip: "Title"
}) ], e.prototype, "titleLabel", void 0);
r([ v({
type: cc.Node,
tooltip: "世界信息"
}) ], e.prototype, "status", void 0);
r([ v({
type: cc.Label,
tooltip: "世界人口"
}) ], e.prototype, "population", void 0);
r([ v({
type: cc.Label,
tooltip: "王国数量"
}) ], e.prototype, "kingdoms", void 0);
r([ v({
type: cc.Label,
tooltip: "城市数量"
}) ], e.prototype, "cities", void 0);
r([ v({
type: cc.Label,
tooltip: "建筑数量"
}) ], e.prototype, "houses", void 0);
r([ v({
type: cc.Label,
tooltip: "区域数量"
}) ], e.prototype, "zones", void 0);
return i = r([ g ], e);
}(cc.Component);
i.default = b;
cc._RF.pop();
}, {
"../../../../framework/lib/base64/Base64": void 0,
"../../../../framework/main/Constants": void 0,
"../../../common/src/MsgCache": void 0,
"../../../common/src/advert/AdsManager": void 0,
"../../../common/src/data/AchievData": void 0,
"../../../common/src/data/UserData": void 0,
"../../../common/src/module/LoadLayer": void 0,
"../Config": "Config",
"../MapBox": "MapBox",
"./SaveItem": "SaveItem",
"./SaveManager": "SaveManager"
} ],
SavedMap: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "8450f6KgQxPxIW4ezCoWkre", "SavedMap");
var o = this && this.__values || function(t) {
var e = "function" == typeof Symbol && Symbol.iterator, i = e && t[e], o = 0;
if (i) return i.call(t);
if (t && "number" == typeof t.length) return {
next: function() {
t && o >= t.length && (t = void 0);
return {
value: t && t[o++],
done: !t
};
}
};
throw new TypeError(e ? "Object is not iterable." : "Symbol.iterator is not defined.");
};
Object.defineProperty(i, "__esModule", {
value: !0
});
i.SavedPreview = i.MapMetaData = void 0;
var a = t("../../../../framework/lib/base64/Base64"), r = t("../actors/ActorStatus"), n = t("../assetLibrary/AssetManager"), s = t("../Config"), l = t("../map/layer/ConwayLife"), c = t("../map/map/MapStats"), u = t("../map/tile/TileZone"), d = t("../MapBox"), h = t("../world/WorldLaws"), p = function() {
function t() {
this.saveVersion = 0;
this.width = 0;
this.height = 0;
this.mapStats = new c.default();
this.cities = 0;
this.units = 0;
this.population = 0;
this.buildings = 0;
this.structures = 0;
this.kingdoms = 0;
this.races = [];
}
t.prototype.toJson = function() {
return JSON.stringify(this);
};
return t;
}();
i.MapMetaData = p;
i.SavedPreview = function(t, e, i, o) {
this.slotId = 0;
this.width = 0;
this.height = 0;
this.textureDataBase64 = "";
this.slotId = t;
this.width = e;
this.height = i;
this.textureDataBase64 = o;
};
var f = function() {
function t() {
this.saveVersion = 0;
this.width = 0;
this.height = 0;
this.mapStats = new c.default();
this.worldLaws = new h.default();
this.tileString = "";
this.tileMap = [];
this.tileArray = [];
this.tileAmounts = [];
this.fire = [];
this.conwayEater = [];
this.conwayCreator = [];
this.tiles = [];
this.cities = [];
this.actors = [];
this.buildings = [];
this.kingdoms = [];
this.relations = [];
this.width = s.default.ZONE_AMOUNT_X_DEFAULT;
this.height = s.default.ZONE_AMOUNT_Y_DEFAULT;
}
t.prototype.getTileMapID = function(t) {
this.tileMap.includes(t) || this.tileMap.push(t);
return this.tileMap.indexOf(t);
};
t.prototype.create = function() {
var t, e, i, a, n = this;
this.width = s.default.ZONE_AMOUNT_X;
this.height = s.default.ZONE_AMOUNT_Y;
this.saveVersion = s.default.WORLD_SAVE_VERSION;
this.mapStats = d.default.inst.mapStats;
this.worldLaws = d.default.inst.worldLaws;
this.mapStats.population = d.default.inst.units.length;
this.kingdoms = d.default.inst.kingdoms.save();
this.relations = d.default.inst.kingdoms.diplomacyManager.save();
d.default.inst.citiesList.forEach(function(t) {
var e = t.data;
e.storage.save();
e.zones.clear();
t.zones.forEach(function(t) {
var i = new u.ZoneData();
i.x = t.x;
i.y = t.y;
e.zones.push(i);
});
n.cities.push(e);
});
this.tileMap.clear();
this.fire.clear();
this.conwayEater.clear();
this.conwayCreator.clear();
var c = [], h = [], p = "", f = 0, m = 0;
c.push([]);
h.push([]);
var y = 0;
d.default.inst.tilesList.forEach(function(t) {
if (t.type.name != p || m != t.pos.y) {
if (f > 0) {
h[m][y] = f;
c[m][y++] = n.getTileMapID(p);
f = 0;
}
p = t.type.name;
if (m != t.pos.y) {
m = t.pos.y;
c.push([]);
h.push([]);
y = 0;
}
}
f++;
t.data.fire && n.fire.push(t.data.tile_id);
t.data.conwayType == l.ConwayType.Eater && n.conwayEater.push(t.data.tile_id);
t.data.conwayType == l.ConwayType.Creator && n.conwayCreator.push(t.data.tile_id);
});
if (f > 0) {
h[m][y] = f;
c[m][y++] = this.getTileMapID(p);
}
this.tileArray = Array.from(c);
this.tileAmounts = Array.from(h);
c = [];
h = [];
try {
for (var _ = o(d.default.inst.units.list), g = _.next(); !g.done; g = _.next()) {
var v = g.value;
if ((null === (i = v.data) || void 0 === i ? void 0 : i.alive) && !v.stats.skipSave) {
var b = new r.ActorData();
b.status = v.data;
b.x = v.currentTile.pos.x;
b.y = v.currentTile.pos.y;
b.inventory = v.inventory;
if (v.equipment) {
var T = v.equipment.getDataForSave();
T.length > 0 && (b.items = T);
}
"livingPlants" != v.stats.id && "livingHouse" != v.stats.id || (b.special = v.spriteRenderer.spriteFrame.name);
(null === (a = v.city) || void 0 === a ? void 0 : a.data) && (b.cityID = v.city.data.cityID);
this.actors.push(b);
}
}
} catch (e) {
t = {
error: e
};
} finally {
try {
g && !g.done && (e = _.return) && e.call(_);
} finally {
if (t) throw t.error;
}
}
d.default.inst.buildings.list.forEach(function(t) {
n.buildings.push(t.data);
});
};
t.prototype.toJson = function() {
this.worldLaws || this.create();
return JSON.stringify(this);
};
t.prototype.toZip = function() {
var t = this.toJson(), e = pako.deflate(t);
return a.default.encodeFromUint8Array(e);
};
t.prototype.getMeta = function() {
var t = new p(), e = [], i = 0;
this.actors.forEach(function(t) {
var o = n.default.unitStats.get(t.status.statsID);
if (o.unit) {
i++;
e.includes(o.race) || e.push(o.race);
}
});
this.cities.forEach(function(t) {
i += t.popPoints.length;
});
t.saveVersion = this.saveVersion;
t.width = this.width;
t.height = this.height;
t.mapStats = this.mapStats;
t.cities = this.cities.length;
t.units = this.actors.length;
t.population = i;
var o = 0, a = 0;
this.buildings.forEach(function(t) {
t.cityID && o++;
a++;
});
t.buildings = o;
t.structures = a;
t.kingdoms = this.kingdoms.length;
t.races = e;
return t;
};
return t;
}();
i.default = f;
cc._RF.pop();
}, {
"../../../../framework/lib/base64/Base64": void 0,
"../Config": "Config",
"../MapBox": "MapBox",
"../actors/ActorStatus": "ActorStatus",
"../assetLibrary/AssetManager": "AssetManager",
"../map/layer/ConwayLife": "ConwayLife",
"../map/map/MapStats": "MapStats",
"../map/tile/TileZone": "TileZone",
"../world/WorldLaws": "WorldLaws"
} ],
SelectedPowerNameTip: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "7a553PKRApIvoDW4TUQBIvC", "SelectedPowerNameTip");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
}), r = this && this.__decorate || function(t, e, i, o) {
var a, r = arguments.length, n = r < 3 ? e : null === o ? o = Object.getOwnPropertyDescriptor(e, i) : o;
if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) n = Reflect.decorate(t, e, i, o); else for (var s = t.length - 1; s >= 0; s--) (a = t[s]) && (n = (r < 3 ? a(n) : r > 3 ? a(e, i, n) : a(e, i)) || n);
return r > 3 && n && Object.defineProperty(e, i, n), n;
};
Object.defineProperty(i, "__esModule", {
value: !0
});
i.SelectedPowerNameTip = void 0;
var n, s = t("../../../../common/src/text/LocalizedTextManager"), l = cc._decorator, c = l.ccclass, u = l.property;
(function(t) {
t[t.Hidden = 0] = "Hidden";
t[t.OnShow = 1] = "OnShow";
t[t.Shown = 2] = "Shown";
})(n || (n = {}));
var d = function(t) {
a(e, t);
function e() {
var e = null !== t && t.apply(this, arguments) || this;
e.text = null;
e.timeout = 0;
e.timeoutMax = 3;
e.scale = 1;
e.status = n.Hidden;
return e;
}
i = e;
e.prototype.onLoad = function() {
i.inst = this;
};
e.prototype.setText = function(t) {
this.text.string = s.LocalizedTextManager.getGodPowerName(t) + "\n" + s.LocalizedTextManager.getGodPowerDesc(t);
this.startShow();
};
e.prototype.startShow = function() {
this.status = n.Shown;
cc.Tween.stopAllByTarget(this.text.node);
cc.tween(this.text.node).to(.2, {
opacity: 255
}).delay(3).to(.2, {
opacity: 0
}).start();
};
var i;
e.inst = null;
r([ u(cc.Label) ], e.prototype, "text", void 0);
return i = r([ c ], e);
}(cc.Component);
i.SelectedPowerNameTip = d;
cc._RF.pop();
}, {
"../../../../common/src/text/LocalizedTextManager": void 0
} ],
Setting: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "082b9KonWtGp78fkLEbocxU", "Setting");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
}), r = this && this.__decorate || function(t, e, i, o) {
var a, r = arguments.length, n = r < 3 ? e : null === o ? o = Object.getOwnPropertyDescriptor(e, i) : o;
if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) n = Reflect.decorate(t, e, i, o); else for (var s = t.length - 1; s >= 0; s--) (a = t[s]) && (n = (r < 3 ? a(n) : r > 3 ? a(e, i, n) : a(e, i)) || n);
return r > 3 && n && Object.defineProperty(e, i, n), n;
};
Object.defineProperty(i, "__esModule", {
value: !0
});
var n = t("../../../../../framework/manager/AudioMgr"), s = t("../../../../../start/src/Agreement"), l = t("../../../../common/src/GamePopBase"), c = t("../../game/audio/GameAudio"), u = cc._decorator, d = u.ccclass, h = u.property, p = function(t) {
a(e, t);
function e() {
var e = null !== t && t.apply(this, arguments) || this;
e.music = null;
e.sound = null;
e.prefab = null;
e.ndBtn = null;
e.ndMail = null;
return e;
}
e.prototype.onLoad = function() {
this.music.isChecked = n.default.getSoundValue().isBgmOpen;
this.sound.isChecked = n.default.getSoundValue().isEffectOpen;
this.ndBtn.active = OPPO_GAME || VIVO_GAME || JSB_OPPO || JSB_VIVO || QQ_GAME || JSB_233 || XIAOMI_GAME || JSB_IOS;
this.ndMail.active = OPPO_GAME || VIVO_GAME || JSB_OPPO || JSB_VIVO || QQ_GAME || JSB_233 || JSB_IOS;
this.ndMail.getComponent(cc.Label).string = JSB_IOS ? "客服反馈邮箱：591085663@qq.com" : "客服反馈邮箱：1554248792@qq.com";
};
e.prototype.close = function() {
n.default.saveSoundData();
t.prototype.close.call(this);
};
e.prototype.onClickToggle = function(t) {
c.default.playClick();
"musicToggle" == t.node.name && n.default.setMusicIsOpen(t.isChecked);
"soundToggle" == t.node.name && n.default.setEffectIsOpen(t.isChecked);
};
e.prototype.onClickPrivacy = function(t, e) {
var i = cc.instantiate(this.prefab);
i.parent = cc.director.getScene();
i.position = cc.v3(cc.winSize.width / 2, cc.winSize.height / 2);
i.getComponent(s.default).init(function() {}, e);
};
r([ h(cc.Toggle) ], e.prototype, "music", void 0);
r([ h(cc.Toggle) ], e.prototype, "sound", void 0);
r([ h(cc.Prefab) ], e.prototype, "prefab", void 0);
r([ h(cc.Node) ], e.prototype, "ndBtn", void 0);
r([ h(cc.Node) ], e.prototype, "ndMail", void 0);
return r([ d ], e);
}(l.GamePopBase);
i.default = p;
cc._RF.pop();
}, {
"../../../../../framework/manager/AudioMgr": void 0,
"../../../../../start/src/Agreement": void 0,
"../../../../common/src/GamePopBase": void 0,
"../../game/audio/GameAudio": "GameAudio"
} ],
SignInSystem: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "389d6W5j3tKhadgCO+MVyyj", "SignInSystem");
var o = this && this.__decorate || function(t, e, i, o) {
var a, r = arguments.length, n = r < 3 ? e : null === o ? o = Object.getOwnPropertyDescriptor(e, i) : o;
if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) n = Reflect.decorate(t, e, i, o); else for (var s = t.length - 1; s >= 0; s--) (a = t[s]) && (n = (r < 3 ? a(n) : r > 3 ? a(e, i, n) : a(e, i)) || n);
return r > 3 && n && Object.defineProperty(e, i, n), n;
}, a = this && this.__values || function(t) {
var e = "function" == typeof Symbol && Symbol.iterator, i = e && t[e], o = 0;
if (i) return i.call(t);
if (t && "number" == typeof t.length) return {
next: function() {
t && o >= t.length && (t = void 0);
return {
value: t && t[o++],
done: !t
};
}
};
throw new TypeError(e ? "Object is not iterable." : "Symbol.iterator is not defined.");
};
Object.defineProperty(i, "__esModule", {
value: !0
});
var r = t("../../../../../common/src/data/AchievData"), n = t("../../../../../common/src/data/UserData"), s = cc._decorator, l = s.ccclass, c = (s.property, 
function() {
function t() {
this.index = 0;
this.signInStatus = [ n.SignInStatus.NotLogin, n.SignInStatus.NotLogin, n.SignInStatus.NotLogin, n.SignInStatus.NotLogin, n.SignInStatus.NotLogin, n.SignInStatus.NotLogin, n.SignInStatus.NotLogin ];
}
e = t;
t.prototype.initFromUserData = function() {
this.initSystem(n.default.member.firstPlayTime, n.default.member.lastSignInTime, n.default.member.signInStatus);
};
t.prototype.getCurrentSignIndex = function() {
return this.index;
};
t.prototype.getTodaySignStatus = function() {
return this.signInStatus[this.index];
};
t.prototype.getSignStatus = function(t) {
return this.signInStatus[t];
};
t.prototype.signNormal = function(t) {
if (this.signInStatus[t] < n.SignInStatus.Normal) {
this.signInStatus[t] = n.SignInStatus.Normal;
n.default.member.lastSignInTime = cc.sys.now();
n.default.member.signInStatus = this.signInStatus;
n.default.member.signInDays++;
r.default.update(64, n.default.member.signInDays, !0);
n.default.save();
}
};
t.prototype.signVideo = function(t) {
if (this.signInStatus[t] < n.SignInStatus.Video) {
if (this.signInStatus[t] < n.SignInStatus.Normal) {
n.default.member.signInDays++;
r.default.update(64, n.default.member.signInDays, !0);
}
this.signInStatus[t] = n.SignInStatus.Video;
n.default.member.lastSignInTime = cc.sys.now();
n.default.member.signInStatus = this.signInStatus;
n.default.save();
}
};
t.prototype.gmOffsetFirstPlayDay = function(t) {
var e = n.default.member.firstPlayTime;
if (e > 0) {
var i = e + 864e5 * t;
if (i <= cc.sys.now()) {
n.default.member.firstPlayTime = i;
n.default.save();
return !0;
}
}
return !1;
};
t.prototype.gmOffsetLastSignInDay = function(t) {
var e = n.default.member.lastSignInTime;
if (e > 0) {
var i = e + 864e5 * t;
if (i <= cc.sys.now() && i >= n.default.member.firstPlayTime) {
n.default.member.lastSignInTime = i;
n.default.save();
return !0;
}
}
return !1;
};
t.prototype.initSystem = function(t, e, i) {
this.signInStatus = [ n.SignInStatus.NotLogin, n.SignInStatus.NotLogin, n.SignInStatus.NotLogin, n.SignInStatus.NotLogin, n.SignInStatus.NotLogin, n.SignInStatus.NotLogin, n.SignInStatus.NotLogin ];
var o = t > 0 ? new Date(t) : new Date(), a = e > 0 ? new Date(e) : new Date(), r = new Date(o.getFullYear(), o.getMonth(), o.getDate(), 0, 0, 0, 0), s = new Date(a.getFullYear(), a.getMonth(), a.getDate(), 0, 0, 0, 0).getTime() - r.getTime(), l = Math.floor(s / 864e5), c = new Date().getTime() - r.getTime(), u = Math.floor(c / 864e5);
this.index = u % 7;
if (Math.floor(l / 7) == Math.floor(u / 7)) for (var d = 0; d < 7; d++) this.signInStatus[d] = i[d];
return this.signInStatus;
};
t.prototype.getRewards = function(t, e) {
var i, o;
void 0 === e && (e = 1);
var r = [];
try {
for (var s = a(t), l = s.next(); !l.done; l = s.next()) {
var c = l.value, u = new n.PropConfig();
u.number = c.number * (1002 == c.propID ? 1 : e);
u.propID = c.propID;
u.propName = c.propName;
r.push(u);
}
} catch (t) {
i = {
error: t
};
} finally {
try {
l && !l.done && (o = s.return) && o.call(s);
} finally {
if (i) throw i.error;
}
}
return r;
};
var e;
t.inst = new e();
return o([ l ], t);
}());
i.default = c;
cc._RF.pop();
}, {
"../../../../../common/src/data/AchievData": void 0,
"../../../../../common/src/data/UserData": void 0
} ],
SignInView: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "4a281ipKqNFPZYhOUMLvnMO", "SignInView");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
}), r = this && this.__decorate || function(t, e, i, o) {
var a, r = arguments.length, n = r < 3 ? e : null === o ? o = Object.getOwnPropertyDescriptor(e, i) : o;
if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) n = Reflect.decorate(t, e, i, o); else for (var s = t.length - 1; s >= 0; s--) (a = t[s]) && (n = (r < 3 ? a(n) : r > 3 ? a(e, i, n) : a(e, i)) || n);
return r > 3 && n && Object.defineProperty(e, i, n), n;
};
Object.defineProperty(i, "__esModule", {
value: !0
});
var n = t("../../../../../../framework/main/Constants"), s = t("../../../../../../framework/utils/Tools"), l = t("../../../../../../framework/utils/UiUtil"), c = t("../../../../../../start/src/ShuFenReport"), u = t("../../../../../common/src/advert/AdsManager"), d = t("../../../../../common/src/data/RewardData"), h = t("../../../../../common/src/data/UserData"), p = t("../../../../../common/src/GamePopBase"), f = t("../../../../../common/src/MsgCache"), m = t("../../../common/ViewController"), y = t("../../../texture/TextureLoader"), _ = t("../AwardView"), g = t("./SignInSystem"), v = cc._decorator, b = v.ccclass, T = v.property, w = function(t) {
a(e, t);
function e() {
var e = null !== t && t.apply(this, arguments) || this;
e.dayNodes = [];
e.btnNormal = null;
e.btnVideo = null;
e.rewardIdx = 10;
e.curIdx = 0;
e.rewards = [];
e.lockIdx = [ 1, 1, 1, 2, 1, 1, 3 ];
return e;
}
e.prototype.onLoad = function() {
this.btnVideo.node.active = n.default.MODE != n.MODE_TYPE.LOCK;
};
e.prototype.start = function() {
g.default.inst.initFromUserData();
for (var t = 0; t < 7; t++) this.rewards[t] = n.default.MODE == n.MODE_TYPE.LOCK ? d.default.getLockPropConfig(this.lockIdx[t]) : d.default.getRewards(this.rewardIdx + t);
if (n.default.MODE == n.MODE_TYPE.LOCK) {
this.rewards[2][0] = s.default.fromJson(h.default.getPropConfigByID(1002), new h.PropConfig());
this.rewards[3][1] = s.default.fromJson(h.default.getPropConfigByID(1002), new h.PropConfig());
this.rewards[5][0] = s.default.fromJson(h.default.getPropConfigByID(1002), new h.PropConfig());
this.rewards[6][2] = s.default.fromJson(h.default.getPropConfigByID(1002), new h.PropConfig());
}
this.updateAllUi();
};
e.prototype.updateAllUi = function() {
this.curIdx = g.default.inst.getCurrentSignIndex();
for (var t = 0; t < this.dayNodes.length; t++) {
var e = this.dayNodes[t], i = g.default.inst.getSignStatus(t);
this.fillRewards(this.rewards[t], e.getChildByName("layout"));
e.getChildByName("highlight").active = t == this.curIdx;
e.getChildByName("btnGet").active = t < this.curIdx && i < h.SignInStatus.Normal;
e.getChildByName("mask").active = t <= this.curIdx && i >= h.SignInStatus.Normal;
}
var o = g.default.inst.getSignStatus(this.curIdx);
this.btnNormal.node.getChildByName("mask").active = o >= h.SignInStatus.Normal;
this.btnVideo.node.getChildByName("mask").active = o >= h.SignInStatus.Video;
var a = o < h.SignInStatus.Normal ? "三倍领取" : "获取双倍";
this.btnVideo.node.getChildByName("label").getComponent(cc.Label).string = a;
cc.sys.platform == cc.sys.WECHAT_GAME && n.default.MODE != n.MODE_TYPE.LOCK && this.updateBtnState();
};
e.prototype.fillRewards = function(t, e) {
for (var i = 0; i < 3; i++) {
var o = e.getChildByName("item" + i);
if (o) if (i >= t.length) o.active = !1; else {
o.active = !0;
var a = o.getChildByName("rare");
a.active = t[i].rare >= 0 && n.default.MODE != n.MODE_TYPE.LOCK;
if (a.active) {
var r = y.TextureLoader.inst.getSpriteFrame(y.ATLAS_TYPE.UIATLAS, "reward/rare_" + t[i].rare);
r && (a.getComponent(cc.Sprite).spriteFrame = r);
}
if (n.default.MODE != n.MODE_TYPE.LOCK || 1002 == t[i].propID) {
var s = o.getChildByName("icon"), l = y.TextureLoader.inst.getSpriteFrame(y.ATLAS_TYPE.UIATLAS, "propIcon/icon" + t[i].propID);
l && (s.getComponent(cc.Sprite).spriteFrame = l);
}
var c = o.getChildByName("num");
c.getComponent(cc.Label).string = "X" + t[i].number;
c.active = !1;
var u = h.default.getPropByID(t[i].propID);
if (!u) return;
n.default.MODE == n.MODE_TYPE.COUNT ? c.active = !0 : n.default.MODE == n.MODE_TYPE.ALL && (u.lock || (c.active = !0));
if (1002 == u.propID) {
c.active = !0;
c.getComponent(cc.Label).string = "X300";
}
}
}
};
e.prototype.updateBtnState = function() {
var t = g.default.inst.getTodaySignStatus();
this.btnNormal.node.active = t < h.SignInStatus.Normal;
this.btnVideo.node.active = !this.btnNormal.node.active && n.default.MODE == n.MODE_TYPE.COUNT;
};
e.prototype.onClickGetBack = function(t, e) {
l.UiUtil.btnEnabel(t);
this.showVideoAndSign(parseInt(e), !1);
};
e.prototype.onClickSignInNormal = function(t) {
l.UiUtil.btnEnabel(t);
g.default.inst.signNormal(this.curIdx);
this.getRewards(this.curIdx, 1);
c.default.reportCustom("signInNormal");
};
e.prototype.onClickSignInVideo = function(t) {
l.UiUtil.btnEnabel(t);
this.showVideoAndSign(this.curIdx, !0);
};
e.prototype.getRewards = function(t, e) {
void 0 === e && (e = 1);
this.updateAllUi();
var i = g.default.inst.getRewards(this.rewards[t], e);
m.default.open(m.view_type.AwardView, null, null, !0, function(t) {
t.getComponent(_.default).init(_.Reward_type.sign, i);
});
};
e.prototype.showVideoAndSign = function(t, e) {
var i = this;
n.default.REPORT_ID = "signInVideo";
u.default.showVideoAds(function(o) {
if (1 == o) {
var a = g.default.inst.getTodaySignStatus() < h.SignInStatus.Normal ? 3 : 2;
e ? g.default.inst.signVideo(t) : g.default.inst.signNormal(t);
i.getRewards(t, e ? a : 1);
} else {
var r = 0 == o ? "视频播放未完成。" : "视频播放失败，请稍候再试！";
f.default.pushToast(r);
}
});
};
r([ T({
type: [ cc.Node ],
tooltip: "1-7天的节点"
}) ], e.prototype, "dayNodes", void 0);
r([ T({
type: cc.Button,
tooltip: "普通签到"
}) ], e.prototype, "btnNormal", void 0);
r([ T({
type: cc.Button,
tooltip: "视频签到"
}) ], e.prototype, "btnVideo", void 0);
return r([ b ], e);
}(p.GamePopBase);
i.default = w;
cc._RF.pop();
}, {
"../../../../../../framework/main/Constants": void 0,
"../../../../../../framework/utils/Tools": void 0,
"../../../../../../framework/utils/UiUtil": void 0,
"../../../../../../start/src/ShuFenReport": void 0,
"../../../../../common/src/GamePopBase": void 0,
"../../../../../common/src/MsgCache": void 0,
"../../../../../common/src/advert/AdsManager": void 0,
"../../../../../common/src/data/RewardData": void 0,
"../../../../../common/src/data/UserData": void 0,
"../../../common/ViewController": "ViewController",
"../../../texture/TextureLoader": "TextureLoader",
"../AwardView": "AwardView",
"./SignInSystem": "SignInSystem"
} ],
Smoke: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "11632At5CFKCpUnOrPk16iY", "Smoke");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
}), r = this && this.__decorate || function(t, e, i, o) {
var a, r = arguments.length, n = r < 3 ? e : null === o ? o = Object.getOwnPropertyDescriptor(e, i) : o;
if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) n = Reflect.decorate(t, e, i, o); else for (var s = t.length - 1; s >= 0; s--) (a = t[s]) && (n = (r < 3 ? a(n) : r > 3 ? a(e, i, n) : a(e, i)) || n);
return r > 3 && n && Object.defineProperty(e, i, n), n;
};
Object.defineProperty(i, "__esModule", {
value: !0
});
var n = t("../base/BaseEffect"), s = t("../MapBox"), l = cc._decorator, c = l.ccclass, u = (l.property, 
function(t) {
a(e, t);
function e() {
var e = null !== t && t.apply(this, arguments) || this;
e.timer_scale = 0;
return e;
}
e.prototype.logicUpdate = function() {
if (this.timer_scale > 0) this.timer_scale -= s.default.inst.elapsed; else {
this.timer_scale = .01;
this.setAlpha(this.alpha - .01);
if (this.alpha <= 0) this.controller.killObject(this); else {
this.node.scaleX < 4 && (this.node.scale += .03);
this.node.position = cc.v3(this.node.x + .5 * s.default.inst.wind_direction.x, this.node.y + .5 * s.default.inst.wind_direction.y);
}
}
};
return r([ c ], e);
}(n.default));
i.default = u;
cc._RF.pop();
}, {
"../MapBox": "MapBox",
"../base/BaseEffect": "BaseEffect"
} ],
SmoothLoader: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "2d546azzbxCToFVcch4fVsN", "SmoothLoader");
Object.defineProperty(i, "__esModule", {
value: !0
});
i.MapLoaderContainer = void 0;
var o = function(t, e, i) {
void 0 === i && (i = !0);
this.action = null;
this.id = "";
this.debug_log = !0;
this.action = t;
this.id = e;
this.debug_log = i;
};
i.MapLoaderContainer = o;
var a = function() {
function t() {}
t.prepare = function() {
t._actions = [];
t._index = 0;
t._started = !1;
t._have_actions = !1;
t.latest_called_id = "";
t.latest_time = "";
};
t.add = function(e, i, a) {
void 0 === a && (a = !1);
t._have_actions = !0;
if (t._started) {
a && t._actions.splice(t._index + 1 + t._added++, 0, new o(t.skipFrame, "skipFrame", !1));
t._actions.splice(t._index + 1 + t._added++, 0, new o(e, i));
} else {
a && t._actions.push(new o(t.skipFrame, "skipFrame", !1));
t._actions.push(new o(e, i));
}
};
t.setTimerTo01 = function() {
t._current_timer = .001;
};
t.skipFrame = function() {
t._skip_frame = !0;
};
t.isLoading = function() {
return t._have_actions;
};
t.logicUpdate = function(e) {
if (t._have_actions) if (0 != t._actions.length) if (t._current_timer > 0) t._current_timer -= e; else {
t._skip_frame = !1;
var i = cc.sys.now() / 1e3;
t.doActions();
for (;cc.sys.now() / 1e3 - i < .1 && !t._skip_frame && 0 != t._actions.length; ) t.doActions();
t.setTimerTo01();
} else t._have_actions = !1;
};
t.doActions = function() {
t._started = !0;
t._added = 0;
t._actions[t._index].action();
t._index++;
t._index > t._actions.length - 1 && t.prepare();
};
t._index = 0;
t._current_timer = 0;
t._skip_frame = !1;
t._added = 0;
t._started = !1;
t._have_actions = !1;
t._actions = [];
t.latest_called_id = "";
t.latest_time = "";
return t;
}();
i.default = a;
cc._RF.pop();
}, {} ],
SpawnEffect: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "66f1d6ld81CVZAV7F4CHeU9", "SpawnEffect");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
}), r = this && this.__decorate || function(t, e, i, o) {
var a, r = arguments.length, n = r < 3 ? e : null === o ? o = Object.getOwnPropertyDescriptor(e, i) : o;
if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) n = Reflect.decorate(t, e, i, o); else for (var s = t.length - 1; s >= 0; s--) (a = t[s]) && (n = (r < 3 ? a(n) : r > 3 ? a(e, i, n) : a(e, i)) || n);
return r > 3 && n && Object.defineProperty(e, i, n), n;
};
Object.defineProperty(i, "__esModule", {
value: !0
});
var n = t("../animation/SpriteAnimation"), s = t("../assetLibrary/AssetManager"), l = t("../base/BaseEffect"), c = t("../MapBox"), u = cc._decorator, d = u.ccclass, h = (u.property, 
function(t) {
a(e, t);
function e() {
var e = null !== t && t.apply(this, arguments) || this;
e._event = "";
e._animation = null;
e._eventUsed = !1;
e._tile = null;
return e;
}
e.prototype.create = function() {
t.prototype.create.call(this);
this._animation = this.getComponent(n.SpriteAnimation);
};
e.prototype.logicUpdate = function(e) {
t.prototype.logicUpdate.call(this, e);
if (!this._eventUsed && 14 == this._animation.currentFrameIndex) {
this._eventUsed = !0;
if ("crabzilla" == this._event) {
var i = s.default.powers.get("crabzilla");
c.default.inst.createNewUnit(i.actorStatsId, this._tile, "", i.actorSpawnHeight);
}
}
};
e.prototype.setEvent = function(t, e) {
this._tile = e;
this._eventUsed = !1;
this._event = t;
};
return r([ d ], e);
}(l.default));
i.default = h;
cc._RF.pop();
}, {
"../MapBox": "MapBox",
"../animation/SpriteAnimation": "SpriteAnimation",
"../assetLibrary/AssetManager": "AssetManager",
"../base/BaseEffect": "BaseEffect"
} ],
SpellLibrary: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "a7ee9T+awBO3KQEwkoCvxjY", "SpellLibrary");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
});
Object.defineProperty(i, "__esModule", {
value: !0
});
i.Spell = i.CastEntity = i.CastTarget = void 0;
var r, n, s = t("../../actors/ActionLibrary"), l = t("../../world/WorldAction"), c = t("../AssetLibrary");
(function(t) {
t[t.Enemy = 0] = "Enemy";
t[t.Himself = 1] = "Himself";
t[t.Region = 2] = "Region";
t[t.Friendly = 3] = "Friendly";
})(r = i.CastTarget || (i.CastTarget = {}));
(function(t) {
t[t.UnitsOnly = 0] = "UnitsOnly";
t[t.BuildingsOnly = 1] = "BuildingsOnly";
t[t.Both = 2] = "Both";
t[t.Tile = 3] = "Tile";
})(n = i.CastEntity || (i.CastEntity = {}));
var u = function(t) {
a(e, t);
function e() {
var e = null !== t && t.apply(this, arguments) || this;
e.healthPercent = 0;
e.chance = 1;
e.min_distance = 0;
e.castEntity = n.Both;
e.action = l.default.create();
return e;
}
return e;
}(c.Asset);
i.Spell = u;
var d = function(t) {
a(e, t);
function e() {
return null !== t && t.apply(this, arguments) || this;
}
e.prototype.init = function() {
t.prototype.init.call(this);
var e = new u();
e.id = "teleportRandom";
e.chance = .7;
e.castTarget = r.Himself;
e.healthPercent = .6;
this.add(e);
this.t.action.add(s.default.teleportRandom);
var i = new u();
i.id = "lightning";
i.chance = .3;
i.min_distance = 6;
this.add(i);
this.t.action.add(s.default.castLightning);
var o = new u();
o.id = "tornado";
o.chance = .02;
o.min_distance = 9;
this.add(o);
this.t.action.add(s.default.castTornado);
var a = new u();
a.id = "curse";
a.chance = .2;
a.min_distance = 4;
a.castEntity = n.UnitsOnly;
this.add(a);
this.t.action.add(s.default.castCurses);
var l = new u();
l.id = "fire";
l.chance = .2;
l.min_distance = 3;
l.castEntity = n.Both;
this.add(l);
this.t.action.add(s.default.castFire);
var c = new u();
c.id = "bloodRain";
c.chance = .5;
c.min_distance = 0;
c.healthPercent = .9;
c.castTarget = r.Himself;
c.castEntity = n.UnitsOnly;
this.add(c);
this.t.action.add(s.default.castBloodRain);
var d = new u();
d.id = "spawnSeeds";
d.chance = 1;
d.min_distance = 0;
d.castTarget = r.Region;
d.castEntity = n.Tile;
this.add(d);
this.t.action.add(s.default.castSpawnSeeds);
var h = new u();
h.id = "spawnSkeleton";
h.chance = .6;
h.min_distance = 0;
h.castTarget = r.Himself;
this.add(h);
this.t.action.add(s.default.castSpawnSkeleton);
var p = new u();
p.id = "shield";
p.chance = .2;
p.castTarget = r.Himself;
this.add(p);
this.t.action.add(s.default.castShieldOnHimself);
var f = new u();
f.id = "cure";
f.chance = 1;
f.min_distance = 0;
f.castTarget = r.Friendly;
f.castEntity = n.UnitsOnly;
this.add(f);
this.t.action.add(s.default.castCure);
};
return e;
}(c.default);
i.default = d;
cc._RF.pop();
}, {
"../../actors/ActionLibrary": "ActionLibrary",
"../../world/WorldAction": "WorldAction",
"../AssetLibrary": "AssetLibrary"
} ],
SpriteAnimation: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "66280Z5cStPlZzS9AgYFCHW", "SpriteAnimation");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
}), r = this && this.__decorate || function(t, e, i, o) {
var a, r = arguments.length, n = r < 3 ? e : null === o ? o = Object.getOwnPropertyDescriptor(e, i) : o;
if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) n = Reflect.decorate(t, e, i, o); else for (var s = t.length - 1; s >= 0; s--) (a = t[s]) && (n = (r < 3 ? a(n) : r > 3 ? a(e, i, n) : a(e, i)) || n);
return r > 3 && n && Object.defineProperty(e, i, n), n;
};
Object.defineProperty(i, "__esModule", {
value: !0
});
i.SpriteAnimation = i.AnimPlayType = void 0;
var n, s = t("../../../common/src/GameCommon"), l = t("../common/ToolBox");
(function(t) {
t[t.Forward = 0] = "Forward";
t[t.Backward = 1] = "Backward";
})(n = i.AnimPlayType || (i.AnimPlayType = {}));
var c = cc._decorator, u = c.ccclass, d = c.property, h = function(t) {
a(e, t);
function e() {
var e = null !== t && t.apply(this, arguments) || this;
e.ignorePause = !0;
e.isOn = !0;
e.timeBetweenFrames = .1;
e.nextFrameTime = 0;
e.playType = n.Forward;
e.currentFrameIndex = 0;
e.looped = !0;
e.returnToPool = !1;
e.frames = [];
e.dirty = !1;
e.frameCount = 0;
e.spriteRenderer = null;
e.stopFrameTrigger = !1;
e.currentSpriteGraphic = null;
e.inited = !1;
return e;
}
e.prototype.onLoad = function() {
this.create();
};
e.prototype.create = function() {
if (!this.inited) {
this.frameCount = this.frames.length;
this.spriteRenderer = this.getComponent(cc.Sprite);
this.nextFrameTime = this.timeBetweenFrames;
this.inited = !0;
}
};
e.prototype.stopAnimations = function() {
this.isOn = !1;
};
e.prototype.setFrames = function(t) {
if (this.frames != t) {
this.frames = t;
this.frameCount = t.length;
this.currentFrameIndex >= this.frameCount && (this.currentFrameIndex = 0);
this.updateFrame();
}
};
e.prototype.isLastFrame = function() {
return this.currentFrameIndex >= this.frames.length - 1;
};
e.prototype.isFirstFrame = function() {
return 0 == this.currentFrameIndex;
};
e.prototype.logicUpdate = function(t) {
if (this.dirty) {
this.dirty = !1;
this.forceUpdateFrame();
} else if (this.isOn) {
if (s.default.isPaused && !this.ignorePause) return;
if (this.nextFrameTime > 0) {
this.nextFrameTime -= t;
return;
}
this.nextFrameTime = this.timeBetweenFrames;
if (this.playType == n.Forward) if (this.currentFrameIndex + 1 >= this.frameCount) {
if (this.returnToPool && (e = this.getComponent("BaseEffect"))) {
e.kill();
return;
}
if (!this.looped) return;
this.currentFrameIndex = 0;
} else this.currentFrameIndex++; else if (this.currentFrameIndex - 1 < 0) {
if (this.returnToPool) {
var e;
if (e = this.getComponent("BaseEffect")) {
e.kill();
return;
}
}
if (!this.looped) return;
this.currentFrameIndex = this.frames.length - 1;
} else this.currentFrameIndex--;
this.updateFrame();
} else if (this.stopFrameTrigger) {
this.stopFrameTrigger = !1;
this.updateFrame();
}
};
e.prototype.stopAt = function(t, e) {
void 0 === t && (t = 0);
void 0 === e && (e = !1);
this.isOn = !1;
this.currentFrameIndex = t;
e ? this.updateFrame() : this.stopFrameTrigger = !0;
};
e.prototype.forceUpdateFrame = function() {
if (0 != this.frames.length) {
this.currentSpriteGraphic = this.frames[this.currentFrameIndex];
this.applyCurrentSpriteGraphics(this.currentSpriteGraphic);
}
};
e.prototype.setRandomFrame = function() {
this.currentFrameIndex = l.Toolbox.randomInt(0, this.frames.length);
this.updateFrame();
};
e.prototype.setFrameIndex = function(t) {
this.currentFrameIndex = t;
this.updateFrame();
};
e.prototype.updateFrame = function() {
var t = this.frames[this.currentFrameIndex];
if (0 != this.frames.length && this.currentFrameIndex < this.frames.length && this.currentSpriteGraphic != t) {
this.currentSpriteGraphic = t;
this.applyCurrentSpriteGraphics(t);
}
};
e.prototype.applyCurrentSpriteGraphics = function(t) {
this.spriteRenderer && (this.spriteRenderer.spriteFrame = t);
};
e.prototype.getCurrentGraphics = function() {
return this.currentSpriteGraphic;
};
e.prototype.resetAnim = function() {
this.nextFrameTime = this.timeBetweenFrames;
this.currentFrameIndex = 0;
this.updateFrame();
};
r([ d({
tooltip: "默认true"
}) ], e.prototype, "ignorePause", void 0);
r([ d({
tooltip: "默认true"
}) ], e.prototype, "isOn", void 0);
r([ d({
tooltip: "默认0.1"
}) ], e.prototype, "timeBetweenFrames", void 0);
r([ d({
tooltip: "默认0"
}) ], e.prototype, "nextFrameTime", void 0);
r([ d({
type: cc.Enum(n)
}) ], e.prototype, "playType", void 0);
r([ d({
tooltip: "默认0"
}) ], e.prototype, "currentFrameIndex", void 0);
r([ d({
tooltip: "默认true"
}) ], e.prototype, "looped", void 0);
r([ d({
tooltip: "默认false"
}) ], e.prototype, "returnToPool", void 0);
r([ d({
type: [ cc.SpriteFrame ],
tooltip: ""
}) ], e.prototype, "frames", void 0);
r([ d({
tooltip: "默认false"
}) ], e.prototype, "dirty", void 0);
return r([ u ], e);
}(cc.Component);
i.SpriteAnimation = h;
cc._RF.pop();
}, {
"../../../common/src/GameCommon": void 0,
"../common/ToolBox": "ToolBox"
} ],
StackEffects: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "6ce38TUWhBKipkj2aDcaPwk", "StackEffects");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
}), r = this && this.__decorate || function(t, e, i, o) {
var a, r = arguments.length, n = r < 3 ? e : null === o ? o = Object.getOwnPropertyDescriptor(e, i) : o;
if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) n = Reflect.decorate(t, e, i, o); else for (var s = t.length - 1; s >= 0; s--) (a = t[s]) && (n = (r < 3 ? a(n) : r > 3 ? a(e, i, n) : a(e, i)) || n);
return r > 3 && n && Object.defineProperty(e, i, n), n;
};
Object.defineProperty(i, "__esModule", {
value: !0
});
var n = t("../animation/SpriteAnimation"), s = t("../base/BaseEffect"), l = t("../base/BaseMapObject"), c = t("../common/ToolBox"), u = t("../game/audio/GameAudio"), d = t("../MapBox"), h = t("../texture/TextureLoader"), p = t("./AntimatterBombEffect"), f = t("./BaseEffectController"), m = t("./NapalmFlash"), y = t("./NukeFlash"), _ = t("./Projectile"), g = t("./SpawnEffect"), v = t("./StatusParticle"), b = cc._decorator, T = b.ccclass, w = b.property, B = function(t) {
a(e, t);
function e() {
var e = null !== t && t.apply(this, arguments) || this;
e.prefabBasic = null;
e.prefabFireballExplosion = null;
e.prefabLightning = null;
e.prefabSpawn = null;
e.prefabSpawnBig = null;
e.prefabExplosionSmall = null;
e.prefabExplosionNuke = null;
e.prefabExplosionWave = null;
e.prefabFireworks1 = null;
e.prefabFireworks2 = null;
e.prefabNukeFlash = null;
e.prefabBoulderImpact = null;
e.prefabBoulderImpactWater = null;
e.prefabAntimatter = null;
e.prefabFireSmoke = null;
e.prefabNapalmFlash = null;
e.prefabEffectInfinityCoin = null;
e.prefabStatusParticle = null;
e.prefabSlashEffect = null;
e.prefabProjectile = null;
e.prefabMiss = null;
e.prefabHit = null;
e.prefabHitCritical = null;
e.boatExplosion = null;
e.fx_fishnet = null;
e.dictionary = new Map();
e.list = [];
e.timeOutFireworks = 0;
return e;
}
e.prototype.onLoad = function() {
this.dictionary = new Map();
this.list = [];
this.loadEffect("fx_cast_ground_blue", !0, .1, "EffectsBack");
this.loadEffect("fx_cast_top_blue");
this.loadEffect("fx_cast_ground_red", !0, .1, "EffectsBack");
this.loadEffect("fx_cast_top_red");
this.loadEffect("fx_cast_ground_green", !0, .1, "EffectsBack");
this.loadEffect("fx_cast_top_green");
this.loadEffect("fx_create_skeleton", !0, .1, "EffectsTop", 0);
this.loadEffect("fx_teleport_blue", !0, .1, "EffectsTop", 0);
this.loadEffect("fx_teleport_red", !0, .1, "EffectsTop", 0);
this.loadEffect("fx_shield_hit", !0, .1, "EffectsTop", 200);
this.loadEffect("fx_bad_place", !0, .1, "EffectsBack", 10);
this.add(this.prefabFireSmoke, "fireSmoke");
this.add(this.prefabLightning, "lightning");
this.add(this.prefabSpawn, "spawn");
this.add(this.prefabSpawnBig, "spawn_big");
this.add(this.prefabExplosionSmall, "explosionSmall");
this.add(this.prefabExplosionNuke, "explosionNuke");
this.add(this.prefabExplosionWave, "explosionWave");
this.add(this.prefabFireworks1, "fireworks1");
this.add(this.prefabFireworks2, "fireworks2");
this.add(this.prefabNukeFlash, "nukeFlash");
this.add(this.prefabNapalmFlash, "napalmFlash");
this.add(this.prefabBoulderImpact, "boulderImpact");
this.add(this.prefabBoulderImpactWater, "boulderImpactWater");
this.add(this.prefabAntimatter, "antimatterEffect");
this.add(this.prefabEffectInfinityCoin, "infinityCoin");
this.add(this.prefabStatusParticle, "statusParticle", 10);
this.add(this.prefabProjectile, "projectile");
this.add(this.prefabFireballExplosion, "fireballExplosion");
this.add(this.prefabSlashEffect, "slash", 20);
this.add(this.prefabMiss, "miss", 20);
this.add(this.prefabHit, "hit", 10);
this.add(this.prefabHitCritical, "hitCritical", 10);
this.add(this.boatExplosion, "boatExplosion", 20);
this.add(this.fx_fishnet, "fx_fishnet", 20);
};
e.prototype.isLocked = function() {
return this.get("spawn_big").list.length > 0;
};
e.prototype.get = function(t) {
return this.dictionary.get(t);
};
e.prototype.loadEffect = function(t, e, i, o, a) {
void 0 === e && (e = !0);
void 0 === i && (i = .1);
void 0 === o && (o = "EffectsTop");
void 0 === a && (a = 60);
var r = cc.instantiate(this.prefabBasic);
r.parent = this.node;
r.name = t;
r.active = !1;
if (e) {
var l = r.getComponent(n.SpriteAnimation);
l.timeBetweenFrames = i;
l.frames = Array.from(h.TextureLoader.inst.getSpriteFrames(h.ATLAS_TYPE.WORLDATLAS, "effects/" + t + "_t").values());
}
var c = this.add(this.prefabBasic, t, a);
c.addNewObject(r.getComponent(s.default));
c.node.parent = this.node;
c.node.active = !0;
};
e.prototype.add = function(t, e, i) {
void 0 === i && (i = 0);
var o = new cc.Node().addComponent(f.default);
o.create();
o.node.parent = this.node;
o.node.name = e;
o.prefab = t;
o.objectLimit = i;
this.dictionary.set(e, o);
this.list.push(o);
return o;
};
e.prototype.clear = function() {
for (var t = 0; t < this.list.length; t++) this.list[t].clear();
};
e.prototype.spawnEffect = function() {};
e.prototype.logicUpdate = function() {
for (var t = 0; t < this.list.length; t++) this.list[t].logicUpdate(d.default.inst.elapsed);
this.timeOutFireworks > 0 && (this.timeOutFireworks -= cc.director.getDeltaTime());
};
e.prototype.startSpawnEffect = function(t, e) {
void 0 === e && (e = "spawn");
return this.get(e).spawnAt(t, .25);
};
e.prototype.startBigSpawn = function(t) {
var e;
return null === (e = this.get("spawn_big").spawnAt(t)) || void 0 === e ? void 0 : e.getComponent(g.default);
};
e.prototype.slash = function(t, e, i) {
if (!d.default.inst.qualityChanger.lowRes) {
var o = this.get("slash").spawnAt(t, .098);
if (o) {
o.getComponent(n.SpriteAnimation).setFrames(Array.from(h.TextureLoader.inst.getSpriteFrames(h.ATLAS_TYPE.WORLDATLAS, "effects/slashes/slash_" + e).values()));
o.node.angle = i;
}
}
};
e.prototype.startProjectile = function(t, e, i, o) {
void 0 === o && (o = 0);
var a = this.get("projectile").spawnNew();
if (!a) return null;
var r = a.getComponent(_.default);
r.begin(t, e, i, o);
return r;
};
e.prototype.spawnAntimatterEffect = function(t) {
var e;
null === (e = this.get("antimatterEffect").spawnNew()) || void 0 === e || e.getComponent(p.default).spawn(t);
};
e.prototype.spawnNukeFlash = function(t, e) {
var i;
null === (i = this.get("nukeFlash").spawnNew()) || void 0 === i || i.getComponent(y.default).spawnFlash(t, e);
};
e.prototype.spawnNapalmFlash = function(t, e) {
var i;
null === (i = this.get("napalmFlash").spawnNew()) || void 0 === i || i.getComponent(m.default).spawnFlash(t, e);
};
e.prototype.spawnStatusParticle = function(t, e) {
var i;
null === (i = this.get("statusParticle").spawnNew()) || void 0 === i || i.getComponent(v.default).spawnParticle(t, e);
};
e.prototype.spawnFireworks = function(t, e) {
void 0 === e && (e = .05);
if (!(this.timeOutFireworks > 0)) {
this.timeOutFireworks = e;
var i = (c.Toolbox.randomBool() ? this.get("fireworks1") : this.get("fireworks2")).spawnAtRandomScale(t, .3), o = c.Toolbox.randomBool() ? 1 : -1;
i.sprRenderer.node.scaleX *= o;
var a = cc.color(c.Toolbox.randomFloat(0, 255), c.Toolbox.randomFloat(0, 255), c.Toolbox.randomFloat(0, 255), 255);
i.sprRenderer.node.color = a;
i.node.angle = c.Toolbox.randomFloat(-15, 15);
u.default.playFireworks();
}
};
r([ w(cc.Prefab) ], e.prototype, "prefabBasic", void 0);
r([ w(cc.Prefab) ], e.prototype, "prefabFireballExplosion", void 0);
r([ w(cc.Prefab) ], e.prototype, "prefabLightning", void 0);
r([ w(cc.Prefab) ], e.prototype, "prefabSpawn", void 0);
r([ w(cc.Prefab) ], e.prototype, "prefabSpawnBig", void 0);
r([ w(cc.Prefab) ], e.prototype, "prefabExplosionSmall", void 0);
r([ w(cc.Prefab) ], e.prototype, "prefabExplosionNuke", void 0);
r([ w(cc.Prefab) ], e.prototype, "prefabExplosionWave", void 0);
r([ w(cc.Prefab) ], e.prototype, "prefabFireworks1", void 0);
r([ w(cc.Prefab) ], e.prototype, "prefabFireworks2", void 0);
r([ w(cc.Prefab) ], e.prototype, "prefabNukeFlash", void 0);
r([ w(cc.Prefab) ], e.prototype, "prefabBoulderImpact", void 0);
r([ w(cc.Prefab) ], e.prototype, "prefabBoulderImpactWater", void 0);
r([ w(cc.Prefab) ], e.prototype, "prefabAntimatter", void 0);
r([ w(cc.Prefab) ], e.prototype, "prefabFireSmoke", void 0);
r([ w(cc.Prefab) ], e.prototype, "prefabNapalmFlash", void 0);
r([ w(cc.Prefab) ], e.prototype, "prefabEffectInfinityCoin", void 0);
r([ w(cc.Prefab) ], e.prototype, "prefabStatusParticle", void 0);
r([ w(cc.Prefab) ], e.prototype, "prefabSlashEffect", void 0);
r([ w(cc.Prefab) ], e.prototype, "prefabProjectile", void 0);
r([ w(cc.Prefab) ], e.prototype, "prefabMiss", void 0);
r([ w(cc.Prefab) ], e.prototype, "prefabHit", void 0);
r([ w(cc.Prefab) ], e.prototype, "prefabHitCritical", void 0);
r([ w(cc.Prefab) ], e.prototype, "boatExplosion", void 0);
r([ w(cc.Prefab) ], e.prototype, "fx_fishnet", void 0);
return r([ T ], e);
}(l.default);
i.default = B;
cc._RF.pop();
}, {
"../MapBox": "MapBox",
"../animation/SpriteAnimation": "SpriteAnimation",
"../base/BaseEffect": "BaseEffect",
"../base/BaseMapObject": "BaseMapObject",
"../common/ToolBox": "ToolBox",
"../game/audio/GameAudio": "GameAudio",
"../texture/TextureLoader": "TextureLoader",
"./AntimatterBombEffect": "AntimatterBombEffect",
"./BaseEffectController": "BaseEffectController",
"./NapalmFlash": "NapalmFlash",
"./NukeFlash": "NukeFlash",
"./Projectile": "Projectile",
"./SpawnEffect": "SpawnEffect",
"./StatusParticle": "StatusParticle"
} ],
StaticGrid: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "26f26dTQnFMBK9CfO1uvca1", "StaticGrid");
Object.defineProperty(i, "__esModule", {
value: !0
});
i.ASNode = i.DiagonalMovement = void 0;
(function(t) {
t[t.Always = 0] = "Always";
t[t.Never = 1] = "Never";
t[t.IfAtLeastOneWalkable = 2] = "IfAtLeastOneWalkable";
t[t.OnlyWhenNoObstacles = 3] = "OnlyWhenNoObstacles";
})(i.DiagonalMovement || (i.DiagonalMovement = {}));
var o = function() {
function t(t, e, i) {
void 0 === i && (i = !1);
this.tile = null;
this.x = 0;
this.y = 0;
this.walkable = !1;
this.cost = 0;
this.heuristicStartToEndLen = 0;
this.startToCurNodeLen = 0;
this.heuristicCurNodeToEndLen = 0;
this.isOpened = !1;
this.isClosed = !1;
this.parent = null;
this.x = t;
this.y = e;
this.walkable = i;
this.heuristicStartToEndLen = 0;
this.startToCurNodeLen = 0;
this.heuristicCurNodeToEndLen = null;
this.isOpened = !1;
this.isClosed = !1;
this.parent = null;
this.cost = 1;
}
t.prototype.reset = function(t) {
void 0 === t && (t = !1);
this.walkable = t;
this.heuristicStartToEndLen = 0;
this.startToCurNodeLen = 0;
this.heuristicCurNodeToEndLen = null;
this.isOpened = !1;
this.isClosed = !1;
this.parent = null;
this.cost = 1;
};
t.prototype.compareTo = function(t) {
var e = this.heuristicStartToEndLen - t.heuristicStartToEndLen;
return e > 0 ? 1 : 0 == e ? 0 : -1;
};
t.prototype.equals = function(t) {
return !!t && this.x == t.x && this.y == t.y;
};
return t;
}();
i.ASNode = o;
var a = function() {
function t(e, i, o) {
void 0 === o && (o = []);
this.m_nodes = [];
this.closedList = [];
this.m_gridRect = new cc.Rect();
this._width = 0;
this._height = 0;
this.width = e;
this.height = i;
this.m_gridRect.xMin = 0;
this.m_gridRect.yMin = 0;
this.m_gridRect.xMax = e - 1;
this.m_gridRect.yMax = i - 1;
this.m_nodes = t.buildNodes(e, i, o);
}
Object.defineProperty(t.prototype, "width", {
get: function() {
return this._width;
},
set: function(t) {
this._width = t;
},
enumerable: !1,
configurable: !0
});
Object.defineProperty(t.prototype, "height", {
get: function() {
return this._height;
},
set: function(t) {
this._height = t;
},
enumerable: !1,
configurable: !0
});
t.buildNodes = function(t, e, i) {
for (var a = [], r = 0; r < t; r++) {
a[r] = [];
for (var n = 0; n < e; n++) a[r][n] = new o(r, n);
}
if (null == i || 0 == i.length) return a;
if (i.length != t || i[0].length != e) throw new Error("Matrix size does not fit!");
for (var s = 0; s < t; s++) for (var l = 0; l < e; l++) a[s][l].walkable = i[s][l];
return a;
};
t.prototype.getNodeAt = function(t, e) {
return this.m_nodes[t][e];
};
t.prototype.isWalkableAt = function(t, e) {
return !!this.isInside(t, e) && this.m_nodes[t][e].walkable;
};
t.prototype.isInside = function(t, e) {
return t >= 0 && t < this.width && e >= 0 && e < this.height;
};
t.prototype.setWalkableAt = function(t, e, i, o) {
void 0 === o && (o = 1);
this.m_nodes[t][e].walkable = i;
this.m_nodes[t][e].cost = o;
return !0;
};
t.prototype.setTileNode = function(t, e, i) {
this.m_nodes[t][e].tile = i;
};
t.prototype.addToClosed = function(t) {
this.closedList.push(t);
};
t.prototype.reset = function() {
this.closedList.forEach(function(t) {
t.reset();
});
this.closedList.clear();
};
return t;
}();
i.default = a;
cc._RF.pop();
}, {} ],
StatsData: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "f2d87MYJpJBZ7NuMHV9Gf8o", "StatsData");
Object.defineProperty(i, "__esModule", {
value: !0
});
i.GameStatsData = void 0;
i.GameStatsData = function() {
this.gameTime = 0;
this.treesGrown = 0;
this.treesDeath = 0;
this.meteoritesLaunched = 0;
this.pixelsExploded = 0;
this.creaturesBorn = 0;
this.creaturesCreated = 0;
this.creaturesDied = 0;
this.gameLaunches = 0;
this.bombsDropped = 0;
this.infectedZombie = 0;
};
cc._RF.pop();
}, {} ],
StatsHelper: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "33eca8bWiZOMp/9BRZU/shQ", "StatsHelper");
Object.defineProperty(i, "__esModule", {
value: !0
});
var o = t("../../../../framework/utils/Log"), a = t("../../../common/src/text/LocalizedTextManager"), r = t("../assetLibrary/AssetManager"), n = t("../assetLibrary/lib/ResourceLibrary"), s = t("../Config"), l = t("../MapBox"), c = t("./ToolBox"), u = function() {
function t() {}
t.getStatistic = function(e) {
var i, u, d, h, p, f, m, y = 0, _ = "", g = l.default.inst, v = l.default.inst.gameStats;
switch (e) {
case "world_name":
_ = null !== (i = g.mapStats.name) && void 0 !== i ? i : "";
break;

case "village_statistics_infected":
s.default.selectedCity.units.list.forEach(function(t) {
t.haveTrait("infected") ? y++ : t.haveTrait("plague") && y++;
});
_ += y;
break;

case "world_statistics_infected":
g.units.list.forEach(function(t) {
t.haveTrait("infected") ? y++ : t.haveTrait("plague") && y++;
});
_ += y;
break;

case "village_statistics_age":
_ += s.default.selectedCity.data.age;
break;

case "village_statistics_born":
_ += s.default.selectedCity.data.born;
break;

case "village_statistics_deaths":
_ += s.default.selectedCity.data.deaths;
break;

case "village_statistics_kingdom":
_ = c.Toolbox.coloredString(s.default.selectedCity.kingdom.data.name, null === (d = null === (u = s.default.selectedCity.kingdom) || void 0 === u ? void 0 : u.kingdomColor) || void 0 === d ? void 0 : d.colorBorderOut.toHEX());
break;

case "village_statistics_leader":
_ = null != s.default.selectedCity.leader ? c.Toolbox.coloredString(s.default.selectedCity.leader.data.firstName, null === (p = null === (h = s.default.selectedCity.kingdom) || void 0 === h ? void 0 : h.kingdomColor) || void 0 === p ? void 0 : p.colorBorderOut.toHEX()) : "-";
break;

case "village_statistics_king":
_ = null != s.default.selectedCity.kingdom.king ? c.Toolbox.coloredString(s.default.selectedCity.kingdom.king.data.firstName, null === (m = null === (f = s.default.selectedCity.kingdom) || void 0 === f ? void 0 : f.kingdomColor) || void 0 === m ? void 0 : m.colorBorderOut.toHEX()) : "-";
break;

case "world_statistics_time":
_ = "y:" + (g.mapStats.year + 1) + ", m:" + (g.mapStats.month + 1);
break;

case "world_statistics_population":
_ += g.getCivWorldPopulation();
break;

case "world_statistics_beasts":
g.units.list.forEach(function(t) {
t.stats.unit || y++;
});
_ += y;
break;

case "world_statistics_deaths_total":
_ += g.mapStats.deaths;
break;

case "world_statistics_deaths_natural":
_ += g.mapStats.deaths_age;
break;

case "world_statistics_deaths_hunger":
_ += g.mapStats.deaths_hunger;
break;

case "world_statistics_deaths_eaten":
_ += g.mapStats.deaths_eaten;
break;

case "world_statistics_deaths_plague":
_ += g.mapStats.deaths_plague;
break;

case "world_statistics_deaths_other":
_ += g.mapStats.deaths_other;
break;

case "world_statistics_trees":
var b = 0;
g.buildings.list.forEach(function(t) {
var e;
(null === (e = t.stats) || void 0 === e ? void 0 : e.resourceType) == n.ResourceType.Tree && b++;
});
_ += b;
break;

case "houses":
return "0" == t.getStatistic("world_statistics_houses") ? "" : (_ = (_ = a.LocalizedTextManager.getText("world_statistics_houses_all")).replace("$houses$", t.getStatistic("world_statistics_houses"))).replace("$destroyed$", t.getStatistic("world_statistics_houses_destroyed"));

case "world_statistics_houses":
var T = 0;
g.buildings.list.forEach(function(t) {
var e;
(null === (e = t.stats) || void 0 === e ? void 0 : e.cityBuilding) && T++;
});
_ += T;
break;

case "world_statistics_houses_destroyed":
_ += g.mapStats.housesDestroyed;
break;

case "most_popular_race":
var w = 0, B = null;
r.default.raceLibrary.list.forEach(function(t) {
if (t.units.count > w) {
B = t;
w = t.units.count;
}
});
if (0 == w || !B) return "";
_ = a.LocalizedTextManager.getText("world_statistics_most_popular_race");
var k = B.nameLocale;
k || (k = B.units.list.getRandom().stats.nameLocale);
if (!k) {
o.default.d("no name found for " + B);
return "";
}
return (_ = _.replace("$race$", a.LocalizedTextManager.getText(k))).replace("$units$", "" + w);

case "kingdoms_villages":
return "0" == t.getStatistic("kingdoms") && "0" == t.getStatistic("villages") ? "" : a.LocalizedTextManager.getText("kingdoms") + ": " + t.getStatistic("kingdoms") + "/" + a.LocalizedTextManager.getText("villages") + ": " + t.getStatistic("villages");

case "villages":
return "" + g.citiesList.length;

case "kingdoms":
return "" + g.kingdoms.list_civs.length;

case "races":
var A = 0, S = 0, x = 0, C = 0;
g.units.list.forEach(function(t) {
"human" == t.race.id && A++;
"elf" == t.race.id && S++;
"orc" == t.race.id && x++;
"dwarf" == t.race.id && C++;
});
return "H:" + A + " E:" + S + " O:" + x + " D:" + C;

case "world_statistics_biggest_village":
var O = null;
g.citiesList.forEach(function(t) {
(null == O || t.zones.length > O.zones.length) && (O = t);
});
_ = null != O ? O.data.cityName + " [" + O.zones.length + "]" : "?";
break;

case "world_statistics_most_populated_village":
var P = null;
g.citiesList.forEach(function(t) {
(null == P || t.getPopulationTotal() > P.getPopulationTotal()) && (P = t);
});
_ = null != P ? P.data.cityName + " [" + P.getPopulationTotal() + "]" : "?";
break;

case "world_statistics_islands":
_ += g.islandsCalculator.islands.length;
break;

case "statistics_total_playtime":
_ = c.Toolbox.formatTimer(v.gameTime);
break;

case "statistics_trees_grown":
_ += v.treesGrown;
break;

case "statistics_meteorites_launched":
_ += v.meteoritesLaunched;
break;

case "statistics_pixels_exploded":
_ += v.pixelsExploded;
break;

case "statistics_creatures_created":
_ += v.creaturesCreated;
break;

case "statistics_creatures_died":
_ += v.creaturesDied;
break;

case "statistics_bombs_dropped":
_ += v.bombsDropped;
}
return _;
};
return t;
}();
i.default = u;
cc._RF.pop();
}, {
"../../../../framework/utils/Log": void 0,
"../../../common/src/text/LocalizedTextManager": void 0,
"../Config": "Config",
"../MapBox": "MapBox",
"../assetLibrary/AssetManager": "AssetManager",
"../assetLibrary/lib/ResourceLibrary": "ResourceLibrary",
"./ToolBox": "ToolBox"
} ],
StatusLibrary: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "fe0c6atW/5E87Xy8aQL8bPc", "StatusLibrary");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
});
Object.defineProperty(i, "__esModule", {
value: !0
});
var r = t("../../actors/ActorStatus"), n = t("../../common/ToolBox"), s = t("../../effect/ActiveStatusEffect"), l = t("../../MapBox"), c = function(t) {
a(e, t);
function e() {
return null !== t && t.apply(this, arguments) || this;
}
e.prototype.init = function() {
t.prototype.init.call(this);
var i = new s.StatusEffect();
i.id = "slowness";
i.texture = "fx_status_slowness_t";
i.duration = 30;
i.animated = !0;
this.add(i);
this.t.baseStats.speed -= 100;
this.t.baseStats.attackSpeed = -50;
this.t.removeStatus.push("caffeinated");
var o = new s.StatusEffect();
o.id = "caffeinated";
o.texture = "fx_status_caffeinated_t";
o.duration = 60;
o.animated = !0;
this.add(o);
this.t.baseStats.speed = 200;
this.t.baseStats.mod_attackSpeed = 569;
this.t.removeStatus.push("frozen");
var a = new s.StatusEffect();
a.id = "frozen";
a.texture = "fx_status_frozen_t";
a.duration = 7;
a.random_frame = !0;
this.add(a);
this.t.baseStats.knockbackReduction = 100;
this.t.baseStats.armor = -20;
this.t.baseStats.speed = -1e7;
this.t.baseStats.attackSpeed = -1e7;
this.t.removeStatus.push("burning");
this.t.oppositeStatus.push("shield");
this.t.oppositeTraits.push("freeze_proof");
var r = new s.StatusEffect();
r.id = "shield";
r.texture = "fx_status_shield_t";
r.duration = 60;
r.animated = !0;
this.add(r);
this.t.baseStats.knockbackReduction = 100;
this.t.baseStats.armor = 90;
this.t.removeStatus.push("burning");
this.t.oppositeStatus.push("frozen");
this.t.actionOnHit.add(e.spawnShieldHitEffect);
var n = new s.StatusEffect();
n.id = "burning";
n.texture = "fx_status_burning_t";
n.duration = 60;
n.action.add(e.burningEffect);
n.actionInterval = 2;
n.animated = !0;
n.animation_speed = .1;
n.animation_speed_random = .08;
n.random_frame = !0;
n.random_flip = !0;
n.cancelActorJob = !0;
this.add(n);
this.t.oppositeStatus.push("shield");
this.t.oppositeTraits.push("fire_proof");
this.t.removeStatus.push("frozen");
};
e.burningEffect = function(t, e) {
void 0 === e && (e = null);
t.isActor() && n.Toolbox.randomBool() && t.a.addTrait("skin_burns");
var i = .1 * t.curStats.health + 1;
t.getHit(i, !0, r.AttackType.Fire);
!l.default.inst.qualityChanger.lowRes && n.Toolbox.randomChance(.1) && l.default.inst.particlesFire.spawn(t.currentPosition.x, t.currentPosition.y, !0);
return !0;
};
e.spawnShieldHitEffect = function(t, e) {
void 0 === e && (e = null);
if (l.default.inst.qualityChanger.lowRes) return !1;
var i = l.default.inst.stackEffects.get("fx_shield_hit").spawnAt(t.currentPosition, t.curStats.scale);
if (!i) return !1;
i.node.parent = t.a.node;
i.node.position = cc.Vec3.ZERO;
return !0;
};
return e;
}(t("../AssetLibrary").default);
i.default = c;
cc._RF.pop();
}, {
"../../MapBox": "MapBox",
"../../actors/ActorStatus": "ActorStatus",
"../../common/ToolBox": "ToolBox",
"../../effect/ActiveStatusEffect": "ActiveStatusEffect",
"../AssetLibrary": "AssetLibrary"
} ],
StatusParticle: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "6110aF89itPupKDWywKGdX4", "StatusParticle");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
}), r = this && this.__decorate || function(t, e, i, o) {
var a, r = arguments.length, n = r < 3 ? e : null === o ? o = Object.getOwnPropertyDescriptor(e, i) : o;
if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) n = Reflect.decorate(t, e, i, o); else for (var s = t.length - 1; s >= 0; s--) (a = t[s]) && (n = (r < 3 ? a(n) : r > 3 ? a(e, i, n) : a(e, i)) || n);
return r > 3 && n && Object.defineProperty(e, i, n), n;
};
Object.defineProperty(i, "__esModule", {
value: !0
});
var n = t("../base/BaseEffect"), s = cc._decorator, l = s.ccclass, c = (s.property, 
function(t) {
a(e, t);
function e() {
return null !== t && t.apply(this, arguments) || this;
}
e.prototype.spawnParticle = function(e, i, o) {
void 0 === o && (o = .25);
t.prototype.prepare.call(this, e, o);
this.node.color = i;
};
e.prototype.logicUpdate = function(e) {
t.prototype.logicUpdate.call(this, e);
this.setScale(this.scale - .2 * e);
this.scale <= 0 && this.kill();
};
return r([ l ], e);
}(n.default));
i.default = c;
cc._RF.pop();
}, {
"../base/BaseEffect": "BaseEffect"
} ],
TaxiManager: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "8fabfPnTY5Agbv+y0Wl3cuK", "TaxiManager");
var o = this && this.__values || function(t) {
var e = "function" == typeof Symbol && Symbol.iterator, i = e && t[e], o = 0;
if (i) return i.call(t);
if (t && "number" == typeof t.length) return {
next: function() {
t && o >= t.length && (t = void 0);
return {
value: t && t[o++],
done: !t
};
}
};
throw new TypeError(e ? "Object is not iterable." : "Symbol.iterator is not defined.");
};
Object.defineProperty(i, "__esModule", {
value: !0
});
var a = t("./TaxiRequest"), r = function() {
function t() {}
t.newRequest = function(e, i) {
var r, n, s = null;
try {
for (var l = o(t.list), c = l.next(); !c.done; c = l.next()) {
var u = c.value;
if (u.target.isSameIsland(i) && u.requestTile.isSameIsland(e.currentTile)) {
s = u;
break;
}
}
} catch (t) {
r = {
error: t
};
} finally {
try {
c && !c.done && (n = l.return) && n.call(l);
} finally {
if (r) throw r.error;
}
}
if (s) s.actors.includes(e) || s.actors.push(e); else {
(s = new a.default()).kingdom = e.kingdom;
s.setState(a.TaxiRequestState.Pending);
s.actors.push(e);
s.requestTile = e.currentTile;
s.target = i;
t.list.push(s);
}
};
t.cancelRequest = function(e) {
e.cancel();
t.list.remove(e);
};
t.getRequestForActor = function(e) {
for (var i = 0; i < t.list.length; i++) {
var o = t.list[i];
if (o.actors.includes(e)) return o;
}
return null;
};
t.getNewRequestForBoat = function(e) {
var i, r, n = null;
try {
for (var s = o(t.list), l = s.next(); !l.done; l = s.next()) {
var c = l.value;
if (c.isState(a.TaxiRequestState.Assigned) && c.isStillLegit() && c.taxi.actor == e) return c;
c.isState(a.TaxiRequestState.Pending) && c.isStillLegit() && c.kingdom == e.kingdom && (!n || n.actors.length < c.actors.length) && (n = c);
}
} catch (t) {
i = {
error: t
};
} finally {
try {
l && !l.done && (r = s.return) && r.call(s);
} finally {
if (i) throw i.error;
}
}
return n;
};
t.clear = function() {
t.list.clear();
};
t.finish = function(e) {
e.finish();
t.list.remove(e);
};
t.cancelTaxiRequestForActor = function(e) {
var i = t.getRequestForActor(e);
i && t.cancelRequest(i);
};
t.logicUpdate = function(e) {
if (t.timer_check > 0) t.timer_check -= e; else {
t.timer_check = 5;
for (var i = 0; t.list.length > i; ) {
var o = t.list[i];
if (o.isStillLegit()) i++; else {
o.finish();
t.list.splice(i, 1);
}
}
}
};
t.list = [];
t.timer_check = 0;
return t;
}();
i.default = r;
cc._RF.pop();
}, {
"./TaxiRequest": "TaxiRequest"
} ],
TaxiRequest: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "54677WIRKJD+qpf71/QYNjO", "TaxiRequest");
var o, a = this && this.__values || function(t) {
var e = "function" == typeof Symbol && Symbol.iterator, i = e && t[e], o = 0;
if (i) return i.call(t);
if (t && "number" == typeof t.length) return {
next: function() {
t && o >= t.length && (t = void 0);
return {
value: t && t[o++],
done: !t
};
}
};
throw new TypeError(e ? "Object is not iterable." : "Symbol.iterator is not defined.");
};
Object.defineProperty(i, "__esModule", {
value: !0
});
i.TaxiRequestState = i.TaxiRequestType = void 0;
(function(t) {
t[t.Settlers = 0] = "Settlers";
t[t.ArmyAttack = 1] = "ArmyAttack";
t[t.ReturnHome = 2] = "ReturnHome";
})(i.TaxiRequestType || (i.TaxiRequestType = {}));
(function(t) {
t[t.Pending = 0] = "Pending";
t[t.Assigned = 1] = "Assigned";
t[t.Loading = 2] = "Loading";
t[t.Transporting = 3] = "Transporting";
t[t.Finished = 4] = "Finished";
})(o = i.TaxiRequestState || (i.TaxiRequestState = {}));
var r = function() {
function t() {
this.target = null;
this.requestTile = null;
this.actors = [];
this.taxi = null;
this.kingdom = null;
}
t.prototype.cancel = function() {
this.setState(o.Finished);
};
t.prototype.finish = function() {
this.setState(o.Finished);
};
t.prototype.checkList = function() {
for (var t, e, i, o = 0, a = !1; this.actors.length > o; ) {
a = !1;
var r = this.actors[o];
(null === (t = r.data) || void 0 === t ? void 0 : t.alive) && (null === (e = r.currentTile) || void 0 === e ? void 0 : e.isSameIsland(this.requestTile)) ? (null === (i = r.currentTile) || void 0 === i ? void 0 : i.isSameIsland(this.target)) && (a = !0) : a = !0;
a ? this.actors.splice(o, 1) : o++;
}
};
t.prototype.isStillLegit = function() {
var t, e, i;
if (!this.isState(o.Pending) && !(null === (i = null === (e = null === (t = this.taxi) || void 0 === t ? void 0 : t.actor) || void 0 === e ? void 0 : e.data) || void 0 === i ? void 0 : i.alive)) return !1;
this.checkList();
return 0 != this.actors.length && !this.isState(o.Finished);
};
t.prototype.assign = function(t) {
this.taxi = t;
this.setState(o.Assigned);
};
t.prototype.setState = function(t) {
this.state = t;
};
t.prototype.cancelForLatePassengers = function() {
for (var t = 0; t < this.actors.length; ) this.actors[t].insideBoat == this.taxi ? t++ : this.actors.splice(t, 1);
};
t.prototype.everyoneEmbarked = function() {
var t, e;
this.checkList();
try {
for (var i = a(this.actors), o = i.next(); !o.done; o = i.next()) {
var r = o.value;
if (!this.taxi.unitsInside.has(r)) return !1;
}
} catch (e) {
t = {
error: e
};
} finally {
try {
o && !o.done && (e = i.return) && e.call(i);
} finally {
if (t) throw t.error;
}
}
return !0;
};
t.prototype.isState = function(t) {
return this.state == t;
};
return t;
}();
i.default = r;
cc._RF.pop();
}, {} ],
TerraformList: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "b5dcboTwxlE6JltSnPybcLy", "TerraformList");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
});
Object.defineProperty(i, "__esModule", {
value: !0
});
i.TerraformOptions = void 0;
var r = t("../../../../../framework/utils/Tools"), n = t("../AssetLibrary"), s = function(t) {
a(e, t);
function e() {
var e = null !== t && t.apply(this, arguments) || this;
e.spawnPixels = !1;
e.removeTreesFully = !1;
e.destroyBuildings = !1;
e.removeBurned = !1;
e.removeTornado = !1;
e.addBurned = !1;
e.addHeat = 0;
e.flash = !1;
e.removeBorders = !1;
e.removeBuilding = !1;
e.removeGrass = !1;
e.removeRoads = !1;
e.removeFrozen = !1;
e.removeWater = !1;
e.removeRuins = !1;
e.lightningEffect = !1;
e.removeLava = !1;
e.damageBuildings = !1;
e.damage = 0;
e.setFire = !1;
e.applyForce = !1;
e.force_power = 1.5;
e.explode_tile = !1;
e.explosion_pixel_effect = !0;
e.explode_and_set_random_fire = !1;
e.explode_strength = 0;
e.shake = !1;
e.shake_duration = .3;
e.shake_interval = .01;
e.shake_intensity = 2;
e.addTrait = "";
e.ignoreKingdoms = [];
e.destroyOnly = [];
e.ignoreBuildings = [];
return e;
}
return e;
}(n.Asset);
i.TerraformOptions = s;
var l = function(t) {
a(e, t);
function e() {
return null !== t && t.apply(this, arguments) || this;
}
e.prototype.init = function() {
t.prototype.init.call(this);
e.tumor_attack = new s();
e.tumor_attack.id = "tumor_attack";
e.tumor_attack.flash = !0;
e.tumor_attack.destroyBuildings = !0;
e.tumor_attack.ignoreKingdoms = [ "tumor" ];
this.add(e.tumor_attack);
e.destroy = new s();
e.destroy.id = "destroy";
e.destroy.flash = !0;
e.destroy.destroyBuildings = !0;
e.destroy.removeBorders = !0;
this.add(e.destroy);
e.destroy_life = new s();
e.destroy_life.id = "destroy_life";
e.destroy_life.destroyOnly = [ "tumor" ];
e.destroy_life.destroyBuildings = !0;
e.destroy_life.removeBuilding = !0;
e.destroy_life.flash = !0;
e.destroy_life.removeBorders = !0;
e.destroy_life.removeTornado = !0;
this.add(e.destroy_life);
e.earthquake = new s();
e.earthquake.id = "earthquake";
e.earthquake.removeLava = !0;
e.earthquake.destroyBuildings = !0;
e.earthquake.removeBuilding = !0;
this.add(e.earthquake);
e.earthquake = new s();
e.earthquake.id = "earthquakeDisaster";
e.earthquake.removeLava = !0;
e.earthquake.destroyBuildings = !0;
e.earthquake.removeGrass = !0;
e.earthquake.removeRoads = !0;
e.earthquake.removeFrozen = !0;
e.earthquake.removeWater = !0;
this.add(e.earthquake);
e.road = new s();
e.road.id = "road";
e.road.flash = !0;
e.road.removeBuilding = !0;
e.road.destroyBuildings = !0;
e.road.destroyOnly = [ "nature" ];
this.add(e.road);
e.flash = new s();
e.flash.id = "flash";
e.flash.flash = !0;
this.add(e.flash);
e.grey_goo = new s();
e.grey_goo.id = "grey_goo";
e.grey_goo.destroyBuildings = !0;
e.grey_goo.removeBuilding = !0;
e.grey_goo.flash = !0;
e.grey_goo.removeBorders = !0;
this.add(e.grey_goo);
e.remove = new s();
e.remove.id = "remove";
e.remove.flash = !0;
e.remove.removeBuilding = !0;
e.remove.destroyBuildings = !0;
this.add(e.remove);
e.remove = new s();
e.remove.id = "water_fill";
e.remove.flash = !0;
e.remove.removeBuilding = !0;
e.remove.destroyBuildings = !0;
this.add(e.remove);
this.t.ignoreBuildings = [ "geyser", "volcano", "geyserAcid" ];
e.destroy_no_flash = new s();
e.destroy_no_flash.id = "destroy_no_flash";
e.destroy_no_flash.removeBurned = !0;
e.destroy_no_flash.destroyBuildings = !0;
this.add(e.destroy_no_flash);
e.nothing = new s();
e.nothing.id = "nothing";
this.add(e.nothing);
e.removeLava = new s();
e.removeLava.id = "removeLava";
e.removeLava.removeLava = !0;
this.add(e.removeLava);
e.lavaDamage = new s();
e.lavaDamage.id = "lavaDamage";
e.lavaDamage.flash = !0;
e.lavaDamage.damageBuildings = !0;
e.lavaDamage.damage = 10;
this.add(e.lavaDamage);
var i = new s();
i.id = "grenade";
i.flash = !0;
i.damageBuildings = !0;
i.damage = 10;
i.applyForce = !0;
i.spawnPixels = !0;
i.explode_and_set_random_fire = !0;
i.explode_tile = !0;
i.explosion_pixel_effect = !0;
i.explode_strength = 1;
i.shake = !0;
i.removeTornado = !0;
this.add(i);
var o = new s();
o.id = "lightning";
o.flash = !0;
o.lightningEffect = !0;
o.addBurned = !0;
o.addHeat = 9;
o.damage = 77;
o.setFire = !0;
o.applyForce = !0;
o.shake = !0;
this.add(o);
this.t.shake_intensity = .1;
var a = new s();
a.id = "madness_ball";
a.applyForce = !0;
a.force_power = .2;
a.addTrait = "madness";
a.flash = !0;
this.add(a);
var r = new s();
r.id = "ufo_attack";
r.flash = !0;
r.addBurned = !0;
r.addHeat = 3;
r.damage = 50;
r.setFire = !0;
r.applyForce = !0;
r.shake = !0;
this.add(r);
this.t.ignoreKingdoms = [ "aliens" ];
this.t.shake_intensity = .1;
this.clone("ufo_explosion", "grenade");
this.t.ignoreKingdoms = [ "aliens" ];
this.clone("bomb", "grenade");
this.t.damage = 100;
this.t.explode_strength = 3;
this.t.spawnPixels = !0;
this.clone("atomicBomb", "bomb");
this.t.damage = 1e4;
this.clone("czarBomba", "bomb");
this.t.damage = 1e4;
var n = new s();
n.id = "crab";
n.flash = !0;
n.damageBuildings = !0;
n.damage = 10;
n.applyForce = !0;
n.explode_tile = !0;
n.explosion_pixel_effect = !1;
n.explode_strength = 1;
n.shake = !0;
n.shake_intensity = .1;
this.add(n);
this.clone("crab_laser", "bomb");
this.t.damage = 200;
this.t.shake_intensity = 1;
this.clone("santa_bomb", "bomb");
this.t.ignoreKingdoms = [ "santa" ];
this.clone("demon_fireball", "grenade");
this.t.ignoreKingdoms = [ "demons" ];
this.t.shake = !1;
this.t.damageBuildings = !0;
this.t.damage = 30;
this.t.setFire = !0;
this.t.spawnPixels = !1;
this.clone("torch", "grenade");
this.t.ignoreKingdoms = [ "demons" ];
this.t.shake = !1;
this.t.damageBuildings = !0;
this.t.damage = 25;
this.t.setFire = !0;
this.t.spawnPixels = !1;
};
e.prototype.clone = function(t, e) {
var i = JSON.parse(JSON.stringify(this.get(e))), o = r.default.fromJson(i, new s());
o.id = t;
this.add(o);
return o;
};
e.nothing = null;
e.removeLava = null;
e.lavaDamage = null;
e.destroy_no_flash = null;
e.remove = null;
e.grey_goo = null;
e.flash = null;
e.road = null;
e.tumor_attack = null;
e.destroy = null;
e.destroy_life = null;
e.earthquake = null;
return e;
}(n.default);
i.default = l;
cc._RF.pop();
}, {
"../../../../../framework/utils/Tools": void 0,
"../AssetLibrary": "AssetLibrary"
} ],
TesterBehCloseWindows: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "1ba11BdfDBNMaplOdzh6nhK", "TesterBehCloseWindows");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
});
Object.defineProperty(i, "__esModule", {
value: !0
});
var r = function(t) {
a(e, t);
function e() {
return null !== t && t.apply(this, arguments) || this;
}
e.prototype.execute = function(e) {
return t.prototype.execute.call(this, e);
};
return e;
}(t("../behaviour/BehaviourActionBase").BehaviourActionTester);
i.default = r;
cc._RF.pop();
}, {
"../behaviour/BehaviourActionBase": "BehaviourActionBase"
} ],
TesterBehCreateBuildings: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "8fb8dQshP5NArLXRNzvz2QZ", "TesterBehCreateBuildings");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
});
Object.defineProperty(i, "__esModule", {
value: !0
});
var r = t("../behaviour/BehaviourActionBase"), n = t("../MapBox"), s = function(t) {
a(e, t);
function e() {
return null !== t && t.apply(this, arguments) || this;
}
e.prototype.TesterBehCreateBuildings = function() {
if (0 == e.assets.length) {
e.assets.push("tree");
e.assets.push("stone");
e.assets.push("ore_deposit");
e.assets.push("gold");
e.assets.push("fruit_bush");
e.assets.push("palm");
e.assets.push("pine");
e.assets.push("tumor");
e.assets.push("goldenBrain");
e.assets.push("corruptedBrain");
e.assets.push("beehive");
e.assets.push("iceTower");
e.assets.push("flameTower");
e.assets.push("volcano");
e.assets.push("geyserAcid");
e.assets.push("geyser");
}
};
e.prototype.execute = function(i) {
if (e.last_id > e.assets.length - 1) {
e.last_id = 0;
e.assets.shuffle();
}
for (var o = e.assets[e.last_id++], a = 0; a < 3; a++) {
var r = n.default.inst.zoneCalculator.zones.getRandom();
n.default.inst.addBuilding(o, r.centerTile, null, !0);
}
return t.prototype.execute.call(this, i);
};
e.assets = [];
e.last_id = 0;
return e;
}(r.BehaviourActionTester);
i.default = s;
cc._RF.pop();
}, {
"../MapBox": "MapBox",
"../behaviour/BehaviourActionBase": "BehaviourActionBase"
} ],
TesterBehCreateUnits: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "92f4bUbtbZNX7bemHs71WoW", "TesterBehCreateUnits");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
});
Object.defineProperty(i, "__esModule", {
value: !0
});
var r = t("../behaviour/BehaviourActionBase"), n = t("../MapBox"), s = function(t) {
a(e, t);
function e() {
var i = t.call(this) || this;
if (0 == e.assets.length) {
e.assets.push("unit_human");
e.assets.push("unit_elf");
e.assets.push("unit_orc");
e.assets.push("unit_dwarf");
e.assets.push("baby_human");
e.assets.push("baby_elf");
e.assets.push("baby_orc");
e.assets.push("baby_dwarf");
e.assets.push("antBlack");
e.assets.push("antGreen");
e.assets.push("antBlue");
e.assets.push("antRed");
e.assets.push("sandSpider");
e.assets.push("worm");
e.assets.push("printer");
e.assets.push("dragon");
e.assets.push("zombie_dragon");
e.assets.push("UFO");
e.assets.push("tornado");
e.assets.push("godFinger");
e.assets.push("santa");
e.assets.push("sheep");
e.assets.push("cow");
e.assets.push("penguin");
e.assets.push("turtle");
e.assets.push("crab");
e.assets.push("fairy");
e.assets.push("bee");
e.assets.push("fly");
e.assets.push("butterfly");
e.assets.push("grasshopper");
e.assets.push("beetle");
e.assets.push("egg_chicken");
e.assets.push("egg_crab");
e.assets.push("egg_turtle");
e.assets.push("chicken");
e.assets.push("chick");
e.assets.push("rat");
e.assets.push("zombie_rat");
e.assets.push("ratKing");
e.assets.push("zombie_ratKing");
e.assets.push("cat");
e.assets.push("rabbit");
e.assets.push("piranha");
e.assets.push("bandit");
e.assets.push("snowman");
e.assets.push("bear");
e.assets.push("wolf");
e.assets.push("demon");
e.assets.push("zombie");
e.assets.push("necromancer");
e.assets.push("whiteMage");
e.assets.push("evilMage");
e.assets.push("skeleton");
e.assets.push("skeleton_cursed");
e.assets.push("walker");
}
return i;
}
e.prototype.execute = function(i) {
if (e.last_id > e.assets.length - 1) {
e.last_id = 0;
e.assets.shuffle();
}
for (var o = e.assets[e.last_id++], a = 0; a < 10; a++) {
var r = n.default.inst.zoneCalculator.zones.getRandom();
n.default.inst.createNewUnitBySpawning(o, r.centerTile);
}
return t.prototype.execute.call(this, i);
};
e.assets = [];
e.last_id = 0;
return e;
}(r.BehaviourActionTester);
i.default = s;
cc._RF.pop();
}, {
"../MapBox": "MapBox",
"../behaviour/BehaviourActionBase": "BehaviourActionBase"
} ],
TesterBehDestroySimObjects: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "874bb5o2PBHT61LWTYFbK4c", "TesterBehDestroySimObjects");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
});
Object.defineProperty(i, "__esModule", {
value: !0
});
var r = t("../behaviour/BehaviourActionBase"), n = t("../MapBox"), s = function(t) {
a(e, t);
function e() {
return null !== t && t.apply(this, arguments) || this;
}
e.prototype.execute = function(e) {
n.default.inst.units.list.forEach(function(t) {
t.getHit(1e10);
});
n.default.inst.buildings.list.forEach(function(t) {
t.getHit(1e10);
});
return t.prototype.execute.call(this, e);
};
return e;
}(r.BehaviourActionTester);
i.default = s;
cc._RF.pop();
}, {
"../MapBox": "MapBox",
"../behaviour/BehaviourActionBase": "BehaviourActionBase"
} ],
TesterBehEndJobTest: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "1ab0e/MGiJHnLejdRhrtiwv", "TesterBehEndJobTest");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
});
Object.defineProperty(i, "__esModule", {
value: !0
});
var r = t("../behaviour/BehaviourActionBase"), n = function(t) {
a(e, t);
function e() {
return null !== t && t.apply(this, arguments) || this;
}
e.prototype.execute = function(t) {
t.ai.setJob(null);
return r.BehResult.Continue;
};
return e;
}(r.BehaviourActionTester);
i.default = n;
cc._RF.pop();
}, {
"../behaviour/BehaviourActionBase": "BehaviourActionBase"
} ],
TesterBehFillWorld: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "1e4602VoS5OH7c9LHxmHjSP", "TesterBehFillWorld");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
});
Object.defineProperty(i, "__esModule", {
value: !0
});
var r = t("../assetLibrary/lib/TerraformList"), n = t("../behaviour/BehaviourActionBase"), s = t("../map/tile/TileType"), l = t("../MapBox"), c = function(t) {
a(e, t);
function e(e) {
var i = t.call(this) || this;
i.type = "";
i.type = e;
return i;
}
e.prototype.execute = function(i) {
0 == e.tiles.length && s.TileType.list_gameplay.forEach(function(t) {
e.tiles.push(t.name);
});
var o = this.type;
"random" == this.type && (o = e.tiles.getRandom());
for (var a = s.TileType.get(o), n = 0; n < 3; n++) l.default.inst.mapChunkManager.list.getRandom().tiles.forEach(function(t) {
l.default.inst.terraformTile2(t, a, r.default.destroy_no_flash);
});
return t.prototype.execute.call(this, i);
};
e.tiles = [];
return e;
}(n.BehaviourActionTester);
i.default = c;
cc._RF.pop();
}, {
"../MapBox": "MapBox",
"../assetLibrary/lib/TerraformList": "TerraformList",
"../behaviour/BehaviourActionBase": "BehaviourActionBase",
"../map/tile/TileType": "TileType"
} ],
TesterBehGenerateMap: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "08ce1Z5iVFOR4oYqQ4j5DVw", "TesterBehGenerateMap");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
});
Object.defineProperty(i, "__esModule", {
value: !0
});
var r = t("../behaviour/BehaviourActionBase"), n = t("../Config"), s = t("../MapBox"), l = function(t) {
a(e, t);
function e() {
return null !== t && t.apply(this, arguments) || this;
}
e.prototype.execute = function(e) {
n.default.customZoneX = 7;
n.default.customZoneY = 7;
s.default.inst.generateNewMap("custom");
return t.prototype.execute.call(this, e);
};
return e;
}(r.BehaviourActionTester);
i.default = l;
cc._RF.pop();
}, {
"../Config": "Config",
"../MapBox": "MapBox",
"../behaviour/BehaviourActionBase": "BehaviourActionBase"
} ],
TesterBehOpenWindow: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "358d454ixVN34WtvDFeG8o5", "TesterBehOpenWindow");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
});
Object.defineProperty(i, "__esModule", {
value: !0
});
var r = function(t) {
a(e, t);
function e(e) {
var i = t.call(this) || this;
i.windows = [];
i.type = "";
i.type = e;
i.windows.remove("register");
i.windows.remove("worldnet_reset_password");
i.windows.remove("worldnet_main");
i.windows.remove("kingdom_technology");
i.windows.remove("worldnet_login");
i.windows.remove("worldnet_logout");
i.windows.remove("moonbox_promo");
i.windows.remove("inspect_unit");
i.windows.remove("kingdom");
i.windows.remove("village");
i.windows.remove("brushes");
return i;
}
e.prototype.execute = function(e) {
return t.prototype.execute.call(this, e);
};
return e;
}(t("../behaviour/BehaviourActionBase").BehaviourActionTester);
i.default = r;
cc._RF.pop();
}, {
"../behaviour/BehaviourActionBase": "BehaviourActionBase"
} ],
TesterBehRandomPower: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "801e5PNtPRFKrKbcnWlBvTq", "TesterBehRandomPower");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
});
Object.defineProperty(i, "__esModule", {
value: !0
});
var r = t("../../../../framework/utils/Log"), n = t("../assetLibrary/AssetManager"), s = t("../behaviour/BehaviourActionBase"), l = t("../brush/Brush"), c = t("../common/ToolBox"), u = t("../Config"), d = t("../MapBox"), h = t("../ui/power/GodPower"), p = function(t) {
a(e, t);
function e() {
return null !== t && t.apply(this, arguments) || this;
}
e.prototype.TesterBehRandomPower = function() {
0 == e.events.length && n.default.powers.list.forEach(function(t) {
if ("_" != t.id[0] && t.tester_enabled) {
e.events.push(t.id);
if (t.actionType == h.PowerActionType.Tile) {
e.events.push(t.id);
e.events.push(t.id);
e.events.push(t.id);
}
}
});
};
e.prototype.execute = function(i) {
if (e.last_id > e.events.length - 1) {
e.last_id = 0;
e.events.shuffle();
}
var o = e.events[e.last_id++];
c.Toolbox.randomInt(0, d.default.width), c.Toolbox.randomInt(0, d.default.height);
if (!n.default.powers.dict.has(o)) {
r.default.e("TESTER ERROR... " + o);
return s.BehResult.Continue;
}
n.default.powers.get(o);
u.default.currentBrush = l.default.getRandom();
i.debugString = "rand_power_" + o;
return t.prototype.execute.call(this, i);
};
e.events = [];
e.last_id = 0;
return e;
}(s.BehaviourActionTester);
i.default = p;
cc._RF.pop();
}, {
"../../../../framework/utils/Log": void 0,
"../Config": "Config",
"../MapBox": "MapBox",
"../assetLibrary/AssetManager": "AssetManager",
"../behaviour/BehaviourActionBase": "BehaviourActionBase",
"../brush/Brush": "Brush",
"../common/ToolBox": "ToolBox",
"../ui/power/GodPower": "GodPower"
} ],
TesterBehSuperDamageToUnits: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "1a9c4iMnJpI2JHPk4N39cdM", "TesterBehSuperDamageToUnits");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
});
Object.defineProperty(i, "__esModule", {
value: !0
});
var r = t("../behaviour/BehaviourActionBase"), n = t("../MapBox"), s = function(t) {
a(e, t);
function e() {
return null !== t && t.apply(this, arguments) || this;
}
e.prototype.execute = function(e) {
n.default.inst.units.list.forEach(function(t) {
t.stats.canBeKilledByStuff && t.getHit(1e17);
});
return t.prototype.execute.call(this, e);
};
return e;
}(r.BehaviourActionTester);
i.default = s;
cc._RF.pop();
}, {
"../MapBox": "MapBox",
"../behaviour/BehaviourActionBase": "BehaviourActionBase"
} ],
TesterBehTaskLibrary: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "77cbeMfedZArL4aB5boPBv8", "TesterBehTaskLibrary");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
});
Object.defineProperty(i, "__esModule", {
value: !0
});
var r = t("../assetLibrary/AssetLibrary"), n = t("../behaviour/BehaviourTaskBase"), s = t("./TesterBehCloseWindows"), l = t("./TesterBehCreateBuildings"), c = t("./TesterBehCreateUnits"), u = t("./TesterBehDestroySimObjects"), d = t("./TesterBehEndJobTest"), h = t("./TesterBehFillWorld"), p = t("./TesterBehGenerateMap"), f = t("./TesterBehOpenWindow"), m = t("./TesterBehRandomPower"), y = t("./TesterBehSuperDamageToUnits"), _ = t("./TesterBehWait"), g = function(t) {
a(e, t);
function e() {
return null !== t && t.apply(this, arguments) || this;
}
e.prototype.init = function() {
t.prototype.init.call(this);
var e = new n.BehaviourTaskTester();
e.id = "close_all_windows";
this.add(e);
this.t.addBeh(new s.default());
this.t.addBeh(new _.default(1));
var i = new n.BehaviourTaskTester();
i.id = "open_random_window";
this.add(i);
this.t.addBeh(new f.default("random"));
this.t.addBeh(new _.default(1));
var o = new n.BehaviourTaskTester();
o.id = "fill_world_lava";
this.add(o);
for (var a = 0; a < 50; a++) this.t.addBeh(new h.default("lava2"));
var r = new n.BehaviourTaskTester();
r.id = "fill_world_pit";
this.add(r);
for (var g = 0; g < 50; g++) this.t.addBeh(new h.default("pit_close_ocean"));
var v = new n.BehaviourTaskTester();
v.id = "fill_world_water";
this.add(v);
for (var b = 0; b < 50; b++) this.t.addBeh(new h.default("deep_ocean"));
var T = new n.BehaviourTaskTester();
T.id = "fill_world_soil";
this.add(T);
for (var w = 0; w < 50; w++) this.t.addBeh(new h.default("soil"));
var B = new n.BehaviourTaskTester();
B.id = "fill_world_randomly";
this.add(B);
for (var k = 0; k < 50; k++) this.t.addBeh(new h.default("random"));
var A = new n.BehaviourTaskTester();
A.id = "random_power";
this.add(A);
for (var S = 0; S < 10; S++) {
this.t.addBeh(new m.default());
this.t.addBeh(new _.default(.1));
}
var x = new n.BehaviourTaskTester();
x.id = "destroy_sim_objects";
this.add(x);
this.t.addBeh(new u.default());
var C = new n.BehaviourTaskTester();
C.id = "end_test";
this.add(C);
this.t.addBeh(new d.default());
var O = new n.BehaviourTaskTester();
O.id = "wait_1";
this.add(O);
this.t.addBeh(new _.default(1));
var P = new n.BehaviourTaskTester();
P.id = "wait_5";
this.add(P);
this.t.addBeh(new _.default(5));
var R = new n.BehaviourTaskTester();
R.id = "wait_10";
this.add(R);
this.t.addBeh(new _.default(10));
var M = new n.BehaviourTaskTester();
M.id = "wait_20";
this.add(M);
this.t.addBeh(new _.default(20));
var L = new n.BehaviourTaskTester();
L.id = "spawn_units";
this.add(L);
for (var F = 0; F < 10; F++) {
this.t.addBeh(new c.default());
this.t.addBeh(new _.default(.1));
}
var D = new n.BehaviourTaskTester();
D.id = "spawn_buildings";
this.add(D);
for (var I = 0; I < 10; I++) this.t.addBeh(new l.default());
var j = new n.BehaviourTaskTester();
j.id = "generate_map_random";
this.add(j);
this.t.addBeh(new p.default());
var E = new n.BehaviourTaskTester();
E.id = "super_damage_units";
this.add(E);
this.t.addBeh(new y.default());
};
return e;
}(r.default);
i.default = g;
cc._RF.pop();
}, {
"../assetLibrary/AssetLibrary": "AssetLibrary",
"../behaviour/BehaviourTaskBase": "BehaviourTaskBase",
"./TesterBehCloseWindows": "TesterBehCloseWindows",
"./TesterBehCreateBuildings": "TesterBehCreateBuildings",
"./TesterBehCreateUnits": "TesterBehCreateUnits",
"./TesterBehDestroySimObjects": "TesterBehDestroySimObjects",
"./TesterBehEndJobTest": "TesterBehEndJobTest",
"./TesterBehFillWorld": "TesterBehFillWorld",
"./TesterBehGenerateMap": "TesterBehGenerateMap",
"./TesterBehOpenWindow": "TesterBehOpenWindow",
"./TesterBehRandomPower": "TesterBehRandomPower",
"./TesterBehSuperDamageToUnits": "TesterBehSuperDamageToUnits",
"./TesterBehWait": "TesterBehWait"
} ],
TesterBehWait: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "732d9jDBLdOwJSsSJ63HquI", "TesterBehWait");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
});
Object.defineProperty(i, "__esModule", {
value: !0
});
var r = function(t) {
a(e, t);
function e(e) {
var i = t.call(this) || this;
i.wait = 0;
i.wait = e;
return i;
}
e.prototype.execute = function(e) {
e.wait = this.wait;
return t.prototype.execute.call(this, e);
};
return e;
}(t("../behaviour/BehaviourActionBase").BehaviourActionTester);
i.default = r;
cc._RF.pop();
}, {
"../behaviour/BehaviourActionBase": "BehaviourActionBase"
} ],
TesterJobLibrary: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "1ccdaW8oUJMk4rTF6rqIcBJ", "TesterJobLibrary");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
});
Object.defineProperty(i, "__esModule", {
value: !0
});
i.JobTesterAsset = void 0;
var r = t("../actors/ActorJob"), n = t("../assetLibrary/AssetLibrary"), s = function(t) {
a(e, t);
function e() {
return null !== t && t.apply(this, arguments) || this;
}
return e;
}(r.JobAsset);
i.JobTesterAsset = s;
var l = function(t) {
a(e, t);
function e() {
var e = null !== t && t.apply(this, arguments) || this;
e._last_job = 0;
return e;
}
e.prototype.init = function() {
t.prototype.init.call(this);
var e = new s();
e.id = "test_spawn_units";
this.add(e);
this.t.addTask("spawn_units");
this.t.addTask("wait_1");
this.t.addTask("spawn_units");
this.t.addTask("wait_1");
this.t.addTask("spawn_units");
this.t.addTask("wait_1");
this.t.addTask("spawn_units");
this.t.addTask("wait_1");
this.t.addTask("spawn_units");
this.t.addTask("wait_1");
this.t.addTask("super_damage_units");
this.t.addTask("end_test");
var i = new s();
i.id = "test_spawn_buildings";
this.add(i);
this.t.addTask("spawn_buildings");
this.t.addTask("wait_1");
this.t.addTask("spawn_buildings");
this.t.addTask("wait_1");
this.t.addTask("spawn_buildings");
this.t.addTask("wait_1");
this.t.addTask("spawn_buildings");
this.t.addTask("wait_1");
this.t.addTask("spawn_buildings");
this.t.addTask("wait_1");
this.t.addTask("end_test");
var o = new s();
o.id = "destroy_sim_objects";
this.add(o);
this.t.addTask("destroy_sim_objects");
this.t.addTask("end_test");
var a = new s();
a.id = "test_random_power";
this.add(a);
this.t.addTask("random_power");
this.t.addTask("wait_1");
this.t.addTask("random_power");
this.t.addTask("wait_1");
this.t.addTask("random_power");
this.t.addTask("wait_1");
this.t.addTask("random_power");
this.t.addTask("wait_1");
this.t.addTask("random_power");
this.t.addTask("wait_1");
this.t.addTask("random_power");
this.t.addTask("wait_1");
this.t.addTask("random_power");
this.t.addTask("wait_1");
this.t.addTask("random_power");
this.t.addTask("wait_1");
this.t.addTask("random_power");
this.t.addTask("end_test");
var r = new s();
r.id = "test_world_change";
this.add(r);
this.t.addTask("fill_world_water");
this.t.addTask("wait_1");
this.t.addTask("fill_world_randomly");
this.t.addTask("wait_1");
this.t.addTask("fill_world_soil");
this.t.addTask("wait_1");
this.t.addTask("fill_world_randomly");
this.t.addTask("wait_1");
this.t.addTask("end_test");
var n = new s();
n.id = "test_world_pit";
this.add(n);
this.t.addTask("fill_world_pit");
this.t.addTask("wait_10");
this.t.addTask("end_test");
var l = new s();
l.id = "test_world_lava";
this.add(l);
this.t.addTask("fill_world_lava");
this.t.addTask("wait_5");
this.t.addTask("end_test");
var c = new s();
c.id = "test_windows";
this.add(c);
this.t.addTask("end_test");
this.t.addTask("open_random_window");
this.t.addTask("open_random_window");
this.t.addTask("open_random_window");
this.t.addTask("open_random_window");
this.t.addTask("open_random_window");
this.t.addTask("open_random_window");
this.t.addTask("open_random_window");
this.t.addTask("open_random_window");
this.t.addTask("open_random_window");
this.t.addTask("open_random_window");
this.t.addTask("open_random_window");
this.t.addTask("open_random_window");
this.t.addTask("open_random_window");
this.t.addTask("open_random_window");
this.t.addTask("close_all_windows");
this.t.addTask("end_test");
var u = new s();
u.id = "test_camera";
this.add(u);
this.t.addTask("wait_1");
this.t.addTask("end_test");
var d = new s();
d.id = "test_drops";
this.add(d);
this.t.addTask("wait_1");
this.t.addTask("end_test");
var h = new s();
h.id = "test_epic_mage_fight";
this.add(h);
this.t.addTask("wait_1");
this.t.addTask("end_test");
var p = new s();
p.id = "generate_map_random";
this.add(p);
this.t.addTask("wait_1");
this.t.addTask("end_test");
};
e.prototype.getNextJob = function() {
if (this._last_job > this.list.length - 1) {
this._last_job = 0;
this.list.shuffle();
}
return this.list[this._last_job++].id;
};
return e;
}(n.default);
i.default = l;
cc._RF.pop();
}, {
"../actors/ActorJob": "ActorJob",
"../assetLibrary/AssetLibrary": "AssetLibrary"
} ],
TextureBuffer: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "33ce9MDAmFFE6n+RoZHsWlN", "TextureBuffer");
Object.defineProperty(i, "__esModule", {
value: !0
});
i.TextureBuffer = void 0;
var o = function() {
function t(t, e, i, o, a) {
void 0 === a && (a = !0);
this.name = "";
this.width_ = 0;
this.height_ = 0;
this.onlyAlpha_ = !0;
this.dataArray_ = null;
this.name = t;
this.width_ = i;
this.height_ = o;
this.dataArray_ = e;
this.onlyAlpha_ = a;
}
t.prototype.clone = function() {
return new t(this.name, this.dataArray_, this.width_, this.height_, this.onlyAlpha_);
};
Object.defineProperty(t.prototype, "width", {
get: function() {
return this.width_;
},
enumerable: !1,
configurable: !0
});
Object.defineProperty(t.prototype, "height", {
get: function() {
return this.height_;
},
enumerable: !1,
configurable: !0
});
t.prototype.getPixel = function(t, e) {
var i = cc.color(0, 0, 0, 0), o = e * this.width_ + t;
if (this.onlyAlpha_) {
i.r = this.dataArray_[o];
i.g = this.dataArray_[o];
i.b = this.dataArray_[o];
i.a = this.dataArray_[o];
} else {
i.r = this.dataArray_[4 * o + 0];
i.g = this.dataArray_[4 * o + 1];
i.b = this.dataArray_[4 * o + 2];
i.a = this.dataArray_[4 * o + 3];
}
return i;
};
t.prototype.getPixels = function() {
for (var t = [], e = 0; e < this.height * this.width; e++) {
var i = cc.color(0, 0, 0, 0);
if (this.onlyAlpha_) i.a = this.dataArray_[e]; else {
i.r = this.dataArray_[4 * e + 0];
i.g = this.dataArray_[4 * e + 1];
i.b = this.dataArray_[4 * e + 2];
i.a = this.dataArray_[4 * e + 3];
}
t.push(i);
}
return t;
};
t.prototype.setPixels = function(t, e, i) {
this.width_ = e;
this.height_ = i;
this.dataArray_ = this.onlyAlpha_ ? new Uint8Array(e * i) : new Uint8Array(e * i * 4);
for (var o = 0; o < e * i; o++) {
var a = t[o];
if (this.onlyAlpha_) this.dataArray_[o] = a.a; else {
this.dataArray_[4 * o + 0] = a.r;
this.dataArray_[4 * o + 1] = a.g;
this.dataArray_[4 * o + 2] = a.b;
this.dataArray_[4 * o + 3] = a.a;
}
}
return this;
};
return t;
}();
i.TextureBuffer = o;
cc._RF.pop();
}, {} ],
TextureLoader: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "26baaopLeRK34fJFH7BH472", "TextureLoader");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
}), r = this && this.__decorate || function(t, e, i, o) {
var a, r = arguments.length, n = r < 3 ? e : null === o ? o = Object.getOwnPropertyDescriptor(e, i) : o;
if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) n = Reflect.decorate(t, e, i, o); else for (var s = t.length - 1; s >= 0; s--) (a = t[s]) && (n = (r < 3 ? a(n) : r > 3 ? a(e, i, n) : a(e, i)) || n);
return r > 3 && n && Object.defineProperty(e, i, n), n;
};
Object.defineProperty(i, "__esModule", {
value: !0
});
i.TextureLoader = i.ATLAS_TYPE = i.BIN_TYPE = void 0;
var n, s, l = t("./TextureBuffer");
(function(t) {
t.gen_shapes = "gen_shapes";
t.edges = "edges";
t.prints = "prints";
t.buildingsmini = "buildingsmini";
t.tilemap = "tilemap";
t.brushes = "brushes";
})(n = i.BIN_TYPE || (i.BIN_TYPE = {}));
(function(t) {
t.WORLDATLAS = "worldAtlas";
t.UIATLAS = "uiAtlas";
})(s = i.ATLAS_TYPE || (i.ATLAS_TYPE = {}));
var c = cc._decorator, u = c.ccclass, d = c.property, h = function(t) {
a(e, t);
function e() {
var e = null !== t && t.apply(this, arguments) || this;
e.worldAtlas = null;
e.uiAtlas = null;
e.gen_shapes = [];
e.edges = [];
e.prints = [];
e.buildingsmini = [];
e.tilemap = [];
e.brushes = [];
e.textures = new Map();
e.binInfo = {
gen_shapes: {
onlyAlpha: !0,
default: [ 60, 60 ]
},
edges: {
onlyAlpha: !0,
default: [ 50, 50 ]
},
prints: {
onlyAlpha: !0,
print_dbutt: [ 42, 59 ],
print_diamond: [ 100, 100 ],
print_heart: [ 100, 100 ],
print_hexagon: [ 100, 100 ],
print_island1: [ 100, 100 ],
print_skull: [ 13, 13 ],
print_squares: [ 100, 100 ],
print_star: [ 100, 100 ],
print_yin_yang: [ 18, 18 ],
quake1: [ 120, 120 ],
quake2: [ 120, 120 ],
quake3: [ 120, 120 ]
},
buildingsmini: {
onlyAlpha: !1,
path: "buildingsmini"
},
tilemap: {
onlyAlpha: !1,
path: "tilemap"
},
brushes: {
onlyAlpha: !0,
brush_diamond_1: [ 11, 11 ],
brush_diamond_2: [ 14, 14 ],
brush_diamond_4: [ 24, 24 ],
brush_diamond_5: [ 40, 40 ],
brush_diamond_7: [ 50, 50 ],
brush_special_1: [ 33, 33 ],
brush_special_2: [ 45, 45 ],
brush_special_3: [ 70, 70 ],
brush_special_4: [ 22, 22 ],
brush_special_5: [ 14, 14 ]
}
};
return e;
}
i = e;
e.prototype.onLoad = function() {
i.inst = this;
for (var t in n) this.loadTextureBuffer(t);
};
e.prototype.loadTextureBuffer = function(t) {
var e = this.binInfo[t], i = e.onlyAlpha ? null : this.getSpriteFrames(s.WORLDATLAS, e.path), o = this[t], a = new Map();
this.textures.set(t, a);
for (var r = 0; r < o.length; r++) {
var n = o[r], c = new Uint8Array(n._buffer), u = i ? i.get(n.name).getOriginalSize().width : null != e.default ? e.default[0] : e[n.name][0], d = i ? i.get(n.name).getOriginalSize().height : null != e.default ? e.default[1] : e[n.name][1], h = new l.TextureBuffer(n.name, c, u, d, e.onlyAlpha);
a.set(n.name, h);
}
};
e.prototype.getTexture = function(t, e) {
return this.textures.get(t).get(e);
};
e.prototype.getTextures = function(t) {
return this.textures.get(t);
};
e.prototype.getSpriteAtlas = function(t) {
switch (t) {
case s.WORLDATLAS:
return this.worldAtlas;

case s.UIATLAS:
return this.uiAtlas;

default:
return null;
}
};
e.prototype.getSpriteFrame = function(t, e) {
var i = this.getSpriteAtlas(t);
e = e.replace(/\//g, "-");
return i.getSpriteFrame(e);
};
e.prototype.getSpriteFrames = function(t, e) {
var i = new Map(), o = this.getSpriteAtlas(t);
e = (e = e.replace(/\//g, "-")).lastIndexOf("-") == e.length - 1 ? e : e + "-";
o.getSpriteFrames().forEach(function(t) {
if (t.name.includes(e)) {
var o = t.name.substring(e.length);
i.set(o, t);
}
});
return i;
};
var i;
e.inst = null;
r([ d(cc.SpriteAtlas) ], e.prototype, "worldAtlas", void 0);
r([ d(cc.SpriteAtlas) ], e.prototype, "uiAtlas", void 0);
r([ d([ cc.BufferAsset ]) ], e.prototype, "gen_shapes", void 0);
r([ d([ cc.BufferAsset ]) ], e.prototype, "edges", void 0);
r([ d([ cc.BufferAsset ]) ], e.prototype, "prints", void 0);
r([ d([ cc.BufferAsset ]) ], e.prototype, "buildingsmini", void 0);
r([ d([ cc.BufferAsset ]) ], e.prototype, "tilemap", void 0);
r([ d([ cc.BufferAsset ]) ], e.prototype, "brushes", void 0);
return i = r([ u ], e);
}(cc.Component);
i.TextureLoader = h;
cc._RF.pop();
}, {
"./TextureBuffer": "TextureBuffer"
} ],
TextureRotator: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "0bd85/qyeVPwpfnTi0kN/zG", "TextureRotator");
Object.defineProperty(i, "__esModule", {
value: !0
});
i.TextureRotator = void 0;
var o = t("../../../../framework/lib/prototype/MathUtils"), a = function() {
function t() {}
t.rotate = function(e, i) {
var o = t.rotateSquare(e.getPixels(), Math.PI / 180 * i, e);
return e.setPixels(o, e.width, e.height);
};
t.rotateSquare = function(t, e, i) {
for (var a = Math.sin(e), r = Math.cos(e), n = i.getPixels(), s = i.width, l = i.height, c = o.default.intCast(s / 2), u = o.default.intCast(l / 2), d = 0; d < l; d++) for (var h = 0; h < s; h++) {
n[d * s + h] = cc.Color.TRANSPARENT;
var p = o.default.intCast(r * (h - c) + a * (d - u) + c), f = o.default.intCast((0 - a) * (h - c) + r * (d - u) + u);
p > -1 && p < s && f > -1 && f < l && (n[d * s + h] = t[f * s + p]);
}
return n;
};
return t;
}();
i.TextureRotator = a;
cc._RF.pop();
}, {
"../../../../framework/lib/prototype/MathUtils": void 0
} ],
TextureScale: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "36359fUMFdEmbhldRbFwj3f", "TextureScale");
Object.defineProperty(i, "__esModule", {
value: !0
});
i.TextureScale = i.ThreadData = void 0;
var o = t("../../../../framework/lib/prototype/MathUtils"), a = function(t, e) {
this.start = 0;
this.end = 0;
this.start = t;
this.end = e;
};
i.ThreadData = a;
var r = function() {
function t() {}
t.point = function(e, i, o) {
t.threadedScale(e, i, o, !1);
};
t.bilinear = function(e, i, o) {
t.threadedScale(e, i, o, !0);
};
t.threadedScale = function(e, i, o, r) {
t.texColors = e.getPixels();
t.newColors = [];
if (r) {
t.ratioX = 1 / (i / (e.width - 1));
t.ratioY = 1 / (o / (e.height - 1));
} else {
t.ratioX = e.width / i;
t.ratioY = e.height / o;
}
t.w = e.width;
t.w2 = i;
var n = Math.min(6, o);
if (n > 1) {
var s;
s = new a(o / n * 0, o);
r ? t.bilinearScale(s) : t.pointScale(s);
} else {
var l = new a(0, o);
r ? t.bilinearScale(l) : t.pointScale(l);
}
e.setPixels(t.newColors, i, o);
t.texColors = null;
t.newColors = null;
};
t.bilinearScale = function(e) {
for (var i = e.start; i < e.end; i++) for (var o = Math.floor(i * t.ratioY), a = o * t.w, r = (o + 1) * t.w, n = i * t.w2, s = 0; s < t.w2; s++) {
var l = Math.floor(s * t.ratioX), c = s * t.ratioX - l;
t.newColors[n + s] = t.colorLerpUnclamped(t.colorLerpUnclamped(t.texColors[a + l], t.texColors[a + l + 1], c), t.colorLerpUnclamped(t.texColors[r + l], t.texColors[r + l + 1], c), i * t.ratioY - o);
}
};
t.pointScale = function(e) {
for (var i = e.start; i < e.end; i++) for (var a = o.default.intCast(t.ratioY * i * t.w), r = i * t.w2, n = 0; n < t.w2; n++) t.newColors[r + n] = t.texColors[o.default.intCast(a + t.ratioX * n)];
};
t.colorLerpUnclamped = function(t, e, i) {
return cc.color(t.r + (e.r - t.r) * i, t.g + (e.g - t.g) * i, t.b + (e.b - t.b) * i, t.a + (e.a - t.a) * i);
};
t.texColors = [];
t.newColors = [];
t.w = 0;
t.ratioX = 0;
t.ratioY = 0;
t.w2 = 0;
return t;
}();
i.TextureScale = r;
cc._RF.pop();
}, {
"../../../../framework/lib/prototype/MathUtils": void 0
} ],
TileDictionary: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "1e0bb9+8tpOD77pLcEC+uyQ", "TileDictionary");
Object.defineProperty(i, "__esModule", {
value: !0
});
i.TileDictionary = void 0;
var o = t("../../../../../framework/lib/prototype/MathUtils"), a = function() {
function t(t) {
void 0 === t && (t = !1);
this.dict = null;
this.array = null;
this.dict = new Map();
t && (this.array = []);
}
t.prototype.clear = function() {
this.dict.clear();
this.array && (this.array = []);
};
t.prototype.contains = function(t) {
return this.dict.has(t);
};
t.prototype.add = function(t) {
if (!this.contains(t)) {
this.dict.set(t, !0);
this.array && this.array.push(t);
}
};
t.prototype.remove = function(t, e) {
void 0 === e && (e = !0);
if (this.dict.delete(t) && this.array) {
var i = this.array[this.array.length - 1];
if (t == i) this.array.pop(); else {
var o = this.array.indexOf(t);
this.array[o] = i;
this.array.pop();
}
}
};
t.prototype.count = function() {
return this.dict.size;
};
t.prototype.length = function() {
return this.dict.size;
};
t.prototype.getRandomTileAndRemove = function() {
if (this.array) {
var t = o.default.getRandom(this.array);
this.remove(t);
return t;
}
throw new Error("need enable random in constructor");
};
t.prototype.getRandomTile = function() {
if (this.array) return o.default.getRandom(this.array);
throw new Error("need enable random in constructor");
};
t.prototype.getArray = function() {
if (this.array) return this.array;
throw new Error("need enable random in constructor");
};
return t;
}();
i.TileDictionary = a;
cc._RF.pop();
}, {
"../../../../../framework/lib/prototype/MathUtils": void 0
} ],
TileIsland: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "588f4dUMmFNq5m7hjrvn/fV", "TileIsland");
var o = this && this.__values || function(t) {
var e = "function" == typeof Symbol && Symbol.iterator, i = e && t[e], o = 0;
if (i) return i.call(t);
if (t && "number" == typeof t.length) return {
next: function() {
t && o >= t.length && (t = void 0);
return {
value: t && t[o++],
done: !t
};
}
};
throw new TypeError(e ? "Object is not iterable." : "Symbol.iterator is not defined.");
};
Object.defineProperty(i, "__esModule", {
value: !0
});
var a = t("./TileDictionary"), r = t("./TileType"), n = function() {
function t(t) {
this.regions = [];
this.regionsCorners = [];
this.created = 0;
this.haveCity = !1;
this.type = r.TileLayerType.Water;
this.dirty = !1;
this.id = 0;
this.tiles_roads = null;
this.removed = !1;
this.actors = [];
this.docks = [];
this._tileCount = 0;
this.cached_connectedIslandsCheck = new Map();
this.id = t;
this.tiles_roads = new a.TileDictionary();
this.created = cc.sys.now();
}
t.prototype.clearRegionsFromIsland = function() {
this.regions.forEach(function(t) {
t.island = null;
});
this.regions.clear();
};
t.prototype.getTileCount = function() {
return this._tileCount;
};
t.prototype.countTiles = function() {
var t = this;
this._tileCount = 0;
this.regions.forEach(function(e) {
t._tileCount += e.tiles.length;
});
};
t.prototype.getRandomTile = function() {
return this.regions.getRandom().tiles.getRandom();
};
t.prototype.connectedWith = function(t) {
var e, i;
if (this.cached_connectedIslandsCheck.has(t)) return this.cached_connectedIslandsCheck.get(t);
var a = null, r = null;
if (t.getTileCount() < this.getTileCount()) {
a = t;
r = this;
} else {
a = this;
r = t;
}
try {
for (var n = o(a.regions), s = n.next(); !s.done; s = n.next()) {
var l = s.value;
if (!l.centerRegion) for (var c = 0; c < l.getTileCorners().length; c++) {
a.cached_connectedIslandsCheck.set(r, !0);
r.cached_connectedIslandsCheck.set(a, !0);
return !0;
}
}
} catch (t) {
e = {
error: t
};
} finally {
try {
s && !s.done && (i = n.return) && i.call(n);
} finally {
if (e) throw e.error;
}
}
a.cached_connectedIslandsCheck.set(r, !1);
r.cached_connectedIslandsCheck.set(a, !1);
return !1;
};
return t;
}();
i.default = n;
cc._RF.pop();
}, {
"./TileDictionary": "TileDictionary",
"./TileType": "TileType"
} ],
TileMap: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "ef5e3kSJhZGbL7e4L0pvlbN", "TileMap");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
}), r = this && this.__decorate || function(t, e, i, o) {
var a, r = arguments.length, n = r < 3 ? e : null === o ? o = Object.getOwnPropertyDescriptor(e, i) : o;
if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) n = Reflect.decorate(t, e, i, o); else for (var s = t.length - 1; s >= 0; s--) (a = t[s]) && (n = (r < 3 ? a(n) : r > 3 ? a(e, i, n) : a(e, i)) || n);
return r > 3 && n && Object.defineProperty(e, i, n), n;
};
Object.defineProperty(i, "__esModule", {
value: !0
});
i.TileLib = i.Tile = void 0;
var n = t("../../MapBox"), s = t("../../texture/TextureLoader"), l = t("../map/MapLayer"), c = function(t, e) {
this.spriteName = "";
this.z = 0;
this.spriteName = t;
this.z = e;
};
i.Tile = c;
var u = function() {
function t() {
this.tiles = [];
this.tiles_dict = new Map();
}
t.prototype.addVariation = function(t, e) {
var i = new c(t, e);
this.tiles_dict.set(t, i);
this.tiles.push(i);
};
t.prototype.getRandom = function() {
return this.tiles.getRandom();
};
t.prototype.getVariation = function(t) {
return this.tiles_dict.get(t);
};
return t;
}();
i.TileLib = u;
var d = cc._decorator, h = d.ccclass, p = (d.property, function(t) {
a(e, t);
function e() {
var e = null !== t && t.apply(this, arguments) || this;
e.maplist = [];
e.templist = [];
e.tilemaplist = [];
e.tileborderlist = [];
e.drawBorder = !1;
return e;
}
e.prototype.setTile = function(t, e, i) {
void 0 === i && (i = !1);
if (i) {
this.tileborderlist[t.x] || (this.tileborderlist[t.x] = []);
this.tileborderlist[t.x][t.y] = e;
e && (this.drawBorder = !0);
} else {
this.maplist[t.x] || (this.maplist[t.x] = []);
this.tilemaplist[t.x] || (this.tilemaplist[t.x] = []);
this.maplist[t.x][t.y] = e;
this.tilemaplist[t.x][t.y] = e;
}
};
e.prototype.doDraw = function() {
for (var t = !1, e = 0; e < this.maplist.length; e++) if (this.maplist[e]) for (var i = 0; i < this.maplist[e].length; i++) if (o = this.maplist[e][i]) {
t = !0;
this.calculatePixel(cc.v2(e, i), o, !1);
}
this.maplist = [];
this.templist = [];
if (this.drawBorder) {
this.drawBorder = !1;
for (e = 0; e < this.tileborderlist.length; e++) if (this.tileborderlist[e]) for (i = 0; i < this.tileborderlist[e].length; i++) {
var o;
(o = this.tileborderlist[e][i]) && this.calculatePixel(cc.v2(e, i), o, !0);
}
}
this.updatePixels();
return t;
};
Object.defineProperty(e.prototype, "count", {
get: function() {
for (var t = 0, e = 0; e < this.maplist.length; e++) if (this.maplist[e]) for (var i = 0; i < this.maplist[e].length; i++) this.maplist[e][i] && t++;
return t;
},
enumerable: !1,
configurable: !0
});
e.prototype.calculatePixel = function(t, e, i) {
void 0 === i && (i = !1);
this.checkTile(t, e, i);
if (!i) for (var o = t.x - 1; o <= t.x + 1; o++) for (var a = t.y - 1; a <= t.y + 1; a++) if (!(this.maplist[o] && this.maplist[o][a] || this.templist[o] && this.templist[o][a])) {
var r = this.tilemaplist[o] && this.tilemaplist[o][a];
if (r && (!e || r.z >= e.z)) {
this.checkTile(cc.v2(o, a), r);
this.templist[o] || (this.templist[o] = []);
this.templist[o][a] = r;
}
}
};
e.prototype.checkTile = function(t, e, i) {
void 0 === i && (i = !1);
if (e) for (var o = this.getTile(t.x, t.y + 1), a = this.getTile(t.x, t.y - 1), r = this.getTile(t.x - 1, t.y), l = this.getTile(t.x + 1, t.y), c = this.getTile(t.x - 1, t.y + 1), u = this.getTile(t.x + 1, t.y + 1), d = this.getTile(t.x - 1, t.y - 1), h = this.getTile(t.x + 1, t.y - 1), p = s.TextureLoader.inst.getTexture(s.BIN_TYPE.tilemap, e.spriteName), f = this.getDownHeight(a), m = 0; m < p.width; m++) for (var y = 0; y < p.height; y++) {
var _ = 4 * t.x + m - 1, g = 4 * t.y + y - 1;
if (!(_ < 0 || _ >= 4 * n.default.width || g < 0 || g >= 4 * n.default.height)) {
var v = p.getPixel(m, y);
if (0 != v.a) {
if (i) {
if (y >= 4) {
if (y > 4) continue;
if (m < 1) {
if (this.skip(r, e) || this.skip(c, e)) continue;
} else if (m > 4) {
if (this.skip(l, e) || this.skip(u, e)) continue;
} else if (this.skip(o, e)) continue;
} else if (m < 2) {
if (this.skip(r, e)) continue;
} else if (m >= 4 && this.skip(l, e)) continue;
} else if (y >= 4) {
if (y >= 5) {
if (this.skip(o, e)) continue;
if (m < 2) {
if (this.skip(c, e)) continue;
} else if (m >= 4 && this.skip(u, e)) continue;
} else if (m < 1) {
if (this.skip(r, e, !0) || this.skip(c, e)) continue;
} else if (m < 2) {
if (this.skip(o, e) || this.skip(r, e, !0)) continue;
} else if (m >= 5) {
if (this.skip(l, e) || this.skip(u, e)) continue;
} else if (m >= 4) {
if (this.skip(o, e) || this.skip(l, e)) continue;
} else if (this.skip(o, e)) continue;
} else if (y < 2) {
if (a && a.z >= e.z && y < (m < 1 || m > 4 ? f - 1 : f)) continue;
if (y < 1) {
if (m < 2) {
if (this.skip(d, e, !0)) continue;
} else if (m >= 4 && this.skip(h, e)) continue;
} else if (m < 1) {
if (this.skip(r, e, !0) || this.skip(d, e, !0)) continue;
} else if (m < 2) {
if (this.skip(r, e, !0)) continue;
} else if (m >= 5) {
if (this.skip(l, e) || this.skip(h, e)) continue;
} else if (m >= 4 && this.skip(l, e)) continue;
} else {
if (a && a.z >= e.z && y < (m < 1 || m > 4 ? f - 1 : f)) continue;
if (m < 2) {
if (this.skip(r, e, !0)) continue;
} else if (m >= 4 && this.skip(l, e)) continue;
}
this.updateTilePixel(_, g, v);
}
}
}
};
e.prototype.getTile = function(t, e) {
return this.tilemaplist[t] && this.tilemaplist[t][e];
};
e.prototype.getDownHeight = function(t) {
var e = 6;
if (t) switch (t.spriteName) {
case "hills_0":
case "mountains_2":
e = 7;
break;

case "mountains_0":
e = 8;
break;

case "mountains_1":
e = 9;
}
return e - 4;
};
e.prototype.skip = function(t, e, i) {
void 0 === i && (i = !1);
return i ? t && t.z >= e.z : t && t.z > e.z;
};
e.prototype.clear = function() {
t.prototype.clear.call(this);
this.tilemaplist = [];
this.tileborderlist = [];
};
return r([ h ], e);
}(l.default));
i.default = p;
cc._RF.pop();
}, {
"../../MapBox": "MapBox",
"../../texture/TextureLoader": "TextureLoader",
"../map/MapLayer": "MapLayer"
} ],
TileMover: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "93fc66iYXZIsIjTk6q3N/+s", "TileMover");
var o = this && this.__values || function(t) {
var e = "function" == typeof Symbol && Symbol.iterator, i = e && t[e], o = 0;
if (i) return i.call(t);
if (t && "number" == typeof t.length) return {
next: function() {
t && o >= t.length && (t = void 0);
return {
value: t && t[o++],
done: !t
};
}
};
throw new TypeError(e ? "Object is not iterable." : "Symbol.iterator is not defined.");
};
Object.defineProperty(i, "__esModule", {
value: !0
});
i.TileSwitch = void 0;
var a = t("../../assetLibrary/AssetManager"), r = t("../../common/ToolBox"), n = t("../../MapBox"), s = function() {
this.tile = null;
this.newType = null;
};
i.TileSwitch = s;
var l = function() {
function t() {
this.newTiles = [];
}
t.prototype.moveTiles = function(t, e) {
var i, l;
this.clear();
try {
for (var c = o(e.pos), u = c.next(); !u.done; u = c.next()) {
var d = u.value, h = n.default.inst.getTile(t.x + d.x, t.y + d.y);
if (h) {
n.default.inst.flashEffects.flashPixel(h, 10);
if (!r.Toolbox.randomChance(.8)) {
var p = h.neighbours.getRandom();
p.type.grass && n.default.inst.removeGreens(p);
p.type.liquid && n.default.inst.removeWater(p);
if (p) {
var f = new s();
f.tile = p;
f.newType = h.type;
this.newTiles.push(f);
}
}
}
}
} catch (t) {
i = {
error: t
};
} finally {
try {
u && !u.done && (l = c.return) && l.call(c);
} finally {
if (i) throw i.error;
}
}
this.newTiles.forEach(function(t) {
n.default.inst.terraformTile2(t.tile, t.newType, a.default.terraform.get("destroy_no_flash"));
t.tile.type.lava && n.default.inst.lavaLayer.loadLavaTile(t.tile);
});
};
t.prototype.clear = function() {
this.newTiles.clear();
};
return t;
}();
i.default = l;
cc._RF.pop();
}, {
"../../MapBox": "MapBox",
"../../assetLibrary/AssetManager": "AssetManager",
"../../common/ToolBox": "ToolBox"
} ],
TileTypeShortcut: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "33907YQtfRH+73o8ctIgNQ7", "TileTypeShortcut");
Object.defineProperty(i, "__esModule", {
value: !0
});
var o = t("./TileType"), a = function() {
function t() {}
t.init = function() {
t.lava0 = o.TileType.get("lava0");
t.lava1 = o.TileType.get("lava1");
t.lava2 = o.TileType.get("lava2");
t.lava3 = o.TileType.get("lava3");
t.hills = o.TileType.get("hills");
t.mountains = o.TileType.get("mountains");
t.shallow_waters = o.TileType.get("shallow_waters");
t.sand = o.TileType.get("sand");
t.field = o.TileType.get("field");
t.soil = o.TileType.get("soil");
t.grass = o.TileType.get("grass");
t.forest_soil = o.TileType.get("forest_soil");
t.forest = o.TileType.get("forest");
t.road = o.TileType.get("road");
};
t.lava0 = null;
t.lava1 = null;
t.lava2 = null;
t.lava3 = null;
t.hills = null;
t.mountains = null;
t.shallow_waters = null;
t.sand = null;
t.field = null;
t.soil = null;
t.forest_soil = null;
t.forest = null;
t.grass = null;
t.road = null;
return t;
}();
i.default = a;
cc._RF.pop();
}, {
"./TileType": "TileType"
} ],
TileType: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "0befbeuantCRYajHKtQa0ah", "TileType");
Object.defineProperty(i, "__esModule", {
value: !0
});
i.TileType = i.TileLayerType = i.GrowTypes = i.TileTypeName = void 0;
var o, a, r, n = t("../../../../../framework/utils/Tools"), s = t("../../common/ToolBox"), l = t("../../texture/TextureLoader"), c = t("./TileTypeShortcut");
(function(t) {
t.close_ocean = "close_ocean";
t.deep_ocean = "deep_ocean";
t.road = "road";
t.field = "field";
t.forest = "forest";
t.forest_flowers = "forest_flowers";
t.forest_soil = "forest_soil";
t.forest_soil_frozen = "forest_soil_frozen";
t.fuse = "fuse";
t.grass = "grass";
t.grass_flowers = "grass_flowers";
t.hills = "hills";
t.hills_frozen = "hills_frozen";
t.mountains = "mountains";
t.mountains_frozen = "mountains_frozen";
t.border_pit = "border_pit";
t.border_water = "border_water";
t.pit_close_ocean = "pit_close_ocean";
t.pit_deep_ocean = "pit_deep_ocean";
t.pit_shallow_waters = "pit_shallow_waters";
t.sand = "sand";
t.sand_frozen = "sand_frozen";
t.sand_creep = "sand_creep";
t.shallow_waters = "shallow_waters";
t.shallow_waters_frozen = "shallow_waters_frozen";
t.soil = "soil";
t.soil_creep = "soil_creep";
t.soil_frozen = "soil_frozen";
t.tnt = "tnt";
t.tnt_timed = "tnt_timed";
t.landmine = "landmine";
t.water_bomb = "water_bomb";
t.fireworks = "fireworks";
t.grey_goo = "grey_goo";
t.tumorInfection = "tumorInfection";
t.empty = "";
})(o = i.TileTypeName || (i.TileTypeName = {}));
(function(t) {
t.fruitBush = "fruit_bush";
t.pine = "pine";
t.tree = "tree";
t.empty = "";
})(a = i.GrowTypes || (i.GrowTypes = {}));
(function(t) {
t[t.Ground = 0] = "Ground";
t[t.Water = 1] = "Water";
t[t.Lava = 2] = "Lava";
t[t.Block = 3] = "Block";
t[t.Goo = 4] = "Goo";
})(r = i.TileLayerType || (i.TileLayerType = {}));
var u = function() {
function t() {
this.layerType = r.Ground;
this.FIRE_STAGES = 30;
this.BURNED_STAGES = 15;
this.EXPLOSION_STAGES = 60;
this.MAX_HEIGHT = 255;
this.increaseTo = null;
this.decreaseTo = null;
this.freezeTo = null;
this.variations = 1;
this.force_edge_variation = !1;
this.force_edge_variation_frame = "";
this.increaseToID = o.empty;
this.decreaseToID = o.empty;
this.freezeToID = o.empty;
this.creep = !1;
this.canBecomeCreep = !1;
this.creepID = o.empty;
this.id = 0;
this.name = o.empty;
this.tileName = o.empty;
this.walkMod = 1;
this.canGrowFlowers = !1;
this.flowersTypeID = "";
this.spawnCreatures = [];
this.block = !1;
this.canBeBurned = !1;
this.canBeFilled = !1;
this.fillToWater = o.empty;
this.liquid = !1;
this.water = !1;
this.ground = !1;
this.frozen = !1;
this.road = !1;
this.life = !1;
this.damagedWhenWalked = !1;
this.greyGoo = !1;
this.flowers = !1;
this.grass = !1;
this.sand = !1;
this.trees = !1;
this.burnable = !1;
this.terraformAfterFire = !1;
this.landmine = !1;
this.explodable = !1;
this.explodableDelayed = !1;
this.explodableTimed = !1;
this.explodableByWater = !1;
this.ignoreWaterEdgeRendering = !1;
this.explodeRange = 0;
this.explodeTimer = 0;
this.damageUnits = !1;
this.damage = 1;
this.give_trait = "";
this.give_trait_chance = 0;
this.lava = !1;
this.lavaLevel = -1;
this.rocks = !1;
this.edge_hills = !1;
this.edge_mountains = !1;
this.growTypes = a.empty;
this.autoGrowPlants = !1;
this.canGrowGreens = !1;
this.growTo = "";
this.cost = 1;
this.canBeFarmField = !1;
this.canBuildOn = !1;
this.fireChance = 1;
this.drawPixel = !1;
this.drawLayer = "";
this.strength = 3;
this.heightMin = -1;
this.additional_height = [];
this.color_road = new cc.Color(0, 0, 0, 0);
this.color_fire = new cc.Color(0, 0, 0, 0);
this.color_frozen = new cc.Color(0, 0, 0, 0);
this.color_dry = new cc.Color(0, 0, 0, 0);
this.color = new cc.Color(0, 0, 0, 0);
this.edge_color = new cc.Color(0, 0, 0, 0);
this.hole_color = new cc.Color(0, 0, 0, 0);
this.trees_color = new cc.Color(0, 0, 0, 0);
this.trees_color_frozen = new cc.Color(0, 0, 0, 0);
this.grass_color = new cc.Color(0, 0, 0, 0);
this.z = 0;
}
t.setListTo = function(e) {
if ("generator" == e) {
t.list = t.list_generator;
t.depth_list = t.depth_list_generator;
} else if ("gameplay" == e) {
t.list = t.list_gameplay;
t.depth_list = t.depth_list_gameplay;
}
};
t.getRandomTileType = function(e) {
void 0 === e && (e = o.empty);
t.temp_list = [];
t.temp_list.push(o.deep_ocean);
t.temp_list.push(o.close_ocean);
t.temp_list.push(o.shallow_waters);
t.temp_list.push(o.sand);
t.temp_list.push(o.soil);
t.temp_list.push(o.forest_soil);
t.temp_list.push(o.soil);
t.temp_list.push(o.hills);
t.temp_list.push(o.mountains);
e && t.temp_list.remove(e, !0);
return s.Toolbox.getRandom(t.temp_list);
};
t.init = function() {
t.list_gameplay = [];
t.list_generator = [];
t.dict = new Map();
t.setListTo("generator");
var e = new t();
e.name = o.deep_ocean;
e.color = s.Toolbox.makeColor("#3370CC");
e.liquid = !0, e.water = !0;
e.heightMin = 0;
e.decreaseToID = o.pit_deep_ocean;
e.increaseToID = o.pit_close_ocean;
e.walkMod = .1;
e.strength = 0;
e.layerType = r.Water;
t.add(e);
t.setDrawLayer();
t.clone(o.close_ocean, o.deep_ocean);
t.t.drawPixel = !0;
t.t.color = s.Toolbox.makeColor("#4084E2");
t.t.heightMin = 30;
t.t.decreaseToID = o.pit_deep_ocean;
t.t.increaseToID = o.pit_shallow_waters;
t.t.strength = 0;
t.t.layerType = r.Water;
t.setDrawLayer(1);
var i = new t();
i.name = o.shallow_waters;
i.color = s.Toolbox.makeColor("#55AEF0");
i.edge_color = s.Toolbox.makeColor("#3F90EA");
i.liquid = !0;
i.water = !0;
i.heightMin = 70;
i.freezeToID = o.shallow_waters_frozen;
i.decreaseToID = o.pit_shallow_waters;
i.increaseToID = o.sand;
i.walkMod = .1;
i.strength = 0;
i.layerType = r.Water;
t.add(i);
t.setDrawLayer(2);
t.clone(o.pit_deep_ocean, o.deep_ocean);
t.t.drawPixel = !0;
t.t.color = s.Toolbox.makeColor("#898989");
t.t.liquid = !1;
t.t.water = !1;
t.t.walkMod = 1;
t.t.canBeFilled = !0;
t.t.fillToWater = o.deep_ocean;
t.t.decreaseToID = o.empty;
t.t.increaseToID = o.pit_close_ocean;
t.t.canBeBurned = !0;
t.t.layerType = r.Ground;
t.setDrawLayer(3);
t.clone(o.pit_close_ocean, o.close_ocean);
t.t.drawPixel = !0;
t.t.color = s.Toolbox.makeColor("#A0A0A0");
t.t.liquid = !1;
t.t.water = !1;
t.t.walkMod = 1;
t.t.canBeFilled = !0;
t.t.fillToWater = o.close_ocean;
t.t.decreaseToID = o.pit_deep_ocean;
t.t.increaseToID = o.pit_shallow_waters;
t.t.canBeBurned = !0;
t.t.layerType = r.Ground;
t.setDrawLayer(4);
t.clone(o.pit_shallow_waters, o.shallow_waters);
t.t.drawPixel = !0;
t.t.color = s.Toolbox.makeColor("#C1C1C1");
t.t.liquid = !1;
t.t.water = !1;
t.t.walkMod = 1;
t.t.canBeFilled = !0;
t.t.fillToWater = o.shallow_waters;
t.t.decreaseToID = o.pit_close_ocean;
t.t.increaseToID = o.sand;
t.t.freezeToID = o.empty;
t.t.canBeBurned = !0;
t.t.layerType = r.Ground;
t.setDrawLayer(5);
var n = new t();
n.name = o.border_pit, n.layerType = r.Ground;
t.add(n);
t.setDrawLayer(6);
var l = new t();
l.name = o.border_water, l.layerType = r.Ground;
t.add(l);
t.setDrawLayer(7);
t.clone(o.shallow_waters_frozen, o.shallow_waters);
t.t.color = s.Toolbox.makeColor("#A7D6F4");
t.t.edge_color = s.Toolbox.makeColor("#99C0D8");
t.t.liquid = !1;
t.t.frozen = !0;
t.t.ground = !0;
t.t.walkMod = 1;
t.t.decreaseToID = o.shallow_waters;
t.t.increaseToID = o.shallow_waters;
t.t.freezeToID = o.empty;
t.t.damagedWhenWalked = !0;
t.t.strength = 0;
t.t.layerType = r.Ground;
t.setDrawLayer(8);
var u = new t();
u.cost = 116;
u.drawPixel = !0;
u.name = o.road;
u.tileName = o.road;
u.color = s.Toolbox.makeColor("#C1997C");
u.road = !0;
u.decreaseToID = o.soil;
u.increaseToID = o.soil;
u.ground = !0;
u.walkMod = 1.5;
u.canBecomeCreep = !0;
u.creepID = o.sand_creep;
u.canBeBurned = !0;
u.canBuildOn = !0;
u.strength = 0;
t.add(u);
t.setDrawLayer(9);
[ "close_ocean", "deep_ocean", "field", "forest", "forest_flowers", "forest_soil", "forest_soil_frozen", "fuse", "grass", "grass_flowers", "hills", "hills_frozen", "mountains", "mountains_frozen", "pit_close_ocean", "pit_deep_ocean", "pit_shallow_waters", "sand", "sand_frozen", "sand_creep", "shallow_waters", "soil", "soil_creep", "soil_frozen", "tnt" ].forEach(function(e) {
t.clone("road_" + e, o.road);
t.t.color = s.Toolbox.makeColor("#C1997C");
t.t.decreaseToID = e;
t.t.increaseToID = e;
t.setDrawLayer(13, !1, o.road);
});
var d = new t();
d.cost = 116;
d.name = o.sand;
d.drawPixel = !0;
d.color = s.Toolbox.makeColor("#F7E898");
d.edge_color = s.Toolbox.makeColor("#D8C08C");
d.heightMin = 98;
d.additional_height = [ 6, 5 ];
d.decreaseToID = o.pit_shallow_waters;
d.increaseToID = o.soil;
d.freezeToID = o.sand_frozen;
d.ground = !0;
d.walkMod = .7;
d.canBecomeCreep = !0;
d.creepID = o.sand_creep;
d.autoGrowPlants = !0;
d.canBeBurned = !0;
d.canBuildOn = !0;
t.add(d);
t.setDrawLayer(10);
t.clone(o.sand_frozen, o.sand);
t.t.color = s.Toolbox.makeColor("#AFF5F1");
t.t.edge_color = s.Toolbox.makeColor("#8DB7B4");
t.t.frozen = !0;
t.t.walkMod = 1;
t.t.decreaseToID = o.sand;
t.t.increaseToID = o.sand;
t.t.freezeToID = o.empty;
t.t.canBecomeCreep = !1;
t.t.canBeBurned = !1;
t.t.autoGrowPlants = !1;
t.t.strength = 0;
t.setDrawLayer(11);
var h = new t();
h.cost = 115;
h.drawPixel = !0;
h.name = o.soil;
h.color = s.Toolbox.makeColor("#D58E12");
h.heightMin = 108;
h.decreaseToID = o.sand;
h.increaseToID = o.forest_soil;
h.ground = !0;
h.walkMod = 1;
h.canGrowGreens = !0;
h.growTo = o.grass;
h.freezeToID = o.soil_frozen;
h.canBecomeCreep = !0;
h.creepID = o.soil_creep;
h.canBeFarmField = !0;
h.canBuildOn = !0;
h.canBeBurned = !0;
t.add(h);
t.setDrawLayer(12);
t.clone(o.soil_frozen, o.soil);
t.t.color = s.Toolbox.makeColor("#BAD5D3");
t.t.edge_color = s.Toolbox.makeColor("#F5F7F6");
t.t.frozen = !0;
t.t.walkMod = 1;
t.t.canGrowGreens = !1;
t.t.decreaseToID = o.soil;
t.t.increaseToID = o.soil;
t.t.freezeToID = o.empty;
t.t.canBeBurned = !1;
t.t.strength = 0;
t.setDrawLayer(15);
t.clone(o.grass, o.soil);
t.t.variations = 2;
t.t.grass = !0;
t.t.burnable = !0;
t.t.color = s.Toolbox.makeColor("#7EAF46");
t.t.decreaseToID = o.soil;
t.t.canGrowGreens = !1;
t.t.freezeToID = o.soil;
t.t.canBecomeCreep = !0;
t.t.creepID = o.soil_creep;
t.t.canBeBurned = !0;
t.t.canBeFarmField = !0;
t.t.autoGrowPlants = !0;
t.t.growTypes = a.fruitBush;
t.t.strength = 0;
t.t.fireChance = .06;
t.t.canGrowFlowers = !0;
t.t.flowersTypeID = o.grass_flowers;
t.setDrawLayer(14);
t.clone(o.grass_flowers, o.grass);
t.t.canGrowFlowers = !1;
t.t.flowers = !0;
t.t.variations = 5;
t.t.color = s.Toolbox.makeColor("#87BC4B");
t.t.decreaseToID = o.grass;
t.setDrawLayer(14, !1, o.grass);
var p = new t();
p.cost = 120;
p.drawPixel = !0;
p.name = o.forest_soil;
p.color = s.Toolbox.makeColor("#B66F3A");
p.heightMin = 128;
p.additional_height = [ 15, 16, 17, 14, 13, 12, 11, 10 ];
p.decreaseToID = o.soil;
p.increaseToID = o.hills;
p.ground = !0;
p.walkMod = 1;
p.autoGrowPlants = !0;
p.canGrowGreens = !0;
p.growTo = o.forest;
p.freezeToID = o.forest_soil_frozen;
p.canBecomeCreep = !0;
p.creepID = o.soil_creep;
p.canBeFarmField = !0;
p.canBuildOn = !0;
p.canBeBurned = !0;
t.add(p);
t.setDrawLayer(15);
t.clone(o.forest_soil_frozen, o.forest_soil);
t.t.autoGrowPlants = !0;
t.t.growTypes = a.pine;
t.t.color = s.Toolbox.makeColor("#D3E4E3");
t.t.edge_color = s.Toolbox.makeColor("#D1D6D4");
t.t.frozen = !0;
t.t.canGrowGreens = !1;
t.t.decreaseToID = o.forest_soil;
t.t.increaseToID = o.forest_soil;
t.t.freezeToID = o.forest_soil;
t.t.canBecomeCreep = !1;
t.t.canBeBurned = !1;
t.t.strength = 0;
t.setDrawLayer(18);
var f = new t();
f.cost = 120;
f.drawPixel = !0;
f.name = o.forest;
f.color = s.Toolbox.makeColor("#54722D");
f.heightMin = 128;
f.trees = !0;
f.grass = !0;
f.autoGrowPlants = !0;
f.growTypes = a.tree;
f.burnable = !0;
f.additional_height = [ 15, 16, 17, 14, 13, 12, 11, 10 ];
f.decreaseToID = o.forest_soil;
f.increaseToID = o.hills;
f.freezeToID = o.forest_soil;
f.ground = !0;
f.walkMod = 1;
f.canBecomeCreep = !0;
f.creepID = o.soil_creep;
f.canBeBurned = !0;
f.canBuildOn = !0;
f.canBeFarmField = !0;
f.fireChance = .08;
f.strength = 0;
f.canGrowFlowers = !0;
f.flowersTypeID = o.forest_flowers;
t.add(f);
t.setDrawLayer(17);
t.clone(o.forest_flowers, o.forest);
t.t.flowers = !0;
t.t.canGrowFlowers = !1;
t.t.variations = 5;
t.t.color = s.Toolbox.makeColor("#54722D");
t.t.decreaseToID = o.forest;
t.setDrawLayer(17, !1, o.forest);
t.clone(o.field, o.soil);
t.t.canGrowGreens = !1;
t.t.color = s.Toolbox.makeColor("#A8663A");
t.t.canBuildOn = !1;
t.t.decreaseToID = o.soil;
t.t.burnable = !0;
t.t.strength = 0;
t.t.fireChance = .4;
t.setDrawLayer(18);
var m = new t();
m.drawPixel = !0;
m.name = o.sand_creep;
m.creep = !0;
m.color = s.Toolbox.makeColor("#F45193");
m.heightMin = 108;
m.decreaseToID = o.sand;
m.increaseToID = o.sand;
m.ground = !0;
m.walkMod = .5;
m.burnable = !0;
m.life = !0;
m.damageUnits = !0;
m.damage = 10;
m.give_trait_chance = .3;
m.give_trait = o.tumorInfection;
m.fireChance = 1;
m.freezeToID = o.sand_frozen;
m.strength = 0;
t.add(m, !1);
t.setDrawLayer(19);
t.clone(o.soil_creep, o.sand_creep);
t.t.color = s.Toolbox.makeColor("#EF267A");
t.t.decreaseToID = o.soil;
t.t.increaseToID = o.soil;
t.t.creep = !0;
t.t.life = !0;
t.t.burnable = !0;
t.t.canBuildOn = !1;
t.t.strength = 0;
t.setDrawLayer(20);
var y = new t();
y.cost = 100;
y.drawPixel = !0;
y.name = "lava0";
y.color = s.Toolbox.makeColor("#F62D14");
y.decreaseToID = o.sand;
y.increaseToID = o.hills;
y.liquid = !0;
y.walkMod = .2;
y.damageUnits = !0;
y.damage = 150;
y.lava = !0;
y.lavaLevel = 0;
y.strength = 0;
y.layerType = r.Lava;
t.add(y);
t.setDrawLayer(21);
t.clone("lava1", "lava0");
t.t.color = s.Toolbox.makeColor("#FF6700");
t.t.lavaLevel = 1;
t.setDrawLayer(22);
t.clone("lava2", "lava0");
t.t.color = s.Toolbox.makeColor("#FFAC00");
t.t.lavaLevel = 2;
t.setDrawLayer(23);
t.clone("lava3", "lava0");
t.t.color = s.Toolbox.makeColor("#FFDE00");
t.t.lavaLevel = 3;
t.setDrawLayer(24);
var _ = new t();
_.cost = 140;
_.drawPixel = !0;
_.name = o.hills;
_.color = s.Toolbox.makeColor("#5B5E5C");
_.heightMin = 199;
_.rocks = !0;
_.ground = !0;
_.edge_hills = !0;
_.additional_height = [ 2, -6 ];
_.decreaseToID = o.forest_soil;
_.increaseToID = o.mountains;
_.walkMod = .4;
_.freezeToID = o.hills_frozen;
_.canBeBurned = !0;
t.add(_);
t.setDrawLayer(25);
t.clone(o.hills_frozen, o.hills);
t.t.color = s.Toolbox.makeColor("#E2EDEC");
t.t.frozen = !0;
t.t.increaseToID = o.hills;
t.t.decreaseToID = o.hills;
t.t.freezeToID = o.empty;
t.t.canBeBurned = !1;
t.t.strength = 0;
t.setDrawLayer(26);
var g = new t();
g.cost = 160;
g.drawPixel = !0;
g.name = o.mountains;
g.color = s.Toolbox.makeColor("#414545");
g.heightMin = 210;
g.rocks = !0;
g.edge_mountains = !0;
g.additional_height = [ 2, 4 ];
g.decreaseToID = o.hills;
g.walkMod = .1;
g.freezeToID = o.mountains_frozen;
g.canBeBurned = !0;
g.layerType = r.Block;
g.block = !0;
g.force_edge_variation = !0;
g.force_edge_variation_frame = "mountains_2";
t.add(g);
t.setDrawLayer(27);
t.clone(o.mountains_frozen, o.mountains);
t.t.color = s.Toolbox.makeColor("#FCFDFD");
t.t.frozen = !0;
t.t.decreaseToID = o.mountains;
t.t.increaseToID = o.mountains;
t.t.freezeToID = o.empty;
t.t.canBeBurned = !1;
t.t.strength = 0;
t.t.force_edge_variation = !1;
t.t.force_edge_variation_frame = "";
t.setDrawLayer(28);
var v = new t();
v.cost = 10;
v.drawPixel = !0;
v.name = o.fuse;
v.color = s.Toolbox.makeColor("#834C4C");
v.decreaseToID = o.sand;
v.burnable = !0;
v.terraformAfterFire = !0;
v.ground = !0;
v.walkMod = 1;
v.canBuildOn = !0;
v.strength = 0;
t.add(v);
t.setDrawLayer(29);
var b = new t();
b.cost = 10;
b.drawPixel = !0;
b.name = o.tnt;
b.color = s.Toolbox.makeColor("#A30000");
b.decreaseToID = o.pit_deep_ocean;
b.burnable = !0;
b.explodable = !0;
b.explodableDelayed = !0;
b.explodeRange = 10;
b.ground = !0;
b.walkMod = 1;
b.canBuildOn = !0;
b.strength = 0;
t.add(b);
t.setDrawLayer(30);
var T = new t();
T.cost = 10;
T.drawPixel = !0;
T.name = o.fireworks;
T.color = s.Toolbox.makeColor("#B43DCC");
T.decreaseToID = o.sand;
T.burnable = !0;
T.terraformAfterFire = !0;
T.ground = !0;
T.walkMod = 1;
T.canBuildOn = !0;
T.strength = 0;
t.add(T);
t.setDrawLayer(31);
var w = new t();
w.cost = 10;
w.drawPixel = !0;
w.name = o.tnt_timed;
w.color = s.Toolbox.makeColor("#7F0000");
w.decreaseToID = o.pit_deep_ocean;
w.burnable = !0;
w.explodable = !0;
w.explodableTimed = !0;
w.explodeTimer = 5;
w.explodeRange = 8;
w.ground = !0;
w.walkMod = 1;
w.canBuildOn = !0;
w.strength = 0;
t.add(w);
t.setDrawLayer(32);
var B = new t();
B.cost = 10;
B.drawPixel = !0;
B.name = o.landmine;
B.color = s.Toolbox.makeColor("#656565");
B.decreaseToID = o.soil;
B.landmine = !0;
B.burnable = !0;
B.explodable = !0;
B.explodeRange = 3;
B.ground = !0;
B.walkMod = 1;
B.strength = 0;
t.add(B);
t.setDrawLayer(33);
var k = new t();
k.cost = 10;
k.drawPixel = !0;
k.greyGoo = !0;
k.name = o.grey_goo;
k.color = s.Toolbox.makeColor("#5D6191");
k.decreaseToID = o.pit_deep_ocean;
k.burnable = !0;
k.ground = !1;
k.walkMod = .1;
k.damageUnits = !0;
k.damage = 50;
k.strength = 0;
k.life = !0;
k.layerType = r.Goo;
t.add(k);
t.setDrawLayer(34);
var A = new t();
A.cost = 10;
A.drawPixel = !0;
A.name = o.water_bomb;
A.color = s.Toolbox.makeColor("#7A00DE");
A.decreaseToID = o.pit_deep_ocean;
A.burnable = !1;
A.explodable = !0;
A.explodableDelayed = !0;
A.explodeRange = 9;
A.explodableByWater = !0;
A.ignoreWaterEdgeRendering = !0;
A.ground = !0;
A.walkMod = 1;
A.canBeFilled = !0;
A.strength = 0;
A.canBuildOn = !0;
t.add(A);
t.setDrawLayer(35);
t.t = t.get(o.grass);
t.t.spawnCreatures.push("sheep");
t.t.spawnCreatures.push("chick");
t.t.spawnCreatures.push("rabbit");
t.t.spawnCreatures.push("beetle");
t.t.spawnCreatures.push("grasshopper");
t.t.spawnCreatures.push("fly");
t.t = t.get(o.forest);
t.t.spawnCreatures.push("wolf");
t.t.spawnCreatures.push("beetle");
t.t.spawnCreatures.push("grasshopper");
t.t.spawnCreatures.push("fly");
t.t = t.get(o.grass_flowers);
t.t.spawnCreatures.push("butterfly");
t.t = t.get(o.forest_flowers);
t.t.spawnCreatures.push("butterfly");
t.depth_list_generator = [];
t.depth_list_gameplay = [];
t.list_generator.push(t.get(o.deep_ocean));
t.list_generator.push(t.get(o.close_ocean));
t.list_generator.push(t.get(o.shallow_waters));
t.list_generator.push(t.get(o.sand));
t.list_generator.push(t.get(o.grass));
t.list_generator.push(t.get(o.forest));
t.list_generator.push(t.get(o.hills));
t.list_generator.push(t.get(o.mountains));
t.setListTo("generator");
for (var S = 0; S < 256; S++) t.depth_list_generator.push(t.getTypeByDepth(S));
t.setListTo("gameplay");
for (var x = 0; x < 256; x++) t.depth_list_gameplay.push(t.getTypeByDepth(x));
t.setListTo("generator");
t.list_gameplay.forEach(function(e) {
e.decreaseTo = t.get(e.decreaseToID);
e.increaseTo = t.get(e.increaseToID);
e.freezeTo = t.get(e.freezeToID);
});
t.countVariations();
c.default.init();
};
t.countVariations = function() {
var e = l.TextureLoader.inst.getSpriteFrames(l.ATLAS_TYPE.WORLDATLAS, "tilemap");
t.list_gameplay.forEach(function(t) {
t.variations = 0;
e.forEach(function(e, i) {
(i = i.substring(0, i.length - 2)) == t.name && t.variations++;
});
0 == t.variations && (t.variations = 1);
});
};
t.setDrawLayer = function(e, i, a) {
void 0 === e && (e = 0);
void 0 === i && (i = !0);
void 0 === a && (a = o.empty);
t.t.z = e;
i && (a = t.t.name);
t.t.drawLayer = a;
};
t.add = function(e, i) {
void 0 === i && (i = !0);
t.t = e;
i && t.list_gameplay.push(e);
t.t.id = t.dict.size;
t.list_generator.push(e);
t.dict.set(e.name, e);
};
t.get = function(e) {
return e && t.dict.has(e) ? t.dict.get(e) : null;
};
t.getTypeByDepth = function(e) {
if ("number" == typeof e) {
var i = null;
t.list.forEach(function(t) {
-1 != t.heightMin && (i ? e >= t.heightMin && (i = t) : i = t);
});
return i;
}
return t.depth_list[e.Height];
};
t.getTypeByHeight = function(e) {
for (var i = null, o = 0; o < t.list.length; o++) {
var a = t.list[o];
-1 != a.heightMin && (i ? e >= a.heightMin && (i = a) : i = a);
}
return i;
};
t.prototype.isType = function(t) {
return this.name == t || this.id == t.id;
};
t.clone = function(e, i) {
var o = JSON.parse(JSON.stringify(t.dict.get(i)));
t.t = n.default.fromJson(o, new t());
t.t.name = e;
t.clearSpecial(t.t);
t.add(t.t);
};
t.clearSpecial = function(t) {
t.canBeFarmField = !1;
};
t.list = [];
t.list_generator = [];
t.list_gameplay = [];
t.dict = new Map();
t.edge_color_water = s.Toolbox.makeColor("#2D61AF");
t.edge_color_no_water = s.Toolbox.makeColor("#494949");
t.edge_color_hills = s.Toolbox.makeColor("#313333");
t.edge_color_mountain = s.Toolbox.makeColor("#2C3032");
t.depth_list = [];
t.depth_list_generator = [];
t.depth_list_gameplay = [];
t.temp_list = [];
t.t = null;
return t;
}();
i.TileType = u;
cc._RF.pop();
}, {
"../../../../../framework/utils/Tools": void 0,
"../../common/ToolBox": "ToolBox",
"../../texture/TextureLoader": "TextureLoader",
"./TileTypeShortcut": "TileTypeShortcut"
} ],
TileZone: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "56039nQdzlPDLc6v1uf8M0D", "TileZone");
var o = this && this.__values || function(t) {
var e = "function" == typeof Symbol && Symbol.iterator, i = e && t[e], o = 0;
if (i) return i.call(t);
if (t && "number" == typeof t.length) return {
next: function() {
t && o >= t.length && (t = void 0);
return {
value: t && t[o++],
done: !t
};
}
};
throw new TypeError(e ? "Object is not iterable." : "Symbol.iterator is not defined.");
};
Object.defineProperty(i, "__esModule", {
value: !0
});
i.ZoneData = void 0;
var a = t("../../assetLibrary/lib/ResourceLibrary"), r = t("../../base/BaseBuilding"), n = t("../../MapBox"), s = t("./TileType"), l = t("./TileTypeShortcut"), c = t("./WorldTile");
i.ZoneData = function() {
this.x = 0;
this.y = 0;
};
var u = function() {
function t(t, e, i) {
var o = this;
this.cityNamePlaced = !1;
this.x = 0;
this.y = 0;
this.id = 0;
this.tiles = [];
this.zone_color = cc.Color.TRANSPARENT;
this.city = null;
this.neighbours = [];
this.neighboursAll = [];
this.world_edge = !1;
this.centerTile = null;
this.tilesOnFire = 0;
this.tilesWithWater = 0;
this.tilesWithSoil = 0;
this.tilesWithGround = 0;
this.buildings = new Set();
this.abandoned = new Set();
this.trees = new Set();
this.ruins = new Set();
this.stone = new Set();
this.gold = new Set();
this.ore = new Set();
this.food = new Set();
this.wheat = new Set();
this.buildingLists = new Set();
this.zone_up = null;
this.zone_down = null;
this.zone_left = null;
this.zone_right = null;
this.tileTypes = new Map();
this.canBeFarms = [];
this.goodForNewCity = !1;
this.cityChecked = !1;
this.x = t;
this.y = e;
this.id = i;
this.buildingLists.add(this.buildings);
this.buildingLists.add(this.abandoned);
this.buildingLists.add(this.trees);
this.buildingLists.add(this.ruins);
this.buildingLists.add(this.stone);
this.buildingLists.add(this.gold);
this.buildingLists.add(this.ore);
this.buildingLists.add(this.food);
this.buildingLists.add(this.wheat);
s.TileType.list_gameplay.forEach(function(t) {
o.tileTypes.set(t, []);
t.canBeFarmField && o.canBeFarms.push(t);
});
}
t.prototype.haveBuildingOf = function(t) {
var e, i;
try {
for (var a = o(this.buildings), r = a.next(); !r.done; r = a.next()) {
var n = r.value;
if (!n.isNonUsable() && n.city == t) return !0;
}
} catch (t) {
e = {
error: t
};
} finally {
try {
r && !r.done && (i = a.return) && i.call(a);
} finally {
if (e) throw e.error;
}
}
return !1;
};
t.prototype.haveTiles = function(t) {
return this.tileTypes.get(t).length > 0;
};
t.prototype.countCanBeFarms = function() {
var t = this, e = 0;
this.canBeFarms.forEach(function(i) {
e += t.tileTypes.get(i).length;
});
return e;
};
t.prototype.addTile = function(t, e, i) {
this.tiles.push(t);
switch (e) {
case 0:
t.worldTileZoneBorder.borderLeft = !0;
t.worldTileZoneBorder.border = !0;
break;

case 7:
t.worldTileZoneBorder.borderRight = !0;
t.worldTileZoneBorder.border = !0;
}
switch (i) {
case 0:
t.worldTileZoneBorder.borderDown = !0;
t.worldTileZoneBorder.border = !0;
break;

case 7:
t.worldTileZoneBorder.border = !0;
t.worldTileZoneBorder.borderUp = !0;
}
};
t.prototype.setCity = function(t) {
this.city = t;
n.default.inst.zoneCalculator.setDirty(this);
};
t.prototype.addBuilding = function(t) {
var e, i;
if (t.isRuin()) i = this.ruins; else if (t.data.state == r.BuildingState.CivAbandoned) i = this.abandoned; else switch (null === (e = t.stats) || void 0 === e ? void 0 : e.resourceType) {
case a.ResourceType.Tree:
i = this.trees;
break;

case a.ResourceType.Stone:
i = this.stone;
break;

case a.ResourceType.Ore:
i = this.ore;
break;

case a.ResourceType.Gold:
i = this.gold;
break;

case a.ResourceType.Fruits:
i = this.food;
break;

case a.ResourceType.Wheat:
i = this.wheat;
break;

default:
i = t.isRuin() ? this.ruins : this.buildings;
}
i.add(t);
};
t.prototype.removeBuilding = function(t) {
var e, i;
this.abandoned.delete(t);
this.buildings.delete(t);
this.ruins.delete(t);
if (0 != (null === (e = t.stats) || void 0 === e ? void 0 : e.resourceType)) switch (null === (i = t.stats) || void 0 === i ? void 0 : i.resourceType) {
case a.ResourceType.Tree:
this.trees.delete(t);
break;

case a.ResourceType.Stone:
this.stone.delete(t);
break;

case a.ResourceType.Ore:
this.ore.delete(t);
break;

case a.ResourceType.Gold:
this.gold.delete(t);
break;

case a.ResourceType.Fruits:
this.food.delete(t);
break;

case a.ResourceType.Wheat:
this.wheat.delete(t);
}
};
t.prototype.addNeighbour = function(t, e, i) {
void 0 === i && (i = !1);
if (t) {
i || this.neighbours.push(t);
this.neighboursAll.push(t);
switch (e) {
case c.TileDirection.Up:
this.zone_up = t;
break;

case c.TileDirection.Down:
this.zone_down = t;
break;

case c.TileDirection.Left:
this.zone_left = t;
break;

case c.TileDirection.Right:
this.zone_right = t;
}
} else this.world_edge = !0;
};
t.prototype.canPlaceCityHere = function() {
return !(this.city || this.tilesWithGround < 64);
};
t.prototype.goodForExpansion = function() {
return !(this.haveTiles(l.default.lava0) || this.haveTiles(l.default.lava1) || this.haveTiles(l.default.lava2) || this.haveTiles(l.default.lava3));
};
t.prototype.clear = function() {
var t = this;
s.TileType.list_gameplay.forEach(function(e) {
t.tileTypes.set(e, []);
});
this.buildingLists.forEach(function(t) {
t.clear();
});
this.city = null;
this.goodForNewCity = !1;
};
return t;
}();
i.default = u;
cc._RF.pop();
}, {
"../../MapBox": "MapBox",
"../../assetLibrary/lib/ResourceLibrary": "ResourceLibrary",
"../../base/BaseBuilding": "BaseBuilding",
"./TileType": "TileType",
"./TileTypeShortcut": "TileTypeShortcut",
"./WorldTile": "WorldTile"
} ],
ToolBox: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "dd548nr6S1EmLcht4Z5jwJk", "ToolBox");
var o = this && this.__values || function(t) {
var e = "function" == typeof Symbol && Symbol.iterator, i = e && t[e], o = 0;
if (i) return i.call(t);
if (t && "number" == typeof t.length) return {
next: function() {
t && o >= t.length && (t = void 0);
return {
value: t && t[o++],
done: !t
};
}
};
throw new TypeError(e ? "Object is not iterable." : "Symbol.iterator is not defined.");
};
Object.defineProperty(i, "__esModule", {
value: !0
});
i.Toolbox = void 0;
var a = t("../../../../framework/lib/prototype/MathUtils"), r = t("../../../common/src/text/LocalizedTextManager"), n = t("../MapBox"), s = function() {
function t() {}
t.coloredText = function(t, e, i) {
void 0 === i && (i = !1);
i && (t = r.LocalizedTextManager.getText(t));
return "<color=" + e + ">" + t + "</color>";
};
t.bench = function(e) {
var i = cc.sys.now() / 1e3;
t.benchDict.set(e, i);
return i;
};
t.benchSet = function(e, i) {
t.benchDictLatest.set(e, i);
};
t.benchEnd = function(e) {
var i = cc.sys.now() / 1e3 - t.benchDict.get(e);
t.benchDictLatest.set(e, i);
return i;
};
t.getBenchResult = function(e) {
return t.benchDictLatest.has(e) ? t.benchDictLatest.get(e) : -1;
};
t.inBounds = function(t, e, i) {
return t > e && t < i;
};
t.init = function() {
t.color_plague = t.makeColor("#CE4A9B");
t.color_infected = t.makeColor("#35CC6E");
};
t.rotatePointAroundPivot = function(t, e, i) {
return i.multiply(t.sub(e)).add(e);
};
t.cubeBezier3 = function(t, e, i, o, a) {
var r = 1 - a, n = r * r * r, s = r * r * a * 3, l = r * a * a * 3, c = a * a * a;
return cc.v3(n * t.x + s * e.x + l * i.x + c * o.x, n * t.y + s * e.y + l * i.y + c * o.y, n * t.z + s * e.z + l * i.z + c * o.z);
};
t.easeInOutQuart = function(t) {
return t < .5 ? 8 * t * t * t * t : 1 - Math.pow(-2 * t + 2, 4) / 2;
};
t.generateID = function() {
t.gid++;
return t.gid;
};
t.getNewPoint = function(e, i, o, a, r, n) {
void 0 === n && (n = !0);
var s, l = cc.Vec3.ZERO, c = t.dist(e, i, o, a);
if (c - r == 0) {
s = 1;
l.set(cc.v3(o, a, 0));
return l;
}
s = r / (c - r);
n && s < 0 && (s = 0 - s);
var u = (e + s * o) / (1 + s), d = (i + s * a) / (1 + s);
l.x = u;
l.y = d;
return l;
};
t.distVec3 = function(t, e) {
return Math.sqrt((t.x - e.x) * (t.x - e.x) + (t.y - e.y) * (t.y - e.y));
};
t.distVec2 = function(t, e) {
return cc.Vec2.distance(t, e);
};
t.distVec2Float = function(t, e) {
return Math.sqrt((t.x - e.x) * (t.x - e.x) + (t.y - e.y) * (t.y - e.y));
};
t.distTile = function(e, i) {
return e && i ? t.distVec2(e.pos, i.pos) : 0;
};
t.dist = function(t, e, i, o) {
return Math.sqrt((t - i) * (t - i) + (e - o) * (e - o));
};
t.setRandomSeed = function(e) {
t.randomSeed = e;
a.default.setRandomSeed(e);
};
t.randomRate = function(t) {
return Math.random() < t;
};
t.randomChance = function(t) {
return a.default.randomChance(t);
};
t.randomBool = function() {
return a.default.randomBool();
};
t.randomRange = function(t, e) {
return a.default.randomInt(t, e);
};
t.randomFloat = function(t, e) {
return a.default.randomRange(t, e);
};
t.randomPointOnCircle = function(t, e) {
return cc.Vec2.random(cc.Vec2.ZERO).normalizeSelf().mulSelf(a.default.randomRange(t, e));
};
t.randomInt = function(t, e) {
return a.default.randomInt(t, e);
};
t.getRandom = function(t) {
return a.default.getRandom(t);
};
t.getRandomColor = function() {
return cc.color(a.default.randomInt(0, 255), a.default.randomInt(0, 255), a.default.randomInt(0, 255), 255);
};
t.makeColor = function(t) {
var e = new cc.Color();
return cc.Color.fromHEX(e, t);
};
t.colorToHex = function(t) {
return "#" + t.toHEX();
};
t.coloredString = function(t, e) {
return e ? "<color=" + e + ">" + t + "</color>" : t;
};
t.getAngle = function(t, e, i, o) {
return Math.atan2(o - e, i - t);
};
t.makeDarkerColor = function(t) {
return new cc.Color(.4 * t.r, .4 * t.g, .4 * t.b, t.a);
};
t.getClosestTile = function(e, i) {
var o = null, a = 1e4, r = 1e4;
e.forEach(function(e) {
a = t.dist(i.pos.x, i.pos.y, e.pos.x, e.pos.y);
if (!o || a < r) {
r = a;
o = e;
}
});
return o;
};
t.getRandomTileWithinDistance = function(e, i, o, a) {
var r = [];
e.forEach(function(e) {
var n = t.dist(i.pos.x, i.pos.y, e.pos.x, e.pos.y);
n > o && n < a && r.push(e);
});
return t.getRandom(r);
};
t.getClosestActor = function(e, i) {
var a, r, n = null, s = 1e4, l = 1e4;
try {
for (var c = o(e), u = c.next(); !u.done; u = c.next()) {
var d = u.value, h = d.currentTile;
s = t.dist(i.pos.x, i.pos.y, h.pos.x, h.pos.y);
if (!n || s < l) {
l = s;
n = d;
}
}
} catch (t) {
a = {
error: t
};
} finally {
try {
u && !u.done && (r = c.return) && r.call(c);
} finally {
if (a) throw a.error;
}
}
return n;
};
t.moveTowards = function(t, e, i) {
var o = cc.v2(t), a = cc.v2(e).sub(o), r = a.mag();
if (r <= i || 0 == r) return e;
var n = cc.v2(o);
a.mulSelf(i / r);
n.addSelf(a);
return cc.v3(n);
};
t.formatTimer = function(t) {
var e, i = a.default.intCast(t / 60), o = a.default.intCast(t - 60 * i);
e = i >= 10 ? i + ":" : "0" + i + ":";
return o < 10 ? e + "0" + o : e + o;
};
t.getRandomChunkFromTile = function(e) {
t.temp_list_chunks = [];
t.temp_list_chunks.push(e.chunk);
t.temp_list_chunks.addRange(e.chunk.neighboursAll);
return t.getRandom(t.temp_list_chunks);
};
t.getRandomTileAround = function(e) {
var i = t.getRandomChunkFromTile(e).tiles;
return t.getRandom(i);
};
t.getAllChunksFromTile = function(e) {
t.temp_list_chunks = [];
t.temp_list_chunks.push(e.chunk);
t.temp_list_chunks.addRange(e.chunk.neighboursAll);
return t.temp_list_chunks;
};
t.findNotSameRaceInChunkAround = function(e, i) {
t.temp_list_objects = [];
t.temp_list_units = [];
t.fillChunkWithUnits(e);
e.neighboursAll.forEach(function(e) {
t.fillChunkWithUnits(e);
});
t.temp_list_objects.forEach(function(e) {
e.forEach(function(e) {
var o;
(null == e ? void 0 : e.isActor()) && !(null === (o = null == e ? void 0 : e.a) || void 0 === o ? void 0 : o.isRace(i)) && t.temp_list_units.push(e.a);
});
});
};
t.findSameUnitInChunkAround = function(e, i) {
t.temp_list_objects = [];
t.temp_list_units = [];
t.fillChunkWithUnits(e);
e.neighboursAll.forEach(function(e) {
t.fillChunkWithUnits(e);
});
t.temp_list_objects.forEach(function(e) {
e.forEach(function(e) {
e.isActor() && e.a && e.a.stats.id == i && t.temp_list_units.push(e.a);
});
});
};
t.findSameRaceInChunkAround = function(e, i) {
t.temp_list_objects = [];
t.temp_list_units = [];
t.fillChunkWithUnits(e);
e.neighboursAll.forEach(function(e) {
t.fillChunkWithUnits(e);
});
t.temp_list_objects.forEach(function(e) {
e.forEach(function(e) {
var o;
(null == e ? void 0 : e.isActor()) && (null === (o = null == e ? void 0 : e.a) || void 0 === o ? void 0 : o.isRace(i)) && t.temp_list_units.push(e.a);
});
});
};
t.fillChunkWithUnits = function(e) {
var i, a;
if (0 != e.k_dict_objects.size) try {
for (var r = o(e.k_list_objects), n = r.next(); !n.done; n = r.next()) {
var s = n.value;
s && t.temp_list_objects.push(e.k_dict_objects.get(s));
}
} catch (t) {
i = {
error: t
};
} finally {
try {
n && !n.done && (a = r.return) && a.call(r);
} finally {
if (i) throw i.error;
}
}
};
t.fillListWithUnitsFromChunk = function(t, e) {
var i, a;
if (0 != t.k_dict_objects.size) try {
for (var r = o(t.k_list_objects), n = r.next(); !n.done; n = r.next()) {
var s = n.value;
s && t.k_dict_objects.get(s).forEach(function(t) {
t && t.isActor() && e.push(t.a);
});
}
} catch (t) {
i = {
error: t
};
} finally {
try {
n && !n.done && (a = r.return) && a.call(r);
} finally {
if (i) throw i.error;
}
}
};
t.findEnemiesOfKingdomInChunk = function(e, i) {
var a, r, s, l;
if (0 != e.k_dict_objects.size && i) try {
for (var c = o(e.k_list_objects), u = c.next(); !u.done; u = c.next()) {
var d = u.value;
!d || ((null === (s = d.asset) || void 0 === s ? void 0 : s.mobs) || (null === (l = i.asset) || void 0 === l ? void 0 : l.mobs)) && n.default.inst.worldLaws.world_law_peaceful_monsters.boolVal || !i.isEnemy(d) || t.temp_list_objects.push(e.k_dict_objects.get(d));
}
} catch (t) {
a = {
error: t
};
} finally {
try {
u && !u.done && (r = c.return) && r.call(c);
} finally {
if (a) throw a.error;
}
}
};
t.inMapBorder = function(t) {
return !(t.x > n.default.width || t.y > n.default.height || t.x < 0 || t.y < 0);
};
t.addToTempChunksBuildingsType = function(e, i, o) {
void 0 === o && (o = !1);
0 != e.k_dict_objects.size && e.k_dict_objects.forEach(function(e) {
e.forEach(function(e) {
var o;
e.isBuilding() && e.b && (null === (o = e.b.data) || void 0 === o ? void 0 : o.alive) && e.b.haveResources && !e.b.currentTile.targetedBy && e.b.stats.type == i && t.temp_list_buildings_2.push(e.b);
});
});
};
t.lookAt2D = function(t, e) {
var i = Math.atan2(e.y - t.y, e.x - t.x);
return cc.misc.radiansToDegrees(i);
};
t.lowerCaseFirst = function(t) {
return 0 == t.length ? "" : t[0].toLowerCase() + (t.length > 1 ? t.substring(1) : "");
};
t.randomSeed = 0;
t.gid = 0;
t.clear = cc.color(0, 0, 0, 0);
t.color_white = cc.Color.WHITE;
t.color_red = cc.Color.RED;
t.color_yellow = cc.Color.YELLOW;
t.color_abandoned_building = cc.color(178.5, 178.5, 178.5);
t.color_positive = "#43FF43";
t.color_negative = "#FB2C21";
t.color_log_good = t.makeColor("#95DD5D");
t.color_log_warning = t.makeColor("#FF8686");
t.color_log_neutral = t.makeColor("#F3961F");
t.color_heal = t.makeColor("#23F3FF");
t.color_plague = t.makeColor("#CE4A9B");
t.color_mushSpores = t.makeColor("#8CFF99");
t.color_infected = t.makeColor("#35CC6E");
t.benchDict = new Map();
t.benchDictLatest = new Map();
t.temp_list_units = [];
t.temp_list_tiles = [];
t.temp_list_chunks = [];
t.temp_list_objects = [];
t.temp_list_buildings = [];
t.temp_list_buildings_2 = [];
return t;
}();
i.Toolbox = s;
cc._RF.pop();
}, {
"../../../../framework/lib/prototype/MathUtils": void 0,
"../../../common/src/text/LocalizedTextManager": void 0,
"../MapBox": "MapBox"
} ],
ToolTip: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "2d810bzgLpDQplq8eIPFPGr", "ToolTip");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
}), r = this && this.__decorate || function(t, e, i, o) {
var a, r = arguments.length, n = r < 3 ? e : null === o ? o = Object.getOwnPropertyDescriptor(e, i) : o;
if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) n = Reflect.decorate(t, e, i, o); else for (var s = t.length - 1; s >= 0; s--) (a = t[s]) && (n = (r < 3 ? a(n) : r > 3 ? a(e, i, n) : a(e, i)) || n);
return r > 3 && n && Object.defineProperty(e, i, n), n;
};
Object.defineProperty(i, "__esModule", {
value: !0
});
i.TooltipOpinionInfo = void 0;
var n = t("../../../../../framework/lib/prototype/MathUtils"), s = t("../../../../common/src/module/GlobalNode"), l = t("../../../../common/src/text/LocalizedTextManager"), c = t("../../assetLibrary/lib/ItemLibrary"), u = t("../../common/ItemTools"), d = t("../../common/ToolBox"), h = t("../../Config"), p = t("../../MapBox"), f = t("../../texture/TextureLoader"), m = cc._decorator, y = m.ccclass, _ = m.property, g = function() {
this.description = "";
this.value = 0;
};
i.TooltipOpinionInfo = g;
var v = function(t) {
a(e, t);
function e() {
var e = null !== t && t.apply(this, arguments) || this;
e.icon = null;
e.txtName = null;
e.txtDesc = null;
e.desc_layout = null;
e.value_layout = null;
e.debugPosY = 0;
e.debugPosSizeY = 0;
e.timeout = 0;
e.clearTimer = 0;
e.list = [];
e.temp_description = "";
e.temp_description_stat = "";
e.temp_value = "";
return e;
}
i = e;
e.prototype.onLoad = function() {
i.inst = this;
this.node.parent.active = !1;
};
e.prototype.checkClear = function() {
!this.node.parent.active && i.lastObject && (this.clearTimer < .2 ? this.clearTimer += cc.director.getDeltaTime() : i.lastObject = null);
};
e.prototype.isShowingFor = function(t) {
return i.lastObject == t;
};
e.prototype.show = function(t, e, o, a) {
var r, n, s, c, u, p = this;
void 0 === o && (o = "");
void 0 === a && (a = "");
i.lastObject = t;
this.node.parent.active = !0;
this.node.scaleY = .1;
cc.tween(this.node).to(.2, {
scaleY: 1
}, {
easing: "backOut"
}).start();
this.timeout = .1;
this.txtDesc.node.active = !1;
this.desc_layout.active = !1;
this.value_layout.active = !1;
this.list.clear();
this.temp_description = "";
this.temp_description_stat = "";
this.temp_value = "";
var f = this.value_layout.getChildByName("StatsDescription").getComponent(cc.RichText), m = this.value_layout.getChildByName("StatsValues").getComponent(cc.RichText);
switch (e) {
case "kingdom":
this.txtName.string = d.Toolbox.coloredText(null !== (s = null === (n = null === (r = i.info_kingdom) || void 0 === r ? void 0 : r.data) || void 0 === n ? void 0 : n.name) && void 0 !== s ? s : "", d.Toolbox.colorToHex(null === (u = null === (c = i.info_kingdom) || void 0 === c ? void 0 : c.kingdomColor) || void 0 === u ? void 0 : u.colorBorderOut));
this.value_layout.active = !0;
this.setKingdomOpinion();
break;

case "normal":
o && (this.txtName.string = l.LocalizedTextManager.getText(o));
a && (this.temp_description = l.LocalizedTextManager.getText(a));
break;

case "equipment":
this.showEquipment();
break;

case "resource":
this.showResource();
break;

case "world_law":
this.txtName.string = l.LocalizedTextManager.getText(i.info_tip);
this.temp_description = l.LocalizedTextManager.getText(a);
this.temp_description += "\n\n";
this.temp_description += d.Toolbox.coloredText(l.LocalizedTextManager.getText("world_laws_tip_mobile_tap"), "#999999");
break;

case "tip":
l.LocalizedTextManager.contains(i.info_tip) ? this.txtName.string = l.LocalizedTextManager.getText(i.info_tip) : this.txtName.string = i.info_tip;
if (a) {
this.temp_description = a;
this.temp_description = l.LocalizedTextManager.getText(a);
if (this.temp_description.includes("$favorite_food$")) {
var y = "??";
h.default.selectedUnit.data.favoriteFood && (y = l.LocalizedTextManager.getText(h.default.selectedUnit.data.favoriteFood));
this.temp_description = this.temp_description.replace("$favorite_food$", y);
}
}
"loyalty" == i.info_tip && this.setLoyalty();
}
if (this.list.length > 0) {
this.list.sort(function(t, e) {
return t.value - e.value;
});
for (var _ = !1, g = !1, v = 0; v < this.list.length; v++) {
var b = this.list[v];
b.value > 0 && (_ = !0);
if (b.value < 0 && !g && v > 0 && _) {
g = !0;
this.temp_description_stat += "\n---";
this.temp_value += "\n---";
}
if (v > 0) {
this.temp_description_stat += "\n";
this.temp_value += "\n";
}
if (b.value > 0) {
this.temp_value += d.Toolbox.coloredText("+" + b.value, d.Toolbox.color_positive);
this.temp_description_stat += d.Toolbox.coloredText(l.LocalizedTextManager.getText(b.description), "#43FF43");
} else {
this.temp_value += d.Toolbox.coloredText("" + b.value, d.Toolbox.color_negative);
this.temp_description_stat += d.Toolbox.coloredText(l.LocalizedTextManager.getText(b.description), "#FB2C21");
}
}
f.string = this.temp_description_stat;
m.string = this.temp_value;
}
if (this.temp_description) if ("equipment" == e) this.desc_layout.getChildByName("Description").getComponent(cc.RichText).string = this.temp_description; else {
this.txtDesc.string = this.temp_description;
this.txtDesc.node.active = !0;
}
var T = this.txtDesc.node.active || this.desc_layout.active || this.value_layout.active;
this.node.getChildByName("top").getComponent(cc.Sprite).enabled = T;
this.node.getChildByName("bottom").active = T;
this.node.getComponent(cc.Sprite).enabled = !T;
this.node.opacity = 0;
this.scheduleOnce(function() {
p.node.opacity = 255;
var t = i.lastObject.parent.convertToWorldSpaceAR(i.lastObject.position), e = t.clone();
t.x <= .4 * cc.winSize.width ? e.x = t.x + i.lastObject.width / 2 + p.node.width / 2 : t.x >= .6 * cc.winSize.width && (e.x = t.x - i.lastObject.width / 2 - p.node.width / 2);
t.y <= .3 * cc.winSize.height ? e.y = t.y + i.lastObject.height / 2 + p.node.height / 2 : e.x == t.x && (e.y = t.y - i.lastObject.height / 2 - p.node.height / 2);
p.node.position = p.node.parent.convertToNodeSpaceAR(e);
}, .02);
};
e.prototype.showResource = function() {
this.txtName.string = l.LocalizedTextManager.getText(i.info_resource.id);
this.temp_description_stat += l.LocalizedTextManager.getText("amount");
this.temp_value += h.default.selectedCity.data.storage.get(i.info_resource.id);
if ("gold" == i.info_resource.id) {
this.addItemText("yearly_gain", h.default.selectedCity.gold_change);
this.temp_description_stat += "\n";
this.temp_value += "\n";
this.addItemText("tax", h.default.selectedCity.gold_in_tax);
this.temp_description_stat += "\n---";
this.temp_value += "\n---";
0 != h.default.selectedCity.gold_out_army && this.addItemText("upkeep_army", -h.default.selectedCity.gold_out_army);
0 != h.default.selectedCity.gold_out_buildigs && this.addItemText("upkeep_buildings", -h.default.selectedCity.gold_out_buildigs);
0 != h.default.selectedCity.gold_out_homeless && this.addItemText("upkeep_homeless", -h.default.selectedCity.gold_out_homeless);
}
this.value_layout.active = !0;
var t = this.value_layout.getChildByName("StatsDescription").getComponent(cc.RichText), e = this.value_layout.getChildByName("StatsValues").getComponent(cc.RichText);
t.string = this.temp_description_stat;
e.string = this.temp_value;
};
e.prototype.showEquipment = function() {
var t, e;
if (i.info_equipment_slot) {
var o = i.info_equipment_slot.data;
if (o) {
this.desc_layout.active = !0;
var a = this.value_layout.getChildByName("StatsDescription").getComponent(cc.RichText), r = this.value_layout.getChildByName("StatsValues").getComponent(cc.RichText), s = "item_" + o.id;
"0" != o.prefix && (s = s + "_" + o.prefix);
var h = l.LocalizedTextManager.getText("item_name_template");
h = h.replace("$item_id$", l.LocalizedTextManager.getText(s));
h = "0" != o.suffix ? h.replace("$item_suffix$", l.LocalizedTextManager.getText("item_suffix_of_" + o.suffix)) : h.replace("$item_suffix$", "");
var m = "icons/items/icon_" + o.id;
"base" != o.material && (m = m + "_" + o.material);
this.icon.spriteFrame = f.TextureLoader.inst.getSpriteFrame(f.ATLAS_TYPE.UIATLAS, m);
u.default.calcItemValues(o);
var y = u.default.getItemClass(o.type);
this.addItemText("damage", u.default.s_stats.damage);
this.addItemText("attackSpeed", n.default.intCast(u.default.s_stats.attackSpeed));
this.addItemText("crit", n.default.intCast(u.default.s_stats.crit), !0);
this.addItemText("armor", u.default.s_stats.armor, !0);
this.addItemText("speed", n.default.intCast(u.default.s_stats.speed));
this.addItemText("diplomacy", u.default.s_stats.diplomacy);
this.addItemText("health", u.default.s_stats.health);
this.addItemText("damage", n.default.intCast(u.default.s_stats.mod_damage), !0, !0, !0);
this.addItemText("attackSpeed", n.default.intCast(u.default.s_stats.mod_attackSpeed), !0, !0, !0);
this.addItemText("crit", n.default.intCast(u.default.s_stats.mod_crit), !0, !0, !0);
this.addItemText("armor", n.default.intCast(u.default.s_stats.mod_armor), !0, !0, !0);
this.addItemText("speed", n.default.intCast(u.default.s_stats.mod_speed), !0, !0, !0);
this.addItemText("diplomacy", n.default.intCast(u.default.s_stats.mod_diplomacy), !0, !0, !0);
this.addItemText("health", n.default.intCast(u.default.s_stats.mod_health), !0, !0, !0);
if (this.temp_value.length > 0) {
this.value_layout.active = !0;
a.string = this.temp_description_stat;
r.string = this.temp_value;
}
var _ = "", g = "#ffffff";
switch (u.default.s_quality) {
case c.ItemQuality.Junk:
g = "#9E9E9E";
_ = "";
break;

case c.ItemQuality.Normal:
g = "#FFFFFF";
_ = "";
break;

case c.ItemQuality.Rare:
g = "#66AFFF";
_ = "_rare";
break;

case c.ItemQuality.Epic:
g = "#FFF15E";
_ = "_epic";
break;

case c.ItemQuality.Legendary:
g = "#FF7028";
_ = "_legendary";
}
"base" != o.material && (h = "(" + l.LocalizedTextManager.getText("item_mat_" + o.material) + ") " + h);
this.txtName.string = d.Toolbox.coloredText(h, g);
var v = l.LocalizedTextManager.getText(y + _), b = l.LocalizedTextManager.getText("item_template_description_full"), T = l.LocalizedTextManager.getText("item_template_description_age_only");
o.by || (b = T);
var w = p.default.inst.mapStats.year - i.info_equipment_slot.data.year + 1;
b = (b = (b = b.replace("$item_creator_name$", i.info_equipment_slot.data.by)).replace("$item_creator_kingdom$", i.info_equipment_slot.data.from)).replace("$item_creator_years$", "" + w);
b = w >= 1 ? b.replace("$year_ending$", null !== (t = l.LocalizedTextManager.getText("item_template_description_years")) && void 0 !== t ? t : "") : b.replace("$year_ending$", null !== (e = l.LocalizedTextManager.getText("item_template_description_year")) && void 0 !== e ? e : "");
this.temp_description += d.Toolbox.coloredText(v, g);
this.temp_description += "\n";
this.temp_description = this.temp_description + "\n" + d.Toolbox.coloredText(b, g);
}
}
};
e.prototype.addItemText = function(t, e, i, o, a) {
void 0 === i && (i = !1);
void 0 === o && (o = !0);
void 0 === a && (a = !1);
if (0 != e) {
if (this.temp_description_stat.length > 0) {
this.temp_description_stat += "\n";
this.temp_value += "\n";
}
var r = "" + e;
if (o) if (e > 0) {
this.temp_value += d.Toolbox.coloredText("+" + r + (i ? "%" : ""), "#43FF43");
this.temp_description_stat += d.Toolbox.coloredText(l.LocalizedTextManager.getText(t), "#43FF43");
} else {
this.temp_value += d.Toolbox.coloredText(r + (i ? "%" : ""), "#FB2C21");
this.temp_description_stat += d.Toolbox.coloredText(l.LocalizedTextManager.getText(t), "#FB2C21");
} else {
this.temp_value += d.Toolbox.coloredText(r + (i ? "%" : ""), "#ffffff");
this.temp_description_stat += d.Toolbox.coloredText(l.LocalizedTextManager.getText(t), "#ffffff");
}
}
};
e.prototype.setKingdomOpinion = function() {
var t = p.default.inst.kingdoms.diplomacyManager.getRelation(i.info_kingdom, h.default.selectedKingdom);
t.recalculate();
var e, o = t.getOpinion(h.default.selectedKingdom, i.info_kingdom);
this.temp_description_stat += l.LocalizedTextManager.getText("race");
this.temp_value += l.LocalizedTextManager.getText(i.info_kingdom.race.nameLocale);
this.temp_description_stat += "\n";
this.temp_value += "\n";
this.temp_description_stat += l.LocalizedTextManager.getText("kingdom_statistics_age");
this.temp_value += i.info_kingdom.data.age;
this.temp_description_stat += "\n";
this.temp_value += "\n";
this.temp_description_stat += l.LocalizedTextManager.getText("population");
this.temp_value += i.info_kingdom.getPopulationTotal();
this.temp_description_stat += "\n";
this.temp_value += "\n";
this.temp_description_stat += l.LocalizedTextManager.getText("army");
this.temp_value = this.temp_value + i.info_kingdom.countArmy() + "/" + i.info_kingdom.countArmyMax();
this.temp_description_stat += "\n";
this.temp_value += "\n";
this.temp_description_stat += "\n";
this.temp_value += "\n";
if (o._opinion_total >= 0) {
this.temp_value += d.Toolbox.coloredText("" + o._opinion_total, "#43FF43");
this.temp_description_stat += d.Toolbox.coloredText(l.LocalizedTextManager.getText("opinion_total"), "#43FF43");
} else {
this.temp_value += d.Toolbox.coloredText("" + o._opinion_total, "#FB2C21");
this.temp_description_stat += d.Toolbox.coloredText(l.LocalizedTextManager.getText("opinion_total"), "#FB2C21");
}
this.temp_description_stat += "\n---";
this.temp_value += "\n---";
this.temp_description_stat += "\n";
this.temp_value += "\n";
if (0 != o._opinion_king) {
(e = new g()).description = "opinion_king";
e.value = o._opinion_king;
this.list.push(e);
}
if (0 != o._opinion_kings_mood) {
(e = new g()).description = "opinion_kings_mood";
e.value = o._opinion_kings_mood;
this.list.push(e);
}
if (0 != o._opinion_is_supreme) {
(e = new g()).description = "opinion_is_supreme";
e.value = o._opinion_is_supreme;
this.list.push(e);
}
if (0 != o._opinion_close_borders) {
(e = new g()).description = "opinion_close_borders";
e.value = o._opinion_close_borders;
this.list.push(e);
}
if (0 != o._opinion_far_lands) {
(e = new g()).description = "opinion_far_lands";
e.value = o._opinion_far_lands;
this.list.push(e);
}
if (0 != o._in_war) {
(e = new g()).description = "opinion_in_war";
e.value = o._in_war;
this.list.push(e);
}
if (0 != o._opinion_same_wars) {
(e = new g()).description = "opinion_same_wars";
e.value = o._opinion_same_wars;
this.list.push(e);
}
if (0 != o._opinion_race) {
(e = new g()).description = "race";
e.value = o._opinion_race;
this.list.push(e);
}
if (0 != o._opinion_zones) {
(e = new g()).description = "opinion_zones";
e.value = o._opinion_zones;
this.list.push(e);
}
if (0 != o._opinion_peace_time) {
(e = new g()).description = "opinion_peace_time";
e.value = o._opinion_peace_time;
this.list.push(e);
}
if (0 != o._opinion_power) {
(e = new g()).description = "opinion_power";
e.value = o._opinion_power;
this.list.push(e);
}
if (0 != o._opinion_traits) {
(e = new g()).description = "opinion_loyalty_traits";
e.value = o._opinion_traits;
this.list.push(e);
}
};
e.prototype.setLoyalty = function() {
this.txtName.string = l.LocalizedTextManager.getText("loyalty");
this.value_layout.active = !0;
if (i.info_city._opinion_total > 0) {
this.temp_value += d.Toolbox.coloredText("" + i.info_city._opinion_total, "#43FF43");
this.temp_description_stat += d.Toolbox.coloredText(l.LocalizedTextManager.getText("opinion_total"), "#43FF43");
} else {
this.temp_value += d.Toolbox.coloredText("" + i.info_city._opinion_total, "#FB2C21");
this.temp_description_stat += d.Toolbox.coloredText(l.LocalizedTextManager.getText("opinion_total"), "#FB2C21");
}
this.temp_description_stat += "\n";
this.temp_value += "\n";
this.temp_description_stat += "\n";
this.temp_value += "\n";
var t = null;
if (0 != i.info_city._opinion_world_law) {
(t = new g()).description = "opinion_world_law";
t.value = i.info_city._opinion_world_law;
this.list.push(t);
}
if (0 != i.info_city._opinion_superior_enemies) {
(t = new g()).description = "opinion_superior_enemies";
t.value = i.info_city._opinion_superior_enemies;
this.list.push(t);
}
if (0 != i.info_city._opinion_close_to_capital) {
(t = new g()).description = "opinion_close_to_capital";
t.value = i.info_city._opinion_close_to_capital;
this.list.push(t);
}
if (0 != i.info_city._opinion_cities) {
(t = new g()).description = "opinion_number_of_cities";
t.value = i.info_city._opinion_cities;
this.list.push(t);
}
if (0 != i.info_city._opinion_king) {
(t = new g()).description = "opinion_king";
t.value = i.info_city._opinion_king;
this.list.push(t);
}
if (0 != i.info_city._opinion_new_city) {
(t = new g()).description = "opinion_new_city";
t.value = i.info_city._opinion_new_city;
this.list.push(t);
}
if (0 != i.info_city._opinion_new_kingdom) {
(t = new g()).description = "opinion_new_kingdom";
t.value = i.info_city._opinion_new_kingdom;
this.list.push(t);
}
if (0 != i.info_city._opinion_leader) {
(t = new g()).description = "opinion_leader";
t.value = i.info_city._opinion_leader;
this.list.push(t);
}
if (0 != i.info_city._opinion_loyalty_traits) {
(t = new g()).description = "opinion_loyalty_traits";
t.value = i.info_city._opinion_loyalty_traits;
this.list.push(t);
}
if (0 != i.info_city._opinion_loyalty_mood) {
(t = new g()).description = "opinion_leaders_loyalty_mood";
t.value = i.info_city._opinion_loyalty_mood;
this.list.push(t);
}
if (0 != i.info_city._opinion_population) {
(t = new g()).description = "opinion_population";
t.value = i.info_city._opinion_population;
this.list.push(t);
}
if (0 != i.info_city._opinion_zones) {
(t = new g()).description = "opinion_zones";
t.value = i.info_city._opinion_zones;
this.list.push(t);
}
if (0 != i.info_city._opinion_distance) {
(t = new g()).description = "opinion_distance";
t.value = i.info_city._opinion_distance;
this.list.push(t);
}
if (0 != i.info_city._opinion_capital) {
(t = new g()).description = "opinion_capital";
t.value = i.info_city._opinion_capital;
this.list.push(t);
}
};
e.prototype.update = function() {
this.timeout > 0 && (this.timeout -= cc.director.getDeltaTime());
s.default.inst.touched && this.node.parent.active && this.hide();
};
e.prototype.hide = function() {
this.node.position = cc.Vec3.ZERO;
this.node.parent.active = !1;
this.clearTimer = 0;
};
e.hideTooltip = function() {
if (i.inst) {
i.inst.hide();
i.lastObject = null;
}
};
var i;
e.inst = null;
e.info_kingdom = null;
e.info_tip = "";
e.info_tip_description = "";
e.info_equipment_slot = null;
e.info_resource = null;
e.info_city = null;
e.lastObject = null;
r([ _(cc.Sprite) ], e.prototype, "icon", void 0);
r([ _(cc.RichText) ], e.prototype, "txtName", void 0);
r([ _(cc.RichText) ], e.prototype, "txtDesc", void 0);
r([ _(cc.Node) ], e.prototype, "desc_layout", void 0);
r([ _(cc.Node) ], e.prototype, "value_layout", void 0);
return i = r([ y ], e);
}(cc.Component);
i.default = v;
cc._RF.pop();
}, {
"../../../../../framework/lib/prototype/MathUtils": void 0,
"../../../../common/src/module/GlobalNode": void 0,
"../../../../common/src/text/LocalizedTextManager": void 0,
"../../Config": "Config",
"../../MapBox": "MapBox",
"../../assetLibrary/lib/ItemLibrary": "ItemLibrary",
"../../common/ItemTools": "ItemTools",
"../../common/ToolBox": "ToolBox",
"../../texture/TextureLoader": "TextureLoader"
} ],
Tornado: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "0ac42D+dc9EEbdrmuMCvdgT", "Tornado");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
}), r = this && this.__decorate || function(t, e, i, o) {
var a, r = arguments.length, n = r < 3 ? e : null === o ? o = Object.getOwnPropertyDescriptor(e, i) : o;
if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) n = Reflect.decorate(t, e, i, o); else for (var s = t.length - 1; s >= 0; s--) (a = t[s]) && (n = (r < 3 ? a(n) : r > 3 ? a(e, i, n) : a(e, i)) || n);
return r > 3 && n && Object.defineProperty(e, i, n), n;
};
Object.defineProperty(i, "__esModule", {
value: !0
});
var n = t("../../../../../framework/lib/prototype/MathUtils"), s = t("../../../../common/src/data/AchievData"), l = t("../../../../common/src/GameCommon"), c = t("../../assetLibrary/AssetManager"), u = t("../../base/BaseActorComponent"), d = t("../../brush/Brush"), h = t("../../common/ToolBox"), p = t("../../game/audio/GameAudio"), f = t("../../MapBox"), m = t("../../world/WorldTimer"), y = t("../Actor"), _ = t("../ActorStatus"), g = cc._decorator, v = g.ccclass, b = (g.property, 
function(t) {
a(e, t);
function e() {
var e = null !== t && t.apply(this, arguments) || this;
e.shrinkTimer = 1;
e.tweener = null;
e.started = !1;
e.scale = 1;
e.timeout = 1;
e.targetTile = null;
e.startPos = cc.Vec3.ZERO;
e.firstCorner = cc.Vec3.ZERO;
e.secondCorner = cc.Vec3.ZERO;
e.distanceToTarget = 0;
e.angleDirection = cc.Vec3.ZERO;
e.targetPos = cc.Vec3.ZERO;
e.speedMod = .02;
e.brush = null;
e.resizeCooldown = 1.5;
e.moveTimer = null;
e.brushTimer = null;
e.burstTimer = 1;
e.colorEffect = 0;
e.scaleFactor = .5;
e.flipXMul = 1;
return e;
}
i = e;
e.prototype.create = function() {
t.prototype.create.call(this);
this.moveTimer = new m.default(0, this.moveTick.bind(this));
this.brushTimer = new m.default(0, this.brushTick.bind(this));
this.prepare(i.TORNADO_SCALE_DEFAULT);
this.actor.callbacks_landed.push(this.tornado_landed.bind(this));
};
e.prototype.tornado_landed = function() {
this.actor.inMapBorder() ? this.newMove() : this.killTornado();
};
e.prototype.prepare = function(t) {
void 0 === t && (t = 1);
if (!this.started) {
this.started = !0;
this.actor = this.getComponent(y.default);
this.actor.data.alive = !0;
this.node.scale = .1;
this.flipXMul = h.Toolbox.randomBool() ? 1 : -1;
if (-1 == this.flipXMul) {
this.node.scaleX *= this.flipXMul;
this.actor.setFlip(!0);
}
this.setScaleAndTween(t, "backOut");
this.shrinkTimer = h.Toolbox.randomFloat(35, 70);
this.resizeTornado(t);
this.newMove();
this.moveTimer.setTime(-1);
}
};
e.prototype.setScaleAndTween = function(t, e, i) {
void 0 === i && (i = null);
var o = t * this.scaleFactor;
this.actor.setActorSize(o);
if (this.tweener) {
this.tweener.stop();
this.tweener = null;
}
this.tweener = cc.tween(this.node).to(.5, {
scale: t * this.scaleFactor
}, {
easing: e
}).call(function() {
i && i();
}).start();
};
e.prototype.forceScaleTo = function(t) {
this.scale = t;
if (this.tweener) {
this.tweener.stop();
this.tweener = null;
}
this.node.scale = t;
};
e.prototype.newMove = function() {
this.actor.findCurrentTile();
this.startPos = this.actor.currentTile.posV3;
this.targetTile = h.Toolbox.getRandomTileAround(this.actor.currentTile);
var t = h.Toolbox.getRandomTileAround(this.targetTile), e = h.Toolbox.getRandomTileAround(t);
this.firstCorner.x = t.posV3.x;
this.firstCorner.y = t.posV3.y;
this.secondCorner.x = e.posV3.x;
this.secondCorner.y = e.posV3.y;
this.targetPos = this.targetTile.posV3;
this.distanceToTarget = 0;
this.speedMod = h.Toolbox.randomFloat(.1, .2);
this.angleDirection.set(cc.Vec3.ZERO);
this.timeout = h.Toolbox.randomInt(0, 5);
};
e.prototype.logicUpdate = function(t) {
var e, i;
if (!l.default.isPaused && (null === (e = this.actor.data) || void 0 === e ? void 0 : e.alive)) {
this.shrinkTimer -= t;
this.burstTimer > 0 && (this.burstTimer -= t);
this.resizeCooldown > 0 && (this.resizeCooldown -= t);
this.updateColorEffect(t);
if (!this.actor.is_moving) if (this.actor.zPosition.y > 0) {
this.targetTile = null;
this.distanceToTarget = 0;
} else {
this.targetTile || this.newMove();
this.distanceToTarget += t * this.speedMod;
this.moveTimer.logicUpdate(t);
this.brushTimer.logicUpdate(t);
f.default.inst.applyForce(this.actor.currentTile, 10, .5, !1);
if (this.distanceToTarget >= .95) {
this.targetTile = null;
this.distanceToTarget = 0;
}
this.shrinkTimer <= 0 && (null === (i = this.actor.data) || void 0 === i ? void 0 : i.alive) && this.split();
}
}
};
e.prototype.moveTick = function() {
this.actor.currentPosition = h.Toolbox.cubeBezier3(this.startPos, this.firstCorner, this.secondCorner, this.targetPos, h.Toolbox.easeInOutQuart(this.distanceToTarget));
this.actor._positionDirty = !0;
this.actor._currentTileDirty = !0;
};
e.prototype.tornadoAction = function() {
this.brush = d.default.getBrushBySize(n.default.intCast(6 * this.scale));
for (var t = 0; t < this.brush.pos.length; t++) {
var e = this.brush.pos[t], i = this.actor.currentTile.pos.x + e.x, o = this.actor.currentTile.pos.y + e.y;
if (!(i < 0 || i >= f.default.width || o < 0 || o >= f.default.height)) {
var a = f.default.inst.getTileSimple(i, o);
if (a.type.water) {
f.default.inst.removeWater(a);
h.Toolbox.randomBool() && this.spawnBurst(a, "rain", !1);
}
(a.type.grass || a.type.life) && f.default.inst.terraformTile2(a, a.type.decreaseTo, c.default.terraform.get("flash"));
if (a.type.lava) {
f.default.inst.lavaLayer.removeLava(a);
h.Toolbox.randomBool() && this.spawnBurst(a, "lava");
}
a.building && a.building.stats.canBeDamagedByTornado && a.building.getHit(1);
}
}
this.burstTimer < 0 && (this.burstTimer = h.Toolbox.randomFloat(.5, 2));
};
e.prototype.spawnBurst = function(t, e, i) {
void 0 === i && (i = !0);
f.default.inst.dropManager.activeIndex <= 3e3 && f.default.inst.dropManager.spawnBurstPixel(t, e, h.Toolbox.randomFloat(.2, .5), h.Toolbox.randomFloat(1.3, 1.8));
};
e.prototype.brushTick = function() {
this.tornadoAction();
f.default.inst.conwayLayer.checkKillRange(this.actor.currentTile.pos, 7);
};
e.prototype.shrink = function() {
var t;
if (null === (t = this.actor.data) || void 0 === t ? void 0 : t.alive) if (this.scale < i.TORNADO_SCALE_MIN) this.killTornado(); else if (!(this.resizeCooldown > 0)) {
this.scale *= i.TORNADO_SCALE_DECREASE_MOD;
p.default.playTornado();
this.startColorEffect("white");
this.resizeTornado(this.scale);
}
};
e.prototype.grow = function() {
var t;
if ((null === (t = this.actor.data) || void 0 === t ? void 0 : t.alive) && !(this.scale >= i.TORNADO_SCALE_MAX) && !(this.resizeCooldown > 0)) {
this.scale *= i.TORNADO_SCALE_INCREASE_MOD;
this.scale > i.TORNADO_SCALE_MAX && (this.scale = i.TORNADO_SCALE_MAX);
p.default.playTornado();
this.startColorEffect();
this.resizeTornado(this.scale);
}
};
e.prototype.split = function(t) {
var e;
void 0 === t && (t = !1);
if (!(null === (e = this.actor.data) || void 0 === e ? void 0 : e.alive)) return !1;
p.default.playTornado();
var o = this.scale;
this.scale *= .5;
this.resizeTornado(this.scale);
this.startColorEffect("white");
this.scale < i.TORNADO_SCALE_MIN && t && s.default.update(48);
if (this.scale < i.TORNADO_SCALE_MIN) {
this.killTornado();
return !0;
}
var a = 1;
t || (a = h.Toolbox.randomInt(0, 1));
for (var r = 0; r < a; r++) {
var n = f.default.inst.createNewUnit("tornado", this.actor.currentTile).getComponent(i);
n.forceScaleTo(o);
n.resizeTornado(this.scale);
}
return !0;
};
e.prototype.resizeTornado = function(t) {
this.scale = t;
this.shrinkTimer = h.Toolbox.randomFloat(35, 70);
this.setScaleAndTween(this.scale, "backIn");
this.actor.curStats.speed = 6 * this.scale;
this.actor.curStats.damage = n.default.intCast(10 * this.scale);
this.resizeCooldown = .1;
};
e.prototype.startColorEffect = function(t) {
void 0 === t && (t = "red");
this.colorEffect = .3;
};
e.prototype.updateColorEffect = function(t) {
if (0 != this.colorEffect) {
this.colorEffect -= t;
this.colorEffect < 0 && (this.colorEffect = 0);
}
};
e.prototype.kill = function() {
this.started = !1;
};
e.prototype.killTornado = function() {
var t;
if (null === (t = this.actor.data) || void 0 === t ? void 0 : t.alive) {
this.actor.data.alive = !1;
this.setScaleAndTween(0, "backIn", this.finishAndRemove.bind(this));
}
};
e.prototype.finishAndRemove = function() {
this.actor.killHimself(!0, _.AttackType.None, !1);
};
e.growTornados = function(t) {
i.resizeOnTile(t, "grow");
t.neighboursAll.forEach(function(t) {
i.resizeOnTile(t, "grow");
});
};
e.shrinkTornados = function(t) {
i.resizeOnTile(t, "shrink");
t.neighboursAll.forEach(function(t) {
i.resizeOnTile(t, "shrink");
});
};
e.resizeOnTile = function(t, e) {
t.units.forEach(function(t) {
var o, a, r;
(null === (o = t.base_data) || void 0 === o ? void 0 : o.alive) && "tornado" == (null === (r = null === (a = t.a) || void 0 === a ? void 0 : a.stats) || void 0 === r ? void 0 : r.id) && ("grow" == e ? t.getComponent(i).grow() : t.getComponent(i).shrink());
});
};
var i;
e.TORNADO_SCALE_DECREASE_MOD = .9;
e.TORNADO_SCALE_INCREASE_MOD = 1.1;
e.TORNADO_SCALE_MIN = .1;
e.TORNADO_SCALE_MAX = 20;
e.TORNADO_SCALE_DEFAULT = .5;
return i = r([ v ], e);
}(u.default));
i.default = b;
cc._RF.pop();
}, {
"../../../../../framework/lib/prototype/MathUtils": void 0,
"../../../../common/src/GameCommon": void 0,
"../../../../common/src/data/AchievData": void 0,
"../../MapBox": "MapBox",
"../../assetLibrary/AssetManager": "AssetManager",
"../../base/BaseActorComponent": "BaseActorComponent",
"../../brush/Brush": "Brush",
"../../common/ToolBox": "ToolBox",
"../../game/audio/GameAudio": "GameAudio",
"../../world/WorldTimer": "WorldTimer",
"../Actor": "Actor",
"../ActorStatus": "ActorStatus"
} ],
TumorBuilding: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "2e25dixsPNI2qutfD2IQS2l", "TumorBuilding");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
});
Object.defineProperty(i, "__esModule", {
value: !0
});
var r = t("../actors/other/Ant"), n = t("../base/BaseBuilding"), s = t("../MapBox"), l = function(t) {
a(e, t);
function e() {
var e = null !== t && t.apply(this, arguments) || this;
e.tentacles = 0;
return e;
}
e.prototype.logicUpdate = function() {
if (0 == this.tentacles) {
this.newTentacle();
this.newTentacle();
} else 1 == this.tentacles && this.newTentacle();
};
e.prototype.newTentacle = function() {
s.default.inst.createNewUnit("tentacle", this.building.currentTile).getComponent(r.default).setTumor(this);
};
return e;
}(n.BaseBuildingComponent);
i.default = l;
cc._RF.pop();
}, {
"../MapBox": "MapBox",
"../actors/other/Ant": "Ant",
"../base/BaseBuilding": "BaseBuilding"
} ],
UFO: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "71867/ghbZBFLtVRJKE0Ps5", "UFO");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
}), r = this && this.__decorate || function(t, e, i, o) {
var a, r = arguments.length, n = r < 3 ? e : null === o ? o = Object.getOwnPropertyDescriptor(e, i) : o;
if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) n = Reflect.decorate(t, e, i, o); else for (var s = t.length - 1; s >= 0; s--) (a = t[s]) && (n = (r < 3 ? a(n) : r > 3 ? a(e, i, n) : a(e, i)) || n);
return r > 3 && n && Object.defineProperty(e, i, n), n;
};
Object.defineProperty(i, "__esModule", {
value: !0
});
i.UfoState = void 0;
var n, s = t("../../../../../framework/lib/prototype/MathUtils"), l = t("../../animation/SpriteAnimation"), c = t("../../assetLibrary/AssetManager"), u = t("../../base/BaseActorComponent"), d = t("../../common/ToolBox"), h = t("../../game/audio/GameAudio"), p = t("../../MapBox");
(function(t) {
t[t.Flying = 0] = "Flying";
t[t.Exploring = 1] = "Exploring";
t[t.Attacking = 2] = "Attacking";
t[t.Abduct = 3] = "Abduct";
t[t.Dying = 4] = "Dying";
t[t.GoingToUnitTarget = 5] = "GoingToUnitTarget";
t[t.AttackingUnitTarget = 6] = "AttackingUnitTarget";
})(n = i.UfoState || (i.UfoState = {}));
var f = cc._decorator, m = f.ccclass, y = (f.property, function(t) {
a(e, t);
function e() {
var e = null !== t && t.apply(this, arguments) || this;
e.beamRnd = null;
e.beamAnim = null;
e.attacksForCity = 0;
e.cityToAttack = null;
e.exploringTicks = 0;
e.actionTime = 0;
e.aggroTargets = [];
return e;
}
e.prototype.create = function() {
t.prototype.create.call(this);
var e = this.node.getChildByName("Beam");
this.beamRnd = e.getComponent(cc.Sprite);
this.beamAnim = e.getComponent(l.SpriteAnimation);
this.hideBeam();
this.setState(n.Flying);
this.actor.callbacks_get_hit.push(this.getHit.bind(this));
};
e.prototype.click = function() {
this.beamAnim.isOn || this.startBeam();
};
e.prototype.setState = function(t, e) {
var i, o;
void 0 === e && (e = null);
this.state = t;
var a = null;
switch (t) {
case n.GoingToUnitTarget:
this.actor.curStats.speed = 50;
this.actor.moveTo(e);
this.actor.is_moving = !0;
break;

case n.Flying:
this.actor.curStats.speed = 20;
this.beamAnim.isOn = !1;
this.beamRnd.enabled = !1;
if (this.attacksForCity > 0 && (null === (i = this.cityToAttack) || void 0 === i ? void 0 : i.buildings)) if (0 == this.cityToAttack.buildings.length) this.cityToAttack = null; else {
a = null === (o = this.cityToAttack.buildings) || void 0 === o ? void 0 : o.getRandom().currentTile.zone.tiles.getRandom();
this.attacksForCity--;
this.attacksForCity < 0 && (this.cityToAttack = null);
}
a || (a = p.default.inst.islandsCalculator.getRandomGround());
this.actor.moveTo(a);
break;

case n.Exploring:
this.actor.curStats.speed = 10;
a = this.actor.currentTile.zone.tiles.getRandom();
this.actor.moveTo(a);
break;

case n.Attacking:
case n.AttackingUnitTarget:
this.startBeam();
break;

case n.Dying:
this.beamAnim.isOn = !1;
this.beamRnd.enabled = !1;
break;

case n.Abduct:
}
};
e.prototype.startBeam = function() {
this.beamAnim.stopAt(0, !0);
this.beamAnim.isOn = !0;
this.beamRnd.enabled = !0;
h.default.playUfoAttack(this.node.position);
};
e.prototype.logicUpdate = function(e) {
var i;
t.prototype.logicUpdate.call(this, e);
this.beamAnim.logicUpdate(e);
this.actor.curStats.speed < 30 && this.state == n.Flying && (this.actor.curStats.speed += 10 * e);
if (null === (i = this.actor.data) || void 0 === i ? void 0 : i.alive) {
if (this.beamAnim.isOn) {
if (4 == this.beamAnim.currentFrameIndex) for (var o = 0; o < 8; o++) for (var a = 0; a < 8; a++) {
var r = p.default.inst.getTile(this.actor.currentTile.pos.x + a - 4, this.actor.currentTile.pos.y + o - 4);
!r || d.Toolbox.dist(this.actor.currentTile.pos.x, this.actor.currentTile.pos.y, r.pos.x, r.pos.y) > 4 || this.attackTile(r);
}
if (this.beamAnim.currentFrameIndex != this.beamAnim.frames.length - 1) return;
this.hideBeam();
}
this.actor.is_moving || (this.actionTime > 0 ? this.actionTime -= e : this.nextAction());
} else {
this.hideBeam();
this.actor.updateFall(e);
if (0 == this.actor.zPosition.y) {
h.default.playExplosionMedium();
var l = p.default.inst.getTile(s.default.intCast(this.actor.currentPosition.x), s.default.intCast(this.actor.currentPosition.y));
if (!l) {
this.actor.killHimself(!0);
return;
}
this.actor.killHimself(!0);
p.default.inst.damageWorld(l, 5, c.default.terraform.get("ufo_explosion"));
p.default.inst.stackEffects.get("explosionSmall").spawnAtRandomScale(l, .45, .6);
}
}
};
e.prototype.hideBeam = function() {
this.beamAnim.isOn = !1;
this.beamRnd.enabled = !1;
};
e.prototype.attackTile = function(t) {
t && p.default.inst.damageWorld(t, 0, c.default.terraform.get("ufo_attack"));
};
e.prototype.nextAction = function() {
var t, e, i, o, a;
if (null === (e = null === (t = this.actor) || void 0 === t ? void 0 : t.data) || void 0 === e ? void 0 : e.alive) {
if (0 != this.aggroTargets.length) {
this.aggroTargets.shuffle();
for (var r = 0; r < this.aggroTargets.length; r++) {
var s = this.aggroTargets[r];
if (null === (i = null == s ? void 0 : s.data) || void 0 === i ? void 0 : i.alive) {
this.setState(n.GoingToUnitTarget, s.currentTile);
break;
}
}
this.aggroTargets.clear();
}
switch (this.state) {
case n.GoingToUnitTarget:
this.setState(n.AttackingUnitTarget);
break;

case n.AttackingUnitTarget:
this.setState(n.Flying);
break;

case n.Flying:
this.cityToAttack && this.actor.currentTile.building && !p.default.inst.worldLaws.world_law_peaceful_monsters.boolVal && this.setState(n.Attacking);
this.exploringTicks = d.Toolbox.randomInt(3, 7);
this.setState(n.Exploring);
break;

case n.Exploring:
if (this.exploringTicks > 0) {
this.exploringTicks--;
if (null === (a = null === (o = this.actor.currentTile) || void 0 === o ? void 0 : o.zone) || void 0 === a ? void 0 : a.city) {
this.cityToAttack = this.actor.currentTile.zone.city;
this.attacksForCity = d.Toolbox.randomInt(3, 10);
}
this.cityToAttack ? this.setState(n.Flying) : this.setState(n.Exploring);
} else this.setState(n.Flying);
break;

case n.Attacking:
case n.Abduct:
case n.Dying:
}
}
};
e.prototype.getHit = function() {
this.state != n.Flying && this.state != n.Exploring || this.nextAction();
this.actor.attackedBy && this.aggroTargets.push(this.actor.attackedBy);
};
return r([ m ], e);
}(u.default));
i.default = y;
cc._RF.pop();
}, {
"../../../../../framework/lib/prototype/MathUtils": void 0,
"../../MapBox": "MapBox",
"../../animation/SpriteAnimation": "SpriteAnimation",
"../../assetLibrary/AssetManager": "AssetManager",
"../../base/BaseActorComponent": "BaseActorComponent",
"../../common/ToolBox": "ToolBox",
"../../game/audio/GameAudio": "GameAudio"
} ],
UiController: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "84da3hZQ5pIOIynnDoXZlbj", "UiController");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
}), r = this && this.__decorate || function(t, e, i, o) {
var a, r = arguments.length, n = r < 3 ? e : null === o ? o = Object.getOwnPropertyDescriptor(e, i) : o;
if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) n = Reflect.decorate(t, e, i, o); else for (var s = t.length - 1; s >= 0; s--) (a = t[s]) && (n = (r < 3 ? a(n) : r > 3 ? a(e, i, n) : a(e, i)) || n);
return r > 3 && n && Object.defineProperty(e, i, n), n;
}, n = this && this.__values || function(t) {
var e = "function" == typeof Symbol && Symbol.iterator, i = e && t[e], o = 0;
if (i) return i.call(t);
if (t && "number" == typeof t.length) return {
next: function() {
t && o >= t.length && (t = void 0);
return {
value: t && t[o++],
done: !t
};
}
};
throw new TypeError(e ? "Object is not iterable." : "Symbol.iterator is not defined.");
};
Object.defineProperty(i, "__esModule", {
value: !0
});
var s = t("../../../../framework/lib/prototype/DateUtils"), l = t("../../../../framework/main/Constants"), c = t("../../../../framework/manager/AdaptMgr"), u = t("../../../../framework/manager/AudioMgr"), d = t("../../../../framework/manager/ResMgr"), h = t("../../../../framework/utils/PlatformUtils"), p = t("../../../../framework/utils/UiUtil"), f = t("../../../common/src/advert/AdsManager"), m = t("../../../common/src/advert/sdk/GameTdd"), y = t("../../../common/src/data/AchievData"), _ = t("../../../common/src/data/RewardData"), g = t("../../../common/src/data/UserData"), v = t("../../../common/src/GameCommon"), b = t("../../../common/src/module/GuideView"), T = t("../../../common/src/MsgCache"), w = t("../common/GameUtils"), B = t("../common/PrefabLibrary"), k = t("../common/ViewController"), A = t("../Config"), S = t("../DebugConfig"), x = t("../game/achiev/AchievementToast"), C = t("../game/audio/GameAudio"), O = t("../game/guide/GuideController"), P = t("../game/reward/AdView"), R = t("../game/reward/AwardView"), M = t("../game/reward/mystery/MysteryButton"), L = t("../game/reward/OnlineReward"), F = t("../MapBox"), D = t("./power/PowerButton"), I = t("./power/PowerButtonSelector"), j = t("./power/SelectedPowerNameTip"), E = cc._decorator, N = E.ccclass, G = E.property, U = function(t) {
a(e, t);
function e() {
var e = null !== t && t.apply(this, arguments) || this;
e.propList = [];
e.toggleContainer = null;
e.selectIcon = null;
e.ndSelected = null;
e.mainSizeButton = null;
e.btnPulldown = null;
e.btnAchiev = null;
e.btnOnline = null;
e.btnSignIn = null;
e.btnMoreGame = null;
e.toggleRec = null;
e.pauseSprite = [];
e.propSprite = [];
e.pbAchiev = null;
e.propDict = new Map();
e.toggleIdx = 0;
e.gmClickTimer = 0;
e.gmClickCount = 0;
e.video_interval = 0;
e.insert_interval = 0;
e.achievList = [];
e.bottomTweenTime = .3;
e.isDoRecord = !1;
return e;
}
i = e;
e.prototype.onLoad = function() {
var t, e, o, a;
i.inst = this;
try {
for (var r = n(this.toggleContainer.children), s = r.next(); !s.done; s = r.next()) s.value.getComponent(cc.Toggle).isChecked = !0;
} catch (e) {
t = {
error: e
};
} finally {
try {
s && !s.done && (e = r.return) && e.call(r);
} finally {
if (t) throw t.error;
}
}
try {
for (var u = n(this.propList), d = u.next(); !d.done; d = u.next()) {
var h = d.value, p = parseInt(h.name.substr(3, 4));
this.propDict.set(p, h);
}
} catch (t) {
o = {
error: t
};
} finally {
try {
d && !d.done && (a = u.return) && a.call(u);
} finally {
if (o) throw o.error;
}
}
this.propList = [];
this.updateProp();
this.toggleContainer.children[0].getComponent(cc.Toggle).isChecked = !0;
this.toggleIdx = 0;
var f = this.node.getChildByName("left");
if (KS_GAME) {
var m = f.getComponent(cc.Widget);
m.top = 140;
m.updateAlignment();
}
this.node.children.forEach(function(t) {
c.default.adaptScreenScale(t);
});
if (l.default.MODE == l.MODE_TYPE.LOCK) {
this.btnPulldown.active = !1;
this.btnOnline.active = !1;
this.btnSignIn.parent = this.btnOnline.parent;
this.btnSignIn.position = this.btnOnline.position;
}
this.btnMoreGame.active = l.default.IS_LOCAL || JSB_OPPO || QQ_GAME || WECHAT_GAME;
this.toggleRec.node.active = BYTEDANCE_GAME;
cc.director.on("bannerResize", this.bottomUpdateY, this);
cc.director.on("updateProp", this.updateProp, this);
y.default.dispatcher.on(y.default.eventName, this.achievListen, this);
};
e.prototype.onDestroy = function() {
cc.director.off("updateProp");
cc.director.off("bannerResize");
u.default.stopAllEffects();
y.default.dispatcher.off(y.default.eventName, this);
};
e.prototype.start = function() {
d.default.loadDir("res/audio");
p.UiUtil.openModule("res/prefab/ui/tip/ToolTip", l.default.GLOBAL_NODE);
p.UiUtil.openModule("res/prefab/ui/tip/WorldTip", l.default.GLOBAL_NODE);
!l.default.IS_LOCAL && l.default.IS_AD_SHOW && (JSB_IOS ? this.bottomUpdateY(130) : XIAOMI_GAME ? this.bottomUpdateY(60) : JSB_MMY ? this.bottomUpdateY(145) : JSB_XIAOMI ? this.bottomUpdateY(150) : WECHAT_GAME || QQ_GAME || BYTEDANCE_GAME || JSB_233 || this.bottomUpdateY(114));
C.default.playBGM();
};
e.prototype.update = function(t) {
this.gmClickTimer += t;
this.gmClickTimer > .5 && (this.gmClickCount = 0);
if (!l.default.FULLVIDEO_SHOW) {
this.video_interval += t;
if (this.video_interval > 180) {
this.video_interval = 0;
l.default.FULLVIDEO_SHOW = !0;
}
}
if (!l.default.INSERTAD_SHOW) {
this.insert_interval += t;
if (this.insert_interval > 60) {
this.insert_interval = 0;
l.default.INSERTAD_SHOW = !0;
}
}
};
e.prototype.initGuideView = function() {
O.default.inst.initView(B.default.inst.guide);
FIRST_PLAY ? this.scheduleOnce(function() {
O.default.inst.do(O.GUIDE_TYPE.novice);
}, .3) : this.showBoxGift();
};
e.prototype.achievListen = function(t) {
var e = this;
if (!t.awarded) {
this.achievList.push(t);
var i = function() {
p.UiUtil.openModule("res/prefab/ui/achiev/AchievToast").then(function(t) {
t.getComponent(x.default).show(e.achievList[0], function() {
e.achievList.shift();
e.achievList.length > 0 && i();
});
e.btnAchiev.getChildByName("dot").active = !0;
});
};
1 == this.achievList.length && i();
}
};
e.prototype.onClickToggle = function(t, e) {
C.default.playClick();
var i = parseInt(e);
"toggle0" == t.target.name && O.default.inst.in(O.GUIDE_TYPE.save, 1) && O.default.inst.do(O.GUIDE_TYPE.save);
"toggle0" == t.target.name && O.default.inst.in(O.GUIDE_TYPE.cityInfo, 1) && O.default.inst.do(O.GUIDE_TYPE.cityInfo);
"toggle0" == t.target.name && O.default.inst.in(O.GUIDE_TYPE.timeScale, 1) && O.default.inst.do(O.GUIDE_TYPE.timeScale);
"toggle2" == t.target.name && O.default.inst.in(O.GUIDE_TYPE.novice, 3) && O.default.inst.do(O.GUIDE_TYPE.novice);
"toggle4" == t.target.name && O.default.inst.in(O.GUIDE_TYPE.novice, 10) && O.default.inst.do(O.GUIDE_TYPE.novice);
if (0 == i && v.default.isPaused) {
this.gmClickTimer = 0;
this.gmClickCount++;
if (this.gmClickCount > 10) {
this.gmClickCount = 0;
k.default.open(k.view_type.GMView, null, t);
}
}
if (i != this.toggleIdx) {
this.toggleIdx = i;
var o = cc.find("checkmark/scrollView/view/HLayout", t.target);
o.scaleX = .75;
o.x = -o.parent.width / 2;
cc.tween(o).to(.07, {
scaleX: 1
}).start();
j.SelectedPowerNameTip.inst.setText(t.target.name);
}
};
e.prototype.onClickProp = function(t, e) {
var i = t.getCurrentTarget(), o = i.getComponent(D.PowerButton);
if (o && o.type != D.PowerButtonType.Active) o.click(t, e); else if (null == i ? void 0 : i.name) {
A.default.selectedProp = parseInt(i.name.substr(3, 4));
A.default.selectedPowerid = o.godPower.name;
var a = g.default.getPropByID(A.default.selectedProp);
if (a) {
this.updateProp(A.default.selectedProp);
o && o.click(t, e);
if (!S.default.Prop_infinite) if (l.default.MODE == l.MODE_TYPE.COUNT) {
if (0 == a.number) {
this.onClickAddProp();
return;
}
} else if (l.default.MODE == l.MODE_TYPE.LOCK) {
if (a.lock) {
k.default.open(k.view_type.InfiniteProp);
return;
}
} else {
if (a.lock) {
k.default.open(k.view_type.InfiniteProp);
return;
}
if (0 == a.number) {
this.onClickAddProp();
return;
}
}
"btn3001" == i.name && O.default.inst.in(O.GUIDE_TYPE.novice, 4) && O.default.inst.do(O.GUIDE_TYPE.novice);
"btn5010" == i.name && O.default.inst.in(O.GUIDE_TYPE.novice, 11) && this.scheduleOnce(function() {
O.default.inst.do(O.GUIDE_TYPE.novice);
}, .02);
}
}
};
e.prototype.showSelectTip = function(t) {
var e;
if (null == t ? void 0 : t.node) {
var i = t.node.getChildByName("icon");
this.selectIcon.getComponent(cc.Sprite).spriteFrame = i.getComponent(cc.Sprite).spriteFrame;
this.selectIcon.width = i.width;
this.selectIcon.height = i.height;
this.mainSizeButton.active = 1 == (null === (e = t.godPower) || void 0 === e ? void 0 : e.showToolSizes);
var o = cc.find("frame/layout/btnAdd", this.ndSelected), a = g.default.getPropConfigByID(A.default.selectedProp);
o.active = (null == a ? void 0 : a.rare) != g.RARE_TYPE.NORMAL && l.default.MODE != l.MODE_TYPE.LOCK;
a && (o.getChildByName("num").getComponent(cc.Label).string = "+" + a.reward);
cc.tween(this.ndSelected).to(.2, {
x: 0
}).start();
}
};
e.prototype.closeSelectTip = function() {
C.default.playClick();
cc.tween(this.ndSelected).to(.2, {
x: 300
}).start();
I.PowerButtonSelector.inst.unselectAll();
};
e.prototype.onClickAddProp = function(t) {
var e = this;
t && p.UiUtil.btnEnabel(t);
l.default.REPORT_ID = "addPropNum";
f.default.showVideoAds(function(t) {
if (1 == t) {
g.default.getPropByID(A.default.selectedProp).number += g.default.getPropConfigByID(A.default.selectedProp).reward;
e.updateProp(A.default.selectedProp);
g.default.save();
} else {
var i = 0 == t ? "视频播放未完成。" : "视频播放失败，请稍候再试！";
T.default.pushToast(i);
}
});
};
e.prototype.onClickPullDown = function() {
var t = this.btnPulldown.getChildByName("touchNode"), e = this.btnPulldown.getChildByName("layout"), i = this.btnPulldown.getChildByName("icon"), o = !e.active;
e.active = o;
t.active = o;
i.angle = o ? 180 : 0;
};
e.prototype.onClickPause = function(t) {
C.default.playClick();
var e = t.getCurrentTarget().getChildByName("icon").getComponent(cc.Sprite);
v.default.setPause(!v.default.isPaused);
j.SelectedPowerNameTip.inst.setText(v.default.isPaused ? "gamePaused" : "gameUnpaused");
e.spriteFrame = v.default.isPaused ? this.pauseSprite[1] : this.pauseSprite[0];
};
e.prototype.onClickTimeScale = function(t, e) {
C.default.playClick();
O.default.inst.in(O.GUIDE_TYPE.timeScale, 1) && O.default.inst.do(O.GUIDE_TYPE.timeScale);
var i = parseInt(t.node.name.substr(3, 4)), o = g.default.getPropByID(i), a = g.default.getPropConfigByID(i);
this.toggleContainer.stopAllActions();
var r = !1;
if (o.number > 0) {
if (t.isChecked) {
if (!g.default.member.useTimeScale) {
g.default.member.useTimeScale = !0;
g.default.save();
}
cc.tween(this.toggleContainer).sequence(cc.delayTime(1), cc.callFunc(function() {
if (!v.default.isPaused) {
o.number--;
g.default.save();
y.default.update(67);
if (0 === o.number) {
t.isChecked = !1;
t.checkEvents[0].emit([ t, !0 ]);
}
}
})).repeatForever().start();
}
} else {
t.isChecked = !1;
if (!e) {
r = !0;
l.default.REPORT_ID = "timeScale";
f.default.showVideoAds(function(e) {
if (1 == e) {
o.number += a.reward;
g.default.save();
t.isChecked = !0;
t.checkEvents[0].emit([ t, !0 ]);
} else {
var i = 0 == e ? "视频播放未完成。" : "视频播放失败，请稍候再试！";
T.default.pushToast(i);
}
});
}
}
A.default.timeScale = t.isChecked ? 3 : 1;
r || T.default.pushToast(t.isChecked ? "开始时间加速" : "停止时间加速");
};
e.prototype.onClickSaveWorld = function(t) {
C.default.playClick();
k.default.open(k.view_type.SaveWorld, null, t);
};
e.prototype.onClickBrushSize = function(t) {
var e = this;
C.default.playClick();
k.default.open(k.view_type.UiBrushes, function(t) {
var i = e.mainSizeButton.getChildByName("icon");
i.getComponent(cc.Sprite).spriteFrame = t.getChildByName("icon").getComponent(cc.Sprite).spriteFrame;
i.width = t.getChildByName("icon").width;
i.height = t.getChildByName("icon").height;
O.default.inst.in(O.GUIDE_TYPE.novice, 13) && O.default.inst.do(O.GUIDE_TYPE.novice);
}, t, !1, function() {
O.default.inst.in(O.GUIDE_TYPE.novice, 12) && e.scheduleOnce(function() {
O.default.inst.do(O.GUIDE_TYPE.novice);
}, .4);
});
};
e.prototype.onClickWorldLog = function(t) {
C.default.playClick();
k.default.open(k.view_type.WorldLog, null, t);
};
e.prototype.onShowKingdomList = function(t) {
C.default.playClick();
k.default.open(k.view_type.KingdomList, null, t);
};
e.prototype.onShowWorldLaws = function(t) {
C.default.playClick();
k.default.open(k.view_type.WorldLaws, null, t);
};
e.prototype.onShowFavoritesList = function(t) {
C.default.playClick();
k.default.open(k.view_type.Favorites, null, t);
};
e.prototype.onClickSetting = function(t) {
C.default.playClick();
k.default.open(k.view_type.Setting, null, t);
};
e.prototype.onClickNewMap = function(t) {
var e = this;
C.default.playClick();
k.default.open(k.view_type.MapSetting, function(t) {
e.scheduleOnce(function() {
F.default.inst.generateNewMap(t);
}, .3);
}, t);
};
e.prototype.onClickWorldInfo = function(t) {
C.default.playClick();
k.default.open(k.view_type.WorldInfo, null, t);
};
e.prototype.onClickAchievement = function(t) {
C.default.playClick();
k.default.open(k.view_type.Achiev, null, t);
this.btnAchiev.getChildByName("dot").active = !1;
};
e.prototype.onClickCensusInfo = function(t) {
C.default.playClick();
k.default.open(k.view_type.CensusInfo, null, t);
};
e.prototype.onClickSign = function(t) {
C.default.playClick();
k.default.open(k.view_type.SignIn, null, t, !1);
};
e.prototype.onClickOnline = function(t) {
C.default.playClick();
O.default.inst.in(O.GUIDE_TYPE.online, 0) && O.default.inst.do(O.GUIDE_TYPE.online);
var e = t.getCurrentTarget().getComponent(L.default);
e.setEnable(!1);
k.default.open(k.view_type.AwardView, null, t, !1, function(t) {
e.getReward();
t.getComponent(R.default).init(R.Reward_type.online, l.default.MODE == l.MODE_TYPE.LOCK ? _.default.getLockPropConfig(2) : e.rewardID);
});
};
e.prototype.onClickMysteryGift = function(t) {
C.default.playClick();
M.default.inst.hide();
k.default.open(k.view_type.Mystery, null, t);
};
e.prototype.onClickLuckyWheel = function(t) {
C.default.playClick();
k.default.open(k.view_type.LuckyWheel, null, t);
};
e.prototype.onClickMoreGame = function() {
JSB_OPPO ? h.default.requestChannel("AdsUtil", "goToOppo") : QQ_GAME ? f.default.showAppBoxAd(function() {}) : (WECHAT_GAME || l.default.IS_LOCAL) && k.default.open(k.view_type.HtBox);
};
e.prototype.onClickRecord = function(t) {
var e = this, i = this.toggleRec.node.getChildByName("title"), o = this.toggleRec.node.getChildByName("time");
o.active = t.isChecked;
i.getComponent(cc.Label).string = t.isChecked ? "录制中" : "开始录制";
if (t.isChecked) {
f.default.startRecording(function(a) {
if (a) {
T.default.pushToast("录屏停止");
e.isDoRecord = !1;
var r = function() {
w.default.allowPopUi() ? k.default.open(k.view_type.RecordShare) : e.toggleRec.scheduleOnce(r, 1);
};
r();
} else {
e.isDoRecord = !1;
T.default.pushToast("录屏失败：录屏时长低于3秒");
}
t.isChecked = !1;
o.active = !1;
e.toggleRec.unscheduleAllCallbacks();
i.getComponent(cc.Label).string = "开始录制";
}, 300);
var a = 1;
T.default.pushToast("录屏开始");
o.getComponent(cc.Label).string = "00:00";
this.toggleRec.schedule(function() {
o.getComponent(cc.Label).string = s.default.formatMinutes(a++);
if (a >= 300 && e.toggleRec.isChecked) {
e.toggleRec.isChecked = !1;
e.toggleRec.checkEvents[0].emit([ e.toggleRec ]);
}
}, 1);
} else {
this.toggleRec.unscheduleAllCallbacks();
this.isDoRecord = !0;
f.default.stopRecording(30);
}
};
e.prototype.updateProp = function(t) {
var e = this;
void 0 === t && (t = 0);
if (0 === t) this.propDict.forEach(function(t, i) {
e.doUpdateProp(i);
}); else {
if (1002 !== t && t === A.default.selectedProp) {
var i = g.default.getPropByID(A.default.selectedProp), o = cc.find("frame/layout/selectedBg/num", this.ndSelected);
if (i && o) {
o.active = i.number >= 0 && l.default.MODE != l.MODE_TYPE.LOCK;
o.getComponent(cc.Label).string = Math.floor(i.number).toString();
}
}
this.doUpdateProp(t);
}
};
e.prototype.doUpdateProp = function(t) {
var e = this.propDict.get(t), i = g.default.getPropByID(t), o = g.default.getPropConfigByID(t);
if (i && e && o && o.rare != g.RARE_TYPE.NORMAL) {
var a = e.getChildByName("video");
a && (l.default.MODE == l.MODE_TYPE.COUNT ? a.active = 0 == i.number && !S.default.Prop_infinite : l.default.MODE == l.MODE_TYPE.LOCK ? a.active = i.lock && !S.default.Prop_infinite : a.active = (i.lock || 0 == i.number) && !S.default.Prop_infinite);
var r = e.getChildByName("num");
if (r) {
r.active = 1002 == t || !(null == a ? void 0 : a.active) && l.default.MODE != l.MODE_TYPE.LOCK;
r.getComponent(cc.Label).string = 1002 == t && 0 == i.number ? "+" + o.reward + "s" : i.number.toString();
}
}
};
e.prototype.bottomMove = function(t, e) {
var i = this;
void 0 === e && (e = null);
var o = this.node.getChildByName("bottom"), a = t ? 1.5 * -cc.winSize.width : 0;
t ? BYTEDANCE_GAME || this.showBanner(!1) : BYTEDANCE_GAME && this.showBanner(!1);
cc.tween(o).to(this.bottomTweenTime, {
x: a
}, {
easing: "backOut"
}).call(function() {
if (t) BYTEDANCE_GAME && i.showBanner(!0); else {
BYTEDANCE_GAME || i.showBanner(!0);
i.updateProp(A.default.selectedProp);
}
t || i.checkGuideViewHeight();
e && e();
}).start();
var r = this.node.getChildByName("right"), n = t ? 55 : -55;
cc.tween(r).to(this.bottomTweenTime, {
x: cc.winSize.width / 2 + n
}, {
easing: "backOut"
}).start();
var s = this.node.getChildByName("left"), l = t ? -55 : 55;
cc.tween(s).to(this.bottomTweenTime, {
x: -cc.winSize.width / 2 + l
}, {
easing: "backOut"
}).start();
};
e.prototype.bottomUpdateY = function(t) {
if (!BYTEDANCE_GAME) {
var e = WECHAT_GAME || QQ_GAME || XIAOMI_GAME, i = this.node.getChildByName("bottom"), o = e ? t / cc.view.getFrameSize().height : t / cc.winSize.height, a = i.getComponent(cc.Widget);
a.bottom = cc.winSize.height * o;
a.updateAlignment();
this.checkGuideViewHeight();
}
};
e.prototype.checkGuideViewHeight = function() {
var t = this.node.getChildByName("bottom").getComponent(cc.Widget);
b.default.inst && b.default.inst.setTipsY(t.bottom + 256);
};
e.prototype.showBanner = function(t) {
if (t) {
if (!O.default.inst.isGuiding) {
this.showCustomAd(!0);
f.default.showBannerAd();
}
} else {
this.showCustomAd(!1);
f.default.hideBannerAd(cc.sys.platform != cc.sys.WECHAT_GAME);
}
};
e.prototype.showCustomAd = function(t) {
if (cc.sys.platform == cc.sys.WECHAT_GAME) {
t ? f.default.showCustomAd(cc.v2(55 / cc.winSize.width, .55)) : f.default.hideCustomAd();
f.default.showClubButton(t, cc.v2(55 / cc.winSize.width, .45));
}
};
e.prototype.showBoxGift = function() {
var t = this;
if (OPPO_GAME || QQ_GAME || JSB_OPPO || JSB_VIVO || BYTEDANCE_GAME || JSB_233 || JSB_MMY) {
f.default.preloadNativeAd();
var e = null, i = m.default.getData("p2", m.v_type.Number), o = null != i ? i : 120, a = function() {
e || (e = f.default.getNativeAdData());
if (!w.default.allowPopUi() || OPPO_GAME && !e) setTimeout(a, 3e3); else {
k.default.open(k.view_type.BoxGift);
var i = m.default.getData("p1", m.v_type.Number) || .5;
setTimeout(function() {
OPPO_GAME && k.default.open(k.view_type.AdView, null, null, !1, function(t) {
t.getComponent(P.default).init(!1, _.default.getRewards(17), e);
}, function() {
t.showBoxGift();
});
}, 1e3 * i);
}
};
this.scheduleOnce(a, o);
}
};
var i;
e.inst = null;
r([ G({
type: [ cc.Node ],
tooltip: "道具按钮列表"
}) ], e.prototype, "propList", void 0);
r([ G({
type: cc.Node
}) ], e.prototype, "toggleContainer", void 0);
r([ G({
type: cc.Node
}) ], e.prototype, "selectIcon", void 0);
r([ G({
type: cc.Node
}) ], e.prototype, "ndSelected", void 0);
r([ G({
type: cc.Node
}) ], e.prototype, "mainSizeButton", void 0);
r([ G(cc.Node) ], e.prototype, "btnPulldown", void 0);
r([ G(cc.Node) ], e.prototype, "btnAchiev", void 0);
r([ G(cc.Node) ], e.prototype, "btnOnline", void 0);
r([ G(cc.Node) ], e.prototype, "btnSignIn", void 0);
r([ G(cc.Node) ], e.prototype, "btnMoreGame", void 0);
r([ G(cc.Toggle) ], e.prototype, "toggleRec", void 0);
r([ G([ cc.SpriteFrame ]) ], e.prototype, "pauseSprite", void 0);
r([ G([ cc.SpriteFrame ]) ], e.prototype, "propSprite", void 0);
r([ G(cc.Prefab) ], e.prototype, "pbAchiev", void 0);
return i = r([ N ], e);
}(cc.Component);
i.default = U;
cc._RF.pop();
}, {
"../../../../framework/lib/prototype/DateUtils": void 0,
"../../../../framework/main/Constants": void 0,
"../../../../framework/manager/AdaptMgr": void 0,
"../../../../framework/manager/AudioMgr": void 0,
"../../../../framework/manager/ResMgr": void 0,
"../../../../framework/utils/PlatformUtils": void 0,
"../../../../framework/utils/UiUtil": void 0,
"../../../common/src/GameCommon": void 0,
"../../../common/src/MsgCache": void 0,
"../../../common/src/advert/AdsManager": void 0,
"../../../common/src/advert/sdk/GameTdd": void 0,
"../../../common/src/data/AchievData": void 0,
"../../../common/src/data/RewardData": void 0,
"../../../common/src/data/UserData": void 0,
"../../../common/src/module/GuideView": void 0,
"../Config": "Config",
"../DebugConfig": "DebugConfig",
"../MapBox": "MapBox",
"../common/GameUtils": "GameUtils",
"../common/PrefabLibrary": "PrefabLibrary",
"../common/ViewController": "ViewController",
"../game/achiev/AchievementToast": "AchievementToast",
"../game/audio/GameAudio": "GameAudio",
"../game/guide/GuideController": "GuideController",
"../game/reward/AdView": "AdView",
"../game/reward/AwardView": "AwardView",
"../game/reward/OnlineReward": "OnlineReward",
"../game/reward/mystery/MysteryButton": "MysteryButton",
"./power/PowerButton": "PowerButton",
"./power/PowerButtonSelector": "PowerButtonSelector",
"./power/SelectedPowerNameTip": "SelectedPowerNameTip"
} ],
UnitAvatarLoader: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "b7c57I9Pg5N7JRGFjNnIopF", "UnitAvatarLoader");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
}), r = this && this.__decorate || function(t, e, i, o) {
var a, r = arguments.length, n = r < 3 ? e : null === o ? o = Object.getOwnPropertyDescriptor(e, i) : o;
if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) n = Reflect.decorate(t, e, i, o); else for (var s = t.length - 1; s >= 0; s--) (a = t[s]) && (n = (r < 3 ? a(n) : r > 3 ? a(e, i, n) : a(e, i)) || n);
return r > 3 && n && Object.defineProperty(e, i, n), n;
};
Object.defineProperty(i, "__esModule", {
value: !0
});
var n, s = t("./ActorAnimationLoader");
(function(t) {
t[t.Body = 0] = "Body";
t[t.Head = 1] = "Head";
t[t.Item = 2] = "Item";
})(n || (n = {}));
var l = cc._decorator, c = l.ccclass, u = (l.property, function(t) {
a(e, t);
function e() {
var e = null !== t && t.apply(this, arguments) || this;
e.avatarSize = 3;
return e;
}
e.prototype.load = function(t) {
if (!t.stats.specialAnimation) {
t.updateAnimation(0, !0);
t.spriteAnimation.forceUpdateFrame();
}
this.node.destroyAllChildren();
this.node.setScale(cc.v3(t.stats.inspectAvatarScale * this.avatarSize, t.stats.inspectAvatarScale * this.avatarSize));
this.showSpritePart(t.spriteRenderer.spriteFrame, t, cc.Vec3.ZERO, n.Body);
if (t.stats.body_separate_part_head) {
var e = t.getAnimationFrameData(), i = cc.v3(0, 9);
if (e) {
i.x = e.posHead.x;
i.y = e.posHead.y;
}
this.showSpritePart(t.s_head_sprite, t, i, n.Head);
}
if (t.isItemRendered()) {
var o = t.getAnimationFrameData(), a = cc.v3(-3.5, 3.5);
if (o) {
a.x = o.posItem.x;
a.y = o.posItem.y;
}
var r = t.getTextureToRenderInHand();
this.showSpritePart(s.default.getItem(r), t, a, n.Item);
}
};
e.prototype.showSpritePart = function(t, e, i, o) {
var a = new cc.Node(), r = a.addComponent(cc.Sprite);
r.spriteFrame = t;
a.width = r.spriteFrame.getRect().width;
a.height = r.spriteFrame.getRect().height;
a.parent = this.node;
a.anchorY = 0;
a.y = i.y;
switch (o) {
case n.Head:
a.anchorY = 1;
"dwarf" == e.race.id && (a.y -= 1);
e.stats.id.includes("santa") && (a.y += 1);
break;

case n.Item:
a.anchorY = .2;
a.x = -3.5;
}
};
return r([ c ], e);
}(cc.Component));
i.default = u;
cc._RF.pop();
}, {
"./ActorAnimationLoader": "ActorAnimationLoader"
} ],
UnitGroupManager: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "7bbf4IVkexIhZSpIgOou2Y7", "UnitGroupManager");
Object.defineProperty(i, "__esModule", {
value: !0
});
i.UnitGroup = void 0;
var o = t("../common/ToolBox"), a = t("./ActorBase"), r = function() {
function t(t) {
this.units = new a.ActorContainer();
this.id = 0;
this.groupLeader = null;
this._prev_leader_position = null;
this.alive = !0;
this.city = null;
this.city = t;
}
t.prototype.clear = function() {
this.units.clear();
this.setGroupLeader(null);
this.alive = !1;
};
t.prototype.disband = function() {
this.units.list.forEach(function(t) {
t.removeFromGroup();
});
this.clear();
};
t.prototype.setGroupLeader = function(t) {
!t && this.groupLeader && this.groupLeader.setGroupLeader(!1);
this.groupLeader = t;
this.groupLeader && this.groupLeader.setGroupLeader(!0);
};
t.prototype.logicUpdate = function() {
var t;
this.units.checkAddRemove();
if (this.groupLeader && !(null === (t = this.groupLeader.data) || void 0 === t ? void 0 : t.alive)) {
this._prev_leader_position = this.groupLeader.currentTile;
this.setGroupLeader(null);
}
this.findGroupLeader();
this.checkDeadUnits();
};
t.prototype.findGroupLeader = function() {
var t = this;
if (this.groupLeader) {
if (this.groupLeader.kingdom.isCiv()) return;
this.setGroupLeader(null);
}
if (0 != this.units.length) if (this._prev_leader_position) {
var e = null, i = 0, a = 0;
this.units.list.forEach(function(r) {
var n;
if (null === (n = r.data) || void 0 === n ? void 0 : n.alive) {
i = o.Toolbox.distTile(r.currentTile, t._prev_leader_position);
if (!e || i < a) {
e = r;
a = i;
}
}
});
e && this.setGroupLeader(e);
} else this.setGroupLeader(this.units.getRandom());
};
t.prototype.checkDeadUnits = function() {
var e = this;
t._units_to_remove.clear();
this.units.list.forEach(function(e) {
var i;
(null === (i = e.data) || void 0 === i ? void 0 : i.alive) || t._units_to_remove.push(e);
});
t._units_to_remove.forEach(function(t) {
e.units.remove(t);
});
};
t.prototype.isAlive = function() {
return this.alive;
};
t.prototype.addUnit = function(t) {
this.units.add(t);
t.unitGroup = this;
};
t.prototype.removeUnit = function(t) {
this.units.remove(t);
};
t.prototype.countUnits = function() {
return this.units.length;
};
t.prototype.getDebug = function() {
var t = this.units.length.toString();
this.groupLeader && (t = t + " " + this.groupLeader.data.firstName + "(" + this.groupLeader.data.age + ")");
return t;
};
t._tiles = [];
t._units_to_remove = [];
return t;
}();
i.UnitGroup = r;
var n = function() {
function t() {
this.last_id = 0;
this.interval_check_dead = 1;
this.timer_check_dead = 1;
this.groups = [];
}
t.prototype.logicUpdate = function(t) {
var e;
if (this.timer_check_dead > 0) this.timer_check_dead -= t; else {
this.timer_check_dead = this.interval_check_dead;
for (var i = 0; i < this.groups.length; ) {
var o = this.groups[i];
o.logicUpdate(t);
if (null === (e = o.city) || void 0 === e ? void 0 : e.alive) i++; else {
o.disband();
this.groups.splice(i, 1);
}
}
}
};
t.prototype.createNewGroup = function(t) {
var e = new r(t);
e.id = this.last_id++;
this.groups.push(e);
return e;
};
t.prototype.clear = function() {
this.groups.forEach(function(t) {
t.clear();
});
this.groups.clear();
};
return t;
}();
i.default = n;
cc._RF.pop();
}, {
"../common/ToolBox": "ToolBox",
"./ActorBase": "ActorBase"
} ],
UnitLayer: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "42c59avz7hKtb7BGS075khe", "UnitLayer");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
}), r = this && this.__decorate || function(t, e, i, o) {
var a, r = arguments.length, n = r < 3 ? e : null === o ? o = Object.getOwnPropertyDescriptor(e, i) : o;
if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) n = Reflect.decorate(t, e, i, o); else for (var s = t.length - 1; s >= 0; s--) (a = t[s]) && (n = (r < 3 ? a(n) : r > 3 ? a(e, i, n) : a(e, i)) || n);
return r > 3 && n && Object.defineProperty(e, i, n), n;
}, n = this && this.__values || function(t) {
var e = "function" == typeof Symbol && Symbol.iterator, i = e && t[e], o = 0;
if (i) return i.call(t);
if (t && "number" == typeof t.length) return {
next: function() {
t && o >= t.length && (t = void 0);
return {
value: t && t[o++],
done: !t
};
}
};
throw new TypeError(e ? "Object is not iterable." : "Symbol.iterator is not defined.");
};
Object.defineProperty(i, "__esModule", {
value: !0
});
var s = t("../../common/ToolBox"), l = t("../../MapBox"), c = t("../map/MapLayer"), u = cc._decorator, d = u.ccclass, h = (u.property, 
function(t) {
a(e, t);
function e() {
var e = null !== t && t.apply(this, arguments) || this;
e.prevTiles = [];
e.interval = .1;
e.dead = cc.color(0, 0, 0, 127.5);
return e;
}
e.prototype.onLoad = function() {
this.dead = s.Toolbox.makeColor("#393939");
t.prototype.create.call(this);
};
e.prototype.clear = function() {
this.prevTiles.clear();
t.prototype.clear.call(this);
};
e.prototype.updateDirty = function(t) {
var e, i, o, a = this;
if (this.timer > 0) this.timer -= t; else {
this.timer = this.interval;
this.prevTiles.forEach(function(t) {
a.updateSinglePixel(t.data.tile_id, cc.Color.TRANSPARENT);
});
this.prevTiles.clear();
try {
for (var r = n(l.default.inst.units.list), s = r.next(); !s.done; s = r.next()) {
var c = s.value;
if (c.stats && c.stats.hideOnMinimap && 0 != c.stats.color.a && !c.insideBuilding) {
this.prevTiles.push(c.currentTile);
c.currentTile && ((null === (o = c.data) || void 0 === o ? void 0 : o.alive) ? (c.stats.isBoat || c.stats.unit) && c.kingdom && c.kingdom.isCiv() ? c.stats.drawBoatMark || this.updateSinglePixel(c.currentTile.data.tile_id, c.kingdom.kingdomColor.colorBorderInside) : this.updateSinglePixel(c.currentTile.data.tile_id, c.stats.color) : this.updateSinglePixel(c.currentTile.data.tile_id, this.dead));
}
}
} catch (t) {
e = {
error: t
};
} finally {
try {
s && !s.done && (i = r.return) && i.call(r);
} finally {
if (e) throw e.error;
}
}
this.updatePixels();
}
};
return r([ d ], e);
}(c.default));
i.default = h;
cc._RF.pop();
}, {
"../../MapBox": "MapBox",
"../../common/ToolBox": "ToolBox",
"../map/MapLayer": "MapLayer"
} ],
UnitSelectionEffect: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "d0effFwJzNNCZU1bFyUSOD/", "UnitSelectionEffect");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
}), r = this && this.__decorate || function(t, e, i, o) {
var a, r = arguments.length, n = r < 3 ? e : null === o ? o = Object.getOwnPropertyDescriptor(e, i) : o;
if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) n = Reflect.decorate(t, e, i, o); else for (var s = t.length - 1; s >= 0; s--) (a = t[s]) && (n = (r < 3 ? a(n) : r > 3 ? a(e, i, n) : a(e, i)) || n);
return r > 3 && n && Object.defineProperty(e, i, n), n;
};
Object.defineProperty(i, "__esModule", {
value: !0
});
var n = t("../base/BaseAnimatedObject"), s = t("../common/Globals"), l = t("../MapBox"), c = cc._decorator, u = c.ccclass, d = (c.property, 
function(t) {
a(e, t);
function e() {
return null !== t && t.apply(this, arguments) || this;
}
e.prototype.create = function() {
t.prototype.create.call(this);
this.node.parent = l.default.inst.node;
this.node.name = "unit_selector_effect";
};
e.prototype.logicUpdate = function(e) {
t.prototype.update.call(this, e);
var i = !0, o = null;
l.default.inst.qualityChanger.lowRes && (i = !1);
i && (i = !!(o = l.default.inst.getActorNearCursor()));
if (i) {
this.node.active = !0;
this.node.position = o.currentPosition;
this.node.scale = o.node.scale;
} else {
this.node.active = !1;
this.node.position = s.default.POINT_IN_VOID;
}
};
return r([ u ], e);
}(n.default));
i.default = d;
cc._RF.pop();
}, {
"../MapBox": "MapBox",
"../base/BaseAnimatedObject": "BaseAnimatedObject",
"../common/Globals": "Globals"
} ],
UnitSpawner: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "fe8b8tUHDZBVJw1KNKG5v5+", "UnitSpawner");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
});
Object.defineProperty(i, "__esModule", {
value: !0
});
var r = t("../base/BaseBuilding"), n = t("../MapBox"), s = function(t) {
a(e, t);
function e() {
var e = null !== t && t.apply(this, arguments) || this;
e.units_current = 0;
e.units_limit = 5;
e.spawnInterval = 10;
e.spawnTimer = 1;
e.spawnActions = [];
return e;
}
e.prototype.logicUpdate = function(e) {
t.prototype.logicUpdate.call(this, e);
if (this.spawnTimer > 0) this.spawnTimer -= e; else {
this.spawnTimer = this.spawnInterval;
this.spawnUnit();
}
};
e.prototype.spawnUnit = function() {
if (this.units_current < this.units_limit) {
var t = this.building.stats.spawnUnits_asset, e = n.default.inst.createNewUnit(t, this.building.currentTile);
this.setUnitFromHere(e);
}
};
e.prototype.setUnitFromHere = function(t) {
t.setHomeBuilding(this.building);
t.callbacks_on_death.push(this.callbackUnitDied.bind(this));
this.units_current++;
this.spawnActions.forEach(function(e) {
e(t);
});
};
e.prototype.callbackUnitDied = function() {
this.units_current--;
};
return e;
}(r.BaseBuildingComponent);
i.default = s;
cc._RF.pop();
}, {
"../MapBox": "MapBox",
"../base/BaseBuilding": "BaseBuilding"
} ],
UnitSpriteAnimation: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "46d44Q6iExGoaKL/8qmjOHN", "UnitSpriteAnimation");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
}), r = this && this.__decorate || function(t, e, i, o) {
var a, r = arguments.length, n = r < 3 ? e : null === o ? o = Object.getOwnPropertyDescriptor(e, i) : o;
if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) n = Reflect.decorate(t, e, i, o); else for (var s = t.length - 1; s >= 0; s--) (a = t[s]) && (n = (r < 3 ? a(n) : r > 3 ? a(e, i, n) : a(e, i)) || n);
return r > 3 && n && Object.defineProperty(e, i, n), n;
};
Object.defineProperty(i, "__esModule", {
value: !0
});
i.UnitSpriteAnimation = i.UnitSpriteAnimationData = i.AnimationDataBoat = i.AnimationDataUnit = i.ActorAnimation = i.AnimationFrameData = void 0;
var n = t("../actors/Actor"), s = t("../MapBox"), l = t("../texture/TextureLoader"), c = t("./ActorAnimationLoader"), u = t("./SpriteAnimation");
i.AnimationFrameData = function() {
this.id = "";
this.posHead = cc.Vec2.ZERO;
this.posItem = cc.Vec2.ZERO;
this.showHead = !0;
this.showItem = !0;
};
i.ActorAnimation = function() {
this.frames = [];
this.timeBetweenFrames = .5;
};
i.AnimationDataUnit = function() {
this.id = "";
this.sprites = new Map();
this.frameData = new Map();
this.walking = null;
this.swimming = null;
this.heads = [];
};
i.AnimationDataBoat = function() {
this.id = "";
this.dict = new Map();
this.broken = null;
this.normal = null;
};
i.UnitSpriteAnimationData = function() {
this.head = cc.Vec2.ZERO;
this.item = cc.Vec2.ZERO;
this.backpack = cc.Vec2.ZERO;
this.showHead = !0;
this.showItem = !0;
};
var d = cc._decorator, h = d.ccclass, p = d.property, f = function(t) {
a(e, t);
function e() {
var e = null !== t && t.apply(this, arguments) || this;
e.shadow = null;
e.actor = null;
e.head = null;
e.item = null;
e.banner = null;
e.favorite = null;
return e;
}
i = e;
e.prototype.onLoad = function() {
t.prototype.create.call(this);
this.actor = this.node.parent.getComponent(n.default);
};
e.prototype.update = function() {
this.actor && this.updateShadow();
};
e.prototype.updateFrame = function() {
var e;
t.prototype.updateFrame.call(this);
if (this.actor && this.currentSpriteGraphic && this.actor._is_visible && !s.default.inst.qualityChanger.lowRes) {
var i = this.currentSpriteGraphic.name.substr(this.currentSpriteGraphic.name.length - 6), o = this.actor.actorAnimationData.frameData.get(i);
if (o) {
this.actor.frameData = o;
this.updateHead();
if (null === (e = this.actor.data) || void 0 === e ? void 0 : e.alive) {
this.updateItem();
this.updateBanner();
this.updateFavoriteIcon();
}
}
}
};
e.prototype.updateHead = function() {
var t = this.actor.getAnimationFrameData();
if (t && this.actor.stats.body_separate_part_head) {
this.head = this.head ? this.head : this.getHead();
this.head.parent = this.actor.node;
this.head.y = t.posHead.y;
"dwarf" == this.actor.race.id && (this.head.y -= 1);
this.actor.stats.id.includes("santa") && (this.head.y += 1);
this.head.getComponent(cc.Sprite).spriteFrame = this.actor.s_head_sprite;
} else if (this.head) {
this.head.color = cc.Color.WHITE;
this.head.opacity = 255;
i.headsPool.put(this.head);
this.head = null;
}
};
e.prototype.updateShadow = function() {
this.shadow.active = this.actor.stats.shadow;
this.actor.isInAir() ? this.shadow.y = -7 : this.shadow.y = 10 * -(this.actor.node.y - this.actor.currentPosition.y);
};
e.prototype.updateItem = function() {
var t = !1;
this.actor.ai.task && this.actor.ai.task.force_item_sprite && (t = !0);
var e = this.actor.getAnimationFrameData();
if ((t || this.actor.s_weapon_texture) && this.actor.isItemRendered() && e) {
this.item = this.item ? this.item : this.getItem();
this.item.parent = this.actor.node;
this.item.y = e.posItem.y;
this.item.getComponent(cc.Sprite).spriteFrame = c.default.getItem(this.actor.getTextureToRenderInHand());
} else if (this.item) {
this.item.color = cc.Color.WHITE;
this.item.opacity = 255;
i.itemsPool.put(this.item);
this.item = null;
}
};
e.prototype.updateBanner = function() {
var t, e, o = this.actor.getAnimationFrameData();
if (this.actor.isGroupLeader && (null === (t = this.actor.kingdom) || void 0 === t ? void 0 : t.isCiv()) && (null === (e = this.actor.kingdom) || void 0 === e ? void 0 : e.kingdomColor) && o) {
this.banner = this.banner ? this.banner : this.getBanner();
this.banner.parent = this.head;
this.banner.color = this.actor.kingdom.kingdomColor.colorBorderOut;
} else if (this.banner) {
i.bannersPool.put(this.banner);
this.banner = null;
}
};
e.prototype.updateFavoriteIcon = function() {
if (this.actor.data.favorite && !this.actor.stats.hideFavoriteIcon) {
this.favorite = this.favorite ? this.favorite : this.getFavorite();
this.favorite.parent = this.head;
} else if (this.favorite) {
i.favoritesPool.put(this.favorite);
this.favorite = null;
}
};
e.prototype.getBanner = function() {
var t = i.bannersPool.get();
if (!t) {
(t = new cc.Node("banner")).anchorY = 0;
var e = l.TextureLoader.inst.getSpriteFrame(l.ATLAS_TYPE.WORLDATLAS, "actors/races/civ_army_banner");
t.addComponent(cc.Sprite).spriteFrame = e;
}
return t;
};
e.prototype.getHead = function() {
var t = i.headsPool.get();
if (!t) {
(t = new cc.Node("head")).addComponent(cc.Sprite);
t.anchorY = 1;
}
return t;
};
e.prototype.getItem = function() {
var t = i.itemsPool.get();
if (!t) {
(t = new cc.Node("item")).addComponent(cc.Sprite);
t.anchorY = .2;
t.x = -3.5;
}
return t;
};
e.prototype.getFavorite = function() {
var t = i.favoritesPool.get();
if (!t) {
(t = new cc.Node("favorite")).anchorY = 0;
var e = l.TextureLoader.inst.getSpriteFrame(l.ATLAS_TYPE.UIATLAS, "icons/iconFavoriteStar");
t.addComponent(cc.Sprite).spriteFrame = e;
}
return t;
};
var i;
e.itemsPool = new cc.NodePool();
e.headsPool = new cc.NodePool();
e.bannersPool = new cc.NodePool();
e.favoritesPool = new cc.NodePool();
r([ p(cc.Node) ], e.prototype, "shadow", void 0);
return i = r([ h ], e);
}(u.SpriteAnimation);
i.UnitSpriteAnimation = f;
cc._RF.pop();
}, {
"../MapBox": "MapBox",
"../actors/Actor": "Actor",
"../texture/TextureLoader": "TextureLoader",
"./ActorAnimationLoader": "ActorAnimationLoader",
"./SpriteAnimation": "SpriteAnimation"
} ],
UnitZones: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "50bf1wt/KdK+Y8vYW32RiiN", "UnitZones");
Object.defineProperty(i, "__esModule", {
value: !0
});
var o = t("../../building/Docks"), a = t("../../MapBox"), r = function() {
function t() {
this.timer = 0;
this.interval = 1;
this.chunks = [];
this.tiles = [];
}
t.prototype.logicUpdate = function() {
if (this.timer > 0) this.timer -= cc.director.getDeltaTime(); else {
this.timer = this.interval;
this.recalc();
}
};
t.prototype.clear = function() {
a.default.inst.citiesList.forEach(function(t) {
t.clearCurrentCaptureAmounts();
});
this.tiles.forEach(function(t) {
t.clearUnits();
});
a.default.inst.islandsCalculator.islands.forEach(function(t) {
t.docks.clear();
});
this.chunks.forEach(function(t) {
t.clearObjects();
});
this.chunks.clear();
this.tiles.clear();
};
t.prototype.addUnit = function(t, e) {
0 == e.units.length && this.tiles.push(e);
e.units.push(t);
t.professionAsset.can_capture && e.zone.city && !t.isInsideSomething() && e.zone.city.updateConquest(t);
};
t.prototype.recalc = function() {
var t = this;
this.clear();
a.default.inst.units.list.forEach(function(e) {
var i;
if ((null === (i = null == e ? void 0 : e.data) || void 0 === i ? void 0 : i.alive) && (null == e ? void 0 : e.kingdom)) {
var o = e.currentTile.chunk;
0 == o.k_dict_objects.size && t.chunks.push(o);
t.addUnit(e, e.currentTile);
o.addObject(e);
}
});
a.default.inst.buildings.list.forEach(function(e) {
var i, a;
if (null === (i = e.data) || void 0 === i ? void 0 : i.alive) {
e._is_visible;
(null === (a = e.stats) || void 0 === a ? void 0 : a.docks) && e.getComponent(o.default).tiles_water.length > 0 && e.getComponent(o.default).tiles_water[0].region.island.docks.push(e.getComponent(o.default));
var r = e.currentTile.chunk;
0 == r.k_dict_objects.size && t.chunks.push(r);
r.addObject(e);
}
});
};
return t;
}();
i.default = r;
cc._RF.pop();
}, {
"../../MapBox": "MapBox",
"../../building/Docks": "Docks"
} ],
UnusedLibrary: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "bf77a7qVk1BNqlB07vaeX9V", "UnusedLibrary");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
}), r = this && this.__decorate || function(t, e, i, o) {
var a, r = arguments.length, n = r < 3 ? e : null === o ? o = Object.getOwnPropertyDescriptor(e, i) : o;
if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) n = Reflect.decorate(t, e, i, o); else for (var s = t.length - 1; s >= 0; s--) (a = t[s]) && (n = (r < 3 ? a(n) : r > 3 ? a(e, i, n) : a(e, i)) || n);
return r > 3 && n && Object.defineProperty(e, i, n), n;
}, n = this && this.__values || function(t) {
var e = "function" == typeof Symbol && Symbol.iterator, i = e && t[e], o = 0;
if (i) return i.call(t);
if (t && "number" == typeof t.length) return {
next: function() {
t && o >= t.length && (t = void 0);
return {
value: t && t[o++],
done: !t
};
}
};
throw new TypeError(e ? "Object is not iterable." : "Symbol.iterator is not defined.");
};
Object.defineProperty(i, "__esModule", {
value: !0
});
var s = t("../actors/other/dragon/DragonAsset"), l = cc._decorator, c = l.ccclass, u = l.property, d = function(t) {
a(e, t);
function e() {
var e = null !== t && t.apply(this, arguments) || this;
e.atlas = null;
e.actor = [];
e.meteorite = null;
e.dragonAsset = null;
e.zombieDragonAsset = null;
e.loaded = !1;
return e;
}
i = e;
e.prototype.onLoad = function() {
i.inst = this;
};
e.prototype.getActorPrefab = function(t) {
var e, i;
try {
for (var o = n(this.actor), a = o.next(); !a.done; a = o.next()) {
var r = a.value;
if (r.name == t) return r;
}
} catch (t) {
e = {
error: t
};
} finally {
try {
a && !a.done && (i = o.return) && i.call(o);
} finally {
if (e) throw e.error;
}
}
return null;
};
var i;
e.inst = null;
r([ u(cc.SpriteAtlas) ], e.prototype, "atlas", void 0);
r([ u({
type: [ cc.Prefab ],
tooltip: "实例化actor需要的预制"
}) ], e.prototype, "actor", void 0);
r([ u({
type: cc.Prefab,
tooltip: "实例化陨石需要的预制"
}) ], e.prototype, "meteorite", void 0);
r([ u({
type: s.default,
tooltip: "实例化dragon需要的配置"
}) ], e.prototype, "dragonAsset", void 0);
r([ u({
type: s.default,
tooltip: "实例化zombieDragon需要的配置"
}) ], e.prototype, "zombieDragonAsset", void 0);
return i = r([ c ], e);
}(cc.Component);
i.default = d;
cc._RF.pop();
}, {
"../actors/other/dragon/DragonAsset": "DragonAsset"
} ],
ViewController: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "3ec5fcwEC1ALLZrnvI27MEY", "ViewController");
Object.defineProperty(i, "__esModule", {
value: !0
});
i.view_type = void 0;
var o, a = t("../../../../framework/lib/prototype/MathUtils"), r = t("../../../../framework/main/Constants"), n = t("../../../../framework/manager/AdaptMgr"), s = t("../../../../framework/utils/UiUtil"), l = t("../../../common/src/advert/AdsManager"), c = t("../../../common/src/GamePopBase"), u = t("../game/guide/GuideController"), d = t("../ui/UiController");
(function(t) {
t.CreatureInfo = "CreatureInfo";
t.KingdomList = "KingdomList";
t.KingdomWindow = "KingdomWindow";
t.WorldLaws = "WorldLaws";
t.Favorites = "Favorites";
t.CityWindow = "CityWindow";
t.WorldInfo = "WorldInfo";
t.CensusInfo = "CensusInfo";
t.WorldLog = "WorldLog";
t.Setting = "Setting";
t.MapSetting = "MapSetting";
t.UiBrushes = "UiBrushes";
t.GMView = "GMView";
t.SaveWorld = "SaveWorld";
t.Achiev = "Achiev";
t.AwardView = "AwardView";
t.AdView = "AdView";
t.SignIn = "SignIn";
t.InfiniteProp = "InfiniteProp";
t.Mystery = "Mystery";
t.LuckyWheel = "LuckyWheel";
t.BoxGift = "BoxGift";
t.RecordShare = "RecordShare";
t.BoxMonster = "BoxMonster";
t.HtBox = "HtBox";
})(o = i.view_type || (i.view_type = {}));
var h = function() {
function t() {
this.list = [];
this.pbPath = {
HtBox: "res/prefab/ht/HtBox",
CreatureInfo: "res/prefab/ui/info/CreatureInfo",
KingdomList: "res/prefab/ui/info/KingdomList",
KingdomWindow: "res/prefab/ui/info/Kingdom",
WorldLaws: "res/prefab/ui/info/WorldLaws",
Favorites: "res/prefab/ui/info/Favorites",
CityWindow: "res/prefab/ui/info/Village",
WorldInfo: "res/prefab/ui/info/WorldInfo",
CensusInfo: "res/prefab/ui/info/CensusInfo",
WorldLog: "res/prefab/ui/log/WorldLogWindow",
Setting: "res/prefab/ui/setting/Setting",
MapSetting: "res/prefab/ui/setting/MapSetting",
UiBrushes: "res/prefab/ui/setting/UiBrushes",
GMView: "res/prefab/ui/setting/GMView",
SaveWorld: "res/prefab/ui/save/SaveList",
Achiev: "res/prefab/ui/achiev/AchievView",
AwardView: "res/prefab/ui/reward/AwardView",
AdView: "res/prefab/ui/reward/AdView",
SignIn: "res/prefab/ui/reward/SignIn",
InfiniteProp: "res/prefab/ui/reward/InfiniteProp",
Mystery: "res/prefab/ui/reward/MysteryReward",
LuckyWheel: "res/prefab/ui/reward/LuckyWheel",
BoxGift: "res/prefab/ui/reward/BoxGift",
RecordShare: "res/prefab/ui/reward/RecordShare",
BoxMonster: "res/prefab/ui/reward/BoxMonster"
};
}
t.prototype.open = function(t, e, i, h, p, f) {
var m = this;
void 0 === e && (e = null);
void 0 === i && (i = null);
void 0 === h && (h = !1);
void 0 === p && (p = null);
void 0 === f && (f = null);
var y = i ? i instanceof cc.Event ? i.getCurrentTarget() : i.node : null;
if (y) {
var _ = y.getComponent(cc.Button);
_.interactable = !1;
setTimeout(function() {
_.interactable = !0;
}, 1e3);
}
var g = this.list.length > 0 ? this.list[this.list.length - 1] : null;
s.UiUtil.openModule(this.pbPath[t]).then(function(i) {
n.default.adaptScreenScale(i);
if (0 == m.list.length) {
var s = t != o.BoxGift && a.default.randomChance(.4);
(WECHAT_GAME || VIVO_GAME || JSB_OPPO || JSB_VIVO || XIAOMI_GAME || JSB_HUAWEI || JSB_XIAOMI) && s ? setTimeout(function() {
u.default.inst.isGuiding || l.default.showInterstitialAd(function() {});
}, 400) : r.default.FULLVIDEO_SHOW ? setTimeout(function() {
u.default.inst.isGuiding || (JSB_233 ? l.default.showVideoAds(function() {
r.default.FULLVIDEO_SHOW = !1;
r.default.INSERTAD_SHOW = !1;
}, !1) : (JSB_IOS || JSB_MMY) && l.default.showInterstitialAd(function() {
r.default.FULLVIDEO_SHOW = !1;
r.default.INSERTAD_SHOW = !1;
}));
}, 400) : r.default.INSERTAD_SHOW && setTimeout(function() {
u.default.inst.isGuiding || JSB_233 && l.default.showInterstitialAd(function() {
r.default.INSERTAD_SHOW = !1;
if (r.default.FULLVIDEO_SHOW) {
r.default.FULLVIDEO_SHOW = !1;
setTimeout(function() {
r.default.FULLVIDEO_SHOW = !0;
}, 6e4);
}
});
}, 400);
}
p && p(i);
m.list.push(i);
var y = i.getComponent(c.GamePopBase);
y.setCallback(e, function(t) {
var e = m.list.indexOf(i);
m.list.remove(i);
0 == m.list.length ? d.default.inst.bottomMove(!1) : t || (g = m.list[e - 1]) && g.getComponent(c.GamePopBase).move(!1);
f && f();
});
y.open();
g ? h ? g.getComponent(c.GamePopBase).move(!0) : g.getComponent(c.GamePopBase).close(!0) : d.default.inst.bottomMove(!0);
});
};
t.prototype.close = function(t) {
void 0 === t && (t = !1);
for (var e = this.list.length, i = 0; i < e; i++) {
this.list.pop().getComponent(c.GamePopBase).close(!0);
if (!t) break;
}
};
return t;
}();
i.default = new h();
cc._RF.pop();
}, {
"../../../../framework/lib/prototype/MathUtils": void 0,
"../../../../framework/main/Constants": void 0,
"../../../../framework/manager/AdaptMgr": void 0,
"../../../../framework/utils/UiUtil": void 0,
"../../../common/src/GamePopBase": void 0,
"../../../common/src/advert/AdsManager": void 0,
"../game/guide/GuideController": "GuideController",
"../ui/UiController": "UiController"
} ],
WaterHelper: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "9db47BFtPZAarlshbK4w1t7", "WaterHelper");
var o = this && this.__values || function(t) {
var e = "function" == typeof Symbol && Symbol.iterator, i = e && t[e], o = 0;
if (i) return i.call(t);
if (t && "number" == typeof t.length) return {
next: function() {
t && o >= t.length && (t = void 0);
return {
value: t && t[o++],
done: !t
};
}
};
throw new TypeError(e ? "Object is not iterable." : "Symbol.iterator is not defined.");
};
Object.defineProperty(i, "__esModule", {
value: !0
});
var a = t("../map/tile/TileType"), r = t("../MapBox"), n = function() {
function t() {}
t.goodForNewDock = function(e) {
var i;
return !(!e.type.water || null === (i = e.region) || void 0 === i || !i.island || e.region.island.getTileCount() < 2500 || t._water_pools_with_docks.includes(e.region.island));
};
t.saveWaterPoolsWithDocks = function(e) {
e.haveBuildingType("docks") && e.buildings_dict_type.get("docks").forEach(function(e) {
e.tiles.forEach(function(e) {
t.addWaterPool(e);
});
});
};
t.clearWaterPools = function() {
t._water_pools_with_docks.clear();
};
t.addWaterPool = function(e) {
e.region.island && e.region.type == a.TileLayerType.Water && t._water_pools_with_docks.push(e.region.island);
};
t.findTileForBoat = function(e, i) {
var a, n, s, l, c = e.region.island, u = i.region.island;
c.regions.shuffle();
var d = 0, h = t.findTileInRegion(i.region, e);
if (!h) try {
for (var p = o(u.regions), f = p.next(); !f.done; f = p.next()) {
var m = f.value;
if (d++ > 10) break;
if (h = t.findTileInRegion(m, e)) break;
}
} catch (t) {
a = {
error: t
};
} finally {
try {
f && !f.done && (n = p.return) && n.call(p);
} finally {
if (a) throw a.error;
}
}
if (!h) return null;
try {
for (var y = o(h.neighboursAll), _ = y.next(); !_.done; _ = y.next()) {
var g = _.value;
if (g.isSameIsland(e) && g.isGoodForBoat()) {
h = g;
break;
}
}
} catch (t) {
s = {
error: t
};
} finally {
try {
_ && !_.done && (l = y.return) && l.call(y);
} finally {
if (s) throw s.error;
}
}
r.default.inst.flashEffects.flashPixel(h);
return h;
};
t.findTileInRegion = function(t, e) {
var i, a, r = t.getTileCorners();
if (0 == r.length) return null;
r.shuffle();
try {
for (var n = o(r), s = n.next(); !s.done; s = n.next()) {
var l = s.value;
if (l.isSameIsland(e)) return l;
}
} catch (t) {
i = {
error: t
};
} finally {
try {
s && !s.done && (a = n.return) && a.call(n);
} finally {
if (i) throw i.error;
}
}
return null;
};
t._water_pools_with_docks = [];
return t;
}();
i.default = n;
cc._RF.pop();
}, {
"../MapBox": "MapBox",
"../map/tile/TileType": "TileType"
} ],
WaveController: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "cde62YbQuNC5oepQW4/5PsH", "WaveController");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
}), r = this && this.__decorate || function(t, e, i, o) {
var a, r = arguments.length, n = r < 3 ? e : null === o ? o = Object.getOwnPropertyDescriptor(e, i) : o;
if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) n = Reflect.decorate(t, e, i, o); else for (var s = t.length - 1; s >= 0; s--) (a = t[s]) && (n = (r < 3 ? a(n) : r > 3 ? a(e, i, n) : a(e, i)) || n);
return r > 3 && n && Object.defineProperty(e, i, n), n;
}, n = this && this.__values || function(t) {
var e = "function" == typeof Symbol && Symbol.iterator, i = e && t[e], o = 0;
if (i) return i.call(t);
if (t && "number" == typeof t.length) return {
next: function() {
t && o >= t.length && (t = void 0);
return {
value: t && t[o++],
done: !t
};
}
};
throw new TypeError(e ? "Object is not iterable." : "Symbol.iterator is not defined.");
};
Object.defineProperty(i, "__esModule", {
value: !0
});
i.WaveController = void 0;
var s = t("../common/ToolBox"), l = t("../map/tile/TileType"), c = t("../MapBox"), u = t("../natural/Wave"), d = t("./BaseEffectController"), h = cc._decorator, p = h.ccclass, f = (h.property, 
function(t) {
a(e, t);
function e() {
return null !== t && t.apply(this, arguments) || this;
}
e.prototype.onLoad = function() {
t.prototype.create.call(this);
this.timer_interval = .2;
};
e.prototype.spawn = function() {
var t = s.Toolbox.getRandom(c.default.inst.zoneCalculator.zones);
if (t && 0 != t.tilesWithWater) {
var e = s.Toolbox.getRandom(t.tiles);
e.type.layerType == l.TileLayerType.Water && this.getObject().prepare(e, .25);
}
};
e.prototype.checkTile = function(t, e) {
var i, o;
try {
for (var a = n(this.list), r = a.next(); !r.done; r = a.next()) {
var l = r.value;
if (!(s.Toolbox.dist(l.x, l.y, t.pos.x, t.pos.y) > e)) {
var c = l.getComponent(u.default);
this.killObject(c);
break;
}
}
} catch (t) {
i = {
error: t
};
} finally {
try {
r && !r.done && (o = a.return) && o.call(a);
} finally {
if (i) throw i.error;
}
}
};
return r([ p ], e);
}(d.default));
i.WaveController = f;
cc._RF.pop();
}, {
"../MapBox": "MapBox",
"../common/ToolBox": "ToolBox",
"../map/tile/TileType": "TileType",
"../natural/Wave": "Wave",
"./BaseEffectController": "BaseEffectController"
} ],
Wave: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "8f03aIzru1PO6PRovhhVHT6", "Wave");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
}), r = this && this.__decorate || function(t, e, i, o) {
var a, r = arguments.length, n = r < 3 ? e : null === o ? o = Object.getOwnPropertyDescriptor(e, i) : o;
if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) n = Reflect.decorate(t, e, i, o); else for (var s = t.length - 1; s >= 0; s--) (a = t[s]) && (n = (r < 3 ? a(n) : r > 3 ? a(e, i, n) : a(e, i)) || n);
return r > 3 && n && Object.defineProperty(e, i, n), n;
};
Object.defineProperty(i, "__esModule", {
value: !0
});
var n = t("../base/BaseEffect"), s = cc._decorator, l = s.ccclass, c = (s.property, 
function(t) {
a(e, t);
function e() {
var e = null !== t && t.apply(this, arguments) || this;
e.timer = 0;
return e;
}
e.prototype.update = function(t) {
if (this.timer > 0) this.timer -= t; else {
this.timer = .6;
this.tile && (this.tile = this.tile.tile_up);
}
};
e.prototype.waveEnd = function() {
this.controller.killObject(this);
};
return r([ l ], e);
}(n.default));
i.default = c;
cc._RF.pop();
}, {
"../base/BaseEffect": "BaseEffect"
} ],
Wheat: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "7747dVK97hLtbRsn9xBFsxK", "Wheat");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
});
Object.defineProperty(i, "__esModule", {
value: !0
});
var r = function(t) {
a(e, t);
function e() {
var e = null !== t && t.apply(this, arguments) || this;
e.timerGrow = 0;
e.GROW_INTERVAL = 30;
return e;
}
e.prototype.create = function() {
t.prototype.create.call(this);
this.timerGrow = this.GROW_INTERVAL;
};
e.prototype.logicUpdate = function(t) {
this.timerGrow > 0 ? this.timerGrow -= t : this.growWheat();
};
e.prototype.growWheat = function() {
this.building.upgradeBulding();
this.timerGrow = this.GROW_INTERVAL;
};
return e;
}(t("../base/BaseBuilding").BaseBuildingComponent);
i.default = r;
cc._RF.pop();
}, {
"../base/BaseBuilding": "BaseBuilding"
} ],
WorldAction: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "f3f79RjlxdCc6aBMPsrJdTn", "WorldAction");
Object.defineProperty(i, "__esModule", {
value: !0
});
var o = function() {
function t() {
this.list = [];
}
t.create = function() {
return new t();
};
Object.defineProperty(t.prototype, "isEmpty", {
get: function() {
return 0 == this.list.length;
},
enumerable: !1,
configurable: !0
});
t.prototype.clear = function() {
this.list = [];
};
t.prototype.add = function(t) {
this.list.push(t);
};
t.prototype.do = function(t, e) {
void 0 === t && (t = null);
void 0 === e && (e = null);
var i = !1;
this.list.forEach(function(o) {
o(t, e) && (i = !0);
});
return i;
};
return t;
}();
i.default = o;
cc._RF.pop();
}, {} ],
WorldBehaviour: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "b39d0sJmSBMtJ5hjlhWDLYb", "WorldBehaviour");
var o = this && this.__values || function(t) {
var e = "function" == typeof Symbol && Symbol.iterator, i = e && t[e], o = 0;
if (i) return i.call(t);
if (t && "number" == typeof t.length) return {
next: function() {
t && o >= t.length && (t = void 0);
return {
value: t && t[o++],
done: !t
};
}
};
throw new TypeError(e ? "Object is not iterable." : "Symbol.iterator is not defined.");
};
Object.defineProperty(i, "__esModule", {
value: !0
});
i.WorldBehaviourInfo = void 0;
var a = t("../../../common/src/GameCommon"), r = t("../assetLibrary/AssetManager"), n = t("../common/ToolBox"), s = t("../map/map/MapLayer"), l = t("../map/tile/TileDictionary"), c = t("../map/tile/TileType"), u = t("../map/tile/TileTypeShortcut"), d = t("../MapBox"), h = function() {
function t() {
this.dirtyLast = 0;
this.dirty = 0;
this.water = 0;
this.soil = 0;
this.trees = 0;
this.fire = 0;
this.burned_tiles = 0;
this.freeze = "?";
this.unfreeze = "?";
}
t.prototype.logicUpdate = function() {
this.dirtyLast = d.default.inst.dirtyTilesLast;
this.dirty = d.default.inst.tilesDirty.size;
this.water = d.default.inst.behavioursDict.get("water").tileDictionary.length();
this.soil = d.default.inst.behavioursDict.get("soil").tileDictionary.length();
this.trees = d.default.inst.behavioursDict.get("trees").tileDictionary.length();
this.fire = d.default.inst.behavioursDict.get("fire").tileDictionary.length();
this.burned_tiles = d.default.inst.behavioursDict.get("burned_tiles").tileDictionary.length();
this.freeze = d.default.inst.behavioursDict.get("freeze").tileDictionary.length() + " " + d.default.inst.behavioursDict.get("freeze").tileDict2.length();
this.unfreeze = d.default.inst.behavioursDict.get("unfreeze").tileDictionary.length() + " " + d.default.inst.behavioursDict.get("unfreeze").tileDict2.length();
};
return t;
}();
i.WorldBehaviourInfo = h;
var p = function() {
function t(t, e) {
this.timer = 0;
this.interval = 0;
this.ignorePause = !0;
this.action = null;
this.post_action = null;
this.list = [];
this.tileDict2 = null;
this.tileDictionary = null;
this.dirtyList = !1;
this.ticksGrass = 0;
this.indexInList = 0;
this.last_used_regions = new Set();
this.ticks_to_clear = 10;
this.tiles_to_update = [];
this.interval = t;
this.timer = t;
switch (e) {
case "disasters":
this.action = this.updateDisasters;
this.ignorePause = !1;
break;

case "animal_spawn":
this.action = this.updateAnimalSpawn;
this.ignorePause = !1;
break;

case "erosion":
this.action = this.updateErosion;
this.ignorePause = !1;
break;

case "water":
this.action = this.updateWater;
this.ignorePause = !1;
break;

case "trees":
this.action = this.growTrees;
this.ignorePause = !1;
break;

case "soil":
this.action = this.updateGrass;
this.ignorePause = !1;
break;

case "zones":
this.ignorePause = !1;
this.action = this.updateZones;
break;

case "fire":
this.ignorePause = !1;
this.action = this.updateFire;
break;

case "burned_tiles":
this.ignorePause = !1;
this.action = this.updateBurnedTiles;
}
this.tileDictionary = new l.TileDictionary();
this.tileDict2 = new l.TileDictionary();
}
t.init = function() {};
t.prototype.clear = function() {
this.timer = this.interval;
this.tileDict2.clear();
this.tileDictionary.clear();
this.list = [];
this.last_used_regions.clear();
};
t.prepare = function() {};
t.prototype.addTile = function(t, e) {
void 0 === e && (e = !1);
this.tileDictionary.add(t);
e && (this.dirtyList = !0);
};
t.prototype.removeTile = function(t, e) {
void 0 === e && (e = !1);
this.tileDictionary.remove(t);
};
t.prototype.updateErosion = function() {
if (d.default.inst.worldLaws.world_law_erosion.boolVal) {
this.list = [];
d.default.inst.islandsCalculator.islands.shuffle();
for (var t = 0; t < d.default.inst.islandsCalculator.islands.length; t++) {
var e = d.default.inst.islandsCalculator.islands[t];
if (0 == e.type) {
for (var i = 0; i < 5; i++) {
var o = e.getRandomTile();
o && (o.type.canGrowGreens || o.type.grass) && o.isWaterAround() && !this.list.includes(o) && this.list.push(o);
}
if (this.list.length > 5) break;
}
}
if (0 != this.list.length) {
this.list.shuffle();
for (i = 0; i < 5 && i < this.list.length; i++) {
var a = this.list[i];
d.default.inst.terraformTile2(a, u.default.sand, r.default.terraform.get("flash"));
}
}
}
};
t.prototype.logicUpdate = function(t) {
if (!a.default.isPaused || this.ignorePause) {
this.post_action && this.post_action();
if (this.timer > 0) {
this.timer -= t;
return;
}
this.timer = this.interval;
this.action();
}
};
t.prototype.updateBurnedTiles = function() {
var e, i, a, r;
this.timer = n.Toolbox.randomFloat(.01, .1);
this.tiles_to_update = [];
t._tempIslands = [];
d.default.inst.islandsCalculator.islands.forEach(function(e) {
e.type != c.TileLayerType.Water && t._tempIslands.push(e);
});
try {
for (var s = o(t._tempIslands), l = s.next(); !l.done; l = s.next()) for (var u = l.value, h = 0; h < 3; h++) {
t._region = u.regions.getRandom();
if (!(d.default.inst.gameStats.gameTime - t._region.lastBurnedUpdate < .5)) {
t._region.lastBurnedUpdate = d.default.inst.gameStats.gameTime;
t._region.tiles.shuffle();
try {
for (var p = (a = void 0, o(t._region.tiles)), f = p.next(); !f.done; f = p.next()) {
var m = f.value;
if (!m.data.fire && !n.Toolbox.randomBool()) if (m.burned_stages > 1) {
m.burned_stages--;
d.default.inst.burnedLayer.setTileDirty(m);
0 == m.burned_stages && this.tiles_to_update.push(m);
} else {
m.burned_stages = 0;
this.tiles_to_update.push(m);
d.default.inst.burnedLayer.setTileDirty(m);
}
}
} catch (t) {
a = {
error: t
};
} finally {
try {
f && !f.done && (r = p.return) && r.call(p);
} finally {
if (a) throw a.error;
}
}
}
}
} catch (t) {
e = {
error: t
};
} finally {
try {
l && !l.done && (i = s.return) && i.call(s);
} finally {
if (e) throw e.error;
}
}
};
t.prototype.updateFire = function() {
0 != this.tileDictionary.dict.size && this.tileDictionary.dict.forEach(function(t, e) {
e.data.fire_stage > 9 && e.neighbours.forEach(function(t) {
n.Toolbox.randomChance(t.type.fireChance) && t.setFire() && d.default.inst.flashEffects.flashPixel(t, 10);
});
!e.building && e.data.fire_stage % 15 == 0 && Math.random() > .9 && d.default.inst.particlesFire.spawn(e.pos.x, e.pos.y);
e.data.fire_stage++;
d.default.inst.setTileDirty(e);
d.default.inst.fireLayer.setTileDirty(e);
e.data.fire_stage >= 20 && e.stopFire(!0);
});
};
t.prototype.updateGrass = function() {
var e = this;
if (d.default.inst.worldLaws.world_law_grow_grass.boolVal) {
t._tempIslands = [];
this._limit = 0;
d.default.inst.islandsCalculator.islands.forEach(function(e) {
e.type == c.TileLayerType.Ground && t._tempIslands.push(e);
});
t._regions_to_add = [];
var i = !1;
this.last_used_regions.forEach(function(t) {
e._limit = 0;
e.tryToGrowGrassOnRegion(t, !0) && (i = !0);
});
i ? this.ticks_to_clear = 5 : this.ticks_to_clear--;
if (this.ticks_to_clear <= 0 || this.last_used_regions.size > 100) {
this.ticks_to_clear = 5;
this.last_used_regions.clear;
t._regions_to_add = [];
}
var o = 1;
t._tempIslands.forEach(function(i) {
e._limit = 0;
(o = i.regions.length / 10 + 1) > 5 && (o = 5);
for (var a = 0; a < o; a++) {
t._region = i.regions.getRandom();
e.tryToGrowGrassOnRegion(t._region);
}
});
t._regions_to_add.forEach(function(t) {
e.last_used_regions.add(t);
});
}
};
t.prototype.tryToGrowGrassOnRegion = function(e, i) {
var a, r, s, l;
void 0 === i && (i = !1);
if (d.default.inst.gameStats.gameTime - e.lastGrassGrowth < .5) return !1;
e.lastGrassGrowth = d.default.inst.gameStats.gameTime;
t._region.tiles.shuffle();
var c = !1;
try {
for (var u = o(e.tiles), h = u.next(); !h.done; h = u.next()) {
var p = h.value;
if (!(!p.type.canGrowGreens || p.burned_stages > 0 || n.Toolbox.randomBool())) {
var f = 0;
try {
for (var m = (s = void 0, o(p.neighbours)), y = m.next(); !y.done; y = m.next()) if (y.value.type.grass) {
f++;
break;
}
} catch (t) {
s = {
error: t
};
} finally {
try {
y && !y.done && (l = m.return) && l.call(m);
} finally {
if (s) throw s.error;
}
}
if (0 != f) if (p.grassTicksBeforeGrowth > 0) p.grassTicksBeforeGrowth--; else {
c = !0;
p.neighbours.forEach(function(e) {
t._regions_to_add.push(e.region);
});
t._regions_to_add.push(p.region);
d.default.inst.growGreens(p);
if (this._limit++ > 3 || i) return c;
}
}
}
} catch (t) {
a = {
error: t
};
} finally {
try {
h && !h.done && (r = u.return) && r.call(u);
} finally {
if (a) throw a.error;
}
}
return c;
};
t.prototype.updateZones = function() {
d.default.inst.zoneCalculator.zones.shuffle();
var t = d.default.inst.zoneCalculator.zones[0];
if (t && !t.city && !n.Toolbox.randomBool()) {
t.tiles.shuffle();
for (var e = 0; e < 64; e++) {
var i = t.tiles[e];
i && i.type && i.type.road && !n.Toolbox.randomBool() && d.default.inst.decreaseTile(i);
}
}
};
t.prototype.updateDisasters = function() {
var t = r.default.disasters.getRandomAssetFromPool();
t && n.Toolbox.randomChance(t.chance) && (null == t || t.action(t));
};
t.prototype.updateAnimalSpawn = function() {
if (d.default.inst.worldLaws.world_law_animals_spawn.boolVal && 0 != d.default.inst.mapChunkManager.list.length) {
var t = d.default.inst.mapChunkManager.list.getRandom();
if (0 != t.regions.length) {
var e = t.regions.getRandom();
if (!(e.island.regions.length < 5)) {
var i = e.tiles.getRandom();
if (0 != i.type.spawnCreatures.length) {
var o = i.building && i.building.isNonUsable() && i.building.stats.spawnRats ? r.default.unitStats.get(r.default.unitStats.spawnInRuins.getRandom()) : r.default.unitStats.get(i.type.spawnCreatures.getRandom());
if (o && o.currentAmount <= o.maxRandomAmount) {
d.default.inst.getObjectsInChunks(i, 0, s.MapObjectType.Actor);
d.default.inst.temp_map_objects.length <= 3 && d.default.inst.createNewUnit(o.id, i);
}
}
}
}
}
};
t.prototype.growTrees = function() {
if (d.default.inst.worldLaws.world_law_grow_trees.boolVal) {
t._tempIslands = [];
d.default.inst.islandsCalculator.islands.forEach(function(e) {
e.type == c.TileLayerType.Ground && t._tempIslands.push(e);
});
var e = 0;
t._tempIslands.forEach(function(i) {
var a, r;
t._region = i.regions.getRandom();
(e = i.regions.length / 20 + 1) > 3 && (e = 3);
t._region.tiles.shuffle();
for (var s = 0; s < e; s++) try {
for (var l = (a = void 0, o(t._region.tiles)), c = l.next(); !c.done; c = l.next()) {
var u = c.value;
if (!u.data.fire && u.type.autoGrowPlants && !n.Toolbox.randomBool() && u.zone.trees.size < 3) {
d.default.inst.tryGrowPlant(u);
break;
}
}
} catch (t) {
a = {
error: t
};
} finally {
try {
c && !c.done && (r = l.return) && r.call(l);
} finally {
if (a) throw a.error;
}
}
});
}
};
t.prototype.updateWater = function() {
var t, e, i = this;
if (0 != this.tileDictionary.dict.size) {
this.tiles_to_update = [];
this.tileDictionary.dict.forEach(function(t, e) {
e.world_edge ? n.Toolbox.randomInt(0, 100) < 30 || i.tiles_to_update.push(e) : !e.isWaterAround() || n.Toolbox.randomInt(0, 100) < 30 || i.tiles_to_update.push(e);
});
try {
for (var a = o(this.tiles_to_update), r = a.next(); !r.done; r = a.next()) {
var s = r.value;
if (s.type.canBeFilled) {
if (s.type.explodableByWater) {
d.default.inst.explosionLayer.explodeBomb(s);
continue;
}
d.default.inst.setWater(s);
this.tileDict2.remove(s, !1);
}
}
} catch (e) {
t = {
error: e
};
} finally {
try {
r && !r.done && (e = a.return) && e.call(a);
} finally {
if (t) throw t.error;
}
}
}
};
t.prototype.getTileFromList = function(t) {
return t.length > 0 ? t.pop() : null;
};
t._tempIslands = [];
t._region = null;
t._regions_to_add = [];
return t;
}();
i.default = p;
cc._RF.pop();
}, {
"../../../common/src/GameCommon": void 0,
"../MapBox": "MapBox",
"../assetLibrary/AssetManager": "AssetManager",
"../common/ToolBox": "ToolBox",
"../map/map/MapLayer": "MapLayer",
"../map/tile/TileDictionary": "TileDictionary",
"../map/tile/TileType": "TileType",
"../map/tile/TileTypeShortcut": "TileTypeShortcut"
} ],
WorldInfoWindow: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "08b744jgOhFPrCLefVSpCHW", "WorldInfoWindow");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
}), r = this && this.__decorate || function(t, e, i, o) {
var a, r = arguments.length, n = r < 3 ? e : null === o ? o = Object.getOwnPropertyDescriptor(e, i) : o;
if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) n = Reflect.decorate(t, e, i, o); else for (var s = t.length - 1; s >= 0; s--) (a = t[s]) && (n = (r < 3 ? a(n) : r > 3 ? a(e, i, n) : a(e, i)) || n);
return r > 3 && n && Object.defineProperty(e, i, n), n;
}, n = this && this.__values || function(t) {
var e = "function" == typeof Symbol && Symbol.iterator, i = e && t[e], o = 0;
if (i) return i.call(t);
if (t && "number" == typeof t.length) return {
next: function() {
t && o >= t.length && (t = void 0);
return {
value: t && t[o++],
done: !t
};
}
};
throw new TypeError(e ? "Object is not iterable." : "Symbol.iterator is not defined.");
};
Object.defineProperty(i, "__esModule", {
value: !0
});
i.WorldInfoWindow = void 0;
var s = t("../../../../common/src/GamePopBase"), l = t("../../common/StatsHelper"), c = cc._decorator, u = c.ccclass, d = c.property, h = function(t) {
a(e, t);
function e() {
var e = null !== t && t.apply(this, arguments) || this;
e.valueNode = null;
return e;
}
e.prototype.start = function() {
this.showValues();
};
e.prototype.showValues = function() {
var t, e;
try {
for (var i = n(this.valueNode.children), o = i.next(); !o.done; o = i.next()) {
var a = o.value, r = l.default.getStatistic(a.name);
a.getComponent(cc.RichText).string = r;
}
} catch (e) {
t = {
error: e
};
} finally {
try {
o && !o.done && (e = i.return) && e.call(i);
} finally {
if (t) throw t.error;
}
}
};
r([ d(cc.Node) ], e.prototype, "valueNode", void 0);
return r([ u ], e);
}(s.GamePopBase);
i.WorldInfoWindow = h;
cc._RF.pop();
}, {
"../../../../common/src/GamePopBase": void 0,
"../../common/StatsHelper": "StatsHelper"
} ],
WorldLawWindow: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "b75f3xhcMdD8q0TOKgkUb65", "WorldLawWindow");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
}), r = this && this.__decorate || function(t, e, i, o) {
var a, r = arguments.length, n = r < 3 ? e : null === o ? o = Object.getOwnPropertyDescriptor(e, i) : o;
if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) n = Reflect.decorate(t, e, i, o); else for (var s = t.length - 1; s >= 0; s--) (a = t[s]) && (n = (r < 3 ? a(n) : r > 3 ? a(e, i, n) : a(e, i)) || n);
return r > 3 && n && Object.defineProperty(e, i, n), n;
};
Object.defineProperty(i, "__esModule", {
value: !0
});
var n = t("../../../../common/src/GamePopBase"), s = t("../../common/ToolBox"), l = t("../../MapBox"), c = t("../tip/ToolTip"), u = cc._decorator, d = u.ccclass, h = u.property, p = function(t) {
a(e, t);
function e() {
var e = null !== t && t.apply(this, arguments) || this;
e.lawNodes = [];
return e;
}
e.prototype.onLoad = function() {
var t = this;
this.lawNodes.forEach(function(e) {
t.updateStatus(e);
});
};
e.prototype.click = function(t) {
var e = t.getCurrentTarget(), i = e.name, o = l.default.inst.worldLaws.dict.get(i);
o.boolVal = !o.boolVal;
this.updateStatus(e, !0);
"world_law_peaceful_monsters" == i && o.boolVal && l.default.inst.stopAttacksFor(!0);
};
e.prototype.updateStatus = function(t, e) {
void 0 === e && (e = !1);
var i = t.name, o = l.default.inst.worldLaws.dict.get(i).boolVal, a = t.getChildByName("icon");
t.getChildByName("dot").getComponent(cc.Button).interactable = !o;
if (o) {
a.color = s.Toolbox.makeColor("#FFFFFF");
a.opacity = 255;
} else {
a.color = s.Toolbox.makeColor("#666666");
a.opacity = 155;
}
if (e) {
c.default.info_tip = i + "_title";
c.default.inst.show(t, "world_law", i + "_title", i + "_description");
}
};
r([ h([ cc.Node ]) ], e.prototype, "lawNodes", void 0);
return r([ d ], e);
}(n.GamePopBase);
i.default = p;
cc._RF.pop();
}, {
"../../../../common/src/GamePopBase": void 0,
"../../MapBox": "MapBox",
"../../common/ToolBox": "ToolBox",
"../tip/ToolTip": "ToolTip"
} ],
WorldLaws: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "3734ay4G+hHvopjGV7O2uuu", "WorldLaws");
var o = this && this.__values || function(t) {
var e = "function" == typeof Symbol && Symbol.iterator, i = e && t[e], o = 0;
if (i) return i.call(t);
if (t && "number" == typeof t.length) return {
next: function() {
t && o >= t.length && (t = void 0);
return {
value: t && t[o++],
done: !t
};
}
};
throw new TypeError(e ? "Object is not iterable." : "Symbol.iterator is not defined.");
};
Object.defineProperty(i, "__esModule", {
value: !0
});
i.PlayerOptionData = void 0;
var a = function(t, e) {
void 0 === t && (t = "");
void 0 === e && (e = !0);
this.name = "OPTION";
this.boolVal = !0;
this.stringVal = "";
this.name = t;
this.boolVal = e;
};
i.PlayerOptionData = a;
var r = function() {
function t() {
this.world_law_diplomacy = null;
this.world_law_peaceful_monsters = null;
this.world_law_hunger = null;
this.world_law_grow_trees = null;
this.world_law_grow_grass = null;
this.world_law_kingdom_expansion = null;
this.world_law_old_age = null;
this.world_law_animals_spawn = null;
this.world_law_rebellions = null;
this.world_law_border_stealing = null;
this.world_law_erosion = null;
this.world_law_forever_lava = null;
this.world_law_disasters_nature = null;
this.world_law_disasters_other = null;
this.world_law_angry_civilians = null;
this.list = [];
this.dict = new Map();
}
t.prototype.add = function(t) {
var e, i;
try {
for (var a = o(this.list), r = a.next(); !r.done; r = a.next()) {
var n = r.value;
if (t.name == n.name) {
this.dict.set(n.name, n);
return n;
}
}
} catch (t) {
e = {
error: t
};
} finally {
try {
r && !r.done && (i = a.return) && i.call(a);
} finally {
if (e) throw e.error;
}
}
this.list.push(t);
this.dict.set(t.name, t);
return t;
};
t.prototype.toJSON = function() {
return {
list: this.list
};
};
t.prototype.check = function() {
this.init();
};
t.prototype.init = function() {
this.list || (this.list = []);
this.dict || (this.dict = new Map());
this.world_law_diplomacy = this.add(new a("world_law_diplomacy", !0));
this.world_law_peaceful_monsters = this.add(new a("world_law_peaceful_monsters", !1));
this.world_law_hunger = this.add(new a("world_law_hunger", !0));
this.world_law_grow_trees = this.add(new a("world_law_grow_trees", !0));
this.world_law_grow_grass = this.add(new a("world_law_grow_grass", !0));
this.world_law_kingdom_expansion = this.add(new a("world_law_kingdom_expansion", !0));
this.world_law_old_age = this.add(new a("world_law_old_age", !0));
this.world_law_animals_spawn = this.add(new a("world_law_animals_spawn", !0));
this.world_law_rebellions = this.add(new a("world_law_rebellions", !0));
this.world_law_border_stealing = this.add(new a("world_law_border_stealing", !0));
this.world_law_erosion = this.add(new a("world_law_erosion", !0));
this.world_law_forever_lava = this.add(new a("world_law_forever_lava", !1));
this.world_law_disasters_nature = this.add(new a("world_law_disasters_nature", !1));
this.world_law_disasters_other = this.add(new a("world_law_disasters_other", !1));
this.world_law_angry_civilians = this.add(new a("world_law_angry_civilians", !1));
};
return t;
}();
i.default = r;
cc._RF.pop();
}, {} ],
WorldLogElement: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "452a1XD37pMJ5yH0RFNV4cF", "WorldLogElement");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
}), r = this && this.__decorate || function(t, e, i, o) {
var a, r = arguments.length, n = r < 3 ? e : null === o ? o = Object.getOwnPropertyDescriptor(e, i) : o;
if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) n = Reflect.decorate(t, e, i, o); else for (var s = t.length - 1; s >= 0; s--) (a = t[s]) && (n = (r < 3 ? a(n) : r > 3 ? a(e, i, n) : a(e, i)) || n);
return r > 3 && n && Object.defineProperty(e, i, n), n;
};
Object.defineProperty(i, "__esModule", {
value: !0
});
var n = t("../../texture/TextureLoader"), s = t("./WorldLogMessageExtensions"), l = cc._decorator, c = l.ccclass, u = l.property, d = function(t) {
a(e, t);
function e() {
var e = null !== t && t.apply(this, arguments) || this;
e.description = null;
e.date = null;
e.icon = null;
e.locate = null;
e.follow = null;
e.callback = null;
e.message = null;
return e;
}
e.prototype.updateItem = function(t, e) {
this.message = t;
this.callback = e;
this.date.string = t.date;
var i = s.default.getFormatedText(t, this.description, !1, !0), o = s.default.hasLocation(t), a = s.default.hasFollowLocation(t);
if (a) {
this.follow.active = a;
this.locate.active = !a;
} else {
this.follow.active = a;
this.locate.active = o;
}
this.description.string = null != i ? i : "";
t.icon ? this.icon.spriteFrame = n.TextureLoader.inst.getSpriteFrame(n.ATLAS_TYPE.UIATLAS, "icons/" + t.icon) : this.icon.node.active = !1;
};
e.prototype.clickLocate = function() {
s.default.jumpToLocation(this.message);
this.callback && this.callback();
};
e.prototype.clickFollow = function() {
s.default.followLocation(this.message);
this.callback && this.callback();
};
r([ u(cc.RichText) ], e.prototype, "description", void 0);
r([ u(cc.Label) ], e.prototype, "date", void 0);
r([ u(cc.Sprite) ], e.prototype, "icon", void 0);
r([ u(cc.Node) ], e.prototype, "locate", void 0);
r([ u(cc.Node) ], e.prototype, "follow", void 0);
return r([ c ], e);
}(cc.Component);
i.default = d;
cc._RF.pop();
}, {
"../../texture/TextureLoader": "TextureLoader",
"./WorldLogMessageExtensions": "WorldLogMessageExtensions"
} ],
WorldLogMessageExtensions: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "4a06b9gCOFPgZ/dyJ483AIt", "WorldLogMessageExtensions");
Object.defineProperty(i, "__esModule", {
value: !0
});
i.WorldLogMessage = void 0;
var o = t("../../../../common/src/text/LocalizedTextManager"), a = t("../../common/ToolBox"), r = t("../../MapBox"), n = t("./HistoryHud"), s = t("./WorldLog");
i.WorldLogMessage = function(t, e, i, o) {
void 0 === e && (e = "");
void 0 === i && (i = "");
void 0 === o && (o = "");
this.text = "";
this.special1 = "";
this.special2 = "";
this.special3 = "";
this.color_special1 = cc.Color.TRANSPARENT;
this.color_special2 = cc.Color.TRANSPARENT;
this.color_special3 = cc.Color.TRANSPARENT;
this.date = "";
this.icon = "";
this.city = null;
this.kingdom = null;
this.unit = null;
this.location = cc.Vec3.ZERO;
this.text = t;
this.special1 = e;
this.special2 = i;
this.special3 = o;
this.date = "y:" + (r.default.inst.mapStats.year + 1) + ", m:" + (r.default.inst.mapStats.month + 1);
};
var l = function() {
function t() {}
t.add = function(t) {
s.default.inst.truncateList();
s.default.inst.list.unshift(t);
n.default.inst.newHistory(t);
};
t.coloredText = function(t, e, i, o) {
void 0 === o && (o = -1);
var r = cc.Color.TRANSPARENT;
switch (o) {
case 1:
r = t.color_special1;
break;

case 2:
r = t.color_special2;
break;

case 3:
r = t.color_special3;
}
r == cc.Color.TRANSPARENT && (i = !1);
return i ? "<color=" + a.Toolbox.colorToHex(r) + ">" + e + "</color>" : e;
};
t.getFormatedText = function(t, e, i, r) {
var n = o.LocalizedTextManager.getText(t.text), s = a.Toolbox.color_log_neutral;
switch (t.text) {
case "log_city_revolted":
s = a.Toolbox.color_log_good;
n = (n = n.replace("$name$", this.coloredText(t, t.special1, r))).replace("$kingdom$", this.coloredText(t, t.special2, r, 2));
t.icon = "iconInspiration";
break;

case "king_new":
s = a.Toolbox.color_log_neutral;
n = (n = n.replace("$kingdom$", this.coloredText(t, t.special1, r, 1))).replace("$king$", this.coloredText(t, t.special2, r, 2));
t.icon = "iconKings";
break;

case "king_dead":
s = a.Toolbox.color_log_warning;
n = (n = n.replace("$kingdom$", this.coloredText(t, t.special1, r, 1))).replace("$king$", this.coloredText(t, t.special2, r));
t.icon = "iconDead";
break;

case "king_killed_1":
case "king_killed_2":
case "king_killed_3":
s = a.Toolbox.color_log_warning;
n = (n = (n = n.replace("$kingdom$", this.coloredText(t, t.special1, r, 1))).replace("$king$", this.coloredText(t, t.special2, r, 2))).replace("$name$", this.coloredText(t, t.special3, r, 3));
t.icon = "iconKingslayer";
break;

case "favorite_dead_1":
case "favorite_dead_2":
case "favorite_dead_3":
s = a.Toolbox.color_log_warning;
n = n.replace("$name$", this.coloredText(t, t.special1, r, 1));
t.icon = "iconFavoriteKilled";
break;

case "favorite_killed_1":
case "favorite_killed_2":
case "favorite_killed_3":
s = a.Toolbox.color_log_warning;
n = (n = n.replace("$name$", this.coloredText(t, t.special1, r, 1))).replace("$killer$", this.coloredText(t, t.special2, r, 2));
t.icon = "iconFavoriteKilled";
break;

case "city_new":
s = a.Toolbox.color_log_neutral;
n = n.replace("$name$", this.coloredText(t, t.special1, r, 1));
t.icon = "iconCitySelect";
break;

case "city_destroyed":
s = a.Toolbox.color_log_warning;
n = n.replace("$name$", this.coloredText(t, t.special1, r, 1));
t.icon = "iconPyromaniac";
break;

case "kingdom_new":
s = a.Toolbox.color_log_neutral;
n = n.replace("$name$", this.coloredText(t, t.special1, r, 1));
t.icon = "iconKingdom";
break;

case "kingdom_destroyed":
s = a.Toolbox.color_log_warning;
n = n.replace("$name$", this.coloredText(t, t.special1, r, 1));
t.icon = "iconPyromaniac";
break;

case "diplomacy_war_started":
s = a.Toolbox.color_log_warning;
n = (n = n.replace("$kingdom1$", this.coloredText(t, t.special1, r, 1))).replace("$kingdom2$", this.coloredText(t, t.special2, r, 2));
t.icon = "iconSpite";
break;

case "diplomacy_peace":
s = a.Toolbox.color_log_good;
n = (n = n.replace("$kingdom1$", this.coloredText(t, t.special1, r, 1))).replace("$kingdom2$", this.coloredText(t, t.special2, r, 2));
t.icon = "iconPacifist";
break;

case "worldlog_disaster_evil_mage":
case "worldlog_disaster_underground_necromancer":
case "worldlog_disaster_mad_thoughts":
i = !0;
s = a.Toolbox.color_log_warning;
n = (n = n.replace("$name$", this.coloredText(t, t.special1, r, 1))).replace("$city$", this.coloredText(t, t.special2, r, 1));
}
i && (e.node.color = s);
return n;
};
t.followLocation = function(t) {
if (this.hasFollowLocation(t)) {
s.default.locationFollow(t.unit);
return !0;
}
return !1;
};
t.jumpToLocation = function(t) {
if (!this.followLocation(t)) {
var e = this.getLocation(t);
!e.equals(cc.Vec3.ZERO) && a.Toolbox.inMapBorder(e) && s.default.locationJump(e);
}
};
t.hasLocation = function(t) {
return !this.getLocation(t).equals(cc.Vec3.ZERO);
};
t.hasFollowLocation = function(t) {
var e, i;
return !(null === (i = null === (e = t.unit) || void 0 === e ? void 0 : e.data) || void 0 === i || !i.alive);
};
t.getLocation = function(t) {
var e, i, o, r, n;
if (null === (i = null === (e = t.unit) || void 0 === e ? void 0 : e.data) || void 0 === i ? void 0 : i.alive) return t.unit.currentPosition;
if (!t.location.equals(cc.Vec3.ZERO) && a.Toolbox.inMapBorder(t.location)) return t.location;
if ((null === (o = t.kingdom) || void 0 === o ? void 0 : o.alive) && (null === (r = t.kingdom) || void 0 === r ? void 0 : r.capital)) {
if (a.Toolbox.inMapBorder(t.kingdom.capital.lastCityCenter)) return t.kingdom.capital.lastCityCenter;
if (a.Toolbox.inMapBorder(t.kingdom.capital.cityCenter)) return t.kingdom.capital.cityCenter;
}
if (null === (n = t.city) || void 0 === n ? void 0 : n.alive) {
if (a.Toolbox.inMapBorder(t.city.lastCityCenter)) return t.city.lastCityCenter;
if (a.Toolbox.inMapBorder(t.city.cityCenter)) return t.city.cityCenter;
}
return cc.Vec3.ZERO;
};
return t;
}();
i.default = l;
cc._RF.pop();
}, {
"../../../../common/src/text/LocalizedTextManager": void 0,
"../../MapBox": "MapBox",
"../../common/ToolBox": "ToolBox",
"./HistoryHud": "HistoryHud",
"./WorldLog": "WorldLog"
} ],
WorldLogWindow: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "b672bwiegJBNb+dzBe2ZTbq", "WorldLogWindow");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
}), r = this && this.__decorate || function(t, e, i, o) {
var a, r = arguments.length, n = r < 3 ? e : null === o ? o = Object.getOwnPropertyDescriptor(e, i) : o;
if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) n = Reflect.decorate(t, e, i, o); else for (var s = t.length - 1; s >= 0; s--) (a = t[s]) && (n = (r < 3 ? a(n) : r > 3 ? a(e, i, n) : a(e, i)) || n);
return r > 3 && n && Object.defineProperty(e, i, n), n;
};
Object.defineProperty(i, "__esModule", {
value: !0
});
var n = t("../../../../common/src/GamePopBase"), s = t("../../../../common/src/module/scrollView/List"), l = t("./WorldLog"), c = t("./WorldLogElement"), u = cc._decorator, d = u.ccclass, h = u.property, p = function(t) {
a(e, t);
function e() {
var e = null !== t && t.apply(this, arguments) || this;
e.pbItem = null;
e.scrollView = null;
return e;
}
e.prototype.open = function() {
t.prototype.open.call(this);
this.updateList();
};
e.prototype.updateList = function() {
this.scrollView.getComponent(s.default).numItems = l.default.inst.list.length;
};
e.prototype.updateItem = function(t, e) {
if (!(l.default.inst.list.length <= e)) {
var i = l.default.inst.list[e];
t.getComponent(c.default).updateItem(i, this.close.bind(this));
}
};
r([ h(cc.Prefab) ], e.prototype, "pbItem", void 0);
r([ h(cc.ScrollView) ], e.prototype, "scrollView", void 0);
return r([ d ], e);
}(n.GamePopBase);
i.default = p;
cc._RF.pop();
}, {
"../../../../common/src/GamePopBase": void 0,
"../../../../common/src/module/scrollView/List": void 0,
"./WorldLog": "WorldLog",
"./WorldLogElement": "WorldLogElement"
} ],
WorldLog: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "d76285zd6VA0oCvHuNWfEts", "WorldLog");
Object.defineProperty(i, "__esModule", {
value: !0
});
var o = t("../../common/MoveCamera"), a = t("../../common/ToolBox"), r = t("./WorldLogMessageExtensions"), n = function() {
function t() {
this.list = [];
this.limit = 40;
t.inst = this;
}
t.prototype.truncateList = function() {
for (;this.list.length >= this.limit; ) this.list.pop();
};
t.prototype.clear = function() {
this.list.clear();
};
t.logNewKing = function(t) {
var e, i, o = new r.WorldLogMessage("king_new", t.data.name, t.king.data.firstName);
o.unit = t.king;
o.location = t.king.currentPosition;
o.color_special1 = null === (e = t.kingdomColor) || void 0 === e ? void 0 : e.colorBorderOut;
o.color_special2 = null === (i = t.kingdomColor) || void 0 === i ? void 0 : i.colorBorderOut;
r.default.add(o);
};
t.logKingDead = function(t, e) {
var i, o = new r.WorldLogMessage("king_dead", t.data.name, e.data.firstName);
o.location = e.currentPosition;
o.kingdom = t;
o.color_special1 = null === (i = t.kingdomColor) || void 0 === i ? void 0 : i.colorBorderOut;
r.default.add(o);
};
t.logKingMurder = function(t, e, i) {
var o, n, s, l, c, u, d = new r.WorldLogMessage("king_killed_" + a.Toolbox.randomInt(1, 3), t.data.name, e.data.firstName, null === (o = null == i ? void 0 : i.data) || void 0 === o ? void 0 : o.firstName);
d.color_special1 = null === (n = t.kingdomColor) || void 0 === n ? void 0 : n.colorBorderOut;
d.color_special2 = null === (s = t.kingdomColor) || void 0 === s ? void 0 : s.colorBorderOut;
(null === (l = null == i ? void 0 : i.kingdom) || void 0 === l ? void 0 : l.kingdomColor) && (d.color_special3 = null === (u = null === (c = i.kingdom) || void 0 === c ? void 0 : c.kingdomColor) || void 0 === u ? void 0 : u.colorBorderOut);
d.unit = i;
d.location = e.currentPosition;
d.kingdom = t;
r.default.add(d);
};
t.logFavDead = function(t) {
var e, i, o, n = new r.WorldLogMessage("favorite_dead_" + a.Toolbox.randomInt(1, 3), t.data.firstName);
n.location = t.currentPosition;
(null === (e = null == t ? void 0 : t.kingdom) || void 0 === e ? void 0 : e.kingdomColor) && (n.color_special1 = null === (o = null === (i = t.kingdom) || void 0 === i ? void 0 : i.kingdomColor) || void 0 === o ? void 0 : o.colorBorderOut);
r.default.add(n);
};
t.logFavMurder = function(t, e) {
var i, o, n, s, l, c, u, d = new r.WorldLogMessage("favorite_killed_" + a.Toolbox.randomInt(1, 3), t.data.firstName, null === (i = null == e ? void 0 : e.data) || void 0 === i ? void 0 : i.firstName);
(null === (o = null == t ? void 0 : t.kingdom) || void 0 === o ? void 0 : o.kingdomColor) && (d.color_special1 = null === (s = null === (n = t.kingdom) || void 0 === n ? void 0 : n.kingdomColor) || void 0 === s ? void 0 : s.colorBorderOut);
(null === (l = null == e ? void 0 : e.kingdom) || void 0 === l ? void 0 : l.kingdomColor) && (d.color_special2 = null === (u = null === (c = e.kingdom) || void 0 === c ? void 0 : c.kingdomColor) || void 0 === u ? void 0 : u.colorBorderOut);
d.unit = e;
d.location = t.currentPosition;
r.default.add(d);
};
t.logNewCity = function(t) {
var e, i, o = new r.WorldLogMessage("city_new", t.data.cityName);
o.city = t;
o.location = t.lastCityCenter;
o.color_special1 = null === (i = null === (e = t.kingdom) || void 0 === e ? void 0 : e.kingdomColor) || void 0 === i ? void 0 : i.colorBorderOut;
r.default.add(o);
};
t.logCityRevolt = function(t) {
var e = new r.WorldLogMessage("log_city_revolted", t.data.cityName, t.kingdom.data.name);
e.city = t;
e.location = t.lastCityCenter;
r.default.add(e);
};
t.logNewWar = function(t, e) {
var i, o, a = new r.WorldLogMessage("diplomacy_war_started", t.data.name, e.data.name);
a.kingdom = e;
a.location = e.location;
a.color_special1 = null === (i = null == t ? void 0 : t.kingdomColor) || void 0 === i ? void 0 : i.colorBorderOut;
a.color_special2 = null === (o = null == e ? void 0 : e.kingdomColor) || void 0 === o ? void 0 : o.colorBorderOut;
r.default.add(a);
};
t.logNewPeace = function(t, e) {
var i, o, a = new r.WorldLogMessage("diplomacy_peace", t.data.name, e.data.name);
a.kingdom = e;
a.location = e.location;
a.color_special1 = null === (i = null == t ? void 0 : t.kingdomColor) || void 0 === i ? void 0 : i.colorBorderOut;
a.color_special2 = null === (o = null == e ? void 0 : e.kingdomColor) || void 0 === o ? void 0 : o.colorBorderOut;
r.default.add(a);
};
t.logNewKingdom = function(t) {
var e, i = new r.WorldLogMessage("kingdom_new", t.data.name);
i.kingdom = t;
i.location = t.location;
i.color_special1 = null === (e = null == t ? void 0 : t.kingdomColor) || void 0 === e ? void 0 : e.colorBorderOut;
r.default.add(i);
};
t.logKingdomDestroyed = function(t) {
var e, i = new r.WorldLogMessage("kingdom_destroyed", t.data.name);
i.kingdom = t;
i.location = t.location;
i.color_special1 = null === (e = null == t ? void 0 : t.kingdomColor) || void 0 === e ? void 0 : e.colorBorderOut;
r.default.add(i);
};
t.logCityDestroyed = function(t) {
var e, i, o = new r.WorldLogMessage("city_destroyed", t.data.cityName);
o.color_special1 = null === (i = null === (e = t.kingdom) || void 0 === e ? void 0 : e.kingdomColor) || void 0 === i ? void 0 : i.colorBorderOut;
o.location = t.lastCityCenter;
o.city = t;
r.default.add(o);
};
t.logDisaster = function(t, e, i, o, a) {
void 0 === i && (i = "");
void 0 === o && (o = null);
void 0 === a && (a = null);
if (t.world_log) {
var n = new r.WorldLogMessage(t.world_log);
n.icon = t.world_log_icon;
n.location = e.posV3;
n.special1 = i;
if (o) {
n.special2 = o.data.cityName;
n.city = o;
}
n.unit = a;
r.default.add(n);
}
};
t.locationJump = function(t) {
o.MoveCamera.inst.focusOn(t.clone());
};
t.locationFollow = function(t) {
o.MoveCamera.inst.focusOnAndFollow(t);
};
t.inst = null;
return t;
}();
i.default = n;
cc._RF.pop();
}, {
"../../common/MoveCamera": "MoveCamera",
"../../common/ToolBox": "ToolBox",
"./WorldLogMessageExtensions": "WorldLogMessageExtensions"
} ],
WorldNameGenerator: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "8ca0d1HWypJApwJSLXPqjrD", "WorldNameGenerator");
Object.defineProperty(i, "__esModule", {
value: !0
});
var o = t("../../common/ToolBox"), a = function() {
function t() {}
t.generateName = function() {
return o.Toolbox.randomBool() ? t.first.getRandom() + " " + t.second.getRandom() : t.second.getRandom() + " of " + t.ofWords.getRandom();
};
t.first = [ "Forgotten", "New", "Red", "Blue", "Never", "Green", "Mirage", "Ever", "Hollow", "Infinite", "Empty", "Ghost", "Perfected", "God's", "Hidden", "Stolen", "Broken", "Nightmare", "Secret", "Sacred", "Cruel", "Phantom", "Free", "Dragon", "Demon", "Thunder", "Silent", "Old", "Ancient", "Eternity", "Flat", "Dream" ];
t.second = [ "Isles", "Lands", "Land", "Realm", "Earth", "Sanctum", "World", "Planet", "Archipelago", "Territories", "Acres" ];
t.ofWords = [ "Souls", "Life", "Sun", "Moon", "God", "Blood", "Dragons", "Man", "Greatness", "Misery", "Happiness", "Death", "Clouds", "Rain", "War" ];
return t;
}();
i.default = a;
cc._RF.pop();
}, {
"../../common/ToolBox": "ToolBox"
} ],
WorldTileData: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "c2bcfUuD5dGkbm4QOhH2xOk", "WorldTileData");
Object.defineProperty(i, "__esModule", {
value: !0
});
var o = t("../layer/ConwayLife");
i.default = function() {
this.type = "";
this.height = 0;
this.conwayType = o.ConwayType.None;
this.fire = !1;
this.fire_stage = 0;
this.tile_id = 0;
this.x = 0;
this.y = 0;
};
cc._RF.pop();
}, {
"../layer/ConwayLife": "ConwayLife"
} ],
WorldTilemapEx: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "68d20knz+1BAKRmi+rVQgwx", "WorldTilemapEx");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
}), r = this && this.__decorate || function(t, e, i, o) {
var a, r = arguments.length, n = r < 3 ? e : null === o ? o = Object.getOwnPropertyDescriptor(e, i) : o;
if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) n = Reflect.decorate(t, e, i, o); else for (var s = t.length - 1; s >= 0; s--) (a = t[s]) && (n = (r < 3 ? a(n) : r > 3 ? a(e, i, n) : a(e, i)) || n);
return r > 3 && n && Object.defineProperty(e, i, n), n;
}, n = this && this.__values || function(t) {
var e = "function" == typeof Symbol && Symbol.iterator, i = e && t[e], o = 0;
if (i) return i.call(t);
if (t && "number" == typeof t.length) return {
next: function() {
t && o >= t.length && (t = void 0);
return {
value: t && t[o++],
done: !t
};
}
};
throw new TypeError(e ? "Object is not iterable." : "Symbol.iterator is not defined.");
};
Object.defineProperty(i, "__esModule", {
value: !0
});
i.TileLibEx = i.TileEx = void 0;
var s = t("../../../../../framework/utils/Log"), l = t("../../base/BaseMapObject"), c = t("../../Config"), u = t("../../MapBox"), d = t("../../texture/TextureLoader"), h = t("../map/MapLayer"), p = t("./TileType"), f = function(t, e) {
this.spriteName = "";
this.z = 0;
this.spriteName = t;
this.z = e;
};
i.TileEx = f;
var m = function() {
function t() {
this.tiles = [];
this.tiles_dict = new Map();
}
t.prototype.addVariation = function(t, e) {
var i = new f(t, e);
this.tiles_dict.set(t, i);
this.tiles.push(i);
};
t.prototype.getRandom = function() {
return this.tiles.getRandom();
};
t.prototype.getVariation = function(t) {
return this.tiles_dict.get(t);
};
return t;
}();
i.TileLibEx = m;
var y = cc._decorator, _ = y.ccclass, g = (y.property, function(t) {
a(e, t);
function e() {
var e = null !== t && t.apply(this, arguments) || this;
e.tilemap = null;
e.d_tiles = new Map();
e.pixelList = [];
e.backTileList = [];
e.backPixelList = [];
e.inited = !1;
e.drawTime = 0;
return e;
}
i = e;
e.prototype.onLoad = function() {
t.prototype.create.call(this);
this.tilemap = this.getComponent(h.default);
i.lastTileEmpty.z = i.EMPTY_Z;
this.border_pit = p.TileType.get("border_pit");
this.border_water = p.TileType.get("border_water");
for (var e = p.TileType.list_gameplay, o = 0; o < e.length; o++) {
var a = e[o];
try {
for (var r = new m(), n = 0; n < a.variations; n++) a.tileName ? r.addVariation(a.tileName + "_" + n, a.z) : r.addVariation(a.name + "_" + n, a.z);
this.d_tiles.set(a, r);
} catch (t) {
s.default.d("... " + a.name);
this.d_tiles.has(a) || this.d_tiles.set(a, null);
}
}
};
e.prototype.clear = function() {
this.pixelList = [];
this.backPixelList = [];
this.backTileList = [];
};
e.prototype.prepare = function() {
this.clear();
this.tilemap.createTextureNew(4 * u.default.width, 4 * u.default.height);
};
e.prototype.updateTileMap = function() {
var t, e;
this.inited || s.default.v("首次渲染1：", cc.sys.now() / 1e3 - c.default.LOAD_TIME_CREATE);
try {
for (var o = n(u.default.inst.tilesDirty), a = o.next(); !a.done; a = o.next()) {
var r = a.value;
if (r.dirty) {
u.default.inst.checkBehaviours(r);
r.dirty = !1;
var l = cc.v3(r.pos.x, r.pos.y, r.type.z);
if (l.z != r.lastTile.z || r.lastDrawnType != r.type) {
if (r.lastTile.z != i.lastTileEmpty.z) {
this.setTile(r.lastTile.clone(), null);
r.lastTile = i.lastTileEmpty;
}
r.lastDrawnType = r.type;
this.setTile(l.clone(), this.getVariation(r, r.type));
r.lastTile = l.clone();
}
if (r.lastBorderWater.z != i.lastTileEmpty.z) {
this.setTile(r.lastBorderWater.clone(), null);
r.lastBorderWater = i.lastTileEmpty;
}
if ((r.type.ground || r.type.block) && !r.type.canBeFilled) {
var d = null;
r.tile_down && r.tile_down._type.canBeFilled ? d = this.border_pit : (!r.tile_down || r.tile_down.type.liquid && !r.tile_down.type.lava) && (d = this.border_water);
if (d) {
l.y = r.pos.y - 1;
l.z = d.z;
this.setTile(l.clone(), this.d_tiles.get(d).getRandom());
r.lastBorderWater = l;
}
}
}
}
} catch (e) {
t = {
error: e
};
} finally {
try {
a && !a.done && (e = o.return) && e.call(o);
} finally {
if (t) throw t.error;
}
}
if (!this.inited) {
this.inited = !0;
this.enableTiles(!1);
s.default.v("首次渲染2：", cc.sys.now() / 1e3 - c.default.LOAD_TIME_CREATE);
}
this.tilemap.updatePixels();
};
e.prototype.enableTiles = function(t) {
this.tilemap.setRendererEnabled(t);
};
e.prototype.getVariation = function(t, e) {
return t.type.force_edge_variation && t.tile_up && t.tile_up.type != t.type ? this.d_tiles.get(e).getVariation(e.force_edge_variation_frame) : this.d_tiles.get(e).getRandom();
};
e.prototype.setTile = function(t, e) {
this.backTileList[t.x] || (this.backTileList[t.x] = []);
this.backTileList[t.x][t.y] || (this.backTileList[t.x][t.y] = []);
if (e) {
this.calculatePixel(e.spriteName, t, e);
for (var i = 0; i < this.backTileList[t.x][t.y].length; i++) if ((a = this.backTileList[t.x][t.y][i])[0] == t.z) {
this.backTileList[t.x][t.y].splice(i, 1);
break;
}
this.backTileList[t.x][t.y].push([ e.z, e.spriteName ]);
} else {
var o = "";
for (i = 0; i < this.backTileList[t.x][t.y].length; i++) {
var a;
if ((a = this.backTileList[t.x][t.y][i])[0] == t.z) {
o = a[1];
this.backTileList[t.x][t.y].splice(i, 1);
break;
}
}
o && this.calculatePixel(o, t, e);
}
};
e.prototype.calculatePixel = function(t, e, i) {
for (var o = d.TextureLoader.inst.getTexture(d.BIN_TYPE.tilemap, t), a = 0; a < o.width; a++) for (var r = 0; r < o.height; r++) {
var n = 4 * e.x + a - 1, s = 4 * e.y + r - 1;
if (!(n < 0 || n >= 4 * u.default.width || s < 0 || s >= 4 * u.default.height)) {
var l = o.getPixel(a, r);
if (0 != l.a) {
var c = cc.v3(n, s);
this.setPixelColor(c, l, e, i);
}
}
}
};
e.prototype.setPixelColor = function(t, e, i, o) {
var a;
if (!this.pixelList[t.x]) {
this.pixelList[t.x] = [];
this.backPixelList[t.x] = [];
}
var r = this.pixelList[t.x][t.y];
if (o) {
if (!r || r.z < i.z) {
this.tilemap.updateTilePixel(t.x, t.y, e);
this.pixelList[t.x][t.y] = i;
} else if (r.z == i.z && (i.y < r.y || i.y == r.y && i.x < r.x)) {
this.tilemap.updateTilePixel(t.x, t.y, e);
this.pixelList[t.x][t.y] = i;
}
this.setBack(t, i, e);
} else if ((null === (a = this.backPixelList[t.x][t.y]) || void 0 === a ? void 0 : a.length) > 0) {
for (var n = 0; n < this.backPixelList[t.x][t.y].length; n++) {
var s = this.backPixelList[t.x][t.y][n];
if (cc.Vec3.equals(i, s[0])) {
this.backPixelList[t.x][t.y].splice(n, 1);
break;
}
}
if (r && cc.Vec3.equals(r, i)) {
var l = this.backPixelList[t.x][t.y];
if (l.length > 0) {
var c, u = cc.v3(0, 0, -1);
l.forEach(function(t) {
var e = t[0];
if (e.z > u.z) {
c = t[1];
u = e;
} else if (e.z == u.z && (e.y < u.y || e.y == u.y && e.x < u.x)) {
c = t[1];
u = e;
}
});
this.tilemap.updateTilePixel(t.x, t.y, c);
this.pixelList[t.x][t.y] = u;
} else this.pixelList[t.x][t.y] = void 0;
}
}
};
e.prototype.setBack = function(t, e, i) {
this.backPixelList[t.x][t.y] || (this.backPixelList[t.x][t.y] = []);
for (var o = 0; o < this.backPixelList[t.x][t.y].length; o++) {
var a = this.backPixelList[t.x][t.y][o];
if (cc.Vec3.equals(e, a[0])) {
this.backPixelList[t.x][t.y].splice(o, 1);
break;
}
}
this.backPixelList[t.x][t.y].push([ e, i ]);
};
e.prototype.stringify = function(t) {
return '{"x":' + t.x + ',"y":' + t.y + ',"z":' + t.z + "}";
};
var i;
e.EMPTY_Z = -1e3;
e.lastTileEmpty = cc.v3(-1, -1, -1e3);
return i = r([ _ ], e);
}(l.default));
i.default = g;
cc._RF.pop();
}, {
"../../../../../framework/utils/Log": void 0,
"../../Config": "Config",
"../../MapBox": "MapBox",
"../../base/BaseMapObject": "BaseMapObject",
"../../texture/TextureLoader": "TextureLoader",
"../map/MapLayer": "MapLayer",
"./TileType": "TileType"
} ],
WorldTilemap: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "9fb94VA2y1AfrAaEimtXWZt", "WorldTilemap");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
}), r = this && this.__decorate || function(t, e, i, o) {
var a, r = arguments.length, n = r < 3 ? e : null === o ? o = Object.getOwnPropertyDescriptor(e, i) : o;
if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) n = Reflect.decorate(t, e, i, o); else for (var s = t.length - 1; s >= 0; s--) (a = t[s]) && (n = (r < 3 ? a(n) : r > 3 ? a(e, i, n) : a(e, i)) || n);
return r > 3 && n && Object.defineProperty(e, i, n), n;
}, n = this && this.__values || function(t) {
var e = "function" == typeof Symbol && Symbol.iterator, i = e && t[e], o = 0;
if (i) return i.call(t);
if (t && "number" == typeof t.length) return {
next: function() {
t && o >= t.length && (t = void 0);
return {
value: t && t[o++],
done: !t
};
}
};
throw new TypeError(e ? "Object is not iterable." : "Symbol.iterator is not defined.");
};
Object.defineProperty(i, "__esModule", {
value: !0
});
var s = t("../../../../../framework/utils/Log"), l = t("../../base/BaseMapObject"), c = t("../../MapBox"), u = t("./TileMap"), d = t("./TileType"), h = cc._decorator, p = h.ccclass, f = (h.property, 
function(t) {
a(e, t);
function e() {
var e = null !== t && t.apply(this, arguments) || this;
e.d_tiles = new Map();
e.tilemap = null;
e.redrawTime = 0;
e.redrawEnable = !0;
e.bPrint = !0;
return e;
}
i = e;
e.prototype.onLoad = function() {
t.prototype.create.call(this);
this.tilemap = this.getComponent(u.default);
i.lastTileEmpty.z = i.EMPTY_Z;
this.border_pit = d.TileType.get("border_pit");
this.border_water = d.TileType.get("border_water");
for (var e = 0; e < d.TileType.list_gameplay.length; e++) {
for (var o = d.TileType.list_gameplay[e], a = new u.TileLib(), r = 0; r < o.variations; r++) o.tileName ? a.addVariation(o.tileName + "_" + r, o.z) : a.addVariation(o.name + "_" + r, o.z);
this.d_tiles.set(o, a);
}
};
e.prototype.clear = function() {
this.tilemap.clear();
};
e.prototype.prepare = function() {
this.redrawTime = 0;
this.tilemap.clear();
this.tilemap.createTextureNew(4 * c.default.width, 4 * c.default.height);
};
e.prototype.updateTileMap = function() {
var t, e;
try {
for (var o = n(c.default.inst.tilesDirty), a = o.next(); !a.done; a = o.next()) {
var r = a.value;
if (r.dirty) {
c.default.inst.checkBehaviours(r);
r.dirty = !1;
if (r.type.z != r.lastTile.z || r.lastDrawnType != r.type) {
if (r.lastTile.z != i.lastTileEmpty.z) {
this.tilemap.setTile(r.lastTile, void 0);
r.lastTile = i.lastTileEmpty;
}
r.lastDrawnType = r.type;
var s = cc.v3(r.pos.x, r.pos.y, r.type.z);
this.tilemap.setTile(s, this.getVariation(r, r.type));
r.lastTile = s;
}
if (!OS_IOS) {
if (r.lastBorderWater.z != i.lastTileEmpty.z) {
this.tilemap.setTile(r.lastBorderWater, void 0, !0);
r.lastBorderWater = i.lastTileEmpty;
}
if ((r.type.ground || r.type.block) && !r.type.canBeFilled && r.tile_down) {
var l = null;
r.tile_down._type.canBeFilled ? l = this.border_pit : r.tile_down.type.liquid && !r.tile_down.type.lava && (l = this.border_water);
if (l) {
var u = cc.v3(r.pos.x, r.pos.y - 1, l.z);
this.tilemap.setTile(u, this.d_tiles.get(l).getRandom(), !0);
r.lastBorderWater = u;
}
} else if (r.type.liquid && !r.type.lava && r.tile_up && (r.tile_up.type.ground || r.tile_up.type.block) && !r.tile_up.type.canBeFilled) {
u = cc.v3(r.pos.x, r.pos.y, this.border_water.z);
this.tilemap.setTile(u, this.d_tiles.get(this.border_water).getRandom(), !0);
r.tile_up.lastBorderWater = u;
}
}
}
}
} catch (e) {
t = {
error: e
};
} finally {
try {
a && !a.done && (e = o.return) && e.call(o);
} finally {
if (t) throw t.error;
}
}
};
e.prototype.lateUpdate = function(t) {
this.redrawTime += t;
if (this.redrawTime > this.getRefreshTime()) {
var e = cc.sys.now();
if (this.tilemap.doDraw() && this.bPrint) {
this.bPrint = !1;
s.default.v("首次渲染耗时：", (cc.sys.now() - e) / 1e3);
}
this.redrawTime = 0;
}
};
e.prototype.getRefreshTime = function() {
var t = this.tilemap.count < 150 ? .1 : 1;
t = OS_IOS ? 2 * t : t;
return this.redrawEnable ? t : 5 * t;
};
e.prototype.enableTiles = function(t) {
this.redrawEnable = t;
this.tilemap.setRendererEnabled(t);
};
e.prototype.getVariation = function(t, e) {
return t.type.force_edge_variation && t.tile_up && t.tile_up.type != t.type ? this.d_tiles.get(e).getVariation(e.force_edge_variation_frame) : this.d_tiles.get(e).getRandom();
};
var i;
e.EMPTY_Z = -1e3;
e.lastTileEmpty = cc.v3(-1, -1, -1e3);
return i = r([ p ], e);
}(l.default));
i.default = f;
cc._RF.pop();
}, {
"../../../../../framework/utils/Log": void 0,
"../../MapBox": "MapBox",
"../../base/BaseMapObject": "BaseMapObject",
"./TileMap": "TileMap",
"./TileType": "TileType"
} ],
WorldTile: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "f92639hcSRDuYlA0A133n2c", "WorldTile");
var o = this && this.__values || function(t) {
var e = "function" == typeof Symbol && Symbol.iterator, i = e && t[e], o = 0;
if (i) return i.call(t);
if (t && "number" == typeof t.length) return {
next: function() {
t && o >= t.length && (t = void 0);
return {
value: t && t[o++],
done: !t
};
}
};
throw new TypeError(e ? "Object is not iterable." : "Symbol.iterator is not defined.");
};
Object.defineProperty(i, "__esModule", {
value: !0
});
i.WorldTileZoneBorder = i.ColorArray = i.TileDirection = void 0;
var a, r = t("../../../../common/src/data/AchievData"), n = t("../../actors/ActionLibrary"), s = t("../../actors/ActorBase"), l = t("../../assetLibrary/AssetManager"), c = t("../../common/ToolBox"), u = t("../../DebugConfig"), d = t("../../MapBox"), h = t("../layer/ConwayLife"), p = t("./TileType"), f = t("./WorldTileData"), m = t("./WorldTilemap");
(function(t) {
t[t.Left = 0] = "Left";
t[t.Right = 1] = "Right";
t[t.Up = 2] = "Up";
t[t.Down = 3] = "Down";
t[t.Null = 4] = "Null";
})(a = i.TileDirection || (i.TileDirection = {}));
i.ColorArray = function(t, e, i) {
void 0 === i && (i = 1);
this.colors = [];
this.colors = [];
for (var o = 0; o < e; o++) {
var a = o <= 0 ? 0 : 1 / e * o;
this.colors.push(new cc.Color(t.r, t.g, t.b, a * i * 255));
}
};
var y = function() {
function t() {
this.corner_l_u = !1;
this.corner_l_d = !1;
this.corner_r_d = !1;
this.corner_r_u = !1;
this.borderUp = !1;
this.borderLeft = !1;
this.borderRight = !1;
this.borderDown = !1;
this.border = !1;
}
t.prototype.reset = function() {};
return t;
}();
i.WorldTileZoneBorder = y;
var _ = function() {
function t(t, e, i) {
this.clicked = !1;
this.burned_stages = 0;
this.worldTileZoneBorder = new y();
this.health = 10;
this.lastBorderTile = cc.v3(-1, -1, -1e3);
this.lastBorderWater = cc.v3(-1, -1, -1e3);
this.lastTile = cc.v3(-1, -1, -1e3);
this.delayedTimerBomb = 0;
this.delayedBombType = "";
this.lavaTick = 0;
this.data = new f.default();
this.heat = 0;
this.explosionWave = 0;
this.explosionPower = 0;
this.grassTicksBeforeGrowth = 0;
this.targetedBy = null;
this.world_edge = !1;
this.tile_up = null;
this.tile_down = null;
this.tile_left = null;
this.tile_right = null;
this.neighbours = [];
this.neighboursAll = [];
this.roadIsland = null;
this.pollinated = 0;
this.dirty = !1;
this.needRedraw = !1;
this.x = 0;
this.y = 0;
this.pos = cc.Vec2.ZERO;
this.posV3 = cc.Vec3.ZERO;
this.buildingX = 0;
this.buildingY = 0;
this.flash_state = 0;
this.colorArray = null;
this.edge_region_right = null;
this.edge_region_up = null;
this.region = null;
this.zone = null;
this.chunk = null;
this.chunkEdge = !1;
this.building = null;
this.units = [];
this.explosionFxStage = 0;
this.dirtyIslandTile = !1;
this.checkedTile = !1;
this.score = -1;
this.debugColor = cc.Color.TRANSPARENT;
this.lastTile = m.default.lastTileEmpty;
this.data.tile_id = i;
this.neighbours = [];
this.neighboursAll = [];
this.pos = cc.v2(t, e);
this.posV3 = cc.v3(t, e).add(s.default.spriteOffset);
this.x = t;
this.y = e;
}
Object.defineProperty(t.prototype, "type", {
get: function() {
return this._type;
},
set: function(e) {
if (e && this.zone.tileTypes.get(e)) {
if (this._type != e) {
this._type && this.zone.tileTypes.get(this._type).remove(this);
this.zone.tileTypes.get(e).push(this);
}
this.health = t.DEFAULT_HEALTH;
this.data.fire && this.stopFire();
if (this.zone) if (this._type) {
!this._type.liquid && e.liquid ? this.zone.tilesWithWater++ : this._type.liquid && !e.liquid && this.zone.tilesWithWater--;
!this._type.ground && e.ground ? this.zone.tilesWithGround++ : this._type.ground && !e.ground && this.zone.tilesWithGround--;
} else {
e.liquid && this.zone.tilesWithWater++;
e.ground && this.zone.tilesWithGround++;
}
this._type = e;
d.default.inst.setTileDirty(this);
d.default.inst.updateWalkableTile(this);
this._type.explodableTimed && d.default.inst.explosionLayer.addTimedTnt(this);
}
},
enumerable: !1,
configurable: !0
});
Object.defineProperty(t.prototype, "Height", {
get: function() {
return this.data.height;
},
set: function(t) {
this.data.height = t;
this.data.height < 0 ? this.data.height = 0 : this.data.height > 255 && (this.data.height = 255);
},
enumerable: !1,
configurable: !0
});
t.prototype.pollinate = function() {
this.pollinated++;
if (this.pollinated > 5) {
this.spreadSeed();
this.pollinated = 0;
}
d.default.inst.placeBeehive && r.default.update(20);
};
t.prototype.spreadSeed = function() {
var t = c.Toolbox.getRandomChunkFromTile(this).tiles.getRandom();
t.type.canGrowFlowers && d.default.inst.terraformTile2(t, p.TileType.get(t.type.flowersTypeID), l.default.terraform.get("flash"));
};
t.prototype.canBuildOn = function(t) {
return !(this.type.liquid && !t.canBePlacedOnWater || t.burnable && this.data.fire || t.affectedByLava && this.type.lava || !t.canBePlacedOnBlocks && this.type.block || !(t.ignoreBuildings || !this.building || this.building.isNonUsable() || this.building.city || this.building.stats.ignoredByCities) || !t.ignoreBuildings && this.building && this.building.stats.cityBuilding && !this.building.isNonUsable() && this.building.stats.priority >= t.priority);
};
t.prototype.getCost = function() {
return this._type.cost;
};
t.prototype.setRoad = function() {
d.default.inst.roadsCalculator.setDirty(this);
};
t.prototype.isSameIsland = function(t) {
return !!t && (t.region && this.region ? t.region.island == this.region.island : t.region == this.region);
};
t.prototype.getColor = function() {
return this.type.color;
};
t.prototype.addNeighbour = function(t, e, i) {
void 0 === i && (i = !1);
if (t) {
i || this.neighbours.push(t);
this.neighboursAll.push(t);
switch (e) {
case a.Up:
this.tile_up = t;
break;

case a.Down:
this.tile_down = t;
break;

case a.Left:
this.tile_left = t;
break;

case a.Right:
this.tile_right = t;
}
} else this.world_edge = !0;
};
t.prototype.isWaterAround = function() {
var t, e;
try {
for (var i = o(this.neighbours), a = i.next(); !a.done; a = i.next()) if (a.value.type.layerType == p.TileLayerType.Water) return !0;
} catch (e) {
t = {
error: e
};
} finally {
try {
a && !a.done && (e = i.return) && e.call(i);
} finally {
if (t) throw t.error;
}
}
return !1;
};
t.prototype.isGoodForBoat = function() {
var t, e;
if (this.type.layerType != p.TileLayerType.Water) return !1;
if (!u.default.CheckGoodForBoat) return !0;
try {
for (var i = o(this.neighboursAll), a = i.next(); !a.done; a = i.next()) if (a.value.type.layerType != p.TileLayerType.Water) return !1;
} catch (e) {
t = {
error: e
};
} finally {
try {
a && !a.done && (e = i.return) && e.call(i);
} finally {
if (t) throw t.error;
}
}
return !0;
};
t.prototype.isTypeAround = function(t) {
var e, i;
try {
for (var a = o(this.neighbours), r = a.next(); !r.done; r = a.next()) if (r.value.type == t) return !0;
} catch (t) {
e = {
error: t
};
} finally {
try {
r && !r.done && (i = a.return) && i.call(a);
} finally {
if (e) throw e.error;
}
}
return !1;
};
t.prototype.setAcid = function() {
var t, e;
c.Toolbox.randomChance(.2) && d.default.inst.particlesSmoke.spawn(this.posV3.x, this.posV3.y);
if (this.building) {
if ((null === (t = this.building.stats) || void 0 === t ? void 0 : t.affectedByAcid) || !(null === (e = this.building.data) || void 0 === e ? void 0 : e.alive)) {
this.building.getHit(20);
this.type.decreaseTo && d.default.inst.terraformTile2(this, this.type.decreaseTo, l.default.terraform.get("destroy"));
}
} else this.type.decreaseTo && d.default.inst.terraformTile2(this, this.type.decreaseTo, l.default.terraform.get("destroy"));
this.units.forEach(function(t) {
t.getHit(250);
});
d.default.inst.conwayLayer.checkKillRange(this.pos, 2);
};
t.prototype.setFire = function(t) {
void 0 === t && (t = !1);
if (this.type.explodable) {
d.default.inst.explosionLayer.explodeBomb(this);
r.default.update(13);
}
if (!t && (!this.type.burnable || this.data.fire)) return !1;
if (this.type.liquid) return !1;
var e = !1;
if (this.building && this.building.isBurnable()) {
n.default.addBurningEffectOnTarget(this.building);
e = !0;
}
if (this.type.burnable || e || t) {
e = !0;
this.type.isType("fireworks") && d.default.inst.stackEffects.spawnFireworks(this);
this.data.fire_stage = c.Toolbox.randomRange(0, 5);
this.data.fire || this.zone.tilesOnFire++;
this.type.decreaseTo && this.type.burnable && d.default.inst.terraformTile2(this, this.type.decreaseTo, l.default.terraform.get("flash"));
this.data.fire = !0;
d.default.inst.setTileDirty(this);
d.default.inst.fireLayer.setTileDirty(this);
}
(this.type.grass || this.type.frozen) && d.default.inst.decreaseTile(this);
return e;
};
t.prototype.isPossibleToMine = function() {
var t = 0;
this.neighbours.forEach(function(e) {
e.type.rocks && t++;
});
return t <= 2;
};
t.prototype.setTileType = function(t) {
this.type = "string" == typeof t ? p.TileType.get(t) : t;
d.default.inst.setTileDirty(this);
};
t.prototype.setBurned = function(t) {
void 0 === t && (t = -1);
if (this.type.canBeBurned) {
this.burned_stages = -1 == t ? 15 - c.Toolbox.randomRange(0, 10) : t;
d.default.inst.burnedLayer.setTileDirty(this);
}
};
t.prototype.removeBurn = function() {
if (0 != this.burned_stages) {
this.burned_stages = 0;
d.default.inst.burnedLayer.setTileDirty(this);
}
};
t.prototype.stopFire = function(t) {
void 0 === t && (t = !1);
this.data.fire && this.zone.tilesOnFire--;
this.data.fire = !1;
this.data.fire_stage = 0;
d.default.inst.setTileDirty(this);
this.setBurned();
d.default.inst.fireLayer.setTileDirty(this);
t && (this.grassTicksBeforeGrowth = 5);
};
t.prototype.canGrowTrees = function() {
return !!this.type.trees && this.canGrow();
};
t.prototype.canGrow = function() {
return !this.data.fire && 0 == this.burned_stages;
};
t.prototype.removeTrees = function(t) {
void 0 === t && (t = !0);
t && d.default.inst.flashEffects.flashPixel(this, 20);
d.default.inst.setTileDirty(this);
};
t.prototype.removeGrass = function(t) {
void 0 === t && (t = !0);
t && d.default.inst.flashEffects.flashPixel(this, 20);
d.default.inst.removeGreens(this);
};
t.prototype.eatGreens = function(t) {
void 0 === t && (t = 5);
this.removeGrass();
this.grassTicksBeforeGrowth = t;
r.default.update(8);
};
t.prototype.mineRocks = function() {
d.default.inst.flashEffects.flashPixel(this, 20);
this.type.isType("mountains") ? this.setTileType("hills") : this.type.isType("hills") && this.setTileType("soil");
d.default.inst.setTileDirty(this);
};
t.prototype.clearUnits = function() {
this.units = [];
};
t.prototype.clear = function() {
this.buildingX = 0;
this.buildingY = 0;
this.units = [];
this.pollinated = 0;
this.type = p.TileType.get("deep_ocean");
this.dirty = !1;
this.needRedraw = !1;
this.delayedTimerBomb = -1;
this.Height = 0;
this.heat = 0;
this.lavaTick = 0;
this.flash_state = 0;
this.burned_stages = 0;
this.building = null;
this.data.conwayType = h.ConwayType.None;
this.explosionFxStage = 0;
this.region = null;
this.edge_region_right = null;
this.edge_region_up = null;
this.lastTile = m.default.lastTileEmpty;
this.lastBorderTile = m.default.lastTileEmpty;
this.worldTileZoneBorder.reset();
};
t.DEFAULT_HEALTH = 10;
return t;
}();
i.default = _;
cc._RF.pop();
}, {
"../../../../common/src/data/AchievData": void 0,
"../../DebugConfig": "DebugConfig",
"../../MapBox": "MapBox",
"../../actors/ActionLibrary": "ActionLibrary",
"../../actors/ActorBase": "ActorBase",
"../../assetLibrary/AssetManager": "AssetManager",
"../../common/ToolBox": "ToolBox",
"../layer/ConwayLife": "ConwayLife",
"./TileType": "TileType",
"./WorldTileData": "WorldTileData",
"./WorldTilemap": "WorldTilemap"
} ],
WorldTimer: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "61482sRSXpCJZSGJcOCDuYF", "WorldTimer");
Object.defineProperty(i, "__esModule", {
value: !0
});
var o = function() {
function t(t, e) {
this.isActive = !1;
this.isStopWatch = !1;
this.callback = null;
this.interval = 0;
this.timer = 0;
if ("function" == typeof e) {
this.callback = e;
this.timer = this.interval;
} else this.isStopWatch = e;
this.interval = t;
}
t.prototype.setTime = function(t) {
this.timer = t;
};
t.prototype.setInterval = function(t) {
this.interval = t;
};
t.prototype.startTimer = function(t) {
void 0 === t && (t = -1);
-1 != t && (this.interval = t);
this.timer = this.interval;
};
t.prototype.stop = function() {
this.isActive = !1;
};
t.prototype.logicUpdate = function(t) {
void 0 === t && (t = -1);
-1 == t && (t = cc.director.getDeltaTime());
if (this.isStopWatch) if (this.timer > 0) {
this.timer -= t;
this.isActive = !0;
} else this.isActive = !1; else if (this.timer > 0) this.timer -= t; else {
this.timer = this.interval;
this.callback();
}
};
return t;
}();
i.default = o;
cc._RF.pop();
}, {} ],
WorldTip: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "3d2674TYl5PS6umFWp4brv1", "WorldTip");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
}), r = this && this.__decorate || function(t, e, i, o) {
var a, r = arguments.length, n = r < 3 ? e : null === o ? o = Object.getOwnPropertyDescriptor(e, i) : o;
if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) n = Reflect.decorate(t, e, i, o); else for (var s = t.length - 1; s >= 0; s--) (a = t[s]) && (n = (r < 3 ? a(n) : r > 3 ? a(e, i, n) : a(e, i)) || n);
return r > 3 && n && Object.defineProperty(e, i, n), n;
};
Object.defineProperty(i, "__esModule", {
value: !0
});
var n = t("../../../../common/src/module/GlobalNode"), s = t("../../../../common/src/text/LocalizedTextManager"), l = cc._decorator, c = l.ccclass, u = l.property, d = function(t) {
a(e, t);
function e() {
var e = null !== t && t.apply(this, arguments) || this;
e.richText = null;
e.topNode = null;
return e;
}
i = e;
e.prototype.onLoad = function() {
i.inst = this;
this.richText.node.active = !1;
};
e.prototype.show = function(t, e, o) {
var a = this;
void 0 === e && (e = !0);
void 0 === o && (o = "center");
if (e) {
this.richText.string = this.addOutline(s.LocalizedTextManager.getText(t));
i.replacementDict && (this.richText.string = this.addOutline(i.replaceWords(this.richText.string)));
} else this.richText.string = this.addOutline(t);
this.richText.node.position = "center" == o ? cc.Vec3.ZERO : "top" == o ? this.topNode.position : cc.v3(this.richText.node.parent.convertToNodeSpaceAR(n.default.inst.touchPos));
this.richText.node.stopAllActions();
this.richText.node.active = !0;
this.richText.node.scale = .75;
this.richText.node.opacity = 0;
cc.tween(this.richText.node).to(.2, {
scale: .5,
opacity: 255
}).delay(3).to(.5, {
opacity: 0
}).call(function() {
a.richText.node.active = !1;
}).start();
};
e.prototype.hide = function() {
var t = this;
this.richText.node.stopAllActions();
cc.tween(this.richText.node).to(.5, {
opacity: 0
}).call(function() {
t.richText.node.active = !1;
}).start();
};
e.addWordReplacement = function(t, e) {
i.replacementDict || (i.replacementDict = new Map());
i.replacementDict.set(t, e);
};
e.replaceWords = function(t) {
i.replacementDict.forEach(function(e, i) {
t = t.replace(i, e);
});
i.replacementDict = null;
return t;
};
e.prototype.addOutline = function(t) {
return "<outline color=black width=4>" + t + "</outline>";
};
var i;
e.inst = null;
e.replacementDict = new Map();
r([ u(cc.RichText) ], e.prototype, "richText", void 0);
r([ u(cc.Node) ], e.prototype, "topNode", void 0);
return i = r([ c ], e);
}(cc.Component);
i.default = d;
cc._RF.pop();
}, {
"../../../../common/src/module/GlobalNode": void 0,
"../../../../common/src/text/LocalizedTextManager": void 0
} ],
ZoneCalculator: [ function(t, e, i) {
"use strict";
cc._RF.push(e, "d41712UyM9DBqPl4JPUvp/4", "ZoneCalculator");
var o, a = this && this.__extends || (o = function(t, e) {
return (o = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(t, e) {
t.__proto__ = e;
} || function(t, e) {
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
})(t, e);
}, function(t, e) {
o(t, e);
function i() {
this.constructor = t;
}
t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i());
}), r = this && this.__decorate || function(t, e, i, o) {
var a, r = arguments.length, n = r < 3 ? e : null === o ? o = Object.getOwnPropertyDescriptor(e, i) : o;
if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) n = Reflect.decorate(t, e, i, o); else for (var s = t.length - 1; s >= 0; s--) (a = t[s]) && (n = (r < 3 ? a(n) : r > 3 ? a(e, i, n) : a(e, i)) || n);
return r > 3 && n && Object.defineProperty(e, i, n), n;
};
Object.defineProperty(i, "__esModule", {
value: !0
});
i.RelationColor = i.ZoneDisplayMode = void 0;
var n, s = t("../../common/ToolBox"), l = t("../../Config"), c = t("../../MapBox"), u = t("../map/MapLayer"), d = t("../tile/TileZone"), h = t("../tile/WorldTile");
(function(t) {
t[t.Borders = 0] = "Borders";
t[t.Relations = 1] = "Relations";
})(n = i.ZoneDisplayMode || (i.ZoneDisplayMode = {}));
var p = function(t) {
this.color = cc.Color.TRANSPARENT;
this.border = cc.Color.TRANSPARENT;
this.color = s.Toolbox.makeColor(t);
this.border = s.Toolbox.makeColor(t);
this.color.a = 153;
};
i.RelationColor = p;
var f = cc._decorator, m = f.ccclass, y = f.property, _ = function(t) {
a(e, t);
function e() {
var e = null !== t && t.apply(this, arguments) || this;
e.mode = n.Borders;
e.color1 = cc.Color.GRAY;
e.color2 = cc.Color.WHITE;
e.color_selected = null;
e.color_ally = null;
e.color_enemy = null;
e.zones = [];
e.zones_shuffled = [];
e.zonesDict = new Map();
e.dirty = !1;
e.dirtyZones = new Set();
e.totalZonesX = 0;
e.totalZonesY = 0;
e._allDirty = !1;
e.checkKingdom = !1;
return e;
}
Object.defineProperty(e.prototype, "length", {
get: function() {
return this.zones.length;
},
enumerable: !1,
configurable: !0
});
e.prototype.onLoad = function() {
this.colorValues = cc.color(255, .46 * 255, 48.45, 255);
this.color_selected = new p("#ffffff");
this.color_ally = new p("#00ff00");
this.color_enemy = new p("#ff0000");
t.prototype.create.call(this);
this.sprRnd.node.opacity = 198.9;
};
e.prototype.clear = function() {
t.prototype.clear.call(this);
this.dirtyZones.clear();
this.zones.forEach(function(t) {
t.clear();
});
this.dirty = !0;
};
e.prototype.generate = function() {
this.zones.clear();
this.zones_shuffled.clear();
this.zonesDict.clear();
this.totalZonesX = 8 * l.default.ZONE_AMOUNT_X;
this.totalZonesY = 8 * l.default.ZONE_AMOUNT_Y;
for (var t = 0, e = 0; e < this.totalZonesY; e++) for (var i = 0; i < this.totalZonesX; i++) {
var o = new d.default(i, e, t);
o.zone_color = (i + e) % 2 == 0 ? this.color1 : this.color2;
this.zones.push(o);
this.zonesDict.set(i + "_" + e, o);
this.fillZone(o);
t++;
}
this.zones_shuffled.addRange(this.zones);
this.generateNeighbours();
this.zones.shuffle();
this.zones_shuffled.shuffle();
};
e.prototype.getZone = function(t, e) {
var i = t + "_" + e;
return this.zonesDict.has(i) ? this.zonesDict.get(i) : null;
};
e.prototype.generateNeighbours = function() {
var t = this;
this.zones.forEach(function(e) {
e.neighbours = [];
e.neighboursAll = [];
var i = t.getZone(e.x - 1, e.y);
e.addNeighbour(i, h.TileDirection.Left);
i = t.getZone(e.x + 1, e.y);
e.addNeighbour(i, h.TileDirection.Right);
i = t.getZone(e.x, e.y - 1);
e.addNeighbour(i, h.TileDirection.Down);
i = t.getZone(e.x, e.y + 1);
e.addNeighbour(i, h.TileDirection.Up);
i = t.getZone(e.x - 1, e.y - 1);
e.addNeighbour(i, h.TileDirection.Null, !0);
i = t.getZone(e.x - 1, e.y + 1);
e.addNeighbour(i, h.TileDirection.Null, !0);
i = t.getZone(e.x + 1, e.y - 1);
e.addNeighbour(i, h.TileDirection.Null, !0);
i = t.getZone(e.x + 1, e.y + 1);
e.addNeighbour(i, h.TileDirection.Null, !0);
});
};
e.prototype.fillZone = function(t) {
for (var e = 8 * t.x, i = 8 * t.y, o = 0; o < 8; o++) for (var a = 0; a < 8; a++) {
var r = c.default.inst.getTile(o + e, a + i);
if (r) {
r.zone = t;
t.addTile(r, o, a);
4 == o && 4 == a && (t.centerTile = r);
}
}
};
e.prototype.logicUpdate = function(e) {
if (c.default.inst.showCityZones()) {
this.sprRnd.enabled || (this.sprRnd.enabled = !0);
c.default.inst.isSelectedPower("relations") ? this.setLastMode(n.Relations) : this.setLastMode(n.Borders);
} else this.sprRnd.enabled && (this.sprRnd.enabled = !1);
t.prototype.logicUpdate.call(this, e);
};
e.prototype.setLastMode = function(t) {
this.mode != t && this.allDirty();
this.mode = t;
};
e.prototype.allDirty = function(t) {
var e = this;
void 0 === t && (t = !1);
if (!this._allDirty) {
t || (this._allDirty = !0);
this.dirtyZones.clear();
this.zones.forEach(function(i) {
if (t) i.city && e.setDirty(i, !1); else {
e.dirty = !0;
e.dirtyZones.add(i);
}
});
}
};
e.prototype.setDirty = function(t, e) {
var i = this;
void 0 === e && (e = !0);
this.dirty = !0;
this.dirtyZones.add(t);
e && t.neighboursAll.forEach(function(t) {
i.dirtyZones.add(t);
});
};
e.prototype.colorCityZone = function(t) {
var e = this;
this.checkKingdom = !0;
t.tiles.forEach(function(i) {
var o, a, r, s;
if (e.mode == n.Relations) {
if (l.default.selectedKingdom) {
var c = t.city.kingdom == l.default.selectedKingdom ? e.color_selected : t.city.kingdom.isEnemy(l.default.selectedKingdom) ? e.color_enemy : e.color_ally;
i.worldTileZoneBorder.border ? i.worldTileZoneBorder.borderUp && e.isBorderColor2(t.zone_up, t.city, !0) ? e.updateSinglePixel(i.data.tile_id, c.border) : i.worldTileZoneBorder.borderDown && e.isBorderColor2(t.zone_down, t.city) ? e.updateSinglePixel(i.data.tile_id, c.border) : i.worldTileZoneBorder.borderLeft && e.isBorderColor2(t.zone_left, t.city) ? e.updateSinglePixel(i.data.tile_id, c.border) : i.worldTileZoneBorder.borderRight && e.isBorderColor2(t.zone_right, t.city, !0) ? e.updateSinglePixel(i.data.tile_id, c.border) : e.updateSinglePixel(i.data.tile_id, c.color) : e.updateSinglePixel(i.data.tile_id, c.color);
}
} else {
var u = null === (a = null === (o = t.city.kingdom) || void 0 === o ? void 0 : o.kingdomColor) || void 0 === a ? void 0 : a.colorBorderInsideAlpha, d = null === (s = null === (r = t.city.kingdom) || void 0 === r ? void 0 : r.kingdomColor) || void 0 === s ? void 0 : s.colorBorderOut;
i.worldTileZoneBorder.border ? i.worldTileZoneBorder.borderUp && e.isBorderColor(t.zone_up, t.city, !0) ? e.updateSinglePixel(i.data.tile_id, d) : i.worldTileZoneBorder.borderDown && e.isBorderColor(t.zone_down, t.city) ? e.updateSinglePixel(i.data.tile_id, d) : i.worldTileZoneBorder.borderLeft && e.isBorderColor(t.zone_left, t.city) ? e.updateSinglePixel(i.data.tile_id, d) : i.worldTileZoneBorder.borderRight && e.isBorderColor(t.zone_right, t.city, !0) ? e.updateSinglePixel(i.data.tile_id, d) : e.updateSinglePixel(i.data.tile_id, u) : e.updateSinglePixel(i.data.tile_id, u);
}
});
};
e.prototype.isBorderColor2 = function(t, e, i) {
void 0 === i && (i = !1);
return !(t && t.city != e && t.city && t.city.kingdom == e.kingdom || t && t.city && t.city.kingdom == e.kingdom);
};
e.prototype.isBorderColor = function(t, e, i) {
void 0 === i && (i = !1);
return !(i && t && t.city != e && t.city && this.checkKingdom && t.city.kingdom == e.kingdom || (this.checkKingdom ? t && t.city && t.city.kingdom == e.kingdom && t.city == e : t && t.city == e));
};
e.prototype.debugCityZOnes = function() {
var t = this;
this.zones.forEach(function(e) {
e.city ? t.colorZone(e, cc.Color.YELLOW) : e.goodForNewCity ? t.colorZone(e, cc.Color.RED) : t.colorZone(e, cc.Color.TRANSPARENT);
});
this.updatePixels();
};
e.prototype.redrawDirtyTiles = function() {
var t = this;
if (this.dirty) {
this.dirty = !1;
this._allDirty = !1;
if (0 == this.dirtyZones.size) c.default.inst.tilesList.forEach(function(e) {
t.updateSinglePixel(e.data.tile_id, cc.Color.TRANSPARENT);
}); else {
this.dirtyZones.forEach(function(e) {
e.city ? t.colorCityZone(e) : t.colorZone(e, cc.Color.TRANSPARENT);
});
this.dirtyZones.clear();
}
this.updatePixels();
}
};
e.prototype.updateDirty = function() {
c.default.inst.showCityZones() && this.redrawDirtyTiles();
};
e.prototype.colorZone = function(t, e) {
var i = this;
t.tiles.forEach(function(t) {
i.updateSinglePixel(t.data.tile_id, e);
});
};
r([ y({
type: cc.Enum(n)
}) ], e.prototype, "mode", void 0);
r([ y(cc.Color) ], e.prototype, "color1", void 0);
r([ y(cc.Color) ], e.prototype, "color2", void 0);
return r([ m ], e);
}(u.default);
i.default = _;
cc._RF.pop();
}, {
"../../Config": "Config",
"../../MapBox": "MapBox",
"../../common/ToolBox": "ToolBox",
"../map/MapLayer": "MapLayer",
"../tile/TileZone": "TileZone",
"../tile/WorldTile": "WorldTile"
} ]
}, {}, [ "Config", "DebugConfig", "MapBox", "ActionLibrary", "Actor", "ActorBag", "ActorBase", "ActorEquipment", "ActorEquipmentSlot", "ActorJob", "ActorMove", "ActorStats", "ActorStatus", "ActorTool", "AutoTesterBot", "HoverModule", "UnitGroupManager", "ConstructionLayerDebug", "Ant", "Baby", "Bee", "Boulder", "Egg", "GodFinger", "Santa", "Tornado", "UFO", "Boat", "TaxiManager", "TaxiRequest", "Dragon", "DragonAsset", "Race", "AiSystem", "BehActiveCrabDangerCheck", "BehAngleAnimation", "BehAnimalCheckHungry", "BehAnimalFindTile", "BehAttackActorTarget", "BehBabymakingTime", "BehBeeCheckHome", "BehBeeCheckReturnHome", "BehBeePollinate", "BehBeeReturnHome", "BehBoat", "BehBoatCheckFishingRepeat", "BehBoatCheckHomeDocks", "BehBoatCollectFish", "BehBoatDamageCheck", "BehBoatDangerCheck", "BehBoatFindRequest", "BehBoatFindTargetForTrade", "BehBoatFindTileInDock", "BehBoatFindWaterNeutralTile", "BehBoatFindWaterTile", "BehBoatFishing", "BehBoatMakeTrade", "BehBoatSetHomeDockTarget", "BehBoatTransportCheck", "BehBoatTransportDoLoading", "BehBoatTransportFindTilePickUp", "BehBoatTransportFindTileUnload", "BehBoatTransportUnloadUnits", "BehBuildTargetProgress", "BehBurnTumorTiles", "BehCheckBuildCity", "BehCheckCitizenJob", "BehCheckCityArmyGroup", "BehCheckCure", "BehCheckHunger", "BehCheckIfInWater", "BehCheckIfOnGround", "BehCheckIfOnSmallLand", "BehChuckTargetBuildProgress", "BehCity", "BehCityCheckAttack", "BehCityCreateRoad", "BehCityFindBuilding", "BehCityFindFireZone", "BehCityFindNewJob", "BehCityFindStorage", "BehCityGetRandomZoneTile", "BehCityRemoveFire", "BehCitySettlerFindTileSameIsland", "BehCitySettlerTaxiCheck", "BehCityWarriorTaxiCheck", "BehConsumeActorTarget", "BehConsumeFlowers", "BehConsumeGrass", "BehConsumeTargetBuilding", "BehConvertOre", "BehCrabBurrow", "BehEndJob", "BehExitBuilding", "BehExtractResourcesFromBuilding", "BehFightCheckEnemyIsOk", "BehFindBuilding", "BehFindConstructionTile", "BehFindEmptyNearbyCity", "BehFindFarmField", "BehFindGoldenBrain", "BehFindMeatSource", "BehFindRandomCivBuildingTile", "BehFindRandomFrontBuildingTile", "BehFindRandomTile", "BehFindSameRaceActor", "BehFindTargetForHunter", "BehFindTile", "BehFindTileBeach", "BehFindTileForCity", "BehFindTileForFarm", "BehFindTileNearbyGroupLeader", "BehFindTileWhenOnFire", "BehFindWheat", "BehGetResourcesFromMine", "BehGoOrSwimToTileTarget", "BehGoToActorTarget", "BehGoToBuildingTarget", "BehGoToTileTarget", "BehHeal", "BehJoinCity", "BehJumpingAnimation", "BehLookAtTarget", "BehMagicMakeSkeleton", "BehMakeBaby", "BehMakeFarm", "BehMakeItem", "BehMoveAwayFromBlock", "BehPlantCrops", "BehRandomSwim", "BehRandomTeleport", "BehRandomWait", "BehRemoveRuins", "BehRepairInDock", "BehReplenishHunger", "BehResourceGatheringAnimation", "BehRestartTask", "BehSetNextTask", "BehShortRandomMove", "BehSitInsideBoat", "BehSkeletonFindTile", "BehSpawnSeeds", "BehSpecialRat", "BehStayInBuildingTarget", "BehSwimToIsland", "BehTaxiCheck", "BehTaxiEmbark", "BehTaxiFindShipTile", "BehTryBabymaking", "BehUnloadResources", "BehWalkIntoWaterCorner", "BehaviourActionActor", "BehaviourTaskActor", "CityBehAddProgress", "CityBehBorderGrowth", "CityBehBorderSteal", "CityBehBuild", "CityBehBuildDocks", "CityBehCheckArmy", "CityBehCheckAttackZone", "CityBehCheckCitizenTasks", "CityBehCheckPopPoints", "CityBehCheckSettleTarget", "CityBehFindLeader", "CityBehGiveInventoryItem", "CityBehProduceBoat", "CityBehProduceResources", "CityBehProduceUnit", "CityBehRandomWait", "CityBehSupplyKingdomCities", "CityBehUpgradeRandomBuilding", "KingdomBehCheckCapital", "KingdomBehCheckKing", "KingdomBehRandomWait", "KingdomCheckAttackTarget", "KingdomCheckDeadKingdom", "KingdomCheckDiplomacy", "KingdomCheckRevolts", "CondGroupLeader", "CondHaveAttackTarget", "CondHaveUnitGroup", "CondNoAttackTarget", "CondNoUnitGroup", "CondNotGroupLeader", "AStarFinder", "AStarParam", "RegionPathFinder", "StaticGrid", "ActorAnimationLoader", "BuildingAnimationLoader", "BuildingSpritesContainer", "MapObjectShadow", "SantaAnimation", "SpriteAnimation", "UnitAvatarLoader", "UnitSpriteAnimation", "AssetLibrary", "AssetManager", "ActorJobLibrary", "ActorStatsLibrary", "ActorTraitLibrary", "BehaviourTaskActorLibrary", "BehaviourTaskCityLibrary", "BehaviourTaskKingdomLibrary", "BuildingLibrary", "CityJobLibrary", "DisasterLibrary", "DropsLibrary", "ItemAccessoryMaterialLibrary", "ItemArmorMaterialLibrary", "ItemLibrary", "ItemPrefixLibrary", "ItemSuffixLibrary", "ItemWeaponMaterialLibrary", "KingdomJobLibrary", "KingdomLibrary", "MoodLibrary", "NameGeneratorLibrary", "PersonalityLibrary", "PowerLibrary", "ProfessionLibrary", "ProjectileLibrary", "RaceLibrary", "ResourceLibrary", "SpellLibrary", "StatusLibrary", "TerraformList", "BaseActorComponent", "BaseAnimatedObject", "BaseBuilding", "BaseCondition", "BaseContainer", "BaseEffect", "BaseMapObject", "BaseObjectData", "BaseSimObject", "BaseStats", "BehaviourActionBase", "BehaviourActionCity", "BehaviourTaskBase", "WorldBehaviour", "Brush", "BrushWindow", "Beehive", "Building", "BuildingEffectSpawnPixel", "BuildingFruitGrowth", "BuildingMapIcon", "BuildingSmokeEffect", "BuildingTower", "Docks", "IceTower", "TumorBuilding", "UnitSpawner", "Wheat", "City", "CityBuildOrder", "CityJobs", "CityPlaceFinder", "CityStorage", "CityTaskList", "CachedRaycastIslands", "GameUtils", "Globals", "ItemTools", "MoveCamera", "PathfinderTools", "PrefabLibrary", "SmoothLoader", "StatsHelper", "ToolBox", "UnusedLibrary", "ViewController", "WaterHelper", "ActiveStatusEffect", "AntimatterBombEffect", "BaseEffectController", "CloudController", "EffectDivineLight", "EffectInfinityCoin", "ExplosionFlash", "ExplosionsEffects", "GlowParticles", "HeatRayEffect", "Meteorite", "NapalmFlash", "NukeFlash", "PixelFlashEffects", "Projectile", "Smoke", "SpawnEffect", "StackEffects", "StatusParticle", "UnitSelectionEffect", "WaveController", "AchievementItem", "AchievementToast", "AchievementView", "GameAudio", "GuideController", "AdView", "AwardView", "BoxGift", "BoxMonster", "CumulativeReward", "InfiniteProp", "LuckyWheel", "OnlineReward", "RecordShare", "MysteryButton", "MysteryReward", "SignInSystem", "SignInView", "DiplomacyManager", "DiplomacyRelation", "Kingdom", "KingdomColor", "KingdomColorContainer", "KingdomColors", "KingdomManager", "KingdomOpinion", "Drop", "DropManager", "GeneratorTool", "ItemGenerator", "NameGenerator", "WorldNameGenerator", "BurnedTilesLayer", "ConwayLife", "FireLayer", "GreyGooLayer", "IslandsCalculator", "LavaLayer", "RoadsCalculator", "UnitLayer", "ZoneCalculator", "MapBorder", "MapChunk", "MapChunkManager", "MapEdges", "MapLayer", "MapMark", "MapMarks", "MapNamesManager", "MapRegion", "MapStats", "MapText", "MarkContainer", "PathFindingVisualiser", "QualityChanger", "RegionLinkHashes", "Heat", "TileDictionary", "TileIsland", "TileMap", "TileMover", "TileType", "TileTypeShortcut", "TileZone", "UnitZones", "WorldTile", "WorldTileData", "WorldTilemap", "WorldTilemapEx", "Cloud", "Earthquake", "PrintLibrary", "Wave", "SaveItem", "SaveList", "SaveManager", "SavePopup", "SavedMap", "StatsData", "TesterBehCloseWindows", "TesterBehCreateBuildings", "TesterBehCreateUnits", "TesterBehDestroySimObjects", "TesterBehEndJobTest", "TesterBehFillWorld", "TesterBehGenerateMap", "TesterBehOpenWindow", "TesterBehRandomPower", "TesterBehSuperDamageToUnits", "TesterBehTaskLibrary", "TesterBehWait", "TesterJobLibrary", "TextureBuffer", "TextureLoader", "TextureRotator", "TextureScale", "UiController", "CensusInfo", "CityInfoElement", "CityWindow", "CreatureInfo", "FavoriteElement", "FavoritesWindow", "KingdomElement", "KingdomListWindow", "KingdomWindow", "WorldInfoWindow", "WorldLawWindow", "HistoryHud", "HistoryHudItem", "WorldLog", "WorldLogElement", "WorldLogMessageExtensions", "WorldLogWindow", "GodActions", "GodPower", "PowerActionsModule", "PowerButton", "PowerButtonSelector", "SelectedPowerNameTip", "GMView", "MapSetting", "Setting", "ToolTip", "WorldTip", "WorldAction", "WorldLaws", "WorldTimer" ]);