function createBitmapByName(t) { var e = new egret.Bitmap, i = RES.getRes(t); return e.texture = i, e } function createBitmapFromSheet(t, e) { void 0 === e && (e = "gameRes"); var i = RES.getRes(e), n = i.getTexture(t), a = new egret.Bitmap; return a.texture = n, a } function getTextureFromSheet(t, e) { void 0 === e && (e = "gameRes"); var i = RES.getRes(e), n = i.getTexture(t); return n } var __reflect = this && this.__reflect || function(t, e, i) { t.__class__ = e, i ? i.push(e) : i = [e], t.__types__ = t.__types__ ? i.concat(t.__types__) : i }, __extends = this && this.__extends || function(t, e) { function i() { this.constructor = t } for (var n in e) e.hasOwnProperty(n) && (t[n] = e[n]); i.prototype = e.prototype, t.prototype = new i }, __awaiter = this && this.__awaiter || function(t, e, i, n) { return new(i || (i = Promise))(function(a, o) { function s(t) { try { h(n.next(t)) } catch(e) { o(e) } } function r(t) { try { h(n["throw"](t)) } catch(e) { o(e) } } function h(t) { t.done ? a(t.value) : new i(function(e) { e(t.value) }).then(s, r) } h((n = n.apply(t, e || [])).next()) }) }, __generator = this && this.__generator || function(t, e) { function i(t) { return function(e) { return n([t, e]) } } function n(i) { if (a) throw new TypeError("Generator is already executing."); for (; h;) try { if (a = 1, o && (s = o[2 & i[0] ? "return": i[0] ? "throw": "next"]) && !(s = s.call(o, i[1])).done) return s; switch (o = 0, s && (i = [0, s.value]), i[0]) { case 0: case 1: s = i; break; case 4: return h.label++, { value: i[1], done: !1 }; case 5: h.label++, o = i[1], i = [0]; continue; case 7: i = h.ops.pop(), h.trys.pop(); continue; default: if (s = h.trys, !(s = s.length > 0 && s[s.length - 1]) && (6 === i[0] || 2 === i[0])) { h = 0; continue } if (3 === i[0] && (!s || i[1] > s[0] && i[1] < s[3])) { h.label = i[1]; break } if (6 === i[0] && h.label < s[1]) { h.label = s[1], s = i; break } if (s && h.label < s[2]) { h.label = s[2], h.ops.push(i); break } s[2] && h.ops.pop(), h.trys.pop(); continue } i = e.call(t, h) } catch(n) { i = [6, n], o = 0 } finally { a = s = 0 } if (5 & i[0]) throw i[1]; return { value: i[0] ? i[1] : void 0, done: !0 } } var a, o, s, r, h = { label: 0, sent: function() { if (1 & s[0]) throw s[1]; return s[1] }, trys: [], ops: [] }; return r = { next: i(0), "throw": i(1), "return": i(2) }, "function" == typeof Symbol && (r[Symbol.iterator] = function() { return this }), r }, game; ! function(t) { var e = function(e) { function i() { var t = e.call(this) || this; return t.scaleX = GameConfig.curWidth() / Const.DESGIN_W, t.scaleY = GameConfig.curHeight() / Const.DESGIN_H, t.touchEnabled = !0, t.addEventListener(egret.TouchEvent.TOUCH_TAP, t.onTouchTap, t), t.addEventListener(egret.Event.ADDED_TO_STAGE, t.onAdded, t), t.addEventListener(egret.Event.REMOVED_FROM_STAGE, t.onRemoved, t), t } return __extends(i, e), i.prototype.onAdded = function() { this.removeEventListener(egret.Event.ADDED_TO_STAGE, this.onAdded, this) }, i.prototype.onRemoved = function() { this.removeEventListener(egret.Event.REMOVED_FROM_STAGE, this.onRemoved, this), this.removeEventListener(egret.TouchEvent.TOUCH_TAP, this.onTouchTap, this), t.UIUtils.removeButtonScaleEffects(this), this.destroy() }, i.prototype.createChildren = function() { e.prototype.createChildren.call(this), t.UIUtils.addButtonScaleEffects(this), this.bindTouchEnded(this) }, i.prototype.destory = function(t) { egret.Tween.get(this).to({ alpha: 0 }, 200).call(function() { t && t() }, this) }, i.prototype.onShowAnimateOver = function() {}, i.prototype.onTouchTap = function(t) {}, i.prototype.bindTouchEnded = function(t) { if (t) { t.name && this[t.name + "TouchEnded"] && t.addEventListener(egret.TouchEvent.TOUCH_END, this[t.name + "TouchEnded"], this); for (var e = t.numChildren, i = 0; e > i; i++) { var n = t.getChildAt(i); this.bindTouchEnded(n) } } }, i.prototype.destroy = function() { this.resGroup }, i } (eui.Component); t.BaseComponent = e, __reflect(e.prototype, "game.BaseComponent") } (game || (game = {})); var HashMap = function() { function t() { this.data = {} } return t.prototype.set = function(t, e) { this.data[t] = e }, t.prototype.put = function(t, e) { this.set(t, e) }, t.prototype.add = function(t, e) { this.set(t, e) }, t.prototype.get = function(t, e) { return 1 == arguments.length ? this.data[t] : this.has(t) ? this.data[t] : e }, t.prototype.has = function(t) { return this.data.hasOwnProperty(t) }, t.prototype.remove = function(t) { this.data[t] = void 0, delete this.data[t] }, t.prototype.clear = function() { this.data = {} }, t.prototype.keys = function() { var t = []; for (var e in this.data) t.push(e); return t }, t.prototype.values = function() { var t = []; for (var e in this.data) t.push(this.data[e]); return t }, t.prototype.reset = function(t) { t && (this.data = t.data || t) }, t.prototype.parse = function(t) { if (t) { var e = JSON.parse(t); this.data = e } }, t.prototype.toString = function() { return JSON.stringify(this.data) }, t } (); __reflect(HashMap.prototype, "HashMap"); var PanelNotify = function() { function t() { this["static"] = "CLOSE_ANSWER" } return t.OPEN_PAY = "OPEN_PAY", t.CLOSE_PAY = "CLOSE_PAY", t.OPEN_ALERT = "PANEL_OPEN_ALERT", t.CLOSE_ALERT = "PANEL_CLOSE_ALERT", t.OPEN_SHOP = "OPEN_SHOP", t.CLOSE_SHOP = "CLOSE_SHOP", t.OPEN_FIND_PASSWORD = "OPEN_FIND_PASSWORD", t.CLOSE_FIND_PASSWORD = "CLOSE_FIND_PASSWORD", t.OPEN_WARE_HOUSE = "OPEN_WARE_HOUSE", t.CLOSE_WARE_HOUSE = "CLOSE_WARE_HOUSE", t.OPEN_PET_USE = "OPEN_PET_USE", t.CLOSE_PET_USE = "CLOSE_PET_USE", t.OPEN_SKIN = "OPEN_SKIN", t.CLOSE_SKIN = "CLOSE_SKIN", t.OPEN_BAG = "OPEN_BAG", t.CLOSE_BAG = "CLOSE_BAG", t.OPEN_BAG2 = "OPEN_BAG2", t.CLOSE_BAG2 = "CLOSE_BAG2", t.OPEN_MOFA = "OPEN_MOFA", t.CLOSE_MOFA = "CLOSE_MOFA", t.OPEN_MOFAHECHENG = "OPEN_MOFAHECHENG", t.CLOSE_MOFAHECHENG = "CLOSE_MOFAHECHENG", t.OPEN_LEVELGIFT = "OPEN_LEVELGIFT", t.CLOSE_LEVELGIFT = "CLOSE_LEVELGIFT", t.OPEN_ONLINEGIFT = "OPEN_ONLINEGIFT", t.CLOSE_ONLINEGIFT = "CLOSE_ONLINEGIFT", t.OPEN_SIGN = "OPEN_SIGN", t.CLOSE_SIGN = "CLOSE_SIGN", t.OPEN_SIGN_LIAN = "OPEN_SIGN_LIAN", t.CLOSE_SIGN_LIAN = "CLOSE_SIGN_LIAN", t.OPEN_FULI = "OPEN_FULI", t.CLOSE_FULI = "CLOSE_FULI", t.OPEN_FULI_GET = "OPEN_FULI_GET", t.CLOSE_FULI_GET = "CLOSE_FULI_GET", t.OPEN_BATTLES_PET = "OPEN_BATTLES_PET", t.CLOSE_BATTLES_PET = "CLOSE_BATTLES_PET", t.OPEN_BATTLE_PET_TIPS = "OPEN_BATTLE_PET_TIPS", t.CLOSE_BATTLE_PET_TIPS = "CLOSE_BATTLE_PET_TIPS", t.OPEN_BATTLE_FRUIT_TIPS = "OPEN_BATTLE_FRUIT_TIPS", t.CLOSE_BATTLE_FRUIT_TIPS = "CLOSE_BATTLE_FRUIT_TIPS", t.OPEN_ASUMENT_PARK = "OPEN_ASUMENT_PARK", t.CLOSE_ASUMENT_PARK = "CLOSE_ASUMENT_PARK", t.OPEN_REWARD_TIPS = "OPEN_REWARD_TIPS", t.CLOSE_REWARD_TIPS = "CLOSE_REWARD_TIPS", t.OPEN_ZUMA = "OPEN_ZUMA", t.CLOSE_ZUMA = "CLOSE_ZUMA", t.OPEN_TIANBING = "OPEN_TIANBING", t.CLOSE_TIANBING = "CLOSE_TIANBING", t.TIANBING_NEXT_QUESTION = "TIANBING_NEXT_QUESTION", t.OPEN_TIANBING_GAMEOVER = "OPEN_TIANBING_GAMEOVER", t.CLOSE_TIANBING_GAMEOVER = "CLOSE_TIANBING_GAMEOVER", t.OPEN_ZHUAWAWA = "OPEN_ZHUAWAWA", t.CLOSE_ZHUAWAWA = "CLOSE_ZHUAWAWA", t.OPEN_SPORTS = "OPEN_SPORTS", t.CLOSE_SPORTS = "CLOSE_SPORTS", t.OPEN_CHENGJIU = "OPEN_CHENGJIU", t.CLOSE_CHENGJIU = "CLOSE_CHENGJIU", t.OPEN_BOX = "OPEN_BOX", t.CLOSE_BOX = "CLOSE_BOX", t.OPEN_CHANGE_GOLD = "OPEN_CHANGE_GOLD", t.CLOSE_CHANGE_GOLD = "CLOSE_CHANGE_GOLD", t.OPEN_LANDEXTEND = "OPEN_LANDEXTEND", t.CLOSE_LANDEXTEND = "CLOSE_LANDEXTEND", t.OPEN_LAND_UPGRADE = "OPEN_LAND_UPGRADE", t.CLOSE_LAND_UPGRADE = "CLOSE_LAND_UPGRADE", t.OPEN_HELP = "OPEN_HELP", t.CLOSE_HELP = "CLOSE_HELP", t.OPEN_HOUSEUPGRADE = "OPEN_HOUSEUPGRADE", t.CLOSE_HOUSEUPGRADE = "CLOSE_HOUSEUPGRADE", t.OPEN_DOG = "OPEN_DOG", t.CLOSE_DOG = "CLOSE_DOG", t.OPEN_DOGTIPS = "OPEN_DOGTIPS", t.CLOSE_DOGTIPS = "CLOSE_DOGTIPS", t.OPEN_FRIEND = "OPEN_FRIEND", t.CLOSE_FRIEND = "CLOSE_FRIEND", t.HIDE_FRIEND = "HIDE_FRIEND", t.SHOW_FRIEND = "SHOW_FRIEND", t.OPEN_FRIEND_ADD = "OPEN_FRIEND_ADD", t.CLOSE_FRIEND_ADD = "CLOSE_FRIEND_ADD", t.OPEN_PLAYER_INFO = "OPEN_PLAYER_INFO", t.CLOSE_PLAYER_INFO = "CLOSE_PLAYER_INFO", t.OPEN_FRIEND_ADD_REQ = "OPEN_FRIEND_ADD_REQ", t.CLOSE_FRIEND_ADD_REQ = "CLOSE_FRIEND_ADD_REQ", t.OPEN_SEND_MESSAGE = "OPEN_SEND_MESSAGE", t.CLOSE_SEND_MESSAGE = "CLOSE_SEND_MESSAGE", t.OPEN_LOG = "OPEN_LOG", t.CLOSE_LOG = "CLOSE_LOG", t.OPEN_REGIST = "OPEN_REGIST", t.CLOSE_REGIST = "CLOSE_REGIST", t.OPEN_FRIEND_GIVE = "OPEN_FRIEND_GIVE", t.CLOSE_FRIEND_GIVE = "CLOSE_FRIEND_GIVE", t.OPEN_FRIEND_GIVE_LIST = "OPEN_FRIEND_GIVE_LIST", t.CLOSE_FRIEND_GIVE_LIST = "CLOSE_FRIEND_GIVE_LIST", t.OPEN_LOTTERY = "OPEN_LOTTERY", t.CLOSE_LOTTERY = "CLOSE_LOTTERY", t.OPEN_RANK = "OPEN_RANK", t.CLOSE_RANK = "CLOSE_RANK", t.OPEN_HELP_SUCCESS = "OPEN_HELP_SUCCESS", t.CLOSE_HELP_SUCCESS = "CLOSE_HELP_SUCCESS", t.OPEN_HAIBAO = "OPEN_ANSWER", t.CLOSE_HAIBAO = "CLOSE_ANSWER", t.CLOSE_EXGOLD = "CLOSE_EXGOLD", t.OPEN_EXGOLD = "OPEN_EXGOLD", t.OPEN_NOTICE = "OPEN_NOTICE", t.CLOSE_NOTICE = "CLOSE_NOTICE", t } (); __reflect(PanelNotify.prototype, "PanelNotify"); var Proxy = function() { function t() {} return t.NET_PROXY = "netProxy", t.WEIXIN_PROXY = "weixinProxy", t.PLAYER_PROXY = "playerProxy", t.AUDIO_PROXY = "audioProxy", t } (); __reflect(Proxy.prototype, "Proxy"); var SysNotify = function() { function t() {} return t.FRIEND_RED = "FRIEND_RED", t.START_GAME = "sys_start_game", t.PLANT_REFRESH = "plant_refresh", t.OTHER_PLANT_REFRESH = "other_plant_refresh", t.LAND_REFRESH = "land_refresh", t.PLANT_REAP = "plant_reap", t.USER_DIAMOND_CHANGE = "user_diamond_change", t.USER_GOLD_CHANGE = "user_gold_change", t.USER_FLOW_CHANGE = "user_flow_change", t.USER_EXP_CHANGE = "user_exp_change", t.USER_GOODS_CHANGE = "user_goods_change", t.USER_HOUSE_CHANGE = "user_house_change", t.USER_SKIN_CHANGE = "user_skin_change", t.USER_DOG_CHANGE = "USER_DOG_CHANGE", t.COOLMENU_HIDE = "coolmenu_hide", t.GOD_ACTIVE = "god_active", t.SHOP_QUERY_LIMIT = "shop_query_limit", t.BAG_CLOSE = "bag_close", t.FRIEND_DEAL_OVER = "friend_deal_over", t.FRIEND_REFRESH = "friend_refresh", t.DOG_ENDTIME_CHANGE = "dog_endtime_change", t.BOX_LIST_CHANGE = "box_list_change", t.TOPLAYER_INFO_UPDATE = "TOPLAYER_INFO_UPDATE", t.FLUSH_GROUP3 = "FLUSH_GROUP3", t.SHOW_MESSAGE = "SHOW_MESSAGE", t.DOG_UPDAT = "DOG_UPDAT", t.MOFAJIAGONG_UPDATA = "MOFAJIAGONG_UPDATA", t.MOFAHECHENG_UPDATA = "MOFAHECHENG_UPDATA", t.GETREWARD_UPDATA = "GETREWARD_UPDATA", t.GETSIGNS_UPDATA = "GETSIGNS_UPDATA", t.GETVIPREWARD_UPDATA = "GETVIPREWARD_UPDATA", t.PET_FUHUA_UPDATA = "PET_FUHUA_UPDATA", t.PET_UODATA = "PET_FUHUA_UPDATA", t.START_ATTACK = "START_ATTACK", t.END_ATTACK = "END_ATTACK", t.BE_ATTACK = "BE_ATTACK", t.BE_END_ATTACK = "BE_END_ATTACK", t.DODGE = "DODGE", t.DODGE_END = "DODGE_END", t.CHENGJIU_UPDATA = "CHENGJIU_UPDATA", t.SPORT_UPDATA = "SPORT_UPDATA", t.BOX_UPDATA = "BOX_UPDATA", t.BOX_OPEN = "BOX_OPEN", t.STOG_UPDATA = "STOG_UPDATA", t.GTOS_UPDATA = "GTOS_UPDATA", t.CHANGE_LIST = "CHANGE_LIST", t } (); __reflect(SysNotify.prototype, "SysNotify"); var ResourceProxyBase = function(t) { function e(e) { void 0 === e && (e = ""); var i = t.call(this, e) || this; return i._dataMap = new Array, i._proxyName = "", i._proxyName = e, i } return __extends(e, t), e.prototype.getData = function() { var t = RES.getRes(this._proxyName); return t }, e } (puremvc.Proxy); __reflect(ResourceProxyBase.prototype, "ResourceProxyBase", ["puremvc.IProxy", "puremvc.INotifier"]); var ClientNotify = function() { function t() {} return t.FLUSH_FARM = "FLUSH_FARM", t.LAND_SHOUHUO = "LAND_SHOUHUO", t.LAND_CHANCHU = "LAND_CHANCHU", t.LAND_EXTEND = "LAND_EXTEND", t.LAND_UPGRADE = "LAND_UPGRADE", t.UPGREADE_HOUSE = "UPGREADE_HOUSE", t.KICK_BUG = "KICK_BUG", t.KICK_GRASS = "KICK_GRASS", t.KICK_WATER = "KICK_WATER", t.GAO_SHI = "GAO_SHI", t.USE_FERTILIZE = "USE_FERTILIZE", t.ASK_FRIENDREQ = "ASK_FRIENDREQ", t.GO_OTHER_FARM = "GO_OTHER_FARM", t.SHOW_CONFIRM_ALERT = "SHOW_CONFIRM_ALERT", t.SHOW_BOTH_GAME_SCENE = "SHOW_BOTH_GAME_SCENE", t.GIVE_SUCCESS = "GIVE_SUCCESS", t.TOUFANG_SUCCES = "TOUFANG_SUCCES", t.CLEAR_ANIMALS = "CLEAR_ANIMALS", t.UPDATA_SIMPLE_ANIMAL = "UPDATA_SIMPLE_ANIMAL", t.DELETE_ANIMAL = "DELETE_ANIMAL", t } (); __reflect(ClientNotify.prototype, "ClientNotify"); var game; ! function(t) { var e = function(e) { function i() { var t = e.call(this) || this; return t.addEventListener(egret.Event.ADDED_TO_STAGE, t.onAdd, t), t.addEventListener(egret.Event.REMOVED_FROM_STAGE, t.onRemove, t), t.scaleX = GameConfig.curWidth() / GameConfig.DES_WIDTH, t.scaleY = GameConfig.curHeight() / GameConfig.DES_HEIGHT, t } return __extends(i, e), i.prototype.createdChildren = function() { e.prototype.createChildren.call(this), this.creates() }, i.prototype.childrenCreated = function() { e.prototype.childrenCreated.call(this), this.createds() }, i.prototype.onAdd = function(e) { t.UIUtils.addButtonScaleEffects(this), this.adds() }, i.prototype.onRemove = function(e) { t.UIUtils.removeButtonScaleEffects(this), this.removes() }, i.prototype.adds = function() {}, i.prototype.removes = function() {}, i.prototype.createds = function() {}, i.prototype.creates = function() {}, i } (eui.Component); t.BasePanel2 = e, __reflect(e.prototype, "game.BasePanel2") } (game || (game = {})); var game; ! function(t) { var e = function(e) { function i() { var t = e.call(this) || this; return t.addEventListener(egret.TouchEvent.TOUCH_TAP, t.onTouchTap, t), t.addEventListener(egret.Event.ADDED_TO_STAGE, t.onAdded, t), t.addEventListener(egret.Event.REMOVED_FROM_STAGE, t.onRemoved, t), t } return __extends(i, e), i.prototype.onAdded = function() { this.removeEventListener(egret.Event.ADDED_TO_STAGE, this.onAdded, this) }, i.prototype.onRemoved = function() { this.removeEventListener(egret.Event.REMOVED_FROM_STAGE, this.onRemoved, this), this.removeEventListener(egret.TouchEvent.TOUCH_TAP, this.onTouchTap, this), t.UIUtils.removeButtonScaleEffects(this) }, i.prototype.createChildren = function() { e.prototype.createChildren.call(this), t.UIUtils.addButtonScaleEffects(this) }, i.prototype.onTouchTap = function(t) {}, i } (eui.ItemRenderer); t.BaseItemRenderer = e, __reflect(e.prototype, "game.BaseItemRenderer") } (game || (game = {})); var game; ! function(t) { var e = function(e) { function i() { var t = e.call(this) || this; return t.isVisibleAnimate = !0, t.helpTxtId = -1, t.isFullScreen = !1, t.createChildrened = !1, t.touchEnabled = !0, t.initsize(), t.addEventListener(egret.TouchEvent.TOUCH_TAP, t.onTouchTap, t), t.addEventListener(egret.Event.ADDED_TO_STAGE, t.onAdded, t), t.addEventListener(egret.Event.REMOVED_FROM_STAGE, t.onRemoved, t), t } return __extends(i, e), i.prototype.initsize = function() { this.scaleX = GameConfig.curWidth() / Const.DESGIN_W, this.scaleY = GameConfig.curHeight() / Const.DESGIN_H }, i.prototype.onAdded = function() { this.createChildrened && this.onShow() }, i.prototype.setMediator = function(t) { this.mediator && (this.mediator = t) }, i.prototype.createChildren = function() { e.prototype.createChildren.call(this), this.panelCommon && (this.commonPanel = new t.PanelCommon(this.panelCommon), this.btnClose = this.commonPanel.btnClose, this.btnHelp = this.commonPanel.btnHelp, this.closeBtn = this.commonPanel.closeBtn), this.btnHelp && (this.btnHelp.visible = this.helpTxtId > 0), this.isFullScreen, this.btnClose && this.btnClose.addEventListener(egret.TouchEvent.TOUCH_TAP, this.btnCloseTouchEnded, this), this.closeBtn && this.closeBtn.addEventListener(egret.TouchEvent.TOUCH_TAP, this.closeBtnTouchEnded, this), t.UIUtils.addButtonScaleEffects(this), this.bindTouchEnded(this), this.onShow(), this.createChildrened = !0 }, i.prototype.closeBtnTouchEnded = function() {}, i.prototype.onTouchTap = function(t) {}, i.prototype.btnCloseTouchEnded = function() { this.isVisibleAnimate && this.onHide() }, i.prototype.onRemoved = function() { this.removeEventListener(egret.Event.ADDED_TO_STAGE, this.onAdded, this), this.removeEventListener(egret.Event.REMOVED_FROM_STAGE, this.onRemoved, this), this.removeEventListener(egret.TouchEvent.TOUCH_TAP, this.onTouchTap, this), t.UIUtils.removeButtonScaleEffects(this) }, i.prototype.bindTouchEnded = function(t) { if (t) { t.name && this[t.name + "TouchEnded"] && t.addEventListener(egret.TouchEvent.TOUCH_END, this[t.name + "TouchEnded"], this); for (var e = t.numChildren, i = 0; e > i; i++) { var n = t.getChildAt(i); this.bindTouchEnded(n) } } }, i.prototype.onShow = function() { if (this.isVisibleAnimate) { this.x = Const.WIN_W / 2, this.y = Const.WIN_H / 2, this._startPos && (this.x = this._startPos.x, this.y = this._startPos.y); var t = (Const.WIN_W - this.width) / 2, e = (Const.WIN_H - this.height) / 2; this.scaleX = this.scaleY = 0, egret.Tween.get(this).to({ x: t, y: e, scaleX: 1, scaleY: 1 }, 250, egret.Ease.backOut).call(this.onShowAnimateOver, this) } else this.onShowAnimateOver() }, i.prototype.onShowAnimateOver = function() {}, i.prototype.btnHelpTouchEnded = function() { this.helpTxtId > 0 && t.AppFacade.getInstance().sendNotification(PanelNotify.OPEN_HELP, { textId: this.helpTxtId }) }, i.prototype.onHideAnimateOver = function() {}, i.prototype.onHide = function() { if (this.isVisibleAnimate) { var e = Const.WIN_W / 2, i = Const.WIN_H / 2; this._startPos && (e = this._startPos.x, i = this._startPos.y), egret.Tween.get(this).to({ x: e, y: i, scaleX: 0, scaleY: 0 }, 250, egret.Ease.backIn).call(this.onHideAnimateOver, this).call(t.UIUtils.removeSelf, this, [this]) } else this.onHideAnimateOver(), t.UIUtils.removeSelf(this) }, i } (eui.Component); t.BasePanel = e, __reflect(e.prototype, "game.BasePanel") } (game || (game = {})); var BaseMediator = function(t) { function e(e, i) { void 0 === e && (e = ""), void 0 === i && (i = null); var n = t.call(this, e, i) || this; return n.isInitialized = !1, n.isPopUp = !1, n.ui = null, n.w = 0, n.h = 0, n.type = "panel", n.w = GameConfig.curWidth(), n.h = GameConfig.curHeight(), n } return __extends(e, t), e.prototype.showUI = function(t, e, i, n, a, o) { void 0 === e && (e = !0), void 0 === i && (i = 0), void 0 === n && (n = 0), void 0 === a && (a = 0), void 0 === o && (o = !1), this.ui = t, this.beforShow(), this.initUI(), this.initData(), PopUpManager.addPopUp(t, e, i, n, a, o) }, e.prototype.beforShow = function() {}, e.prototype.initUI = function() {}, e.prototype.hideViewComponent = function(t) { t ? PopUpManager.showPanel(this.viewComponent) : PopUpManager.hidePanel(this.viewComponent) }, e.prototype.closeViewComponent = function(t) { return void 0 === t && (t = 1), __awaiter(this, void 0, void 0, function() { var e; return __generator(this, function(i) { switch (this.type) { case "panel": e = this, PopUpManager.removePopUpAsync(e.viewComponent, t, function() {}); break; case "scene": this.viewComponent && game.UIUtils.removeSelf(this.viewComponent) } return [2] }) }) }, e.prototype.initData = function() {}, e.prototype.destroy = function() {}, e.prototype.getIsPopUp = function() { return this.isPopUp }, e.prototype.getIsInit = function() { return this.isInitialized }, e.prototype.getWidth = function() { return this.ui.width }, e.prototype.getHeight = function() { return this.ui.height }, e } (puremvc.Mediator); __reflect(BaseMediator.prototype, "BaseMediator", ["puremvc.IMediator", "puremvc.INotifier"]); var SceneBase = function(t) { function e() { var e = t.call(this) || this; return e.width = Const.WIN_W, e.height = Const.WIN_H, e.touchEnabled = !0, e.addEventListener(egret.TouchEvent.TOUCH_TAP, e.onTouchTap, e), e.addEventListener(egret.Event.ADDED_TO_STAGE, e.onAdded, e), e.addEventListener(egret.Event.REMOVED_FROM_STAGE, e.onRemoved, e), e } return __extends(e, t), e.prototype.onAdded = function() { this.removeEventListener(egret.Event.ADDED_TO_STAGE, this.onAdded, this) }, e.prototype.onRemoved = function() { this.removeEventListener(egret.Event.REMOVED_FROM_STAGE, this.onRemoved, this), this.removeEventListener(egret.TouchEvent.TOUCH_TAP, this.onTouchTap, this), game.UIUtils.removeButtonScaleEffects(this), this.destroy() }, e.prototype.destroy = function() { this.resGroup && RES.destroyRes(this.resGroup) }, e.prototype.createChildren = function() { t.prototype.createChildren.call(this), game.UIUtils.addButtonScaleEffects(this) }, e.prototype.onTouchTap = function(t) {}, e } (eui.Panel); __reflect(SceneBase.prototype, "SceneBase"); var GiftManager = function(t) { function e() { var e = t.call(this) || this; return e.onLineDataArr = [], e.co = 0, e } return __extends(e, t), e.getInstance = function() { return this._insatance || (this._insatance = new e), this._insatance }, e.prototype.initData = function(t) { this.online_start_time = t.online_start_time, this.online_last_time = t.online_last_time, this.online_total_time = t.online_total_time, this.online_get_count = t.online_get_count, this.onLineDataArr.length = 0; var e = Global.gameProxy.getOnlineGiftConfig(); for (var i in e) { var t = {}, n = e[i].receive_time - this.online_total_time; t.receive_time = n > 0 ? n: 0, t.fruit_id4 = e[i].fruit_id4, t.fruit_id3 = e[i].fruit_id3, t.fruit_id2 = e[i].fruit_id2, t.fruit_id1 = e[i].fruit_id1, t.id = e[i].id; var a = Global.playerProxy.playerData.online_gift_get_count % 7; a >= t.id ? (t.isGet = 0, t.receive_time = 0) : (a = t.id - 1) ? t.isGet = 1 : t.isGet = 2, this.onLineDataArr.push(t) } this.addTimer() }, e.prototype.getDataForID = function(t) { for (var e = 0; e < this.onLineDataArr.length; e++) if (this.onLineDataArr[e].id == t) return this.onLineDataArr[e]; return null }, e.prototype.addTimer = function() { core.TimerManager.instance.addTick(1e3, 0, this.onTimer, this) }, e.prototype.onTimer = function() { for (var t = Global.playerProxy.playerData.online_gift_get_count % 7, e = 0; e < this.onLineDataArr.length; e++) this.onLineDataArr[e].receive_time >= 1 && (this.onLineDataArr[e].receive_time -= 1), t >= this.onLineDataArr[e].id ? this.onLineDataArr[e].isGet = 0 : t == this.onLineDataArr[e].id - 1 && 0 == this.onLineDataArr[e].receive_time ? this.onLineDataArr[e].isGet = 1 : this.onLineDataArr[e].isGet = 2; this.co++, this.co >= 30 && (this.co = 0, Global.netProxy.sendRequest(GameConfig.SERVER_PATH + "comm/ping", {}, null)) }, e.prototype.getNetOnLineGift = function() { Global.netProxy.sendRequest(GameConfig.SERVER_PATH + "user/get-online-gift", {}, this.onGetNetOnLineGift.bind(this)) }, e.prototype.onGetNetOnLineGift = function(t) { if (0 == t.status) { Global.playerProxy.playerData.online_gift_get_count += 1; var e = this.getDataForID(this.curid); e.receive_time = 0, e.isGet = 0; var i = ""; for (var n in e)("fruit_id1" == n || "fruit_id2" == n || "fruit_id3" == n || "fruit_id4" == n) && e[n] && (i += e[n] + ","); Global.playerProxy.addItem1(i), game.EventManager.instance.dispatch(SysNotify.TOPLAYER_INFO_UPDATE), game.EventManager.instance.dispatch(SysNotify.GETREWARD_UPDATA) } else TipsUtils.showTipsDownToUp(GameConfig.ServerCode[t.status]) }, e } (egret.EventDispatcher); __reflect(GiftManager.prototype, "GiftManager"); var game; ! function(t) { var e = function() { function e() {} return e.getPlant = function(e, i) { if (i == t.PlantStatus.seed) return "resource/assets/icon/plant/plant_p0.png"; if (i == t.PlantStatus.die) return "resource/assets/icon/plant/plant_p4.png"; var n = Global.gameProxy.getPlantConfig(e); return "resource/assets/icon/plant/" + (i == t.PlantStatus.seeding ? n.g1: i == t.PlantStatus.growup ? n.g2: n.g3) + ".png" }, e.getIcon = function(t) { return "resource/assets/icon/icon/" + t + ".png" }, e.getHead = function(t) { return "resource/assets/icon/head/head" + t + ".png" }, e.getLand = function(t) { return "resource/assets/icon/land/" + t + ".png" }, e.getSkin = function(t) { return "resource/assets/icon/skin/" + t + ".png" }, e.getSkinName = function(t) { return "resource/assets/icon/skin/skin_name_" + t + ".png" }, e.getGround = function(t) { return "resource/assets/icon/skin/" + t + ".jpg" }, e.getGroundFenceFront = function(t) { return "resource/assets/icon/skin/" + t + "_1.png" }, e.getGroundFenceBack = function(t) { return "resource/assets/icon/skin/" + t + "_0.png" }, e.getHouse = function(t) { return "resource/assets/icon/house/" + t + ".png" }, e.getBox = function(t) { return "resource/assets/icon/box/" + t + ".png" }, e } (); t.URLConfig = e, __reflect(e.prototype, "game.URLConfig") } (game || (game = {})); var game; ! function(t) { var e = function(e) { function i() { return e.call(this) || this } return __extends(i, e), i.getInstance = function() { return null == this.instance && (this.instance = new i), this.instance }, i.prototype.initializeController = function() { e.prototype.initializeController.call(this), this.registerCommand(i.STARTUP, t.StartupCommand) }, i.prototype.startUp = function(t) { i.getInstance().sendNotification(i.STARTUP, t), this.removeCommand(i.STARTUP) }, i.STARTUP = "startup", i } (puremvc.Facade); t.AppFacade = e, __reflect(e.prototype, "game.AppFacade", ["puremvc.IFacade", "puremvc.INotifier"]) } (game || (game = {})); var LoadingUI = function(t) { function e() { var e = t.call(this) || this; return e.createView(), e } return __extends(e, t), e.prototype.createView = function() { this.textField = new egret.TextField, this.addChild(this.textField), this.textField.y = 300, this.textField.width = 480, this.textField.height = 100, this.textField.textAlign = "center" }, e.prototype.onProgress = function(t, e) { this.textField.text = "Loading..." + t + "/" + e }, e } (egret.Sprite); __reflect(LoadingUI.prototype, "LoadingUI", ["RES.PromiseTaskReporter"]); var Main = function(t) { function e() { return null !== t && t.apply(this, arguments) || this } return __extends(e, t), e.prototype.createChildren = function() { t.prototype.createChildren.call(this), egret.lifecycle.addLifecycleListener(function(t) {}), egret.lifecycle.onPause = function() { egret.ticker.pause() }, egret.lifecycle.onResume = function() { egret.ticker.resume() }; var e = new AssetAdapter; egret.registerImplementation("eui.IAssetAdapter", e), egret.registerImplementation("eui.IThemeAdapter", new ThemeAdapter), this.runGame()["catch"](function(t) { console.log(t) }) }, e.prototype.runGame = function() { return __awaiter(this, void 0, void 0, function() { var t; return __generator(this, function(e) { switch (e.label) { case 0: return [4, this.loadResource()]; case 1: return e.sent(), this.addChild(GameLayerManager.gameLayer()), game.AppFacade.getInstance().startUp(GameLayerManager.gameLayer()), this.createGameScene(), [4, platform.login()]; case 2: return e.sent(), [4, platform.getUserInfo()]; case 3: return t = e.sent(), console.log(t), [2] } }) }) }, e.prototype.loadResource = function() { return __awaiter(this, void 0, void 0, function() { var t, e; return __generator(this, function(i) { switch (i.label) { case 0: return i.trys.push([0, 4, , 5]), t = new LoadingUI, this.stage.addChild(t), [4, RES.loadConfig("resource/default.res.json", "resource/")]; case 1: return i.sent(), [4, this.loadTheme()]; case 2: return i.sent(), [4, RES.loadGroup("preload", 0, t)]; case 3: return i.sent(), this.stage.removeChild(t), [3, 5]; case 4: return e = i.sent(), console.error(e), [3, 5]; case 5: return [2] } }) }) }, e.prototype.loadTheme = function() { var t = this; return new Promise(function(e, i) { var n = new eui.Theme("resource/default.thm.json", t.stage); n.addEventListener(eui.UIEvent.COMPLETE, function() { e() }, t) }) }, e.prototype.createGameScene = function() { Const.stage = this.stage, Const.WIN_W = this.stage.stageWidth, Const.WIN_H = this.stage.stageHeight, DateTimer.instance.run(), game.AppFacade.getInstance().sendNotification(SysNotify.START_GAME) }, e } (eui.UILayer); __reflect(Main.prototype, "Main"); var SceneNotify = function() { function t() {} return t.OPEN_BATTLEPET = "SceneNotify_OPEN_BATTLEPET", t.CLOSE_BATTLEPET = "SceneNotify_CLOSE_BATTLEPET", t.OPEN_LOGIN = "SceneNotify_OPEN_LOGIN", t.CLOSE_LOGIN = "SceneNotify_CLOSE_LOGIN", t.CLOSE_LOADING = "SceneNotify_CLOSE_LOADING", t.OPEN_CREATEROLE = "SceneNotify_OPEN_CREATEROLE", t.CLOSE_CREATEROLE = "SceneNotify_CLOSE_CREATEROLE", t.OPEN_OTHER_GAME = "SceneNotify_OPEN_OTHER_GAME", t.OPEN_MINE_GAME = "SceneNotify_OPEN_MINE_GAME", t.BACK_MINE_GAME = "SceneNotify_BACK_MINE_GAME", t.OPEN_OTHER_MGAME = "SceneNotify_OPEN_OTHER_MGAME", t.OPEN_MINE_MGAME = "SceneNotify_OPEN_MINE_MGAME", t.BACK_MINE_MGAME = "SceneNotify_BACK_MINE_MGAME", t.CLOSE_GAME = "SceneNotify_CLOSE_GAME", t.CLOSE_MGAME = "SceneNotify_CLOSE_MGAME", t.GAME_NEXT_QUESTION = "GAME_NEXT_QUESTION", t.CLOSE_TOUCH_GROUP = "CLOSE_TOUCH_GROUP", t.OPEN_SAY = "OPEN_SAY", t.CLOSE_SAY = "CLOSE_SAY", t } (); __reflect(SceneNotify.prototype, "SceneNotify"); var DebugPlatform = function() { function t() {} return t.prototype.getUserInfo = function() { return __awaiter(this, void 0, void 0, function() { return __generator(this, function(t) { return [2, { nickName: "username" }] }) }) }, t.prototype.login = function() { return __awaiter(this, void 0, void 0, function() { return __generator(this, function(t) { return [2] }) }) }, t } (); __reflect(DebugPlatform.prototype, "DebugPlatform", ["Platform"]), window.platform || (window.platform = new DebugPlatform); var game; ! function(t) { var e = function(e) { function i() { return e.call(this) || this } return __extends(i, e), i.prototype.execute = function(e) { this.facade.registerCommand(ClientNotify.GO_OTHER_FARM, t.GoOtherFarmCommand) }, i } (puremvc.SimpleCommand); t.ControllerPrepCommand = e, __reflect(e.prototype, "game.ControllerPrepCommand", ["puremvc.ICommand", "puremvc.INotifier"]) } (game || (game = {})); var game; ! function(t) { var e = function(t) { function e() { return t.call(this) || this } return __extends(e, t), e.prototype.execute = function(t) { var e = this, i = t.getBody().uid, n = GameConfig.SERVER_PATH + "interaction/get-other-user-info"; Global.netProxy.sendRequest(n, { be_user_id: i }, function(t) { return 0 !== t.status ? void TipsUtils.showErrorCodeTips(t.status) : (Global.otherPlayerProxy.setPlayerData(t.data), Global.otherPlayerProxy.setPlayerLandData(t.data), void e.facade.sendNotification(SceneNotify.OPEN_OTHER_GAME)) }) }, e.NAME = "GoOtherFarmCommand", e } (puremvc.SimpleCommand); t.GoOtherFarmCommand = e, __reflect(e.prototype, "game.GoOtherFarmCommand", ["puremvc.ICommand", "puremvc.INotifier"]) } (game || (game = {})); var game; ! function(t) { var e = function(e) { function i() { return e.call(this) || this } return __extends(i, e), i.prototype.execute = function(e) { var i = [t.NetProxy, t.PlayerProxy, t.OtherPlayerProxy, t.WeixinProxy, t.AudioProxy, t.GameProxy], n = this; _.forEach(i, function(t, e) { var a = new i[e]; n.facade.registerProxy(a), a && a.init && a.init() }) }, i } (puremvc.SimpleCommand); t.ModelPrepCommand = e, __reflect(e.prototype, "game.ModelPrepCommand", ["puremvc.ICommand", "puremvc.INotifier"]) } (game || (game = {})); var game; ! function(t) { var e = function(e) { function i() { return e.call(this) || this } return __extends(i, e), i.prototype.initializeMacroCommand = function() { this.addSubCommand(t.ControllerPrepCommand), this.addSubCommand(t.ModelPrepCommand), this.addSubCommand(t.ViewPrepCommand) }, i } (puremvc.MacroCommand); t.StartupCommand = e, __reflect(e.prototype, "game.StartupCommand") } (game || (game = {})); var game; ! function(t) { var e = function(e) { function i() { return e.call(this) || this } return __extends(i, e), i.prototype.execute = function(e) { this.facade.registerMediator(new t.AlertMediator), this.facade.registerMediator(new t.LogoMediator), this.facade.registerMediator(new t.RegisterMediator) }, i } (puremvc.SimpleCommand); t.ViewPrepCommand = e, __reflect(e.prototype, "game.ViewPrepCommand", ["puremvc.ICommand", "puremvc.INotifier"]) } (game || (game = {})); var game; ! function(t) { var e = function(t) { function e() { var i = t.call(this, e.NAME) || this; return i.soundOpen = !0, i } return __extends(e, t), e.prototype.init = function() { Global.audioProxy = this; var t = egret.localStorage.getItem("farm1.sound"); this.isOpen = t && "0" === t ? !1 : !0, console.log("this.isOpen:" + this.isOpen) }, e.prototype.setSoundOpen = function(t) { this.soundOpen = t }, e.prototype.closeBgMusic = function() { this.isOpen && this.channel && (this.channel.stop(), this.backgroundSound = null) }, e.prototype.setVolice = function(t) { this.moveChannel && (this.moveChannel.volume = t) }, e.prototype.startBgMusic = function() { this.isOpen && (this.backgroundSound || (this.backgroundSound = RES.getRes("background_mp3"), this.channel && (this.channel.stop(), this.channel = null), this.channel = this.backgroundSound.play(0, -1))) }, e.prototype.startBgMusic1 = function() { this.isOpen && (this.backgroundSound || (this.backgroundSound = RES.getRes("background_1_mp3"), this.channel && (this.channel.stop(), this.channel = null), this.channel = this.backgroundSound.play(0, -1))) }, e.prototype.openSound = function(t) { if (this.isOpen = t, t) { if (this.channel) return; this.backgroundSound = RES.getRes("background_mp3"), this.backgroundSound && (this.channel = this.backgroundSound.play(0, -1), this.channel.volume = 1) } else this.channel && this.channel.stop(), this.channel = null }, e.prototype.playSound = function(t) { if (this.soundOpen) { var e = RES.getRes(t); e && e.play(0, 1) } }, e.prototype.playSoundCount = function(t, e, i) { if (void 0 === i && (i = 1), this.isOpen) { var n = RES.getRes(t); this.moveChannel = n.play(0, e), this.moveChannel.volume = i } }, e.NAME = Proxy.AUDIO_PROXY, e } (puremvc.Proxy); t.AudioProxy = e, __reflect(e.prototype, "game.AudioProxy", ["puremvc.IProxy", "puremvc.INotifier"]) } (game || (game = {})); var game; ! function(t) { var e = function(e) { function i() { var t = e.call(this, i.NAME) || this; return t.allShopItemDatas = [], t } return __extends(i, e), i.prototype.init = function() { Global.gameProxy = this }, i.prototype.getGameConfigJson = function(t) { var e = this; Global.netProxy.sendRequest(GameConfig.SERVER_PATH + "comm/game-config", { msg: 123 }, function(i) { 0 === i.status ? (e.gameConfig = i.data, e.initShopItemDatas(), t && t()) : Global.alertMediator.addAlert("获取游戏配置失败,请重新打开游戏!") }) }, i.prototype.getLvConfigByLv = function(e) { return this.gameConfig[t.TabelName.player_level][e] }, i.prototype.getMaxExpByLv = function(e) { return e + 1 > 60 && (e = 60), this.gameConfig[t.TabelName.player_level][e].exp }, i.prototype.getAllShopConfig = function() { return this.gameConfig[t.TabelName.store_list] }, i.prototype.initShopItemDatas = function() { var e = this.getAllShopConfig(); for (var i in e) if (i && "undefined" !== i) { var n = e[i], a = new t.ShopItemData(n); this.allShopItemDatas.push(a) } }, i.prototype.getShopConfigByType = function(t) { return _.groupBy(this.allShopItemDatas, "type")[t] }, i.prototype.getCommonConfigById = function(e) { return this.gameConfig[t.TabelName.common][e] }, i.prototype.getPlantConfig = function(e) { return new t.PlantConfig(this.gameConfig[t.TabelName.crop_list][e]) }, i.prototype.getFirstGiftConfig = function() { return this.gameConfig.novice_pack_list }, i.prototype.getPlantConfigByPlantId = function(e) { var i = _.groupBy(this.gameConfig[t.TabelName.crop_list], "item_id"); return i[e][0] }, i.prototype.getPlantConfigbase = function(e) { return this.gameConfig[t.TabelName.crop_list][e] }, i.prototype.getItemImageId = function(e) { var i = this.getItemConfig(e); return i && null != i.graphical_id ? i.graphical_id : 3002 }, i.prototype.getItemConfig = function(e) { var i = this.gameConfig[t.TabelName.item_list] || {}, n = i[e]; return n || (n = { id: e, type1: 0, type2: 0, name: "未知物品" + e, graphical_id: 3002, player_level: 1, sell_gold: 0, effect_id: 0, desc: "本地配置缺少该物品" }), n }, i.prototype.getLandExtendConfig = function(e) { return this.gameConfig[t.TabelName.land_extend][e] }, i.prototype.getTextConfig = function(e) { return this.gameConfig[t.TabelName.txt_list][e] }, i.prototype.getHouseUpgradeConfig = function(e) { return this.gameConfig[t.TabelName.farm_level][e] }, i.prototype.getTabelConfigByType = function(t) { return this.gameConfig[t] }, i.prototype.getConfigArrFactory = function() { var t = this.gameConfig.factory, e = []; for (var i in t) t[i].id <= 15 && e.push(t[i]); return e }, i.prototype.getCurItemArrforFactoryLV = function(t) { void 0 === t && (t = 0); for (var e = this.getConfigArrFactory(), i = [], n = 0; n < e.length; n++) e[n].level <= t && i.push(e[n]); return i }, i.prototype.getFactoryConfigForID = function(t) { return this.gameConfig.factory_upgrade[t] }, i.prototype.gethechengConfig = function() { return this.gameConfig.compose }, i.prototype.getCurhechengArrforLV = function(t) { var e = this.gethechengConfig(), i = []; for (var n in e) 0 == t ? e[n].id <= 5 && i.push(e[n]) : e[n].id > 5 && i.push(e[n]); return i }, i.prototype.getOnlineGiftConfig = function() { return this.gameConfig.online_gift }, i.prototype.getOnlineGiftConfigForID = function(t) { return this.gameConfig.online_gift[t] }, i.prototype.getLevelGiftConfig = function() { return this.gameConfig.player_level_gift }, i.prototype.getLevelGiftConfigforID = function(t) { return this.gameConfig.player_level_gift[t] }, i.prototype.getSignConfig = function() { return this.gameConfig.sign }, i.prototype.getSignConfigForID = function(t) { return this.gameConfig.sign[t] }, i.prototype.getVipConfig = function() { return this.gameConfig.vip_list }, i.prototype.getVipConfigForID = function(t) { return this.gameConfig.vip_list[t] }, i.prototype.getzyConfig = function() { return this.gameConfig.card }, i.prototype.getzyConfigForID = function(t) { return this.gameConfig.card[t] }, i.prototype.getPetBaseConfig = function() { return this.gameConfig.pet }, i.prototype.getPetBaseConfigForID = function(t) { return this.gameConfig.pet[t] }, i.prototype.getPetUpConfig = function() { return this.gameConfig.pet_level }, i.prototype.getPetUpConfigForID = function(t) { return this.gameConfig.pet_level[t] }, i.prototype.getPetJinConfig = function() { return this.gameConfig.evolution_list }, i.prototype.getPetJinConfigForID = function(t) { return this.gameConfig.evolution_list[t] }, i.prototype.getPetXiahaoConfig = function() { return this.gameConfig.culture }, i.prototype.getPetXiaohaoConfigForID = function(t) { return this.gameConfig.culture[t] }, i.prototype.getItemSFConfig = function() { return this.gameConfig.battle }, i.prototype.getItemSFConfigForID = function(t) { return this.gameConfig.battle[t] }, i.prototype.getAsumentParkConfig = function() { return this.gameConfig.playground }, i.prototype.getAsumentParConfigForID = function(t) { return this.gameConfig.playground[t] }, i.prototype.getSportConfig = function() { return this.gameConfig.arena }, i.prototype.getSportConfigForID = function(t) { return this.gameConfig.arena[t] }, i.prototype.getSportConfigForRank = function(t) { var e = this.gameConfig.arena; for (var i in e) if (t >= e[i].ranking_min_id && t <= e[i].ranking_mzx_id) return e[i] }, i.prototype.getTaskConfig = function() { return this.gameConfig.daily_list }, i.prototype.getTaskConfigForID = function(t) { return this.gameConfig.daily_list[t] }, i.prototype.getChengjiuConfig = function() { return this.gameConfig.achievement_list }, i.prototype.getChengjiuConfigForID = function(t) { return this.gameConfig.achievement_list[t] }, i.prototype.getBoxConfig = function() { return this.gameConfig["case"] }, i.prototype.getBoxConfigForID = function(t) { return this.gameConfig["case"][t] }, i.prototype.getCommonConfig = function() { return this.gameConfig[t.TabelName.common] }, i.NAME = "GameProxy", i } (ResourceProxyBase); t.GameProxy = e, __reflect(e.prototype, "game.GameProxy") } (game || (game = {})); var game; ! function(t) { var e = function(t) { function e() { var e = null !== t && t.apply(this, arguments) || this; return e.callbackList = new HashMap, e.base64 = window.Base64, e.lockReq = !1, e.token = "", e } return __extends(e, t), e.prototype.init = function() { Global.netProxy = this }, e.prototype.setToken = function(t) { this.token = t }, e.prototype.startUnlockTimeout = function() { this.lockTimeOut && (egret.clearTimeout(this.lockTimeOut), this.lockTimeOut = null), egret.setTimeout(function() { this.lockReq = !1 }, this, 2e3) }, e.prototype.sendRequest = function(t, e, i) { if (console.log(this.lockReq), !this.lockReq) { this.token && e && (e.token = this.token), this.lockReq = !0; var n = new egret.URLLoader; this.callbackList.set(n.hashCode, i), n.dataFormat = egret.URLLoaderDataFormat.TEXT, n.addEventListener(egret.Event.COMPLETE, this.onPostComplete, this); var a = new egret.URLRequest(t); a.method = e ? egret.URLRequestMethod.POST: egret.URLRequestMethod.GET; var o = JSON.stringify(e); a.data = new egret.URLVariables("msg=" + encodeURIComponent(this.base64.encode(o))), this.startUnlockTimeout(), n.load(a) } }, e.prototype.sendRequest2 = function(t, e, i) { this.token && e && (e.token = this.token); var n = new egret.URLLoader; n.dataFormat = egret.URLLoaderDataFormat.TEXT, n.addEventListener(egret.Event.COMPLETE, this.onPostComplete, this); var a = new egret.URLRequest(t); a.method = e ? egret.URLRequestMethod.POST: egret.URLRequestMethod.GET; var o = JSON.stringify(e); a.data = new egret.URLVariables("msg=" + encodeURIComponent(this.base64.encode(o))), this.startUnlockTimeout(), n.load(a) }, e.prototype.sendHttpRequest = function(t, e, i) { var n = new egret.HttpRequest; n.responseType = egret.HttpResponseType.TEXT }, e.prototype.onPostComplete = function(t) { this.lockReq = !1; var e = t.currentTarget; e.removeEventListener(egret.Event.COMPLETE, this.onPostComplete, this), e.removeEventListener(egret.IOErrorEvent.IO_ERROR, this.onPostIOError, this); var i = e.data.replace(/\s/g, ""), n = JSON.parse(i); n && n.data && (n.data = JSON.parse(this.base64.decode(n.data)), console.log("数据返回", n.data)), n.hasOwnProperty("server_time") && DateTimer.instance.updateServerTime(1e3 * n.server_time), this.lockTimeOut && (egret.clearTimeout(this.lockTimeOut), this.lockTimeOut = null); var a = this.callbackList.get(e.hashCode); a && (a(n), this.callbackList.remove(e.hashCode)), n && 7 === n.status && Global.alertMediator.addAlert(GameConfig.ServerCode[7], function() { window.location.href = window.location.href }) }, e.prototype.onPostIOError = function(t) { egret.error("post error : " + t) }, e.NAME = "NetProxy", e } (ResourceProxyBase); t.NetProxy = e, __reflect(e.prototype, "game.NetProxy") } (game || (game = {})); var game; ! function(t) { var e = function(e) { function i() { var t = null !== e && e.apply(this, arguments) || this; return t.playerData = {}, t.landData = {}, t } return __extends(i, e), i.prototype.init = function() { Global.otherPlayerProxy = this }, i.prototype.clearPlayerData = function() { this.playerData = {}, this.landData = {} }, i.prototype.setPlayerData = function(t) { this.playerData = t, this.playerData.id = t.user_id }, i.prototype.getPlayerData = function() { return this.playerData }, i.prototype.setPlayerDataProperty = function(t, e) { this.playerData[t] = e }, i.prototype.getLandByIndex = function(t) { return this.landData[t] }, i.prototype.setPlayerLandData = function(e) { this.landData = {}; for (var i = e.landList, n = 0; n < i.length; n++) this.landData[i[n].position] = new t.LandData(i[n].position, i[n]) }, i.prototype.updateLandData = function(e, i) { var n = this.landData[e]; if (n) n.updateData(i); else { var a = new t.LandData(e, i); this.landData[e] = a, n = a } t.EventManager.instance.dispatch(SysNotify.OTHER_PLANT_REFRESH, n.landId) }, i } (ResourceProxyBase); t.OtherPlayerProxy = e, __reflect(e.prototype, "game.OtherPlayerProxy") } (game || (game = {})); var game; ! function(t) { var e = function(e) { function i() { var t = null !== e && e.apply(this, arguments) || this; return t.landData = {}, t.uuid = "", t.wareHouseItemData = {}, t } return __extends(i, e), i.prototype.init = function() { Global.playerProxy = this }, i.prototype.setPlayerData = function(t) { this.playerData = t, this.playerData.id = t.user_id }, i.prototype.setPlayerDataProperty = function(t, e) { this.playerData[t] = e }, i.prototype.setPlayerLandData = function(e) { this.landData = {}; for (var i = e.landList, n = 0; n < i.length; n++) this.landData[i[n].position] = new t.LandData(i[n].position, i[n]) }, i.prototype.changeLandDataToDie = function(t) {}, i.prototype.updateLandData = function(e, i) { var n = this.landData[e]; if (n) n.updateData(i); else { var a = new t.LandData(e, i); this.landData[e] = a, n = a } t.EventManager.instance.dispatch(SysNotify.LAND_REFRESH, n.landId), t.EventManager.instance.dispatch(SysNotify.PLANT_REFRESH, n.landId), n.get_exp && this.addExp(n.get_exp) }, i.prototype.getLandCountByLv = function(t, e) { void 0 === e && (e = !1); var i = 0; for (var n in this.landData) { var a = this.landData[n]; e ? a.landLv >= t && i++:a.landLv == t && i++ } return i }, i.prototype.getLandUpDataByLvOrder = function(e, i) { for (var n = _.values(Global.gameProxy.gameConfig[t.TabelName.land_upgrade]), a = 0; a < n.length; a++) { var o = n[a]; if (o.level == e && o.position == i) return new t.LandUpgradeData(o) } return new t.LandUpgradeData(o) }, i.prototype.addExp = function(e) { this.playerData.exp += e; var i = Global.gameProxy.getMaxExpByLv(this.playerData.level); this.playerData.exp >= i && (this.playerData.exp -= i, this.playerData.level++), t.EventManager.instance.dispatch(SysNotify.USER_EXP_CHANGE) }, i.prototype.getPlayerStoreHouse = function(e) { var i = GameConfig.SERVER_PATH + "store-house", n = this; Global.netProxy.sendRequest(i, { msg: 123 }, function(i) { console.log(i); if (0 === i.status) { var a = {}; i.data.forEach(function(e) { a[e.item_id] = new t.ItemData(e.item_id, e.num) }), n.wareHouseItemData = a, e && e() } }) }, i.prototype.wareHouseHas = function(t) { return !! this.wareHouseItemData[t] }, i.prototype.updateWareHouseItem = function(e, i) { if (void 0 === i && (i = 0), i) { var n = this.wareHouseItemData[e.item_id]; n ? n.number += i: this.wareHouseItemData[e.item_id] = new t.ItemData(e.item_id, i) } else this.wareHouseItemData[e.item_id] = new t.ItemData(e.item_id, e.num) }, i.prototype.sellWareHouseItem = function(t, e) { var i = this.wareHouseItemData[t.id]; i.number -= e, i.number <= 0 && delete this.wareHouseItemData[t.id] }, i.prototype.sellWareHouseItem1 = function(e) { for (var i = e.split(","), n = 0; n < i.length; n++) { var a = i[n].split(":")[0], o = parseInt(i[n].split(":")[1]); "105001" == a ? Global.playerProxy.playerData.gem -= o: "105002" == a ? Global.playerProxy.playerData.gold -= o: "201012" == a || "201013" == a || "201014" == a || "201015" == a || "" != a && this.sellWareHouseItem({ id: a }, o) } t.EventManager.instance.dispatch(SysNotify.TOPLAYER_INFO_UPDATE) }, i.prototype.addItem1 = function(e, i) { void 0 === i && (i = !0); for (var n = [], a = e.split(","), o = 0; o < a.length; o++) { var s = a[o].split(":")[0], r = parseInt(a[o].split(":")[1]); if ("105001" == s ? Global.playerProxy.playerData.gem += r: "105002" == s ? Global.playerProxy.playerData.gold += r: "201012" == s || "201013" == s || "201014" == s || "201015" == s || "" != s && this.updateWareHouseItem({ item_id: s }, r), "" != s) { var h = Global.gameProxy.getItemConfig(s); n.push("获得" + h.name + "X" + r) } } if (i) { var o = 0; core.TimerManager.instance.addTick(300, n.length, function() { TipsUtils.showTipsDownToUp(n[o]), o++, o == n.length && t.EventManager.instance.dispatch(SysNotify.TOPLAYER_INFO_UPDATE) }, this) } else t.EventManager.instance.dispatch(SysNotify.TOPLAYER_INFO_UPDATE) }, i.prototype.getMySkins = function() { var t = []; console.log(this.wareHouseItemData); for (var e in this.wareHouseItemData) { var i = this.wareHouseItemData[e]; i.config.type == ItemType.SKIN && t.push(i) } return t }, i.prototype.getItemByType = function(t) { var e = _.values(this.wareHouseItemData), i = _.groupBy(e, function(t) { return t.config && t.config.type }); return i[t] ? i[t] : [] }, i.prototype.getItemBigTypeByArr = function(t) { for (var e = [], i = 0; i < t.length; i++) for (var n = this.getItemByType(t[i]), a = 0; a < n.length; a++) e.push(n[a]); return e }, i.prototype.getItemBySmallType = function(t) { var e = _.values(this.wareHouseItemData), i = _.groupBy(e, function(t) { return t.config && t.config.smallType }); return i[t] ? i[t] : [] }, i.prototype.getHasItemByItemId = function(t) { return this.wareHouseItemData[t] }, i } (ResourceProxyBase); t.PlayerProxy = e, __reflect(e.prototype, "game.PlayerProxy") } (game || (game = {})); var ThemeAdapter = function() { function t() {} return t.prototype.getTheme = function(t, e, i, n) { function a(t) { e.call(n, t) } function o(e) { e.resItem.url == t && (RES.removeEventListener(RES.ResourceEvent.ITEM_LOAD_ERROR, o, null), i.call(n)) } var s = this; if ("undefined" != typeof generateEUI) egret.callLater(function() { e.call(n, generateEUI) }, this); else if ("undefined" != typeof generateEUI2) RES.getResByUrl("resource/gameEui.json", function(t, i) { window.JSONParseClass.setData(t), egret.callLater(function() { e.call(n, generateEUI2) }, s) }, this, RES.ResourceItem.TYPE_JSON); else if ("undefined" != typeof generateJSON) if (t.indexOf(".exml") > -1) { var r = t.split("/"); r.pop(); var h = r.join("/") + "_EUI.json"; generateJSON.paths[t] ? egret.callLater(function() { e.call(n, generateJSON.paths[t]) }, this) : RES.getResByUrl(h, function(i) { window.JSONParseClass.setData(i), egret.callLater(function() { e.call(n, generateJSON.paths[t]) }, s) }, this, RES.ResourceItem.TYPE_JSON) } else egret.callLater(function() { e.call(n, generateJSON) }, this); else RES.addEventListener(RES.ResourceEvent.ITEM_LOAD_ERROR, o, null), RES.getResByUrl(t, a, this, RES.ResourceItem.TYPE_TEXT) }, t } (); __reflect(ThemeAdapter.prototype, "ThemeAdapter", ["eui.IThemeAdapter"]); var game; ! function(t) { var e = function(e) { function i() { var t = e.call(this, i.NAME) || this; return t.shareServerIndex = 0, t.shareServerURLArr = [GameConfig.SERVER_PATH + "share"], t.shareData = {}, t.weixinConfig = !1, t } return __extends(i, e), i.prototype.init = function() { Global.weixinProxy = this }, i.prototype.config = function(t) { void 0 === t && (t = null); var e = (Global.playerProxy, Global.netProxy), i = window.wx, n = encodeURIComponent(window.location.href.split("#")[0]), a = this.shareServerURLArr[this.shareServerIndex], o = { url: n }, s = this; e.sendRequest(a, o, function(t) { i.config({ debug: GameConfig.WEIXIN_DEBUG, appId: t.appId, timestamp: t.timestamp, nonceStr: t.nonceStr, signature: t.signature, jsApiList: ["checkJsApi", "onMenuShareTimeline", "onMenuShareAppMessage", "onMenuShareQQ", "onMenuShareWeibo", "chooseImage", "previewImage", "uploadImage", "downloadImage"] }), i.ready(function() { i.checkJsApi({ jsApiList: ["checkJsApi", "onMenuShareTimeline", "onMenuShareAppMessage", "onMenuShareQQ", "onMenuShareWeibo", "chooseImage", "previewImage", "uploadImage", "downloadImage"], success: function(e) { Mta.getMathH5() && Mta.getMathH5().clickShare("wechat_moments"), s.shareURL = t.url, s.share(), s.weixinConfig = !0 } }) }), i.error(function(t) { s.shareServerIndex++, s.shareServerIndex >= s.shareServerURLArr.length ? alert("wx.error: " + JSON.stringify(t)) : s.config() }) }) }, i.prototype.share = function(e, i) { void 0 === e && (e = ""), void 0 === i && (i = null); var n = Math.floor(_.random(1, 3)), a = (this.shareData[n], "拼眼力赢红包!一带一路上的寻宝之旅"), o = window.wx, s = this.shareURL + encodeURIComponent(e), r = { title: a, desc: "你的眼力有多好,到手的红包有多少", link: s, imgUrl: "https://mmbiz.qlogo.cn/mmbiz_jpg/DSvNbEibEqELrSQE9cRFBUxjcRQicktRGWpEbPmTK7SNATKYomoQt70ZcNVUScpUnT9r0E4dAjwkGdtlQFpia99cw/0?wx_fmt=jpeg" }, h = {}; for (var l in r) h[l] = r[l]; h.success = function() { t.AppFacade.getInstance().sendNotification(SceneNotify.CLOSE_TOUCH_GROUP), Mta.getMathH5() && Mta.getMathH5().clickShare("wechat_moments"); var e = GameConfig.SERVER_PATH + "yutong_share"; Global.netProxy.sendRequest(e, {}, function(t) { 1 === t.status ? alert(t.msg) : alert(t.msg) }) }; var c = {}; for (var l in r) c[l] = r[l]; c.success = function() { t.AppFacade.getInstance().sendNotification(SceneNotify.CLOSE_TOUCH_GROUP), Mta.getMathH5() && Mta.getMathH5().clickShare("wechat_moments"); var e = GameConfig.SERVER_PATH + "yutong_share"; Global.netProxy.sendRequest(e, {}, function(t) { 1 === t.status ? alert(t.msg) : alert(t.msg) }) }, o.onMenuShareTimeline(h), o.onMenuShareAppMessage(c), o.onMenuShareQQ(r), o.onMenuShareWeibo(r) }, i.prototype.changeShareText = function(t) { this.share(this.shareURL, t) }, i.NAME = "WeixinProxy", i } (ResourceProxyBase); t.WeixinProxy = e, __reflect(e.prototype, "game.WeixinProxy") } (game || (game = {})); var core; ! function(t) { var e = function() { function t() { if (t.s_instance) throw new Error("单例类不可实例化"); egret.startTick(this.onTick, this), this.m_tickList = [] } return t.prototype.onTick = function(t) { for (var e = this.m_tickList, i = e.length; i > 0; i--) { var n = e[i - 1]; n.isValid || e.splice(i - 1, 1) } for (var i = 0, a = e.length; a > i; i++) { var n = e[i]; if (t - n.timestamp > n.delay) { if (n.timestamp = t, n.count++, n.callback) { var o = egret.getTimer(); n.callback.call(n.thisObj, n.clone()); var s = egret.getTimer(); s - o > 2 && egret.log("tick回调耗时:" + (s - o)) } n.count == n.maxCount && (n.isValid = !1) } } return ! 1 }, t.prototype.addTick = function(t, e, n, a) { for (var o = [], s = 4; s < arguments.length; s++) o[s - 4] = arguments[s]; var r = this.m_tickList; if (r) for (var h = 0, l = r.length; l > h; h++) { var c = r[h]; if (c.callback == n && c.thisObj == a && c.delay == t && c.maxCount == e) return void(c.isValid || (c.isValid = !0, c.delay = t, c.count = 0, c.maxCount = 0 >= e ? Number.MAX_VALUE: e, c.callback = n, c.thisObj = a, c.args = o, c.timestamp = egret.getTimer())) } else r = [], this.m_tickList = r; var p = new i; p.delay = t, p.count = 0, p.maxCount = 0 >= e ? Number.MAX_VALUE: e, p.callback = n, p.thisObj = a, p.args = o, p.timestamp = egret.getTimer(), p.isValid = !0, r.push(p) }, t.prototype.removeTick = function(t, e) { var i = this.m_tickList; if (i) for (var n = 0, a = i.length; a > n; n++) { var o = i[n]; if (o.callback == t && o.thisObj == e) return void(o.isValid = !1) } }, t.prototype.removeTicks = function(t) { var e = this.m_tickList; if (e) for (var i = 0, n = e.length; n > i; i++) { var a = e[i]; a.thisObj == t && (a.isValid = !1) } }, t.prototype.removeAllTicks = function() { this.m_tickList.length = 0 }, Object.defineProperty(t, "instance", { get: function() { return null == t.s_instance && (t.s_instance = new t), t.s_instance }, enumerable: !0, configurable: !0 }), t } (); t.TimerManager = e, __reflect(e.prototype, "core.TimerManager"); var i = function(t) { function e() { return t.call(this) || this } return __extends(e, t), e.prototype.clone = function() { var t = new e; return t.delay = this.delay, t.count = this.count, t.maxCount = this.maxCount, t.callback = this.callback, t.thisObj = this.thisObj, t.args = this.args, t.isValid = this.isValid, t }, e } (egret.HashObject); t.TickData = i, __reflect(i.prototype, "core.TickData") } (core || (core = {})); var game; ! function(t) { var e = function() { function t(t) { this.imgBg = t.imgBg, this.panel = t.panel, this.imgTitle = t.imgTitle, this.imgIcon = t.imgIcon, this._btnClose = t.btnClose, this.btnHelp = t.btnHelp, this.groupHelp = t.groupHelp, this.closeBtn = t.closeBtn } return t.prototype.setPanelWidth = function(t) { void 0 === t && (t = 540), this.imgBg.width = t, this.groupHelp.right = 81 - (t - 540) / 2 }, t.prototype.setPanelHeight = function(t) { void 0 === t && (t = 634), this.imgBg.height = t, this.panel.height = t + 6 }, t.prototype.setTitleIcon = function(t) { this.imgIcon.source = t }, t.prototype.setTitle = function(t) { this.imgTitle.source = t }, Object.defineProperty(t.prototype, "btnClose", { get: function() { return this._btnClose }, enumerable: !0, configurable: !0 }), t.prototype.setIconOffsetX = function(t) { this.imgIcon.horizontalCenter = -182.5 + t }, t } (); t.PanelCommon = e, __reflect(e.prototype, "game.PanelCommon") } (game || (game = {})); var game; ! function(t) { var e = function() { function t(t) { this.lv = t.id, this.items = t.item_id, this.outAddPer = t.output, this.add_exp = t.add_exp, this.needPlayerLV = t.player_level } return t } (); t.HouseUpgradeData = e, __reflect(e.prototype, "game.HouseUpgradeData") } (game || (game = {})); var game; ! function(t) { var e = function() { function t(t) { this.index = t.id - 1, this.lv = t.player_level, this.gold = t.gold } return t } (); t.LandExtentData = e, __reflect(e.prototype, "game.LandExtentData") } (game || (game = {})); var game; ! function(t) { var e = function() { function t(t) { this.id = t.id, this.index = t.position - 1, this.lv = t.level, this.items = t.item_id, this.outAddPer = t.output, this.expAddPer = t.add_exp, this.player_level = t.player_level } return t } (); t.LandUpgradeData = e, __reflect(e.prototype, "game.LandUpgradeData") } (game || (game = {})); var game; ! function(t) { var e = function() { function t() {} return t } (); t.LotteryData = e, __reflect(e.prototype, "game.LotteryData") } (game || (game = {})); var game; ! function(t) { var e = function() { function t() {} return t } (); t.RabateData = e, __reflect(e.prototype, "game.RabateData") } (game || (game = {})); var Const = function() { function t() {} return t.WIN_W = 640, t.WIN_H = 960, t.DESGIN_W = 640, t.DESGIN_H = 960, t.LAND_HALF_W = 97, t.LAND_HALF_H = 47, t.DIAMOND_ID = 105001, t.GOLD_ID = 105002, t.FLOW_ID = 105003, t.EX_MAX_NUMBER = 999, t.EX_OUT_FLOW_PHONE = "", t.WARE_CAPACITY = 32, t.RANK_SHOW_TYPE = 1, t.GOLD_ICON = 3002, t.DIAMOND_ICON = 3001, t } (); __reflect(Const.prototype, "Const"); var game; ! function(t) { var e = function(e) { function i() { var t = e.call(this) || this; return t.contentArr = [], t.isRunning = !1, t.skinName = new GamePaoMaSkin, t } return __extends(i, e), i.prototype.createChildren = function() { e.prototype.createChildren.call(this), manager.UpdateTickerManager.instance.add(i._instance), t.EventManager.instance.addEvent(SysNotify.SHOW_MESSAGE, this.showMessage, this, !0), this.tipsContent.mask = this.maskRect, this.addEventListener(egret.TouchEvent.TOUCH_END, this.tipsTouchEnded, this), this.visible = !1 }, i.prototype.update = function(t) { this.contentArr.length > 0 && !this.isRunning && (this.visible = !0, this.isRunning = !0, this.run()) }, i.prototype.run = function() { var t = this.contentArr.pop(); this.tipsContent.text = t, this.tipsContent.x = Const.WIN_W; var e = 200 * t.length; this.tipsContent.visible = !0, egret.Tween.get(this.tipsContent).to({ x: -this.tipsContent.width }, e).call(function() { this.visible = !1, this.isRunning = !1 }, this) }, i.prototype.showMessage = function(t) { var e = t.data, i = e.nickname, n = e.message, a = e.wx_id, o = e.phone, s = i + ": " + n; a && (s += " 私人微信 " + a), o && (s += " 电话号码 " + o), this.contentArr.push(s) }, Object.defineProperty(i, "instance", { get: function() { return i._instance || (i._instance = new i), i._instance }, enumerable: !0, configurable: !0 }), i.prototype.show = function() { this.y = 299, this.x = Const.WIN_W / 2 - this.width / 2, GameLayerManager.instance.mainLayer.addChild(this) }, i.prototype.tipsTouchEnded = function(t) { window.parent && window.parent.openiframe && window.parent.openiframe(window.parent.messageUrl) }, i } (eui.Component); t.GamePaoMa = e, __reflect(e.prototype, "game.GamePaoMa", ["IUpdate"]) } (game || (game = {})); var game; ! function(t) { var e = function(e) { function i(t) { var i = e.call(this) || this; return i.contentArr = [], i.isMine = !0, i.gameScene = t, i.isMine = t.isMine, i.playerProxy = t.playerProxy, i.skinName = new GameTopSkin, i.top = i.horizontalCenter = 0, i.touchEnabled = !1, i } return __extends(i, e), i.prototype.initsize = function() {}, i.prototype.onRemoved = function() { e.prototype.onRemoved.call(this), t.EventManager.instance.removeEvent(SysNotify.FRIEND_RED, this.friendpOINT, this), t.EventManager.instance.removeEvent(SysNotify.TOPLAYER_INFO_UPDATE, this.updateTopInfo, this), t.EventManager.instance.removeEvent(SysNotify.USER_EXP_CHANGE, this.showExp, this) }, i.prototype.createChildren = function() { e.prototype.createChildren.call(this), this.imgHead.mask = this.imgHeadMask; var i = this.playerProxy.playerData; this.labelName.text = i.nickname; var n = i.avatar.toString(); console.log('111111111111'+n); if (n || (n = "1"), n.indexOf("http") > -1) this.imgHead.source = n; else { var a = t.URLConfig.getHead(n); this.imgHead.source = a } this.isMine ? (t.EventManager.instance.addEvent(SysNotify.FRIEND_RED, this.friendpOINT, this, !0), t.EventManager.instance.addEvent(SysNotify.TOPLAYER_INFO_UPDATE, this.updateTopInfo, this, !0), t.EventManager.instance.addEvent(SysNotify.USER_EXP_CHANGE, this.showExp, this, !0)) : (this.groupBtn.visible = !1, this.btnShowOrHide.visible = !1), this.barExp.minimum = 0, this.updateTopInfo() }, i.prototype.friendpOINT = function() { this.friendRad.visible = !0 }, i.prototype.tipsImageTouchEnded = function() { window.parent && window.parent.openiframe && window.parent.openiframe(window.parent.messageUrl) }, i.prototype.updateTopInfo = function() { this.showGold(), this.showExp(), this.showScore(), this.showVip() }, i.prototype.showExp = function() { if (this.barExp) { var t = this.playerProxy.playerData; this.barExp.value = t.exp, this.barExp.maximum = Global.gameProxy.getMaxExpByLv(t.level + 1), this.labelLv.text = "LV." + t.level } }, i.prototype.showGold = function() { if (this.labelGold) { var e = this.playerProxy.playerData; this.labelGold.text = t.Utils.BigNumTostring(e.gold) } }, i.prototype.showScore = function() { if (this.labelScore) { var e = this.playerProxy.playerData; this.labelScore.text = t.Utils.BigNumTostring(e.score) } }, i.prototype.showVip = function() { this.playerProxy.playerData }, i.prototype.onShow = function() { this.top = -this.height, egret.Tween.get(this).to({ top: 0 }, 250) }, i.prototype.onHide = function() { egret.Tween.get(this).to({ top: -this.height }, 250).call(t.UIUtils.removeSelf, this, [this]) }, i.prototype.btnShowOrHideTouchEnded = function() { var t = this; this.btnShowOrHide.touchEnabled = !1, this.btnShowOrHide.selected ? (this.groupBtn.visible = !0, egret.Tween.get(this.groupBtn).to({ y: 0 }, 250).call(function() { t.btnShowOrHide.touchEnabled = !0, t.btnShowOrHide.selected = !1 })) : egret.Tween.get(this.groupBtn).to({ y: -100 }, 250).call(function() { t.groupBtn.visible = !1, t.btnShowOrHide.touchEnabled = !0, t.btnShowOrHide.selected = !0 }, this) }, i.prototype.onTouchTap = function(e) { var i = e.target; switch (i) { case this.imgHead: this.isMine && t.AppFacade.getInstance().sendNotification(PanelNotify.OPEN_PLAYER_INFO); break; case this.btn1: t.AppFacade.getInstance().sendNotification(PanelNotify.OPEN_SKIN); break; case this.btn2: t.AppFacade.getInstance().sendNotification(PanelNotify.OPEN_LAND_UPGRADE); break; case this.btn3: t.AppFacade.getInstance().sendNotification(PanelNotify.OPEN_LOG); break; case this.btn4: t.AppFacade.getInstance().sendNotification(PanelNotify.OPEN_LOTTERY); break; case this.btn5: t.AppFacade.getInstance().sendNotification(PanelNotify.OPEN_SIGN); break; case this.btn6: t.AppFacade.getInstance().sendNotification(PanelNotify.OPEN_NOTICE); break; case this.btn7: t.AppFacade.getInstance().sendNotification(PanelNotify.OPEN_LEVELGIFT); break; case this.btn8: top.location.href="/web/?token="+Global.playerProxy.playerData.code+"&r=0.5228841979683092#/userCenter/"; } }, i } (t.BasePanel); t.GameTopLayer = e, __reflect(e.prototype, "game.GameTopLayer") } (game || (game = {})); var game; ! function(t) { var e = function(e) { function i(t) { var i = e.call(this) || this; return i.currLandIndex = -1, i.landPlantMap = new HashMap, i.lastTouchX = -1, i.startTouchX = -1, i.lastTouchTime = -1, i.isVisibleAnimate = !1, i.gameScene = t, i.isMine = t.isMine, i.isMine ? i.playerProxy = Global.playerProxy: i.playerProxy = Global.otherPlayerProxy, i.isMine = i.gameScene.isMine, i.skinName = new GameViewSkin, i } return __extends(i, e), i.prototype.initsize = function() {}, i.prototype.createChildren = function() { e.prototype.createChildren.call(this), this.isMine ? (this.imgAdd.anchorOffsetX = 47, this.imgAdd.anchorOffsetY = 83) : (this.imgAdd.touchEnabled = !1, t.UIUtils.removeSelf(this.imgAdd)), this.imgLandLight.touchEnabled = !1, this.hideLandLight(), this.landGroup.touchEnabled = this.landGroup.touchChildren = !1, this.plantGroup.touchEnabled = this.plantGroup.touchChildren = !1, this.stateGroup.touchEnabled = this.stateGroup.touchChildren = !1, this.stateGroup.name = "stateGroup", GameLayerManager.instance.plantStateLayer = this.stateGroup, this.initLandCenterPos(), this.initOpenLand(), this.updateAllPlant(), this.updateAddLandImg() }, i.prototype.onAdded = function() { e.prototype.onAdded.call(this), this.addEventListener(egret.TouchEvent.TOUCH_BEGIN, this.onTouchBeganHandler, this), this.stage.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onStageTouchTapHandler, this), this.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTouchTapHandler, this), this.isMine ? (t.EventManager.instance.addEvent(SysNotify.PLANT_REFRESH, this.onLandPlantRefresh, this), t.EventManager.instance.addEvent(SysNotify.LAND_REFRESH, this.onLandRefresh, this)) : t.EventManager.instance.addEvent(SysNotify.OTHER_PLANT_REFRESH, this.onLandPlantRefresh, this), t.EventManager.instance.addEvent(SysNotify.PLANT_REAP, this.onPlantReap, this), t.EventManager.instance.addEvent(SysNotify.COOLMENU_HIDE, this.hideLandLight, this), t.UIUtils.addLongTouch(this, this.onLongTouchLand.bind(this), this.onLongTouchLandEnd.bind(this)) }, i.prototype.onPlantReap = function(e) { var i = e.data, n = Const.clickLandIndex, a = this.landCenterPosArr[n]; a = this.landGroup.localToGlobal(a.x - 50, a.y - 30); var o = (this.playerProxy.landData, this.playerProxy.landData[n]); t.SimpleTip.popTip(o.plantName + "x" + i, a.x, a.y, 16); var s = this.landPlantMap.get(n); s.showReapAnim() }, i.prototype.onLandPlantRefresh = function(t) { if (null != t.data) { var e = t.data, i = this.playerProxy.landData[e]; this.updateOnePlant(i, e) } else this.updateAllPlant() }, i.prototype.onLongTouchLand = function(e) { console.log(e.stageX+'='+this.x+'----'+e.stageY+'='+this.y); var i = this.checkPlantOrLandClick(e.stageX - this.x+20, e.stageY - 560-40); if (i >= 0) { var n = this.playerProxy.landData, a = n[i]; if (a) { var o = this.landCenterPosArr[i].clone(); o.x += this.x, o.y += this.y - 25, t.PlantCdTip.show(a, o) } } }, i.prototype.onLongTouchLandEnd = function(e) { t.PlantCdTip.hide() }, i.prototype.onRemoved = function() { e.prototype.onRemoved.call(this), this.removeEventListener(egret.TouchEvent.TOUCH_BEGIN, this.onTouchBeganHandler, this), this.stage.removeEventListener(egret.TouchEvent.TOUCH_TAP, this.onStageTouchTapHandler, this), this.removeEventListener(egret.TouchEvent.TOUCH_TAP, this.onTouchTapHandler, this), t.EventManager.instance.removeEvent(SysNotify.PLANT_REAP, this.onPlantReap, this), t.EventManager.instance.removeEvent(SysNotify.COOLMENU_HIDE, this.hideLandLight, this), this.isMine ? t.EventManager.instance.removeEvent(SysNotify.OTHER_PLANT_REFRESH, this.onLandPlantRefresh, this) : (t.EventManager.instance.removeEvent(SysNotify.PLANT_REFRESH, this.onLandPlantRefresh, this), t.EventManager.instance.removeEvent(SysNotify.LAND_REFRESH, this.onLandRefresh, this)), t.UIUtils.removeLongTouch(this) }, i.prototype.onTouchBeganHandler = function(e) { t.CoolMenu.instance.hide(), t.PlantCdTip.hide(), this.lastTouchX = e.stageX, this.startTouchX = e.stageX, this.lastTouchTime = egret.getTimer() }, i.prototype.hideLandLight = function() { this.imgLandLight.visible = !1 }, i.prototype.onStageTouchTapHandler = function() { this.hideLandLight() }, i.prototype.updateAddLandImg = function() { var t = _.values(this.playerProxy.landData).length; if (t >= 12) this.imgAdd.visible = !1; else { this.imgAdd.visible = !0; var e = this.landCenterPosArr[t]; this.imgAdd.x = e.x - 10, this.imgAdd.y = e.y } }, i.prototype.initOpenLand = function() { for (var t = 0; 12 > t; t++) { var e = new eui.Image; e.x = this.landCenterPosArr[t].x - Const.LAND_HALF_W, e.y = this.landCenterPosArr[t].y - Const.LAND_HALF_H, this.landGroup.addChild(e), this.updateOneLand(t) } }, i.prototype.onLandRefresh = function(t) { if (null != t.data) { var e = t.data; this.updateOneLand(e) } else for (var i = Global.playerProxy.landData, n = _.values(i).length, a = 0; n > a; a++) this.updateOneLand(a); this.updateAddLandImg() }, i.prototype.updateOneLand = function(t) { var e = this.playerProxy.landData, i = -1, n = e[t]; n && (i = n.landLv); var a = this.landGroup.getChildAt(t); a.source = "land" + i + "_png" }, i.prototype.flushGameView = function() { this.updateAllPlant() }, i.prototype.updateAllPlant = function() { var t = this.playerProxy.landData; this.initLandCenterPos(), this.plantGroup.removeChildren(); for (var e in t) this.updateOnePlant(t[e], e) }, i.prototype.initLandCenterPos = function() { this.landCenterPosArr = []; for (var t = Const.LAND_HALF_W, e = Const.LAND_HALF_H, i = 0; 12 > i; i++) { var n = new egret.Point; n.x = -(i % 3) * (t - 10) + parseInt(i / 3 + "") * t, n.y = i % 3 * (e + 3) + parseInt(i / 3 + "") * e, this.landCenterPosArr.push(n) } }, i.prototype.updateOnePlant = function(e, i) { var n = (this.playerProxy.landData, this.landPlantMap.get(i)); e && e.plantId > 0 ? (n ? n.changeData(e) : (n = new t.WidgetLand(e), n.x = this.landCenterPosArr[i].x, n.y = this.landCenterPosArr[i].y, this.landPlantMap.add(i, n)), n.updateDisease(), this.plantGroup.addChild(n)) : t.UIUtils.removeSelf(n) }, i.prototype.onTouchTapHandler = function(e) { if (e.stopPropagation(), e.target == this.imgAdd) t.AppFacade.getInstance().sendNotification(PanelNotify.OPEN_LANDEXTEND); else { var i = this.checkPlantOrLandClick(e.localX, e.localY); i >= 0 ? this.clickLand(i) : this.hideLandLight() } }, i.prototype.clickLand = function(e) { this.currLandIndex = e, Const.clickLandIndex = e; var i = this.playerProxy.landData[e], n = this.landCenterPosArr[e], a = n.clone(); a.x += this.x, a.y += this.y - 25, t.CoolMenu.instance.hide(); var o = this.getMyFarmMenu(i), s = 0; this.isMine || (o = this.getOtherFarmMenu(i), s = Const.WIN_W), t.CoolMenu.instance.show(o, a, s), this.isMine, this.showLandLight(n) }, i.prototype.showLandLight = function(t) { this.imgLandLight.visible = !0, this.imgLandLight.x = t.x - Const.LAND_HALF_W, this.imgLandLight.y = t.y - Const.LAND_HALF_H - 2 }, i.prototype.getOtherFarmMenu = function(e) { var i = []; return e.status == t.PlantStatus.ripe ? i = [MenuType.STEAL] : e.status != t.PlantStatus.empty && e.status != t.PlantStatus.die && (i = [], e.stateBug || e.status != t.PlantStatus.seed && i.push(MenuType.PUT_BUG), e.stateGrass || i.push(MenuType.PUT_GRASS), e.stateDry), i }, i.prototype.getMyFarmMenu = function(e) { var i = []; return e && e.status != t.PlantStatus.empty ? e.status == t.PlantStatus.die ? i = [MenuType.UPROOT] : e.status == t.PlantStatus.ripe ? i = [MenuType.GAIN] : (i = [MenuType.UPROOT, MenuType.MANURE], e.stateBug && i.push(MenuType.DIE_BUG), e.stateGrass && i.push(MenuType.DIE_GRASS), e.stateDry && i.push(MenuType.PUT_WATER)) : i = [MenuType.PLANT], i }, i.prototype.checkPlantOrLandClick = function(t, e) { for (var i = -1, n = new egret.Point(t, e), a = 0; a < this.plantGroup.numChildren; a++) { var o = this.plantGroup.getChildAt(a), s = o.getBoundingBox(); if (s && s.containsPoint(n)) { i = o.landData.landId; break } } if (0 > i) for (var r = this.playerProxy.landData, l = _.values(r).length, a = 0; l > a; a++) { var h = this.landCenterPosArr[a]; if (Math.abs(h.x - t) < Const.LAND_HALF_H && Math.abs(h.y - e) < Const.LAND_HALF_H) { i = a; break } } return i }, i } (t.BasePanel); t.GameView = e, __reflect(e.prototype, "game.GameView") } (game || (game = {})); var game; ! function(t) { var e = function(e) { function i() { var t = e.call(this) || this; return t.status = 1, t.isWaveButtonShowing = !1, t.isWavePlayingShowMode = !0, t.wavePlayingAngle = 0, t.skinName = new LeftMenuSkin, t.x = 0, t.y = Const.DESGIN_H - t.height, t } return __extends(i, e), i.prototype.onShow = function() {}, i.prototype.onHide = function() {}, i.prototype.initsize = function() {}, i.prototype.createChildren = function() { e.prototype.createChildren.call(this), this.initWaveButton() }, i.prototype.onTouchTap = function(e) { e.stopPropagation(); var i = t.AppFacade.getInstance().retrieveMediator(t.GameScenceMediter2.NAME), n = i.viewComponent, a = n.gameView; switch (e.target) { case this.btn1: t.AppFacade.getInstance().sendNotification(SceneNotify.OPEN_MINE_GAME), t.AppFacade.getInstance().sendNotification(SceneNotify.CLOSE_MGAME); break; case this.btn2: GameScenceManager.getInstance().sendNetmuchangShou(); break; case this.btn3: t.AppFacade.getInstance().sendNotification(PanelNotify.OPEN_BAG2, { type: ItemType.PROPS }); break; case this.btn4: var o; a.animalType == AnimalType.JI ? o = Global.playerProxy.getHasItemByItemId(200330) : a.animalType == AnimalType.YANG ? o = Global.playerProxy.getHasItemByItemId(200320) : a.animalType == AnimalType.NIU && (o = Global.playerProxy.getHasItemByItemId(200340)), o ? (GameScenceManager.getInstance().tou_item_id = o.config.id, GameScenceManager.getInstance().sendNetToufang()) : TipsUtils.showTipsDownToUp("当前没有幼崽") } }, i.prototype.btnHomeTouchEnded = function() { this.showOrHideWaveButton() }, i.prototype.initWaveButton = function() { this.isWaveButtonShowing = !1, this.waveButtonArr = [this.btn1, this.btn2, this.btn3, this.btn4], this.waveCenterPos = new egret.Point( - 71.5, -69.5), console.log(this.waveCenterPos), this.visibleWaveButton(!1) }, i.prototype.visibleWaveButton = function(t) { this.waveButtonArr.forEach(function(e) { e.visible = t, t || (e.x = e.y = -1e3) }, this) }, i.prototype.showOrHideWaveButton = function() { this.isWaveButtonShowing ? this.hideWave() : this.showWave() }, i.prototype.onStageTap = function(t) { this.hideWave() }, i.prototype.showWave = function() { this.isWaveButtonShowing = !0, this.isWavePlayingShowMode = !0, this.wavePlayingAngle = 180, this.visibleWaveButton(!0), manager.UpdateTickerManager.instance.add(this) }, i.prototype.hideWave = function() { this.isWaveButtonShowing = !1, this.isWavePlayingShowMode = !1, this.wavePlayingAngle = 10, manager.UpdateTickerManager.instance.add(this) }, i.prototype.update = function(e) { var i = this; this.isWavePlayingShowMode ? (this.wavePlayingAngle -= .4 * e, this.wavePlayingAngle < 8 && manager.UpdateTickerManager.instance.remove(this)) : (this.wavePlayingAngle += .4 * e, this.wavePlayingAngle >= 180 && (this.wavePlayingAngle = 180, manager.UpdateTickerManager.instance.remove(this), this.visibleWaveButton(!1))), this.waveButtonArr.forEach(function(e, n) { var a = i.wavePlayingAngle - 35 * n, o = t.Utils.ang2rad(a), s = 155 * Math.cos(o) - i.waveCenterPos.x, r = 155 * Math.sin(o) - i.waveCenterPos.y; e.x = s - e.width / 2, e.y = r }) }, i } (t.BasePanel); t.LeftMenu = e, __reflect(e.prototype, "game.LeftMenu", ["IUpdate"]) } (game || (game = {})); var game; ! function(t) { var e = function(e) { function i() { var t = e.call(this) || this; return t.status = 1, t.skinName = leftmiddleButtonSkin, t.x = 0, t.y = 250, t } return __extends(i, e), i.prototype.onShow = function() {}, i.prototype.onHide = function() {}, i.prototype.createChildren = function() { e.prototype.createChildren.call(this), manager.UpdateTickerManager.instance.add(this) }, i.prototype.childrenCreated = function() { e.prototype.childrenCreated.call(this) }, i.prototype.initsize = function() {}, i.prototype.onTouchTap = function(e) { switch (e.stopPropagation(), e.target) { case this.btn1: t.AppFacade.getInstance().sendNotification(PanelNotify.OPEN_FULI); break; case this.btn2: t.AppFacade.getInstance().sendNotification(PanelNotify.OPEN_NOTICE); break; case this.btn3: t.AppFacade.getInstance().sendNotification(PanelNotify.OPEN_ONLINEGIFT); break; case this.btn4: t.AppFacade.getInstance().sendNotification(PanelNotify.OPEN_SIGN) } }, i.prototype.onStageTap = function(t) {}, i.prototype.update = function(t) {}, i } (t.BasePanel); t.LeftMiddleMenu = e, __reflect(e.prototype, "game.LeftMiddleMenu", ["IUpdate"]) } (game || (game = {})); var game; ! function(t) { var e = function(e) { function i() { var t = e.call(this) || this; return t.status = 1, t.isWaveButtonShowing = !1, t.isWavePlayingShowMode = !0, t.wavePlayingAngle = 0, t.skinName = new MainMenuSkin, t.x = Const.DESGIN_W - t.width, t.y = Const.DESGIN_H - t.height, t } return __extends(i, e), i.prototype.onShow = function() {}, i.prototype.initsize = function() {}, i.prototype.onHide = function() {}, i.prototype.createChildren = function() { e.prototype.createChildren.call(this), this.initWaveButton() }, i.prototype.childrenCreated = function() { e.prototype.childrenCreated.call(this) }, i.prototype.onTouchTap = function(e) { switch (e.stopPropagation(), e.target) { case this.btn1: t.AppFacade.getInstance().sendNotification(PanelNotify.OPEN_SHOP); break; case this.btn2: t.AppFacade.getInstance().sendNotification(PanelNotify.OPEN_WARE_HOUSE); break; case this.btn3: t.AppFacade.getInstance().sendNotification(PanelNotify.OPEN_FRIEND, { index: 0 }); break; case this.btn4: t.AppFacade.getInstance().sendNotification(PanelNotify.OPEN_CHANGE_GOLD) } }, i.prototype.btnHomeTouchEnded = function() { this.showOrHideWaveButton() }, i.prototype.initWaveButton = function() { this.isWaveButtonShowing = !1, this.waveButtonArr = [this.btn1, this.btn2, this.btn3, this.btn4], this.waveCenterPos = new egret.Point(.5 * this.btnHome.width, .5 * this.btnHome.height), this.visibleWaveButton(!1) }, i.prototype.visibleWaveButton = function(t) { this.waveButtonArr.forEach(function(e) { e.visible = t, t || (e.x = e.y = 1e3) }, this) }, i.prototype.showOrHideWaveButton = function() { this.isWaveButtonShowing ? this.hideWave() : this.showWave() }, i.prototype.onStageTap = function(t) { this.hideWave() }, i.prototype.showWave = function() { this.isWaveButtonShowing = !0, this.isWavePlayingShowMode = !0, this.wavePlayingAngle = 180, this.visibleWaveButton(!0), manager.UpdateTickerManager.instance.add(this) }, i.prototype.hideWave = function() { this.isWaveButtonShowing = !1, this.isWavePlayingShowMode = !1, this.wavePlayingAngle = 275, manager.UpdateTickerManager.instance.add(this) }, i.prototype.update = function(e) { var i = this; if (this.isWavePlayingShowMode ? (this.wavePlayingAngle += .4 * e, this.wavePlayingAngle >= 280 && (this.wavePlayingAngle = 280, manager.UpdateTickerManager.instance.remove(this))) : (this.wavePlayingAngle -= .4 * e, this.wavePlayingAngle < 135 && (manager.UpdateTickerManager.instance.remove(this), this.visibleWaveButton(!1))), this.waveButtonArr.forEach(function(e, n) { var a = i.wavePlayingAngle - 36 * n, o = t.Utils.ang2rad(a), s = 155 * Math.cos(o) + i.waveCenterPos.x, r = 155 * Math.sin(o) + i.waveCenterPos.y; e.x = s, e.y = r }), this.isWavePlayingShowMode) { if (GuideManager.getInsatance().isShowGuide && 0 == GuideManager.getInsatance().target && 0 == GuideManager.getInsatance().step && (GuideManager.getInsatance().des = TextConst.textObj[2], GuideManager.getInsatance().show(this.btn1)), GuideManager.getInsatance().isShowGuide && 4 == GuideManager.getInsatance().target && 0 == GuideManager.getInsatance().step) { GuideManager.getInsatance().des = TextConst.textObj[14]; var n = t.AppFacade.getInstance().retrieveMediator(t.GameMediator.NAME); GuideManager.getInsatance().show(n.viewComponent.mainMenu.btn2) } GuideManager.getInsatance().isShowGuide && 6 == GuideManager.getInsatance().target && 0 == GuideManager.getInsatance().step && (GuideManager.getInsatance().des = TextConst.textObj[24.1], GuideManager.getInsatance().show(this.btn1)) } }, i } (t.BasePanel); t.MainMenu = e, __reflect(e.prototype, "game.MainMenu", ["IUpdate"]) } (game || (game = {})); var game; ! function(t) { var e = function(e) { function i() { var t = e.call(this) || this; return t.skinName = new BagIconSkin, t } return __extends(i, e), i.prototype.createChildren = function() { e.prototype.createChildren.call(this), t.UIUtils.addLongTouch(this, this.onLongTouchBegan.bind(this), this.onLongTouchEnd.bind(this)) }, i.prototype.onLongTouchBegan = function() { var e = this.data; e && t.ItemTip.show(e, this.localToGlobal(this.width / 2, this.height / 2)) }, i.prototype.onLongTouchEnd = function() { t.ItemTip.hide() }, i.prototype.dataChanged = function() { this.itemData = this.data, this.imgIcon.source = t.URLConfig.getIcon(this.itemData.config.icon), this.labelNum.text = "x" + this.itemData.number, GuideManager.getInsatance().isShowGuide && 1 == GuideManager.getInsatance().target && 0 == GuideManager.getInsatance().step && (GuideManager.getInsatance().des = TextConst.textObj[7], GuideManager.getInsatance().show(this, !1, 555, 310)) }, i.prototype.onTouchTap = function(e) { var i = Global.playerProxy.playerData; if (this.itemData.config.smallType == SmallType.ANIMALFOOD) return t.AppFacade.getInstance().sendNotification(PanelNotify.CLOSE_BAG2), GameScenceManager.getInstance().feed_item_id = this.itemData.config.id, void GameScenceManager.getInstance().sendNetmuchangFeed(); if (i.level >= this.itemData.config.lv) { t.AppFacade.getInstance().sendNotification(PanelNotify.CLOSE_BAG); var n = t.AppFacade.getInstance().retrieveMediator(t.GameMediator.NAME); this.itemData.config.smallType == SmallType.MANURE ? n.useFertilize(this.itemData.config) : n.plantSeed(Const.clickLandIndex, this.itemData.config) } else TipsUtils.showTipsDownToUp("等级不足", !0) }, i } (t.BaseItemRenderer); t.BagIconRender = e, __reflect(e.prototype, "game.BagIconRender") } (game || (game = {})); var game; ! function(t) { var e = function(e) { function i() { var t = e.call(this) || this; return t.touchEnabled = !1, t } return __extends(i, e), Object.defineProperty(i, "instance", { get: function() { return i._instance || (i._instance = new i), i._instance }, enumerable: !0, configurable: !0 }), i.prototype.show = function(e, i, n) { if (void 0 === n && (n = 0), this.fromPos = i, this.removeChildren(), e && e.length && 0 != e.length) if (0 == e.length) new t.CoolMenuItem(e[0]).execute(); else { var a = e.length, o = -90; i.x < 150 && a > 2 ? o = 0 : i.x > Const.WIN_W - 150 && a > 2 && (o = 180); var s = 50, r = 110; a >= 2 ? (2 == a ? s = 55 : 3 == a ? s = 72 : (4 == a && (r = 95), s = 360 / a, (i.x < 150 || i.x > Const.WIN_W - 150) && (s = 270 / a, 5 == a && (r = 125))), o -= (a - 1) * s / 2) : r = 60; for (var h = 0; a > h; h++) { var l = new t.CoolMenuItem(e[h]), c = t.Utils.ang2rad(o + h * s), p = Math.cos(c) * r + i.x + n, u = Math.sin(c) * r + i.y; l.x = i.x + n, l.y = i.y, this.addChild(l), egret.Tween.get(l).to({ x: p, y: u }, 200, egret.Ease.backOut).call(function() { GuideManager.getInsatance().isShowGuide && 1 == GuideManager.getInsatance().target && 0 == GuideManager.getInsatance().step && (GuideManager.getInsatance().des = TextConst.textObj[6], GuideManager.getInsatance().show(l)), GuideManager.getInsatance().isShowGuide && 11 == GuideManager.getInsatance().target && 0 == GuideManager.getInsatance().step && (GuideManager.getInsatance().setsVisable(!1), GuideManager.getInsatance().target = 12, GuideManager.getInsatance().sendNetMessage()) }) } this.fromPos.x += n, GameLayerManager.instance.popLayer.addChild(this), Const.stage.once(egret.TouchEvent.TOUCH_BEGIN, this.onStageTouch, this, !1, -1) } }, i.prototype.onStageTouch = function(t) { this.hide(!0) }, i.prototype.hide = function(e) { var i = this; if (void 0 === e && (e = !1), Const.stage.removeEventListener(egret.TouchEvent.TOUCH_BEGIN, this.onStageTouch, this), e && this.numChildren > 0) { for (var n = 0; n < this.numChildren; n++) { var a = this.getChildAt(n); egret.Tween.get(a).to({ x: this.fromPos.x, y: this.fromPos.y }, 200, egret.Ease.backIn) } egret.setTimeout(function() { t.UIUtils.removeSelf(i) }, this, 200), t.AppFacade.getInstance().sendNotification(SysNotify.COOLMENU_HIDE) } else t.UIUtils.removeSelf(this) }, i } (eui.Group); t.CoolMenu = e, __reflect(e.prototype, "game.CoolMenu") } (game || (game = {})); var game; ! function(t) { var e = function(e) { function i(i) { var n = e.call(this, "menu_p_" + i + "_png") || this; return n.anchorOffsetX = 46, n.anchorOffsetY = 44, n.type = i, t.UIUtils.addButtonScaleEffects(n, !0), n.addEventListener(egret.TouchEvent.TOUCH_TAP, n.onTouchTapHandler, n), n.once(egret.Event.REMOVED_FROM_STAGE, n.onRemoved, n), n } return __extends(i, e), i.prototype.onRemoved = function(e) { t.UIUtils.removeButtonScaleEffects(this, !0), this.removeEventListener(egret.TouchEvent.TOUCH_TAP, this.onTouchTapHandler, this) }, i.prototype.onTouchTapHandler = function(e) { this.execute(); var i = t.UIUtils.getParentByClass(this, t.CoolMenu); i.hide(!0), e.stopPropagation(), e.stopImmediatePropagation() }, i.prototype.execute = function() { switch (this.type) { case MenuType.PLANT: this.plant(); break; case MenuType.GAIN: this.gain(); break; case MenuType.STEAL: this.steal(); break; case MenuType.UPROOT: this.uproot(); break; case MenuType.DIE_BUG: this.dieBug(); break; case MenuType.DIE_GRASS: this.dieGrass(); break; case MenuType.PUT_WATER: this.putWater(); break; case MenuType.PUT_GRASS: this.putGrass(); break; case MenuType.PUT_BUG: this.putBug(); break; case MenuType.MANURE: this.manure() } }, i.prototype.plant = function() { t.AppFacade.getInstance().sendNotification(PanelNotify.OPEN_BAG, { type: ItemType.SEED }) }, i.prototype.gain = function() { t.AppFacade.getInstance().sendNotification(ClientNotify.LAND_SHOUHUO) }, i.prototype.steal = function() { var e = Global.otherPlayerProxy.playerData, i = e.id > 0 ? e.id: 0; if (i > 0) { var n = function(e, i) { var n = e.steal_count, a = e.deduct_gold; if (a > 0) Global.playerProxy.playerData.gold -= a, PopUpManager.popTip("偷菜不幸被狗狗发现,逃跑过程中遗落了" + a + "金币"), t.EventManager.instance.dispatch(SysNotify.TOPLAYER_INFO_UPDATE); else { var o = Global.otherPlayerProxy.getLandByIndex(i), s = { item_id: o.plantConfig.outputId }; Global.playerProxy.updateWareHouseItem(s, n), PopUpManager.popTip("偷取" + o.plantConfig.name + "x" + n) } }; t.AppFacade.getInstance().sendNotification(ClientNotify.GAO_SHI, { id: i, type: 0, callback: n }) } }, i.prototype.uproot = function() { t.AppFacade.getInstance().sendNotification(ClientNotify.LAND_CHANCHU) }, i.prototype.dieBug = function() { var e = Global.otherPlayerProxy.playerData, i = e.id > 0 ? e.id: 0; i > 0 ? t.AppFacade.getInstance().sendNotification(ClientNotify.GAO_SHI, { id: i, type: 4 }) : t.AppFacade.getInstance().sendNotification(ClientNotify.KICK_BUG, { uid: i }) }, i.prototype.putBug = function() { var e = Global.otherPlayerProxy.playerData.id; e && t.AppFacade.getInstance().sendNotification(ClientNotify.GAO_SHI, { id: e, type: 1 }) }, i.prototype.dieGrass = function() { var e = Global.otherPlayerProxy.playerData, i = e.id > 0 ? e.id: 0; i > 0 ? t.AppFacade.getInstance().sendNotification(ClientNotify.GAO_SHI, { id: i, type: 5 }) : t.AppFacade.getInstance().sendNotification(ClientNotify.KICK_GRASS, { uid: i }) }, i.prototype.putGrass = function() { var e = Global.otherPlayerProxy.playerData, i = e.id > 0 ? e.id: 0; i > 0 && t.AppFacade.getInstance().sendNotification(ClientNotify.GAO_SHI, { id: i, type: 2 }) }, i.prototype.putWater = function() { var e = Global.otherPlayerProxy.playerData, i = e.id > 0 ? e.id: 0; i > 0 ? t.AppFacade.getInstance().sendNotification(ClientNotify.GAO_SHI, { id: i, type: 3 }) : t.AppFacade.getInstance().sendNotification(ClientNotify.KICK_WATER, { uid: i }) }, i.prototype.manure = function() { t.AppFacade.getInstance().sendNotification(PanelNotify.OPEN_BAG, { type: ItemType.PROPS }) }, i } (eui.Image); t.CoolMenuItem = e, __reflect(e.prototype, "game.CoolMenuItem") } (game || (game = {})); var MenuType = { PLANT: "plant", GAIN: "gain", STEAL: "steal", UPROOT: "uproot", DIE_BUG: "die_bug", DIE_GRASS: "die_grass", PUT_WATER: "put_water", PUT_BUG: "put_bug", PUT_GRASS: "put_grass", MANURE: "manure" }, game; ! function(t) { var e = function(t) { function e() { var e = t.call(this) || this; return e.skinName = new DogListItemSkin, e } return __extends(e, t), e.prototype.createChildren = function() { t.prototype.createChildren.call(this) }, e.prototype.dataChanged = function() { t.prototype.dataChanged.call(this); var e = this.data, i = (e.level, Global.gameProxy.getPetBaseConfigForID(e.pet_config_id)), n = e.feed, a = i.hunger; this.prossBar.setPross(n, a), this.labelName.text = i.name, this.imgHead.source = i.graphical_id + "_png", this.labelName0.text = i.desc }, e.prototype.onTouchTap = function(t) { switch (t.stopPropagation(), t.target) { case this.btnSwitch: this.swith() } }, e.prototype.swith = function() { var t = this.data; BattlePetManager.getInstance().feedID = t.id, BattlePetManager.getInstance().sendNetFeend() }, e } (t.BaseItemRenderer); t.DogItemRender = e, __reflect(e.prototype, "game.DogItemRender") } (game || (game = {})); var game; ! function(t) { var e = function(e) { function i(t) { var i = e.call(this) || this; return i.dx = 195, i.dy = 20, i.playerProxy = t, i } return __extends(i, e), i.prototype.showType = function(e) { if (this.type !== e) { this.type = e; var i = DateTimer.instance.now, n = this.playerProxy.playerData.dog_hunger_end_time; 106001 === e ? (this.mc = t.MCUtils.getMc("dog"), this.mc.scaleX = 1, this.mc.scaleY = 1) : 106002 == e && (i >= n ? this.mc = t.MCUtils.getMc("dog1", null, "hungry") : this.mc = t.MCUtils.getMc("dog1", null, "idle"), this.mc.scaleX = .8, this.mc.scaleY = .8), this.addChild(this.mc) } }, i.prototype.changeDog = function() { egret.Tween.removeTweens(this.mc), t.UIUtils.removeSelf(this.mc); var e = Global.playerProxy.playerData.use_dog_item_id; this.showType(e), this.runTypeAni() }, i.prototype.runTypeAni = function() { var t = this; t.scaleX = 1; var e = DateTimer.instance.now, i = this.playerProxy.playerData.dog_hunger_end_time; switch (this.type) { case 106001: if (this.x = this.dx, this.y = this.dy, t.scaleX = -1, e >= i) return; t.mc.gotoAndPlay("forward", -1), egret.Tween.get(this, { loop: !0 }).to({ x: this.dx + 330, y: this.dy + 135 }, 5e3).call(function() { t.mc.gotoAndPlay("back", -1), t.scaleX = 1 }).to({ x: this.dx, y: this.dy }, 5e3).call(function() { t.scaleX = -1, t.mc.gotoAndPlay("forward", -1) }); break; case 106002: if (this.x = this.dx, this.y = this.dy, e >= i) return void this.mc.gotoAndPlay("0", -1); egret.Tween.get(this, { loop: !0 }).to({ x: this.dx, y: this.dy }, 3e3).call(function() { t.mc.gotoAndPlay("1", -1) }).to({ x: this.dx + 330, y: this.dy + 135 }, 5e3).call(function() { t.mc.gotoAndPlay("3", -1) }).to({ x: this.dx, y: this.dy }, 5e3).call(function() { t.mc.gotoAndPlay("4", -1) }).to({ x: this.dx, y: this.dy }, 2e3).call(function() { t.mc.gotoAndPlay("0", -1) }) } }, i } (egret.Sprite); t.WidgetDog = e, __reflect(e.prototype, "game.WidgetDog") } (game || (game = {})); var game; ! function(t) { var e = function() { function t(t) { this.uid = t.user_id, this.lv = t.level, this.gold = t.gold, this.name = t.nickname, this.rank = t.ranking, this.hasInteraction = t.has_interaction, this.fighting_capacity = t.fighting_capacity } return t } (); t.FriendData = e, __reflect(e.prototype, "game.FriendData") } (game || (game = {})); var game; ! function(t) { var e = function(e) { function i() { var t = e.call(this) || this; return t.exNum = 0, t.skinName = new FriendGiveItemSkin, t } return __extends(i, e), i.prototype.createChildren = function() { e.prototype.createChildren.call(this), this.inpNum.text = this.exNum + "", this.inpNum.addEventListener(egret.Event.FOCUS_OUT, this.onNumInpChange, this) }, i.prototype.onNumInpChange = function() { this.exNum = parseInt(this.inpNum.text), this.exNum = t.Utils.limit(this.exNum, 0, Math.floor(this.itemData.number / 100)), this.inpNum.text = this.exNum + "" }, i.prototype.dataChanged = function() { this.itemData = this.data, this.imageIcon.source = t.URLConfig.getIcon(this.itemData.config.icon), this.labelNum.text = this.itemData.number + "", this.inpNum.text = this.exNum + "" }, i.prototype.onTouchTap = function(t) { switch (t.stopPropagation(), t.target) { case this.addBtn: var e = Math.floor(this.itemData.number / 100); if (1 > e) return void PopUpManager.popTip("果实不足,果实转赠一手单位为100个"); this.changeExNumber(1); break; case this.subBtn: var e = Math.floor(this.itemData.number / 100); if (1 > e) return void PopUpManager.popTip("果实不足,果实转赠一手单位为100个"); this.changeExNumber( - 1) } }, i.prototype.changeExNumber = function(e) { this.exNum += e, this.exNum = t.Utils.limit(this.exNum, 0, Math.floor(this.itemData.number / 100)), this.inpNum.text = this.exNum + "" }, i } (t.BaseItemRenderer); t.FriendGiveItemRender = e, __reflect(e.prototype, "game.FriendGiveItemRender") } (game || (game = {})); var game; ! function(t) { var e = function(e) { function i() { var t = e.call(this) || this; return t.skinName = new FriendGiveNoCompleteSkin, t } return __extends(i, e), i.prototype.createChildren = function() { e.prototype.createChildren.call(this) }, i.prototype.onTouchTap = function(e) { e.stopPropagation(), t.AppFacade.getInstance().sendNotification(PanelNotify.OPEN_FRIEND_GIVE_LIST, this.data) }, i.prototype.dataChanged = function() { var t = this.data.from_user_nickname, e = 0 == this.data.type ? "金币转赠": "果实转赠", i = this.data.deal_id, n = "编号:" + i + " " + t + " 给 " + this.data.be_user_nickname + " 的" + e; this.labelContent.text = n }, i } (t.BaseItemRenderer); t.FriendGiveNoComRender = e, __reflect(e.prototype, "game.FriendGiveNoComRender") } (game || (game = {})); var game; ! function(t) { var e = function(e) { function i() { var t = e.call(this) || this; return t.skinName = new FriendRankItemSkin, t } return __extends(i, e), i.prototype.createChildren = function() { e.prototype.createChildren.call(this) }, i.prototype.dataChanged = function() { var e = this.data; this.friendData = e, e.rank <= 3 ? (this.imgRank.visible = !0, this.labelRank.visible = !1, this.imgRank.source = "rank" + e.rank + "_png") : (this.imgRank.visible = !1, this.labelRank.visible = !0, this.labelRank.text = e.rank + ""), this.labelName.text = e.name.length > 7 ? e.name.substr(0, 7) + "...": e.name, 1 == Const.RANK_SHOW_TYPE ? this.labelLv.text = e.lv + "": 0 == Const.RANK_SHOW_TYPE ? this.labelLv.text = t.Utils.BigNumTostring(e.gold) : 2 == Const.RANK_SHOW_TYPE && (this.labelLv.text = e.fighting_capacity + ""), e.uid != Global.playerProxy.playerData.id && e.hasInteraction ? this.btnHand.visible = !0 : this.btnHand.visible = !1 }, i.prototype.onTouchTap = function(e) { var i = e.target; (i == this.btnHome || i == this.btnHand) && (this.friendData.uid == Global.playerProxy.playerData.id ? PopUpManager.popTip("这是你的农场,不用去啦!") : (t.AppFacade.getInstance().sendNotification(ClientNotify.GO_OTHER_FARM, { uid: this.friendData.uid }), t.AppFacade.getInstance().sendNotification(SceneNotify.CLOSE_MGAME), GameScenceManager.getInstance().be_user_id = this.friendData.uid)) }, i } (t.BaseItemRenderer); t.FriendItemRender = e, __reflect(e.prototype, "game.FriendItemRender") } (game || (game = {})); var game; ! function(t) { var e = function(e) { function i() { var t = e.call(this) || this; return t.skinName = new FriendReqItemSkin, t } return __extends(i, e), i.prototype.createChildren = function() { e.prototype.createChildren.call(this) }, i.prototype.dataChanged = function() { var t = this.data; this.labelName.text = t.name.length > 6 ? t.name.substr(0, 7) + "...": t.name, this.labelLv.text = t.lv + "", this.labelMoney.text = t.gold + "" }, i.prototype.onTouchTap = function(e) { var i = t.AppFacade.getInstance().retrieveMediator(t.FriendReqMediator.NAME), n = this.data, a = e.target, o = 2; a == this.btnOk && (o = 1), i.applyResult(o, n.uid, this.dealOver.bind(this)) }, i.prototype.dealOver = function() { t.EventManager.instance.dispatch(SysNotify.FRIEND_DEAL_OVER, this.data) }, i } (t.BaseItemRenderer); t.FriendReqItemRender = e, __reflect(e.prototype, "game.FriendReqItemRender") } (game || (game = {})); var game; ! function(t) { var e = function() { function t(t, e) { var i = Global.gameProxy.getItemConfig(t); i && (this.chageConfigToHasContent(i), this.number = e) } return t.prototype.chageConfigToHasContent = function(t) { var e = {}; e.id = t.id, e.type = t.type1, e.smallType = t.type2, e.name = t.name, e.lv = t.player_level, e.icon = t.graphical_id, e.desc = t.desc, e.sellPrice = t.sell_gold, e.effect = t.effect_id, this.config = e }, t } (); t.ItemData = e, __reflect(e.prototype, "game.ItemData") } (game || (game = {})); var game; ! function(t) { var e = function(e) { function i() { var t = e.call(this) || this; return t.skinName = new GoodsTipSkin, t } return __extends(i, e), i.show = function(e, n) { var a = i._instance; a || (a = new i, i._instance = a); var o = t.URLConfig.getIcon(e.config.icon); RES.getResByUrl(o, function(t) { a.imgIcon.source = o; var e = t.textureWidth, i = t.textureHeight; if (e > 70 || i > 70) { var n = Math.min(70 / e, 70 / i); a.imgIcon.scaleX = a.imgIcon.scaleY = n } }, this), a.labelName.text = e.config.name, a.labelDesc.y = a.labelName.y + a.labelName.height + 5, a.labelDesc.text = e.config.desc, egret.callLater(function() { a.anchorOffsetX = a.width / 2, a.anchorOffsetY = a.height / 2; var t = n.x, e = n.y - a.height / 2 - 16; n.x < a.width / 2 ? t = a.width / 2 : n.x > Const.WIN_W - a.width / 2 && (t = Const.WIN_W - a.width / 2), n.y < .2 * Const.WIN_H && (e = n.y + a.height / 2 + 20), a.x = t, a.y = e }, this), a.scaleX = a.scaleY = 0, GameLayerManager.instance.tipLayer.addChild(a), egret.Tween.get(a).to({ scaleX: 1, scaleY: 1 }, 150) }, i.hide = function() { var e = i._instance; e && egret.Tween.get(e).to({ scaleX: 0, scaleY: 0 }, 150).call(t.UIUtils.removeSelf, e, [e]) }, i } (eui.Component); t.ItemTip = e, __reflect(e.prototype, "game.ItemTip") } (game || (game = {})); var ItemType; ! function(t) { t[t.SEED = 1] = "SEED", t[t.FRUIT = 2] = "FRUIT", t[t.PROPS = 3] = "PROPS", t[t.SKIN = 4] = "SKIN", t[t.ANIMAL = 5] = "ANIMAL" } (ItemType || (ItemType = {})); var SmallType; ! function(t) { t[t.MANURE = 108] = "MANURE", t[t.DOG_FOOD = 4] = "DOG_FOOD", t[t.RE_SIGN = 5] = "RE_SIGN", t[t.DOG = 6] = "DOG", t[t.MAGIC_FRUIT = 10] = "MAGIC_FRUIT", t[t.CRYSTAL = 11] = "CRYSTAL", t[t.SKIN = 990] = "SKIN", t[t.CURRENCY = 1e3] = "CURRENCY", t[t.ANIMALFOOD = 109] = "ANIMALFOOD" } (SmallType || (SmallType = {})); var game; ! function(t) { var e = function() { function e(t, e) { this.landLv = 0, this.status = -1, this.cropNum = 0, this.landId = t, this.updateData(e) } return e.prototype.updateData = function(t) { t && (this.landLv = t.level, this.setPlantId(t.crop_id), this.cropNum = t.crop_num, this.stateBug = t.has_bug, this.stateGrass = t.has_grass, this.stateDry = t.has_dry, this.stateGather = t.has_gather, this.plantGatherTime = t.crop_gather_time, this.plantStartTime = t.crop_start_time, this.is_mystery_seed = t.is_mystery_seed, this.setStatus()) }, e.prototype.setStatus = function() { if (this.plantId < 1) return void(this.status = -1); if (1 == this.stateGather) return void(this.status = t.PlantStatus.die); if (this.plantStartTime === this.plantGatherTime) return void(this.status = t.PlantStatus.ripe); var e = DateTimer.instance.now, i = e - this.plantStartTime, n = this.plantConfig.time3, a = this.plantConfig.time2, o = this.plantConfig.time1; o > i ? this.status = t.PlantStatus.seed: i >= o && o + a > i ? this.status = t.PlantStatus.seeding: i >= o + a && o + a + n > i ? this.status = t.PlantStatus.growup: this.status = t.PlantStatus.ripe }, e.prototype.setPlantId = function(t) { this.plantId = t, t > 0 && (this.plantConfig = Global.gameProxy.getPlantConfig(t), this.plantName = this.plantConfig.name, this.plantAllStatusTime = [this.plantConfig.time1, this.plantConfig.time2, this.plantConfig.time3]) }, Object.defineProperty(e.prototype, "currPhaseTotalTime", { get: function() { return this.status < 3 ? 1e3 * this.plantAllStatusTime[this.status] : -1 }, enumerable: !0, configurable: !0 }), Object.defineProperty(e.prototype, "currPhaseRunTime", { get: function() { for (var t = DateTimer.instance.now - this.plantStartTime, e = 0, i = 0; i < this.status; i++) e += this.plantAllStatusTime[i]; return 1e3 * (t - e) }, enumerable: !0, configurable: !0 }), Object.defineProperty(e.prototype, "currPhaseNeedTime", { get: function() { var t = this.currPhaseTotalTime - this.currPhaseRunTime; return 0 > t && (t = 0), t }, enumerable: !0, configurable: !0 }), e } (); t.LandData = e, __reflect(e.prototype, "game.LandData") } (game || (game = {})); var game; ! function(t) { var e = function() { function t(t) { this.id = t.id, this.name = t.name, this.g1 = t.seedling_id, this.g2 = t.grow_id, this.g3 = t.ripe_id, this.time1 = t.seedling_time, this.time2 = t.grow_time, this.time3 = t.ripe_time, this.outputId = t.item_id } return t } (); t.PlantConfig = e, __reflect(e.prototype, "game.PlantConfig") } (game || (game = {})); var game; ! function(t) { var e; ! function(t) { t[t.empty = -1] = "empty", t[t.seed = 0] = "seed", t[t.seeding = 1] = "seeding", t[t.growup = 2] = "growup", t[t.ripe = 3] = "ripe", t[t.die = 4] = "die" } (e = t.PlantStatus || (t.PlantStatus = {})); var i = function() { function t() {} return t.getName = function(t) { var i = ""; switch (t) { case e.empty: break; case e.seed: i = "种子期"; break; case e.seeding: i = "发芽期"; break; case e.growup: i = "生长期"; break; case e.ripe: i = "成熟期"; break; case e.die: i = "枯萎" } return i }, t } (); t.PlantStatusCode = i, __reflect(i.prototype, "game.PlantStatusCode") } (game || (game = {})); var game; ! function(t) { var e = function(e) { function i(t) { var i = e.call(this) || this; return i.lastResURL = "", i.landData = t, i.touchChildren = i.touchEnabled = !1, i.touchThrough = !0, i.addEventListener(egret.Event.ADDED_TO_STAGE, i.onAdded, i), i.addEventListener(egret.Event.REMOVED_FROM_STAGE, i.onRemoved, i), i.init(), i } return __extends(i, e), i.prototype.onRemoved = function(e) { t.UIUtils.removeSelf(this.stateGroup) }, i.prototype.init = function() { this.renderContent(), GameLayerManager.instance.plantStateLayer.addChild(this.stateGroup) }, i.prototype.setDisease = function(e) { if (this.stateGroup.removeChildren(), t.Utils.isElinArr(this.landData.status, [t.PlantStatus.seed, t.PlantStatus.growup, t.PlantStatus.seeding])) { for (var i = e.length, n = 0; i > n; n++) { var a = new eui.Image("plant_state" + e[n] + "_png"); a.x = 33 * n, 3 == i && 1 == n && (a.y = -10), this.stateGroup.addChild(a) } var o = 33 * i; this.stateGroup.x = this.x - o / 2 - 13, this.landData.status == t.PlantStatus.growup ? this.stateGroup.y = -100 + this.y: this.stateGroup.y = -70 + this.y } }, i.prototype.updateDisease = function() { var t = []; this.landData.stateGrass && t.push(1), this.landData.stateBug && t.push(2), this.landData.stateDry && t.push(3), this.setDisease(t) }, i.prototype.onNextPhaseTimerOver = function(e) { this.landData.status == t.PlantStatus.seed ? this.landData.status = t.PlantStatus.seeding: this.landData.status == t.PlantStatus.seeding ? this.landData.status = t.PlantStatus.growup: this.landData.status == t.PlantStatus.growup && (this.landData.status = t.PlantStatus.ripe), this.changeData(this.landData) }, i.prototype.changeData = function(t) { this.landData = t, this.renderContent() }, i.prototype.onAdded = function(t) { GameLayerManager.instance.plantStateLayer.addChild(this.stateGroup) }, i.prototype.renderContent = function() { var e = this, i = this.landData; this.plantImage || (this.landImage = new eui.Image(RES.getRes("land_manure_png")), this.landImage.x = -Const.LAND_HALF_W, this.landImage.y = -Const.LAND_HALF_H, this.addChild(this.landImage), this.landImage.visible = !1, this.plantImage = new eui.Image, this.addChild(this.plantImage), this.stateGroup = new eui.Group, this.stateGroup.touchChildren = !1, this.stateGroup.touchEnabled = !1); var n = t.URLConfig.getPlant(i.plantId, i.status); this.lastResURL != n && (this.lastResURL = n, this.plantImage.source = "", RES.getResByUrl(n, function(n) { e.plantImage.source = n; var a = n.textureWidth, o = n.textureHeight; e.plantImage.x = -a / 2 - 10, i.status == t.PlantStatus.seed ? e.plantImage.y = -o: e.plantImage.y = -o + 10, e.box = new egret.Rectangle( - a / 3, .75 * -o, .66 * a, .75 * o) }, this)), this.nextPhaseTimer && (this.nextPhaseTimer.reset(), this.nextPhaseTimer.stop()), this.landData && t.Utils.isElinArr(this.landData.status, [t.PlantStatus.seed, t.PlantStatus.seeding, t.PlantStatus.growup]) && (this.nextPhaseTimer ? (this.nextPhaseTimer.delay = this.landData.currPhaseNeedTime, this.nextPhaseTimer.reset(), this.nextPhaseTimer.repeatCount = 1) : (this.nextPhaseTimer = new egret.Timer(this.landData.currPhaseNeedTime, 1), this.nextPhaseTimer.addEventListener(egret.TimerEvent.TIMER_COMPLETE, this.onNextPhaseTimerOver, this)), this.nextPhaseTimer.start()) }, i.prototype.getBoundingBox = function() { return this.box ? (this.boundingBox ? (this.boundingBox.x = this.box.x + this.x, this.boundingBox.y = this.box.y + this.y, this.boundingBox.width = this.box.width, this.boundingBox.height = this.box.height) : this.boundingBox = new egret.Rectangle(this.box.x + this.x, this.box.y + this.y, this.box.width, this.box.height), this.boundingBox) : null }, i.prototype.showReapAnim = function() { var e = this, i = t.URLConfig.getPlant(this.landData.plantId, t.PlantStatus.ripe), n = new eui.Image(i); this.addChild(n), RES.getResByUrl(i, function(i) { n.source = i; var a = i.textureWidth, o = i.textureHeight; n.x = -a / 2 - 10, n.y = -o + 10, egret.Tween.get(n).to({ y: n.y - 50, alpha: 0 }, 300).call(t.UIUtils.removeSelf, e, [n]) }, this) }, i } (eui.Group); t.WidgetLand = e, __reflect(e.prototype, "game.WidgetLand") } (game || (game = {})); var game; ! function(t) { var e = function() { function t(t) { this.uid = t.user_id, this.buid = t.be_user_id, this.name = t.be_user_nickname, this.type = t.type, this.time = t.time, this.itemId = t.item_id, this.itemNum = t.num } return t.prototype.toString = function() { var t = TimeFormat.showDayOrDate(this.time); return t += this.getUserName(), t += this.getOptName(), t += this.getItemValue() }, t.prototype.getUserName = function() { return this.uid === Global.playerProxy.playerData.user_id ? " 我": " " + this.name }, t.prototype.getItemValue = function() { if (this.itemId) { var t = Global.gameProxy.getItemConfig(this.itemId); if (t) return this.itemNum ? t.name + (t.smallType == SmallType.SKIN ? "": "x" + this.itemNum) : t.name } return "" }, t.prototype.getOptName = function() { var t = ""; switch (this.type) { case 0: t = "购买"; break; case 1: t = "卖出"; break; case 2: t = "种植"; break; case 3: t = "收获"; break; case 4: t = "偷取了"; break; case 5: t = "喂养施肥"; break; case 6: t = "进行了锄地"; break; case 7: t = "进行了土地升级"; break; case 8: t = "切换了农场风格"; break; case 9: t = "喂了狗狗"; break; case 10: t = "使坏放虫"; break; case 11: t = "使坏种草"; break; case 12: t = "对土地浇水"; break; case 13: t = "对植物除虫"; break; case 14: t = "对植物除草"; break; case 15: t = "扩建了1块土地"; break; case 16: t = "进行了房屋升级"; break; case 17: t = "被偷了"; break; case 18: t = "狗狗抓住"; break; case 19: t = "被狗狗抓住"; break; case 21: t = "给你种草"; break; case 20: t = "给你放虫"; break; case 22: t = "帮你浇水"; break; case 23: t = "帮你放虫"; break; case 28: t = "撤销交易"; break; case 24: t = "帮你浇水"; case 25: t = "兑换获得" + this.itemNum+"金币"; break; case 27: t = "提现" + this.itemNum+"金币"; break; case 32: t = "抽奖消耗" + this.itemNum+'金币'; break; case 33: t = "抽奖获得"; break; } return " " + t }, t } (); t.LogData = e, __reflect(e.prototype, "game.LogData") } (game || (game = {})); var game; ! function(t) { var e = function(t) { function e() { var e = t.call(this) || this; return e.skinName = new LogItemSkin, e } return __extends(e, t), e.prototype.createChildren = function() { t.prototype.createChildren.call(this) }, e.prototype.dataChanged = function() { var t = this.data; this.labelLog.text = t.toString(), this.imgBg.height = this.labelLog.height + 25 }, e } (t.BaseItemRenderer); t.LogItemRender = e, __reflect(e.prototype, "game.LogItemRender") } (game || (game = {})); var game; ! function(t) { var e = function() { function t(t) { this.message = t.message, this.created_at = t.created_at } return t.prototype.toString = function() { var t = TimeFormat.showDayOrDate(this.created_at) + " " + this.message; return t }, t } (); t.SystemLogData = e, __reflect(e.prototype, "game.SystemLogData") } (game || (game = {})); var game; ! function(t) { var e = function(e) { function i() { var t = e.call(this) || this; return t.skinName = new ShopItemSkin, t.addEventListener(egret.Event.ADDED_TO_STAGE, t.onAdded, t), t.addEventListener(egret.Event.REMOVED_FROM_STAGE, t.onRemoved, t), t } return __extends(i, e), i.prototype.onAdded = function() { e.prototype.onAdded.call(this) }, i.prototype.onRemoved = function() { e.prototype.onRemoved.call(this) }, i.prototype.createChildren = function() { e.prototype.createChildren.call(this), t.UIUtils.addShortTouch(this.groupIcon, this.onShortTouchBegan.bind(this), this.onShortTouchEnd.bind(this)) }, i.prototype.onShortTouchBegan = function() { this.shopItemData && t.ItemTip.show(this.shopItemData.itemData, this.groupIcon.localToGlobal(this.groupIcon.width / 2, this.groupIcon.height / 2)) }, i.prototype.onShortTouchEnd = function() { t.ItemTip.hide() }, i.prototype.dataChanged = function() { this.shopItemData = this.data, this.imgIcon.source = t.URLConfig.getIcon(this.shopItemData.itemData.config.icon), this.labelName.text = this.shopItemData.itemData.config.name, this.labelLv.text = "Lv." + this.shopItemData.playerLevel, this.shopItemData.gold > 0 ? (this.imgPriceType.source = "sicon_gold_png", this.labelPrice.text = this.shopItemData.gold + "") : (this.imgPriceType.source = "sicon_diamond_png", this.labelPrice.text = this.shopItemData.diamond + ""); var e = Global.playerProxy.playerData, i = Global.playerProxy.getHasItemByItemId(this.shopItemData.itemData.config.id); i && (this.btnBuy.enabled = !1, this.btnBuy.label = "已拥有"), this.btnBuy.enabled = e.level >= this.shopItemData.playerLevel, this.imgLock.visible = e.level < this.shopItemData.playerLevel }, i.prototype.onTouchTap = function(e) { return __awaiter(this, void 0, void 0, function() { var i, n, a, o; return __generator(this, function(s) { switch (s.label) { case 0: return i = e.target, i != this.btnBuy ? [3, 2] : (n = 1, this.btnBuy.enabled = !1, a = t.AppFacade.getInstance().retrieveMediator(t.ShopMediator.NAME), [4, a.buy(this.shopItemData, n)]); case 1: if (o = s.sent(), 0 == o) return this.btnBuy.label = "已拥有", [2]; this.btnBuy.enabled = !0, s.label = 2; case 2: return [2] } }) }) }, i } (t.BaseItemRenderer); t.ShopDogItemRender = e, __reflect(e.prototype, "game.ShopDogItemRender") } (game || (game = {})); var game; ! function(t) { var e = function() { function e(e) { this.id = e.id, this.diamond = e.gem, this.gold = e.gold, this.playerLevel = e.player_level, this.type = e.type, this.priority_type1 = e.priority_type1, this.itemData = new t.ItemData(e.item_id, 0) } return e } (); t.ShopItemData = e, __reflect(e.prototype, "game.ShopItemData") } (game || (game = {})); var game; ! function(t) { var e = function(e) { function i() { var t = e.call(this) || this; return t.skinName = new ShopItemSkin, t } return __extends(i, e), i.prototype.onAdded = function() { e.prototype.onAdded.call(this) }, i.prototype.onRemoved = function() { e.prototype.onRemoved.call(this) }, i.prototype.createChildren = function() { e.prototype.createChildren.call(this), t.UIUtils.addShortTouch(this.groupIcon, this.onShortTouchBegan.bind(this), this.onShortTouchEnd.bind(this)) }, i.prototype.onShortTouchBegan = function() { this.shopItemData && t.ItemTip.show(this.shopItemData.itemData, this.groupIcon.localToGlobal(this.groupIcon.width / 2, this.groupIcon.height / 2)) }, i.prototype.onShortTouchEnd = function() { t.ItemTip.hide() }, i.prototype.childrenCreated = function() { e.prototype.childrenCreated.call(this) }, i.prototype.dataChanged = function() { e.prototype.dataChanged.call(this), this.shopItemData = this.data, this.imgIcon.source = t.URLConfig.getIcon(this.shopItemData.itemData.config.icon), this.labelName.text = this.shopItemData.itemData.config.name, this.labelLv.text = "Lv." + this.shopItemData.playerLevel, this.shopItemData.gold > 0 ? (this.imgPriceType.source = "3002_png", this.labelPrice.text = t.Utils.BigNumTostring(this.shopItemData.gold)) : (this.imgPriceType.source = "3001_png", this.labelPrice.text = t.Utils.BigNumTostring(this.shopItemData.diamond)); var i = Global.playerProxy.playerData; if (this.btnBuy.enabled = i.level >= this.shopItemData.playerLevel, this.imgLock.visible = i.level < this.shopItemData.playerLevel, 101001 == this.shopItemData.itemData.config.id && GuideManager.getInsatance().isShowGuide && 0 == GuideManager.getInsatance().target && 0 == GuideManager.getInsatance().step && (GuideManager.getInsatance().des = TextConst.textObj[3], GuideManager.getInsatance().show(this.btnBuy, !1, 210, 329)), 201002 == this.shopItemData.itemData.config.id && GuideManager.getInsatance().isShowGuide && 6 == GuideManager.getInsatance().target && 0 == GuideManager.getInsatance().step) { GuideManager.getInsatance().des = TextConst.textObj[26]; t.AppFacade.getInstance().retrieveMediator(t.GameMediator.NAME); GuideManager.getInsatance().show(this.btnBuy, !1, 210, 504) } }, i.prototype.onTouchTap = function(e) { var i = e.target; if (i == this.btnBuy) { var n = 1; 99 == this.shopItemData.id && (n = 100); var a = t.AppFacade.getInstance().retrieveMediator(t.ShopMediator.NAME); a.buy(this.shopItemData, n) } }, i } (t.BaseItemRenderer); t.ShopItemRender = e, __reflect(e.prototype, "game.ShopItemRender") } (game || (game = {})); var game; ! function(t) { var e = function(e) { function i() { var t = e.call(this) || this; return t.skinName = new ShopSkinItemSkin, t } return __extends(i, e), i.prototype.createChildren = function() { e.prototype.createChildren.call(this) }, i.prototype.dataChanged = function() { this.shopItemData = this.data, this.imgTitle.source = t.URLConfig.getSkinName(this.shopItemData.itemData.config.icon), this.imgIcon.source = t.URLConfig.getIcon(this.shopItemData.itemData.config.icon), this.shopItemData.diamond > 0 ? (this.labelPrice.text = this.shopItemData.diamond + "", this.wupinImage.source = "3001_png") : (this.wupinImage.source = "3002_png", this.labelPrice.text = this.shopItemData.gold + ""), Global.playerProxy.wareHouseHas(this.shopItemData.itemData.config.id) ? (this.btnBuy.enabled = !1, this.imgBuyed.visible = !0) : (this.btnBuy.enabled = !0, this.imgBuyed.visible = !1) }, i.prototype.onTouchTap = function(t) { var e = t.target; e == this.btnBuy && this.onBuy() }, i.prototype.onBuy = function() { return __awaiter(this, void 0, void 0, function() { var e, i; return __generator(this, function(n) { switch (n.label) { case 0: return e = Global.playerProxy.playerData, e.gold <= this.shopItemData.gold ? (TipsUtils.showTipsDownToUp("钻石不够,请充值", !0), [3, 3]) : [3, 1]; case 1: return i = t.AppFacade.getInstance().retrieveMediator(t.ShopMediator.NAME), [4, i.buy(this.shopItemData, 1)]; case 2: n.sent(), this.dataChanged(), n.label = 3; case 3: return [2] } }) }) }, i } (t.BaseItemRenderer); t.ShopSkinItemRender = e, __reflect(e.prototype, "game.ShopSkinItemRender") } (game || (game = {})); var game; ! function(t) { var e = function(e) { function i() { var t = e.call(this) || this; return t.skinName = new SkinItemSkin, t } return __extends(i, e), i.prototype.onAdded = function() { e.prototype.onAdded.call(this), t.EventManager.instance.addEvent(SysNotify.USER_SKIN_CHANGE, this.updateShow, this) }, i.prototype.onRemoved = function() { e.prototype.onRemoved.call(this), t.EventManager.instance.removeEvent(SysNotify.USER_SKIN_CHANGE, this.updateShow, this) }, i.prototype.createChildren = function() { e.prototype.createChildren.call(this), this.imgTitle.visible = !1 }, i.prototype.dataChanged = function() { this.itemData = this.data, this.updateShow() }, i.prototype.updateShow = function() { this.imgIcon.source = t.URLConfig.getIcon(this.itemData.config.icon); var e = Global.playerProxy.playerData, i = Global.gameProxy.getItemConfig(e.bg_image_id), n = i.graphical_id === this.itemData.config.icon; this.imgTitle.visible = n }, i.prototype.onTouchTap = function(e) { var i = Global.playerProxy.playerData, n = Global.gameProxy.getItemConfig(i.bg_image_id), a = n.graphical_id === this.itemData.config.icon; if (!a) { var o = t.AppFacade.getInstance().retrieveMediator(t.SkinMediator.NAME); o.changeSkin(this.itemData.config.id) } }, i } (t.BaseItemRenderer); t.SkinItem = e, __reflect(e.prototype, "game.SkinItem") } (game || (game = {})); var game; ! function(t) { var e = function(e) { function i(t) { var i = e.call(this) || this; return i.exNum = 1, i.longTouchAddEx = 0, i.itemData = t, i.isVisibleAnimate = !0, i.skinName = new SellSkin, i } return __extends(i, e), i.prototype.createChildren = function() { e.prototype.createChildren.call(this), this.updateShow(), this.inpNum.addEventListener(egret.Event.FOCUS_OUT, this.onNumInpChange, this) }, i.prototype.updateShow = function() { var e = this; this.imgIcon.source = t.URLConfig.getIcon(this.itemData.config.icon), this.labelName.text = this.itemData.config.name, this.labelPrice.text = this.itemData.config.sellPrice + "", this.inpNum.text = this.itemData.number + "", this.exNum = this.itemData.number, this.onNumInpChange(), this.itemData.config.smallType == SmallType.MAGIC_FRUIT ? t.MCUtils.getMc("magic_eff", function(i) { e.mcEff && "magic_eff" == e.mcEff.name || t.UIUtils.removeSelf(e.mcEff), e.mcEff = i, i.x = 168, i.y = 395, i.play( - 1), i.blendMode = egret.BlendMode.ADD, e.panel.addChild(i) }) : t.UIUtils.removeSelf(this.mcEff) }, i.prototype.onNumInpChange = function() { this.exNum = parseInt(this.inpNum.text), this.exNum = t.Utils.limit(this.exNum, 1, this.itemData.number), this.inpNum.text = this.exNum + "", this.updateTotal() }, i.prototype.btnCloseTouchEnded = function() { this.onHide() }, i.prototype.btnAddTouchEnded = function() { this.changeExNumber(1) }, i.prototype.btnSubTouchEnded = function() { this.changeExNumber( - 1) }, i.prototype.btnSellTouchEnded = function() { this.sell() }, i.prototype.updateTotal = function() { this.labelPriceTotal.text = this.exNum * this.itemData.config.sellPrice + "" }, i.prototype.changeExNumber = function(e, i) { void 0 === i && (i = !1), i ? this.exNum = e: this.exNum += e, this.exNum = t.Utils.limit(this.exNum, 1, this.itemData.number), this.inpNum.text = this.exNum + "", this.updateTotal() }, i.prototype.startSubExNum = function() { this.longTouchAddEx = -1 }, i.prototype.endSubExNum = function() { this.longTouchAddEx = 0 }, i.prototype.startAddExNum = function() { this.longTouchAddEx = 1 }, i.prototype.endAddExNum = function() { this.longTouchAddEx = 0 }, i.prototype.changePrice = function() {}, i.prototype.update = function(t) { this.changeExNumber(this.longTouchAddEx), (1 == this.exNum || this.exNum == Const.EX_MAX_NUMBER) && (this.longTouchAddEx = 0) }, i.prototype.sell = function() { var t = this; this.itemData.config.sellPrice > 999 ? Global.alertMediator.addAlert("该物品价值较高,确认出售吗?", function() { t.doSell() }) : this.doSell() }, i.prototype.doSell = function() { var e = this, i = t.AppFacade.getInstance().retrieveMediator(t.WareHouseMediator.NAME); i.sellWareHouseItem(this.itemData.config, this.exNum, function() { e.onHide() }) }, i } (t.BasePanel); t.SellPanel = e, __reflect(e.prototype, "game.SellPanel") } (game || (game = {})); var game; ! function(t) { var e = function(e) { function i() { var i = e.call(this) || this; return i.skinName = new WareHouseItemSkin, t.UIUtils.addLongTouch(i, i.onLongTouchBegan.bind(i), i.onLongTouchEnd.bind(i)), i } return __extends(i, e), i.prototype.onLongTouchBegan = function() { var e = this.data; e && t.ItemTip.show(e, this.localToGlobal(this.width / 2, this.height / 2)) }, i.prototype.onLongTouchEnd = function() { t.ItemTip.hide() }, i.prototype.dataChanged = function() { var e = this, i = this.data; if (i) { this.imgIcon.source = t.URLConfig.getIcon(i.config.icon), this.labelNum.text = i.number > 0 ? "x" + i.number: "", this.labelLv.text = "Lv." + i.config.lv, this.imgNumbg.visible = !0; var n = ""; i.config.smallType == SmallType.MAGIC_FRUIT ? n = "magic_eff": i.config.smallType == SmallType.CRYSTAL ? n = "crystal_eff": t.UIUtils.removeSelf(this.mcEff), this.mcEff && "magic_eff" == this.mcEff.name || t.UIUtils.removeSelf(this.mcEff), n && t.MCUtils.getMc(n, function(t) { e.mcEff = t, e.mcEff.x = e.width / 2, e.mcEff.y = e.height / 2 + 5, e.mcEff.play( - 1), e.mcEff.blendMode = egret.BlendMode.ADD, e.addChildAt(e.mcEff, 2) }); var a = Global.playerProxy.getItemBigTypeByArr([3, 5, 6, 7, 8, 9, 10, 12, 13, 14, 15]); a.sort(function(t, e) { return t.config.id - e.config.id }); for (var o = a.concat(), s = 0, r = 0; r < o.length; r++) if (o[r].config.id == i.config.id) { s = r; break } this.validateNow() } else this.imgIcon.source = null, this.labelNum.text = "", this.labelLv.text = "", this.imgNumbg.visible = !1, t.UIUtils.removeSelf(this.mcEff) }, i.prototype.setLabelText = function(t, e) { void 0 === e && (e = 12149e3), this.labelNum.textColor = e, this.labelNum.text = t }, i.prototype.onTouchTap = function(e) { if (this.data) { var i = this.data; if (i.config.sellPrice > 0) { var n = new t.SellPanel(i); GameLayerManager.instance.popLayer.addChild(n) } } }, i } (t.BaseItemRenderer); t.WareHouseItem = e, __reflect(e.prototype, "game.WareHouseItem") } (game || (game = {})); var game; ! function(t) { var e = function(e) { function i() { var t = e.call(this) || this; return t.skinName = new PlantCdTipSkin, t } return __extends(i, e), i.show = function(e, n) { if (e && !(e.plantId <= 0)) { var a = i._instance; if (a || (a = new i, i._instance = a), 1 != e.is_mystery_seed || e.status != t.PlantStatus.seeding && e.status != t.PlantStatus.seed ? a.labelName.text = e.plantName + " (" + t.PlantStatusCode.getName(e.status) + ")": a.labelName.text = "神秘种子", a.labelTime.text = e.status == t.PlantStatus.ripe ? "剩余果实:" + e.cropNum: e.status == t.PlantStatus.die ? "已经收获": t.Utils.showTimeFormat(e.currPhaseNeedTime) + "后" + t.PlantStatusCode.getName(e.status + 1), e.status == t.PlantStatus.ripe || e.status == t.PlantStatus.die) a.barTime.value = 100; else { var o = e.currPhaseRunTime / e.currPhaseTotalTime; a.barTime.value = t.Utils.limit(100 * o, 0, 100) } egret.callLater(function() { a.anchorOffsetX = a.width / 2, a.anchorOffsetY = a.height / 2; var t = n.x, e = n.y - a.height / 2 - 16; n.x < a.width / 2 ? t = a.width / 2 : n.x > Const.WIN_W - a.width / 2 && (t = Const.WIN_W - a.width / 2), n.y < .2 * Const.WIN_H && (e = n.y + a.height / 2 + 20), a.x = t, a.y = e }, this), a.scaleX = a.scaleY = 0, GameLayerManager.instance.tipLayer.addChild(a), egret.Tween.get(a).to({ scaleX: 1, scaleY: 1 }, 150) } }, i.hide = function() { var e = i._instance; e && e.stage && egret.Tween.get(e).to({ scaleX: 0, scaleY: 0 }, 150).call(t.UIUtils.removeSelf, e, [e]) }, i } (eui.Component); t.PlantCdTip = e, __reflect(e.prototype, "game.PlantCdTip") } (game || (game = {})); var game; ! function(t) { var e = function() { function e() {} return e.popTip = function(i, n, a, o) { var s; s = e._pool.length > 0 ? e._pool.pop() : new eui.Label, s.touchEnabled = !1, s.text = i, s.size = 30, s.x = n + t.Utils.rang( - o, o), s.y = a + t.Utils.rang( - o, o), GameLayerManager.instance.tipLayer.addChild(s), egret.Tween.get(s).to({ y: s.y - 100 }, 500).call(function() { e._pool.length < 50 && (t.UIUtils.removeSelf(s), e._pool.push(s)) }) }, e._pool = [], e } (); t.SimpleTip = e, __reflect(e.prototype, "game.SimpleTip") } (game || (game = {})); var game; ! function(t) { var e = function(e) { function i() { var t = e.call(this) || this; t.touchChildren = !1, t.touchEnabled = !1; var i = new eui.Image("log_itembg_png"); i.scale9Grid = new egret.Rectangle(25, 25, 1, 1), t.addChild(i), i.horizontalCenter = 0, i.verticalCenter = 0, t.bg = i; var n = new eui.Label; return n.textAlign = "center", n.lineSpacing = 5, n.maxWidth = 450, n.textColor = 16720418, n.horizontalCenter = 0, n.verticalCenter = 0, t.label = n, t.addChild(n), t } return __extends(i, e), i.prototype.updateTxt = function(t, e) { e ? this.label.textFlow = FontUtils.html(t) : this.label.text = t, this.label.x = -this.label.width / 2, this.label.y = 20, this.bg.width = this.label.width + 30, this.bg.height = this.label.height + 24 }, i.popTip = function(e, n, a) { void 0 === n && (n = 1e3), void 0 === a && (a = !1); var o; i._pool.length > 0 ? (o = i._pool.pop(), o.alpha = 1) : o = new i, o.updateTxt(e, a), o.x = (Const.WIN_W - o.bg.width) / 2, o.y = (Const.WIN_H - o.bg.height) / 2, GameLayerManager.instance.tipLayer.addChild(o), egret.Tween.get(o).to({ y: o.y - 50 }, 100, egret.Ease.backOut).wait(n).to({ y: o.y - 180, alpha: 0 }, 200).call(function() { t.UIUtils.removeSelf(o), i._pool.length < 50 && i._pool.push(o) }) }, i._pool = [], i } (eui.Group); t.ToastTip = e, __reflect(e.prototype, "game.ToastTip") } (game || (game = {})); var UseBattlePetTips = function(t) { function e() { var e = t.call(this) || this; return e.skinName = UseBattlePetTipsSkin, e } return __extends(e, t), e.prototype.childrenCreated = function() { t.prototype.childrenCreated.call(this), this.updata(), this.useButton.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTab, this), game.UIUtils.addButtonScaleEffects(this) }, e.prototype.onTab = function(t) { if (Global.netProxy.sendRequest(GameConfig.SERVER_PATH + "pet/brooding-egg", { item_id: this.data.config.id, user_id: Global.playerProxy.playerData.id }, this.onSendNetzy.bind(this)), 201021 == this.data.config.id && GuideManager.getInsatance().isShowGuide && 4 == GuideManager.getInsatance().target && 0 == GuideManager.getInsatance().step) { this.validateNow(), GuideManager.getInsatance().des = TextConst.textObj[18], GuideManager.getInsatance().step = 0, GuideManager.getInsatance().target = 5, GuideManager.getInsatance().sendNetMessage(); var e = game.AppFacade.getInstance().retrieveMediator(game.WareHouseMediator.NAME); GuideManager.getInsatance().show(e.viewComponent.btnClose) } }, e.prototype.updata = function() { this.desLabel.text = "确定使用" + this.data.config.name + "吗", 201021 == this.data.config.id && GuideManager.getInsatance().isShowGuide && 4 == GuideManager.getInsatance().target && 0 == GuideManager.getInsatance().step && (this.validateNow(), GuideManager.getInsatance().des = TextConst.textObj[17], GuideManager.getInsatance().show(this.useButton)) }, e.prototype.onSendNetzy = function(t) { if (0 == t.status) { game.AppFacade.getInstance().sendNotification(PanelNotify.CLOSE_PET_USE), TipsUtils.showTipsDownToUp("使用成功"), Global.playerProxy.sellWareHouseItem({ id: this.data.config.id }, 1); var e = game.AppFacade.getInstance().retrieveMediator(game.WareHouseMediator.NAME); e.viewComponent.flushList() } }, e } (eui.Component); __reflect(UseBattlePetTips.prototype, "UseBattlePetTips"); var UseBattlePetTipsMediator = function(t) { function e() { return t.call(this, "UseBattlePetTipsMediator") || this } return __extends(e, t), e.prototype.listNotificationInterests = function() { return [PanelNotify.OPEN_PET_USE, PanelNotify.CLOSE_PET_USE] }, e.prototype.onRegister = function() { t.prototype.onRegister.call(this) }, e.prototype.showViewComponent = function(t) { void 0 === t && (t = 7), this.viewComponent = new UseBattlePetTips, this.viewComponent.data = this.data, this.showUI(this.viewComponent, !0, 0, 0, t) }, e.prototype.handleNotification = function(t) { var e = t.getBody(); switch (t.getName()) { case PanelNotify.OPEN_PET_USE: this.data = e, this.showViewComponent(); break; case PanelNotify.CLOSE_PET_USE: this.closeViewComponent() } }, e.NAME = "UseBattlePetTipsMediator", e } (BaseMediator); __reflect(UseBattlePetTipsMediator.prototype, "UseBattlePetTipsMediator"); var AchiconitemRender = function(t) { function e() { var e = t.call(this) || this; return e.skinName = AchiIconSkin, e } return __extends(e, t), e.prototype.partAdded = function(e, i) { t.prototype.partAdded.call(this, e, i) }, e.prototype.childrenCreated = function() { t.prototype.childrenCreated.call(this) }, e.prototype.dataChanged = function() { t.prototype.dataChanged.call(this); var e = Global.gameProxy.getItemConfig(this.data.itemData.config.id); this.imgIcon.source = e.graphical_id + "_png" }, e } (eui.ItemRenderer); __reflect(AchiconitemRender.prototype, "AchiconitemRender"); var GameConfig; ! function(t) { function e() { var t = window.navigator.userAgent.toLowerCase(), e = "" + t.match(/MicroMessenger/i); return "null" == e ? !1 : "micromessenger" == e ? !0 : void 0 } function i() { return console.log("w---" + document.body.clientWidth + "h---" + document.body.clientHeight), document.body.clientHeight / document.body.clientWidth > 1.32 } function n() { var t = window.navigator.userAgent.toLowerCase(); "" + t.match(/MicroMessenger/i); return "" + t.match(/windows nt/i) == "windows nt" ? "windows": "" + t.match(/iphone/i) == "iphone" ? "ios": "" + t.match(/android/i) == "android" ? "android": "" + t.match(/ipad/i) == "ipad" ? "ipad": "" + t.match(/linux/i) == "linux" ? "linux": "" + t.match(/mac/i) == "mac" ? "mac": "" + t.match(/ucbrower/i) == "ucbrower" ? "ucbrower": void console.log("未知系统类型") } function a() { var t = window.navigator.userAgent.toLowerCase(); return "" + t.match(/micromessenger/i) == "micromessenger" ? "micromessenger": "" + t.match(/qzone/i) == "qzone" ? "qzone": "" + t.match(/weibo/i) == "weibo" ? "weibo": "" + t.match(/qq/i) == "qq" ? "qq": "" + t.match(/renren/i) == "renren" ? "renren": "" + t.match(/txmicroblog/i) == "txmicroblog" ? "txmicroblog": "" + t.match(/douban/i) == "douban" ? "douban": "other" } function o() { return egret.MainContext.instance.stage } function s() { return egret.MainContext.instance.stage.stageWidth } function r() { return egret.MainContext.instance.stage.stageHeight } t.version = "1.2", t.GAME_EXPORT = !0, t.SERVER_PATH = "http://"+window.location.host+"/home/web/index.php?r=", t.SOKCET_PATH = "http://"+window.location.host+":9501", t.DEBUG_MODEL = !0, t.WEIXIN_DEBUG = !1, t.GAME_NAME = "php-farm1", t.REMAIN_UN_KEY = "qqfarm2.1024.un", t.REMAIN_PW_KEY = "qqfarm2.1024.pw", t.REMAIN_UN_SEL_KEY = "qqfarm2.1024.un_select", t.REMAIN_PW_SEL_KEY = "qqfarm2.1024.pw_select", t.TextColors = { white: 16777215, milkWhite: 16511407, grayWhite: 13547170, yellow: 16776960, lightYellow: 16765813, orangeYellow: 16750848, red: 15799040, green: 58624, blue: 1742039, grayBlue: 3101047, purple: 15284466, pink: 16724016, black: 3026221, golden: 16766720 }, t.LabelFontSize = { littleSize: 12, middleSize: 18, normalSize: 24, bigSize: 36 }, t.isWeiXin = e, t.isBigScreen = i, t.systemType = n, t.platformType = a, t.curStage = o, t.curWidth = s, t.curHeight = r, t.DES_WIDTH = 640, t.DES_HEIGHT = 960, t.GOLD_ID = 105001, t.GEM_ID = 105002 } (GameConfig || (GameConfig = {})); var game; ! function(t) { var e = function(e) { function i() { var t = e.call(this) || this; return t.skinName = new FriendGiveListItemSkin, t } return __extends(i, e), i.prototype.createChildren = function() { e.prototype.createChildren.call(this) }, i.prototype.dataChanged = function() { this.data; if ( - 3 == this.data.item_id) this.labelNum.text = "x" + this.data.num; else { var e = Global.gameProxy.getItemConfig(this.data.item_id); this.imgIcon.source = t.URLConfig.getIcon(e.graphical_id), this.labelNum.text = "x" + this.data.num } }, i } (t.BaseItemRenderer); t.FriendGiveListItemRender = e, __reflect(e.prototype, "game.FriendGiveListItemRender") } (game || (game = {})); var game; ! function(t) { var e = function(t) { function e() { var e = t.call(this) || this; return e.skinName = new NoticeListItemSkin, e } return __extends(e, t), e.prototype.createChildren = function() { t.prototype.createChildren.call(this) }, e.prototype.dataChanged = function() { var t = this.data; this.titleLabel.text = t.title, this.contentLabel.text = t.message, this.timeLabel.text = TimeFormat.showDayOrDate(t.created_at) }, e } (t.BaseItemRenderer); t.NoticeItemRender = e, __reflect(e.prototype, "game.NoticeItemRender") } (game || (game = {})); var game; ! function(t) { var e = function(e) { function i() { var t = e.call(this) || this; return t.skinName = new PayItemRenderSkin, t } return __extends(i, e), i.prototype.createChildren = function() { e.prototype.createChildren.call(this), this.buyBtn.addEventListener(egret.TouchEvent.TOUCH_TAP, this.buyBtnTouchEnded, this) }, i.prototype.buyBtnTouchEnded = function() { this.payPanel.buy(this.payConfig) }, i.prototype.initWidthData = function(e, i, n) { this.payConfig = e, this.payPanel = n, e.id <= 6 ? (this.iconImage.source = RES.getRes("3001_png"), this.payIcon.source = RES.getRes("pay_d" + i + "_png"), this.labelValue.text = t.Utils.BigNumTostring(e.gem)) : (this.iconImage.source = RES.getRes("3002_png"), this.labelValue.text = t.Utils.BigNumTostring(e.gold), this.payIcon.source = RES.getRes("pay_g" + i + "_png")), this.rmbLabel.text = "¥" + e.rmb }, i } (eui.Component); t.PayItemRender = e, __reflect(e.prototype, "game.PayItemRender") } (game || (game = {})); var game; ! function(t) { var e = function(e) { function i(t) { var i = e.call(this) || this; return i.type = t, i.isFullScreen = !0, i.isVisibleAnimate = !0, i.skinName = new BagPanelSkin, i } return __extends(i, e), i.prototype.onShow = function() { this.isVisibleAnimate ? (this.x = 114, egret.Tween.get(this).to({ x: 0 }, 250, egret.Ease.sineOut).call(this.onShowAnimateOver, this)) : this.onShowAnimateOver() }, i.prototype.onHide = function() { egret.Tween.get(this).to({ x: 114 }, 250, egret.Ease.sineOut).call(this.onShowAnimateOver, this) }, i.prototype.onShowAnimateOver = function() { e.prototype.onShowAnimateOver.call(this) }, i.prototype.onAdded = function() { e.prototype.onAdded.call(this), Const.stage.addEventListener(egret.TouchEvent.TOUCH_BEGIN, this.onStageTouchBegin, this), this.addEventListener(egret.TouchEvent.TOUCH_BEGIN, this.onTargetTouchBegin, this) }, i.prototype.onRemoved = function() { e.prototype.onRemoved.call(this), Const.stage.removeEventListener(egret.TouchEvent.TOUCH_BEGIN, this.onStageTouchBegin, this), this.removeEventListener(egret.TouchEvent.TOUCH_BEGIN, this.onTargetTouchBegin, this) }, i.prototype.createChildren = function() { e.prototype.createChildren.call(this), this.list.itemRenderer = t.BagIconRender; var i = Global.playerProxy.getItemByType(this.type); this.type == ItemType.PROPS && (i = Global.playerProxy.getItemBySmallType(SmallType.MANURE)), i.sort(function(t, e) { return t.config.id - e.config.id }), this.list.dataProvider = new eui.ArrayCollection(i) }, i.prototype.onTargetTouchBegin = function(t) { t.stopPropagation() }, i.prototype.onStageTouchBegin = function() { t.AppFacade.getInstance().sendNotification(PanelNotify.CLOSE_BAG) }, i } (t.BasePanel); t.BagPanel = e, __reflect(e.prototype, "game.BagPanel") } (game || (game = {})); var game; ! function(t) { var e = function(e) { function i(t, i) { var n = e.call(this) || this; return n._selectIndex = -1, n.dataArr = t, n.itemClickCallback = i, n.initItems(), n.addEventListener(egret.TouchEvent.TOUCH_TAP, n.onTouchTap, n), n } return __extends(i, e), i.prototype.initItems = function() { var e = this; this.itemArr = []; for (var i = 0; i < this.dataArr.length; i++) { var n = new t.TabItem(this.dataArr[i]); this.itemArr.push(n), n.x = 90 * i, n.bottom = -1, this.addChild(n) } egret.callLater(function() { e.setSelectIndex(0) }, this) }, i.prototype.onTouchTap = function(e) { var i = e.target; if (i instanceof t.TabItem) { var n = this.itemArr.indexOf(i); this.setSelectIndex(n) } }, i.prototype.setSelectIndex = function(t, e) { void 0 === e && (e = !0); for (var i = 0, n = 0; n < this.itemArr.length; n++) { var a = this.itemArr[n]; a.select = t == n, a.bottom = t == n ? -4 : -2, a.x = i, i += a.width + 5 } e && (this._selectIndex = t, this.itemClickCallback(t)), this._selectIndex = t }, Object.defineProperty(i.prototype, "selectIndex", { get: function() { return this._selectIndex }, enumerable: !0, configurable: !0 }), i.prototype.setItemBaseHeight = function(t) { for (var e = 0; e < this.itemArr.length; e++) { var i = this.itemArr[e]; i.baseHeight = t } }, i } (eui.Group); t.Tab = e, __reflect(e.prototype, "game.Tab") } (game || (game = {})); var game; ! function(t) { var e = function(t) { function e(e) { var i = t.call(this) || this; return i._select = !1, i.baseHeight = 40, i.touchChildren = !1, i.touchEnabled = !0, i.bg = new eui.Image("tab_unselecte_png"), i.bg.scale9Grid = new egret.Rectangle(40, 20, 2, 2), i.addChild(i.bg), i.label = new eui.Label(e), i.label.fontFamily = "huakang", i.label.size = 26, i.label.textColor = 7749668, i.addChild(i.label), i.label.horizontalCenter = 0, i.label.verticalCenter = 0, i.label.stroke = 0, i.label.strokeColor = 7031078, i } return __extends(e, t), Object.defineProperty(e.prototype, "select", { get: function() { return this._select }, set: function(t) { var e = this.label.width; t ? (this.label.stroke = 3, this.label.textColor = 16777215, this.bg.source = "tab_selected_png", this.bg.width = Math.max(105, e + 34), this.bg.height = this.baseHeight + 7) : (this.label.stroke = 0, this.label.textColor = 7749668, this.bg.source = "tab_unselecte_png", this.bg.width = Math.max(88, e + 34), this.bg.height = this.baseHeight) }, enumerable: !0, configurable: !0 }), e } (eui.Group); t.TabItem = e, __reflect(e.prototype, "game.TabItem") } (game || (game = {})); var game; ! function(t) { var e = function(e) { function i(t) { var i = e.call(this) || this; return i.tipsText = t.tips, i.okCallback = t.okCallback || null, i.noCallback = t.noCallback || null, i.onlyOkBtn = t.onlyOkBtn || !1, i.skinName = new AlertSkin, i } return __extends(i, e), i.prototype.btnNoTouchEnded = function() { this.noCallback && this.noCallback(), t.AppFacade.getInstance().sendNotification(PanelNotify.CLOSE_ALERT) }, i.prototype.btnOkTouchEnded = function() { this.okCallback && this.okCallback(), t.AppFacade.getInstance().sendNotification(PanelNotify.CLOSE_ALERT) }, i.prototype.createChildren = function() { e.prototype.createChildren.call(this), this.labelTxt && (this.labelTxt.text = this.tipsText), this.onlyOkBtn ? (this.btnOk.horizontalCenter = 0, this.btnNo.visible = !1) : (this.btnOk.horizontalCenter = -104, this.btnNo.visible = !0) }, i } (t.BaseComponent); t.AlertPanel = e, __reflect(e.prototype, "game.AlertPanel") } (game || (game = {})); var BagPanel2 = function(t) { function e(e) { var i = t.call(this) || this; return i.type = e, i.isFullScreen = !0, i.isVisibleAnimate = !0, i.skinName = new BagPanel2SkinSkin, i } return __extends(e, t), e.prototype.onShow = function() { this.isVisibleAnimate ? (this.x = -114, egret.Tween.get(this).to({ x: 0 }, 250, egret.Ease.sineOut).call(this.onShowAnimateOver, this)) : this.onShowAnimateOver() }, e.prototype.onHide = function() { egret.Tween.get(this).to({ x: -114 }, 250, egret.Ease.sineOut).call(this.onShowAnimateOver, this) }, e.prototype.onShowAnimateOver = function() { t.prototype.onShowAnimateOver.call(this) }, e.prototype.onAdded = function() { t.prototype.onAdded.call(this), Const.stage.addEventListener(egret.TouchEvent.TOUCH_BEGIN, this.onStageTouchBegin, this), this.addEventListener(egret.TouchEvent.TOUCH_BEGIN, this.onTargetTouchBegin, this) }, e.prototype.onRemoved = function() { t.prototype.onRemoved.call(this), Const.stage.removeEventListener(egret.TouchEvent.TOUCH_BEGIN, this.onStageTouchBegin, this), this.removeEventListener(egret.TouchEvent.TOUCH_BEGIN, this.onTargetTouchBegin, this) }, e.prototype.createChildren = function() { t.prototype.createChildren.call(this), this.list.itemRenderer = game.BagIconRender; var e = Global.playerProxy.getItemByType(this.type); this.type == ItemType.PROPS && (e = Global.playerProxy.getItemBySmallType(109)), e.sort(function(t, e) { return t.config.id - e.config.id }), this.list.dataProvider = new eui.ArrayCollection(e) }, e.prototype.onTargetTouchBegin = function(t) { t.stopPropagation() }, e.prototype.onStageTouchBegin = function() { game.AppFacade.getInstance().sendNotification(PanelNotify.CLOSE_BAG2) }, e } (game.BasePanel); __reflect(BagPanel2.prototype, "BagPanel2"); var Global; ! function(t) {} (Global || (Global = {})); var game; ! function(t) { var e = function(e) { function i() { var t = e.call(this) || this; return t.skinName = new FindPasswordSkin, t } return __extends(i, e), i.prototype.createChildren = function() { e.prototype.createChildren.call(this), this.commonPanel.setPanelWidth(600), this.commonPanel.setPanelHeight(560), this.commonPanel.setTitleIcon("panel_icon_skin_png"), this.commonPanel.setTitle("user_mmxg_png"), this.commonPanel.btnClose.label = "确定", this.commonPanel.closeBtn.visible = !0, this.pwdEt.displayAsPassword = !0 }, i.prototype.closeBtnTouchEnded = function() { t.AppFacade.getInstance().sendNotification(PanelNotify.CLOSE_FIND_PASSWORD) }, i.prototype.btnCloseTouchEnded = function() { var e = this.phoneEt.text.trim(), i = this.pwdEt.text.trim(), n = this.pwdEt1.text.trim(), a = { phone: e, password: i, password1: n }; Global.netProxy.setToken(null), Global.netProxy.sendRequest(GameConfig.SERVER_PATH + "user/modify-password", a, function(e) { return 0 == e.status ? (PopUpManager.popTip("找回密码成功"), void t.AppFacade.getInstance().sendNotification(PanelNotify.CLOSE_FIND_PASSWORD)) : void TipsUtils.showErrorCodeTips(e.status) }) }, i } (t.BasePanel); t.FindPasswordScene = e, __reflect(e.prototype, "game.FindPasswordScene") } (game || (game = {})); var game; ! function(t) { var e = function(e) { function i(t) { var i = e.call(this) || this; return i.textId = t, i.isFullScreen = !0, i.isVisibleAnimate = !0, i.skinName = new HelpSkin, i } return __extends(i, e), i.prototype.createChildren = function() { e.prototype.createChildren.call(this); var t = Global.gameProxy.getTextConfig(this.textId); this.labelTxt.textFlow = FontUtils.html(t.content) }, i.prototype.onTouchTap = function(e) { t.AppFacade.getInstance().sendNotification(PanelNotify.CLOSE_HELP) }, i } (t.BasePanel); t.HelpPanel = e, __reflect(e.prototype, "game.HelpPanel") } (game || (game = {})); var game; ! function(t) { var e = function(e) { function i() { var t = e.call(this) || this; return t.isFullScreen = !0, t.isVisibleAnimate = !0, t.skinName = new BuildingSkin, t } return __extends(i, e), i.prototype.createChildren = function() { e.prototype.createChildren.call(this), this.commonPanel.setPanelWidth(640), this.commonPanel.setPanelHeight(810), this.commonPanel.setTitleIcon("panel_icon_building_png"), this.commonPanel.setTitle("panel_title_building_png"), this.initTab() }, i.prototype.initTab = function() { var e = ["房屋升级"]; this.tab = new t.Tab(e, this.onTabItemClickCallback.bind(this)), this.tab.bottom = 0, this.groupTab.addChild(this.tab) }, i.prototype.onTabItemClickCallback = function(e) { var i = Global.playerProxy.playerData, n = t.Utils.limit(i.farm_level + 1, 1, 12); if (this.houseUpgradeData = new t.HouseUpgradeData(Global.gameProxy.getHouseUpgradeConfig(n)), this.imgIcon.source = t.URLConfig.getHouse(n), this.labelLv.text = "LV." + n, this.labelAddOut.text = this.houseUpgradeData.add_exp.toString() + "%", this.labelAddOut0.text = this.houseUpgradeData.outAddPer + "%", this.labelAddOut1.text = this.houseUpgradeData.needPlayerLV.toString(), this.btnUp.enabled = !0, i.farm_level >= 12) { this.btnUp.enabled = !1, this.btnUp.label = "满级"; for (var a = 1; 5 > a; a++) this["itemLabel" + a].visible = !1, this["itemIcon" + a].visible = !1 } else { for (var o = this.houseUpgradeData.items, s = o.split(","), r = 0, a = 0; 4 > a; a++) { var h = s[a].split(":"), l = Global.gameProxy.getItemConfig(h[0]); if (l) { this["itemLabel" + (a + 1)].text = h[1], this["itemIcon" + (a + 1)].source = t.URLConfig.getIcon(l.graphical_id); var c = Global.playerProxy.getHasItemByItemId(h[0]); ! c || c.number < parseInt(h[1]) ? (this["itemLabel" + (a + 1)].textColor = 16711680, r++) : this["itemLabel" + (a + 1)].textColor = 16777215 } } r > 0 && (this.btnUp.enabled = !1) } }, i.prototype.btnCloseTouchEnded = function() { t.AppFacade.getInstance().sendNotification(PanelNotify.CLOSE_HOUSEUPGRADE) }, i.prototype.flushPanel = function() { this.onTabItemClickCallback(0) }, i.prototype.btnUpTouchEnded = function() { t.AppFacade.getInstance().sendNotification(ClientNotify.UPGREADE_HOUSE, { upgradeData: this.houseUpgradeData }) }, i } (t.BasePanel); t.HouseUpgradePanel = e, __reflect(e.prototype, "game.HouseUpgradePanel") } (game || (game = {})); var game; ! function(t) { var e = function(e) { function i() { var t = e.call(this) || this; return t.isFullScreen = !0, t.isVisibleAnimate = !0, t.skinName = new LandOpenSkin, t } return __extends(i, e), i.prototype.createChildren = function() { e.prototype.createChildren.call(this); var i = Global.playerProxy.landData, n = Global.gameProxy.getLandExtendConfig(_.values(i).length + 1), a = new t.LandExtentData(n); this.landExtendData = a, this.labelLv.text = a.lv + "", this.labelGold.text = a.gold + "", this.labelGold.textColor = this.labelLv.textColor = 65280, this.btnOpen.enabled = !0; var o = Global.playerProxy.playerData; o.level < a.lv && (this.labelLv.textColor = 16711680, this.btnOpen.enabled = !1), o.gold < a.gold && (this.labelGold.textColor = 16711680, this.btnOpen.enabled = !1) }, i.prototype.btnOpenTouchEnded = function() { var e = Global.playerProxy.playerData, i = this.landExtendData.gold; return i > e.gold ? void PopUpManager.popTip("金币不足,无法扩建") : void t.AppFacade.getInstance().sendNotification(ClientNotify.LAND_EXTEND, { gold: i }) }, i.prototype.btnCloseTouchEnded = function() { t.AppFacade.getInstance().sendNotification(PanelNotify.CLOSE_LANDEXTEND) }, i } (t.BasePanel); t.LandExtendPanel = e, __reflect(e.prototype, "game.LandExtendPanel") } (game || (game = {})); var game; ! function(t) { var e = function(e) { function i() { var t = e.call(this) || this; return t.isFullScreen = !0, t.isVisibleAnimate = !0, t.helpTxtId = 7, t.skinName = new LandUpSkin, t } return __extends(i, e), i.prototype.createChildren = function() { e.prototype.createChildren.call(this), this.commonPanel.setPanelWidth(640), this.commonPanel.setPanelHeight(864), this.commonPanel.setTitleIcon("panel_icon_landup_png"), this.commonPanel.setTitle("panel_title_landup_png"), this.initTab() }, i.prototype.initTab = function() { var e = ["红土地", "黑土地", "金土地"]; this.tab = new t.Tab(e, this.onTabItemClickCallback.bind(this)), this.tab.bottom = 0, this.groupTab.addChild(this.tab) }, i.prototype.onTabItemClickCallback = function(e) { var i = e + 1; this.landLv = i, this.updateStart(i); var n = Global.playerProxy.getLandCountByLv(i, !0) + 1, a = Global.playerProxy.getLandUpDataByLvOrder(i, n); this.landUpgradeData = a, this.imgIcon.source = "land_up_icon" + (e + 1) + "_png", this.imgName.source = "land_up_name" + (e + 1) + "_png"; var o = ["普通土地", "红土地", "黑土地", "金土地"]; this.labelTxtOut.text = "收获" + o[e + 1] + "的果实将增加产量百分比:", this.labelAddOut.text = a.outAddPer + "%", this.labelTxtOut0.text = "收获" + o[e + 1] + "的果实将增加农场主经验百分比:", this.labelAddOut0.x = this.labelTxtOut0.x + this.labelTxtOut0.width, this.labelAddOut0.text = a.expAddPer + "%", this.labelTxtOut1.text = "升级" + o[e + 1] + "需要农场主等级达到:", this.labelAddOut1.text = "LV" + a.player_level; for (var s = a.items, r = s.split(","), h = 0, l = 0; 4 > l; l++) { var c = r[l].split(":"), p = Global.gameProxy.getItemConfig(c[0]); if (p) { this["itemLabel" + (l + 1)].text = c[1], this["itemIcon" + (l + 1)].source = t.URLConfig.getIcon(p.graphical_id); var u = Global.playerProxy.getHasItemByItemId(c[0]); ! u || u.number < parseInt(c[1]) ? (this["itemLabel" + (l + 1)].textColor = 16711680, h++) : this["itemLabel" + (l + 1)].textColor = 16777215 } } this.btnUp.enabled = 1 > h; var d = [], g = Global.playerProxy.playerData; g.level < a.player_level && (this.btnUp.enabled = !1, d.push("等级不足")), h > 0 ? this.labelErr.text = "材料不足": this.labelErr.text = "" }, i.prototype.updateStart = function(t) { for (var e = Global.playerProxy.getLandCountByLv(t, !0), i = 0; 12 > i; i++) { var n = this.groupStar.getChildAt(i); e > i ? n.source = "building_land_num" + t + "_png": n.source = "building_land_num0_png" } }, i.prototype.btnUpTouchEnded = function() { if (Global.playerProxy.getLandCountByLv(this.landLv - 1, !1) <= 0) { var e = ["普通土地", "红土地", "黑土地", "金土地"]; return void PopUpManager.popTip("没有足够的" + e[this.landLv - 1]) } t.AppFacade.getInstance().sendNotification(ClientNotify.LAND_UPGRADE, { level: this.landLv, landData: this.landUpgradeData }) }, i.prototype.flushPanel = function() { this.onTabItemClickCallback(this.tab.selectIndex) }, i.prototype.onTouchTap = function(t) { e.prototype.onTouchTap.call(this, t), t.target == this.btnUp }, i.prototype.btnCloseTouchEnded = function() { t.AppFacade.getInstance().sendNotification(PanelNotify.CLOSE_LAND_UPGRADE) }, i } (t.BasePanel); t.LandUpgradePanel = e, __reflect(e.prototype, "game.LandUpgradePanel") } (game || (game = {})); var game; ! function(t) { var e = function(e) { function i() { var t = e.call(this) || this; return t.pageIndex = 1, t.pageMax = 1, t.pageEveNum = 10, t.pageFruitEveNum = 15, t.tabIndex = 0, t.isFullScreen = !0, t.isVisibleAnimate = !0, t.skinName = new LogPanelSkin, t } return __extends(i, e), i.prototype.createChildren = function() { e.prototype.createChildren.call(this), this.commonPanel.setPanelWidth(600), this.commonPanel.setPanelHeight(790), this.commonPanel.setTitleIcon("panel_icon_log_png"), this.commonPanel.setTitle("panel_title_log_png"), this.initTab(), this.list.dataProvider = null, this.list.itemRenderer = t.LogItemRender, this.scroller.addEventListener(egret.TouchEvent.TOUCH_BEGIN, this.onScrollerTouchBegan, this) }, i.prototype.initLogList = function() { this.list.dataProvider = null, this.list.itemRenderer = t.LogItemRender, this.changePage(1, !0), this.scroller.addEventListener(egret.TouchEvent.TOUCH_BEGIN, this.onScrollerTouchBegan, this) }, i.prototype.onScrollerTouchBegan = function(t) { this.scrollerTouchStart = t.stageX, this.stage.once(egret.TouchEvent.TOUCH_END, this.onScrollerTouchEnded, this, !0, Number.MAX_VALUE) }, i.prototype.onScrollerTouchEnded = function(t) { var e = t.stageX - this.scrollerTouchStart; e > 150 ? this.changePage( - 1) : -150 > e && this.changePage(1) }, i.prototype.initTab = function() { var e = ["玩家日志"]; this.tab = new t.Tab(e, this.onTabItemClickCallback.bind(this)), this.tab.bottom = 0, this.groupTab.addChild(this.tab) }, i.prototype.onTabItemClickCallback = function(t) { this.logType = t, this.changePage(1, !0) }, i.prototype.changePage = function(t, e) { if (void 0 === e && (e = !1), e) this.pageIndex = t; else { if (this.pageIndex <= 1 && 0 > t) return; if (this.pageIndex >= this.pageMax && t > 0) return; this.pageIndex += t } this.labelPage.text = this.pageIndex + "/" + this.pageMax, this.updateListPage(this.pageIndex) }, i.prototype.getLogListArr = function(e) { var i = []; if (!e) return i; for (var n = 0; n < e.length; n++) i.push(new t.LogData(e[n])); return i }, i.prototype.getSysLogListArr = function(e) { var i = []; if (!e) return i; for (var n = 0; n < e.length; n++) i.push(new t.SystemLogData(e[n])); return i }, i.prototype.onListData = function(e) { this.pageMax = t.Utils.limit(Math.ceil(e.total_count / 10), 1, 10), this.labelPage.text = this.pageIndex + "/" + this.pageMax, this.list.dataProvider = new eui.ArrayCollection(this.getLogListArr(e.list)) }, i.prototype.onSysLogListData = function(e) { this.pageMax = t.Utils.limit(Math.ceil(e.total_count / 10), 1, 10), this.labelPage.text = this.pageIndex + "/" + this.pageMax, this.list.dataProvider = new eui.ArrayCollection(this.getSysLogListArr(e.list)) }, i.prototype.updateListPage = function(t) { 0 == this.logType ? (this.btnClear.visible = !0, this.mediator.getPlayerLogList((this.pageIndex - 1) * this.pageEveNum, this.pageEveNum, this.onListData.bind(this))) : (this.btnClear.visible = !1, this.mediator.getSystemLogList((this.pageIndex - 1) * this.pageEveNum, this.pageEveNum, this.onSysLogListData.bind(this))) }, i.prototype.onTouchTap = function(t) { e.prototype.onTouchTap.call(this, t); var i = t.target; switch (i) { case this.btnPrev: this.changePage( - 1); break; case this.btnNext: this.changePage(1); break; case this.btnClear: this.clearLog() } }, i.prototype.btnCloseTouchEnded = function() { this.mediator.closeViewComponent() }, i.prototype.clearLog = function() { this.pageIndex = 1; var t = this; this.mediator.clearLog(function() { t.labelPage.text = "1/1", t.list.dataProvider = new eui.ArrayCollection(t.getLogListArr([])) }) }, i } (t.BasePanel); t.LogPanel = e, __reflect(e.prototype, "game.LogPanel") } (game || (game = {})); var game; ! function(t) { var e = function(e) { function i() { var t = e.call(this) || this; return t.rewardCount = 14, t.rewardIndex = -1, t.lightIndex = 0, t.isAcc = !0, t.effDelay = 500, t.isFullScreen = !0, t.skinName = new LotterySkin, t } return __extends(i, e), i.prototype.createChildren = function() { e.prototype.createChildren.call(this), this.groupLight.visible = !1, this.imgLight.visible = !1, this.updateView() }, i.prototype.childrenCreated = function() { e.prototype.childrenCreated.call(this), GuideManager.getInsatance().isShowGuide && 3 == GuideManager.getInsatance().target && 0 == GuideManager.getInsatance().step && (GuideManager.getInsatance().des = TextConst.textObj[12], GuideManager.getInsatance().show(this.btnLottery, !1, 254, 484)) }, i.prototype.onShow = function() {}, i.prototype.updateView = function() { this.btnReward.visible = !1, this.btnLottery.visible = !0, this.btnLottery.enabled = !0, this.initCards(), this.updateCost() }, i.prototype.updateCost = function() { this.imgDiamond.visible = !1, this.imgGold.visible = !0; var t = Global.playerProxy.playerData.lottery_count, e = Global.gameProxy.getCommonConfigById("15").min; this.useGold = t > 0 ? e: 0, 0 == this.useGold ? this.labelPrice.text = "本次免费": this.labelPrice.text = this.useGold + "" }, i.prototype.initCards = function() { this.cardPosArr = []; var t = Global.gameProxy.getTabelConfigByType("lottery"); this.gifts = t; for (var e = 0; e < this.groupItems.numChildren; e++) { var i = t[e + 1], n = Global.gameProxy.getItemImageId(i.item_id), a = this.groupItems.getChildAt(e); a.imgIcon.source = n + "_png", a.labelNum.text = "x" + i.count, this.cardPosArr.push(new egret.Point(a.x + this.groupItems.x - 15, a.y + this.groupItems.y - 15)) } }, i.prototype.onTouchTap = function(t) { switch (e.prototype.onTouchTap.call(this, t), t.target) { case this.btnLottery: this.lottery(), GuideManager.getInsatance().isShowGuide && 3 == GuideManager.getInsatance().target && 0 == GuideManager.getInsatance().step && (GuideManager.getInsatance().des = TextConst.textObj[13], GuideManager.getInsatance().show(this.btnClose), GuideManager.getInsatance().target = 4, GuideManager.getInsatance().sendNetMessage()) } }, i.prototype.btnCloseTouchEnded = function() { if (t.AppFacade.getInstance().sendNotification(PanelNotify.CLOSE_LOTTERY), GuideManager.getInsatance().isShowGuide && 4 == GuideManager.getInsatance().target && 0 == GuideManager.getInsatance().step) { GuideManager.getInsatance().des = TextConst.textObj[14]; var e = t.AppFacade.getInstance().retrieveMediator(t.GameMediator.NAME); e.viewComponent.mainMenu.isWaveButtonShowing ? GuideManager.getInsatance().show(e.viewComponent.mainMenu.btn2) : GuideManager.getInsatance().show(e.viewComponent.mainMenu) } }, i.prototype.lottery = function() { var e = this; this.btnLottery.enabled = !1; var i = GameConfig.SERVER_PATH + "comm/lottery"; Global.netProxy.sendRequest(i, {}, function(i) { 0 == i.status ? (Global.playerProxy.playerData.gold -= e.useGold, Global.playerProxy.playerData.lottery_count = i.data.count, t.EventManager.instance.dispatch(SysNotify.TOPLAYER_INFO_UPDATE), e.updateCost(), e.getConfig = i.data, e.rewardIndex = i.data.id - 1, e.showLotteryEffect(), Global.audioProxy.playSound("lottery_mp3")) : (TipsUtils.showErrorCodeTips(i.status), e.btnLottery.enabled = !0) }) }, i.prototype.showLotteryEffect = function() { var t = this; this.lightIndex = 0, this.groupLight.visible = !0, this.imgLight.visible = !0, this.isAcc = !0, this.effDelay = 500, this.setLightImgPos(); for (var e = 0; e < this.groupLight.numChildren; e++) { var i = this.groupLight.getChildAt(e); i.alpha = 0, egret.Tween.get(i, { loop: !0 }).wait(250 * Math.random()).to({ alpha: 1 }, 50).wait(200 + 250 * Math.random()).to({ alpha: 0 }, 50) } manager.UpdateTickerManager.instance.add(this), this.update(500); var n = 1; this.cirLightDelayId = egret.setInterval(function() { n++, t.imgCirLight.source = "lottery_l" + (1 + n % 2) + "_png" }, this, 100) }, i.prototype.hideLotteryEffect = function() { manager.UpdateTickerManager.instance.remove(this); for (var t = 0; t < this.groupLight.numChildren; t++) { var e = this.groupLight.getChildAt(t); egret.Tween.removeTweens(e) } this.groupLight.visible = !1, egret.clearInterval(this.cirLightDelayId), this.showResult() }, i.prototype.showResult = function() { var e = this.getConfig, i = Global.gameProxy.getTabelConfigByType("lottery"), n = i[e.id].count, a = e.item_id; Global.playerProxy.addItem1(a + ":" + n), t.EventManager.instance.dispatch(SysNotify.TOPLAYER_INFO_UPDATE), this.btnLottery.visible = !0, this.btnLottery.enabled = !0 }, i.prototype.resetLotteryEffect = function() { this.btnLottery.enabled = !0, this.lightIndex = 0, this.hideLotteryEffect(), this.btnLottery.visible = !0 }, i.prototype.update = function(e) { if (this.effDelay -= e, this.effDelay <= 0) { var i = 500; if (this.isAcc) i = 500 - 50 * this.lightIndex; else { var n = this.getRewardIndexAndLightIndexLen(); i = 500 - 50 * n, 0 == n && this.hideLotteryEffect() } if (i = t.Utils.limit(i, 50, 500), i += this.effDelay, this.effDelay = i, this.setLightImgPos(), this.lightIndex++, this.lightIndex > 100 && this.rewardIndex >= 0) { var n = this.getRewardIndexAndLightIndexLen(); 10 == n && (this.isAcc = !1) } } }, i.prototype.getRewardIndexAndLightIndexLen = function() { var t = 10, e = this.lightIndex % this.rewardCount; return t = e > this.rewardIndex ? this.rewardCount - e + this.rewardIndex: this.rewardIndex - e }, i.prototype.setLightImgPos = function() { var t = this.cardPosArr[this.lightIndex % this.rewardCount]; this.imgLight.x = t.x, this.imgLight.y = t.y }, i } (t.BasePanel); t.LotteryPanel = e, __reflect(e.prototype, "game.LotteryPanel", ["IUpdate"]) } (game || (game = {})); var game; ! function(t) { var e = function(e) { function i() { var t = e.call(this) || this; return t.pageIndex = 1, t.pageMax = 1, t.pageEveNum = 4, t.pageFruitEveNum = 15, t.tabIndex = 0, t.isFullScreen = !0, t.isVisibleAnimate = !0, t.skinName = new NoticeSkin, t } return __extends(i, e), i.prototype.createChildren = function() { e.prototype.createChildren.call(this), this.commonPanel.setPanelWidth(620), this.commonPanel.setPanelHeight(780), this.commonPanel.setTitleIcon("menu_notice_png"), this.commonPanel.setTitle("panel_title_notic1e_png"), this.list.dataProvider = null, this.list.itemRenderer = t.NoticeItemRender, this.scroller.addEventListener(egret.TouchEvent.TOUCH_BEGIN, this.onScrollerTouchBegan, this), this.changePage(1, !0) }, i.prototype.onScrollerTouchBegan = function(t) { this.scrollerTouchStart = t.stageX, this.stage.once(egret.TouchEvent.TOUCH_END, this.onScrollerTouchEnded, this, !0, Number.MAX_VALUE) }, i.prototype.onScrollerTouchEnded = function(t) { var e = t.stageX - this.scrollerTouchStart; e > 150 ? this.changePage( - 1) : -150 > e && this.changePage(1) }, i.prototype.changePage = function(t, e) { if (void 0 === e && (e = !1), e) this.pageIndex = t; else { if (this.pageIndex <= 1 && 0 > t) return; if (this.pageIndex >= this.pageMax && t > 0) return; this.pageIndex += t } this.labelPage.text = this.pageIndex + "/" + this.pageMax, this.updateListPage(this.pageIndex) }, i.prototype.onSysLogListData = function(e) { this.pageMax = t.Utils.limit(Math.ceil(e.total_count / 4), 1, 10), this.labelPage.text = this.pageIndex + "/" + this.pageMax, this.list.dataProvider = new eui.ArrayCollection(e.list) }, i.prototype.updateListPage = function(t) { this.mediator.getSystemNoticeList((this.pageIndex - 1) * this.pageEveNum, this.pageEveNum, this.onSysLogListData.bind(this)) }, i.prototype.onTouchTap = function(t) { e.prototype.onTouchTap.call(this, t); var i = t.target; switch (i) { case this.btnPrev: this.changePage( - 1); break; case this.btnNext: this.changePage(1) } }, i.prototype.btnCloseTouchEnded = function() { this.mediator.closeViewComponent() }, i } (t.BasePanel); t.NoticePanel = e, __reflect(e.prototype, "game.NoticePanel") } (game || (game = {})); var game; ! function(t) { var e = function(e) { function i() { var t = e.call(this) || this; return t.tabIndex = 0, t.locked = !1, t.isFullScreen = !0, t.isVisibleAnimate = !0, t.skinName = new PaySkin, t } return __extends(i, e), i.prototype.createChildren = function() { e.prototype.createChildren.call(this), this.commonPanel.setPanelWidth(600), this.commonPanel.setPanelHeight(790), this.commonPanel.setTitleIcon("panel_icon_info_png"), this.commonPanel.setTitle("pay_title_png"); var i = Global.gameProxy.getTabelConfigByType(t.TabelName.diamonds_recharge), n = []; for (var a in i) i[a].id <= 6 && n.push(i[a]); for (var o = 0; o < n.length; o++) this["diamondPay" + (o + 1)].initWidthData(n[o], o + 1, this) }, i.prototype.btnCloseTouchEnded = function() { t.AppFacade.getInstance().sendNotification(PanelNotify.CLOSE_PAY) }, i.prototype.buy = function(t) { var e = this; if (this.locked) return void PopUpManager.popTip("请等待服务器处理"); var i = GameConfig.SERVER_PATH + "pay/pay", n = { pay_id: t.id }; Global.netProxy.sendRequest(i, n, function(t) { 0 == t.status ? window.location.href = t.data.url: (TipsUtils.showErrorCodeTips(t.status), e.locked = !1) }) }, i } (t.BasePanel); t.PayPanel = e, __reflect(e.prototype, "game.PayPanel") } (game || (game = {})); var game; ! function(t) { var e = function(e) { function i() { var t = e.call(this) || this; return t.isFullScreen = !0, t.isVisibleAnimate = !0, t.skinName = new RoleInfoSkin, t } return __extends(i, e), i.prototype.createChildren = function() { e.prototype.createChildren.call(this), this.commonPanel.setPanelWidth(600), this.commonPanel.setPanelHeight(835), this.commonPanel.setTitleIcon("panel_icon_warehouse_png"), this.commonPanel.setTitle("panel_title_info_png") }, i.prototype.childrenCreated = function() { e.prototype.childrenCreated.call(this), this.initRoleInfo(), this.initList(), t.UIUtils.addShortTouch(this.setButton, this.onSet.bind(this), null) }, i.prototype.onSet = function() { t.SettingPanel.instance.show() }, i.prototype.flushPanel = function() { this.initRoleInfo() }, i.prototype.initList = function() { var t; t = Global.gameProxy.getShopConfigByType(ItemType.SEED), t = _.sortBy(t, "priority_type1"), this.list.dataProvider = new eui.ArrayCollection(t), this.list.itemRenderer = AchiconitemRender }, i.prototype.initRoleInfo = function() { var e = Global.playerProxy.playerData; this.imgHead.mask = this.imgHeadMask; console.log(Global.playerProxy.playerData) var i = e.avatar.toString(); if ("" == i && (i = "1"), i.indexOf("http") > -1) this.imgHead.source = i; else { var n = t.URLConfig.getHead(i); this.imgHead.source = n } this.labelId.text = e.username + "", this.labelName.text = e.nickname, this.labelLv.text = "LV." + e.level, this.labelGold.text = t.Utils.BigNumTostring(e.gold), this.labelpower.text = t.Utils.BigNumTostring(e.score), this.loginTime.text = t.Utils.formatDate(new Date(1e3 * Global.playerProxy.playerData.login_at)), this.logouttime.text = t.Utils.formatDate(new Date(1e3 * Global.playerProxy.playerData.updated_at)) }, i.prototype.btnCloseTouchEnded = function() { t.AppFacade.getInstance().sendNotification(PanelNotify.CLOSE_PLAYER_INFO) }, i } (t.BasePanel); t.PlayerInfoPanel = e, __reflect(e.prototype, "game.PlayerInfoPanel") } (game || (game = {})); var game; ! function(t) { var e = function(e) { function i() { var t = e.call(this) || this; return t.timeCount = 60, t.skinName = new RegistSkin, t } return __extends(i, e), i.prototype.childrenCreated = function() { e.prototype.childrenCreated.call(this); this.shareEdt.text = getURLQueryString("code") }, i.prototype.createChildren = function() { e.prototype.createChildren.call(this), this.commonPanel.setPanelWidth(600), this.commonPanel.setPanelHeight(530), this.commonPanel.setTitleIcon("panel_icon_skin_png"), this.commonPanel.setTitle("user_regist_title_png"), this.commonPanel.btnClose.label = "注册", this.commonPanel.closeBtn.visible = !0, this.pwdEt.displayAsPassword = !0, this.repwdEt.displayAsPassword = !0 }, i.prototype.closeBtnTouchEnded = function() { t.AppFacade.getInstance().sendNotification(PanelNotify.CLOSE_REGIST) }, i.prototype.btnCloseTouchEnded = function() { var e = this.phoneEt.text.trim(), i = this.pwdEt.text.trim(), n = this.repwdEt.text.trim(); o = this.shareEdt.text.trim(); if (!RegUtils.checkMobile(e)) return void PopUpManager.popTip("输入格式错误"); if (i.length < 4 || i.length > 8) return void PopUpManager.popTip("密码长度4-8位"); if (RegUtils.isNull(i)) return void PopUpManager.popTip("密码不能为空"); if (i != n) return void PopUpManager.popTip("2次密码不一样"); var a = { username: e, password: i, password1: n, introduce_code: o }; return 0 == this.check1.selected ? void TipsUtils.showTipsDownToUp("请同意协议") : (Global.netProxy.setToken(null), void Global.netProxy.sendRequest(GameConfig.SERVER_PATH + "user/register", a, function(e) { return 0 == e.status ? (PopUpManager.popTip("注册成功"), void t.AppFacade.getInstance().sendNotification(PanelNotify.CLOSE_REGIST)) : void TipsUtils.showErrorCodeTips(e.status) })) }, i } (t.BasePanel); t.RegistPanel = e, __reflect(e.prototype, "game.RegistPanel") } (game || (game = {})); var game; ! function(t) { var e = function(e) { function i() { var t = e.call(this) || this; return t.skinName = new SendMessageSkin, t } return __extends(i, e), i.prototype.createChildren = function() { e.prototype.createChildren.call(this), this.commonPanel.setPanelWidth(600), this.commonPanel.setPanelHeight(730), this.commonPanel.setTitleIcon("img_icon_laba_png"), this.commonPanel.setTitle("panel_title_message_png") }, i.prototype.btnCloseTouchEnded = function() { t.AppFacade.getInstance().sendNotification(PanelNotify.CLOSE_SEND_MESSAGE) }, i.prototype.onTouchTap = function(t) { switch (t.stopPropagation(), t.target) { case this.sendBtn: this.sendMessage() } }, i.prototype.sendMessage = function() { var t = this, e = Global.playerProxy.getHasItemByItemId(107002); if (!e || e.number < 1) return void PopUpManager.popTip("喇叭道具不足"); var i = this.phoneEt.text.trim(), n = this.contentEt.text.trim(), a = this.wxEt.text.trim(); if (RegUtils.isNull(n)) return void PopUpManager.popTip("请输入发布内容"); var o = { wx_id: a, phone: i, message: n }, s = GameConfig.SERVER_PATH + "comm/broadcast"; Global.netProxy.sendRequest(s, o, function(i) { 0 == i.status ? (PopUpManager.popTip("发布成功,等待审核"), Global.playerProxy.sellWareHouseItem({ id: e.config.id }, 1), t.closeBtnTouchEnded()) : TipsUtils.showErrorCodeTips(i.status) }) }, i } (t.BasePanel); t.SendMessagePanel = e, __reflect(e.prototype, "game.SendMessagePanel") } (game || (game = {})); var game; ! function(t) { var e = function(e) { function i() { var t = e.call(this) || this; return t.isFullScreen = !0, t.skinName = new SettingPanelSkin, t } return __extends(i, e), Object.defineProperty(i, "instance", { get: function() { return i._instance || (i._instance = new i), i._instance }, set: function(t) { i._instance = null }, enumerable: !0, configurable: !0 }), i.prototype.createChildren = function() { e.prototype.createChildren.call(this) }, i.prototype.hide = function() { var e = Const.WIN_W / 2, n = Const.WIN_H / 2; egret.Tween.get(this).to({ x: e, y: n, scaleX: 0, scaleY: 0 }, 250, egret.Ease.backIn).call(function() { t.UIUtils.removeSelf(this), i._instance = null }, this) }, i.prototype.show = function() { var t = !!Global.audioProxy.isOpen; this.closeMusicBtn.visible = t, this.openMusicBtn.visible = !t, GameLayerManager.instance.popLayer.addChild(this); var t = !!Global.audioProxy.soundOpen; this.closeYinXiaoBtn.visible = t, this.openYinXiaoBtn.visible = !t }, i.prototype.onTouchTap = function(e) { switch (e.stopPropagation(), e.target) { case this.closeYinXiaoBtn: Global.audioProxy.setSoundOpen(!1), this.closeYinXiaoBtn.visible = !1, this.openYinXiaoBtn.visible = !0; break; case this.openYinXiaoBtn: Global.audioProxy.setSoundOpen(!0), this.closeYinXiaoBtn.visible = !0, this.openYinXiaoBtn.visible = !1; break; case this.closeMusicBtn: Global.audioProxy.openSound(!1), this.closeMusicBtn.visible = !1, this.openMusicBtn.visible = !0; break; case this.openMusicBtn: Global.audioProxy.openSound(!0), this.closeMusicBtn.visible = !0, this.openMusicBtn.visible = !1; break; case this.closePanelBtn: this.hide(); break; case this.zhuangbanBtn: this.hide(), t.AppFacade.getInstance().sendNotification(PanelNotify.OPEN_SKIN) } }, i } (t.BasePanel); t.SettingPanel = e, __reflect(e.prototype, "game.SettingPanel") } (game || (game = {})); var game; ! function(t) { var e = function(e) { function i() { var t = e.call(this) || this; return t.isFullScreen = !0, t.isVisibleAnimate = !0, t.skinName = new ShopSkin, t } return __extends(i, e), i.prototype.createChildren = function() { e.prototype.createChildren.call(this), this.commonPanel.setPanelWidth(620), this.commonPanel.setPanelHeight(754), this.commonPanel.setTitleIcon("panel_icon_shop_png"), this.commonPanel.setTitle("panel_title_shop_png"), this.initTab() }, i.prototype.initsize = function() { this.scaleX = GameConfig.curWidth() / Const.DESGIN_W, this.scaleY = GameConfig.curHeight() / Const.DESGIN_H }, i.prototype.childrenCreated = function() { e.prototype.childrenCreated.call(this) }, i.prototype.onShow = function() {}, i.prototype.initTab = function() { var e = ["种子", "幼崽", "道具", "背景"]; if (this.tab = new t.Tab(e, this.onTabItemClickCallback.bind(this)), this.tab.bottom = 0, this.groupTab.addChild(this.tab), GuideManager.getInsatance().isShowGuide && 6 == GuideManager.getInsatance().target && 0 == GuideManager.getInsatance().step) { t.AppFacade.getInstance().retrieveMediator(t.GameMediator.NAME); GuideManager.getInsatance().des = TextConst.textObj[25], GuideManager.getInsatance().show(this.tab.getChildAt(1).bg, !1, 232, 206) } }, i.prototype.onTabItemClickCallback = function(e) { this.list.itemRenderer = t.ShopItemRender, this.list.dataProvider = null; var i = null; 0 == e ? (i = Global.gameProxy.getShopConfigByType(ItemType.SEED), i = _.sortBy(i, "priority_type1")) : 1 == e ? i = Global.gameProxy.getShopConfigByType(ItemType.ANIMAL) : 2 == e ? i = Global.gameProxy.getShopConfigByType(ItemType.PROPS) : 3 == e && (i = Global.gameProxy.getShopConfigByType(ItemType.SKIN), this.list.itemRenderer = t.ShopSkinItemRender); Global.playerProxy.playerData; this.updateTabPageByData(i) }, i.prototype.updatas = function() { var e = this.scrolls.viewport.scrollV, i = this.tab.selectIndex; this.list.itemRenderer = t.ShopItemRender, this.list.dataProvider = null; var n = null; 0 == i ? (n = Global.gameProxy.getShopConfigByType(1), n = _.sortBy(n, "priority_type1")) : 1 == i ? n = Global.gameProxy.getShopConfigByType(2) : 2 == i && (n = Global.gameProxy.getShopConfigByType(3), this.list.itemRenderer = t.ShopSkinItemRender); for (var a = Global.playerProxy.playerData, o = a.buy_pet_egg_list, s = 0; s < o.length; s++) for (var r = 0; r < n.length; r++) o[s] == n[r].itemData.config.id && n.splice(r, 1); this.updateTabPageByData(n), this.scrolls.validateNow(), this.scrolls.viewport.scrollV = e }, i.prototype.btnCloseTouchEnded = function() { t.AppFacade.getInstance().sendNotification(PanelNotify.CLOSE_SHOP) }, i.prototype.updateTabPageByData = function(t) { this.list.dataProvider = new eui.ArrayCollection(t) }, i } (t.BasePanel); t.ShopPanel = e, __reflect(e.prototype, "game.ShopPanel") } (game || (game = {})); var game; ! function(t) { var e = function(e) { function i() { var t = e.call(this) || this; return t.isFullScreen = !0, t.isVisibleAnimate = !0, t.skinName = new ChangeSkinSkin, t } return __extends(i, e), i.prototype.createChildren = function() { e.prototype.createChildren.call(this), this.commonPanel.setPanelWidth(640), this.commonPanel.setPanelHeight(734), this.commonPanel.setIconOffsetX(65), this.commonPanel.setTitleIcon("panel_icon_skin_png"), this.commonPanel.setTitle("panel_title_skin_png"), this.initList() }, i.prototype.onRemoved = function() { e.prototype.onRemoved.call(this) }, i.prototype.initList = function() { var e = Global.playerProxy.getMySkins(); e.sort(function(t, e) { return t.config.id - e.config.id }), this.list.dataProvider = new eui.ArrayCollection(e), this.list.itemRenderer = t.SkinItem }, i.prototype.btnCloseTouchEnded = function() { t.AppFacade.getInstance().sendNotification(PanelNotify.CLOSE_SKIN) }, i } (t.BasePanel); t.SkinPanel = e, __reflect(e.prototype, "game.SkinPanel") } (game || (game = {})); var game; ! function(t) { var e = function(e) { function i() { var t = e.call(this) || this; return t.isFullScreen = !0, t.isVisibleAnimate = !0, t.skinName = new SurePasswordSkin, t } return __extends(i, e), Object.defineProperty(i, "instance", { get: function() { return i._instance || (i._instance = new i), i._instance }, enumerable: !0, configurable: !0 }), i.prototype.show = function(t, e, i) { this.serverPath = t, this.data = e, this.sucCallback = i, GameLayerManager.instance.popLayer.addChild(this) }, i.prototype.btnOkTouch = function() { var t = this, e = this.pwdEt.text; return RegUtils.isNull(e) ? void PopUpManager.popTip("请输入交易密码") : (this.data.pay_password = e.trim(), void Global.netProxy.sendRequest(this.serverPath, this.data, function(e) { t.sucCallback && t.sucCallback(e), t.closeBtnTouchEnded() })) }, i.prototype.closeBtnTouchEnded = function() { var e = Const.WIN_W / 2, n = Const.WIN_H / 2; egret.Tween.get(this).to({ x: e, y: n, scaleX: 0, scaleY: 0 }, 250, egret.Ease.backIn).call(function() { t.UIUtils.removeSelf(this), i._instance = null }, this) }, i.prototype.onTouchTap = function(t) { switch (t.stopPropagation(), t.target) { case this.btnOk: this.btnOk.enabled = !1, this.btnOkTouch(); break; case this.btnNo: this.closeBtnTouchEnded() } }, i } (t.BasePanel); t.SurePasswordPanel = e, __reflect(e.prototype, "game.SurePasswordPanel") } (game || (game = {})); var WaitPanel = function(t) { function e(e) { void 0 === e && (e = 1); var i = t.call(this) || this; return i.bg = new egret.Sprite, i.w = 0, i.h = 0, i.createView(), i } return __extends(e, t), e.prototype.createView = function() { this.w = egret.MainContext.instance.stage.stageWidth, this.h = egret.MainContext.instance.stage.stageHeight, this.bg.graphics.beginFill(0, .2), this.bg.graphics.drawRect(0, 0, this.w, this.h), this.bg.graphics.endFill(), this.bg.width = this.w, this.bg.height = this.h, this.addChild(this.bg), this.touchEnabled = !0, this.waitImg = new egret.Bitmap, this.waitImg.texture = RES.getRes("loadingcircle_png"), this.addChild(this.waitImg), this.waitImg.x = this.w / 2, this.waitImg.y = this.h / 2, this.waitImg.anchorOffsetX = this.waitImg.width / 2, this.waitImg.anchorOffsetY = this.waitImg.height / 2, EffectUtils.rotationEffect(this.waitImg, 1e3) }, e } (egret.Sprite); __reflect(WaitPanel.prototype, "WaitPanel"); var game; ! function(t) { var e = function(e) { function i() { var t = e.call(this) || this; return t.isFullScreen = !0, t.isVisibleAnimate = !0, t.skinName = new WareHouseSkin, t } return __extends(i, e), i.prototype.createChildren = function() { e.prototype.createChildren.call(this), this.initList(), this.initTab() }, i.prototype.onShow = function() {}, i.prototype.initList = function() { this.list.dataProvider = null, this.list.itemRenderer = t.WareHouseItem }, i.prototype.initTab = function() { var e = ["种子", "家畜", "道具", "果实"]; this.tab = new t.Tab(e, this.onTabItemClickCallback.bind(this)), this.groupTab.addChild(this.tab) }, i.prototype.flushList = function() { this.onTabItemClickCallback(this.tab.selectIndex) }, i.prototype.onTabItemClickCallback = function(t) { var e = null; 0 == t ? e = Global.playerProxy.getItemByType(ItemType.SEED) : 1 == t ? e = Global.playerProxy.getItemByType(ItemType.ANIMAL) : 2 == t ? e = Global.playerProxy.getItemByType(ItemType.PROPS) : 3 == t && (e = Global.playerProxy.getItemByType(ItemType.FRUIT)), this.updateTabPageByData(e) }, i.prototype.updateTabPageByData = function(t) { t.sort(function(t, e) { return t.config.id - e.config.id }); var e = t.concat(), i = e.length, n = Const.WARE_CAPACITY - i; if (n > 0) for (var a = 0; n > a; a++) e.push(null); this.list.dataProvider = new eui.ArrayCollection(e) }, i.prototype.btnCloseTouchEnded = function() { t.AppFacade.getInstance().sendNotification(PanelNotify.CLOSE_WARE_HOUSE) }, i } (t.BasePanel); t.WareHousePanel = e, __reflect(e.prototype, "game.WareHousePanel") } (game || (game = {})); var BattleBaseCompoment = function(t) { function e() { var e = t.call(this) || this; return e.isUpdata = !1, e } return __extends(e, t), e.prototype.partAdded = function(e, i) { t.prototype.partAdded.call(this, e, i) }, e.prototype.childrenCreated = function() { t.prototype.childrenCreated.call(this), this.jiasuButton.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onJiasu, this), this.sleepButton.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onSleep, this), this.battleButton.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onBattle, this), GuideManager.getInsatance().isShowGuide && 5 == GuideManager.getInsatance().target && 0 == GuideManager.getInsatance().step && (GuideManager.getInsatance().des = TextConst.textObj[21], GuideManager.getInsatance().show(this.jiasuButton)), GuideManager.getInsatance().isShowGuide && 5 == GuideManager.getInsatance().target && 1 == GuideManager.getInsatance().step && (GuideManager.getInsatance().des = TextConst.textObj[22], GuideManager.getInsatance().show(this.battleButton)) }, e.prototype.updata = function() { var t = BattlePetManager.getInstance().getPetForID(BattlePetManager.getInstance().curID), e = Global.gameProxy.getPetBaseConfigForID(t.pet_config_id); Global.gameProxy.getPetJinConfigForID(t.pet_config_id); this.headImg.source = e.graphical_id + "_png", this.fightFeedLabel.text = e.hunger; var i = t.level + 1; i > 60 && (i = 60); var n = Global.gameProxy.getPetUpConfigForID(i); if (this.petPoerLabel.text = t.fighting_capacity + "", this.petWay.text = PetPro.petWay[e.type], this.petLevelLabel.text = t.level + "", this.g1.visible = !1, this.g2.visible = !1, t.has_end_brooding_time > 0) this.isUpdata = !0, this.g2.visible = !0, this.timeLabel.text = game.Utils.showTimeFormat(1e3 * t.has_end_brooding_time), this.gemNumLabel.text = t.accelerate_brooding_gem + ""; else { this.isUpdata = !1, this.g1.visible = !0; var a = t.exp, o = n.exp; this.bar1.setPross(a, o); var s = t.feed; this.curhungerLabel.text = "" + s } this.hoLabel.text = t.petData.blood + "", this.attrackLabel.text = t.petData.attack + "", this.critLabel.text = t.petData.crit + "", this.dodgeLabel.text = t.petData.dodge + "", this.defenselabel.text = t.petData.anti + "", this.desLabel.text = e.desc, t.is_enter_war == PetWar.PET_NOFIGHT ? (this.battleButton.visible = !0, this.sleepButton.visible = !1) : (this.battleButton.visible = !1, this.sleepButton.visible = !0) }, e.prototype.enterFrame = function() { var t = BattlePetManager.getInstance().getPetForID(BattlePetManager.getInstance().curID); Global.gameProxy.getPetBaseConfigForID(t.pet_config_id); if (this.isUpdata) this.timeLabel.text = game.Utils.showTimeFormat(1e3 * t.has_end_brooding_time); else if (t.is_enter_war == PetWar.PET_FIGHT) { var e = t.feed; this.curhungerLabel.text = "" + e } }, e.prototype.onJiasu = function(t) { BattlePetManager.getInstance().sendNetAdd(), GuideManager.getInsatance().isShowGuide && 5 == GuideManager.getInsatance().target && 0 == GuideManager.getInsatance().step && (this.validateNow(), GuideManager.getInsatance().des = TextConst.textObj[22], GuideManager.getInsatance().show(this.battleButton), GuideManager.getInsatance().step = 1, GuideManager.getInsatance().sendNetMessage()) }, e.prototype.onSleep = function(t) {}, e.prototype.onBattle = function(t) { if (BattlePetManager.getInstance().sendNetWar(), GuideManager.getInsatance().isShowGuide && 5 == GuideManager.getInsatance().target && 1 == GuideManager.getInsatance().step) { var e = game.AppFacade.getInstance().retrieveMediator(BattlePetMediator.NAME); GuideManager.getInsatance().show(e.viewComponent.btnClose), GuideManager.getInsatance().des = TextConst.textObj[23], GuideManager.getInsatance().target = 6, GuideManager.getInsatance().step = 0, GuideManager.getInsatance().sendNetMessage() } }, e } (eui.Component); __reflect(BattleBaseCompoment.prototype, "BattleBaseCompoment"); var BattlePanel = function(t) { function e() { var e = t.call(this) || this; return e.isFullScreen = !0, e.isVisibleAnimate = !0, e.skinName = BattlePetPanelSkin, e } return __extends(e, t), e.prototype.onShow = function() {}, e.prototype.createChildren = function() { t.prototype.createChildren.call(this), this.commonPanel.setPanelWidth(640), this.commonPanel.setPanelHeight(940), this.commonPanel.setTitleIcon(""), this.commonPanel.setTitle("battle_pet_json.battle_pet_canzhan12_png") }, e.prototype.onAdded = function() { t.prototype.onAdded.call(this), this.addEventListener(egret.Event.ENTER_FRAME, this.onEnterFrame, this), game.EventManager.instance.addEvent(SysNotify.PET_UODATA, this.onUpData, this) }, e.prototype.onRemoved = function() { t.prototype.onRemoved.call(this), this.removeEventListener(egret.Event.ENTER_FRAME, this.onEnterFrame, this), game.EventManager.instance.removeEvent(SysNotify.PET_UODATA, this.onUpData, this) }, e.prototype.initTab = function() { var t = ["基本属性", "战力升级", "宠物进化"]; this.tab = new game.Tab(t, this.onTabItemClickCallback.bind(this)), this.groupbar.addChild(this.tab), GuideManager.getInsatance().isShowGuide && 7 == GuideManager.getInsatance().target && 0 == GuideManager.getInsatance().step && (this.validateNow(), GuideManager.getInsatance().des = TextConst.textObj[29], GuideManager.getInsatance().show(this.tab.getChildAt(1), !1, 260, 125)), GuideManager.getInsatance().isShowGuide && 7 == GuideManager.getInsatance().target && 1 == GuideManager.getInsatance().step && (this.validateNow(), GuideManager.getInsatance().des = TextConst.textObj[29], GuideManager.getInsatance().show(this.tab.getChildAt(1), !1, 260, 125)) }, e.prototype.onEnterFrame = function(t) { this.baseC && this.baseC.enterFrame() }, e.prototype.onTabItemClickCallback = function(t) { this.updata(), 1 == t && GuideManager.getInsatance().isShowGuide && 7 == GuideManager.getInsatance().target && 0 == GuideManager.getInsatance().step && (this.validateNow(), GuideManager.getInsatance().des = TextConst.textObj[30], GuideManager.getInsatance().show(this.upLevelc.changeButton)) }, e.prototype.change = function(t) { BattlePetManager.getInstance().curID = this.radioButtonGroup.selectedValue, this.updata() }, e.prototype.onUpData = function() { this.updata() }, e.prototype.initRadioGroup = function() { this.radioButtonGroup = new eui.RadioButtonGroup, this.gs.removeChildren(); for (var t = BattlePetManager.getInstance().petArr, e = 0; e < t.length; e++) { var i = new BattlePetRadioButton; i.value = t[e].id, i.group = this.radioButtonGroup, this.gs.addChild(i); var n = Global.gameProxy.getPetBaseConfigForID(t[e].pet_config_id); i.headImg.source = n.graphical_id + "_png", i.nameLabel.text = n.name, i.x = e * i.width + e * i.width * .4, 0 == e && (i.selected = !0, BattlePetManager.getInstance().curID = t[e].id) } }, e.prototype.updataRadioGroup = function() { for (var t = 0; t < this.gs.numChildren; t++) { var e = this.gs.getChildAt(t); if (e.value == BattlePetManager.getInstance().curID) { var i = BattlePetManager.getInstance().getPetForID(BattlePetManager.getInstance().curID), n = Global.gameProxy.getPetBaseConfigForID(i.pet_config_id); e.headImg.source = n.graphical_id + "_png", e.nameLabel.text = n.name } } }, e.prototype.updata = function() { this.baseC.visible = !1, this.upLevelc.visible = !1, this.jinhuaC.visible = !1; var t = BattlePetManager.getInstance().getPetForID(BattlePetManager.getInstance().curID), e = (Global.gameProxy.getPetBaseConfigForID(t.pet_config_id), this.tab.selectIndex); switch (e) { case 0: this.baseC.visible = !0, this.baseC.updata(); break; case 1: if (t.has_end_brooding_time > 0) return this.tab.setSelectIndex(0), void TipsUtils.showTipsDownToUp("宠物正在孵化"); this.upLevelc.visible = !0, this.upLevelc.updata(); break; case 2: if (t.has_end_brooding_time > 0) return this.tab.setSelectIndex(0), void TipsUtils.showTipsDownToUp("宠物正在孵化"); this.jinhuaC.visible = !0, this.jinhuaC.updata() } this.updataRadioGroup() }, e.prototype.partAdded = function(e, i) { t.prototype.partAdded.call(this, e, i) }, e.prototype.childrenCreated = function() { t.prototype.childrenCreated.call(this), this.initRadioGroup(), this.initTab(), this.tab.setSelectIndex(0), this.radioButtonGroup.addEventListener(egret.Event.CHANGE, this.change, this), game.EventManager.instance.addEvent(SysNotify.PET_FUHUA_UPDATA, this.onUpData, this) }, e.prototype.btnCloseTouchEnded = function() { game.AppFacade.getInstance().sendNotification(PanelNotify.CLOSE_BATTLES_PET) }, e } (game.BasePanel); __reflect(BattlePanel.prototype, "BattlePanel"); var BattlePetItem2 = function(t) { function e() { var e = t.call(this) || this; return e.skinName = BattlePetItem2Skin, e } return __extends(e, t), e.prototype.childrenCreated = function() { t.prototype.childrenCreated.call(this) }, e.prototype.setImgScale = function(t) { this.headImg.scaleX = t, this.headImg.scaleY = t }, e } (eui.Component); __reflect(BattlePetItem2.prototype, "BattlePetItem2"); var BattlePetJinhuaCompoment = function(t) { function e() { return t.call(this) || this } return __extends(e, t), e.prototype.partAdded = function(e, i) { t.prototype.partAdded.call(this, e, i) }, e.prototype.childrenCreated = function() { t.prototype.childrenCreated.call(this), this.jinhuaButton.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onJinHua, this) }, e.prototype.onJinHua = function(t) { BattlePetManager.getInstance().isjin = 0, game.AppFacade.instance.sendNotification(PanelNotify.OPEN_BATTLE_PET_TIPS) }, e.prototype.updata = function() { var t = BattlePetManager.getInstance().getPetForID(BattlePetManager.getInstance().curID), e = Global.gameProxy.getPetJinConfigForID(t.pet_config_id); if (void 0 != e) { this.jinhuaButton.visible = !0; var i = Global.gameProxy.getPetBaseConfigForID(t.pet_config_id); this.headImg1.source = i.graphical_id + "_png", this.nameLabel1.text = i.name; var n = Global.gameProxy.getPetBaseConfigForID(e.next_id); this.headImg2.source = n.graphical_id + "_png", this.nameLabel2.text = n.name, this.item0.titleNameLabel.text = "等级上限", this.item0.titleNumLabel.text = i.max_level, this.item0.titleNumLabel.x = this.item0.titleNameLabel.x + this.item0.titleNameLabel.width + 10, this.item0.titleNameLabel1.text = "等级上限", this.item0.titleNumLabel1.text = n.max_level, this.item0.titleNumLabel1.x = this.item0.titleNameLabel1.x + this.item0.titleNameLabel1.width + 10; var a = n.blood - i.blood; this.item1.titleNameLabel.text = "血量", this.item1.titleNumLabel.text = t.petData.blood + "", this.item1.titleNameLabel1.text = "血量", this.item1.titleNumLabel1.text = t.petData.blood + a + ""; var o = n.attack - i.attack; this.item2.titleNameLabel.text = "攻击", this.item2.titleNumLabel.text = t.petData.attack + "", this.item2.titleNameLabel1.text = "攻击", this.item2.titleNumLabel1.text = t.petData.attack + o + ""; var s = n.anti - i.anti; this.item3.titleNameLabel.text = "防御", this.item3.titleNumLabel.text = t.petData.anti + "", this.item3.titleNameLabel1.text = "防御", this.item3.titleNumLabel1.text = t.petData.anti + s + ""; var r = n.crit - i.crit; this.item4.titleNameLabel.text = "暴击", this.item4.titleNumLabel.text = t.petData.crit + "", this.item4.titleNameLabel1.text = "暴击", this.item4.titleNumLabel1.text = t.petData.crit + r + ""; var h = n.dodge - i.dodge; this.item5.titleNameLabel.text = "闪避", this.item5.titleNumLabel.text = t.petData.dodge + "", this.item5.titleNameLabel1.text = "闪避", this.item5.titleNumLabel1.text = t.petData.dodge + h + ""; var l = .2 * a + 1 * o + 2 * s + 3 * r + 3 * h; this.item6.titleNameLabel.text = "战力", this.item6.titleNumLabel.text = BattlePetManager.getInstance().alaysPower(t.petData) + "", this.item6.titleNameLabel1.text = "战力", this.item6.titleNumLabel1.text = BattlePetManager.getInstance().alaysPower(t.petData) + Math.ceil(l) + "" } else { var i = Global.gameProxy.getPetBaseConfigForID(t.pet_config_id); this.headImg1.source = i.graphical_id + "_png", this.nameLabel1.text = i.name, this.headImg2.source = i.graphical_id + "_png", this.nameLabel2.text = "MAX", this.jinhuaButton.visible = !1, this.item0.titleNameLabel.text = "等级上限", this.item0.titleNumLabel.text = i.max_level, this.item0.titleNumLabel.x = this.item0.titleNameLabel.x + this.item0.titleNameLabel.width + 10, this.item0.titleNameLabel1.text = "等级上限", this.item0.titleNumLabel1.text = i.max_level, this.item0.titleNumLabel1.x = this.item0.titleNameLabel1.x + this.item0.titleNameLabel1.width + 10, this.item1.titleNameLabel.text = "血量", this.item1.titleNumLabel.text = t.petData.blood + "", this.item1.titleNameLabel1.text = "血量", this.item1.titleNumLabel1.text = t.petData.blood + "", this.item2.titleNameLabel.text = "攻击", this.item2.titleNumLabel.text = t.petData.attack + "", this.item2.titleNameLabel1.text = "攻击", this.item2.titleNumLabel1.text = t.petData.attack + "", this.item3.titleNameLabel.text = "防御", this.item3.titleNumLabel.text = t.petData.anti + "", this.item3.titleNameLabel1.text = "防御", this.item3.titleNumLabel1.text = t.petData.anti + "", this.item4.titleNameLabel.text = "暴击", this.item4.titleNumLabel.text = t.petData.crit + "", this.item4.titleNameLabel1.text = "暴击", this.item4.titleNumLabel1.text = t.petData.crit + "", this.item5.titleNameLabel.text = "闪避", this.item5.titleNumLabel.text = t.petData.dodge + "", this.item5.titleNameLabel1.text = "闪避", this.item5.titleNumLabel1.text = t.petData.dodge + "", this.item6.titleNameLabel.text = "战力", this.item6.titleNumLabel.text = BattlePetManager.getInstance().alaysPower(t.petData) + "", this.item6.titleNameLabel1.text = "战力", this.item6.titleNumLabel1.text = BattlePetManager.getInstance().alaysPower(t.petData) + "" } }, e } (eui.Component); __reflect(BattlePetJinhuaCompoment.prototype, "BattlePetJinhuaCompoment"); var BattlePetJinhuaTips = function(t) { function e() { var e = t.call(this) || this; return e.skinName = BattlePetJinhuaTipSkin, e.addEventListener(egret.Event.ADDED_TO_STAGE, e.onAdd, e), e.addEventListener(egret.Event.REMOVED_FROM_STAGE, e.onRemove, e), e } return __extends(e, t), e.prototype.onAdd = function(t) { this.closeButton.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onClose, this), this.okButton.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onClose, this), this.jinhuaButton.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onJinhua, this) }, e.prototype.onRemove = function(t) { this.closeButton.removeEventListener(egret.TouchEvent.TOUCH_TAP, this.onClose, this), this.okButton.removeEventListener(egret.TouchEvent.TOUCH_TAP, this.onClose, this), this.jinhuaButton.removeEventListener(egret.TouchEvent.TOUCH_TAP, this.onJinhua, this) }, e.prototype.onJinhua = function(t) { BattlePetManager.getInstance().sendNetJinhua(), game.AppFacade.instance.sendNotification(PanelNotify.CLOSE_BATTLE_PET_TIPS) }, e.prototype.onClose = function(t) { game.AppFacade.instance.sendNotification(PanelNotify.CLOSE_BATTLE_PET_TIPS) }, e.prototype.childrenCreated = function() { if (t.prototype.childrenCreated.call(this), this.g1.visible = !1, this.g2.visible = !1, 0 == BattlePetManager.getInstance().isjin) this.g1.visible = !0, this.updataItem(); else { this.g2.visible = !0; var e = BattlePetManager.getInstance().getPetForID(BattlePetManager.getInstance().curID), i = Global.gameProxy.getPetJinConfigForID(e.pet_config_id), n = Global.gameProxy.getPetBaseConfigForID(i.next_id); this.nameLabel.text = n.name, this.headImg.source = n.graphical_id + "_png" } }, e.prototype.updataItem = function() { for (var t = BattlePetManager.getInstance().getPetForID(BattlePetManager.getInstance().curID), e = Global.gameProxy.getPetJinConfigForID(t.pet_config_id), i = e.crystal_id.split(","), n = 1; 6 > n; n++) { var a = i[n - 1].split(":")[0], o = i[n - 1].split(":")[1], s = Global.gameProxy.getItemConfig(a), r = this["item" + n]; r.headImg.source = s.graphical_id + "_png", r.numLaebl.text = "X" + o } var h = e.drawing_id, l = Global.gameProxy.getItemImageId(h); this.item0.headImg.source = l + "_png", this.item0.numLaebl.text = "X1" }, e } (eui.Component); __reflect(BattlePetJinhuaTips.prototype, "BattlePetJinhuaTips"); var BattlePetManager = function(t) { function e() { var e = t.call(this) || this; return e.petArr = [], e.isjin = 0, e } return __extends(e, t), e.getInstance = function() { return this._insatance || (this._insatance = new e), this._insatance }, e.prototype.initPet = function(t) { this.petArr.length = 0; for (var e = 0; e < t.length; e++) { var i = new Pet; i.readData(t[e]), this.petArr.push(i) } }, e.prototype.getPetForID = function(t) { for (var e = 0; e < this.petArr.length; e++) if (this.petArr[e].id == t) return this.petArr[e] }, e.prototype.alaysPower = function(t) { var e = .2 * t.blood + 1 * t.attack + 3 * t.crit + 2 * t.anti + 3 * t.dodge; return Math.ceil(e) }, e.prototype.sendGetpet = function() { Global.netProxy.sendRequest(GameConfig.SERVER_PATH + "pet/get-list", {}, this.onSendNetzy.bind(this)) }, e.prototype.onSendNetzy = function(t) { 0 == t.status && (e.getInstance().initPet(t.data.list), game.EventManager.instance.dispatch(SysNotify.PET_UODATA), game.EventManager.instance.dispatch(SysNotify.USER_DOG_CHANGE)) }, e.prototype.sendNetAdd = function() { var t = this.getPetForID(this.curID); Global.gameProxy.getPetJinConfigForID(t.pet_config_id); Global.playerProxy.playerData.gem >= t.accelerate_brooding_gem ? Global.netProxy.sendRequest(GameConfig.SERVER_PATH + "pet/accelerate-brooding-egg", { user_id: Global.playerProxy.playerData.id, pet_id: this.curID }, this.onSendNetAdd.bind(this)) : TipsUtils.showTipsDownToUp("钻石不够,请充值") }, e.prototype.onSendNetAdd = function(t) { if (0 == t.status) { var e = this.getPetForID(this.curID); Global.gameProxy.getPetJinConfigForID(e.pet_config_id); Global.playerProxy.playerData.gem -= e.accelerate_brooding_gem, game.EventManager.instance.dispatch(SysNotify.TOPLAYER_INFO_UPDATE), this.sendGetpet() } }, e.prototype.sendNetJinhua = function() { Global.netProxy.sendRequest(GameConfig.SERVER_PATH + "pet/evolution", { user_id: Global.playerProxy.playerData.id, pet_id: this.curID }, this.onSendNetJinhua.bind(this)) }, e.prototype.onSendNetJinhua = function(t) { if (0 == t.status) { var i = this.getPetForID(this.curID), n = Global.gameProxy.getPetJinConfigForID(i.pet_config_id); Global.playerProxy.sellWareHouseItem1(n.crystal_id + "," + n.drawing_id + ":1"), e.getInstance().isjin = 1, game.AppFacade.instance.sendNotification(PanelNotify.OPEN_BATTLE_PET_TIPS), this.sendGetpet() } else TipsUtils.showTipsDownToUp(GameConfig.ServerCode[t.status]) }, e.prototype.sendNetPeiyang = function() { Global.netProxy.sendRequest(GameConfig.SERVER_PATH + "pet/train", { user_id: Global.playerProxy.playerData.id, pet_id: this.curID, type: this.curType }, this.onSendNetPeiyang.bind(this)) }, e.prototype.onSendNetPeiyang = function(t) { if (0 == t.status) { var e = this.getPetForID(this.curID), i = Global.gameProxy.getPetXiaohaoConfigForID(e.pet_config_id), n = i.consume_id.split(","); Global.playerProxy.sellWareHouseItem1(n[this.curType - 1]), this.sendGetpet(), TipsUtils.showTipsDownToUp("培养成功") } else TipsUtils.showTipsDownToUp(GameConfig.ServerCode[t.status]) }, e.prototype.sendNetUpLevel = function() { Global.netProxy.sendRequest(GameConfig.SERVER_PATH + "pet/upgrade", { user_id: Global.playerProxy.playerData.id, pet_id: this.curID, gold: this.curGold }, this.onSendNetUpLevel.bind(this)) }, e.prototype.onSendNetUpLevel = function(t) { 0 == t.status ? (Global.playerProxy.playerData.gold -= this.curGold, game.EventManager.instance.dispatch(SysNotify.TOPLAYER_INFO_UPDATE), this.sendGetpet()) : TipsUtils.showTipsDownToUp(GameConfig.ServerCode[t.status]) }, e.prototype.sendNetFeend = function() { console.log(this.feedItemID); this.feedItem = this.getFeed(this.feedItemID), this.feedItem ? Global.netProxy.sendRequest(GameConfig.SERVER_PATH + "user/feed-dog", { item_id: this.feedItemID }, this.onSendNetFeed.bind(this)) : TipsUtils.showTipsDownToUp("没有狗粮") }, e.prototype.onSendNetFeed = function(t) { if (0 == t.status) { Global.playerProxy.sellWareHouseItem({ id: this.feedItem.config.id }, 1), game.EventManager.instance.dispatch(SysNotify.TOPLAYER_INFO_UPDATE), TipsUtils.showTipsDownToUp("喂养成功"); Global.playerProxy.playerData.dog_hunger_end_time = t.data.dog_hunger_end_time, game.EventManager.instance.dispatch(SysNotify.DOG_UPDAT); } else TipsUtils.showTipsDownToUp(GameConfig.ServerCode[t.status]) }, e.prototype.sendNetWar = function() { Global.netProxy.sendRequest(GameConfig.SERVER_PATH + "pet/set-enter-war", { pet_id: this.curID }, this.onSendNetWar.bind(this)) }, e.prototype.onSendNetWar = function(t) { 0 == t.status ? (game.EventManager.instance.dispatch(SysNotify.TOPLAYER_INFO_UPDATE), this.sendGetpet()) : TipsUtils.showTipsDownToUp(GameConfig.ServerCode[t.status]) }, e.prototype.getFeed = function(t) { var e = Global.playerProxy.getHasItemByItemId(t); return void 0 != e ? e: null }, e } (egret.EventDispatcher); __reflect(BattlePetManager.prototype, "BattlePetManager"); var BattlePetMediator = function(t) { function e() { return t.call(this, "BattlePetMediator") || this } return __extends(e, t), e.prototype.listNotificationInterests = function() { return [PanelNotify.OPEN_BATTLES_PET, PanelNotify.CLOSE_BATTLES_PET] }, e.prototype.onRegister = function() { t.prototype.onRegister.call(this) }, e.prototype.showViewComponent = function(t) { void 0 === t && (t = 7), this.viewComponent = new BattlePanel, this.showUI(this.viewComponent, !0, 0, 0, t) }, e.prototype.handleNotification = function(t) { t.getBody(); switch (t.getName()) { case PanelNotify.OPEN_BATTLES_PET: this.sendGetpet(); break; case PanelNotify.CLOSE_BATTLES_PET: this.closeViewComponent() } }, e.prototype.sendGetpet = function() { Global.netProxy.sendRequest(GameConfig.SERVER_PATH + "pet/get-list", {}, this.onSendNetzy.bind(this)) }, e.prototype.onSendNetzy = function(t) { 0 == t.status && (BattlePetManager.getInstance().initPet(t.data.list), 0 == t.data.list.length ? TipsUtils.showTipsDownToUp("您没有宠物") : this.showViewComponent()) }, e.NAME = "BattlePetMediator", e } (BaseMediator); __reflect(BattlePetMediator.prototype, "BattlePetMediator"); var BattlePetProItem = function(t) { function e(e) { var i = t.call(this) || this; return i.type = 0, i.type = e, i.skinName = BattleProItemSkin, i.addEventListener(egret.Event.ADDED_TO_STAGE, i.onAdd, i), i.addEventListener(egret.Event.REMOVED_FROM_STAGE, i.onRemove, i), i } return __extends(e, t), e.prototype.onAdd = function(t) { this.peiyangButton.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onPeiyang, this) }, e.prototype.onRemove = function(t) { this.removeEventListener(egret.Event.ADDED_TO_STAGE, this.onAdd, this), this.removeEventListener(egret.Event.REMOVED_FROM_STAGE, this.onRemove, this), this.peiyangButton.removeEventListener(egret.TouchEvent.TOUCH_TAP, this.onPeiyang, this) }, e.prototype.childrenCreated = function() { t.prototype.childrenCreated.call(this), this.peiyangButton.touchEnabled = !0, GuideManager.getInsatance().isShowGuide && 7 == GuideManager.getInsatance().target && 1 == GuideManager.getInsatance().step && (this.validateNow(), GuideManager.getInsatance().show(this.peiyangButton)) }, e.prototype.onPeiyang = function(t) { BattlePetManager.getInstance().curType = this.type + 1; var e = BattlePetManager.getInstance().getPetForID(BattlePetManager.getInstance().curID); if (e.trainArr[this.type] < e.level ? BattlePetManager.getInstance().sendNetPeiyang() : TipsUtils.showTipsDownToUp("当前宠物等级不足"), GuideManager.getInsatance().isShowGuide && 7 == GuideManager.getInsatance().target && 1 == GuideManager.getInsatance().step) { this.validateNow(), GuideManager.getInsatance().step = 0, GuideManager.getInsatance().target = 8, GuideManager.getInsatance().des = TextConst.textObj[32], GuideManager.getInsatance().sendNetMessage(); var i = game.AppFacade.getInstance().retrieveMediator(BattlePetMediator.NAME); GuideManager.getInsatance().show(i.viewComponent.btnClose) } }, e } (eui.Component); __reflect(BattlePetProItem.prototype, "BattlePetProItem"); var BattlePetProItem1 = function(t) { function e() { var e = t.call(this) || this; return e.skinName = BattleProItem1Skin, e } return __extends(e, t), e.prototype.childrenCreated = function() { t.prototype.childrenCreated.call(this) }, e } (eui.Component); __reflect(BattlePetProItem1.prototype, "BattlePetProItem1"); var BattlePetRadioButton = function(t) { function e() { var e = t.call(this) || this; return e.skinName = BattlePetRadioButtonSkin, e } return __extends(e, t), e.prototype.partAdded = function(e, i) { t.prototype.partAdded.call(this, e, i) }, e.prototype.childrenCreated = function() { t.prototype.childrenCreated.call(this) }, e } (eui.RadioButton); __reflect(BattlePetRadioButton.prototype, "BattlePetRadioButton"); var BattlePetTipsMeditor = function(t) { function e() { return t.call(this, "BattlePetTipsMeditor") || this } return __extends(e, t), e.prototype.listNotificationInterests = function() { return [PanelNotify.OPEN_BATTLE_PET_TIPS, PanelNotify.CLOSE_BATTLE_PET_TIPS] }, e.prototype.onRegister = function() { t.prototype.onRegister.call(this) }, e.prototype.showViewComponent = function(t) { void 0 === t && (t = 7), this.viewComponent = new BattlePetJinhuaTips, this.showUI(this.viewComponent, !0, 0, 0, t) }, e.prototype.handleNotification = function(t) { t.getBody(); switch (t.getName()) { case PanelNotify.OPEN_BATTLE_PET_TIPS: this.showViewComponent(); break; case PanelNotify.CLOSE_BATTLE_PET_TIPS: this.closeViewComponent() } }, e.NAME = "BattlePetTipsMeditor", e } (BaseMediator); __reflect(BattlePetTipsMeditor.prototype, "BattlePetTipsMeditor"); var BattlePetUpLevelCompoment = function(t) { function e() { return t.call(this) || this } return __extends(e, t), e.prototype.partAdded = function(e, i) { t.prototype.partAdded.call(this, e, i) }, e.prototype.childrenCreated = function() { t.prototype.childrenCreated.call(this), this.initItem(), this.changeButton.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onChange, this), this.scrolls.touchEnabled = !0 }, e.prototype.initItem = function() { this.gs.removeChildren(); for (var t = 0; 5 > t; t++) { var e = new BattlePetProItem(t); this.gs.addChild(e), e.y = e.height * t + .1 * e.height } }, e.prototype.updata = function() { var t = BattlePetManager.getInstance().getPetForID(BattlePetManager.getInstance().curID); Global.gameProxy.getPetBaseConfigForID(t.pet_config_id); this.levelLabel.text = t.level + ""; var e = t.level + 1; e > 60 && (e = 60); var i = Global.gameProxy.getPetUpConfigForID(e), n = Global.gameProxy.getPetXiaohaoConfigForID(parseInt(t.pet_config_id)), a = Global.gameProxy.getCommonConfigById(18), o = a.min; this.desLabel1.text = "注:金币兑换经验值的比例为" + o + ":1,只能输入倍数为" + o + "的金币"; var s = t.exp, r = i.exp; this.prossbar.setPross(s, r), this.goldEditLabel.text = "" + (r - s) * o; for (var h = Global.gameProxy.getPetXiaohaoConfigForID(t.pet_config_id), l = h.consume_id.split(","), c = 0; c < this.gs.numChildren; c++) { var p = this.gs.getChildAt(c); p.proNameLabel.text = PetPro.petProStr[p.type], p.titleNameLabel.text = t.petData[PetPro.ketArr[p.type]] + "", p.proLabel.text = n[PetPro.ketArr[p.type]], p.countLabel.text = t.trainArr[p.type] + "/" + t.level; var u = l[p.type].split(":")[0], d = parseInt(l[p.type].split(":")[1]), g = Global.gameProxy.getItemImageId(u); p.icons.source = g + "_png", p.countLabel0.text = "X" + d, GuideManager.getInsatance().isShowGuide && 7 == GuideManager.getInsatance().target && 1 == GuideManager.getInsatance().step && p.type == PetPro.PET_HP && (this.validateNow(), GuideManager.getInsatance().show(p.peiyangButton)) } }, e.prototype.onChange = function(t) { var e = parseInt(this.goldEditLabel.text), i = Global.gameProxy.getCommonConfigById(18), n = i.min, a = BattlePetManager.getInstance().getPetForID(BattlePetManager.getInstance().curID), o = (Global.gameProxy.getPetBaseConfigForID(a.pet_config_id), a.level + 1); o > 60 && (o = 60); var s = Global.gameProxy.getPetUpConfigForID(o), r = a.exp, h = s.exp; e % n == 0 && e >= n ? 100 * (h - r) >= e ? (BattlePetManager.getInstance().curGold = e, BattlePetManager.getInstance().sendNetUpLevel()) : TipsUtils.showTipsDownToUp("当前金币大于当前升级经验所需金币") : TipsUtils.showTipsDownToUp("请输入" + n + "的倍数"), GuideManager.getInsatance().isShowGuide && 7 == GuideManager.getInsatance().target && 0 == GuideManager.getInsatance().step && (this.validateNow(), GuideManager.getInsatance().des = TextConst.textObj[31], GuideManager.getInsatance().step = 1, GuideManager.getInsatance().sendNetMessage(), GuideManager.getInsatance().show(this.gs.getChildAt(0).peiyangButton)) }, e } (eui.Component); __reflect(BattlePetUpLevelCompoment.prototype, "BattlePetUpLevelCompoment"); var PetData = function() { function t() {} return t } (); __reflect(PetData.prototype, "PetData"); var PetPro = function() { function t() {} return t.ketArr = ["blood", "attack", "anti", "crit", "dodge"], t.ketArrd = ["blood_add", "attack_add", "anti_add", "crit_add", "dodge_add"], t.petProStr = ["血量", "攻击", "防御", "暴击", "闪避"], t.petWay = ["无类型", "近身攻击", "远程攻击"], t.PET_HP = 0, t.DEFENT = 2, t.ATTACK = 1, t.CRIT = 3, t.DODGE = 4, t.POWER = 5, t } (); __reflect(PetPro.prototype, "PetPro"); var Pet = function() { function t() { this.trainArr = [0, 0, 0, 0, 0], this.accelerate_brooding_gem = 0, this.curBlood = 0, this.index = 0, this.petData = new PetData } return t.prototype.readData = function(t) { this.id = t.id, this.pet_config_id = t.pet_config_id, this.name = t.name, this.level = t.level, this.exp = t.exp, this.feed = t.feed, this.feed_max = t.feed_max, this.last_updata_feed_time = t.last_updata_feed_time, this.fighting_capacity = t.fighting_capacity, this.is_enter_war = t.is_enter_war, this.index = t.index, this.end_brooding_time = t.end_brooding_time, this.last_feed_update_time = t.last_feed_update_time, this.has_end_brooding_time = -1, this.accelerate_brooding_gem = t.accelerate_brooding_gem, this.petData.blood = t[PetPro.ketArr[0]] + t[PetPro.ketArrd[0]], this.curBlood = t[PetPro.ketArr[0]] + t[PetPro.ketArrd[0]], this.petData.attack = t[PetPro.ketArr[1]] + t[PetPro.ketArrd[1]], this.petData.anti = t[PetPro.ketArr[2]] + t[PetPro.ketArrd[2]], this.petData.crit = t[PetPro.ketArr[3]] + t[PetPro.ketArrd[3]], this.petData.dodge = t[PetPro.ketArr[4]] + t[PetPro.ketArrd[4]], this.trainArr[PetPro.PET_HP] = t.blood_train_count, this.trainArr[PetPro.DEFENT] = t.anti_train_count, this.trainArr[PetPro.CRIT] = t.crit_train_count, this.trainArr[PetPro.ATTACK] = t.attack_train_count, this.trainArr[PetPro.DODGE] = t.dodge_train_count }, t } (); __reflect(Pet.prototype, "Pet"); var PetWar; ! function(t) { t[t.PET_FIGHT = 1] = "PET_FIGHT", t[t.PET_NOFIGHT = 0] = "PET_NOFIGHT" } (PetWar || (PetWar = {})); var BoxManager = function(t) { function e() { var e = t.call(this) || this; return e.curid = null, e.BoxList = [], e } return __extends(e, t), e.getInstance = function() { return this._instance || (this._instance = new e), this._instance }, e.prototype.sendNetGetBoxList = function(t, e) { this.callF = t, this.callObj = e, Global.netProxy.sendRequest(GameConfig.SERVER_PATH + "comm/get-box-list", {}, this.onSendNetGetBoxList.bind(this)) }, e.prototype.onSendNetGetBoxList = function(t) { if (this.curid = null, 0 == t.status) { this.BoxList.length = 0; for (var e = 0; e < t.data.length; e++) { var i = new Box; i.readData(t.data[e]), this.BoxList.push(i), i.end_open_time > 0 && (this.curid = i.id) } if (this.BoxList = _.sortBy(this.BoxList, "end_open_time"), this.BoxList.length > 0) { var n = this.BoxList.pop(); this.BoxList.unshift(n) } this.callF && this.callObj && this.callF.call(this.callObj), game.EventManager.instance.dispatch(SysNotify.BOX_UPDATA) } else TipsUtils.showTipsDownToUp(GameConfig.ServerCode[t.status]) }, e.prototype.sendNetBoxtime = function() { Global.netProxy.sendRequest(GameConfig.SERVER_PATH + "comm/box-start-time", { box_id: this.curid }, this.onSendNetBoxtime.bind(this)) }, e.prototype.onSendNetBoxtime = function(t) { 0 == t.status ? this.sendNetGetBoxList(null, null) : TipsUtils.showTipsDownToUp(GameConfig.ServerCode[t.status]) }, e.prototype.sendNetOpenBox = function() { var t = 0; t = this.gem > 0 ? 1 : 0, Global.netProxy.sendRequest(GameConfig.SERVER_PATH + "comm/open-box", { user_id: Global.playerProxy.playerData.id, box_id: this.curid, use_gem: t }, this.onSendNetOpenBox.bind(this)) }, e.prototype.onSendNetOpenBox = function(t) { 0 == t.status ? (Global.playerProxy.playerData.gem -= this.gem, game.EventManager.instance.dispatch(SysNotify.BOX_OPEN), game.EventManager.instance.dispatch(SysNotify.TOPLAYER_INFO_UPDATE)) : TipsUtils.showTipsDownToUp(GameConfig.ServerCode[t.status]) }, e.prototype.sendNetDelnBox = function() { Global.netProxy.sendRequest(GameConfig.SERVER_PATH + "comm/del-box", { box_id: this.delid }, this.onSendNetDelBox.bind(this)) }, e.prototype.onSendNetDelBox = function(t) { 0 == t.status ? (this.sendNetGetBoxList(null, null), game.EventManager.instance.dispatch(SysNotify.TOPLAYER_INFO_UPDATE)) : TipsUtils.showTipsDownToUp(GameConfig.ServerCode[t.status]) }, e.prototype.getBoxForID = function(t) { for (var e = 0; e < this.BoxList.length; e++) if (this.BoxList[e].id == t) return this.BoxList[e]; return null }, e.prototype.delBoxForID = function(t) { for (var e = 0; e < this.BoxList.length; e++) this.BoxList[e].id == t && this.BoxList.splice(e, 1) }, e } (egret.EventDispatcher); __reflect(BoxManager.prototype, "BoxManager"); var Box = function() { function t() {} return t.prototype.readData = function(t) { this.id = t.id, this.item_id = t.item_id, this.end_open_time = t.end_open_time, this.is_get_gift = t.is_get_gift }, t } (); __reflect(Box.prototype, "Box"); var BoxMediator = function(t) { function e() { var e = t.call(this, "BoxMediator") || this; return e.GroupName = "box", e } return __extends(e, t), e.prototype.listNotificationInterests = function() { return [PanelNotify.OPEN_BOX, PanelNotify.CLOSE_BOX] }, e.prototype.onRegister = function() { t.prototype.onRegister.call(this) }, e.prototype.showViewComponent = function(t) { void 0 === t && (t = 7), this.viewComponent = new BoxPanel, this.showUI(this.viewComponent, !0, 0, 0, t) }, e.prototype.handleNotification = function(t) { t.getBody(); switch (t.getName()) { case PanelNotify.OPEN_BOX: BoxManager.getInstance().sendNetGetBoxList(this.onGetInfo, this); break; case PanelNotify.CLOSE_BOX: this.closeViewComponent() } }, e.prototype.onGetInfo = function() { RES.isGroupLoaded(this.GroupName) ? this.showViewComponent() : (LoadingCompoment.getInstance().show(), RES.addEventListener(RES.ResourceEvent.GROUP_COMPLETE, this.onResourceLoadComplete, this), RES.addEventListener(RES.ResourceEvent.GROUP_LOAD_ERROR, this.onResourceLoadError, this), RES.addEventListener(RES.ResourceEvent.GROUP_PROGRESS, this.onResourceProgress, this), RES.loadGroup(this.GroupName)) }, e.prototype.onResourceLoadComplete = function(t) { t.groupName == this.GroupName && (RES.removeEventListener(RES.ResourceEvent.GROUP_COMPLETE, this.onResourceLoadComplete, this), RES.removeEventListener(RES.ResourceEvent.GROUP_LOAD_ERROR, this.onResourceLoadError, this), RES.removeEventListener(RES.ResourceEvent.GROUP_PROGRESS, this.onResourceProgress, this), LoadingCompoment.getInstance().hide(), this.showViewComponent()) }, e.prototype.onResourceLoadError = function(t) { console.warn("Group:" + t.groupName + " has failed to load"), this.onResourceLoadComplete(t) }, e.prototype.onResourceProgress = function(t) { t.groupName == this.GroupName && LoadingCompoment.getInstance().prossBar.setPross(t.itemsLoaded, t.itemsTotal) }, e.NAME = "BoxMediator", e } (BaseMediator); __reflect(BoxMediator.prototype, "BoxMediator"); var BoxPanel = function(t) { function e() { var e = t.call(this) || this; return e.skinName = BoxPanelSkin, e } return __extends(e, t), e.prototype.createChildren = function() { t.prototype.createChildren.call(this), this.commonPanel.setPanelWidth(640), this.commonPanel.setPanelHeight(840), this.commonPanel.setTitleIcon("box_json.box_sp1"), this.commonPanel.setTitle("box_json.box_sp0"), game.UIUtils.addButtonScaleEffects(this), this.updata() }, e.prototype.onAdded = function() { t.prototype.onAdded.call(this), game.EventManager.instance.addEvent(SysNotify.BOX_UPDATA, this.updata, this), this.gemButton.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onOpenBox, this), this.addListener1() }, e.prototype.onRemoved = function() { t.prototype.onRemoved.call(this), game.EventManager.instance.removeEvent(SysNotify.BOX_UPDATA, this.updata, this), this.gemButton.removeEventListener(egret.TouchEvent.TOUCH_TAP, this.onOpenBox, this), this.removeListenner1() }, e.prototype.childrenCreated = function() { t.prototype.childrenCreated.call(this), this.mc = game.MCUtils1.getMc("box_faguang"), this.mc.x = GameConfig.curWidth() / 2, this.mc.y = 800, this.addChild(this.mc), this.mc.visible = !1 }, e.prototype.initUnit = function() {}, e.prototype.addListener1 = function() { for (var t = 0; 8 > t; t++) this["unit" + t].addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTab, this); core.TimerManager.instance.addTick(1e3, -1, this.onTimer, this), game.EventManager.instance.addEvent(SysNotify.BOX_OPEN, this.onNetOpenBox, this) }, e.prototype.removeListenner1 = function() { for (var t = 0; 8 > t; t++) this["unit" + t].removeEventListener(egret.TouchEvent.TOUCH_TAP, this.onTab, this); core.TimerManager.instance.removeTick(this.onTimer, this), game.EventManager.instance.removeEvent(SysNotify.BOX_OPEN, this.onNetOpenBox, this) }, e.prototype.onTimer = function() { if (null != BoxManager.getInstance().curid) { var t = BoxManager.getInstance().getBoxForID(BoxManager.getInstance().curid); if (t) { var e = t.end_open_time - DateTimer.instance.now; e >= 0 ? this.timeLabel.text = TimeFormat.showHHMMSS(1e3 * e) : (this.timeLabel.text = TimeFormat.showHHMMSS(0), this.gemButton.label = "0") } } }, e.prototype.onTab = function(t) { var e = t.currentTarget; null != e.id && null == BoxManager.getInstance().curid && (BoxManager.getInstance().curid = e.id, e.fagaungImg.visible = !0, BoxManager.getInstance().sendNetBoxtime()) }, e.prototype.onOpenBox = function(t) { if (null != BoxManager.getInstance().curid) { var e = BoxManager.getInstance().getBoxForID(BoxManager.getInstance().curid), i = Global.gameProxy.getBoxConfigForID(e.item_id); e.end_open_time > DateTimer.instance.now ? BoxManager.getInstance().gem = i.Diamond: BoxManager.getInstance().gem = 0, BoxManager.getInstance().sendNetOpenBox() } else TipsUtils.showTipsDownToUp("请选择宝箱") }, e.prototype.onNetOpenBox = function() { this.mc.visible = !0, this.mc.gotoAndPlay(1, 1), this.mc.addEventListener(egret.Event.COMPLETE, this.onMoviePlayComplete, this) }, e.prototype.onMoviePlayComplete = function(t) { this.mc.removeEventListener(egret.Event.COMPLETE, this.onMoviePlayComplete, this), this.mc.visible = !1; var e = BoxManager.getInstance().getBoxForID(BoxManager.getInstance().curid), i = Global.gameProxy.getBoxConfigForID(e.item_id), n = i.reward_id; Global.playerProxy.addItem1(n), BoxManager.getInstance().sendNetGetBoxList(null, null) }, e.prototype.btnCloseTouchEnded = function() { game.AppFacade.getInstance().sendNotification(PanelNotify.CLOSE_BOX) }, e.prototype.updata = function() { for (var t = 0; 8 > t; t++) this["unit" + t].icons.source = "", this["unit" + t].fagaungImg.visible = !1, this["unit" + t].closeButton.visible = !1, this["unit" + t].id = null; for (var t = 0; t < BoxManager.getInstance().BoxList.length; t++) { var e = BoxManager.getInstance().BoxList[t].item_id, i = Global.gameProxy.getItemImageId(e); this["unit" + t].icons.source = i + "_png", this["unit" + t].closeButton.visible = !0, this["unit" + t].id = BoxManager.getInstance().BoxList[t].id, this["unit" + t].id == BoxManager.getInstance().curid && (this["unit" + t].fagaungImg.visible = !0) } this.boxImg.source = "", this.gemButton.label = "0", this.timeLabel.text = ""; var n = [201016, 201015, 201014, 201013, 201012], a = ["box_bg01_png", "box_bg1_png", "box_bg2_png", "box_bg3_png", "box_bg4_png"]; if (null != BoxManager.getInstance().curid) { for (var o, s = BoxManager.getInstance().getBoxForID(BoxManager.getInstance().curid), e = s.item_id, t = 0; t < n.length; t++) n[t] == e && (o = t); this.boxImg.source = a[o]; var r = Global.gameProxy.getBoxConfigForID(e); s.end_open_time >= DateTimer.instance.now ? this.gemButton.label = r.Diamond: this.gemButton.label = "0" } }, e } (game.BasePanel); __reflect(BoxPanel.prototype, "BoxPanel"); var BoxUnit = function(t) { function e() { return t.call(this) || this } return __extends(e, t), e.prototype.childrenCreated = function() { t.prototype.childrenCreated.call(this), this.closeButton.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onclose, this) }, e.prototype.onclose = function(t) { BoxManager.getInstance().delid = this.id, BoxManager.getInstance().sendNetDelnBox() }, e } (eui.Component); __reflect(BoxUnit.prototype, "BoxUnit"); var FaguangButton = function(t) { function e() { var e = t.call(this) || this; return e.skinName = FaguangButtonSkin, e } return __extends(e, t), e.prototype.childrenCreated = function() { t.prototype.childrenCreated.call(this), this.mc = game.MCUtils1.getMc("box_anniu"), this.gs.addChild(this.mc), this.mc.x = this.gs.width / 2, this.mc.y = this.gs.height / 2, this.mc.play( - 1) }, e } (eui.Button); __reflect(FaguangButton.prototype, "FaguangButton"); var ChangeItemRender = function(t) { function e() { var e = t.call(this) || this; return e.skinName = ChangeItemRenderSkin, e } return __extends(e, t), e.prototype.childrenCreated = function() { t.prototype.childrenCreated.call(this) }, e.prototype.dataChanged = function() { t.prototype.dataChanged.call(this); var e = Global.gameProxy.getCommonConfig(), i = e[12], n = e[13]; switch (ChangeManager.getInstance().type) { case 0: var aa = "金币"; break; case 1: var aa = "积分"; } var s = parseInt(this.data.created_at); this.timeLabel.text = game.Utils.formatDate(new Date(1e3 * s)), this.nameLabel.text = Global.playerProxy.playerData.nickname+'兑换获得'+this.data.num+aa }, e } (eui.ItemRenderer); __reflect(ChangeItemRender.prototype, "ChangeItemRender"); var ChangeManager = function(t) { function e() { var e = t.call(this) || this; return e.changeList = [], e } return __extends(e, t), e.getInstance = function() { return this._instance || (this._instance = new e), this._instance }, e.prototype.sendNetGetChangeList = function() { console.log(this.type) Global.netProxy.sendRequest(GameConfig.SERVER_PATH + "comm/score-gold-list", { type: this.type }, this.onSendNetGetChangeList.bind(this)) }, e.prototype.onSendNetGetChangeList = function(t) { console.log(t) 0 == t.status ? (this.changeList = t.data.list, game.EventManager.instance.dispatch(SysNotify.CHANGE_LIST), game.EventManager.instance.dispatch(SysNotify.TOPLAYER_INFO_UPDATE)) : TipsUtils.showTipsDownToUp(GameConfig.ServerCode[t.status]) }, e.prototype.sendNetSChangeG = function() { Global.netProxy.sendRequest(GameConfig.SERVER_PATH + "comm/score-to-gold", { score: this.score }, this.onSendNetSChangeG.bind(this)) }, e.prototype.onSendNetSChangeG = function(t) { 0 == t.status ? (Global.playerProxy.playerData.gold = t.data.gold, Global.playerProxy.playerData.score -= this.score, game.EventManager.instance.dispatch(SysNotify.STOG_UPDATA), this.sendNetGetChangeList()) : TipsUtils.showTipsDownToUp(GameConfig.ServerCode[t.status]) }, e.prototype.sendNetGChangeS = function() { Global.netProxy.sendRequest(GameConfig.SERVER_PATH + "comm/gold-to-score", { gold: this.gold }, this.onSendNetGChangeS.bind(this)) }, e.prototype.onSendNetGChangeS = function(t) { 0 == t.status ? (Global.playerProxy.playerData.score = t.data.score, TipsUtils.showTipsDownToUp("兑换成功"), game.EventManager.instance.dispatch(SysNotify.GTOS_UPDATA), Global.playerProxy.playerData.gold -= this.gold, game.EventManager.instance.dispatch(SysNotify.TOPLAYER_INFO_UPDATE), this.sendNetGetChangeList()) : TipsUtils.showTipsDownToUp(GameConfig.ServerCode[t.status]) }, e } (egret.EventDispatcher); __reflect(ChangeManager.prototype, "ChangeManager"); var Changemediater = function(t) { function e() { var e = t.call(this, "Changemediater") || this; return e.GroupName = "change", e } return __extends(e, t), e.prototype.listNotificationInterests = function() { return [PanelNotify.OPEN_CHANGE_GOLD, PanelNotify.CLOSE_CHANGE_GOLD] }, e.prototype.onRegister = function() { t.prototype.onRegister.call(this) }, e.prototype.showViewComponent = function(t) { void 0 === t && (t = 7), this.viewComponent = new ChangePanel, this.showUI(this.viewComponent, !0, 0, 0, t) }, e.prototype.handleNotification = function(t) { t.getBody(); switch (t.getName()) { case PanelNotify.OPEN_CHANGE_GOLD: this.onGetInfo(); break; case PanelNotify.CLOSE_CHANGE_GOLD: this.closeViewComponent() } }, e.prototype.onGetInfo = function() { RES.isGroupLoaded(this.GroupName) ? this.showViewComponent() : (LoadingCompoment.getInstance().show(), RES.addEventListener(RES.ResourceEvent.GROUP_COMPLETE, this.onResourceLoadComplete, this), RES.addEventListener(RES.ResourceEvent.GROUP_LOAD_ERROR, this.onResourceLoadError, this), RES.addEventListener(RES.ResourceEvent.GROUP_PROGRESS, this.onResourceProgress, this), RES.loadGroup(this.GroupName)) }, e.prototype.onResourceLoadComplete = function(t) { t.groupName == this.GroupName && (RES.removeEventListener(RES.ResourceEvent.GROUP_COMPLETE, this.onResourceLoadComplete, this), RES.removeEventListener(RES.ResourceEvent.GROUP_LOAD_ERROR, this.onResourceLoadError, this), RES.removeEventListener(RES.ResourceEvent.GROUP_PROGRESS, this.onResourceProgress, this), LoadingCompoment.getInstance().hide(), this.showViewComponent()) }, e.prototype.onResourceLoadError = function(t) { console.warn("Group:" + t.groupName + " has failed to load"), this.onResourceLoadComplete(t) }, e.prototype.onResourceProgress = function(t) { t.groupName == this.GroupName && LoadingCompoment.getInstance().prossBar.setPross(t.itemsLoaded, t.itemsTotal) }, e.NAME = "Changemediater", e } (BaseMediator); __reflect(Changemediater.prototype, "Changemediater"); var ChangePanel = function(t) { function e() { var e = t.call(this) || this; return e.goldnum = 1, e.scorenum = 1, e.min = 1, e.skinName = changePanelSkinSkin, e } return __extends(e, t), e.prototype.adds = function() { this.closeButton.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onClose, this), game.EventManager.instance.addEventListener(SysNotify.GTOS_UPDATA, this.onGToS, this), game.EventManager.instance.addEventListener(SysNotify.STOG_UPDATA, this.onSToG, this), game.EventManager.instance.addEventListener(SysNotify.CHANGE_LIST, this.onGetChangeList, this), this.gjiaLabel.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onchangeNum, this), this.gjianLabel.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onchangeNum, this), this.sjiaLabel.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onchangeNum, this), this.sjianLabel.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onchangeNum, this), this.gtsLabel.addEventListener(egret.TextEvent.CHANGE, this.onInputChange, this), this.stgLabel.addEventListener(egret.TextEvent.CHANGE, this.onInputChange, this), this.changeGoldButton.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onchangeto, this), this.changeScoreButton.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onchangeto, this) }, e.prototype.removes = function() { this.closeButton.removeEventListener(egret.TouchEvent.TOUCH_TAP, this.onClose, this), game.EventManager.instance.removeEventListener(SysNotify.GTOS_UPDATA, this.onGToS, this), game.EventManager.instance.removeEventListener(SysNotify.STOG_UPDATA, this.onSToG, this), game.EventManager.instance.removeEventListener(SysNotify.CHANGE_LIST, this.onGetChangeList, this), this.gjiaLabel.removeEventListener(egret.TouchEvent.TOUCH_TAP, this.onchangeNum, this), this.gjianLabel.removeEventListener(egret.TouchEvent.TOUCH_TAP, this.onchangeNum, this), this.sjiaLabel.removeEventListener(egret.TouchEvent.TOUCH_TAP, this.onchangeNum, this), this.sjianLabel.removeEventListener(egret.TouchEvent.TOUCH_TAP, this.onchangeNum, this), this.gtsLabel.removeEventListener(egret.TextEvent.CHANGE, this.onInputChange, this), this.stgLabel.removeEventListener(egret.TextEvent.CHANGE, this.onInputChange, this), this.changeGoldButton.removeEventListener(egret.TouchEvent.TOUCH_TAP, this.onchangeto, this), this.changeScoreButton.removeEventListener(egret.TouchEvent.TOUCH_TAP, this.onchangeto, this) }, e.prototype.onchangeto = function(t) { var e = Global.gameProxy.getCommonConfig(), i = (e[12], e[13]), n = Global.playerProxy.playerData.score, a = Global.playerProxy.playerData.gold; switch (t.currentTarget) { case this.changeGoldButton: if (!RegUtils.isNumber(this.stgLabel.text)) return void TipsUtils.showTipsDownToUp("请输入数字"); if (this.scorenum = parseInt(this.stgLabel.text), this.scorenum > n) return void TipsUtils.showTipsDownToUp("积分不够"); this.scorenum <= 0 && TipsUtils.showTipsDownToUp("请输入大于0的数字"), ChangeManager.getInstance().score = this.scorenum, ChangeManager.getInstance().sendNetSChangeG(); break; case this.changeScoreButton: if (!RegUtils.isNumber(this.gtsLabel.text)) return void TipsUtils.showTipsDownToUp("请输入数字"); if (this.goldnum = parseInt(this.gtsLabel.text), this.goldnum > a) return void TipsUtils.showTipsDownToUp("金币不够"); if (this.goldnum <= 0 && TipsUtils.showTipsDownToUp("请输入大于0的数字"), this.goldnum % i.min != 0) return void TipsUtils.showTipsDownToUp("请输入" + i.min + "的倍数"); ChangeManager.getInstance().gold = this.goldnum, ChangeManager.getInstance().sendNetGChangeS() } }, e.prototype.onInputChange = function(t) { var e = Global.gameProxy.getCommonConfig(); e[12], e[13], Global.playerProxy.playerData.gold, Global.playerProxy.playerData.score; RegUtils.isNumber(this.stgLabel.text) && (this.scorenum = parseInt(this.stgLabel.text)), RegUtils.isNumber(this.gtsLabel.text) && (this.goldnum = parseInt(this.gtsLabel.text)) }, e.prototype.onchangeNum = function(t) { var e = Global.playerProxy.playerData.gold, i = Global.playerProxy.playerData.score, n = Global.gameProxy.getCommonConfig(), a = (n[12], n[13]); switch (t.currentTarget) { case this.gjiaLabel: this.goldnum + a.min <= e && (this.goldnum += a.min); break; case this.gjianLabel: this.goldnum - a.min > 0 ? this.goldnum -= a.min: this.goldnum = a.min; break; case this.sjiaLabel: this.scorenum + this.min <= i && (this.scorenum += this.min); break; case this.sjianLabel: this.scorenum - this.min > 0 ? this.scorenum -= this.min: this.scorenum = this.min } this.gtsLabel.text = this.goldnum + "", this.stgLabel.text = this.scorenum + "" }, e.prototype.creates = function() {}, e.prototype.createds = function() { this.scrolls.viewport = this.list, this.list.itemRenderer = ChangeItemRender; var t = ["金币兑换", "积分兑换"]; this.tab = new game.Tab(t, this.onTabItemClickCallback.bind(this)), this.groupbar.addChild(this.tab) }, e.prototype.onTabItemClickCallback = function(t) { 0 == t ? ChangeManager.getInstance().type = 0 : ChangeManager.getInstance().type = 1, ChangeManager.getInstance().sendNetGetChangeList() }, e.prototype.onGToS = function() { this.updata() }, e.prototype.onSToG = function() { this.updata() }, e.prototype.onGetChangeList = function() { this.updata() }, e.prototype.updata = function() { var t = ChangeManager.getInstance().changeList; this.list.dataProvider = new eui.ArrayCollection(t), this.g1.visible = !1, this.g2.visible = !1, this.goldLabel.text = Global.playerProxy.playerData.gold, this.scoreLabel.text = Global.playerProxy.playerData.score; var e = Global.gameProxy.getCommonConfig(), i = e[24], n = e[17]; switch (this.goldnum = n.min, this.scorenum = this.min, this.tab.selectIndex) { case 0: this.g1.visible = !0, this.stgdesLabel.text = "积分兑换金币比例为1:" + i.min; break; case 1: this.g2.visible = !0, this.gtsdesLabel.text = "金币兑换积分比例为" + n.min + ":1" } this.gtsLabel.text = this.goldnum + "", this.stgLabel.text = this.scorenum + "" }, e.prototype.onClose = function(t) { game.AppFacade.getInstance().sendNotification(PanelNotify.CLOSE_CHANGE_GOLD) }, e } (game.BasePanel2); __reflect(ChangePanel.prototype, "ChangePanel"); var ChengjiuItem = function(t) { function e() { var e = t.call(this) || this; return e.skinName = ChengjiuItemSkin, e } return __extends(e, t), e.prototype.onAdded = function() { t.prototype.onAdded.call(this), game.UIUtils.addButtonScaleEffects(this), this.getButton.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onGetReward, this) }, e.prototype.onRemoved = function() { t.prototype.onRemoved.call(this), game.UIUtils.removeButtonScaleEffects(this), this.getButton.removeEventListener(egret.TouchEvent.TOUCH_TAP, this.onGetReward, this) }, e.prototype.childrenCreated = function() { t.prototype.childrenCreated.call(this) }, e.prototype.onGetReward = function(t) { if (0 == this.data.showType) ChengjiuManager.getInstance().types = 0, ChengjiuManager.getInstance().curid = this.data.id, ChengjiuManager.getInstance().sendNetGetTaskReward(); else if (ChengjiuManager.getInstance().types = 1, ChengjiuManager.getInstance().curid = this.data.id, ChengjiuManager.getInstance().sendNetGetChengjiuReward(), GuideManager.getInsatance().isShowGuide && 9 == GuideManager.getInsatance().target && 0 == GuideManager.getInsatance().step) { this.validateNow(), GuideManager.getInsatance().des = TextConst.textObj[41], GuideManager.getInsatance().target = 10, GuideManager.getInsatance().step = 0, GuideManager.getInsatance().sendNetMessage(); var e = game.AppFacade.getInstance().retrieveMediator(ChengjiuMediator.NAME); GuideManager.getInsatance().show(e.viewComponent.btnClose) } }, e.prototype.dataChanged = function() { if (t.prototype.dataChanged.call(this), 0 == this.data.showType) { var e, i = this.data; this.prossBar.setPross(i.item_num, i.max_item_num), e = Global.gameProxy.getTaskConfigForID(i.config_id), this.icons.source = e.daily_icon + "_png", this.titleLabel.text = e.content; var n = e.goldcurrency_id.split(":"), a = Global.gameProxy.getItemImageId(n[0]); this.icons2.source = a + "_png", this.rewardLabel.text = n[1], 0 == i.sortKey ? (this.noGetButton.visible = !1, this.getButton.visible = !0, this.getButton.enabled = !1) : 1 == i.sortKey || (2 == i.sortKey ? (this.noGetButton.visible = !0, this.getButton.visible = !1) : 3 == i.sortKey && (this.noGetButton.visible = !1, this.getButton.visible = !0, this.getButton.enabled = !0)) } else { var e, o = this.data; this.prossBar.setPross(o.count, o.max_count), e = Global.gameProxy.getChengjiuConfigForID(o.config_id), this.icons.source = e.achievement_icon + "_png", this.titleLabel.text = e.name; var a = Global.gameProxy.getItemImageId(e.item_id); this.icons2.source = a + "_png"; var s, r = e.gold_id.split(":"); s = o.level >= r.length ? r[r.length - 1] : r[o.level], this.rewardLabel.text = s, 0 == o.sortKey ? (this.noGetButton.visible = !1, this.getButton.visible = !0, this.getButton.enabled = !1) : 1 == o.sortKey ? (this.getButton.visible = !1, this.noGetButton.visible = !0) : (this.noGetButton.visible = !1, this.getButton.visible = !0, this.getButton.enabled = !0), GuideManager.getInsatance().isShowGuide && 9 == GuideManager.getInsatance().target && 0 == GuideManager.getInsatance().step && (10 == o.config_id && (this.validateNow(), GuideManager.getInsatance().show(this.getButton)), GuideManager.getInsatance().des = TextConst.textObj[40]) } }, e } (game.BaseItemRenderer); __reflect(ChengjiuItem.prototype, "ChengjiuItem"); var ChengjiuManager = function() { function t() { this.chengjiuArr = [], this.TaskArr = [] } return t.getInstance = function() { return this._insatance || (this._insatance = new t), this._insatance }, t.prototype.initChengjiuData = function(t) { this.chengjiuArr.length = 0; var e = Global.gameProxy.getChengjiuConfig(); for (var i in e) { var n = new Chengjiu; n.config_id = i; for (var a = 0; a < t.length; a++) t[a].config_id == n.config_id && n.readData(t[a]); this.chengjiuArr.push(n) } }, t.prototype.initTask = function(t) { this.TaskArr.length = 0; for (var e = 0; e < t.length; e++) { var i = new Task; i.readData(t[e]), this.TaskArr.push(i) } }, t.prototype.sendNetGetInfo = function(t, e) { this.callBack = t, this.callobj = e, Global.netProxy.sendRequest(GameConfig.SERVER_PATH + "ach/get-list", {}, this.onGetChengjiuInfo.bind(this)) }, t.prototype.onGetChengjiuInfo = function(t) { 0 == t.status ? (this.initChengjiuData(t.data.list), Global.netProxy.sendRequest(GameConfig.SERVER_PATH + "comm/get-task-list", {}, this.onGetTaskInfo.bind(this))) : TipsUtils.showTipsDownToUp(GameConfig.ServerCode[t.status]) }, t.prototype.onGetTaskInfo = function(t) { 0 == t.status ? (this.initTask(t.data), this.callBack.call(this.callobj)) : TipsUtils.showTipsDownToUp(GameConfig.ServerCode[t.status]) }, t.prototype.sendNetGetTaskReward = function() { Global.netProxy.sendRequest(GameConfig.SERVER_PATH + "comm/get-task-gift", { id: this.curid }, this.onSendNetGetTaskReward.bind(this)) }, t.prototype.onSendNetGetTaskReward = function(t) { if (0 == t.status) { Global.audioProxy.playSound("anliu_mp3"); var e = this.getTaskDataForID(this.curid), i = Global.gameProxy.getTaskConfigForID(e.config_id), n = i.goldcurrency_id; Global.playerProxy.addItem1(n), Global.playerProxy.addExp(i.experience), e.is_get_gift = 1, e.resetSoort(), game.EventManager.instance.dispatch(SysNotify.TOPLAYER_INFO_UPDATE), game.EventManager.instance.dispatch(SysNotify.CHENGJIU_UPDATA) } else TipsUtils.showTipsDownToUp(GameConfig.ServerCode[t.status]) }, t.prototype.sendNetGetChengjiuReward = function() { Global.netProxy.sendRequest(GameConfig.SERVER_PATH + "ach/get-gift", { id: this.curid }, this.onSendNetGetChengjiuReward.bind(this)) }, t.prototype.onSendNetGetChengjiuReward = function(t) { if (0 == t.status) { Global.audioProxy.playSound("anliu_mp3"); var e, i = this.getChengjiuDataForID(this.curid), n = Global.gameProxy.getChengjiuConfigForID(i.config_id), a = n.item_id, o = n.gold_id.split(":"); e = i.level >= o.length ? o[o.length - 1] : o[i.level], Global.playerProxy.addItem1(a + ":" + e), Global.playerProxy.addExp(n.experience), i.level += 1, i.count = 0; var s = n.complete.split(":"); i.level + 1 >= s.length ? i.max_count = parseInt(s[s.length - 1]) : i.max_count = parseInt(s[i.level + 1]), i.resectSort(), game.EventManager.instance.dispatch(SysNotify.TOPLAYER_INFO_UPDATE), game.EventManager.instance.dispatch(SysNotify.CHENGJIU_UPDATA) } else TipsUtils.showTipsDownToUp(GameConfig.ServerCode[t.status]) }, t.prototype.getChengjiuDataForID = function(t) { for (var e = 0; e < this.chengjiuArr.length; e++) if (this.chengjiuArr[e].id == t) return this.chengjiuArr[e]; return null }, t.prototype.getTaskDataForID = function(t) { for (var e = 0; e < this.TaskArr.length; e++) if (this.TaskArr[e].id == t) return this.TaskArr[e]; return null }, t.prototype.sorts = function() { this.TaskArr.sort(this.sortsFcuntion2), this.chengjiuArr.sort(this.sortsFcuntion2), this.TaskArr.sort(this.sortsFcuntion), this.chengjiuArr.sort(this.sortsFcuntion) }, t.prototype.sortsFcuntion = function(t, e) { return e.sortKey - t.sortKey }, t.prototype.sortsFcuntion2 = function(t, e) { return t.id - e.id }, t } (); __reflect(ChengjiuManager.prototype, "ChengjiuManager"); var Task = function() { function t() { this.is_get_gift = 0, this.showType = 0, this.sortKey = 0 } return t.prototype.readData = function(t) { this.id = t.id, this.config_id = t.config_id, this.item_num = t.item_num, this.max_item_num = t.max_item_num, this.is_get_gift = t.is_get_gift, this.resetSoort() }, t.prototype.resetSoort = function() { this.max_item_num > this.item_num ? this.sortKey = 2 : this.max_item_num == this.item_num && 0 == this.is_get_gift ? this.sortKey = 3 : this.max_item_num == this.item_num && 1 == this.is_get_gift ? this.sortKey = 0 : this.sortKey = 1 }, t } (); __reflect(Task.prototype, "Task"); var Chengjiu = function() { function t() { this.id = 0, this.level = 0, this.count = 0, this.max_count = 10, this.is_get_gift = 0, this.showType = 1, this.sortKey = 1 } return t.prototype.readData = function(t) { this.id = t.id, this.config_id = t.config_id, this.level = t.level, this.count = t.count, this.max_count = t.max_count, this.is_get_gift = t.is_get_gift, this.resectSort() }, t.prototype.resectSort = function() { var t = Global.gameProxy.getChengjiuConfigForID(this.config_id), e = t.gold_id.split(":"); this.level < e.length ? this.max_count > this.count ? this.sortKey = 1 : this.max_count == this.count && (this.sortKey = 2) : this.sortKey = 0 }, t } (); __reflect(Chengjiu.prototype, "Chengjiu"); var ChengjiuMediator = function(t) { function e() { return t.call(this, "ChengjiuMediator") || this } return __extends(e, t), e.prototype.listNotificationInterests = function() { return [PanelNotify.OPEN_CHENGJIU, PanelNotify.CLOSE_CHENGJIU] }, e.prototype.onRegister = function() { t.prototype.onRegister.call(this) }, e.prototype.showViewComponent = function(t) { void 0 === t && (t = 7), this.viewComponent = new ChengjiuPanel, this.showUI(this.viewComponent, !0, 0, 0, t) }, e.prototype.handleNotification = function(t) { t.getBody(); switch (t.getName()) { case PanelNotify.OPEN_CHENGJIU: ChengjiuManager.getInstance().sendNetGetInfo(this.onGetInfo, this); break; case PanelNotify.CLOSE_CHENGJIU: this.closeViewComponent() } }, e.prototype.onGetInfo = function() { this.showViewComponent() }, e.NAME = "ChengjiuMediator", e } (BaseMediator); __reflect(ChengjiuMediator.prototype, "ChengjiuMediator"); var ChengjiuPanel = function(t) { function e() { var e = t.call(this) || this; return e.isFullScreen = !0, e.isVisibleAnimate = !0, e.skinName = ChengjiuPanelSkin, e } return __extends(e, t), e.prototype.onAdded = function() { t.prototype.onAdded.call(this), game.UIUtils.addButtonScaleEffects(this), game.EventManager.instance.addEvent(SysNotify.CHENGJIU_UPDATA, this.updata, this) }, e.prototype.onRemoved = function() { t.prototype.onRemoved.call(this), game.UIUtils.removeButtonScaleEffects(this), game.EventManager.instance.removeEvent(SysNotify.CHENGJIU_UPDATA, this.updata, this) }, e.prototype.onShow = function() {}, e.prototype.createChildren = function() { t.prototype.createChildren.call(this), this.commonPanel.setPanelWidth(640), this.commonPanel.setPanelHeight(840), this.commonPanel.setTitleIcon(""), this.commonPanel.setTitle("chengjiu_title_png"), game.UIUtils.addButtonScaleEffects(this) }, e.prototype.childrenCreated = function() { t.prototype.childrenCreated.call(this), this.scrolls.viewport = this.list, this.list.itemRenderer = ChengjiuItem, this.initTab() }, e.prototype.updata = function(t) { var e = this; void 0 === t && (t = !0), ChengjiuManager.getInstance().sorts(); var i = this.scrolls.viewport.scrollV; switch (this.tab.selectIndex) { case 0: var n; n = ChengjiuManager.getInstance().TaskArr, this.list.dataProvider = new eui.ArrayCollection(n); break; case 1: var a; a = ChengjiuManager.getInstance().chengjiuArr, this.list.dataProvider = new eui.ArrayCollection(a) } t && egret.callLater(function() { e.scrolls.validateNow(), e.scrolls.viewport.scrollV = i }, this) }, e.prototype.initTab = function() { var t = ["日常任务", "系统成就"]; this.tab = new game.Tab(t, this.onTabItemClickCallback.bind(this)), this.tab.bottom = 0, this.groupbar.addChild(this.tab), GuideManager.getInsatance().isShowGuide && 9 == GuideManager.getInsatance().target && 0 == GuideManager.getInsatance().step && (this.validateNow(), GuideManager.getInsatance().des = TextConst.textObj[39], GuideManager.getInsatance().show(this.tab.getChildAt(1), !1, 226, 167)) }, e.prototype.onTabItemClickCallback = function(t) { this.updata(!1) }, e.prototype.btnCloseTouchEnded = function() { game.AppFacade.getInstance().sendNotification(PanelNotify.CLOSE_CHENGJIU) }, e } (game.BasePanel); __reflect(ChengjiuPanel.prototype, "ChengjiuPanel"); var game; ! function(t) { var e = function(e) { function i() { return e.call(this, "DogMediator") || this } return __extends(i, e), i.prototype.listNotificationInterests = function() { return [PanelNotify.OPEN_DOG, PanelNotify.CLOSE_DOG] }, i.prototype.onRegister = function() { e.prototype.onRegister.call(this) }, i.prototype.showViewComponent = function(e) { var that=this; Global.netProxy.sendRequest(GameConfig.SERVER_PATH + "store/hasdog", {}, function(n) { 0 == n.status ? (void 0 === e && (e = 7),that.viewComponent = new t.DogPanel,that.showUI(that.viewComponent, !0, 0, 0, e)) : TipsUtils.showErrorCodeTips(n.status) }) }, i.prototype.handleNotification = function(t) { t.getBody(); switch (t.getName()) { case PanelNotify.OPEN_DOG: this.showViewComponent(7); break; case PanelNotify.CLOSE_DOG: this.closeViewComponent(1) } }, i.NAME = "DogMediator", i } (BaseMediator); t.DogMediator = e, __reflect(e.prototype, "game.DogMediator") } (game || (game = {})); var game; ! function(t) { var e = function(e) { function i() { var t = e.call(this) || this; return t.isFullScreen = !0, t.isVisibleAnimate = !0, t.skinName = new DogSkin, t } return __extends(i, e), i.prototype.onAdded = function() { e.prototype.onAdded.call(this), this.btnFood.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTab, this), this.addEventListener(egret.Event.ENTER_FRAME, this.enterFrame, this) }, i.prototype.onRemoved = function() { e.prototype.onRemoved.call(this), this.btnFood.removeEventListener(egret.TouchEvent.TOUCH_TAP, this.onTab, this), this.removeEventListener(egret.Event.ENTER_FRAME, this.enterFrame, this) }, i.prototype.onTab = function(e) { t.AppFacade.instance.sendNotification(PanelNotify.OPEN_DOGTIPS) }, i.prototype.createChildren = function() { e.prototype.createChildren.call(this), this.commonPanel.setPanelWidth(640), this.commonPanel.setPanelHeight(450), this.commonPanel.setTitle("panel_title_dog_png") }, i.prototype.childrenCreated = function() { e.prototype.childrenCreated.call(this), this.dogIcon.source = "6002_png" }, i.prototype.upData = function() { var e = Global.playerProxy.playerData.dog_hunger_end_time - DateTimer.instance.now; e > 0 ? this.petPowerNameDes.text = "" + t.Utils.showTimeFormat(1e3 * e) : this.petPowerNameDes.text = "狗狗处于饥饿状态" }, i.prototype.enterFrame = function() { this.upData() }, i.prototype.btnCloseTouchEnded = function() { t.AppFacade.getInstance().sendNotification(PanelNotify.CLOSE_DOG) }, i } (t.BasePanel); t.DogPanel = e, __reflect(e.prototype, "game.DogPanel") } (game || (game = {})); var DogTips = function(t) { function e() { var e = t.call(this) || this; return e.configArr = [103005, 103006, 103007], e.skinName = DogSelectFoodSkin, e.addEventListener(egret.Event.REMOVED_FROM_STAGE, e.onRemoeved, e), e.addEventListener(egret.Event.ADDED_TO_STAGE, e.onAdded, e), e } return __extends(e, t), e.prototype.childrenCreated = function() { t.prototype.childrenCreated.call(this), this.updata() }, e.prototype.updata = function() { for (var t = 0; 3 > t; t++) { var e = Global.gameProxy.getItemConfig(this.configArr[t]); this["headImg" + t].source = e.graphical_id + "_png", this["nameLabel" + t].text = e.name; var i = BattlePetManager.getInstance().getFeed(e.id); i ? this["numLabel" + t].text = "X" + i.number: this["numLabel" + t].text = "X0" } }, e.prototype.onRemoeved = function() { game.UIUtils.removeButtonScaleEffects(this), this.btnClose.removeEventListener(egret.TouchEvent.TOUCH_TAP, this.onClose, this), this.btnEat.removeEventListener(egret.TouchEvent.TOUCH_TAP, this.onClose, this), game.EventManager.instance.removeEvent(SysNotify.DOG_UPDAT, this.updata, this), this.groupFood0.removeEventListener(egret.TouchEvent.TOUCH_TAP, this.onSelected, this), this.groupFood1.removeEventListener(egret.TouchEvent.TOUCH_TAP, this.onSelected, this), this.groupFood2.removeEventListener(egret.TouchEvent.TOUCH_TAP, this.onSelected, this) }, e.prototype.onAdded = function() { game.UIUtils.addButtonScaleEffects(this), this.btnClose.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onClose, this), this.btnEat.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onClose, this), game.EventManager.instance.addEvent(SysNotify.DOG_UPDAT, this.updata, this), this.groupFood0.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onSelected, this), this.groupFood1.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onSelected, this), this.groupFood2.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onSelected, this) }, e.prototype.onSelected = function(t) { t.currentTarget == this.groupFood0 ? BattlePetManager.getInstance().feedItemID = 103005 : t.currentTarget == this.groupFood1 ? BattlePetManager.getInstance().feedItemID = 103006 : t.currentTarget == this.groupFood2 && (BattlePetManager.getInstance().feedItemID = 103007), BattlePetManager.getInstance().sendNetFeend() }, e.prototype.onClose = function() { game.AppFacade.instance.sendNotification(PanelNotify.CLOSE_DOGTIPS) }, e.prototype.onEat = function() { game.AppFacade.instance.sendNotification(PanelNotify.CLOSE_DOGTIPS) }, e } (eui.Component); __reflect(DogTips.prototype, "DogTips"); var DogTipsMediter = function(t) { function e() { return t.call(this, "DogTipsMediter") || this } return __extends(e, t), e.prototype.listNotificationInterests = function() { return [PanelNotify.OPEN_DOGTIPS, PanelNotify.CLOSE_DOGTIPS] }, e.prototype.onRegister = function() { t.prototype.onRegister.call(this) }, e.prototype.showViewComponent = function(t) { void 0 === t && (t = 7), this.viewComponent = new DogTips, this.showUI(this.viewComponent, !0, 0, 0, t) }, e.prototype.handleNotification = function(t) { t.getBody(); switch (t.getName()) { case PanelNotify.OPEN_DOGTIPS: this.showViewComponent(1); break; case PanelNotify.CLOSE_DOGTIPS: this.closeViewComponent(1) } }, e.NAME = "DogTipsMediter", e } (BaseMediator); __reflect(DogTipsMediter.prototype, "DogTipsMediter"); var game; ! function(t) { var e = function(e) { function i() { var t = e.call(this) || this; return t.isFullScreen = !0, t.skinName = new ExGoldSkin, t } return __extends(i, e), i.prototype.createChildren = function() { e.prototype.createChildren.call(this); var t = Global.gameProxy.getTabelConfigByType("common")[17]; this.inpDiamond.text = t.min, this.labelGold.text = "1", this.commonConfig = t, this.tipsLabel.text = "金币兑换钻石比例: " + t.min + ": 1", this.inpDiamond.addEventListener(egret.Event.FOCUS_OUT, this.onInpChange, this) }, i.prototype.onInpChange = function() { var t = parseInt(this.inpDiamond.text); (!this.inpDiamond.text || parseInt(this.inpDiamond.text) < this.commonConfig.min) && (t = this.commonConfig.min), this.inpDiamond.text = t + "", this.labelGold.text = t / this.commonConfig.min + "" }, i.prototype.btnCloseTouchEnded = function() { t.AppFacade.getInstance().sendNotification(PanelNotify.CLOSE_EXGOLD) }, i.prototype.onTouchTap = function(t) { switch (e.prototype.onTouchTap.call(this, t), t.target) { case this.btnEx: this.exGold() } }, i.prototype.exGold = function() { var e = this, i = parseInt(this.inpDiamond.text); if (i < this.commonConfig.min) return void PopUpManager.popTip("最少兑换的金币:" + this.commonConfig.min); if (i > Global.playerProxy.playerData.gold) return void PopUpManager.popTip("金币不足"); var n = "是否花费" + i + "金币兑换" + i / this.commonConfig.min + "钻石"; Global.alertMediator.addAlert(n, function() { var n = GameConfig.SERVER_PATH + "user/gold-exchange-gem"; Global.netProxy.sendRequest(n, { gold: i }, function(n) { 0 == n.status ? (PopUpManager.popTip("兑换成功!"), Global.playerProxy.playerData.gold -= i, Global.playerProxy.playerData.gem += i / e.commonConfig.min, t.EventManager.instance.dispatch(SysNotify.TOPLAYER_INFO_UPDATE)) : TipsUtils.showErrorCodeTips(n.status) }) }) }, i } (t.BasePanel); t.ExGoldPanel = e, __reflect(e.prototype, "game.ExGoldPanel") } (game || (game = {})); var game; ! function(t) { var e = function(e) { function i() { var t = e.call(this) || this; return t.isFullScreen = !0, t.isVisibleAnimate = !0, t.skinName = new FriendAddSkin, t } return __extends(i, e), i.prototype.createChildren = function() { e.prototype.createChildren.call(this), this.labelName.text = "", this.labelLv.text = "", this.labelMoney.text = "", this.btnHome.visible = !1 }, i.prototype.onTouchTap = function(t) { e.prototype.onTouchTap.call(this, t); var i = t.target; switch (i) { case this.btnSearch: this.searchUser(); break; case this.btnAdd: this.goOtherFarm() } }, i.prototype.btnCloseTouchEnded = function() { t.AppFacade.getInstance().sendNotification(PanelNotify.CLOSE_FRIEND_ADD) }, i.prototype.goOtherFarm = function() { var t = Global.playerProxy.playerData; this.friendData ? this.friendData.uid == t.id ? PopUpManager.popTip("不能自己添加自己") : this.mediator.addFriend(this.friendData.uid) : PopUpManager.popTip("请确认目标存在") }, i.prototype.searchUser = function() { var e = this, i = parseInt(this.inpID.text); if (!i) return void PopUpManager.popTip("请输入正确的ID"); this.friendData = null; var n = GameConfig.SERVER_PATH + "friend/find"; Global.netProxy.sendRequest(n, { find_phone: i }, function(i) { 0 == i.status ? (e.friendData = new t.FriendData(i.data), e.labelName.text = e.friendData.name, e.labelLv.text = e.friendData.lv + "", e.labelMoney.text = e.friendData.gold + "", e.btnHome.visible = !0) : (e.labelName.text = "", e.labelLv.text = "", e.labelMoney.text = "", e.btnHome.visible = !1, PopUpManager.popTip("查无此人")) }) }, i } (t.BasePanel); t.FriendAddPanel = e, __reflect(e.prototype, "game.FriendAddPanel") } (game || (game = {})); var game; ! function(t) { var e = function(e) { function i() { var t = e.call(this) || this; return t.reqArr = [], t.pageIndex = 1, t.pageMax = 1, t.pageEveNum = 6, t.isFullScreen = !0, t.isVisibleAnimate = !0, t.skinName = new FriendReqSkin, t } return __extends(i, e), i.prototype.onAdded = function() { e.prototype.onAdded.call(this), t.EventManager.instance.addEvent(SysNotify.FRIEND_DEAL_OVER, this.dealApplyOver, this) }, i.prototype.onRemoved = function() { e.prototype.onRemoved.call(this), t.EventManager.instance.removeEvent(SysNotify.FRIEND_DEAL_OVER, this.dealApplyOver, this) }, i.prototype.createChildren = function() { e.prototype.createChildren.call(this), this.initList() }, i.prototype.initList = function() { this.list.dataProvider = null, this.list.itemRenderer = t.FriendReqItemRender, this.updateListPage(1) }, i.prototype.onTouchTap = function(t) { e.prototype.onTouchTap.call(this, t); var i = t.target; switch (i) { case this.btnOneKeyOk: this.pass(); break; case this.btnOneKeyNo: this.reject(); break; case this.btnPrev: this.changePage( - 1); break; case this.btnNext: this.changePage(1) } }, i.prototype.pass = function() { if (this.reqArr.length > 0) { this.reqArr.shift(); this.mediator.applyAllReq(1, this.pass.bind(this)) } }, i.prototype.reject = function() { if (this.reqArr.length > 0) { this.reqArr.shift(); this.mediator.applyAllReq(2, this.reject.bind(this)) } }, i.prototype.btnCloseTouchEnded = function() { t.AppFacade.getInstance().sendNotification(PanelNotify.CLOSE_FRIEND_ADD_REQ) }, i.prototype.changePage = function(t, e) { if (void 0 === e && (e = !1), e) this.pageIndex = t; else { if (this.pageIndex <= 1 && 0 > t) return; if (this.pageIndex >= this.pageMax && t > 0) return; this.pageIndex += t } this.labelPage.text = this.pageIndex + "/" + this.pageMax, this.updateListPage(this.pageIndex) }, i.prototype.updateListPage = function(t) { var e = (t - 1) * this.pageEveNum; this.mediator.applyList(e, this.pageEveNum, this.onListData.bind(this)) }, i.prototype.onListData = function(e) { this.pageMax = Math.ceil(e.total_count / this.pageEveNum) || 1, this.reqArr = []; for (var i = e.list || [], n = 0; n < i.length; n++) this.reqArr.push(new t.FriendData(i[n])); this.labelPage.text = this.pageIndex + "/" + this.pageMax, this.list.dataProvider = new eui.ArrayCollection(this.reqArr) }, i.prototype.dealApplyOver = function(t) { var e = t.data, i = this.reqArr.indexOf(e); i > -1 && (this.reqArr.splice(i, 1), 0 != this.reqArr.length ? this.list.dataProvider = new eui.ArrayCollection(this.reqArr) : this.updateListPage(this.pageIndex)) }, i } (t.BasePanel); t.FriendAddReqPanel = e, __reflect(e.prototype, "game.FriendAddReqPanel") } (game || (game = {})); var game; ! function(t) { var e = function(e) { function i(t) { var i = e.call(this) || this; return i.listData = t, i.isFullScreen = !0, i.isVisibleAnimate = !0, i.skinName = new FriendGiveListSkin, i } return __extends(i, e), i.prototype.createChildren = function() { e.prototype.createChildren.call(this), this.list.dataProvider = null, this.list.itemRenderer = t.FriendGiveListItemRender; var i = "编号:" + this.listData.deal_id + " " + this.listData.from_user_nickname + " 给 " + this.listData.be_user_nickname + " 的转赠"; this.labelName.text = i, this.initList() }, i.prototype.initList = function() { var t = []; if (0 === this.listData.type) { var e = { num: this.listData.data.gold, item_id: -3 }; t.push(e) } else t = this.listData.data.item_list; this.list.dataProvider = new eui.ArrayCollection(t) }, i.prototype.onTouchTap = function(t) { switch (t.stopPropagation(), t.target) { case this.enterBtn: this.enterBtnTouch() } }, i.prototype.enterBtnTouch = function() { var e = GameConfig.SERVER_PATH + "deal/deal-confirm", i = { deal_id: this.listData.deal_id }; t.SurePasswordPanel.instance.show(e, i, function(e) { 0 == e.status ? (this.btnCloseTouchEnded(), t.EventManager.instance.dispatch(SysNotify.FLUSH_GROUP3), PopUpManager.popTip("已确认,等待对方确定"), t.AppFacade.getInstance().sendNotification(PanelNotify.CLOSE_FRIEND_GIVE_LIST)) : TipsUtils.showErrorCodeTips(e.status) }) }, i.prototype.btnCloseTouchEnded = function() { t.AppFacade.getInstance().sendNotification(PanelNotify.CLOSE_FRIEND_GIVE_LIST) }, i } (t.BasePanel); t.FriendGiveListPanel = e, __reflect(e.prototype, "game.FriendGiveListPanel") } (game || (game = {})); var game; ! function(t) { var e = function(e) { function i() { var t = e.call(this) || this; return t.type = 0, t.pageIndex = 1, t.pageMax = 1, t.pageEveNum = 10, t.isFullScreen = !0, t.isVisibleAnimate = !0, t.skinName = new FriendGiveSkin, t } return __extends(i, e), i.prototype.createChildren = function() { e.prototype.createChildren.call(this), this.commonPanel.setPanelWidth(620), this.commonPanel.setPanelHeight(810), this.commonPanel.setTitleIcon("give_icon_png"), this.commonPanel.setTitle("give_title_png"), this.commonPanel.groupHelp.visible = !1, this.commonPanel.btnClose.label = "转赠", this.commonPanel.closeBtn.visible = !0, this.list.itemRenderer = t.FriendGiveItemRender, this.list.dataProvider = null, this.noList.itemRenderer = t.FriendGiveNoComRender, this.noList.dataProvider = null, this.initTab() }, i.prototype.onAdded = function() { e.prototype.onAdded.call(this), t.EventManager.instance.addEvent(SysNotify.FLUSH_GROUP3, this.updateGroup3, this) }, i.prototype.onRemoved = function() { e.prototype.onRemoved.call(this), t.EventManager.instance.removeEvent(SysNotify.FLUSH_GROUP3, this.updateGroup3, this) }, i.prototype.closeBtnTouchEnded = function() { t.AppFacade.getInstance().sendNotification(PanelNotify.CLOSE_FRIEND_GIVE) }, i.prototype.btnCloseTouchEnded = function() { 0 === this.type ? this.sendGold() : 1 === this.type ? this.sendFriut() : this.closeBtnTouchEnded() }, i.prototype.sendFriut = function() { if (RegUtils.isNull(this.fruitIdEt.text)) return void PopUpManager.popTip("请输入交易人ID"); for (var e = [], i = 0; i < this.list.numChildren; i++) { var n = this.list.$children[i]; if (n.exNum > 0) { var a = { num: 100 * n.exNum, item_id: n.data.config.id }; e.push(a) } } if (e.length < 1) return void PopUpManager.popTip("没有转增的果实"); var o = { be_user_id: this.fruitIdEt.text, type: 1, gold: 0, item_list: e }, s = GameConfig.SERVER_PATH + "deal/deal"; t.SurePasswordPanel.instance.show(s, o, function(i) { 0 !== i.status ? TipsUtils.showErrorCodeTips(i.status) : (PopUpManager.popTip("已发起交易"), e.forEach(function(t) { Global.playerProxy.sellWareHouseItem({ id: t.item_id }, t.num) }), t.EventManager.instance.dispatch(SysNotify.TOPLAYER_INFO_UPDATE), t.AppFacade.getInstance().sendNotification(PanelNotify.CLOSE_FRIEND_GIVE)) }) }, i.prototype.onTouchTap = function(t) { e.prototype.onTouchTap.call(this, t); var i = t.target; switch (i) { case this.btnPrev: this.changePage( - 1); break; case this.btnNext: this.changePage(1); break; case this.sendBtn: this.searchPlayer() } }, i.prototype.searchPlayer = function() { var t = this, e = this.goldIdEt.text.trim(); if (RegUtils.isNull(e)) return void PopUpManager.popTip("请输入交易人ID,后查询"); var i = GameConfig.SERVER_PATH + "user/get-wx-name"; Global.netProxy.sendRequest(i, { be_user_id: e }, function(e) { 0 == e.status ? t.nameLabel.text = e.data.wx_name: (t.nameLabel.text = "", PopUpManager.popTip("查无此人")) }) }, i.prototype.sendGold = function() { if (RegUtils.isNull(this.goldIdEt.text)) return void PopUpManager.popTip("请输入交易人ID"); if (parseInt(this.goldEt.text) <= 0) return void PopUpManager.popTip("金额不能小于0"); var e = GameConfig.SERVER_PATH + "deal/deal", i = { be_user_id: this.goldIdEt.text, type: 0, gold: parseInt(this.goldEt.text), item_list: [] }; t.SurePasswordPanel.instance.show(e, i, function(e) { 0 !== e.status ? TipsUtils.showErrorCodeTips(e.status) : (PopUpManager.popTip("已发起交易"), Global.playerProxy.playerData.gold -= i.gold, t.EventManager.instance.dispatch(SysNotify.TOPLAYER_INFO_UPDATE)) }) }, i.prototype.initTab = function() { var e = ["金币转赠", "果实转赠", "未完成的转赠"]; this.tab = new t.Tab(e, this.onTabItemClickCallback.bind(this)), this.tab.bottom = 0, this.groupTab.addChild(this.tab) }, i.prototype.updateGroup3 = function() { 2 == this.type && this.onTabItemClickCallback(2) }, i.prototype.onTabItemClickCallback = function(t) { if (this.btnClose.visible = !0, 0 == t) return this.type = 0, this.goldGroup.visible = !0, this.fruitGroup.visible = !1, void(this.noComGroup.visible = !1); if (1 == t) { this.type = 1, this.noComGroup.visible = !1, this.goldGroup.visible = !1, this.fruitGroup.visible = !0; var e = Global.playerProxy.getItemByType(ItemType.FRUIT); this.list.dataProvider = new eui.ArrayCollection(e) } else this.type = 2, this.noComGroup.visible = !0, this.goldGroup.visible = !1, this.fruitGroup.visible = !1, this.changePage(this.pageIndex, !0), this.btnClose.visible = !1 }, i.prototype.changePage = function(t, e) { if (void 0 === e && (e = !1), e) this.pageIndex = t; else { if (this.pageIndex <= 1 && 0 > t) return; if (this.pageIndex >= this.pageMax && t > 0) return; this.pageIndex += t } this.labelPage.text = this.pageIndex + "/" + this.pageMax, this.updateListPage(this.pageIndex) }, i.prototype.updateListPage = function(t) { var e = GameConfig.SERVER_PATH + "deal/get-list", i = { offset: (this.pageIndex - 1) * this.pageEveNum, count: this.pageEveNum }; Global.netProxy.sendRequest(e, i, this.onListData.bind(this)) }, i.prototype.onListData = function(e) { var i = e.data; this.pageMax = t.Utils.limit(Math.ceil(i.total_count / 10), 1, 10), this.labelPage.text = this.pageIndex + "/" + this.pageMax, this.noList.dataProvider = new eui.ArrayCollection(i.list) }, i } (t.BasePanel); t.FriendGivePanel = e, __reflect(e.prototype, "game.FriendGivePanel") } (game || (game = {})); var game; ! function(t) { var e = function(e) { function i(t) { void 0 === t && (t = 0); var i = e.call(this) || this; return i.pageIndex = 1, i.pageMax = 1, i.pageEveNum = 7, i.showType = 1, i.rankType = 0, i.startIndex = 0, i.startIndex = t, i.isFullScreen = !0, i.isVisibleAnimate = !0, i.skinName = new FriendSkin, i } return __extends(i, e), i.prototype.onScrollerTouchBegan = function(t) { this.scrollerTouchStart = t.stageX, this.stage.once(egret.TouchEvent.TOUCH_END, this.onScrollerTouchEnded, this, !0, Number.MAX_VALUE) }, i.prototype.onScrollerTouchEnded = function(t) { var e = t.stageX - this.scrollerTouchStart; e > 150 ? this.changePage( - 1) : -150 > e && this.changePage(1) }, i.prototype.createChildren = function() { e.prototype.createChildren.call(this), this.commonPanel.setPanelWidth(594), this.commonPanel.setPanelHeight(862), this.commonPanel.setTitleIcon("panel_icon_friend_png"), this.commonPanel.setTitle("panel_title_friend_png"), this.initList(), this.initTab(), this.changeType(1), t.EventManager.instance.addEvent(SysNotify.FRIEND_REFRESH, this.onFriendNeedRefresh, this) }, i.prototype.onFriendNeedRefresh = function() { this.changePage(this.pageIndex, !0) }, i.prototype.initList = function() { this.list.dataProvider = null, this.list.itemRenderer = t.FriendItemRender, this.scroller.addEventListener(egret.TouchEvent.TOUCH_BEGIN, this.onScrollerTouchBegan, this) }, i.prototype.btnCloseTouchEnded = function() { t.AppFacade.getInstance().sendNotification(PanelNotify.CLOSE_FRIEND) }, i.prototype.onTouchTap = function(i) { e.prototype.onTouchTap.call(this, i); var n = i.target; switch (n) { case this.btnPrev: this.changePage( - 1); break; case this.btnNext: this.changePage(1); break; case this.btnAdd: t.AppFacade.getInstance().sendNotification(PanelNotify.OPEN_FRIEND_ADD); break; case this.btnReq: t.AppFacade.getInstance().sendNotification(PanelNotify.OPEN_FRIEND_ADD_REQ); break; case this.btnLv: this.changeType(1); break; case this.btnGold: this.changeType(0); break; case this.btnPower: this.changeType(2) } }, i.prototype.initTab = function() { var e = ["全国排名", "好友排名"]; 1 == this.startIndex && (e = ["好友排名", "全国排名"]), this.tab = new t.Tab(e, this.onTabItemClickCallback.bind(this)), this.tab.setItemBaseHeight(50), this.tab.bottom = 0, this.groupTab.addChild(this.tab) }, i.prototype.onTabItemClickCallback = function(t) { 1 == this.startIndex ? 0 == t ? this.rankType = 1 : this.rankType = 0 : this.rankType = t, this.changePage(1, !0) }, i.prototype.changePage = function(t, e) { if (void 0 === e && (e = !1), e) this.pageIndex = t; else { if (this.pageIndex <= 1 && 0 > t) return; if (this.pageIndex >= this.pageMax && t > 0) return; this.pageIndex += t } this.labelPage.text = this.pageIndex + "/" + this.pageMax, this.updateListPage(this.pageIndex) }, i.prototype.updateListPage = function(t) { 0 == this.rankType ? this.mediator.getRankList(this.showType, t - 1, this.pageEveNum, this.onListData.bind(this)) : this.mediator.getFriendList(this.showType, t - 1, this.pageEveNum, this.onListData.bind(this)) }, i.prototype.onListData = function(e) { this.pageMax = Math.ceil(e.total_count / this.pageEveNum) || 1, this.reqArr = []; for (var i = e.list || [], n = 0; n < i.length; n++) { var a = new t.FriendData(i[n]); a.rank = (this.pageIndex - 1) * this.pageEveNum + n + 1, this.reqArr.push(a) } this.labelPage.text = this.pageIndex + "/" + this.pageMax, this.list.dataProvider = new eui.ArrayCollection(this.reqArr) }, i.prototype.changeType = function(t) { var e = ["财富", "等级", "战力"]; this.showType = t, this.labelTitleLv.text = e[t], Const.RANK_SHOW_TYPE = t, this.changePage(1, !0) }, i } (t.BasePanel); t.FriendPanel = e, __reflect(e.prototype, "game.FriendPanel") } (game || (game = {})); var FulibaoTipsMediter = function(t) { function e() { return t.call(this, "FulibaoTipsMediter") || this } return __extends(e, t), e.prototype.listNotificationInterests = function() { return [PanelNotify.OPEN_FULI_GET, PanelNotify.CLOSE_FULI_GET] }, e.prototype.onRegister = function() { t.prototype.onRegister.call(this) }, e.prototype.showViewComponent = function(t) { void 0 === t && (t = 7), this.viewComponent = new FuliLibaoTips, this.showUI(this.viewComponent, !0, 0, 0, t) }, e.prototype.handleNotification = function(t) { t.getBody(); switch (t.getName()) { case PanelNotify.OPEN_FULI_GET: this.showViewComponent(6); break; case PanelNotify.CLOSE_FULI_GET: this.closeViewComponent(6) } }, e.NAME = "FulibaoTipsMediter", e } (BaseMediator); __reflect(FulibaoTipsMediter.prototype, "FulibaoTipsMediter"); var FuliItem1 = function(t) { function e() { return t.call(this) || this } return __extends(e, t), e.prototype.childrenCreated = function() { t.prototype.childrenCreated.call(this) }, e } (eui.Component); __reflect(FuliItem1.prototype, "FuliItem1"); var FuliItem2 = function(t) { function e() { var e = t.call(this) || this; return e.pageIndex = 0, e.pageNum = 14, e } return __extends(e, t), e.prototype.childrenCreated = function() { t.prototype.childrenCreated.call(this), this.scrolls.viewport = this.g1, this.payButton.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onPay, this), this.buyButton.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onLingqu, this), this.leftButton.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onLeft, this), this.rightButton.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onRight, this), this.pageIndex = Global.playerProxy.playerData.vip - 1 >= 0 ? Global.playerProxy.playerData.vip - 1 : 0, this.updata() }, e.prototype.onPay = function(t) { game.AppFacade.getInstance().sendNotification(PanelNotify.OPEN_PAY), game.AppFacade.getInstance().sendNotification(PanelNotify.CLOSE_FULI) }, e.prototype.onLingqu = function(t) { 0 == FuliMannager.getInstance().fuliData.is_get_fix_gift || 0 == FuliMannager.getInstance().fuliData.is_get_week_gift ? (game.AppFacade.getInstance().sendNotification(PanelNotify.OPEN_FULI_GET), game.AppFacade.getInstance().sendNotification(PanelNotify.CLOSE_FULI)) : TipsUtils.showTipsDownToUp("您已领取礼包") }, e.prototype.onLeft = function(t) { this.pageIndex > 0 && this.pageIndex--, this.updataTextfiledGroup(this.pageIndex + 1) }, e.prototype.onRight = function(t) { this.pageIndex < this.pageNum && this.pageIndex++, this.updataTextfiledGroup(this.pageIndex + 1) }, e.prototype.updata = function() { var t = Global.playerProxy.playerData.vip, e = t + 1; e > 15 && (e = 15); var i = Global.gameProxy.getVipConfigForID(e), n = FuliMannager.getInstance().fuliData; this.vipLabel.text = "VIP " + t, this.gs.visible = !0, this.imgNoVip.visible = !1, 0 == t ? (this.payGemLabel1.text = "1", this.buyButton.enabled = !1) : (this.payGemLabel1.text = t + "", 0 == FuliMannager.getInstance().fuliData.is_get_fix_gift || 0 == FuliMannager.getInstance().fuliData.is_get_week_gift ? (this.buyButton.enabled = !0, this.buyButton.label = "领取") : (this.buyButton.enabled = !1, this.buyButton.label = "已领取")); var a = i.recharge_amount - n.exp; this.prossBar.setPross(n.exp, i.recharge_amount), this.gemLabel.text = a.toString(), this.vipLabel3.text = e.toString(), this.updataTextfiledGroup(this.pageIndex + 1) }, e.prototype.updataTextfiledGroup = function(t) { var e = Global.gameProxy.getVipConfigForID(t); this.vipLabel1.text = e.id + "", this.vipLabel2.text = e.id + "", this.payGemLabel.text = e.recharge_amount, this.gt.removeChildren(); for (var i = 0; i < FuliMannager.getInstance().indexArr[t - 1]; i++) { var n = new FuliTextFieldItem; this.gt.addChild(n), n.y = n.height * i, n.strLabel.text = FuliMannager.getInstance().strArr[i] + " " + e[FuliMannager.getInstance().strkeyArr[i]] } }, e } (eui.Component); __reflect(FuliItem2.prototype, "FuliItem2"); var FulilibaoItem = function(t) { function e() { return t.call(this) || this } return __extends(e, t), e.prototype.partAdded = function(e, i) { t.prototype.partAdded.call(this, e, i) }, e.prototype.childrenCreated = function() { t.prototype.childrenCreated.call(this) }, e } (eui.Component); __reflect(FulilibaoItem.prototype, "FulilibaoItem"); var FuliLibaoTips = function(t) { function e() { var e = t.call(this) || this; return e.itemARR = [], e.skinName = FuliLibaoPanelSkin, e } return __extends(e, t), e.getInstance = function() { return this._instance || (this._instance = new e), this._instance }, e.prototype.childrenCreated = function() { this.itemARR.push(this.item0), this.itemARR.push(this.item1), this.itemARR.push(this.item2), this.LingquButton.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onLingqu, this), this.btnClose.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onBtnClose, this), this.updata(), game.UIUtils.addButtonScaleEffects(this) }, e.prototype.onLingqu = function(t) { FuliMannager.getInstance().sendNetGetAward() }, e.prototype.onBtnClose = function(t) { game.AppFacade.getInstance().sendNotification(PanelNotify.CLOSE_FULI_GET) }, e.prototype.updata = function() { this.icons.source = "", this.numLabel.text = ""; for (var t = 0; t < this.itemARR.length; t++) this.itemARR[t].imgicon.source = "", this.itemARR[t].numLabel.text = "", this.itemARR[t].nameLabel.text = ""; var e = FuliMannager.getInstance().fuliData, i = Global.playerProxy.playerData.vip; this.vipLabel.text = "VIP" + i; var n = Global.gameProxy.getVipConfigForID(i), a = (e.is_get_fix_gift, e.is_get_week_gift, n.fixed_reward_id), o = a.split(":"), s = Global.gameProxy.getItemImageId(o[0]); this.icons.source = s + "_png", this.numLabel.text = o[1]; var t = 0; for (var r in n) if ("cycle_bonus_id1" == r || "cycle_bonus_id2" == r || "cycle_bonus_id3" == r) { var h = n[r], l = h.split(":"); if ("0" != l[1]) { var c = Global.gameProxy.getItemImageId(l[0]); this.itemARR[t].imgicon.source = c + "_png", this.itemARR[t].numLabel.text = l[1], this.itemARR[t].nameLabel.text = Global.gameProxy.getItemConfig(l[0]).name, t++ } } }, e } (eui.Component); __reflect(FuliLibaoTips.prototype, "FuliLibaoTips"); var FuliMannager = function(t) { function e() { var e = t.call(this) || this; return e.zyData = [], e.strkeyArr = ["arena", "playground_frequency", "turntable_frequency"], e.strArr = ["每天可挑战玩家次数增加", "游乐场免费进入次数", "大转盘免费抽取次数"], e.indexArr = [0, 1, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3], e.zhoukaArr = [150, 150, 7, 15], e.yuekaArr = [300, 150, 30, 30], e } return __extends(e, t), e.getInstance = function() { return this._instance || (this._instance = new e), this._instance }, e.prototype.getIndexForTime = function(t) { for (var e, i = new Date(1e3 * t), n = i.getFullYear(), a = i.getMonth(), e = i.getDate(), o = 0; a > o; o++) e += this.getMonthDays(n, o); return e }, e.prototype.isLeapYear = function(t) { return t % 400 == 0 || t % 4 == 0 && t % 100 != 0 }, e.prototype.getMonthDays = function(t, e) { return [31, null, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31][e] || (this.isLeapYear(t) ? 29 : 28) }, e.prototype.sendNetGetAward = function() { Global.netProxy.sendRequest(GameConfig.SERVER_PATH + "comm/get-vip-gift", {}, this.onSendNetJiagong.bind(this)) }, e.prototype.getisZY = function(t) { for (var e = 0; e < this.zyData.length; e++) if (this.zyData[e].item_id == t) return this.zyData[e]; return null }, e.prototype.onSendNetJiagong = function(t) { if (0 === t.status) { var e = Global.playerProxy.playerData.vip, i = Global.gameProxy.getVipConfigForID(e), n = []; if (0 == this.fuliData.is_get_fix_gift) { var a = i.fixed_reward_id; Global.playerProxy.addItem1(a), this.fuliData.is_get_fix_gift = 1 } if (0 == this.fuliData.is_get_week_gift) { var a = ""; for (var o in i)("cycle_bonus_id1" == o || "cycle_bonus_id1" == o || "cycle_bonus_id1" == o) && (a = i[o] + ","); Global.playerProxy.addItem1(a), this.fuliData.is_get_fix_gift = 1 } var s = 0; core.TimerManager.instance.addTick(100, n.length, function() { TipsUtils.showTipsDownToUp(n[s]), s++ }, this), game.EventManager.instance.dispatch(SysNotify.TOPLAYER_INFO_UPDATE), game.EventManager.instance.dispatch(SysNotify.GETVIPREWARD_UPDATA) } else TipsUtils.showTipsDownToUp(GameConfig.ServerCode[t.status]) }, e.prototype.sendNetzyGetAward = function() { Global.netProxy.sendRequest(GameConfig.SERVER_PATH + "comm/get-card-gift", { item_id: this.curid }, this.onSendNetzy.bind(this)) }, e.prototype.onSendNetzy = function(t) { if (0 == t.status) { var e = Global.gameProxy.getzyConfigForID(this.curid), i = e.diamonds_day_id.split(":"), n = Global.gameProxy.getItemConfig(i[0]); Global.playerProxy.playerData.gem += i[1], TipsUtils.showTipsDownToUp("获得" + n.nameX + i[1]) } }, e } (egret.EventDispatcher); __reflect(FuliMannager.prototype, "FuliMannager"); var FuliMediter = function(t) { function e() { return t.call(this, "FuliMediter") || this } return __extends(e, t), e.prototype.listNotificationInterests = function() { return [PanelNotify.OPEN_FULI, PanelNotify.CLOSE_FULI] }, e.prototype.onRegister = function() { t.prototype.onRegister.call(this) }, e.prototype.showViewComponent = function(t) { void 0 === t && (t = 7), this.viewComponent = new FuliPanel, this.showUI(this.viewComponent, !0, 0, 0, t) }, e.prototype.handleNotification = function(t) { t.getBody(); switch (t.getName()) { case PanelNotify.OPEN_FULI: Global.netProxy.sendRequest(GameConfig.SERVER_PATH + "comm/get-vip", {}, this.onGetVip.bind(this)); break; case PanelNotify.CLOSE_FULI: this.closeViewComponent(10) } }, e.prototype.onGetVip = function(t) { 0 == t.status && (FuliMannager.getInstance().fuliData = t.data, Global.playerProxy.playerData.vip = t.data.level, game.EventManager.instance.dispatch(SysNotify.TOPLAYER_INFO_UPDATE), 0 == Global.playerProxy.playerData.vip ? Global.netProxy.sendRequest(GameConfig.SERVER_PATH + "comm/get-card", {}, this.onGetZhouAndYue.bind(this)) : 0 == FuliMannager.getInstance().fuliData.is_get_fix_gift || 0 == FuliMannager.getInstance().fuliData.is_get_week_gift ? game.AppFacade.instance.sendNotification(PanelNotify.OPEN_FULI_GET) : Global.netProxy.sendRequest(GameConfig.SERVER_PATH + "comm/get-card", {}, this.onGetZhouAndYue.bind(this))) }, e.prototype.onGetZhouAndYue = function(t) { 0 == t.status && (FuliMannager.getInstance().zyData = t.data, this.showViewComponent(10)) }, e.NAME = "FuliMediter", e } (BaseMediator); __reflect(FuliMediter.prototype, "FuliMediter"); var FuliPanel = function(t) { function e() { var e = t.call(this) || this; return e.skinName = FuliPanelSkin, e } return __extends(e, t), e.prototype.createChildren = function() { t.prototype.createChildren.call(this), this.isFullScreen = !0, this.isVisibleAnimate = !0, this.commonPanel.setPanelWidth(620), this.commonPanel.setPanelHeight(710), this.commonPanel.setTitle("fuli_json.fuli_title_png") }, e.prototype.childrenCreated = function() { t.prototype.childrenCreated.call(this), this.updataAll() }, e.prototype.onAdded = function() { t.prototype.onAdded.call(this), this.item0.buyButton.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onBuyz, this), this.item0.getButton.addEventListener(egret.TouchEvent.TOUCH_TAP, this.ongetz, this), this.item1.buyButton.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onBuyy, this), this.item1.getButton.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onGety, this) }, e.prototype.onRemoved = function() { t.prototype.onRemoved.call(this), this.item0.buyButton.removeEventListener(egret.TouchEvent.TOUCH_TAP, this.onBuyz, this), this.item0.getButton.removeEventListener(egret.TouchEvent.TOUCH_TAP, this.ongetz, this), this.item1.buyButton.removeEventListener(egret.TouchEvent.TOUCH_TAP, this.onBuyy, this), this.item1.getButton.removeEventListener(egret.TouchEvent.TOUCH_TAP, this.onGety, this) }, e.prototype.onBuyz = function(t) {}, e.prototype.ongetz = function(t) { FuliMannager.getInstance().curid = 601e3, FuliMannager.getInstance().sendNetzyGetAward() }, e.prototype.onBuyy = function(t) {}, e.prototype.onGety = function(t) { FuliMannager.getInstance().curid = 601001, FuliMannager.getInstance().sendNetzyGetAward() }, e.prototype.btnCloseTouchEnded = function() { game.AppFacade.getInstance().sendNotification(PanelNotify.CLOSE_FULI) }, e.prototype.updataAll = function() { this.itemall.updata(), this.updataItem0And1() }, e.prototype.updataItem0And1 = function() { var t = Global.gameProxy.getzyConfigForID(601e3); this.item0.gemLabel0.text = t.rmb, this.item0.gemLabel1.text = t.fixed_reward_id.split(":")[1], this.item0.gemLabel2.text = t.diamonds_day_id.split(":")[1], this.item0.nameLabel.text = t.name, this.item0.imgicon.source = "fuli_zhouka_png"; var e = FuliMannager.getInstance().getisZY("601000"); if (e) { var i = FuliMannager.getInstance().getIndexForTime(e.last_get_gift_time), n = FuliMannager.getInstance().getIndexForTime(e.expire_time), a = n - i; this.item0.gemLabel3.text = a + "", this.item0.buyButton.visible = !1, this.item0.getButton.visible = !0 } else this.item0.gemLabel3.text = "0", this.item0.buyButton.visible = !0, this.item0.getButton.visible = !1; this.item0.gemLabel0.text = FuliMannager.getInstance().zhoukaArr[3] + ""; var o = Global.gameProxy.getzyConfigForID(601001); this.item1.gemLabel0.text = o.rmb, this.item1.gemLabel1.text = o.fixed_reward_id.split(":")[1], this.item1.gemLabel2.text = o.diamonds_day_id.split(":")[1], this.item1.nameLabel.text = o.name, this.item1.imgicon.source = "fuli_yueka_png"; var s = FuliMannager.getInstance().getisZY("601001"); if (s) { var i = FuliMannager.getInstance().getIndexForTime(s.last_get_gift_time), n = FuliMannager.getInstance().getIndexForTime(s.expire_time), a = n - i; this.item1.gemLabel3.text = a + "", this.item1.buyButton.visible = !1, this.item1.getButton.visible = !0 } else this.item1.gemLabel3.text = "0", this.item1.buyButton.visible = !0, this.item1.getButton.visible = !1 }, e } (game.BasePanel); __reflect(FuliPanel.prototype, "FuliPanel"); var FuliProssbAR = function(t) { function e() { return t.call(this) || this } return __extends(e, t), e.prototype.partAdded = function(e, i) { t.prototype.partAdded.call(this, e, i) }, e.prototype.childrenCreated = function() { t.prototype.childrenCreated.call(this), this.group.mask = this.imgmask }, e.prototype.setPross = function(t, e) { var i = t / e; i > 1 && (i = 1), this.imgProssBar.x = this.imgProssBar.width * i - this.imgProssBar.width, this.prosslabel.text = t + "/" + e }, e } (eui.Component); __reflect(FuliProssbAR.prototype, "FuliProssbAR"); var FuliTextFieldItem = function(t) { function e() { var e = t.call(this) || this; return e.skinName = TextFiledItemSkin, e } return __extends(e, t), e.prototype.childrenCreated = function() { t.prototype.childrenCreated.call(this) }, e } (eui.Component); __reflect(FuliTextFieldItem.prototype, "FuliTextFieldItem"); var GiftItemRender = function(t) { function e() { var e = t.call(this) || this; return e.unitArr = [], e.skinName = OnLineGiftItemRenderSkin, e } return __extends(e, t), e.prototype.partAdded = function(e, i) { t.prototype.partAdded.call(this, e, i) }, e.prototype.childrenCreated = function() { t.prototype.childrenCreated.call(this), this.unitArr.length = 0, this.unitArr.push(this.unit0), this.unitArr.push(this.unit1), this.unitArr.push(this.unit2), this.unitArr.push(this.unit3), game.UIUtils.addShortTouch(this.getButton, this.onSendGetReward.bind(this), null), GuideManager.getInsatance().isShowGuide && 10 == GuideManager.getInsatance().target && 0 == GuideManager.getInsatance().step && (this.validateNow(), GuideManager.getInsatance().des = TextConst.textObj[43], GuideManager.getInsatance().show(this.getButton)) }, e.prototype.onSendGetReward = function() { EffectUtils.playEffect(this.getButton, 1); if (0 == this.data.receive_time) { if (GiftManager.getInstance().curid = this.data.id, GiftManager.getInstance().getNetOnLineGift(), GuideManager.getInsatance().isShowGuide && 10 == GuideManager.getInsatance().target && 0 == GuideManager.getInsatance().step) { this.validateNow(), GuideManager.getInsatance().des = TextConst.textObj[44], GuideManager.getInsatance().target = 11, GuideManager.getInsatance().sendNetMessage(); var t = game.AppFacade.getInstance().retrieveMediator(OnlineGiftMediter.NAME); GuideManager.getInsatance().show(t.viewComponent.btnClose) } } else this.data.receive_time > 0 ? TipsUtils.showTipsDownToUp("时间未到") : this.data.player_level && (LevelGiftManager.getInstance().curid = this.data.id, LevelGiftManager.getInstance().sendNetLevelGift()) }, e.prototype.onTimer = function() { if (this.data && this.data.receive_time >= 0) { var t = GiftManager.getInstance().getDataForID(this.data.id), e = t.receive_time; this.timeLabel.text = game.Utils.showTimeFormat(1e3 * e), this.getButton.visible = !1, this.getButtonD.visible = !1, 0 == t.isGet ? (this.getButton.visible = !0, this.getButton.enabled = !1) : 1 == t.isGet ? (this.getButton.visible = !0, this.getButton.enabled = !0) : (this.getButton.visible = !1, this.getButtonD.visible = !0) } }, e.prototype.dataChanged = function() { if (t.prototype.dataChanged.call(this), this.clearItem(), this.data.receive_time >= 0) { this.onLineGroup.visible = !0, this.levelGroup.visible = !1; var e = (Global.playerProxy.playerData.online_gift_get_count % 7, GiftManager.getInstance().getDataForID(this.data.id)); this.getButton.visible = !1, this.getButtonD.visible = !1, 0 == e.isGet ? (this.getButton.visible = !0, this.getButton.enabled = !1) : 1 == e.isGet ? (this.getButton.visible = !0, this.getButton.enabled = !0) : (this.getButton.visible = !1, this.getButtonD.visible = !0), this.timeLabel.text = game.Utils.showTimeFormat(1e3 * e.receive_time); var i = 1; for (var n in this.data) if (("fruit_id1" == n || "fruit_id2" == n || "fruit_id3" == n || "fruit_id4" == n) && this.data[n]) { var a = this.data[n], o = a.split(":"); 1 == o.length && (o.length = 0, o = a.split(":")); var s = Global.gameProxy.getItemImageId(o[0]); this.unitArr[i - 1].setIcon(s + "_png"), this.unitArr[i - 1].setNum(parseInt(o[1])); var r = new SimpleItemData(Global.gameProxy.getItemConfig(o[0])); this.unitArr[i - 1].itemData = r, i++ } if (GuideManager.getInsatance().isShowGuide && 10 == GuideManager.getInsatance().target && 0 == GuideManager.getInsatance().step) { this.validateNow(); game.AppFacade.getInstance().retrieveMediator(game.GameMediator.NAME); GuideManager.getInsatance().show(this.getButton) } } else if (this.data.player_level) { this.onLineGroup.visible = !1, this.levelGroup.visible = !0, this.clearItem(); var i = 1; for (var n in this.data) if (("fruit_id1" == n || "fruit_id2" == n || "fruit_id3" == n || "fruit_id4" == n) && this.data[n]) { var a = this.data[n], o = a.split(":"); 1 == o.length && (o.length = 0, o = a.split(":")); var s = Global.gameProxy.getItemImageId(o[0]); this.unitArr[i - 1].setIcon(s + "_png"), this.unitArr[i - 1].setNum(parseInt(o[1])); var r = new SimpleItemData(Global.gameProxy.getItemConfig(o[0])); this.unitArr[i - 1].itemData = r, i++ } this.levelLabel.text = this.data.player_level, this.getButton.visible = !1, this.getButtonD.visible = !1, 0 == this.data.isget ? (this.getButton.visible = !0, this.getButton.enabled = !1) : 1 == this.data.isget ? (this.getButton.visible = !0, this.getButton.enabled = !0, this.levelLabel.textColor = 16777215) : this.getButtonD.visible = !0 } }, e.prototype.clearItem = function() { for (var t = 0; t < this.unitArr.length; t++) this.unitArr[t].setIcon(""), this.unitArr[t].setNum(0) }, e } (eui.ItemRenderer); __reflect(GiftItemRender.prototype, "GiftItemRender"); var AssetAdapter = function() { function t() {} return t.prototype.getAsset = function(t, e, i) { function n(n) { e.call(i, n, t) } if (RES.hasRes(t)) { var a = RES.getRes(t); a ? n(a) : RES.getResAsync(t, n, this) } else RES.getResByUrl(t, n, this, RES.ResourceItem.TYPE_IMAGE) }, t } (); __reflect(AssetAdapter.prototype, "AssetAdapter", ["eui.IAssetAdapter"]); var LevelGiftData = function() { function t(t) { this.isget = 2, this.id = t.id, this.fruit_id1 = t.fruit_id1, this.fruit_id2 = t.fruit_id2, this.fruit_id3 = t.fruit_id3, this.fruit_id4 = t.fruit_id4, this.player_level = t.player_level, this.sortkey = parseInt(t.id) } return t } (); __reflect(LevelGiftData.prototype, "LevelGiftData"); var LevelGiftManager = function(t) { function e() { var e = t.call(this) || this; return e.levelGiftArr = [], e } return __extends(e, t), e.getInstance = function() { return this._insatance || (this._insatance = new e), this._insatance }, e.prototype.updataData = function(t) { this.levelGiftArr.length = 0; var e = Global.gameProxy.getLevelGiftConfig(); for (var i in e) { var n = new LevelGiftData(e[i]); this.levelGiftArr.push(n); for (var a = 0; a < t.length; a++) t[a].gift_id == n.id && (n.isget = 0, n.sortkey += 20); n.player_level <= Global.playerProxy.playerData.level && 2 == n.isget && (n.isget = 1, n.sortkey -= 20) } this.levelGiftArr.sort(this.sort) }, e.prototype.sort = function(t, e) { return t.sortkey > e.sortkey ? 1 : -1 }, e.prototype.getGiftDataForID = function(t) { for (var e = 0; e < this.levelGiftArr.length; e++) if (this.levelGiftArr[e].id == t) return this.levelGiftArr[e]; return null }, e.prototype.sendNetGetList = function() { Global.netProxy.sendRequest(GameConfig.SERVER_PATH + "user/get-player-level-gift-list", { gift_id: this.curid }, this.onSendNetGetList.bind(this)) }, e.prototype.onSendNetGetList = function(t) { e.getInstance().updataData(t.data.list), game.EventManager.instance.dispatch(SysNotify.GETREWARD_UPDATA) }, e.prototype.sendNetLevelGift = function() { Global.netProxy.sendRequest(GameConfig.SERVER_PATH + "user/get-player-level-gift", { gift_id: this.curid }, this.onSendNetLevelGift.bind(this)) }, e.prototype.onSendNetLevelGift = function(t) { if (0 == t.status) { var e = this.getGiftDataForID(this.curid), i = ""; for (var n in e) { ("fruit_id1" == n || "fruit_id2" == n || "fruit_id3" == n || "fruit_id4" == n) && e[n] && (i += e[n] + ",") } Global.playerProxy.addItem1(i), game.EventManager.instance.dispatch(SysNotify.TOPLAYER_INFO_UPDATE), this.sendNetGetList() } else TipsUtils.showTipsDownToUp(GameConfig.ServerCode[t.status]) }, e } (egret.EventDispatcher); __reflect(LevelGiftManager.prototype, "LevelGiftManager"); var LevelGiftMediter = function(t) { function e() { return t.call(this, "LevelGiftMediter") || this } return __extends(e, t), e.prototype.listNotificationInterests = function() { return [PanelNotify.OPEN_LEVELGIFT, PanelNotify.CLOSE_LEVELGIFT] }, e.prototype.onRegister = function() { t.prototype.onRegister.call(this) }, e.prototype.showViewComponent = function(t) { void 0 === t && (t = 7), this.viewComponent = new LevelGiftPanel, this.showUI(this.viewComponent, !0, 0, 0, t) }, e.prototype.handleNotification = function(t) { t.getBody(); switch (t.getName()) { case PanelNotify.OPEN_LEVELGIFT: Global.netProxy.sendRequest(GameConfig.SERVER_PATH + "user/get-player-level-gift-list", {}, this.onGetPlayerLevelGift.bind(this)); break; case PanelNotify.CLOSE_LEVELGIFT: this.closeViewComponent(10) } }, e.prototype.onGetPlayerLevelGift = function(t) { 0 == t.status && (LevelGiftManager.getInstance().updataData(t.data.list), this.showViewComponent(10)) }, e.NAME = "LevelGiftMediter", e } (BaseMediator); __reflect(LevelGiftMediter.prototype, "LevelGiftMediter"); var LevelGiftPanel = function(t) { function e() { var e = t.call(this) || this; return e.skinName = LevelGiftPanelSkin, e } return __extends(e, t), e.prototype.partAdded = function(e, i) { t.prototype.partAdded.call(this, e, i) }, e.prototype.onAdded = function() { t.prototype.onAdded.call(this), game.EventManager.instance.addEvent(SysNotify.GETREWARD_UPDATA, this.OnUPdata, this) }, e.prototype.onRemoved = function() { t.prototype.onRemoved.call(this), game.EventManager.instance.removeEvent(SysNotify.GETREWARD_UPDATA, this.OnUPdata, this) }, e.prototype.OnUPdata = function() { var t = this; this.scrolls.viewport.scrollEnabled = !0; var e = this.scrolls.viewport.scrollV; this.initData(), egret.callLater(function() { t.scrolls.validateNow(), t.scrolls.viewport.scrollV = e }, this) }, e.prototype.initData = function() { var t = LevelGiftManager.getInstance().levelGiftArr; this.list.dataProvider = new eui.ArrayCollection(t) }, e.prototype.childrenCreated = function() { t.prototype.childrenCreated.call(this), this.scrolls.viewport = this.list, this.list.itemRenderer = GiftItemRender, this.initData() }, e.prototype.createChildren = function() { t.prototype.createChildren.call(this), this.isFullScreen = !0, this.isVisibleAnimate = !0, this.commonPanel.setPanelWidth(640), this.commonPanel.setPanelHeight(800), this.commonPanel.setTitle("onLineGift_json.onLineGift_Title1_png") }, e.prototype.btnCloseTouchEnded = function() { game.AppFacade.getInstance().sendNotification(PanelNotify.CLOSE_LEVELGIFT) }, e } (game.BasePanel); __reflect(LevelGiftPanel.prototype, "LevelGiftPanel"); var OnlineGiftMediter = function(t) { function e() { var e = t.call(this, "OnlineGiftMediter") || this; return e.GroupName = "online", e } return __extends(e, t), e.prototype.listNotificationInterests = function() { return [PanelNotify.OPEN_ONLINEGIFT, PanelNotify.CLOSE_ONLINEGIFT] }, e.prototype.onRegister = function() { t.prototype.onRegister.call(this) }, e.prototype.showViewComponent = function(t) { void 0 === t && (t = 7), this.viewComponent = new OnlineGiftPanel, this.showUI(this.viewComponent, !0, 0, 0, t) }, e.prototype.handleNotification = function(t) { t.getBody(); switch (t.getName()) { case PanelNotify.OPEN_ONLINEGIFT: RES.isGroupLoaded(this.GroupName) ? this.showViewComponent(10) : (LoadingCompoment.getInstance().show(), RES.addEventListener(RES.ResourceEvent.GROUP_COMPLETE, this.onResourceLoadComplete, this), RES.addEventListener(RES.ResourceEvent.GROUP_LOAD_ERROR, this.onResourceLoadError, this), RES.addEventListener(RES.ResourceEvent.GROUP_PROGRESS, this.onResourceProgress, this), RES.loadGroup(this.GroupName)); break; case PanelNotify.CLOSE_ONLINEGIFT: this.closeViewComponent(10) } }, e.prototype.onResourceLoadComplete = function(t) { t.groupName == this.GroupName && (RES.removeEventListener(RES.ResourceEvent.GROUP_COMPLETE, this.onResourceLoadComplete, this), RES.removeEventListener(RES.ResourceEvent.GROUP_LOAD_ERROR, this.onResourceLoadError, this), RES.removeEventListener(RES.ResourceEvent.GROUP_PROGRESS, this.onResourceProgress, this), LoadingCompoment.getInstance().hide(), this.showViewComponent(10)) }, e.prototype.onResourceLoadError = function(t) { console.warn("Group:" + t.groupName + " has failed to load"), this.onResourceLoadComplete(t) }, e.prototype.onResourceProgress = function(t) { t.groupName == this.GroupName && LoadingCompoment.getInstance().prossBar.setPross(t.itemsLoaded, t.itemsTotal) }, e.NAME = "OnlineGiftMediter", e } (BaseMediator); __reflect(OnlineGiftMediter.prototype, "OnlineGiftMediter"); var OnlineGiftPanel = function(t) { function e() { var e = t.call(this) || this; return e.skinName = OnLineGiftPanelSkin, e } return __extends(e, t), e.prototype.partAdded = function(e, i) { t.prototype.partAdded.call(this, e, i) }, e.prototype.onAdded = function() { t.prototype.onAdded.call(this), core.TimerManager.instance.addTick(1e3, 0, this.onTimer, this), game.EventManager.instance.addEvent(SysNotify.GETREWARD_UPDATA, this.OnUPdata, this) }, e.prototype.onRemoved = function() { t.prototype.onRemoved.call(this), core.TimerManager.instance.removeTick(this.onTimer, this), game.EventManager.instance.removeEvent(SysNotify.GETREWARD_UPDATA, this.OnUPdata, this) }, e.prototype.onShow = function() {}, e.prototype.OnUPdata = function() { var t = this, e = this.scrolls.viewport.scrollV; this.initData(), egret.callLater(function() { t.scrolls.validateNow(), t.scrolls.viewport.scrollV = e }, this) }, e.prototype.onTimer = function() { for (var t = 0; t < this.list.numChildren; t++) { var e = this.list.getChildAt(t); e.onTimer() } }, e.prototype.childrenCreated = function() { t.prototype.childrenCreated.call(this), this.scrolls.viewport = this.list, this.list.itemRenderer = GiftItemRender, this.initData() }, e.prototype.createChildren = function() { t.prototype.createChildren.call(this), this.isFullScreen = !0, this.isVisibleAnimate = !0, this.commonPanel.setPanelWidth(640), this.commonPanel.setPanelHeight(700), this.commonPanel.setTitle("onLineGift_json.onLineGift_Title2_png") }, e.prototype.initData = function() { var t = GiftManager.getInstance().onLineDataArr; this.list.dataProvider = new eui.ArrayCollection(t) }, e.prototype.btnCloseTouchEnded = function() { if (game.AppFacade.getInstance().sendNotification(PanelNotify.CLOSE_ONLINEGIFT), GuideManager.getInsatance().isShowGuide && 11 == GuideManager.getInsatance().target && 0 == GuideManager.getInsatance().step) { GuideManager.getInsatance().des = TextConst.textObj[45]; var t = game.AppFacade.getInstance().retrieveMediator(game.GameMediator.NAME); GuideManager.getInsatance().show(t.viewComponent.gameView.landGroup.getChildAt(0), !1, 235, 409, .5, !1, 200, 200) } }, e } (game.BasePanel); __reflect(OnlineGiftPanel.prototype, "OnlineGiftPanel"); var GuideManager = function(t) { function e() { var e = t.call(this) || this; return e.step = 0, e.target = 5, e.des = "5555555555555555", e.isShowGuide = !0, e.init(), e } return __extends(e, t), e.prototype.init = function() { this.guidePanel = new GuidePanel }, e.getInsatance = function() { return this._instance || (this._instance = new e), this._instance }, e.prototype.show = function(t, e, i, n, a, o, s, r) { void 0 === e && (e = !0), void 0 === i && (i = 0), void 0 === n && (n = 0), void 0 === a && (a = 1), void 0 === o && (o = !0), void 0 === s && (s = 50), void 0 === r && (r = 50), GameLayerManager.gameLayer().guideLayer.addChild(this.guidePanel), t.validateNow(); var h = t.localToGlobal(); h.x = h.x / (GameConfig.curWidth() / Const.DESGIN_W), h.y = h.y / (GameConfig.curHeight() / Const.DESGIN_H); var l = new egret.Rectangle; this.guidePanel.guide_desLabel.text = this.des, e ? (l.x = h.x, l.y = h.y) : (l.x = i, l.y = n), o ? (l.width = t.width * a, l.height = t.height * a) : (l.width = s * a, l.height = r * a), this.guidePanel.updataGuide(l) }, e.prototype.showNext = function() {}, e.prototype.showLast = function() {}, e.prototype.setsVisable = function(t) { void 0 === t && (t = !0), this.guidePanel.visible = t }, e.prototype.hide = function() {}, e.prototype.sendNetMessage = function() { var t = GameConfig.SERVER_PATH + "user/save-guid"; Global.netProxy.sendRequest2(t, { target: this.target, step: this.step }, null) }, e } (egret.EventDispatcher); __reflect(GuideManager.prototype, "GuideManager"); var GuidePanel = function(t) { function e() { var e = t.call(this) || this; return e.dis = 30, e.scaleX = GameConfig.curWidth() / Const.DESGIN_W, e.scaleY = GameConfig.curHeight() / Const.DESGIN_H, e.skinName = GuideSkinSkin, e.upshape = new egret.Shape, e.downshap = new egret.Shape, e.leftshap = new egret.Shape, e.rightshap = new egret.Shape, e.gs.addChild(e.upshape), e.gs.addChild(e.downshap), e.gs.addChild(e.leftshap), e.gs.addChild(e.rightshap), e.upshape.touchEnabled = !0, e.downshap.touchEnabled = !0, e.leftshap.touchEnabled = !0, e.rightshap.touchEnabled = !0, e } return __extends(e, t), e.prototype.childrenCreated = function() { t.prototype.childrenCreated.call(this), this.touchEnabled = !1 }, e.prototype.updataGuide = function(t) { this.upshape.graphics.clear(), this.downshap.graphics.clear(), this.leftshap.graphics.clear(), this.rightshap.graphics.clear(), this.upshape.graphics.beginFill(0, .2), this.upshape.graphics.drawRect(0, 0, Const.DESGIN_W, t.y), this.upshape.graphics.endFill(), this.downshap.graphics.beginFill(0, .2), this.downshap.graphics.drawRect(0, t.y + t.height, Const.DESGIN_W, Const.DESGIN_H), this.downshap.graphics.endFill(), this.leftshap.graphics.beginFill(0, .2), this.leftshap.graphics.drawRect(0, t.y, t.x, t.height), this.leftshap.graphics.endFill(), this.rightshap.graphics.beginFill(0, .2), this.rightshap.graphics.drawRect(t.x + t.width, t.y, Const.DESGIN_W - t.x - t.width, t.height), this.rightshap.graphics.endFill(), this.guide_kuangImg.width = t.width + 25, this.guide_kuangImg.height = t.height + 25, this.guide_kuangImg.anchorOffsetX = this.guide_kuangImg.width / 2, this.guide_kuangImg.anchorOffsetY = this.guide_kuangImg.height / 2, this.guide_kuangImg.x = t.x + t.width / 2, this.guide_kuangImg.y = t.y + t.height / 2; var e = t.x + t.width / 2, i = t.y + t.height / 2; egret.Tween.removeTweens(this.guide_shouImg), i <= Const.DESGIN_H / 2 && e <= Const.DESGIN_W / 2 ? (this.guide_shouImg.rotation = 0, this.guide_shouImg.x = e + t.width + this.dis, this.guide_shouImg.y = i + t.height + this.dis, this.guide_desLabel.x = e, this.guide_desLabel.y = this.guide_shouImg.y + this.guide_shouImg.height, egret.Tween.get(this.guide_shouImg, { loop: !0 }).to({ x: e + t.width, y: i + t.height }, 500).to({ x: e + t.width + this.dis, y: i + t.height + this.dis }, 500)) : i <= Const.DESGIN_H / 2 && e >= Const.DESGIN_W / 2 ? (this.guide_shouImg.rotation = 90, this.guide_shouImg.x = e - t.width - this.dis, this.guide_shouImg.y = i + t.height + this.dis, this.guide_desLabel.y = this.guide_shouImg.y + this.guide_shouImg.height, egret.Tween.get(this.guide_shouImg, { loop: !0 }).to({ x: e - t.width, y: i + t.height }, 500).to({ x: e - t.width - this.dis, y: i + t.height + this.dis }, 500)) : i >= Const.DESGIN_H / 2 && e <= Const.DESGIN_W / 2 ? (this.guide_shouImg.rotation = 270, this.guide_shouImg.x = e + t.width + this.dis, this.guide_shouImg.y = i - t.height - this.dis, this.guide_desLabel.y = this.guide_shouImg.y - this.guide_shouImg.height - this.guide_desLabel.height, egret.Tween.get(this.guide_shouImg, { loop: !0 }).to({ x: e + t.width, y: i - t.height }, 500).to({ x: e + t.width + this.dis, y: i - t.height - this.dis }, 500)) : i >= Const.DESGIN_H / 2 && e >= Const.DESGIN_W / 2 && (console.log(t), this.guide_shouImg.rotation = 180, this.guide_shouImg.x = e - t.width - this.dis, this.guide_shouImg.y = i - t.height - this.dis, this.guide_desLabel.y = this.guide_shouImg.y - this.guide_shouImg.height - this.guide_desLabel.height, egret.Tween.get(this.guide_shouImg, { loop: !0 }).to({ x: e - t.width, y: i - t.height }, 500).to({ x: e - t.width - this.dis, y: i - t.height - this.dis }, 500)), t.width > .8 * Const.DESGIN_W && (this.guide_shouImg.x = t.width / 2, this.guide_shouImg.y = t.y - this.guide_shouImg.height, this.guide_desLabel.y = this.guide_shouImg.y - this.guide_desLabel.height - 60, egret.Tween.removeTweens(this.guide_shouImg), this.guide_shouImg.rotation = 225, egret.Tween.get(this.guide_shouImg, { loop: !0 }).to({ y: t.y - this.guide_shouImg.height - 30 }, 500).to({ y: t.y - this.guide_shouImg.height }, 500)) }, e } (eui.Component); __reflect(GuidePanel.prototype, "GuidePanel"); var TextConst = function() { function t() {} return t.textObj = { 1 : "点击家园按钮,进入家园系统", 2 : "点击商店按钮进入商店", 3 : "点击购买萝卜种子", 4 : "点击离开按钮,离开游戏商店", 5 : "点击空白土地,弹出播种按钮", 6 : "点击播种", 7 : "选择点击屏幕右侧中萝卜种子则播种成功", 8 : "点击每日签到按钮", 9 : "点击屏幕右下方签到按钮方可签到成功", 10 : "点击离开按钮离开签到界面", 11 : "点击屏幕上方幸运转盘按钮,进入大转盘", 12 : "点击屏幕中央抽奖按钮抽奖", 13 : "点击离开按钮离开大转盘界面", 14 : "点击屏幕右下方仓库按钮进入仓库", 15 : "点击道具栏", 16 : "点击宠物蛋", 17 : "点击使用按钮", 18 : "点击离开按钮离开我的仓库", 19 : "点击世界按钮,进入世界系统", 20 : "点击战宠进入宠物界面", 21 : "点击加速,加速孵化成功", 22 : "点击参战,让宠物参加战斗", 23 : "点击离开,离开战宠", 24.1 : "再一次点击商店", 24 : "点击家园按钮", 25 : "点击神秘商店", 26 : "购买红色宝石", 27 : "点击离开按钮", 28 : "再次点击战宠按钮", 29 : "点击战力升级标签栏,进入战宠升级界面", 30 : "点击兑换按钮,完成当前等级升级", 31 : "升级完毕,点击下方培养按钮,增加属性", 32 : "点击离开按钮离开战宠界面", 33 : "点击竞技按钮进入竞技场", 34 : "点击挑战按钮,挑战该玩家进入战斗", 35 : "点击果实,并连接2个以上相同果实图案进行连线消除,战宠会自动攻击对方", 36 : "点击离开竞技场", 37 : "再次点击我的世界", 38 : "点击成就按钮", 39 : "点击系统成就", 40 : "点击领取按钮领取成就奖励", 41 : "点击离开", 42 : "点击屏幕左边的在线礼包按钮", 43 : "点击领取按钮领取在线奖励", 44 : "点击离开按钮离开在线礼包", 45 : "点击大萝卜,收割,新手引导到此结束,请玩家自行体会" }, t } (); __reflect(TextConst.prototype, "TextConst"); var game; ! function(t) { var e = function(e) { function i(t) { void 0 === t && (t = null); var n = e.call(this, i.NAME, t) || this; return n.alertInterval = null, n.alertWaiting = null, n.runningAlert = null, n } return __extends(i, e), i.prototype.listNotificationInterests = function() { return [PanelNotify.OPEN_ALERT, PanelNotify.CLOSE_ALERT] }, i.prototype.onRegister = function() { e.prototype.onRegister.call(this), this.startInterVal(), this.alertWaiting = [], Global.alertMediator = this }, i.prototype.showViewComponent = function(e) { void 0 === e && (e = 6), this.viewComponent = new t.AlertPanel(this.runningAlert), this.showUI(this.viewComponent, !0, 0, 0, e) }, i.prototype.handleNotification = function(t) { t.getBody(); switch (t.getName()) { case PanelNotify.OPEN_ALERT: var e = t.getBody(); this.alertWaiting || (this.alertWaiting = []), this.alertWaiting.push(e), this.alertInterval || this.startInterVal(); break; case PanelNotify.CLOSE_ALERT: this.runningAlert = null, this.closeViewComponent(1) } }, i.prototype.startInterVal = function() { var t = this; this.alertInterval = setInterval(function() { t.checkHasAlert() }, 100) }, i.prototype.addAlert = function(t, e, i, n) { void 0 === e && (e = null), void 0 === i && (i = null), void 0 === n && (n = !0), n || (n = !1), this.sendNotification(PanelNotify.OPEN_ALERT, { tips: t, okCallback: e, noCallback: i, onlyOkBtn: n }) }, i.prototype.checkHasAlert = function() { if (!this.runningAlert) { if (!this.alertWaiting || this.alertWaiting.length < 1) return clearInterval(this.alertInterval), void(this.alertInterval = null); this.runningAlert = this.alertWaiting.shift(), this.showViewComponent(2) } }, i.prototype.initUI = function() {}, i.prototype.initData = function() {}, i.NAME = "AlertMediator", i } (BaseMediator); t.AlertMediator = e, __reflect(e.prototype, "game.AlertMediator") } (game || (game = {})); var game; ! function(t) { var e = function(e) { function i() { return e.call(this, "BagMediator") || this } return __extends(i, e), i.prototype.listNotificationInterests = function() { return [PanelNotify.OPEN_BAG, PanelNotify.CLOSE_BAG] }, i.prototype.onRegister = function() { e.prototype.onRegister.call(this) }, i.prototype.showViewComponent = function(e, i) { void 0 === e && (e = 7), this.viewComponent = new t.BagPanel(i), this.showUI(this.viewComponent, !0, 0, 0, e) }, i.prototype.handleNotification = function(t) { t.getBody(); switch (t.getName()) { case PanelNotify.OPEN_BAG: var e = t.getBody().type; this.showViewComponent(10, e); break; case PanelNotify.CLOSE_BAG: this.closeViewComponent(10) } }, i.NAME = "BagMediator", i } (BaseMediator); t.BagMediator = e, __reflect(e.prototype, "game.BagMediator") } (game || (game = {})); var BagMediator2 = function(t) { function e() { return t.call(this, "BagMediator2") || this } return __extends(e, t), e.prototype.listNotificationInterests = function() { return [PanelNotify.OPEN_BAG2, PanelNotify.CLOSE_BAG2] }, e.prototype.onRegister = function() { t.prototype.onRegister.call(this) }, e.prototype.showViewComponent = function(t, e) { void 0 === t && (t = 7), this.viewComponent = new BagPanel2(e), this.showUI(this.viewComponent, !0, 0, 0, t) }, e.prototype.handleNotification = function(t) { t.getBody(); switch (t.getName()) { case PanelNotify.OPEN_BAG2: var e = t.getBody().type; this.showViewComponent(10, e); break; case PanelNotify.CLOSE_BAG2: this.closeViewComponent(10) } }, e.NAME = "BagMediator2", e } (BaseMediator); __reflect(BagMediator2.prototype, "BagMediator2"); var GameConfig; ! function(t) { var e = function() { function t() {} return t[0] = "操作成功", t[1] = "操作失败", t[2] = "参数解析异常", t[3] = "命令类型错误", t[4] = "未知异常", t[5] = "帐号已经被禁用", t[6] = "帐号或者密码错误", t[7] = "您的帐号在其他地方登录,请重新登录!", t[12] = "帐号或者密码错误", t[13] = "帐号或者密码错误", t[14] = "注册失败", t[15] = "帐号或者密码错误", t[1001] = "帐号已经被注册", t[1002] = "缺少token", t[1003] = "不存在的数据", t[1004] = "金币不够", t[1005] = "发送数据参数错误", t[1007] = "参数错误", t[1008] = "农田上已经有农作物", t[1009] = "当前等级不足", t[1010] = "系统错误", t[1011] = "你没有这个物品", t[1012] = "物品数量不够", t[1013] = "该物品不能购买多个", t[1014] = "物品类型错误", t[1015] = "农田上没有种植种子", t[1016] = "尚未成熟", t[1017] = "你已经收割过该农作物", t[1018] = "农田不需要清理", t[1019] = "已经成熟", t[1020] = "操作错误", t[1021] = "系统错误", t[1022] = "你已经添加过TA了", t[1023] = "这个好友请求已经回复过你", t[1024] = "没有可偷取的数量", t[1025] = "请等待好友的回复", t[1026] = "你已经偷过了,给主人留一点吧", t[1027] = "你已经放过虫了", t[1028] = "你已经放过草了", t[1029] = "你已经浇过水了", t[1030] = "你已经帮主人除过虫", t[1031] = "你已经帮主人除过草", t[1032] = "手机号码错误", t[1033] = "系统错误", t[1034] = "转赠用户不存在", t[1035] = "操作太快", t[1036] = "转赠用户不在线", t[1037] = "发布消息信息错误", t[1038] = "支付密码错误", t[1039] = "请等待对方确认", t[1040] = "你没有购买宠物", t[1041] = "等级已经满了", t[1042] = "自己不能给自己交易", t[1043] = "服务器系统错误", t[1044] = "施肥已经到达上限", t[1045] = "施肥时间错误", t[1046] = "你们不是好友", t[1047] = "土地等级不够,无法种植该植物", t[1048] = "验证码错误", t[1049] = "发送验证码失败", t[1050] = "用户不存在或者被禁用", t[1051] = "推荐码错误", t[1052] = "钻石不够", t[1058] = "已升到满级", t[1056] = "物品不足", t[1057] = "物品不足", t[1063] = "宠物饥饿度不足", t[1064] = "您没出战宠物", t[1065] = "昵称重复", t[1066] = "达到最大等级", t[1067] = "数量限制", t[1068] = "牧场已偷取", t[1069] = "牧场未产出", t[1070] = "鸡已被宰割", t[1071] = "请先添加对方为好友", t[1072] = "请先购买狗狗", t } (); t.ServerCode = e, __reflect(e.prototype, "GameConfig.ServerCode") } (GameConfig || (GameConfig = {})); var game; ! function(t) { var e = function(e) { function i() { return e.call(this, "ExGoldMediator") || this } return __extends(i, e), i.prototype.listNotificationInterests = function() { return [PanelNotify.OPEN_EXGOLD, PanelNotify.CLOSE_EXGOLD] }, i.prototype.onRegister = function() { e.prototype.onRegister.call(this) }, i.prototype.showViewComponent = function(e) { void 0 === e && (e = 7), this.viewComponent = new t.ExGoldPanel, this.showUI(this.viewComponent, !0, 0, 0, e) }, i.prototype.handleNotification = function(t) { t.getBody(); switch (t.getName()) { case PanelNotify.OPEN_EXGOLD: this.showViewComponent(7); break; case PanelNotify.CLOSE_EXGOLD: this.closeViewComponent(1) } }, i.NAME = "ExGoldMediator", i } (BaseMediator); t.ExGoldMediator = e, __reflect(e.prototype, "game.ExGoldMediator") } (game || (game = {})); var game; ! function(t) { var e = function(e) { function i() { return e.call(this, "FindPasswordMediator") || this } return __extends(i, e), i.prototype.listNotificationInterests = function() { return [PanelNotify.OPEN_FIND_PASSWORD, PanelNotify.CLOSE_FIND_PASSWORD] }, i.prototype.onRegister = function() { e.prototype.onRegister.call(this) }, i.prototype.showViewComponent = function(e) { void 0 === e && (e = 0), this.viewComponent = new t.FindPasswordScene, this.showUI(this.viewComponent, !0, 0, 0, e) }, i.prototype.handleNotification = function(t) { t.getBody(); switch (t.getName()) { case PanelNotify.OPEN_FIND_PASSWORD: this.showViewComponent(7); break; case PanelNotify.CLOSE_FIND_PASSWORD: this.closeViewComponent(1) } }, i.NAME = "FindPasswordMediator", i } (BaseMediator); t.FindPasswordMediator = e, __reflect(e.prototype, "game.FindPasswordMediator") } (game || (game = {})); var game; ! function(t) { var e = function(e) { function i() { return e.call(this, "HelpMediator") || this } return __extends(i, e), i.prototype.listNotificationInterests = function() { return [PanelNotify.OPEN_HELP, PanelNotify.CLOSE_HELP] }, i.prototype.onRegister = function() { e.prototype.onRegister.call(this) }, i.prototype.showViewComponent = function(e, i) { void 0 === e && (e = 7), this.viewComponent = new t.HelpPanel(i), this.showUI(this.viewComponent, !0, 0, 0, e) }, i.prototype.handleNotification = function(t) { var e = t.getBody(); switch (t.getName()) { case PanelNotify.OPEN_HELP: this.showViewComponent(7, e.textId); break; case PanelNotify.CLOSE_HELP: this.closeViewComponent(1) } }, i.NAME = "HelpMediator", i } (BaseMediator); t.HelpMediator = e, __reflect(e.prototype, "game.HelpMediator") } (game || (game = {})); var game; ! function(t) { var e = function(e) { function i() { return e.call(this, "HouseUpgradeMediator") || this } return __extends(i, e), i.prototype.listNotificationInterests = function() { return [PanelNotify.OPEN_HOUSEUPGRADE, PanelNotify.CLOSE_HOUSEUPGRADE, ClientNotify.UPGREADE_HOUSE] }, i.prototype.onRegister = function() { e.prototype.onRegister.call(this) }, i.prototype.showViewComponent = function(e) { void 0 === e && (e = 7), this.viewComponent = new t.HouseUpgradePanel, this.showUI(this.viewComponent, !0, 0, 0, e) }, i.prototype.handleNotification = function(t) { var e = t.getBody(); switch (t.getName()) { case PanelNotify.OPEN_HOUSEUPGRADE: this.showViewComponent(7); break; case PanelNotify.CLOSE_HOUSEUPGRADE: this.closeViewComponent(1); break; case ClientNotify.UPGREADE_HOUSE: this.houseUpgrade(e.upgradeData) } }, i.prototype.houseUpgrade = function(e) { var i = GameConfig.SERVER_PATH + "farm/upgrade", n = this; Global.netProxy.sendRequest(i, {}, function(i) { if (0 === i.status) { PopUpManager.popTip("房屋升级"); var a = e.items; Global.playerProxy.sellWareHouseItem1(a), Global.playerProxy.addExp(e.add_exp), TipsUtils.showTipsDownToUp("增加经验" + e.add_exp + "点"), t.EventManager.instance.dispatch(SysNotify.TOPLAYER_INFO_UPDATE); var o = Global.playerProxy.playerData.farm_level + 1; o = t.Utils.limit(o, 1, 12), Global.playerProxy.playerData.farm_level = o, t.EventManager.instance.dispatch(SysNotify.USER_HOUSE_CHANGE, Global.playerProxy.playerData.farm_level), n.viewComponent.flushPanel() } else TipsUtils.showErrorCodeTips(i.status) }) }, i.NAME = "HouseUpgradeMediator", i } (BaseMediator); t.HouseUpgradeMediator = e, __reflect(e.prototype, "game.HouseUpgradeMediator") } (game || (game = {})); var game; ! function(t) { var e = function(e) { function i() { return e.call(this, "LandExtendMediator") || this } return __extends(i, e), i.prototype.listNotificationInterests = function() { return [PanelNotify.OPEN_LANDEXTEND, PanelNotify.CLOSE_LANDEXTEND, ClientNotify.LAND_EXTEND] }, i.prototype.onRegister = function() { e.prototype.onRegister.call(this) }, i.prototype.showViewComponent = function(e) { void 0 === e && (e = 7), this.viewComponent = new t.LandExtendPanel, this.showUI(this.viewComponent, !0, 0, 0, e) }, i.prototype.handleNotification = function(t) { var e = t.getBody(); switch (t.getName()) { case PanelNotify.OPEN_LANDEXTEND: this.showViewComponent(7); break; case PanelNotify.CLOSE_LANDEXTEND: this.closeViewComponent(1); break; case ClientNotify.LAND_EXTEND: var i = e.gold; this.extendLand(i) } }, i.prototype.extendLand = function(e) { var i = GameConfig.SERVER_PATH + "farm/extend-land", n = Global.playerProxy.playerData, a = this; Global.netProxy.sendRequest(i, {}, function(i) { 0 === i.status ? (n.gold -= e, Global.playerProxy.updateLandData(i.data.position, i.data), t.EventManager.instance.dispatch(SysNotify.TOPLAYER_INFO_UPDATE), PopUpManager.popTip("扩建土地成功")) : TipsUtils.showTipsDownToUp(GameConfig.ServerCode[i.status]), a.closeViewComponent(10) }) }, i.NAME = "LandExtendMediator", i } (BaseMediator); t.LandExtendMediator = e, __reflect(e.prototype, "game.LandExtendMediator") } (game || (game = {})); var game; ! function(t) { var e = function(e) { function i() { return e.call(this, "LandUpgradeMediator") || this } return __extends(i, e), i.prototype.listNotificationInterests = function() { return [PanelNotify.OPEN_LAND_UPGRADE, PanelNotify.CLOSE_LAND_UPGRADE, ClientNotify.LAND_UPGRADE] }, i.prototype.onRegister = function() { e.prototype.onRegister.call(this) }, i.prototype.showViewComponent = function(e) { void 0 === e && (e = 7), this.viewComponent = new t.LandUpgradePanel, this.showUI(this.viewComponent, !0, 0, 0, e) }, i.prototype.handleNotification = function(t) { var e = t.getBody(); switch (t.getName()) { case PanelNotify.OPEN_LAND_UPGRADE: this.showViewComponent(7); break; case PanelNotify.CLOSE_LAND_UPGRADE: this.closeViewComponent(1); break; case ClientNotify.LAND_UPGRADE: this.landUpgrade(e) } }, i.prototype.landUpgrade = function(e) { var i = GameConfig.SERVER_PATH + "farm/upgrade-land", n = (Global.playerProxy.playerData, this), a = e.landData; Global.netProxy.sendRequest(i, { level: e.level }, function(e) { if (0 === e.status) { var i = a.items; Global.playerProxy.sellWareHouseItem1(i), Global.playerProxy.updateLandData(e.data.position, e.data), t.EventManager.instance.dispatch(SysNotify.TOPLAYER_INFO_UPDATE), PopUpManager.popTip("升级成功"), n.viewComponent.flushPanel() } else TipsUtils.showTipsDownToUp(GameConfig.ServerCode[e.status]) }) }, i.NAME = "LandUpgradeMediator", i } (BaseMediator); t.LandUpgradeMediator = e, __reflect(e.prototype, "game.LandUpgradeMediator") } (game || (game = {})); var game; ! function(t) { var e = function(e) { function i() { return e.call(this, "LogMediator") || this } return __extends(i, e), i.prototype.listNotificationInterests = function() { return [PanelNotify.OPEN_LOG, PanelNotify.CLOSE_LOG] }, i.prototype.onRegister = function() { e.prototype.onRegister.call(this) }, i.prototype.showViewComponent = function(e) { void 0 === e && (e = 7), this.viewComponent = new t.LogPanel, this.viewComponent.mediator = this, this.showUI(this.viewComponent, !0, 0, 0, e) }, i.prototype.getPlayerLogList = function(t, e, i) { var n = GameConfig.SERVER_PATH + "comm/get-user-log"; Global.netProxy.sendRequest(n, { offset: t, count: e }, function(t) { i && i(t.data) }) }, i.prototype.handleNotification = function(t) { t.getBody(); switch (t.getName()) { case PanelNotify.OPEN_LOG: this.showViewComponent(7); break; case PanelNotify.CLOSE_LOG: this.closeViewComponent(1) } }, i.prototype.clearLog = function(t) { var e = GameConfig.SERVER_PATH + "comm/clean-user-log"; Global.netProxy.sendRequest(e, {}, function(e) { 0 == e.status ? t && t(e.data) : TipsUtils.showErrorCodeTips(e.data) }) }, i.prototype.getSystemLogList = function(t, e, i) { var n = GameConfig.SERVER_PATH + "comm/get-user-system-log"; Global.netProxy.sendRequest(n, { offset: t, count: e }, function(t) { 0 == t.status ? i && i(t.data) : TipsUtils.showErrorCodeTips(t.data) }) }, i.NAME = "LogMediator", i } (BaseMediator); t.LogMediator = e, __reflect(e.prototype, "game.LogMediator") } (game || (game = {})); var game; ! function(t) { var e = function(e) { function i() { return e.call(this, "LotteryMediator") || this } return __extends(i, e), i.prototype.listNotificationInterests = function() { return [PanelNotify.OPEN_LOTTERY, PanelNotify.CLOSE_LOTTERY] }, i.prototype.onRegister = function() { e.prototype.onRegister.call(this) }, i.prototype.showViewComponent = function(e) { void 0 === e && (e = 7), this.viewComponent = new t.LotteryPanel, this.showUI(this.viewComponent, !0, 0, 0, e) }, i.prototype.handleNotification = function(t) { t.getBody(); switch (t.getName()) { case PanelNotify.OPEN_LOTTERY: this.showViewComponent(10); break; case PanelNotify.CLOSE_LOTTERY: this.closeViewComponent(10) } }, i.NAME = "LotteryMediator", i } (BaseMediator); t.LotteryMediator = e, __reflect(e.prototype, "game.LotteryMediator") } (game || (game = {})); var game; ! function(t) { var e = function(e) { function i() { return e.call(this, "NoticeMediator") || this } return __extends(i, e), i.prototype.listNotificationInterests = function() { return [PanelNotify.OPEN_NOTICE, PanelNotify.CLOSE_NOTICE] }, i.prototype.onRegister = function() { e.prototype.onRegister.call(this) }, i.prototype.showViewComponent = function(e) { void 0 === e && (e = 7), this.viewComponent = new t.NoticePanel, this.viewComponent.mediator = this, this.showUI(this.viewComponent, !0, 0, 0, e) }, i.prototype.handleNotification = function(t) { t.getBody(); switch (t.getName()) { case PanelNotify.OPEN_NOTICE: this.showViewComponent(7); break; case PanelNotify.CLOSE_NOTICE: this.closeViewComponent(1) } }, i.prototype.getSystemNoticeList = function(t, e, i) { var n = GameConfig.SERVER_PATH + "comm/get-notice-list"; Global.netProxy.sendRequest(n, { offset: t, count: e }, function(t) { 0 == t.status ? i && i(t.data) : TipsUtils.showErrorCodeTips(t.data) }) }, i.NAME = "NoticeMediator", i } (BaseMediator); t.NoticeMediator = e, __reflect(e.prototype, "game.NoticeMediator") } (game || (game = {})); var game; ! function(t) { var e = function(e) { function i() { return e.call(this, "PayMediator") || this } return __extends(i, e), i.prototype.listNotificationInterests = function() { return [PanelNotify.OPEN_PAY, PanelNotify.CLOSE_PAY] }, i.prototype.onRegister = function() { e.prototype.onRegister.call(this) }, i.prototype.showViewComponent = function(e) { void 0 === e && (e = 7), this.viewComponent = new t.PayPanel, this.showUI(this.viewComponent, !0, 0, 0, e) }, i.prototype.handleNotification = function(t) { t.getBody(); switch (t.getName()) { case PanelNotify.OPEN_PAY: this.showViewComponent(7); break; case PanelNotify.CLOSE_PAY: this.closeViewComponent(1) } }, i.NAME = "PayMediator", i } (BaseMediator); t.PayMediator = e, __reflect(e.prototype, "game.PayMediator") } (game || (game = {})); var game; ! function(t) { var e = function(e) { function i() { return e.call(this, "PlayerInfoMediator") || this } return __extends(i, e), i.prototype.listNotificationInterests = function() { return [PanelNotify.OPEN_PLAYER_INFO, PanelNotify.CLOSE_PLAYER_INFO] }, i.prototype.onRegister = function() { e.prototype.onRegister.call(this) }, i.prototype.showViewComponent = function(e) { void 0 === e && (e = 7), this.viewComponent = new t.PlayerInfoPanel, this.viewComponent.mediator = this, this.showUI(this.viewComponent, !0, 0, 0, e) }, i.prototype.handleNotification = function(t) { t.getBody(); switch (t.getName()) { case PanelNotify.OPEN_PLAYER_INFO: this.onGetinfo(); break; case PanelNotify.CLOSE_PLAYER_INFO: this.closeViewComponent(1) } }, i.prototype.onGetinfo = function() { this.showViewComponent(7) }, i.NAME = "PlayerInfoMediator", i } (BaseMediator); t.PlayerInfoMediator = e, __reflect(e.prototype, "game.PlayerInfoMediator") } (game || (game = {})); var game; ! function(t) { var e = function(e) { function i() { return e.call(this, "RegisterMediator") || this } return __extends(i, e), i.prototype.listNotificationInterests = function() { return [PanelNotify.OPEN_REGIST, PanelNotify.CLOSE_REGIST] }, i.prototype.onRegister = function() { e.prototype.onRegister.call(this) }, i.prototype.showViewComponent = function(e) { void 0 === e && (e = 7), this.viewComponent = new t.RegistPanel, this.showUI(this.viewComponent, !0, 0, 0, e) }, i.prototype.handleNotification = function(t) { t.getBody(); switch (t.getName()) { case PanelNotify.OPEN_REGIST: this.showViewComponent(7); break; case PanelNotify.CLOSE_REGIST: this.closeViewComponent(1) } }, i.NAME = "RegisterMediator", i } (BaseMediator); t.RegisterMediator = e, __reflect(e.prototype, "game.RegisterMediator") } (game || (game = {})); var game; ! function(t) { var e = function(e) { function i() { return e.call(this, "SendMesageMediator") || this } return __extends(i, e), i.prototype.listNotificationInterests = function() { return [PanelNotify.OPEN_SEND_MESSAGE, PanelNotify.CLOSE_SEND_MESSAGE] }, i.prototype.onRegister = function() { e.prototype.onRegister.call(this) }, i.prototype.showViewComponent = function(e) { void 0 === e && (e = 7), this.viewComponent = new t.SendMessagePanel, this.showUI(this.viewComponent, !0, 0, 0, e) }, i.prototype.handleNotification = function(t) { t.getBody(); switch (t.getName()) { case PanelNotify.OPEN_SEND_MESSAGE: this.showViewComponent(7); break; case PanelNotify.CLOSE_SEND_MESSAGE: this.closeViewComponent(1) } }, i.NAME = "SendMesageMediator", i } (BaseMediator); t.SendMesageMediator = e, __reflect(e.prototype, "game.SendMesageMediator") } (game || (game = {})); var game; ! function(t) { var e = function(e) { function i() { return e.call(this, "ShopMediator") || this } return __extends(i, e), i.prototype.listNotificationInterests = function() { return [PanelNotify.OPEN_SHOP, PanelNotify.CLOSE_SHOP] }, i.prototype.onRegister = function() { e.prototype.onRegister.call(this) }, i.prototype.showViewComponent = function(e) { void 0 === e && (e = 7), this.viewComponent = new t.ShopPanel, this.showUI(this.viewComponent, !0, 0, 0, e) }, i.prototype.handleNotification = function(t) { t.getBody(); switch (t.getName()) { case PanelNotify.OPEN_SHOP: this.showViewComponent(7); break; case PanelNotify.CLOSE_SHOP: this.closeViewComponent(1) } }, i.prototype.buy = function(e, i) { var n = this, a = GameConfig.SERVER_PATH + "store/buy", o = Global.playerProxy.playerData, s = e.gold, r = e.diamond; if (s > o.gold) return void TipsUtils.showTipsDownToUp("购买失败:金币不足"); if (r > o.gem) return void TipsUtils.showTipsDownToUp("购买失败:钻石不足,请充值!"); var h = this; console.log(e.id); if(e.id==70){ a = GameConfig.SERVER_PATH + "store/buy-enjoy-pet"; } Global.netProxy.sendRequest(a, { store_id: e.id, num: i }, function(i) { if(e.id==70){ 0 === i.status ? (o.gold -= e.gold, o.gem -= e.diamond, TipsUtils.showTipsDownToUp("购买成功"),Global.playerProxy.playerData.use_dog_item_id = 1062, game.EventManager.instance.dispatch(SysNotify.DOG_UPDAT)) : TipsUtils.showTipsDownToUp(GameConfig.ServerCode[i.status]) }else{ 0 === i.status ? (o.gold -= e.gold, o.gem -= e.diamond, Global.playerProxy.updateWareHouseItem(i.data), t.EventManager.instance.dispatch(SysNotify.TOPLAYER_INFO_UPDATE), TipsUtils.showTipsDownToUp("购买成功"), (201017 == e.itemData.config.id || 201018 == e.itemData.config.id || 201019 == e.itemData.config.id || 201020 == e.itemData.config.id) && (Global.playerProxy.playerData.buy_pet_egg_list.push(e.itemData.config.id), h.viewComponent.updatas()), 101001 == e.itemData.config.id && GuideManager.getInsatance().isShowGuide && 0 == GuideManager.getInsatance().target && 0 == GuideManager.getInsatance().step && (GuideManager.getInsatance().des = TextConst.textObj[4], GuideManager.getInsatance().show(n.viewComponent.btnClose), GuideManager.getInsatance().target = 1, GuideManager.getInsatance().sendNetMessage()), GuideManager.getInsatance().isShowGuide && 6 == GuideManager.getInsatance().target && 0 == GuideManager.getInsatance().step && (GuideManager.getInsatance().des = TextConst.textObj[27], GuideManager.getInsatance().target = 7, GuideManager.getInsatance().step = 0, GuideManager.getInsatance().sendNetMessage(), GuideManager.getInsatance().show(n.viewComponent.btnClose))) : TipsUtils.showTipsDownToUp(GameConfig.ServerCode[i.status]) } }) }, i.NAME = "ShopMediator", i } (BaseMediator); t.ShopMediator = e, __reflect(e.prototype, "game.ShopMediator") } (game || (game = {})); var game; ! function(t) { var e = function(e) { function i() { return e.call(this, "SkinMediator") || this } return __extends(i, e), i.prototype.listNotificationInterests = function() { return [PanelNotify.OPEN_SKIN, PanelNotify.CLOSE_SKIN] }, i.prototype.onRegister = function() { e.prototype.onRegister.call(this) }, i.prototype.showViewComponent = function(e) { void 0 === e && (e = 7), this.viewComponent = new t.SkinPanel, this.showUI(this.viewComponent, !0, 0, 0, e) }, i.prototype.handleNotification = function(t) { t.getBody(); switch (t.getName()) { case PanelNotify.OPEN_SKIN: this.showViewComponent(7); break; case PanelNotify.CLOSE_SKIN: this.closeViewComponent(1) } }, i.prototype.changeSkin = function(e) { var i = GameConfig.SERVER_PATH + "farm/change-bg", n = Global.playerProxy.playerData; Global.netProxy.sendRequest(i, { item_id: e }, function(i) { 0 === i.status ? (n.bg_image_id = e, t.EventManager.instance.dispatch(SysNotify.USER_SKIN_CHANGE)) : TipsUtils.showErrorCodeTips(i.status) }) }, i.NAME = "SkinMediator", i } (BaseMediator); t.SkinMediator = e, __reflect(e.prototype, "game.SkinMediator") } (game || (game = {})); var game; ! function(t) { var e = function(e) { function i() { return e.call(this, "WareHouseMediator") || this } return __extends(i, e), i.prototype.listNotificationInterests = function() { return [PanelNotify.OPEN_WARE_HOUSE, PanelNotify.CLOSE_WARE_HOUSE] }, i.prototype.onRegister = function() { e.prototype.onRegister.call(this) }, i.prototype.sellWareHouseItem = function(e, i, n) { var a = this, o = GameConfig.SERVER_PATH + "store-house/sell", s = Global.playerProxy.playerData; if(e){ Global.netProxy.sendRequest(o, { item_id: e.id, num: i }, function(o) { 0 === o.status ? (s.gold += e.sellPrice * i, Global.playerProxy.sellWareHouseItem(e, i), t.EventManager.instance.dispatch(SysNotify.TOPLAYER_INFO_UPDATE), TipsUtils.showTipsDownToUp("出售成功,获得" + e.sellPrice * i + "金币"), a.viewComponent.flushList(), n()) : TipsUtils.showErrorCodeTips(o.status) }) }else TipsUtils.showTipsDownToUp("请选择动物") }, i.prototype.showViewComponent = function(e) { void 0 === e && (e = 7), this.viewComponent = new t.WareHousePanel, this.showUI(this.viewComponent, !0, 0, 0, e) }, i.prototype.handleNotification = function(t) { t.getBody(); switch (t.getName()) { case PanelNotify.OPEN_WARE_HOUSE: this.showViewComponent(7); break; case PanelNotify.CLOSE_WARE_HOUSE: this.closeViewComponent(1) } }, i.NAME = "WareHouseMediator", i } (BaseMediator); t.WareHouseMediator = e, __reflect(e.prototype, "game.WareHouseMediator") } (game || (game = {})); var game; ! function(t) { var e = function(e) { function i() { return e.call(this, "FriendAddMediator") || this } return __extends(i, e), i.prototype.listNotificationInterests = function() { return [PanelNotify.OPEN_FRIEND_ADD, PanelNotify.CLOSE_FRIEND_ADD] }, i.prototype.onRegister = function() { e.prototype.onRegister.call(this) }, i.prototype.showViewComponent = function(e) { void 0 === e && (e = 7), this.viewComponent = new t.FriendAddPanel, this.viewComponent.mediator = this, this.showUI(this.viewComponent, !0, 0, 0, e) }, i.prototype.handleNotification = function(t) { t.getBody(); switch (t.getName()) { case PanelNotify.OPEN_FRIEND_ADD: this.showViewComponent(7); break; case PanelNotify.CLOSE_FRIEND_ADD: this.closeViewComponent(1) } }, i.prototype.addFriend = function(t) { var e = this, i = GameConfig.SERVER_PATH + "friend/add"; Global.netProxy.sendRequest(i, { friend_user_id: t }, function(t) { 0 === t.status ? (PopUpManager.popTip("申请发出成功"), e.closeViewComponent(1)) : TipsUtils.showErrorCodeTips(t.status) }) }, i.NAME = "FriendAddMediator", i } (BaseMediator); t.FriendAddMediator = e, __reflect(e.prototype, "game.FriendAddMediator") } (game || (game = {})); var game; ! function(t) { var e = function(e) { function i() { return e.call(this, "FriendGiveListMediator") || this } return __extends(i, e), i.prototype.listNotificationInterests = function() { return [PanelNotify.OPEN_FRIEND_GIVE_LIST, PanelNotify.CLOSE_FRIEND_GIVE_LIST] }, i.prototype.onRegister = function() { e.prototype.onRegister.call(this) }, i.prototype.showViewComponent = function(e, i) { void 0 === e && (e = 7), this.viewComponent = new t.FriendGiveListPanel(i), this.showUI(this.viewComponent, !0, 0, 0, e) }, i.prototype.handleNotification = function(t) { var e = t.getBody(); switch (t.getName()) { case PanelNotify.OPEN_FRIEND_GIVE_LIST: this.showViewComponent(7, e); break; case PanelNotify.CLOSE_FRIEND_GIVE_LIST: this.closeViewComponent(1) } }, i.NAME = "FriendGiveListMediator", i } (BaseMediator); t.FriendGiveListMediator = e, __reflect(e.prototype, "game.FriendGiveListMediator") } (game || (game = {})); var game; ! function(t) { var e = function(e) { function i() { return e.call(this, "FriendGiveMediator") || this } return __extends(i, e), i.prototype.listNotificationInterests = function() { return [PanelNotify.CLOSE_FRIEND_GIVE, PanelNotify.OPEN_FRIEND_GIVE, ClientNotify.SHOW_CONFIRM_ALERT, ClientNotify.GIVE_SUCCESS] }, i.prototype.onRegister = function() { e.prototype.onRegister.call(this) }, i.prototype.showViewComponent = function(e) { void 0 === e && (e = 7), this.viewComponent = new t.FriendGivePanel, this.viewComponent.mediator = this, this.showUI(this.viewComponent, !0, 0, 0, e) }, i.prototype.handleNotification = function(t) { var e = t.getBody(); switch (t.getName()) { case PanelNotify.OPEN_FRIEND_GIVE: this.showViewComponent(7); break; case PanelNotify.CLOSE_FRIEND_GIVE: this.closeViewComponent(1); break; case ClientNotify.SHOW_CONFIRM_ALERT: this.showConfrimAlert(e); break; case ClientNotify.GIVE_SUCCESS: this.giveSuccess(e) } }, i.prototype.giveSuccess = function(e) { if (PopUpManager.popTip("本次交易完成"), 0 == e.type) Global.playerProxy.playerData.gold += e.data.gold, t.EventManager.instance.dispatch(SysNotify.TOPLAYER_INFO_UPDATE); else { var i = e.data.item_list; i.forEach(function(t) { Global.playerProxy.updateWareHouseItem({ item_id: t.item_id }, t.num) }) } t.EventManager.instance.dispatch(SysNotify.FLUSH_GROUP3) }, i.prototype.showConfrimAlert = function(e) { var i = "编号:" + e.deal_id + " " + e.from_user_nickname + " 给 " + e.be_user_nickname + " 的转赠"; Global.alertMediator.addAlert("是否确定本次交易---" + i, function() { var i = GameConfig.SERVER_PATH + "deal/deal-confirm", n = { deal_id: e.deal_id }; t.SurePasswordPanel.instance.show(i, n, function(e) { 0 == e.status ? (t.EventManager.instance.dispatch(SysNotify.FLUSH_GROUP3), PopUpManager.popTip("本次交易完成"), t.AppFacade.getInstance().sendNotification(PanelNotify.CLOSE_FRIEND_GIVE_LIST)) : TipsUtils.showErrorCodeTips(e.status) }) }, null, !0) }, i.NAME = "FriendGiveMediator", i } (BaseMediator); t.FriendGiveMediator = e, __reflect(e.prototype, "game.FriendGiveMediator") } (game || (game = {})); var game; ! function(t) { var e = function(e) { function i() { return e.call(this, "FriendMediator") || this } return __extends(i, e), i.prototype.listNotificationInterests = function() { return [PanelNotify.OPEN_FRIEND, PanelNotify.CLOSE_FRIEND, PanelNotify.HIDE_FRIEND, PanelNotify.SHOW_FRIEND] }, i.prototype.onRegister = function() { e.prototype.onRegister.call(this) }, i.prototype.showViewComponent = function(e, i) { void 0 === e && (e = 7), this.viewComponent = new t.FriendPanel(i), this.viewComponent.mediator = this, this.showUI(this.viewComponent, !0, 0, 0, e) }, i.prototype.handleNotification = function(e) { var i = e.getBody(); switch (e.getName()) { case PanelNotify.OPEN_FRIEND: this.showViewComponent(7, i.index), this.facade.registerMediator(new t.FriendAddMediator), this.facade.registerMediator(new t.FriendReqMediator); break; case PanelNotify.CLOSE_FRIEND: this.closeViewComponent(1), this.facade.removeMediator(t.FriendAddMediator.NAME), this.facade.removeMediator(t.FriendReqMediator.NAME); break; case PanelNotify.SHOW_FRIEND: this.hideViewComponent(!0); break; case PanelNotify.HIDE_FRIEND: this.hideViewComponent(!1) } }, i.prototype.getFriendList = function(t, e, i, n) { var a = GameConfig.SERVER_PATH + "friend/friend-list", o = { type: t, count: i, offset: e * i }; Global.netProxy.sendRequest(a, o, function(t) { return 0 !== t.status ? void TipsUtils.showErrorCodeTips(t.status) : void(n && n(t.data)) }) }, i.prototype.getRankList = function(t, e, i, n) { var a = GameConfig.SERVER_PATH + "comm/get-level-ranking", o = { type: t, count: i, offset: e * i }; Global.netProxy.sendRequest(a, o, function(t) { return 0 !== t.status ? void TipsUtils.showErrorCodeTips(t.status) : void(n && n(t.data)) }) }, i.NAME = "FriendMediator", i } (BaseMediator); t.FriendMediator = e, __reflect(e.prototype, "game.FriendMediator") } (game || (game = {})); var game; ! function(t) { var e = function(e) { function i() { return e.call(this, "FriendReqMediator") || this } return __extends(i, e), i.prototype.listNotificationInterests = function() { return [PanelNotify.OPEN_FRIEND_ADD_REQ, PanelNotify.CLOSE_FRIEND_ADD_REQ] }, i.prototype.onRegister = function() { e.prototype.onRegister.call(this) }, i.prototype.showViewComponent = function(e) { void 0 === e && (e = 7), this.viewComponent = new t.FriendAddReqPanel, this.viewComponent.mediator = this, this.showUI(this.viewComponent, !0, 0, 0, e) }, i.prototype.handleNotification = function(t) { t.getBody(); switch (t.getName()) { case PanelNotify.OPEN_FRIEND_ADD_REQ: this.showViewComponent(7); break; case PanelNotify.CLOSE_FRIEND_ADD_REQ: this.closeViewComponent(1) } }, i.prototype.applyList = function(t, e, i) { var n = GameConfig.SERVER_PATH + "friend/get-respond-list"; Global.netProxy.sendRequest(n, { offset: t, count: e }, function(t) { i && i(t.data) }) }, i.prototype.applyAllReq = function(t, e) { var i = this, n = GameConfig.SERVER_PATH + "friend/respond-list"; Global.netProxy.sendRequest(n, { type: t }, function(e) { return 0 == e.status ? (1 === t ? PopUpManager.popTip("通过了全部好友请求") : 2 == t && PopUpManager.popTip("拒绝了全部通过请求"), void i.closeViewComponent(1)) : void TipsUtils.showErrorCodeTips(e.status) }) }, i.prototype.applyResult = function(t, e, i) { var n = GameConfig.SERVER_PATH + "friend/respond", a = { type: t, respond_user_id: e }; Global.netProxy.sendRequest(n, a, function(e) { return 0 == e.status ? (1 === t ? PopUpManager.popTip("通过了好友请求") : 2 == t && PopUpManager.popTip("拒绝了好友请求"), void(i && i(e.data))) : void TipsUtils.showErrorCodeTips(e.status) }) }, i.NAME = "FriendReqMediator", i } (BaseMediator); t.FriendReqMediator = e, __reflect(e.prototype, "game.FriendReqMediator") } (game || (game = {})); var MofahechengManager = function(t) { function e() { return t.call(this) || this } return __extends(e, t), e.getInstance = function() { return this._instance || (this._instance = new e), this._instance }, e.prototype.sendNetJiagong = function() { var t = this.curData.goods_id, e = t.split(":"), i = (e[0], parseInt(e[1])); Global.netProxy.sendRequest(GameConfig.SERVER_PATH + "compose/do", { compose_id: this.curData.id, count: i }, this.onSendNetJiagong.bind(this)) }, e.prototype.onSendNetJiagong = function(t) { return __awaiter(this, void 0, void 0, function() { var e, i, n, a, o, s, r, h; return __generator(this, function(l) { if (0 == t.status) { Global.audioProxy.playSound("jiagongsuc_mp3"), e = this.curData.goods_id, i = e.split(":"), n = i[0], a = parseInt(i[1]), o = Global.gameProxy.getItemConfig(n).name, Global.playerProxy.updateWareHouseItem({ item_id: n }, a), TipsUtils.showTipsDownToUp("获得[" + o + "]X" + a), s = parseInt(this.curData.experience), Global.playerProxy.addExp(s), egret.setTimeout(function() { TipsUtils.showTipsDownToUp("获得[经验]X" + this.curData.experience) }, this, 500), r = ""; for (h in this.curData)("fruit_id1" == h || "fruit_id2" == h || "fruit_id3" == h || "fruit_id4" == h || "fruit_id5" == h || "fruit_id6" == h) && (r = this.curData[h] + ",", Global.playerProxy.sellWareHouseItem1(r)); game.EventManager.instance.dispatch(SysNotify.TOPLAYER_INFO_UPDATE), game.EventManager.instance.dispatch(SysNotify.MOFAHECHENG_UPDATA) } else TipsUtils.showTipsDownToUp(GameConfig.ServerCode[t.status]); return [2] }) }) }, e } (egret.EventDispatcher); __reflect(MofahechengManager.prototype, "MofahechengManager"); var game; ! function(t) { var e = function(t) { function e() { var e = t.call(this, "MofahechengMidter") || this; return e.groupName = "mofahecheng_json", e } return __extends(e, t), e.prototype.listNotificationInterests = function() { return [PanelNotify.OPEN_MOFAHECHENG, PanelNotify.CLOSE_MOFAHECHENG] }, e.prototype.onRegister = function() { t.prototype.onRegister.call(this) }, e.prototype.showViewComponent = function(t) { void 0 === t && (t = 7), this.viewComponent = new MofahechengPanel, this.showUI(this.viewComponent, !0, 0, 0, t) }, e.prototype.handleNotification = function(t) { t.getBody(); switch (t.getName()) { case PanelNotify.OPEN_MOFAHECHENG: this.showViewComponent(10); break; case PanelNotify.CLOSE_MOFAHECHENG: this.closeViewComponent(10) } }, e.NAME = "MofahechengMidter", e } (BaseMediator); t.MofahechengMidter = e, __reflect(e.prototype, "game.MofahechengMidter") } (game || (game = {})); var MofahechengPanel = function(t) { function e() { var e = t.call(this) || this; return e.unitarr = [], e.radioArr = [], e.skinName = MofahechengPanelSkin, e } return __extends(e, t), e.prototype.partAdded = function(e, i) { t.prototype.partAdded.call(this, e, i) }, e.prototype.childrenCreated = function() { t.prototype.childrenCreated.call(this), this.commonPanel.closeBtn.y = 600, this.commonPanel.closeBtn.label = "离开", this.init() }, e.prototype.init = function() { this.unitarr.length = 0, this.unitarr.push(this.unit0), this.unitarr.push(this.unit1), this.unitarr.push(this.unit2), this.unitarr.push(this.unit3), this.unitarr.push(this.unit4), this.radioArr.length = 0, this.likaiBtn.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTab, this), this.radioGroup = new eui.RadioButtonGroup, this.radio0.group = this.radioGroup, this.radioArr.push(this.radio0), this.radio1.group = this.radioGroup, this.radioArr.push(this.radio1), this.radio2.group = this.radioGroup, this.radioArr.push(this.radio2), this.radio3.group = this.radioGroup, this.radioArr.push(this.radio3), this.radio4.group = this.radioGroup, this.radioArr.push(this.radio4), this.radioGroup.addEventListener(egret.Event.CHANGE, this.onRadiochange, this), this.radio0.selected = !0, game.UIUtils.addShortTouch(this.zhizuoButton, this.onZhizuo, null), game.EventManager.instance.addEvent(SysNotify.MOFAHECHENG_UPDATA, this.sysMofahechengUpdata, this), this.initData() }, e.prototype.sysMofahechengUpdata = function() { this.updataAll() }, e.prototype.uninit = function() { this.likaiBtn.removeEventListener(egret.TouchEvent.TOUCH_TAP, this.onTab, this), this.radioGroup.removeEventListener(egret.Event.CHANGE, this.onRadiochange, this), this.radioGroup = null }, e.prototype.createChildren = function() { t.prototype.createChildren.call(this), this.isFullScreen = !0, this.isVisibleAnimate = !0, this.commonPanel.setPanelWidth(640), this.commonPanel.setPanelHeight(800), this.commonPanel.setTitle("mofahecheng_json.mofahecheng_title_png") }, e.prototype.initData = function() { for (var t = 0, e = Global.gameProxy.getCurhechengArrforLV(t), i = 0; i < e.length; i++) { var n = e[i], a = this.radioArr[i]; a.value = n; var o = n.goods_id; if ("" != o) { var s = o.split(":"), r = Global.gameProxy.getItemImageId(s[0]); a.icons.source = r + "_png", 0 == i && (MofahechengManager.getInstance().curData = e[i]) } } this.updataAll() }, e.prototype.updataAll = function() { var t = MofahechengManager.getInstance().curData, e = t.fruit_id1, i = e.split(":"), n = i[0], a = Global.playerProxy.getHasItemByItemId(n), o = a ? a.number: 0, s = 1; for (var r in t) if (r == "fruit_id" + s && 6 > s) { var e = t[r]; if ("" != t[r]) { var i = e.split(":"), h = Global.gameProxy.getItemImageId(i[0]); this.unitarr[s - 1].icons.source = h + "_png"; var l = parseInt(i[1]); if (o >= s * l) this.unitarr[s - 1].numLabel.text = l + "/" + l, this.unitarr[s - 1].numLabel.textColor = 16777215; else { var c = o - l * s; c = c > -l ? l + c: 0, this.unitarr[s - 1].numLabel.text = c + "/" + l, this.unitarr[s - 1].numLabel.textColor = 16188462 } var p = new SimpleItemData(Global.gameProxy.getItemConfig(i[0])); this.unitarr[s - 1].itemData = p, s++ } } var u = t.fruit_id6; if ("" != u) { var d = u.split(":"); this.goldLabel.text = d[1] } }, e.prototype.onRadiochange = function(t) { var e = this.radioGroup.selectedValue; MofahechengManager.getInstance().curData = e, this.updataAll() }, e.prototype.onTab = function() { game.AppFacade.getInstance().sendNotification(PanelNotify.CLOSE_MOFAHECHENG) }, e.prototype.onZhizuo = function() { MofahechengManager.getInstance().sendNetJiagong() }, e } (game.BasePanel); __reflect(MofahechengPanel.prototype, "MofahechengPanel"); var MofahechengRadioButton = function(t) { function e() { return t.call(this) || this } return __extends(e, t), e.prototype.partAdded = function(e, i) { t.prototype.partAdded.call(this, e, i) }, e.prototype.childrenCreated = function() { t.prototype.childrenCreated.call(this), game.UIUtils.addShortTouch(this.icons, this.onShortTouchBegan.bind(this), this.onShortTouchEnd.bind(this)) }, e.prototype.onShortTouchBegan = function() { this.itemData && game.ItemTip.show(this.itemData, this.icons.localToGlobal(this.icons.width / 2, this.icons.height / 2)) }, e.prototype.onShortTouchEnd = function() { game.ItemTip.hide() }, e } (eui.RadioButton); __reflect(MofahechengRadioButton.prototype, "MofahechengRadioButton"); var MofahechengUnit = function(t) { function e() { return t.call(this) || this } return __extends(e, t), e.prototype.partAdded = function(e, i) { t.prototype.partAdded.call(this, e, i) }, e.prototype.childrenCreated = function() { t.prototype.childrenCreated.call(this), game.UIUtils.addShortTouch(this.icons, this.onShortTouchBegan.bind(this), this.onShortTouchEnd.bind(this)) }, e.prototype.onShortTouchBegan = function() { this.itemData && game.ItemTip.show(this.itemData, this.icons.localToGlobal(this.icons.width / 2, this.icons.height / 2)) }, e.prototype.onShortTouchEnd = function() { game.ItemTip.hide() }, e } (eui.Component); __reflect(MofahechengUnit.prototype, "MofahechengUnit"); var MofajaigongItemRender = function(t) { function e() { var e = t.call(this) || this; return e.index = 0, e.skinName = MofajaigongItemRenderSkin, e } return __extends(e, t), e.prototype.partAdded = function(e, i) { t.prototype.partAdded.call(this, e, i) }, e.prototype.childrenCreated = function() { t.prototype.childrenCreated.call(this), this.iconImg.touchEnabled = !0 }, e } (eui.RadioButton); __reflect(MofajaigongItemRender.prototype, "MofajaigongItemRender"); var MofajaigongPanel2 = function(t) { function e() { var e = t.call(this) || this; return e.unitarr = [], e.skinName = Mofajiagong2PanelSkin, e } return __extends(e, t), e.prototype.partAdded = function(e, i) { t.prototype.partAdded.call(this, e, i) }, e.prototype.childrenCreated = function() { t.prototype.childrenCreated.call(this), game.EventManager.instance.addEvent(SysNotify.MOFAJIAGONG_UPDATA, this.sysMofaUpdata, this), game.UIUtils.addShortTouch(this.shengjiButton, this.onShengjiButtonBegin, this.onShengjiButtonEnd), this.updata() }, e.prototype.sysMofaUpdata = function() { this.updata() }, e.prototype.onShengjiButtonBegin = function() { MofaManager.getInstance().sendNetupLevel() }, e.prototype.onShengjiButtonEnd = function() {}, e.prototype.updata = function() { this.unitarr.length = 0, this.unitarr.push(this.unit0), this.unitarr.push(this.unit1), this.unitarr.push(this.unit2), this.unitarr.push(this.unit3), this.unitarr.push(this.unit4); var t = Global.playerProxy.playerData.factory_level, e = Global.playerProxy.playerData.factory_exp, i = Global.gameProxy.getFactoryConfigForID(t + 1); if (i || (i = Global.gameProxy.getFactoryConfigForID(t)), i) { var n = 1; for (var a in i) if (a == "fruit_id" + n) { var o = i[a]; if ("" != o) { var s = o.split(":"); 1 == s.length && (s.length = 0, s = o.split(":")); var r = Global.gameProxy.getItemImageId(s[0]); this.unitarr[n - 1].setIcon(r + "_png"), this.unitarr[n - 1].setNum(parseInt(s[1])); var h = new SimpleItemData(Global.gameProxy.getItemConfig(s[0])); this.unitarr[n - 1].itemData = h, n++ } } var l = e, c = i.experience; this.prossbar.setPross(l, c), this.goldLabel.text = i.gold, 0 == t ? this.imgbgfang.source = "mofajiagong_tubiao_png": 3 == t ? this.imgbgfang.source = "mofajiagongbtn3_png": this.imgbgfang.source = "mofajiagong_btn" + t + "_png", this.iconImg.source = "3002_png" } }, e } (eui.Component); __reflect(MofajaigongPanel2.prototype, "MofajaigongPanel2", ["eui.UIComponent", "egret.DisplayObject"]); var MofajaigongUnitItem = function(t) { function e() { return t.call(this) || this } return __extends(e, t), e.prototype.partAdded = function(e, i) { t.prototype.partAdded.call(this, e, i) }, e.prototype.childrenCreated = function() { t.prototype.childrenCreated.call(this), game.UIUtils.addShortTouch(this.iconImg, this.onShortTouchBegan.bind(this), this.onShortTouchEnd.bind(this)) }, e.prototype.onShortTouchBegan = function() { this.itemData && game.ItemTip.show(this.itemData, this.iconImg.localToGlobal(this.iconImg.width / 2, this.iconImg.height / 2)) }, e.prototype.onShortTouchEnd = function() { game.ItemTip.hide() }, e.prototype.setIcon = function(t) { "" == t ? this.iconImg.visible = !1 : this.iconImg.visible = !0, this.iconImg.source = t }, e.prototype.setNum = function(t) { 0 == t ? this.numlabel.visible = !1 : this.numlabel.visible = !0, this.numlabel.text = "X" + t }, e.prototype.dataChanged = function() { t.prototype.dataChanged.call(this) }, e } (eui.ItemRenderer); __reflect(MofajaigongUnitItem.prototype, "MofajaigongUnitItem"); var MOfajiagongChangeButton = function(t) { function e() { return t.call(this) || this } return __extends(e, t), e } (eui.RadioButton); __reflect(MOfajiagongChangeButton.prototype, "MOfajiagongChangeButton"); var game; ! function(t) { var e = function(e) { function i() { return e.call(this, "MofajiagongMediter") || this } return __extends(i, e), i.prototype.listNotificationInterests = function() { return [PanelNotify.OPEN_MOFA, PanelNotify.CLOSE_MOFA] }, i.prototype.onRegister = function() { e.prototype.onRegister.call(this) }, i.prototype.showViewComponent = function(e) { void 0 === e && (e = 7), this.viewComponent = new t.MofaJiaGongPanel, this.showUI(this.viewComponent, !0, 0, 0, e) }, i.prototype.handleNotification = function(t) { t.getBody(); switch (t.getName()) { case PanelNotify.OPEN_MOFA: this.showViewComponent(10); break; case PanelNotify.CLOSE_MOFA: this.closeViewComponent(10) } }, i.NAME = "MofajiagongMediter", i } (BaseMediator); t.MofajiagongMediter = e, __reflect(e.prototype, "game.MofajiagongMediter") } (game || (game = {})); var game; ! function(t) { var e = function(e) { function i() { var t = e.call(this) || this; return t.skinName = MofajiagongPanelSkin, t } return __extends(i, e), i.prototype.onAdded = function() { e.prototype.onAdded.call(this) }, i.prototype.onRemoved = function() { e.prototype.onRemoved.call(this), this.radioButtonGroup.removeEventListener(egret.Event.CHANGE, this.change, this) }, i.prototype.createChildren = function() { e.prototype.createChildren.call(this), this.commonPanel.setPanelWidth(640), this.commonPanel.setPanelHeight(900), this.commonPanel.setTitle("mofajiagong_title_png") }, i.prototype.childrenCreated = function() { e.prototype.childrenCreated.call(this), this.commonPanel.closeBtn.y = 900, this.commonPanel.closeBtn.label = "离开", this.radioButtonGroup = new eui.RadioButtonGroup, this.radioButtonGroup.addEventListener(egret.Event.CHANGE, this.change, this), this.radioButton0.group = this.radioButtonGroup, this.radioButton0.value = 0, this.radioButton1.group = this.radioButtonGroup, this.radioButton1.value = 1, this.radioButton0.selected = !0, this.panel1.visible = !0, this.panel2.visible = !1 }, i.prototype.change = function(t) { 0 == this.radioButtonGroup.selectedValue ? (this.panel1.visible = !0, this.panel2.visible = !1) : (this.panel2.visible = !0, this.panel1.visible = !1) }, i.prototype.btnCloseTouchEnded = function() { t.AppFacade.getInstance().sendNotification(PanelNotify.CLOSE_MOFA) }, i } (t.BasePanel); t.MofaJiaGongPanel = e, __reflect(e.prototype, "game.MofaJiaGongPanel") } (game || (game = {})); var MofajiagongPanel1 = function(t) { function e() { var e = t.call(this) || this; return e.skinName = Mofajiagong1PanelSkin, e.groups = new eui.Group, e } return __extends(e, t), e.prototype.partAdded = function(e, i) { t.prototype.partAdded.call(this, e, i) }, e.prototype.childrenCreated = function() { t.prototype.childrenCreated.call(this), this.scrolls.viewport = this.groups, this.scrolls.scrollPolicyH = eui.ScrollPolicy.ON, this.scrolls.scrollPolicyV = eui.ScrollPolicy.OFF, this.btnjian.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onBtnJian, this), this.btnjia.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onBtnJia, this), this.labelNum.addEventListener(egret.Event.CHANGE, this.onTextChange, this), this.btnjiagong.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onJiagong, this), game.EventManager.instance.addEvent(SysNotify.MOFAJIAGONG_UPDATA, this.sysMofaUpdata, this), this.leftButton.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onLeft, this), this.rightButton.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onRight, this), this.init() }, e.prototype.onTextChange = function(t) { var e = RegUtils.isInteger(this.labelNum.text); e || (this.labelNum.text = "1"), MofaManager.getInstance().curNum = parseInt(this.labelNum.text), this.updataAll() }, e.prototype.onLeft = function(t) { var e = this, i = this.gs.selection, n = i.index; if (n - 1 >= 0) { var a = this.groups.getChildAt(n - 1); a.selected = !0, MofaManager.getInstance().curFactoryData = a.value, egret.callLater(function() { e.scrolls.viewport.validateNow(), e.scrolls.viewport.scrollH -= a.width }, this) } this.updataAll() }, e.prototype.onRight = function(t) { var e = this, i = this.gs.selection, n = i.index; if (n + 1 < this.groups.numChildren) { var a = this.groups.getChildAt(n + 1); a.selected = !0, MofaManager.getInstance().curFactoryData = a.value, egret.callLater(function() { e.scrolls.viewport.validateNow(), e.scrolls.viewport.scrollH += a.width }, this) } this.updataAll() }, e.prototype.onJiagong = function() { MofaManager.getInstance().sendNetJiagong() }, e.prototype.sysMofaUpdata = function() { this.updataAll() }, e.prototype.init = function() { var t = Global.gameProxy.getCurItemArrforFactoryLV(Global.playerProxy.playerData.factory_level); this.updataRadioGroup(t) }, e.prototype.updataAll = function() { this.updataDesGroup(), this.updataItem() }, e.prototype.updataRadioGroup = function(t) { MofaManager.getInstance().curNum = 1, this.groups.removeChildren(), this.labelNum.text = MofaManager.getInstance().curNum.toString(), this.gs = new eui.RadioButtonGroup; for (var e = 0; e < t.length; e++) { var i = new MofajaigongItemRender, n = t[e].goods_id; if ("" != n) { var a = n.split(":"), o = a[0], s = (a[1], Global.gameProxy.getItemImageId(o)); i.iconImg.source = s + "_png", i.numlabel.text = ""; var r = new SimpleItemData(Global.gameProxy.getItemConfig(o)); i.itemData = r, this.groups.addChild(i), i.index = e, i.x = i.width * e, i.group = this.gs, i.value = t[e], 0 == e && (i.selected = !0, MofaManager.getInstance().curFactoryData = t[e], this.updataAll()) } } this.scrolls.viewport = this.groups, this.gs.addEventListener(egret.Event.CHANGE, this.onChange, this) }, e.prototype.onChange = function(t) { var e = this.gs.selectedValue; MofaManager.getInstance().curFactoryData = e, this.updataAll() }, e.prototype.updataDesGroup = function() { var t = MofaManager.getInstance().curFactoryData, e = t.goods_id, i = e.split(":"), n = i[0], a = Global.gameProxy.getItemConfig(n); this.labelLan.text = a.name, this.DesLabel.text = a.desc; var o = t.fruit_id4, s = o.split(":"), r = parseInt(s[1]), h = MofaManager.getInstance().curNum; this.labeljiagongNum.text = (r * h).toString(), "105002" == s[0] ? MofaManager.getInstance().type = 1 : MofaManager.getInstance().type = 0, this.icons.source = Global.gameProxy.getItemImageId(s[0]) + "_png", this.labelNum.text = MofaManager.getInstance().curNum.toString() }, e.prototype.updataItem = function() { var t = MofaManager.getInstance().curFactoryData; for (var e in t) { if ("fruit_id1" == e && "" != t[e]) { var i = t[e], n = i.split(":"); this.unit0.setNum(parseInt(n[1])); var a = Global.gameProxy.getItemImageId(n[0]); this.unit0.setIcon(a + "_png"); var o = new SimpleItemData(Global.gameProxy.getItemConfig(n[0])); this.unit0.itemData = o } if ("fruit_id2" == e && "" != t[e]) { var i = t[e], n = i.split(":"); this.unit1.setNum(parseInt(n[1])); var a = Global.gameProxy.getItemImageId(n[0]); this.unit1.setIcon(a + "_png"); var o = new SimpleItemData(Global.gameProxy.getItemConfig(n[0])); this.unit1.itemData = o } if ("fruit_id3" == e && "" != t[e]) { var i = t[e], n = i.split(":"); this.unit2.setNum(parseInt(n[1])); var a = Global.gameProxy.getItemImageId(n[0]); this.unit2.setIcon(a + "_png"); var o = new SimpleItemData(Global.gameProxy.getItemConfig(n[0])); this.unit2.itemData = o } } var s = t.goods_id; if ("" != s) { var r = s.split(":"), h = Global.gameProxy.getItemImageId(r[0]); this.hechengIcon.source = h + "_png" } }, e.prototype.onBtnJian = function(t) { var e = MofaManager.getInstance().curNum; e > 1 ? MofaManager.getInstance().curNum -= 1 : MofaManager.getInstance().curNum = 1, this.updataAll() }, e.prototype.onBtnJia = function(t) { var e = MofaManager.getInstance().curNum; 99 > e ? MofaManager.getInstance().curNum += 1 : MofaManager.getInstance().curNum = 99, this.updataAll() }, e } (eui.Component); __reflect(MofajiagongPanel1.prototype, "MofajiagongPanel1"); var MofaManager = function(t) { function e() { var e = t.call(this) || this; return e.curNum = 1, e.type = 1, e } return __extends(e, t), e.getInstance = function() { return this._insatance || (this._insatance = new e), this._insatance }, e.prototype.sendNetJiagong = function() { var t = this.curFactoryData.id; Global.netProxy.sendRequest(GameConfig.SERVER_PATH + "factory/do", { factory_id: t, count: this.curNum }, this.onSendNetJiagong.bind(this)) }, e.prototype.onSendNetJiagong = function(t) { if (0 === t.status) { Global.audioProxy.playSound("jiagongsuc_mp3"); var e = this.curFactoryData.goods_id; Global.playerProxy.addItem1(e); var i = parseInt(this.curFactoryData.experience); Global.playerProxy.addExp(i); for (var n in this.curFactoryData) if ("fruit_id1" == n || "fruit_id2" == n || "fruit_id3" == n || "fruit_id4" == n) { var a = this.curFactoryData[n], o = a.split(":"), s = o[0], r = parseInt(o[1]); "105001" == s ? Global.playerProxy.playerData.gem -= r * this.curNum: "105002" == s ? Global.playerProxy.playerData.gold -= r * this.curNum: Global.playerProxy.sellWareHouseItem({ id: s }, r * this.curNum) } game.EventManager.instance.dispatch(SysNotify.TOPLAYER_INFO_UPDATE), game.EventManager.instance.dispatch(SysNotify.MOFAJIAGONG_UPDATA) } else TipsUtils.showTipsDownToUp(GameConfig.ServerCode[t.status]) }, e.prototype.sendNetupLevel = function() { Global.netProxy.sendRequest(GameConfig.SERVER_PATH + "factory/upgrade", {}, this.onSendnetupLevel.bind(this)) }, e.prototype.onSendnetupLevel = function(t) { if (0 == t.status) { Global.audioProxy.playSound("jiagongsuc_mp3"); var e = Global.playerProxy.playerData.factory_level, i = Global.gameProxy.getFactoryConfigForID(e + 1); if (i) { var n = Global.playerProxy.playerData.factory_exp += i.effect_plus_experience; n >= i.experience && (Global.playerProxy.playerData.factory_level += 1, Global.playerProxy.playerData.factory_exp = n - i.experience), TipsUtils.showTipsDownToUp("经验增加+" + i.effect_plus_experience); var a = ""; for (var o in i)("fruit_id1" == o || "fruit_id2" == o || "fruit_id3" == o || "fruit_id4" == o || "fruit_id5" == o) && (a += i[o] + ","); Global.playerProxy.sellWareHouseItem1(a), Global.playerProxy.playerData.gold -= i.gold } else console.log("配置错误加工厂等级" + e + "不存在"); game.EventManager.instance.dispatch(SysNotify.TOPLAYER_INFO_UPDATE), game.EventManager.instance.dispatch(SysNotify.MOFAJIAGONG_UPDATA) } else TipsUtils.showTipsDownToUp(GameConfig.ServerCode[t.status]) }, e } (egret.EventDispatcher); __reflect(MofaManager.prototype, "MofaManager"); var MofaProssBar = function(t) { function e() { return t.call(this) || this } return __extends(e, t), e.prototype.partAdded = function(e, i) { t.prototype.partAdded.call(this, e, i) }, e.prototype.childrenCreated = function() { t.prototype.childrenCreated.call(this), this.imgGroup.mask = this.imgmask }, e.prototype.setPross = function(t, e) { var i = t / e; this.imgpross.x = this.imgpross.width * i - this.imgpross.width, this.prossLabel.text = t + "/" + e }, e } (eui.Component); __reflect(MofaProssBar.prototype, "MofaProssBar"); var SimpleItemData = function() { function t(t) { this.config = {}, this.icons = "", this.name = "", this.des = "", this.config.icon = t.graphical_id, this.config.desc = t.desc, this.config.name = t.name } return t } (); __reflect(SimpleItemData.prototype, "SimpleItemData"); var SignMediter = function(t) { function e() { var e = t.call(this, "SignMediter") || this; return e.groupName = "SignMediter", e } return __extends(e, t), e.prototype.listNotificationInterests = function() { return [PanelNotify.OPEN_SIGN, PanelNotify.CLOSE_SIGN] }, e.prototype.onRegister = function() { t.prototype.onRegister.call(this) }, e.prototype.showViewComponent = function(t) { void 0 === t && (t = 7), this.viewComponent = new SignPanel, this.showUI(this.viewComponent, !0, 0, 0, t) }, e.prototype.handleNotification = function(t) { t.getBody(); switch (t.getName()) { case PanelNotify.OPEN_SIGN: Global.netProxy.sendRequest(GameConfig.SERVER_PATH + "comm/sign-list", {}, this.onGetSign.bind(this)); break; case PanelNotify.CLOSE_SIGN: this.closeViewComponent() } }, e.prototype.onGetSign = function(t) { if (0 == t.status) { SignsManager.getInstance().hasNetSignData = t.data.list; var e = t.data.continue_list; SignsManager.getInstance().count = e.length, SignsManager.getInstance().inithasSign(), SignsManager.getInstance().updata(), SignsManager.getInstance().getReward() ? game.AppFacade.getInstance().sendNotification(PanelNotify.OPEN_SIGN_LIAN) : this.showViewComponent(7) } }, e.NAME = "SignMediter", e } (BaseMediator); __reflect(SignMediter.prototype, "SignMediter"); var SignPanel = function(t) { function e() { var e = t.call(this) || this; return e.boxArr = [], e.maskArr = [], e.imgGetArr = [], e.imgIconArr = [], e.labelNumArr = [], e.skinName = SignPanelSkin, e.addEventListener(egret.Event.REMOVED_FROM_STAGE, e.onRemoeved, e), e.addEventListener(egret.Event.ADDED_TO_STAGE, e.onAdded, e), e.scaleX = GameConfig.curWidth() / Const.DESGIN_W, e.scaleY = GameConfig.curHeight() / Const.DESGIN_H, e } return __extends(e, t), e.prototype.childrenCreated = function() { t.prototype.childrenCreated.call(this), this.boxArr.push(this.imgBox1), this.boxArr.push(this.imgBox2), this.boxArr.push(this.imgBox3), this.maskArr.push(this.rectMask1), this.maskArr.push(this.rectMask2), this.maskArr.push(this.rectMask3), this.maskArr.push(this.rectMask4), this.maskArr.push(this.rectMask5), this.maskArr.push(this.rectMask6), this.maskArr.push(this.rectMask7), this.imgLineLight.mask = this.groupMask, this.imgGetArr.push(this.imgGet1), this.imgGetArr.push(this.imgGet2), this.imgGetArr.push(this.imgGet3), this.imgGetArr.push(this.imgGet4), this.imgGetArr.push(this.imgGet5), this.imgGetArr.push(this.imgGet6), this.imgGetArr.push(this.imgGet7), this.imgIconArr.push(this.imgIcon1), this.imgIconArr.push(this.imgIcon2), this.imgIconArr.push(this.imgIcon3), this.imgIconArr.push(this.imgIcon4), this.imgIconArr.push(this.imgIcon5), this.imgIconArr.push(this.imgIcon6), this.imgIconArr.push(this.imgIcon7), this.labelNumArr.push(this.labelNum1), this.labelNumArr.push(this.labelNum2), this.labelNumArr.push(this.labelNum3), this.labelNumArr.push(this.labelNum4), this.labelNumArr.push(this.labelNum5), this.labelNumArr.push(this.labelNum6), this.labelNumArr.push(this.labelNum7), game.UIUtils.addShortTouch(this.btnSign, this.onSigns.bind(this), null), game.UIUtils.addShortTouch(this.btnAddSign, this.onAddSigns.bind(this), null); for (var e = 0; e < this.boxArr.length; e++) game.UIUtils.addShortTouch(this.boxArr[e], this.onBox.bind(this), null); this.btnClose.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onClose, this), game.UIUtils.addButtonScaleEffects(this), this.prossbar.prossLabel.visible = !1, this.updata(), GuideManager.getInsatance().isShowGuide && 2 == GuideManager.getInsatance().target && 0 == GuideManager.getInsatance().step && (GuideManager.getInsatance().des = TextConst.textObj[9], GuideManager.getInsatance().show(this.btnSign)) }, e.prototype.onRemoeved = function() { game.EventManager.instance.removeEvent(SysNotify.GETSIGNS_UPDATA, this.onUpdata, this) }, e.prototype.onAdded = function() { game.EventManager.instance.addEvent(SysNotify.GETSIGNS_UPDATA, this.onUpdata, this) }, e.prototype.onClose = function(t) { if (game.AppFacade.instance.sendNotification(PanelNotify.CLOSE_SIGN), GuideManager.getInsatance().isShowGuide && 3 == GuideManager.getInsatance().target && 0 == GuideManager.getInsatance().step) { GuideManager.getInsatance().des = TextConst.textObj[11]; var e = game.AppFacade.getInstance().retrieveMediator(game.GameMediator.NAME); GuideManager.getInsatance().show(e.viewComponent.topLayer.btn7) } }, e.prototype.onUpdata = function() { this.updata() }, e.prototype.onSigns = function() { SignsManager.getInstance().sendNetsigns(); GuideManager.getInsatance().target, GuideManager.getInsatance().step; GuideManager.getInsatance().isShowGuide && 2 == GuideManager.getInsatance().target && 0 == GuideManager.getInsatance().step && (GuideManager.getInsatance().des = TextConst.textObj[10], GuideManager.getInsatance().show(this.btnClose), GuideManager.getInsatance().target = 3, GuideManager.getInsatance().sendNetMessage()) }, e.prototype.onAddSigns = function() { SignsManager.getInstance().sendNetBusigns() }, e.prototype.onBox = function() { game.AppFacade.getInstance().sendNotification(PanelNotify.OPEN_SIGN_LIAN) }, e.prototype.updata = function() { var t = SignsManager.getInstance().getVirtuyCount(); this.prossbar.setPross(t, 7); for (var e = SignsManager.getInstance().getCount(), i = 0; i < this.boxArr.length; i++) e > i ? this.boxArr[i].source = "sign_box1_png": this.boxArr[i].source = "sign_box0_png"; for (var i = 0; i < SignsManager.getInstance().signArr.length; i++) { var n = SignsManager.getInstance().signArr[i]; n.isqian ? (this.maskArr[i].visible = !0, this.imgGetArr[i].visible = !0) : (this.maskArr[i].visible = !1, this.imgGetArr[i].visible = !1); var a = n.days_id, o = a.split(":"), s = o[0], r = parseInt(o[1]), h = Global.gameProxy.getItemImageId(s); this.imgIconArr[i].source = h + "_png", this.labelNumArr[i].text = "X" + r, this.labelDayNum.text = SignsManager.getInstance().getVirtuyCount().toString() } var l = Global.playerProxy.getHasItemByItemId(103008); l ? this.labelCardNum.text = l.number + "": this.labelCardNum.text = "0" }, e } (eui.Component); __reflect(SignPanel.prototype, "SignPanel"); var SignsData = function() { function t(t) { this.isqian = !1, this.id = t.id, this.days_id = t.days_id, this.accumulation_id = t.accumulation_id, this.days = t.days, this.accumulation = t.accumulation } return t } (); __reflect(SignsData.prototype, "SignsData"); var SignsItem = function(t) { function e() { return t.call(this) || this } return __extends(e, t), e.prototype.partAdded = function(e, i) { t.prototype.partAdded.call(this, e, i) }, e.prototype.childrenCreated = function() { t.prototype.childrenCreated.call(this) }, e } (eui.Component); __reflect(SignsItem.prototype, "SignsItem"); var SignsManager = function(t) { function e() { var e = t.call(this) || this; return e.count = 0, e.signArr = [], e.hasNetSignData = [], e.hasSignData = [], e.countArr = [3, 5, 7], e } return __extends(e, t), e.getInstance = function() { return this._instance || (this._instance = new e), this._instance }, e.prototype.updata = function() { this.signArr.length = 0; var t = Global.gameProxy.getSignConfig(); for (var e in t) { var i = new SignsData(t[e]); this.signArr.push(i); for (var n = 0; n < this.hasSignData.length; n++) this.hasSignData[n].id == i.id && (i.isqian = !0) } }, e.prototype.inithasSign = function() { this.hasSignData.length = 0; for (var t = 0; t < this.hasNetSignData.length; t++) this.hasSignData.push({}), this.hasSignData[t].id = this.getIndexForTime(this.hasNetSignData[t].sign_time), this.hasSignData[t].time = this.hasNetSignData[t].sign_time }, e.prototype.getDataForID = function(t) { for (var e = 0; e < this.signArr.length; e++) if (this.signArr[e].id == t) return this.signArr[e]; return null }, e.prototype.getIndexForTime = function(t) { var e = new Date(1e3 * t), i = e.getDay(); return 0 == i && (i = 7), i }, e.prototype.sendNetsigns = function() { var t = this.getIndexForTime(DateTimer.instance.now); 0 == this.getDataForID(t).isqian ? (this.curid = t, Global.netProxy.sendRequest(GameConfig.SERVER_PATH + "comm/sign", {}, this.onGetSign.bind(this))) : TipsUtils.showTipsDownToUp("今日已签到") }, e.prototype.onGetSign = function(t) { if (0 == t.status) { var e = this.getDataForID(this.curid), i = e.days_id; Global.playerProxy.addItem1(i), e.isqian = !0, this.hasSignData.push({ id: e.id, time: DateTimer.instance.now }), this.updata(), game.EventManager.instance.dispatch(SysNotify.GETSIGNS_UPDATA), game.EventManager.instance.dispatch(SysNotify.TOPLAYER_INFO_UPDATE) } }, e.prototype.getcurbuID = function() { for (var t = this.signArr.length - 1; t >= 0; t--) { var e = parseInt(this.getIndexForTime(DateTimer.instance.now) + ""), i = parseInt(this.signArr[t].id + ""); if (0 == this.signArr[t].isqian && e > i) return i } return null }, e.prototype.sendNetBusigns = function() { this.bucurID = this.getcurbuID(), null != this.bucurID ? Global.netProxy.sendRequest(GameConfig.SERVER_PATH + "comm/sign-remedy", {}, this.onGetBuSign.bind(this)) : TipsUtils.showTipsDownToUp("当前不能补签") }, e.prototype.onGetBuSign = function(t) { if (0 == t.status) { var e = this.getDataForID(this.bucurID), i = e.days_id; Global.playerProxy.addItem1(i), Global.playerProxy.sellWareHouseItem({ id: 103008 }, 1), e.isqian = !0, this.hasSignData.push({ id: e.id, time: DateTimer.instance.now }), this.updata(), game.EventManager.instance.dispatch(SysNotify.GETSIGNS_UPDATA), game.EventManager.instance.dispatch(SysNotify.TOPLAYER_INFO_UPDATE) } else TipsUtils.showTipsDownToUp(GameConfig.ServerCode[t.status]) }, e.prototype.getVirtuyCount = function() { for (var t = 0, e = 0, i = 0, t = 0; t < this.signArr.length; t++) 1 == this.signArr[t].isqian ? (e++, e > i && (i = e)) : e = 0; return i }, e.prototype.getCount = function() { for (var t = 0, e = 0, i = 0, t = 0; t < this.signArr.length; t++) 1 == this.signArr[t].isqian ? (e++, e >= 3 && (i = e)) : e = 0; return i >= 3 && 5 > i ? 1 : i >= 5 && 7 > i ? 2 : 7 == i ? 3 : 0 }, e.prototype.getReward = function() { if (this.count < this.getCount()) { var t; return 0 == this.count ? (t = 3, this.getDataForID(t)) : 1 == this.count ? (t = 5, this.getDataForID(t)) : 2 == this.count ? (t = 7, this.getDataForID(t)) : null } return null }, e.prototype.getNetbigrewad = function() { this.curdata = this.getDataForID(this.countArr[this.count]), Global.netProxy.sendRequest(GameConfig.SERVER_PATH + "comm/get-continue-sign-gift", { user_id: Global.playerProxy.playerData.id, count: this.countArr[this.count] }, this.onGetBigRewardID.bind(this)) }, e.prototype.onGetBigRewardID = function(t) { if (0 == t.status) { var e = this.curdata, i = e.accumulation_id; Global.playerProxy.addItem1(i), this.count += 1, game.EventManager.instance.dispatch(SysNotify.GETSIGNS_UPDATA), game.EventManager.instance.dispatch(SysNotify.TOPLAYER_INFO_UPDATE) } }, e } (egret.EventDispatcher); __reflect(SignsManager.prototype, "SignsManager"); var SignsTipsMediter = function(t) { function e() { var e = t.call(this, "SignsTipsMediter") || this; return e.groupName = "SignsTipsMediter", e } return __extends(e, t), e.prototype.listNotificationInterests = function() { return [PanelNotify.OPEN_SIGN_LIAN, PanelNotify.CLOSE_SIGN_LIAN] }, e.prototype.onRegister = function() { t.prototype.onRegister.call(this) }, e.prototype.showViewComponent = function(t) { void 0 === t && (t = 7), this.viewComponent = new SignsTipsPanel, this.showUI(this.viewComponent, !0, 0, 0, t) }, e.prototype.handleNotification = function(t) { t.getBody(); switch (t.getName()) { case PanelNotify.OPEN_SIGN_LIAN: this.showViewComponent(7); break; case PanelNotify.CLOSE_SIGN_LIAN: this.closeViewComponent() } }, e.NAME = "SignsTipsMediter", e } (BaseMediator); __reflect(SignsTipsMediter.prototype, "SignsTipsMediter"); var SignsTipsPanel = function(t) { function e() { var e = t.call(this) || this; return e.itemArr = [], e.boxArr = [], e.skinName = SignTipSkin, e.addEventListener(egret.Event.REMOVED_FROM_STAGE, e.onRemoeved, e), e.addEventListener(egret.Event.ADDED_TO_STAGE, e.onAdded, e), e } return __extends(e, t), e.prototype.childrenCreated = function() { t.prototype.childrenCreated.call(this), this.itemArr.push(this.item0), this.itemArr.push(this.item1), this.itemArr.push(this.item2), this.boxArr.push(this.imgBox1), this.boxArr.push(this.imgBox2), this.boxArr.push(this.imgBox3), game.UIUtils.addShortTouch(this.getButton, this.onGetButton.bind(this), null), game.UIUtils.addShortTouch(this.btnClose, this.onClose.bind(this), null), game.UIUtils.addButtonScaleEffects(this), this.updata() }, e.prototype.onClose = function() { game.AppFacade.instance.sendNotification(PanelNotify.CLOSE_SIGN_LIAN) }, e.prototype.onRemoeved = function() { game.EventManager.instance.removeEvent(SysNotify.GETSIGNS_UPDATA, this.onUpdata, this) }, e.prototype.onAdded = function() { game.EventManager.instance.addEvent(SysNotify.GETSIGNS_UPDATA, this.onUpdata, this) }, e.prototype.onUpdata = function() { this.updata() }, e.prototype.updata = function() { var t = SignsManager.getInstance().getVirtuyCount(); this.prossbar.setPross(t, 7), this.prossbar.prossLabel.visible = !1; var e = -1; t >= 3 && 5 > t ? e = 0 : t >= 5 && 7 > t ? e = 1 : t >= 7 && (e = 2); for (var i = 0; i < this.boxArr.length; i++) e >= i ? this.boxArr[i].source = "sign_box1_png": this.boxArr[i].source = "sign_box0_png"; var n = SignsManager.getInstance().getReward(); n ? (this.disbalButton.visible = !1, this.getButton.visible = !0) : (this.getButton.visible = !1, this.disbalButton.visible = !0), null == n && (n = SignsManager.getInstance().getDataForID(7)); for (var a = n.accumulation_id, o = a.split(","), i = 0; i < o.length; i++) { var s = o[i], r = s.split(":"), h = r[0], l = parseInt(r[1]), c = Global.gameProxy.getItemImageId(h); this.itemArr[i].iconImg.source = c + "_png", this.itemArr[i].numLabel.text = "X" + l } this.dayLabel.text = SignsManager.getInstance().getVirtuyCount().toString() }, e.prototype.onGetButton = function() { SignsManager.getInstance().getNetbigrewad() }, e } (eui.Component); __reflect(SignsTipsPanel.prototype, "SignsTipsPanel"); var SportPanel = function(t) { function e() { var e = t.call(this) || this; return e.isFullScreen = !0, e.isVisibleAnimate = !0, e.skinName = SportsPanelSkin, e } return __extends(e, t), e.prototype.onAdded = function() { t.prototype.onAdded.call(this), game.EventManager.instance.addEvent(SysNotify.SPORT_UPDATA, this.updata, this) }, e.prototype.onRemoved = function() { t.prototype.onRemoved.call(this), game.EventManager.instance.removeEvent(SysNotify.SPORT_UPDATA, this.updata, this) }, e.prototype.createChildren = function() { t.prototype.createChildren.call(this), this.commonPanel.setPanelWidth(640), this.commonPanel.setPanelHeight(940), this.commonPanel.setTitleIcon(""), this.commonPanel.setTitle("sport_json.sport_sp3"), this.initTab(), GuideManager.getInsatance().isShowGuide && 9 == GuideManager.getInsatance().target && 0 == GuideManager.getInsatance().step && (GuideManager.getInsatance().setsVisable(!0), GuideManager.getInsatance().des = TextConst.textObj[36], GuideManager.getInsatance().show(this.btnClose, !1, 220, 883)) }, e.prototype.onShow = function() {}, e.prototype.childrenCreated = function() { t.prototype.childrenCreated.call(this), this.updata() }, e.prototype.updata = function() { this.ssc.visible = !1, this.src.visible = !1; var t = this.tab.selectIndex; switch (t) { case 0: this.ssc.visible = !0, this.ssc.updata(); break; case 1: this.src.visible = !0, this.src.updata() } }, e.prototype.initTab = function() { var t = ["竞技场", "竞技场排名"]; this.tab = new game.Tab(t, this.onTabItemClickCallback.bind(this)), this.tab.bottom = 0, this.groupbar.addChild(this.tab) }, e.prototype.onTabItemClickCallback = function(t) { this.updata() }, e.prototype.btnCloseTouchEnded = function() { game.AppFacade.getInstance().sendNotification(PanelNotify.CLOSE_SPORTS) }, e } (game.BasePanel); __reflect(SportPanel.prototype, "SportPanel"); var SportsItem0 = function(t) { function e() { return t.call(this) || this } return __extends(e, t), e.prototype.childrenCreated = function() { t.prototype.childrenCreated.call(this) }, e } (eui.Component); __reflect(SportsItem0.prototype, "SportsItem0"); var SportsItem1 = function(t) { function e() { return t.call(this) || this } return __extends(e, t), e.prototype.childrenCreated = function() { t.prototype.childrenCreated.call(this), this.sportButton.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onSports, this) }, e.prototype.onSports = function(t) { var e = SportsManager.getInstance().sports; if (e.myinfo.remaining_challenges_count > 0) { var i = Global.gameProxy.getCommonConfig(), n = parseFloat(e.myinfo.last_challenge_time) + i[21].min - DateTimer.instance.now; 0 >= n ? (BattleFruitManager.getInstance().openType = 0, game.AppFacade.instance.sendNotification(SceneNotify.OPEN_BATTLEPET, { uid: this.uid })) : TipsUtils.showTipsDownToUp("时间未到") } else TipsUtils.showTipsDownToUp("挑战次数不足") }, e } (eui.Component); __reflect(SportsItem1.prototype, "SportsItem1"); var SportsManager = function(t) { function e() { return t.call(this) || this } return __extends(e, t), e.getInstance = function() { return this._instance || (this._instance = new e), this._instance }, e.prototype.getSportInfo = function(t, e) { this.callBak = t, this.callObj = e, Global.netProxy.sendRequest(GameConfig.SERVER_PATH + "arena/get-rank-list", {}, this.onGetRankListInfoInfo.bind(this)) }, e.prototype.onGetRankListInfoInfo = function(t) { if (0 == t.status) { this.initSports(); for (var e = 0; e < t.data.list.length; e++) { var i = new BattleFriendInfo; i.readData(t.data.list[e]), this.sports.rankList.push(i) } Global.netProxy.sendRequest(GameConfig.SERVER_PATH + "arena/get-challenge-list", {}, this.onGetChallgeListInfo.bind(this)) } else TipsUtils.showTipsDownToUp(GameConfig.ServerCode[t.status]) }, e.prototype.onGetChallgeListInfo = function(t) { if (0 == t.status) { for (var e = 0; e < t.data.list.length; e++) { var i = new BattleFriendInfo; i.readData(t.data.list[e]), this.sports.areaList.push(i) } Global.netProxy.sendRequest(GameConfig.SERVER_PATH + "arena/get-arena", {}, this.onMyInfo.bind(this)) } else TipsUtils.showTipsDownToUp(GameConfig.ServerCode[t.status]) }, e.prototype.onMyInfo = function(t) { if (0 == t.status) { var e = new BattleFriendInfo; e.readData(t.data), this.sports.myinfo = e, Global.netProxy.sendRequest(GameConfig.SERVER_PATH + "arena/week-gift-list", {}, this.onRewardData.bind(this)) } else TipsUtils.showTipsDownToUp(GameConfig.ServerCode[t.status]) }, e.prototype.onRewardData = function(t) { 0 == t.status ? (this.sports.rewardData = t.data.list, this.callBak.call(this.callObj)) : TipsUtils.showTipsDownToUp(GameConfig.ServerCode[t.status]) }, e.prototype.initSports = function() { this.sports = new Sports }, e.prototype.sendNetEndGame = function() { Global.netProxy.sendRequest(GameConfig.SERVER_PATH + "arena/challenge", { type: BattleFruitManager.getInstance().battleData.result, be_user_id: BattleFruitManager.getInstance().friendData.id }, this.onSendNetEndGame.bind(this)) }, e.prototype.onSendNetEndGame = function(t) { 0 == t.status && (0 == BattleFruitManager.getInstance().battleData.result ? TipsUtils.showTipsDownToUp("挑战成功") : TipsUtils.showTipsDownToUp("挑战失败"), game.AppFacade.instance.sendNotification(SceneNotify.OPEN_MINE_GAME), game.AppFacade.instance.sendNotification(SceneNotify.CLOSE_BATTLEPET), game.AppFacade.instance.sendNotification(PanelNotify.OPEN_SPORTS), GuideManager.getInsatance().isShowGuide && 8 == GuideManager.getInsatance().target && 0 == GuideManager.getInsatance().step && (GuideManager.getInsatance().target = 9, GuideManager.getInsatance().step = 0, GuideManager.getInsatance().sendNetMessage())) }, e.prototype.sendNetGetReward = function() { Global.netProxy.sendRequest(GameConfig.SERVER_PATH + "arena/get-gift", {}, this.onSendNetGetReward.bind(this)) }, e.prototype.onSendNetGetReward = function(t) { if (0 == t.status) { var e = this.getRewardForIndex(this.sports.myinfo.last_week_index), i = e.fixed_id, n = e.fixed_id2, a = e.random_id; Global.playerProxy.addItem1(i + "," + n + "," + a), this.sports.myinfo.is_get_gift = 1, game.EventManager.instance.dispatch(SysNotify.TOPLAYER_INFO_UPDATE), game.EventManager.instance.dispatch(SysNotify.SPORT_UPDATA) } }, e.prototype.getRewardForIndex = function(t) { for (var e in this.sports.rewardData) { var i = this.sports.rewardData[e].ranking_mzx_id, n = this.sports.rewardData[e].ranking_min_id; if (t >= n && i >= t) return this.sports.rewardData[e] } return this.sports.rewardData[13] }, e } (egret.EventDispatcher); __reflect(SportsManager.prototype, "SportsManager"); var BattleFriendInfo = function() { function t() {} return t.prototype.readData = function(t) { this.id = t.id, this.user_id = t.user_id, this.nickname = t.nickname, this.index = t.index, this.score = t.score, this.fighting_capacity = t.fighting_capacity, this.pet_id = t.pet_id, this.win_count = t.win_count, this.fail_count = t.fail_count, this.remaining_challenges_count = t.remaining_challenges_count, this.last_challenge_time = t.last_challenge_time, this.is_get_gift = t.is_get_gift, this.week = t.week, this.avastar = t.avatar, this.next_week_time = t.next_week_time, this.last_week_index = t.last_week_index, this.hasTime = this.last_challenge_time + 600 - DateTimer.instance.now }, t } (); __reflect(BattleFriendInfo.prototype, "BattleFriendInfo"); var Sports = function() { function t() { this.rankList = [], this.areaList = [], this.rewardData = [], this.myinfo = new BattleFriendInfo, this.rankList.length = 0, this.areaList.length = 0 } return t } (); __reflect(Sports.prototype, "Sports"); var SportsMeditor = function(t) { function e() { return t.call(this, "SportsMeditor") || this } return __extends(e, t), e.prototype.listNotificationInterests = function() { return [PanelNotify.OPEN_SPORTS, PanelNotify.CLOSE_SPORTS] }, e.prototype.onRegister = function() { t.prototype.onRegister.call(this) }, e.prototype.showViewComponent = function(t) { void 0 === t && (t = 7), this.viewComponent = new SportPanel, this.showUI(this.viewComponent, !0, 0, 0, t) }, e.prototype.handleNotification = function(t) { t.getBody(); switch (t.getName()) { case PanelNotify.OPEN_SPORTS: SportsManager.getInstance().getSportInfo(this.onGetInfo, this); break; case PanelNotify.CLOSE_SPORTS: this.closeViewComponent() } }, e.prototype.onGetInfo = function() { this.showViewComponent() }, e.NAME = "SportsMeditor", e } (BaseMediator); __reflect(SportsMeditor.prototype, "SportsMeditor"); var SportsRankCompoment = function(t) { function e() { var e = t.call(this) || this; return e.addEventListener(egret.Event.ADDED_TO_STAGE, e.onAdd, e), e.addEventListener(egret.Event.REMOVED_FROM_STAGE, e.onRemove, e), e } return __extends(e, t), e.prototype.onAdd = function() { this.getButton.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTab, this), core.TimerManager.instance.addTick(1e3, -1, this.onTimer, this) }, e.prototype.onRemove = function() { this.removeEventListener(egret.Event.ADDED_TO_STAGE, this.onAdd, this), this.removeEventListener(egret.Event.REMOVED_FROM_STAGE, this.onRemove, this), this.getButton.removeEventListener(egret.TouchEvent.TOUCH_TAP, this.onTab, this), core.TimerManager.instance.removeTick(this.onTimer, this) }, e.prototype.onTimer = function() { var t = SportsManager.getInstance().sports, e = parseFloat(t.myinfo.next_week_time) - DateTimer.instance.now; e >= 0 ? this.timeLabel.text = TimeFormat.showDDHH(1e3 * e) : this.timeLabel.text = TimeFormat.showDDHH(0) }, e.prototype.partAdded = function(e, i) { t.prototype.partAdded.call(this, e, i) }, e.prototype.childrenCreated = function() { t.prototype.childrenCreated.call(this), this.scrolls.viewport = this.list, this.list.itemRenderer = SportsRewardItemRender }, e.prototype.updata = function() { var t = SportsManager.getInstance().sports, e = []; for (var i in t.rewardData) parseInt(i) >= 0 && parseInt(i) <= 4 && e.push({ rank: parseInt(i), data: t.rewardData[i] }); e.push({ rank: 5, data: t.rewardData[5] }), e.push({ rank: 6, data: t.rewardData[5] }), e.push({ rank: 7, data: t.rewardData[5] }), e.push({ rank: 8, data: t.rewardData[5] }), e.push({ rank: 9, data: t.rewardData[5] }), this.list.dataProvider = new eui.ArrayCollection(e); for (var n = 0; 3 > n; n++) this["rewardItem" + n].imghead.source = "", this["rewardItem" + n].numLabel.text = ""; var a = SportsManager.getInstance().getRewardForIndex(t.myinfo.last_week_index), o = a.fixed_id, s = o.split(":")[0], r = Global.gameProxy.getItemImageId(s), h = parseInt(o.split(":")[1]); this.rewardItem0.imghead.source = r + "_png", this.rewardItem0.numLabel.text = h + "", o = a.fixed_id2, s = o.split(":")[0], r = Global.gameProxy.getItemImageId(s), h = parseInt(o.split(":")[1]), this.rewardItem1.imghead.source = r + "_png", this.rewardItem1.numLabel.text = h + "", o = a.random_id, "" != o && (s = o.split(":")[0], r = Global.gameProxy.getItemImageId(s), h = parseInt(o.split(":")[1]), this.rewardItem2.imghead.source = r + "_png", this.rewardItem2.numLabel.text = h + ""), this.ranlLabel.text = t.myinfo.last_week_index.toString(), 1 == t.myinfo.is_get_gift ? this.getButton.enabled = !1 : this.getButton.enabled = !0 }, e.prototype.onTab = function(t) { SportsManager.getInstance().sendNetGetReward() }, e } (eui.Component); __reflect(SportsRankCompoment.prototype, "SportsRankCompoment"); var SportsRankItem = function(t) { function e() { return t.call(this) || this } return __extends(e, t), e.prototype.childrenCreated = function() { t.prototype.childrenCreated.call(this) }, e } (eui.Component); __reflect(SportsRankItem.prototype, "SportsRankItem"); var SportsRewardItemRender = function(t) { function e() { var e = t.call(this) || this; return e.skinName = SportsRewardItemRenderSkin, e } return __extends(e, t), e.prototype.childrenCreated = function() { t.prototype.childrenCreated.call(this) }, e.prototype.dataChanged = function() { t.prototype.dataChanged.call(this), this.item0.imghead.source = "", this.item0.numLabel.text = "", this.item1.imghead.source = "", this.item1.numLabel.text = "", this.item2.imghead.source = "", this.item2.numLabel.text = ""; var e = this.data.data, i = e.fixed_id, n = i.split(":")[0], a = Global.gameProxy.getItemImageId(n), o = parseInt(i.split(":")[1]); this.item0.imghead.source = a + "_png", this.item0.numLabel.text = o + "", i = e.fixed_id2, n = i.split(":")[0], a = Global.gameProxy.getItemImageId(n), o = parseInt(i.split(":")[1]), this.item1.imghead.source = a + "_png", this.item1.numLabel.text = o + "", "" != e.random_id && (i = e.random_id, n = i.split(":")[0], a = Global.gameProxy.getItemImageId(n), o = parseInt(i.split(":")[1]), this.item2.imghead.source = a + "_png", this.item2.numLabel.text = o + ""), this.rankImg.source = "sport_json.sport_num" + (this.data.rank + 1) }, e } (eui.ItemRenderer); __reflect(SportsRewardItemRender.prototype, "SportsRewardItemRender"); var SportsSportsCompoment = function(t) { function e() { var e = t.call(this) || this; return e.addEventListener(egret.Event.ADDED_TO_STAGE, e.onAdd, e), e.addEventListener(egret.Event.REMOVED_FROM_STAGE, e.onRemove, e), e } return __extends(e, t), e.prototype.onAdd = function() { core.TimerManager.instance.addTick(1e3, -1, this.onTimer, this) }, e.prototype.onRemove = function() { this.removeEventListener(egret.Event.ADDED_TO_STAGE, this.onAdd, this), this.removeEventListener(egret.Event.REMOVED_FROM_STAGE, this.onRemove, this), core.TimerManager.instance.removeTick(this.onTimer, this) }, e.prototype.onTimer = function() { var t = SportsManager.getInstance().sports, e = Global.gameProxy.getCommonConfig(), i = parseFloat(t.myinfo.last_challenge_time) + e[21].min - DateTimer.instance.now; i > 0 ? this.countLabel4.text = i + "s": this.countLabel4.text = "0s" }, e.prototype.partAdded = function(e, i) { t.prototype.partAdded.call(this, e, i) }, e.prototype.childrenCreated = function() { t.prototype.childrenCreated.call(this) }, e.prototype.updata = function() { for (var t = SportsManager.getInstance().sports, e = 0; e < t.rankList.length; e++) { var i = this["item" + e], n = t.rankList[e].avastar; "" == n && (n = 1), i.headImg.source = game.URLConfig.getHead(n), i.nameLabel.text = t.rankList[e].nickname } for (var e = 0; e < t.areaList.length; e++) { var a = this["unit" + e], n = t.areaList[e].avastar; "" == n && (n = 1), a.headImg.source = game.URLConfig.getHead(n), a.nameLabel.text = t.areaList[e].nickname, a.rankLabel.text = t.areaList[e].index + "", a.powerLabel.text = t.areaList[e].fighting_capacity + "", a.uid = t.areaList[e].user_id } this.nameLabel.text = t.myinfo.nickname, this.countLabel0.text = t.myinfo.win_count, this.countLabel1.text = t.myinfo.remaining_challenges_count, this.countLabel2.text = t.myinfo.index, this.countLabel3.text = t.myinfo.fail_count; var o = SportsManager.getInstance().getRewardForIndex(t.myinfo.index), s = o.fixed_id, r = s.split(":")[0], h = Global.gameProxy.getItemImageId(r), l = parseInt(s.split(":")[1]); this.headImg0.source = h + "_png", this.label0.text = l + "", s = o.fixed_id2, r = s.split(":")[0], h = Global.gameProxy.getItemImageId(r), l = parseInt(s.split(":")[1]), this.headImg1.source = h + "_png", this.label1.text = l + "", s = o.random_id, r = s.split(":")[0], h = Global.gameProxy.getItemImageId(r), l = parseInt(s.split(":")[1]), this.headImg2.source = h + "_png", this.label2.text = l + "", GuideManager.getInsatance().isShowGuide && 8 == GuideManager.getInsatance().target && 0 == GuideManager.getInsatance().step && (GuideManager.getInsatance().des = TextConst.textObj[34], GuideManager.getInsatance().show(this.unit2)) }, e } (eui.Component); __reflect(SportsSportsCompoment.prototype, "SportsSportsCompoment"); var AsumentParkItem = function(t) { function e() { return t.call(this) || this } return __extends(e, t), e.prototype.childrenCreated = function() { t.prototype.childrenCreated.call(this) }, e.prototype.showGroup = function(t) { 0 == t ? (this.label1.visible = !1, this.label2.visible = !0, this.icon2.visible = !0) : (this.label1.visible = !0, this.label2.visible = !1, this.icon2.visible = !1) }, e } (eui.RadioButton); __reflect(AsumentParkItem.prototype, "AsumentParkItem"); var AsumentParkManager = function(t) { function e() { var e = t.call(this) || this; return e.zhuawaArr = [10, 20, 30, 40, 50], e.sucfaildType = 0, e } return __extends(e, t), e.getInstance = function() { return this._instance || (this._instance = new e), this._instance }, e.prototype.sendNetStartGame = function(t) { this.gameType = t, Global.netProxy.sendRequest(GameConfig.SERVER_PATH + "comm/enter-pleasure-ground", {}, this.onSendNetStartGame.bind(this)) }, e.prototype.onSendNetStartGame = function(t) { if (0 == t.status) { switch (this.gameType) { case 0: game.AppFacade.instance.sendNotification(PanelNotify.OPEN_ZUMA); break; case 1: game.AppFacade.instance.sendNotification(PanelNotify.OPEN_TIANBING); break; case 2: game.AppFacade.instance.sendNotification(PanelNotify.OPEN_ZHUAWAWA) } this.uuid = t.data.uuid, game.AppFacade.instance.sendNotification(PanelNotify.CLOSE_ASUMENT_PARK); var e = Global.gameProxy.getCommonConfig(), i = e[19].min; Global.playerProxy.playerData.gold -= i, game.EventManager.instance.dispatch(SysNotify.TOPLAYER_INFO_UPDATE) } else TipsUtils.showTipsDownToUp(GameConfig.ServerCode[t.status]) }, e.prototype.sendNetEndtGame = function() { Global.netProxy.sendRequest(GameConfig.SERVER_PATH + "comm/pleasure-ground", { user_id: Global.playerProxy.playerData.id, score: this.scroe, uuid: this.uuid }, this.onSendNetEndGame.bind(this)) }, e.prototype.onSendNetEndGame = function(t) { if (0 == t.status) { var e = Global.gameProxy.getAsumentParkConfig(), i = e[1].integral; this.scroe < i ? this.sucfaildType = 3 : (this.sucfaildType = 2, this.curdata = t.data), game.AppFacade.instance.sendNotification(PanelNotify.OPEN_REWARD_TIPS) } else TipsUtils.showTipsDownToUp(GameConfig.ServerCode[t.status]) }, e.prototype.alaysHasCount = function() { var t = Global.playerProxy.playerData.vip; if (0 == t) return 0; var e = Global.gameProxy.getVipConfigForID(t), i = e.playground_frequency; return i - this.asumentCount }, e } (egret.EventDispatcher); __reflect(AsumentParkManager.prototype, "AsumentParkManager"); var AsumentParkMediator = function(t) { function e() { return t.call(this, "AsumentParkMediator") || this } return __extends(e, t), e.prototype.listNotificationInterests = function() { return [PanelNotify.OPEN_ASUMENT_PARK, PanelNotify.CLOSE_ASUMENT_PARK] }, e.prototype.onRegister = function() { t.prototype.onRegister.call(this) }, e.prototype.showViewComponent = function(t) { void 0 === t && (t = 7), this.viewComponent = new AsumentParkPanel, this.showUI(this.viewComponent, !0, 0, 0, t) }, e.prototype.handleNotification = function(t) { t.getBody(); switch (t.getName()) { case PanelNotify.OPEN_ASUMENT_PARK: this.sendNetGetCount(); break; case PanelNotify.CLOSE_ASUMENT_PARK: this.closeViewComponent() } }, e.prototype.sendNetGetCount = function() { Global.netProxy.sendRequest(GameConfig.SERVER_PATH + "comm/get-pleasure-ground", {}, this.onSendNetGetCount.bind(this)) }, e.prototype.onSendNetGetCount = function(t) { 0 == t.status ? (AsumentParkManager.getInstance().asumentCount = t.data.count, this.showViewComponent()) : TipsUtils.showTipsDownToUp(GameConfig.ServerCode[t.status]) }, e.NAME = "AsumentParkMediator", e } (BaseMediator); __reflect(AsumentParkMediator.prototype, "AsumentParkMediator"); var AsumentParkPanel = function(t) { function e() { var e = t.call(this) || this; return e.skinName = amusementParkPanel, e } return __extends(e, t), e.prototype.childrenCreated = function() { t.prototype.childrenCreated.call(this), this.init() }, e.prototype.init = function() { this.radioGroup = new eui.RadioButtonGroup, this.radio0.group = this.radioGroup, this.radio0.value = 0, this.radio1.group = this.radioGroup, this.radio1.value = 1, this.radio2.group = this.radioGroup, this.radio2.value = 2, this.radioGroup.addEventListener(egret.Event.CHANGE, this.onRadioGroupChange, this), this.radio0.showGroup(1), this.radio0.showGroup(0), this.radio0.showGroup(0), this.radio0.icons.source = "park_json.park_t8", this.radio1.icons.source = "park_json.park_t3", this.radio2.icons.source = "park_json.park_t7", this.radio0.imgbg.source = "park_bg1_png", this.radio1.imgbg.source = "park_bg0_png", this.radio2.imgbg.source = "park_bg2_png", this.updata() }, e.prototype.onRadioGroupChange = function(t) { console.log("change" + this.radioGroup.selectedValue), AsumentParkManager.getInstance().sendNetStartGame(this.radioGroup.selectedValue) }, e.prototype.createChildren = function() { t.prototype.createChildren.call(this), this.commonPanel.setPanelWidth(640), this.commonPanel.setPanelHeight(710), this.commonPanel.setTitleIcon("park_json.park_t5"), this.commonPanel.setTitle("park_bg_logo_png") }, e.prototype.btnCloseTouchEnded = function() { game.AppFacade.getInstance().sendNotification(PanelNotify.CLOSE_ASUMENT_PARK) }, e.prototype.updata = function() { var t = AsumentParkManager.getInstance().alaysHasCount(); if (t > 0) this.radio0.showGroup(1), this.radio1.showGroup(1), this.radio2.showGroup(1), this.radio0.label1.text = "免费次数" + t, this.radio1.label1.text = "免费次数" + t, this.radio2.label1.text = "免费次数" + t; else { this.radio0.showGroup(0), this.radio1.showGroup(0), this.radio2.showGroup(0); var e = Global.gameProxy.getCommonConfig(); this.radio0.label2.text = "" + e[19].min, this.radio1.label2.text = "" + e[19].min, this.radio2.label2.text = "" + e[19].min } }, e } (game.BasePanel); __reflect(AsumentParkPanel.prototype, "AsumentParkPanel"); var LoadingCompoment = function(t) { function e() { var e = t.call(this) || this; return e.skinName = LoadingCompomentSkin, e } return __extends(e, t), e.prototype.chilrenCreated = function() { t.prototype.childrenCreated.call(this) }, e.getInstance = function() { return this._instance || (this._instance = new e), this._instance }, e.prototype.show = function() { PopUpManager.addPopUp(this, !1, 0, 0, 0) }, e.prototype.hide = function() { PopUpManager.removePopUpAsync(this, 0, null) }, e } (eui.Component); __reflect(LoadingCompoment.prototype, "LoadingCompoment"); var RewardTips = function(t) { function e() { var e = t.call(this) || this; return e.skinName = RewardTipsSkin, e } return __extends(e, t), e.prototype.childrenCreated = function() { switch (t.prototype.childrenCreated.call(this), this.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTab, this), this.petSucGroup.visible = !1, this.PetFailGroup.visible = !1, this.sucYouleGroup.visible = !1, this.failYouleGroup.visible = !1, AsumentParkManager.getInstance().sucfaildType) { case 0: this.petSucGroup.visible = !0; var e = Global.gameProxy.getItemSFConfig(), i = e[1], n = i.outcome_id; this.expLabel.text = "获得宠物经验" + i.experience_outcome, this.goldLabel.text = "X" + n.split(":")[1]; break; case 1: this.PetFailGroup.visible = !0; break; case 2: this.sucYouleGroup.visible = !0; var a = Global.gameProxy.getItemImageId(AsumentParkManager.getInstance().curdata.item_id), e = Global.gameProxy.getItemConfig(AsumentParkManager.getInstance().curdata.item_id); this.boxImg.source = a + "_png", this.boxLabel.text = e.name; break; case 3: this.failYouleGroup.visible = !0 } }, e.prototype.onTab = function(t) { switch (game.AppFacade.instance.sendNotification(PanelNotify.CLOSE_REWARD_TIPS), AsumentParkManager.getInstance().sucfaildType) { case 0: 0 == BattleFruitManager.getInstance().openType ? (game.AppFacade.getInstance().sendNotification(SceneNotify.OPEN_MINE_GAME), game.AppFacade.getInstance().sendNotification(PanelNotify.OPEN_SPORTS)) : (game.AppFacade.getInstance().sendNotification(SceneNotify.CLOSE_BATTLEPET), game.AppFacade.getInstance().sendNotification(ClientNotify.GO_OTHER_FARM, { uid: BattleFruitManager.getInstance().friendData.user_id })); break; case 1: 0 == BattleFruitManager.getInstance().openType ? (game.AppFacade.getInstance().sendNotification(SceneNotify.OPEN_MINE_GAME), game.AppFacade.getInstance().sendNotification(PanelNotify.OPEN_SPORTS)) : (game.AppFacade.getInstance().sendNotification(SceneNotify.CLOSE_BATTLEPET), game.AppFacade.getInstance().sendNotification(SceneNotify.OPEN_MINE_GAME), game.AppFacade.getInstance().sendNotification(PanelNotify.OPEN_FRIEND, { uid: BattleFruitManager.getInstance().friendData.uid })); break; case 2: 0 == AsumentParkManager.getInstance().gameType ? game.AppFacade.getInstance().sendNotification(PanelNotify.CLOSE_ZUMA) : 1 == AsumentParkManager.getInstance().gameType ? game.AppFacade.getInstance().sendNotification(PanelNotify.CLOSE_TIANBING) : game.AppFacade.getInstance().sendNotification(PanelNotify.CLOSE_ZHUAWAWA), game.AppFacade.instance.sendNotification(PanelNotify.OPEN_ASUMENT_PARK); break; case 3: 0 == AsumentParkManager.getInstance().gameType ? game.AppFacade.getInstance().sendNotification(PanelNotify.CLOSE_ZUMA) : 1 == AsumentParkManager.getInstance().gameType ? game.AppFacade.getInstance().sendNotification(PanelNotify.CLOSE_TIANBING) : game.AppFacade.getInstance().sendNotification(PanelNotify.CLOSE_ZHUAWAWA), game.AppFacade.instance.sendNotification(PanelNotify.OPEN_ASUMENT_PARK) } }, e } (eui.Component); __reflect(RewardTips.prototype, "RewardTips"); var RewardTipsMediator = function(t) { function e() { return t.call(this, "RewardTipsMediator") || this } return __extends(e, t), e.prototype.listNotificationInterests = function() { return [PanelNotify.OPEN_REWARD_TIPS, PanelNotify.CLOSE_REWARD_TIPS] }, e.prototype.onRegister = function() { t.prototype.onRegister.call(this) }, e.prototype.showViewComponent = function(t) { void 0 === t && (t = 7), this.viewComponent = new RewardTips, this.showUI(this.viewComponent, !0, 0, 0, t) }, e.prototype.handleNotification = function(t) { t.getBody(); switch (t.getName()) { case PanelNotify.OPEN_REWARD_TIPS: this.showViewComponent(); break; case PanelNotify.CLOSE_REWARD_TIPS: this.closeViewComponent() } }, e.NAME = "RewardTipsMediator", e } (BaseMediator); __reflect(RewardTipsMediator.prototype, "RewardTipsMediator"); var Globals; ! function(t) { function e() { return __awaiter(this, void 0, void 0, function() { var t; return __generator(this, function(e) { return t = this, [2, new Promise(function(e, i) { for (var n = 0; 5 > n; n++) t.textures[n] = RES.getRes("gtype_" + n + "_png"); for (; t.checkLoadOver();) return void e() })] }) }) } function i() { for (var t in this.textures) if (!this.textures[t]) return ! 1; return ! 0 } t.myName = "dily", t.GAME_ID = "10005", t.textures = {}, t.textureNum = 5, t.initTextures = e, t.checkLoadOver = i } (Globals || (Globals = {})); var game; ! function(t) { var e = function() { function t() {} return t.get = function(t) { return this.map.get(t) }, t.getOne = function(t, e) { var i = this.map.get(t); i || (i = [], this.map.put(t, i)); var n = null; return n = i.length > 0 ? i.pop() : new e }, t.recycle = function(t, e) { var i = this.map.get(t); i || (i = [], this.map.put(t, i)), i.push(e) }, t.destroyObjectPool = function() { this.map.clear() }, t.createObjectByCount = function(t, e, i) { var n = this.map.get(t); n || (n = [], this.map.put(t, n)); for (var a = 0; e > a; a++) { var o = new i; n.push(o) } }, t.map = new HashMap, t } (); t.ObjectPool = e, __reflect(e.prototype, "game.ObjectPool") } (game || (game = {})); var game; ! function(t) { var e = function(e) { function i(t) { void 0 === t && (t = null); var n = e.call(this, i.NAME, t) || this; return n.GroupName = "tianbing", n.lv = 1, n } return __extends(i, e), i.prototype.listNotificationInterests = function() { return [PanelNotify.OPEN_TIANBING, PanelNotify.CLOSE_TIANBING, PanelNotify.TIANBING_NEXT_QUESTION] }, i.prototype.onRegister = function() { e.prototype.onRegister.call(this) }, i.prototype.handleNotification = function(e) { var i = e.getBody(); switch (e.getName()) { case PanelNotify.OPEN_TIANBING: if (this.viewComponent) return; GameConfig.GAME_EXPORT && Mta.clickStar2("play", { time: Date.now() }), RES.isGroupLoaded(this.GroupName) ? this.showViewComponent() : (LoadingCompoment.getInstance().show(), RES.addEventListener(RES.ResourceEvent.GROUP_COMPLETE, this.onResourceLoadComplete, this), RES.addEventListener(RES.ResourceEvent.GROUP_LOAD_ERROR, this.onResourceLoadError, this), RES.addEventListener(RES.ResourceEvent.GROUP_PROGRESS, this.onResourceProgress, this), RES.loadGroup(this.GroupName)); break; case PanelNotify.CLOSE_TIANBING: t.UIUtils.removeSelf(this.viewComponent); break; case PanelNotify.OPEN_TIANBING_GAMEOVER: this.retuenMainScence(i) } }, i.prototype.retuenMainScence = function(e) { t.AppFacade.instance.sendNotification(PanelNotify.CLOSE_TIANBING), t.AppFacade.instance.sendNotification(PanelNotify.OPEN_REWARD_TIPS) }, i.prototype.onResourceLoadComplete = function(e) { e.groupName == this.GroupName && (RES.removeEventListener(RES.ResourceEvent.GROUP_COMPLETE, this.onResourceLoadComplete, this), RES.removeEventListener(RES.ResourceEvent.GROUP_LOAD_ERROR, this.onResourceLoadError, this), RES.removeEventListener(RES.ResourceEvent.GROUP_PROGRESS, this.onResourceProgress, this), LoadingCompoment.getInstance().hide(), Globals.initTextures(), t.ObjectPool.createObjectByCount("xiaochu", 42, t.WidgetXiaoChu), t.ObjectPool.createObjectByCount("xiaochudb", 42, t.WidgetXiaoChuDB), this.showViewComponent()) }, i.prototype.onResourceLoadError = function(t) { console.warn("Group:" + t.groupName + " has failed to load"), this.onResourceLoadComplete(t) }, i.prototype.onResourceProgress = function(t) { t.groupName == this.GroupName && LoadingCompoment.getInstance().prossBar.setPross(t.itemsLoaded, t.itemsTotal) }, i.prototype.showViewComponent = function(e) { void 0 === e && (e = 7), this.viewComponent = new t.TianbingPanel; var i = GameLayerManager.gameLayer().sceneLayer; i.addChild(this.viewComponent) }, i.prototype.initUI = function() {}, i.prototype.initData = function() {}, i.NAME = "TianbingMediator", i } (BaseMediator); t.TianbingMediator = e, __reflect(e.prototype, "game.TianbingMediator") } (game || (game = {})); var game; ! function(t) { var e = function(e) { function i() { var t = e.call(this) || this; return t.widgetXiaoChus = [], t.canTouch = !1, t.MAX_ROW = 7, t.MAX_COL = 6, t.hasFindNextCell = !1, t.currentStatusXiaoChu = [], t.timeCount = 15e4, t.nowDateTime = 0, t.score = 0, t.skinName = new GameSceneSkinss, t } return __extends(i, e), i.prototype.createChildren = function() { e.prototype.createChildren.call(this), this.initMc(), this.xiaochuGroup.mask = this.maskRect, this.lessYNumber = GameConfig.curHeight() / 2 - 322, this.initData(), this.scaleY = GameConfig.curHeight() / Const.DESGIN_H }, i.prototype.musicBtnTouchEnded = function() {}, i.prototype.timeEnterFrame = function() { var t = Date.now(), e = t - this.nowDateTime; if (e > 100) { if (this.nowDateTime = t, this.timeCount -= e, this.timeCount < 0) return this.canTouch = !1, this.timeLabel.text = "0s", this.checkIsPassByTime(), void this.removeEventListener(egret.Event.ENTER_FRAME, this.timeEnterFrame, this); this.timeLabel.text = Math.floor(this.timeCount / 1e3) + "s" } }, i.prototype.initMc = function() { var t = RES.getRes("boom_png"), e = RES.getRes("boom_json"), i = new egret.MovieClipDataFactory(e, t); this.boomMcData = i.generateMovieClipData("boom"); var n = RES.getRes("effect_png"), a = RES.getRes("effect_json"), o = new egret.MovieClipDataFactory(a, n); this.hengMcData = o.generateMovieClipData("heng"), this.shuMcData = o.generateMovieClipData("shu") }, i.prototype.startGame = function() { this.xiaochuGroup.addEventListener(egret.TouchEvent.TOUCH_BEGIN, this.xiaochuGroupTouchBegin, this), this.xiaochuGroup.addEventListener(egret.TouchEvent.TOUCH_MOVE, this.xiaochuGroupTouchMove, this), this.nowDateTime = Date.now(), this.addEventListener(egret.Event.ENTER_FRAME, this.timeEnterFrame, this), this.canTouch = !0 }, i.prototype.xiaochuGroupTouchBegin = function(t) { if (this.checkCanTouch() && this.canTouch) { this.combo = 1; var e = this.findCellByPos(t.stageX, t.stageY - this.lessYNumber); e && (Global.audioProxy.playSound("click_mp3"), this.startCell = e, e.playCellSelect(), this.touchStartX = t.stageX, this.touchStartY = t.stageY - this.lessYNumber, this.hasFindNextCell = !1) } }, i.prototype.checkCanTouch = function() { for (var t = 0; t < this.MAX_ROW; t++) for (var e = 0; e < this.MAX_COL; e++) { var i = this.widgetXiaoChus[t][e]; if (!i) return ! 1 } return ! 0 }, i.prototype.xiaochuGroupTouchMove = function(e) { if (this.checkCanTouch() && this.canTouch && this.startCell && !this.hasFindNextCell) { var i = t.WidgetXiaoChu.SIZE / 2, n = -1, a = -1, o = e.stageX - this.touchStartX, s = e.stageY - this.lessYNumber - this.touchStartY; o > i && this.startCell.col < this.MAX_COL - 1 ? a = this.startCell.col + 1 : -i > o && this.startCell.col > 0 ? a = this.startCell.col - 1 : s > i && this.startCell.row < this.MAX_ROW - 1 ? n = this.startCell.row + 1 : -i > s && this.startCell.row > 0 && (n = this.startCell.row - 1); var r = null; n >= 0 ? r = this.widgetXiaoChus[n][this.startCell.col] : a >= 0 && (r = this.widgetXiaoChus[this.startCell.row][a]), r && (Global.audioProxy.playSound("move_mp3"), this.hasFindNextCell = !0, this.changeTwoCell(this.startCell, r, !0)) } }, i.prototype.playEffectAni = function(t) { for (var e = 0; e < t.length; e++) { var i = t[e], n = i.getEffectType(), a = { x: i.x, y: i.y }, o = new egret.MovieClip(this[n + "McData"]), s = new egret.MovieClip(this[n + "McData"]); this.addChild(o), this.addChild(s), "heng" === n ? (s.scaleX = -1, o.x = a.x - 810 + 112, s.x = 810 + a.x + 58 - 6, o.y = a.y + this.lessYNumber + 6, s.y = a.y + this.lessYNumber + 6) : (s.scaleY = -1, o.x = a.x - 40 + 92, s.x = a.x - 40 + 92, o.y = a.y + this.lessYNumber + 6, s.y = a.y + this.lessYNumber + 58 + 6), this.addMovieClipComplete(o), this.addMovieClipComplete(s), o.play(1), s.play(1) } }, i.prototype.changeTwoCell = function(t, e, i) { var n = this; this.canTouch = !i; var a = t.row, o = t.col; t.setRowAndCol(e.row, e.col), e.setRowAndCol(a, o), this.widgetXiaoChus[t.row][t.col] = t, this.widgetXiaoChus[e.row][e.col] = e; var s = t.startFlyToEnd(), r = e.startFlyToEnd(), h = Math.max(s, r); if (t.statusType && e.statusType) return void egret.setTimeout(function() { Global.audioProxy.playSound("heng_mp3"); var i = this.reCountXiaoChu(this.findHasStatusXiaoChu([t, e]), [t, e]); i = this.filterSingleArr(i), this.playEffectAni([t, e]), this.playRemoveCellEffect(i) }, this, h); var l = "combo1_mp3"; if (i) { var h = Math.max(s, r); egret.setTimeout(function() { var i = n.findHorizontalMatch(t), a = n.findHorizontalMatch(e), o = n.findVerticalMatch(t), s = n.findVerticalMatch(e); if (i.length >= 3 || a.length >= 3 || o.length >= 3 || s.length >= 3) { var r = [], h = i.length; h >= 3 && (h > 3 && (n.checkCreateType78(t, i, 8), h = i.length), i = n.reCountXiaoChu(n.findHasStatusXiaoChu(i), i), i.length !== h && (l = "heng_mp3"), r.push.apply(r, i)); var c = a.length; c >= 3 && (c > 3 && (n.checkCreateType78(e, a, 8), c = i.length), a = n.reCountXiaoChu(n.findHasStatusXiaoChu(a), a), a.length !== c && (l = "heng_mp3"), r.push.apply(r, a)); var p = o.length; p >= 3 && (p > 3 && (n.checkCreateType78(t, o, 7), p = o.length), o = n.reCountXiaoChu(n.findHasStatusXiaoChu(o), o), o.length !== p && (l = "heng_mp3"), r.push.apply(r, o)); var u = s.length; u >= 3 && (u > 3 && (n.checkCreateType78(e, s, 7), u = s.length), s = n.reCountXiaoChu(n.findHasStatusXiaoChu(s), s), s.length !== u && (l = "heng_mp3"), r.push.apply(r, s)), r = n.filterSingleArr(r), Global.audioProxy.playSound(l); var d = n.findHasStatusXiaoChuInRemove(r); n.playEffectAni(d), n.playRemoveCellEffect(r) } else n.changeTwoCell(t, e, !1) }, this, h) } }, i.prototype.findHasStatusXiaoChuInRemove = function(t) { var e = []; return t.forEach(function(t) { t.statusType && e.push(t) }), e }, i.prototype.checkCreateType78 = function(e, i, n) { i.length >= 4 && (e.changeStatusType(n), e.setLife(2), t.Utils.removeArrayItem(i, e)) }, i.prototype.filterSingleArr = function(t) { var e = []; return t.forEach(function(t) { - 1 == e.indexOf(t) && e.push(t) }), e }, i.prototype.addMovieClipComplete = function(e) { e.addEventListener(egret.Event.COMPLETE, function(i) { t.UIUtils.removeSelf(e), e = null }, this) }, i.prototype.playBoomEffect = function(e, i) { var n = new egret.MovieClip(this.boomMcData); this.addChild(n), n.addEventListener(egret.Event.COMPLETE, function(e) { t.UIUtils.removeSelf(n), n = null }, this), n.x = e - 70, n.y = i - 70, n.play(1) }, i.prototype.playRemoveCellEffect = function(t) { for (var e = this, i = 0; i < t.length; i++) { var n = t[i]; n.eatRemove(); var a = n.localToGlobal(); this.playBoomEffect(a.x, a.y), this.widgetXiaoChus[n.row][n.col] = null } egret.setTimeout(function() { e.dropCell(), e.countScore(t.length), e.combo++ }, this, 600) }, i.prototype.countScore = function(t) { var e = 2 * t * Math.pow(1.5, this.combo); this.score += Math.floor(e), this.scoreLabel.text = "" + this.score, this.checkIsPassByScore() }, i.prototype.checkIsPassByTime = function() { egret.setTimeout(function() { AsumentParkManager.getInstance().scroe = this.score, AsumentParkManager.getInstance().sendNetEndtGame() }, this, 2e3) }, i.prototype.checkIsPassByScore = function() {}, i.prototype.dropCell = function() { var t = this; this.setXiaoChuLife(); for (var e = 0, i = {}, n = [], a = this.MAX_ROW - 1; a >= 0; a--) for (var o = 0; o < this.MAX_COL; o++) { i[o] || (i[o] = {}); var s = this.widgetXiaoChus[a][o]; s || (s = this.findLastTopCell(a, o), s ? (this.widgetXiaoChus[s.row][s.col] = null, s.setRowAndCol(a, o), n.push(s)) : (s = this.makeNewCell(a, o), i[o][a] = s, this.resetListYIndex(_.values(i[o])), n.push(s)), this.widgetXiaoChus[a][o] = s) } var e = 0; n.forEach(function(t) { var i = t.startFlyToEnd(); i > e && (e = i) }), egret.setTimeout(function() { t.checkAllMatch3() }, this, e + 100) }, i.prototype.resetListYIndex = function(e) { for (var i = 0; i <= e.length - 1; i++) e[i].y = (e.length - i) * -t.WidgetXiaoChu.SIZE }, i.prototype.findHasStatusXiaoChu = function(e) { for (var i = [], n = 0; n < e.length; n++) e[n].statusType && 1 === e[n].life && !t.Utilss.arrayHasItem(this.currentStatusXiaoChu, e[n]) && i.push(e[n]); return i }, i.prototype.reCountXiaoChu = function(e, i) { var n = this; return e.forEach(function(e, a) { var o = e.statusType; if (7 === o && 1 === e.life) { n.currentStatusXiaoChu.push(e); var s = n.widgetXiaoChus[e.row]; s.forEach(function(e) { t.Utilss.arrayHasItem(i, e) || i.push(e) }) } else 8 === o && 1 === e.life && (n.currentStatusXiaoChu.push(e), n.widgetXiaoChus.forEach(function(n) { n.forEach(function(n) { n.col === e.col && (t.Utilss.arrayHasItem(i, n) || i.push(n)) }) })) }), this.findHasStatusXiaoChu(i).length < 1 ? (this.currentStatusXiaoChu = [], i) : this.reCountXiaoChu(this.findHasStatusXiaoChu(i), i) }, i.prototype.checkAllMatch3 = function() { if (! (this.timeCount <= 0)) { for (var e = [], i = [], n = "combo" + this.combo + "_mp3", a = 0; a < this.MAX_ROW; a++) for (var o = 0; o < this.MAX_COL; o++) { var s = this.widgetXiaoChus[a][o], r = this.findHorizontalMatch(s); r.length > 3 ? t.Utilss.arrayHasItem(e, s) || (s.changeStatusType(8), s.setLife(2), e = e.concat(r), i = i.concat(r), t.Utils.removeArrayItem(i, s)) : 3 === r.length && (i = i.concat(r)); var h = this.findVerticalMatch(s); h.length > 3 ? t.Utilss.arrayHasItem(e, s) || (s.changeStatusType(7), s.setLife(2), e = e.concat(h), i = i.concat(h), t.Utils.removeArrayItem(i, s)) : 3 === h.length && (i = i.concat(h)) } i = this.filterSingleArr(i); var l = i.length; if (i = this.reCountXiaoChu(this.findHasStatusXiaoChu(i), i), i.length !== l && (n = "heng_mp3"), i.length > 0) { "heng_mp3" === n ? Global.audioProxy.playSound("heng_mp3") : this.playComboMusic(); var c = this.findHasStatusXiaoChuInRemove(i); this.playEffectAni(c), this.playRemoveCellEffect(i) } else this.playComboResultMusic(), this.combo = 1, this.canTouch = !0; this.setXiaoChuLife() } }, i.prototype.setXiaoChuLife = function() { this.widgetXiaoChus.forEach(function(t) { t.forEach(function(t) { t && t.setLife(1) }) }) }, i.prototype.playComboResultMusic = function() { var t = this.combo - 1; t >= 3 && 5 > t ? (Global.audioProxy.playSound("comboresult3_mp3"), this.widgetComboTips.showTipsImage(3)) : t >= 5 && 7 > t ? (Global.audioProxy.playSound("comboresult5_mp3"), this.widgetComboTips.showTipsImage(5)) : t >= 7 && 9 > t ? (Global.audioProxy.playSound("comboresult7_mp3"), this.widgetComboTips.showTipsImage(7)) : t >= 9 && 11 > t ? (Global.audioProxy.playSound("comboresult9_mp3"), this.widgetComboTips.showTipsImage(9)) : t >= 11 && (Global.audioProxy.playSound("comboresult11_mp3"), this.widgetComboTips.showTipsImage(11)) }, i.prototype.playComboMusic = function() { this.combo > 8 && (this.combo = 8), Global.audioProxy.playSound("combo" + this.combo + "_mp3") }, i.prototype.findLastTopCell = function(t, e) { for (var i = t - 1; i >= 0;) { var n = this.widgetXiaoChus[i][e]; if (n) return n; i-- } return null }, i.prototype.initData = function() { this.createDb(), this.initCells(), egret.setTimeout(function() { this.showCells() }, this, 300), egret.setTimeout(function() { this.startGame() }, this, 600) }, i.prototype.showCells = function() { this.widgetXiaoChus.forEach(function(t, e) { t.forEach(function(t, e) { t.showXiaoChuImage() }) }) }, i.prototype.initCells = function() { this.widgetXiaoChus = []; for (var t = 0; t < this.MAX_ROW; t++) { var e = []; this.widgetXiaoChus.push(e); for (var i = 0; i < this.MAX_COL; i++) { var n = this.makeNewCell(t, i); n.hideXiaoChuImage(), e.push(n) } } this.checkNoMatch() }, i.prototype.makeNewCell = function(e, i, n) { void 0 === n && (n = !1); var a = t.ObjectPool.getOne("xiaochu", t.WidgetXiaoChu); a.setRowAndCol(e, i); var o = Math.floor(_.random(0, Globals.textureNum - 1)); return a.x = a.endX, a.y = a.endY, n && (a.y = -(e + 1) * t.WidgetXiaoChu.SIZE), this.xiaochuGroup.addChild(a), a.changeImage(Globals.textures[o], o), a }, i.prototype.checkNoMatch = function() { for (var t = !1, e = 0; e < this.MAX_ROW; e++) for (var i = 0; i < this.MAX_COL; i++) { var n = this.widgetXiaoChus[e][i], a = this.findHorizontalMatch(n); if (a.length >= 3) { var o = (n.type + 1) % Globals.textureNum; n.changeImage(Globals.textures[o], o), t = !0 } var s = this.findVerticalMatch(n); if (s.length >= 3) { var o = (n.type + 1) % Globals.textureNum; n.changeImage(Globals.textures[o], o), t = !0 } } t && this.checkNoMatch() }, i.prototype.testFunc = function() {}, i.prototype.findHorizontalMatch = function(t) { var e = t.type, i = (t.statusType, null); i = [t]; for (var n = t.col + 1; n < this.MAX_COL;) { var a = this.widgetXiaoChus[t.row][n]; if (!a || a.type != e) break; i.push(a), n++ } for (var n = t.col - 1; n >= 0;) { var a = this.widgetXiaoChus[t.row][n]; if (!a || a.type != e) break; i.push(a), n-- } return i }, i.prototype.findVerticalMatch = function(t) { for (var e = t.type, i = [t], n = t.row + 1; n < this.MAX_ROW;) { var a = this.widgetXiaoChus[n][t.col]; if (!a || a.type != e) break; i.push(a), n++ } for (var n = t.row - 1; n >= 0;) { var a = this.widgetXiaoChus[n][t.col]; if (!a || a.type != e) break; i.push(a), n-- } return i }, i.prototype.createDb = function() { for (var e = (t.ObjectPool.get("xiaochudb"), this), i = 0; i < this.MAX_ROW; i++) for (var n = 0; n < this.MAX_COL; n++) { var a = t.ObjectPool.getOne("xiaochudb", t.WidgetXiaoChuDB); a.changeDb(n, i), e.xiaochuGroup.addChild(a), a.x = 92 * n, a.y = 92 * i } }, i.prototype.findCellByPos = function(e, i) { e -= 46; var n = Math.floor(i / t.WidgetXiaoChu.SIZE), a = Math.floor(e / t.WidgetXiaoChu.SIZE); return 0 > n ? null: n >= this.MAX_ROW ? null: 0 > a ? null: a >= this.MAX_COL ? null: this.widgetXiaoChus[n][a] }, i } (eui.Component); t.TianbingPanel = e, __reflect(e.prototype, "game.TianbingPanel") } (game || (game = {})); var game; ! function(t) { var e = function() { function e() {} return e.rang = function(t, e) { return Math.round(Math.random() * (e - t) + t) }, e.isRang = function(t, e, i) { return t >= e && i >= t }, e.limit = function(t, e, i) { return Math.max(e, Math.min(i, t)) }, e.ang2rad = function(t) { return t / 180 * Math.PI }, e.rad2ang = function(t) { return t / Math.PI * 180 }, e.getBigNumberShow = function(t) { return 1e4 > t ? t + "": (t /= 1e3, t.toFixed(1) + "K") }, e.isElinArr = function(t, e) { return e.indexOf(t) > -1 }, e.isArrCrossing = function(e, i) { for (var n = 0; n < e.length; n++) if (t.Utils.isElinArr(e[n], i)) return ! 0; return ! 1 }, e.getURLQueryString = function(t) { if (egret.Capabilities.runtimeType == egret.RuntimeType.WEB) { var e = decodeURIComponent(window.location.href); e = e.replace(/"/g, '"'); var i; return e.indexOf("#?") > 0 ? (e = e.replace("#?", "&"), i = e.match(new RegExp("(^|&)" + t + "=([^&]*)(&|$)"))) : i = window.location.search.substr(1).match(new RegExp("(^|&)" + t + "=([^&]*)(&|$)")), i ? i[2] : null } }, e.getMaxStr = function(t) { return t.length <= 5 ? t: t.substr(0, 5) + "..." }, e.removeArrayItem = function(t, e) { var i = t.indexOf(e); i > -1 && t.splice(i, 1) }, e.arrayHasItem = function(t, e) { var i = t.indexOf(e); return i > -1 }, e.mtaChainSdk = function(t) { var e = window.MtaH5; if (e && e.clickStat) { var i = {}; i[t.toLocaleLowerCase()] = "true", e.clickStat("yemianshendu", i) } }, e } (); t.Utilss = e, __reflect(e.prototype, "game.Utilss") } (game || (game = {})); var game; ! function(t) { var e = function(t) { function e() { var e = t.call(this) || this; return e.skinName = new WidgetComboTipsSkin, e } return __extends(e, t), e.prototype.createChildren = function() { t.prototype.createChildren.call(this) }, e.prototype.showTipsImage = function(t) { this.tipsImage.source = RES.getRes("combotips" + t + "_png"), egret.Tween.get(this).to({ scaleX: 1, scaleY: 1 }, 250).wait(300).to({ scaleX: 3, scaleY: 3, alpha: 0 }, 250).call(function() { this.scaleX = 0, this.scaleY = 0, this.alpha = 1 }, this) }, e } (eui.Component); t.WidgetComboTips = e, __reflect(e.prototype, "game.WidgetComboTips") } (game || (game = {})); var game; ! function(t) { var e = function(e) { function i() { var t = e.call(this) || this; return t.needRemove = !0, t.life = 1, t.skinName = new WidgetXiaoChuSkin, t } return __extends(i, e), i.prototype.initMc = function() { var t = RES.getRes("zhadan_png"), e = RES.getRes("zhadan_json"), i = new egret.MovieClipDataFactory(e, t); this.hengMcData = i.generateMovieClipData("heng"), this.shuMcData = i.generateMovieClipData("shu") }, i.prototype.setLife = function(t) { this.life = t }, i.prototype.createChildren = function() { e.prototype.createChildren.call(this), this.initMc() }, i.prototype.getEffectType = function() { return 7 === this.statusType ? "heng": "shu" }, i.prototype.eatRemove = function() { return this.needRemove ? (this.parent.addChild(this), void egret.Tween.get(this).to({ alpha: 0 }, 100).call(function() { this.statusType = null, t.UIUtils.removeSelf(this) }, this, [this])) : void(this.needRemove = !0) }, i.prototype.setRowAndCol = function(t, e) { this.row = t, this.col = e, this.endX = this.col * i.SIZE + 6, this.endY = this.row * i.SIZE + 6 }, i.prototype.startFlyToEnd = function() { var t = 0; if (this.endY != this.y) { var e = 50 * Math.round((this.endY - this.y) / i.SIZE) + 150; egret.Tween.get(this).to({ y: this.endY }, e, egret.Ease.backOut), e > t && (t = e) } if (this.endX != this.x) { var e = 50 * Math.round((this.endX - this.x) / i.SIZE) + 150; egret.Tween.get(this).to({ x: this.endX }, e, egret.Ease.backOut), e > t && (t = e) } return t }, i.prototype.hideXiaoChuImage = function() { this.xiaochuImage.visible = !1 }, i.prototype.showXiaoChuImage = function() { this.xiaochuImage.visible = !0, this.xiaochuImage.scaleX = 0, this.xiaochuImage.scaleY = 0, egret.Tween.get(this.xiaochuImage).to({ scaleX: 1, scaleY: 1 }, 200) }, i.prototype.changeStatusType = function(t) { var e; e = 7 === t ? new egret.MovieClip(this.hengMcData) : new egret.MovieClip(this.shuMcData), e.anchorOffsetX = e.width / 2, e.anchorOffsetY = e.height / 2, e.x = this.width / 2, e.y = this.height / 2, 8 === t && (e.x -= 8), e.play( - 1), this.addChild(e), this.statusType = t }, i.prototype.changeImage = function(t, e) { this.xiaochuImage.source = t, this.xiaochuImage.anchorOffsetX = t.textureWidth / 2, this.xiaochuImage.anchorOffsetY = t.textureHeight / 2, this.xiaochuImage.x = this.xiaochuImage.anchorOffsetX, this.xiaochuImage.y = this.xiaochuImage.anchorOffsetY, this.statusType = null, this.type = e }, i.prototype.playCellSelect = function() { egret.Tween.get(this).to({ scaleX: 1.1, scaleY: 1.1 }, 100).to({ scaleX: 1, scaleY: 1 }, 100) }, i.SIZE = 92, i } (eui.Component); t.WidgetXiaoChu = e, __reflect(e.prototype, "game.WidgetXiaoChu") } (game || (game = {})); var game; ! function(t) { var e = function(t) { function e() { var e = t.call(this) || this; return e.skinName = new WidgetXiaoChuDBSkin, e } return __extends(e, t), e.prototype.createChildren = function() { t.prototype.createChildren.call(this) }, e.prototype.changeDb = function(t, e) { t % 2 === 0 ? e % 2 !== 0 ? this.dibanImage.source = RES.getRes("game_db1_png") : this.dibanImage.source = RES.getRes("game_db2_png") : t % 2 !== 0 && (e % 2 === 0 ? this.dibanImage.source = RES.getRes("game_db1_png") : this.dibanImage.source = RES.getRes("game_db2_png")) }, e } (eui.Component); t.WidgetXiaoChuDB = e, __reflect(e.prototype, "game.WidgetXiaoChuDB") } (game || (game = {})); var ZhuawawaItem = function(t) { function e() { var e = t.call(this) || this; return e.iszhua = !1, e.skinName = ZhuaItemSkin, e } return __extends(e, t), e.prototype.childrenCreated = function() { this.anchorOffsetX = this.width / 2, this.anchorOffsetY = this.height }, e.prototype.setType = function(t) { this._t = t, this.icons.source = "gameRes_json.wawa_" + (t + 1) + "_png", this.scoreLabel.text = AsumentParkManager.getInstance().zhuawaArr[t].toString() }, e } (eui.Component); __reflect(ZhuawawaItem.prototype, "ZhuawawaItem"); var ZhuawawaMediator = function(t) { function e() { var e = t.call(this, "ZhuawawaMediator") || this; return e.GroupName = "zhuawawa", e } return __extends(e, t), e.prototype.listNotificationInterests = function() { return [PanelNotify.OPEN_ZHUAWAWA, PanelNotify.CLOSE_ZHUAWAWA] }, e.prototype.onRegister = function() { t.prototype.onRegister.call(this) }, e.prototype.showViewComponent = function(t) { void 0 === t && (t = 7), this.viewComponent = new ZhuawawaPanel; var e = GameLayerManager.gameLayer().sceneLayer; e.addChild(this.viewComponent) }, e.prototype.handleNotification = function(t) { t.getBody(); switch (t.getName()) { case PanelNotify.OPEN_ZHUAWAWA: RES.isGroupLoaded(this.GroupName) ? this.showViewComponent() : (LoadingCompoment.getInstance().show(), RES.addEventListener(RES.ResourceEvent.GROUP_COMPLETE, this.onResourceLoadComplete, this), RES.addEventListener(RES.ResourceEvent.GROUP_LOAD_ERROR, this.onResourceLoadError, this), RES.addEventListener(RES.ResourceEvent.GROUP_PROGRESS, this.onResourceProgress, this), RES.loadGroup(this.GroupName)); break; case PanelNotify.CLOSE_ZHUAWAWA: game.UIUtils.removeSelf(this.viewComponent) } }, e.prototype.onResourceLoadComplete = function(t) { t.groupName == this.GroupName && (RES.removeEventListener(RES.ResourceEvent.GROUP_COMPLETE, this.onResourceLoadComplete, this), RES.removeEventListener(RES.ResourceEvent.GROUP_LOAD_ERROR, this.onResourceLoadError, this), RES.removeEventListener(RES.ResourceEvent.GROUP_PROGRESS, this.onResourceProgress, this), LoadingCompoment.getInstance().hide(), this.showViewComponent()) }, e.prototype.onResourceLoadError = function(t) { console.warn("Group:" + t.groupName + " has failed to load"), this.onResourceLoadComplete(t) }, e.prototype.onResourceProgress = function(t) { t.groupName == this.GroupName && LoadingCompoment.getInstance().prossBar.setPross(t.itemsLoaded, t.itemsTotal) }, e.NAME = "ZhuawawaMediator", e } (BaseMediator); __reflect(ZhuawawaMediator.prototype, "ZhuawawaMediator"); var ZhuawawaPanel = function(t) { function e() { var e = t.call(this) || this; return e.gArr = [], e.gArrd = [], e.gou_SPEED = 10, e.per = 4, e.state = 0, e.isfirstJia = !1, e.iszhua = !1, e.isSuc = !1, e.isEnd = !1, e.times = 180, e.score = 0, e.skinName = ZhuawawaPanelSkin, e.addEventListener(egret.Event.ADDED_TO_STAGE, e.onAdd, e), e.addEventListener(egret.Event.REMOVED_FROM_STAGE, e.onRemove, e), e } return __extends(e, t), e.prototype.childrenCreated = function() { t.prototype.childrenCreated.call(this), this.jiaziMC = game.MCUtils1.getMc("jiazi"), this.addChild(this.jiaziMC), this.initJiazi(), this.state = 2, this.timeLabel.text = "倒计时:" + this.times + "s", this.scoreLabel.text = "分数:" + this.score.toString(), this.scaleY = GameConfig.curHeight() / Const.DESGIN_H }, e.prototype.onAdd = function(t) { core.TimerManager.instance.addTick(2e3, -1, this.onCreateItem, this), core.TimerManager.instance.addTick(33, -1, this.update, this), core.TimerManager.instance.addTick(1e3, 180, this.onTimer, this), game.UIUtils.addButtonScaleEffects(this), this.startButton.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onStart, this), this.backButton.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onBack, this) }, e.prototype.onRemove = function(t) { this.removeEventListener(egret.Event.ADDED_TO_STAGE, this.onAdd, this), this.removeEventListener(egret.Event.REMOVED_FROM_STAGE, this.onRemove, this), core.TimerManager.instance.removeTick(this.onCreateItem, this), core.TimerManager.instance.removeTick(this.update, this), core.TimerManager.instance.removeTick(this.onTimer, this), game.UIUtils.removeButtonScaleEffects(this), this.startButton.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onStart, this), this.backButton.removeEventListener(egret.TouchEvent.TOUCH_TAP, this.onBack, this) }, e.prototype.onBack = function(t) { game.AppFacade.instance.sendNotification(PanelNotify.CLOSE_ZHUAWAWA) }, e.prototype.initJiazi = function() { this.jiaziMC.gotoAndStop("Sprite"), this.jiaziMC.x = GameConfig.curWidth() / 2, this.jiaziMC.y = 180, this.ganImg.y = -820 }, e.prototype.onStart = function(t) { 2 == this.state ? this.startJia() : TipsUtils.showTipsDownToUp("请下一次再抓") }, e.prototype.startJia = function() { this.state = 1, this.isfirstJia = !1, this.iszhua = !1, this.isSuc = !1 }, e.prototype.updataJia = function() { if (1 == this.state && (this.ganImg.y += this.gou_SPEED, this.jiaziMC.y += this.gou_SPEED, this.jiaziMC.y > 424 && 0 == this.isfirstJia && (this.isfirstJia = !0, this.jiaziMC.gotoAndPlay("Sprite", 1)), this.jiaziMC.y > 574 && 0 == this.iszhua && (this.state = 0, this.iszhua = !0, this.item = this.getInrectItem(), this.jiaziMC.gotoAndStop("Sprite"), this.item && (this.item.iszhua = !0), this.state = -1)), -1 == this.state) if (this.jiaziMC.y > 180) { if (this.ganImg.y -= this.gou_SPEED, this.jiaziMC.y -= this.gou_SPEED, this.jiaziMC.y >= 221 && this.jiaziMC.y <= 230 && this.item) { var t = game.Utils.rang(1, 10); if (t <= this.per) this.isSuc = !0; else { this.isSuc = !1; var e = this.item; this.item = null; var i = this; egret.Tween.get(e).to({ y: 500, alpha: 0 }, 600).call(function() { i.gs.removeChild(e) }, this) } } } else { if (this.isSuc) { var n = AsumentParkManager.getInstance().zhuawaArr[this.item._t]; this.score += n, BloodTips.getInstance().createTips(GameConfig.curWidth() / 2, GameConfig.curHeight() / 2, n + "", 0, 1e3, "vipzi_fnt"), egret.Tween.get(this.item).to({ alpha: 0 }, 200), this.scoreLabel.text = "分数:" + this.score.toString() } this.initJiazi(), this.state = 2 } }, e.prototype.update = function(t) { (1 == this.state || -1 == this.state) && this.updataJia(), this.img1.x += 5, this.img2.x += 5, this.img1.x >= GameConfig.curWidth() && (this.img1.x = -this.img1.width), this.img2.x >= GameConfig.curWidth() && (this.img2.x = -this.img2.width), this.img3.x -= 5, this.img4.x -= 5, this.img3.x <= 0 && (this.img3.x = 2 * this.img3.width), this.img4.x <= 0 && (this.img4.x = 2 * this.img4.width); for (var e = 0; e < this.gArr.length; e++) { var i = this.gArr.pop(); i.x < GameConfig.curWidth() + 100 ? 0 == i.iszhua && (this.gArr.unshift(i), i.x += 5) : this.gs.removeChild(i) } for (var e = 0; e < this.gArrd.length; e++) { var i = this.gArrd.pop(); i.x > -100 ? (this.gArrd.unshift(i), i.x -= 5) : this.gsd.removeChild(i) } this.item && (this.item.y = this.jiaziMC.y + this.item.height) }, e.prototype.createItem = function() { var t = new ZhuawawaItem; return this.gs.addChild(t), t.setType(game.Utils.rang(0, 4)), this.gArr.push(t), t.y = 794, t.x = -300, t }, e.prototype.createItemd = function() { var t = new ZhuawawaItem; return this.gsd.addChild(t), t.setType(game.Utils.rang(0, 4)), t.scaleX = .9, t.scaleY = .9, this.gArrd.push(t), t.y = 674, t.x = GameConfig.curWidth() + 100, t }, e.prototype.onCreateItem = function() { this.createItem(), this.createItemd() }, e.prototype.getInrectItem = function() { for (var t = 0; t < this.gArr.length; t++) { var e = Math.abs(this.gArr[t].x - GameConfig.curWidth() / 2); if (30 > e) return this.gArr[t] } }, e.prototype.onTimer = function() { this.times > 0 && (this.times -= 1), 0 == this.times && (core.TimerManager.instance.removeTick(this.onCreateItem, this), core.TimerManager.instance.removeTick(this.update, this), core.TimerManager.instance.removeTick(this.onTimer, this), AsumentParkManager.getInstance().scroe = this.score, AsumentParkManager.getInstance().sendNetEndtGame()), this.timeLabel.text = "倒计时:" + this.times + "s" }, e } (eui.Component); __reflect(ZhuawawaPanel.prototype, "ZhuawawaPanel"); var GameState; ! function(t) { t[t.READY = 0] = "READY", t[t.PLAYING = 1] = "PLAYING", t[t.PAUSE = 2] = "PAUSE", t[t.OVER = 3] = "OVER" } (GameState || (GameState = {})); var Util = function() { function t() {} return t.rang = function(t, e) { return Math.round(Math.random() * (e - t) + t) }, t.isRang = function(t, e, i) { return t >= e && i >= t }, t.limit = function(t, e, i) { return Math.max(e, Math.min(i, t)) }, t.ang2rad = function(t) { return t / 180 * Math.PI }, t.rad2ang = function(t) { return t / Math.PI * 180 }, t.getBigNumberShow = function(t) { return 1e4 > t ? t + "": (t /= 1e3, t.toFixed(1) + "K") }, t.getBigTimeShow = function(t) { var e = Math.round(t / 1e3); if (e > 3600) { var i = parseInt(e / 3600 + ""); e %= 3600; var n = Math.round(e / 60); return i + "H" + n + "M" } if (e > 60) { var n = parseInt(e / 60 + ""); return e %= 60, n + "M" + e + "S" } return e + "S" }, t.isElinArr = function(t, e) { return e.indexOf(t) > -1 }, t.isArrCrossing = function(e, i) { for (var n = 0; n < e.length; n++) if (t.isElinArr(e[n], i)) return ! 0; return ! 1 }, t.getURLQueryString = function(t) { if (egret.Capabilities.runtimeType == egret.RuntimeType.WEB) { var e, i = decodeURIComponent(window.location.href); return i.indexOf("#?") > 0 ? (i = i.replace("#?", "&"), e = i.match(new RegExp("(^|&)" + t + "=([^&]*)(&|$)"))) : e = window.location.search.substr(1).match(new RegExp("(^|&)" + t + "=([^&]*)(&|$)")), e ? e[2] : null } }, t } (); __reflect(Util.prototype, "Util"); var ZumaMediator = function(t) { function e() { var e = t.call(this, "ZumaMediator") || this; return e.GroupName = "zuma", e } return __extends(e, t), e.prototype.listNotificationInterests = function() { return [PanelNotify.OPEN_ZUMA, PanelNotify.CLOSE_ZUMA] }, e.prototype.onRegister = function() { t.prototype.onRegister.call(this) }, e.prototype.showViewComponent = function(t) { void 0 === t && (t = 7), this.viewComponent = new ZumaPanel, this.showUI(this.viewComponent, !0, 0, 0, t) }, e.prototype.handleNotification = function(t) { t.getBody(); switch (t.getName()) { case PanelNotify.OPEN_ZUMA: RES.isGroupLoaded(this.GroupName) ? this.showViewComponent() : (LoadingCompoment.getInstance().show(), RES.addEventListener(RES.ResourceEvent.GROUP_COMPLETE, this.onResourceLoadComplete, this), RES.addEventListener(RES.ResourceEvent.GROUP_LOAD_ERROR, this.onResourceLoadError, this), RES.addEventListener(RES.ResourceEvent.GROUP_PROGRESS, this.onResourceProgress, this), RES.loadGroup(this.GroupName)); break; case PanelNotify.CLOSE_ZUMA: this.closeViewComponent() } }, e.prototype.onResourceLoadComplete = function(t) { t.groupName == this.GroupName && (RES.removeEventListener(RES.ResourceEvent.GROUP_COMPLETE, this.onResourceLoadComplete, this), RES.removeEventListener(RES.ResourceEvent.GROUP_LOAD_ERROR, this.onResourceLoadError, this), RES.removeEventListener(RES.ResourceEvent.GROUP_PROGRESS, this.onResourceProgress, this), LoadingCompoment.getInstance().hide(), this.showViewComponent()) }, e.prototype.onResourceLoadError = function(t) { console.warn("Group:" + t.groupName + " has failed to load"), this.onResourceLoadComplete(t) }, e.prototype.onResourceProgress = function(t) { t.groupName == this.GroupName && LoadingCompoment.getInstance().prossBar.setPross(t.itemsLoaded, t.itemsTotal) }, e.NAME = "ZumaMediator", e } (BaseMediator); __reflect(ZumaMediator.prototype, "ZumaMediator"); var ZumaPanel = function(t) { function e() { var e = t.call(this) || this; return e.pathPos = [], e.allBall = [], e.isGameStart = !1, e.needRollbackNum = 0, e.makeBallCount = 0, e.validBulletCount = 0, e.gameTime = 120, e.frozenTime = 0, e.comboCount = 0, e.ballTypeQueue = [1, 1, 2, 2, 3, 3, 4, 4, 5, 5], e.lastCreateBallType = 1, e.lastCreateBallTypeCount = 1, e.updateIndex = 0, e.toNextCount = 0, e.$checkBugIndex = 0, e.gameTime = Consts.TOTAL_TIME, e.skinName = MainSceneSkin1, GameManager.instance.state = GameState.PLAYING, GameManager.instance.score = 0, e } return __extends(e, t), e.prototype.createChildren = function() { t.prototype.createChildren.call(this), this.timeProGroup.mask = this.maskSp, this.initPath(), this.makeBall(), this.makeBulletBall() }, e.prototype.onAdded = function() { t.prototype.onAdded.call(this), manager.UpdateTickerManager.instance.add(this), this.addEventListener(egret.TouchEvent.TOUCH_MOVE, this.onTouchMoved, this) }, e.prototype.onRemoved = function() { t.prototype.onRemoved.call(this), manager.UpdateTickerManager.instance.remove(this) }, e.prototype.makeBall = function(t) { void 0 === t && (t = 0); var e = 1; if (this.ballTypeQueue.length > 0) e = this.ballTypeQueue.shift(); else { var i = 1 - .4 * this.lastCreateBallTypeCount; if (Math.random() < i) e = this.lastCreateBallType; else for (e = Util.rang(1, 5); e == this.lastCreateBallType;) e = Util.rang(1, 5) } if (e > 0) { var n = new Ball(this.pathPos, e); this.gameContainer.addChild(n), this.allBall.push(n), n.toNext(t) } else this.allBall.push(null); e == this.lastCreateBallType ? this.lastCreateBallTypeCount++:this.lastCreateBallTypeCount = 1, this.lastCreateBallType = e, this.makeBallCount++, this.makeBallCount == Consts.MIN_SHOW_BALL_NUM && (this.isGameStart = !0) }, e.prototype.makeBulletBall = function() { var t = Util.rang(1, 5); this.validBulletCount >= 12 && (t = Math.random() < .3 ? BallType.FIRE: BallType.ICE, this.validBulletCount = 0); var e = new Ball(this.pathPos, t, !1); this.centerContainer.addChild(e), this.homeBullet = e, (t == BallType.ICE || t == BallType.FIRE) && (egret.Tween.removeTweens(e), e.scaleX = e.scaleY = 1, egret.Tween.get(e, { loop: !0 }).to({ scaleX: 1.2, scaleY: 1.2 }, 250).to({ scaleX: 1, scaleY: 1 }, 250)) }, e.prototype.updateAllBallPostion = function() { for (var t = 0; t < this.allBall.length; t++) this.allBall[t] && this.allBall[t].update() }, e.prototype.updateTimeShow = function() { var t = this.gameTime / Consts.TOTAL_TIME; this.proBar.x = 104 - 458 * (1 - t) }, e.prototype.gameOver = function() { var t = this; GameManager.instance.state == GameState.PLAYING && (GameManager.instance.state = GameState.OVER, this.bullet && egret.Tween.get(this.bullet).to({ scaleX: 0, scaleY: 0 }, 250).call(function() { game.UIUtils.removeSelf(t.bullet), t.bullet = null }, this), manager.UpdateTickerManager.instance.remove(this), AsumentParkManager.getInstance().scroe = GameManager.instance.score, AsumentParkManager.getInstance().sendNetEndtGame()) }, e.prototype.update = function(t) { if (GameManager.instance.state == GameState.PLAYING) { if (t /= 1e3, this.gameTime -= t, this.gameTime <= 0) return this.gameTime = 0, this.updateTimeShow(), void this.gameOver(); if (this.updateTimeShow(), this.updateAllBallPostion(), this.bullet && (this.bullet.bulletUpdate(t), this.checkBulletBounds(), this.bullet && this.checkBulletCollision()), this.frozenTime > 0) return this.frozenTime -= t, void(this.frozenTime < 0 && (this.bullet ? this.frozenTime = .01 : this.rollbackAllNullBalls())); if (this.needRollbackNum > 0 && this.needRollbackBallArr && this.needRollbackBallArr.length) return this.needRollbackNum--, this.rollbackBalls(), void this.checkBallRollbackOver(); this.updateIndex++; var e = 2 + Math.round(this.gameTime / Consts.TOTAL_TIME * 2); e > 1 && this.allBall.length < Consts.MIN_SHOW_BALL_NUM && (e = 1); var i = 2; if (this.makeBallCount < Consts.MIN_SHOW_BALL_NUM) { e = 0; var n = Consts.BALL_CELL_NUM / 2; i = Util.limit(Math.round(n - this.makeBallCount / n), 2, n) } if (this.updateIndex >= e) { this.updateIndex = 0; for (var a = 0; a < this.allBall.length; a++) { var o = this.allBall[a]; o && (o.toNext(i), o.isPathEnd && this.gameOver()) } this.toNextCount += i, this.toNextCount >= Consts.BALL_CELL_NUM && (this.toNextCount -= Consts.BALL_CELL_NUM, this.makeBall(this.toNextCount)) } this.checkShowNullBug(), t > .05 && this.update(0) } }, e.prototype.checkShowNullBug = function() { if (this.isGameStart && !(this.frozenTime > 0 || (this.removeStartNullBall(), this.$checkBugIndex++, this.$checkBugIndex % 10 != 0 || this.checkHasNullBall()))) for (var t = this.allBall.length - 1; t > 0; t--) { var e = this.allBall[t], i = this.allBall[t - 1], n = i.index - e.index - Consts.BALL_CELL_NUM; 0 != n && i.toNext(n) } }, e.prototype.rollbackAllNullBalls = function() { for (var t = 0, e = 0, i = this.allBall.length - 1; i >= 0; i--) { var n = this.allBall[i]; if (n && t > 0) { e = i + 1; break } n || t++ } if (t > 0) { this.setRollbackData(e, t), this.needRollbackBallArr = []; for (var i = 0; e > i; i++) this.needRollbackBallArr.push(this.allBall[i]); 0 == this.needRollbackBallArr.length && (this.needRollbackBallArr = null) } }, e.prototype.checkBallRollbackOver = function() { if (this.needRollbackNum <= 0) { if (this.needRollbackBallArr.length <= 0) return; var t = this.needRollbackBallArr[this.needRollbackBallArr.length - 1], e = this.allBall.indexOf(t); this.needRollbackBallArr = null, this.checkBulletCanRemove(e, !0) || this.rollbackAllNullBalls() } }, e.prototype.rollbackBalls = function() { for (var t = 0; t < this.needRollbackBallArr.length; t++) { var e = this.needRollbackBallArr[t]; e && e.toNext( - Consts.BALL_CELL_NUM / 3) } }, e.prototype.checkBulletBounds = function() { (this.bullet.x < 0 || this.bullet.x > Const.WIN_W || this.bullet.y < 0 || this.bullet.y > Const.WIN_H) && (game.UIUtils.removeSelf(this.bullet), this.bullet = null, this.comboCount = 0) }, e.prototype.destroyIceAndFire = function() { var t = this; egret.Tween.get(this.bullet).to({ scaleX: 10, scaleY: 10, alpha: 0 }, 250).call(function() { game.UIUtils.removeSelf(t.bullet), t.bullet = null }) }, e.prototype.checkBulletCollision = function() { var t = Consts.BALL_SIZE * Consts.BALL_SIZE; this.isMatch3Mode = !1; for (var e = 0; e < this.allBall.length; e++) { var i = this.allBall[e]; if (i) { var n = this.bullet.x - i.x, a = this.bullet.y - i.y; if (Math.abs(n) < Consts.BALL_SIZE || Math.abs(a) < Consts.BALL_SIZE) { var o = n * n + a * a; if (t >= o) { if (this.bullet.type == BallType.ICE || this.bullet.type == BallType.FIRE) this.bullet.type == BallType.ICE ? this.frozenTime = Consts.FROZEN_TIME: (this.removeAllBallsByType(i.type), egret.setTimeout(this.rollbackAllNullBalls, this, 400)), this.destroyIceAndFire(); else { this.isMatch3Mode = !0; var s = 0, r = -1; 90 > s ? (this.bullet.moveToPathIndex(i.index + Consts.BALL_CELL_NUM), r = e) : (this.bullet.moveToPathIndex(i.index), r = e + 1), this.allBall.splice(r, 0, this.bullet), this.moveFrontBall(r), this.checkBulletCanRemove(r) } return void(this.bullet = null) } } } } }, e.prototype.removeAllBallsByType = function(t) { for (var e = 0; e < this.allBall.length; e++) { var i = this.allBall[e]; i && i.type == t && (this.removeOneBall(i), this.allBall[e] = null) } }, e.prototype.removeOneBall = function(t) { egret.Tween.get(t).to({ scaleX: 0, scaleY: 0 }, 250).call(game.UIUtils.removeSelf, this, [t]); var e = RES.getRes("ball_effect_png"), i = RES.getRes("ball_effect_json"), n = new egret.MovieClipDataFactory(i, e), a = new egret.MovieClip(n.generateMovieClipData()); this.addChild(a), a.x = t.x, a.y = t.y, a.play(1), a.once(egret.Event.COMPLETE, function() { game.UIUtils.removeSelf(a) }, this) }, e.prototype.checkBulletCanRemove = function(t, e) { void 0 === e && (e = !1); var i = this.allBall[t]; if (!i) return ! 1; for (var n = [i], a = t, o = t, s = t - 1; s >= 0;) { var r = this.allBall[s]; if (!r || r.type != i.type) break; n.unshift(r), a--, s-- } for (var h = !1, s = t + 1; s < this.allBall.length;) { var r = this.allBall[s]; if (!r || r.type != i.type) break; n.push(r), o++, s++, h = !0 } var l = !1; return l = n.length >= 3 ? e ? h: !0 : !1, l && (this.destroyCanRemoveBall(a, o), this.destroyAfterRollbackBall(a - 1, o + 1, n.length), this.isMatch3Mode && (this.isMatch3Mode = !1, this.validBulletCount++), this.comboCount++, this.updateScore(n.length)), l }, e.prototype.updateScore = function(t) { var e = 2 + 1 * (t - 3), i = t * e, n = i * this.comboCount; GameManager.instance.score += n, this.scoreTF.text = "" + GameManager.instance.score, this.comboCount > 1 && Combo.show(this.comboCount) }, e.prototype.destroyAfterRollbackBall = function(t, e, i) { this.frozenTime > 0 || (t >= 0 ? this.rollbackAllNullBalls() : this.allBall.splice(t + 1, i)) }, e.prototype.setRollbackData = function(t, e) { this.needRollbackNum = 3 * e, this.allBall.splice(t, e) }, e.prototype.findLeftNotNullBall = function(t) { for (var e = [], i = t; i >= 0;) { var n = this.allBall[i]; e.unshift(n), i-- } return e }, e.prototype.destroyCanRemoveBall = function(t, e) { for (var i = t; e >= i; i++) { var n = this.allBall[i]; this.allBall[i] = null, this.removeOneBall(n) } }, e.prototype.moveFrontBall = function(t) { for (var e = t - 1; e >= 0; e--) { var i = this.allBall[e]; if (!i) return void this.allBall.splice(e, 1); i.toNext(Consts.BALL_CELL_NUM) } }, e.prototype.initPath = function() { for (var t = [607, 759, 564, 815, 537, 840, 507, 863, 478, 881, 445, 900, 415, 907, 395, 913, 374, 918, 349, 918, 329, 915, 310, 913, 291, 908, 264, 899, 233, 882, 213, 870, 188, 851, 167, 835, 151, 813, 137, 793, 119, 767, 100, 735, 86, 695, 71, 650, 63, 615, 60, 584, 61, 540, 65, 505, 73, 466, 83, 429, 96, 385, 117, 351, 137, 321, 157, 298, 178, 274, 212, 247, 244, 230, 278, 221, 312, 212, 355, 212, 387, 214, 416, 225, 441, 237, 468, 253, 496, 272, 517, 295, 534, 321, 553, 350, 567, 392, 576, 425, 581, 457, 584, 488, 584, 523, 581, 552, 577, 585, 568, 631, 554, 676, 535, 711, 518, 738, 489, 762, 452, 785, 408, 804, 365, 812, 324, 804, 282, 788, 249, 766, 215, 736, 195, 708, 177, 676, 167, 645, 158, 605, 151, 549, 154, 508, 164, 445, 181, 413, 197, 383, 226, 359, 247, 336, 292, 321, 336, 319, 377, 319, 411, 334, 439, 361, 458, 381, 476, 419, 493, 467, 497, 512, 499, 565, 486, 608, 465, 648, 441, 674, 416, 688, 384, 701, 343, 702, 299, 688, 275, 663, 245, 627, 232, 584, 230, 537, 244, 487, 262, 453, 291, 430, 314, 412, 333, 404], e = 0; e < t.length - 4; e += 2) { var i = t[e], n = t[e + 1], a = t[e + 2], o = t[e + 3], s = a - i, r = o - n, h = Math.sqrt(s * s + r * r), l = Math.round(h / Consts.BALL_EVERY_CUT), c = s / l, p = r / l; this.fillLineDot(i, n, l, c, p) } }, e.prototype.fillLineDot = function(t, e, i, n, a) { for (var o = Const.WIN_H - Const.DESGIN_H, s = 0; i > s; s++) { var r = t + s * n, h = e + s * a + o; this.pathPos.push(new egret.Point(r, h)) } }, e.prototype.onTouchTap = function(t) { t.target; if (this.isGameStart && !this.bullet && !this.checkHasNullBall() && !this.needRollbackBallArr) { this.comboCount = 0; var e = new egret.Point(t.stageX - this.centerContainer.x, t.stageY - this.centerContainer.y), i = Util.rad2ang(Math.atan2(e.y, e.x)); this.centerContainer.rotation = i - 90; var n = this.homeBullet.localToGlobal(Consts.BALL_SIZE / 2); egret.Tween.removeTweens(this.homeBullet), this.bullet = this.homeBullet, this.bullet.x = n.x, this.bullet.y = n.y, this.gameContainer.addChild(this.bullet), this.bullet.setSpeed(e), this.makeBulletBall() } }, e.prototype.onTouchMoved = function(t) { if (this.isGameStart) { var e = new egret.Point(t.stageX - this.centerContainer.x, t.stageY - this.centerContainer.y), i = Util.rad2ang(Math.atan2(e.y, e.x)); this.centerContainer.rotation = i - 90 } }, e.prototype.checkHasNullBall = function() { if (this.frozenTime <= 0) for (var t = 0; t < this.allBall.length; t++) if (!this.allBall[t]) return ! 0; return ! 1 }, e.prototype.removeStartNullBall = function() { for (; ! this.allBall[0] && this.allBall.length > 0;) this.allBall.splice(0, 1) }, e } (SceneBase); __reflect(ZumaPanel.prototype, "ZumaPanel", ["IUpdate"]); var Consts = function() { function t() {} return t.WIN_W = 640, t.WIN_H = 960, t.DESGIN_W = 640, t.DESGIN_H = 960, t.BALL_SIZE = 69, t.BALL_EVERY_CUT = 5.75, t.BALL_CELL_NUM = Math.round(t.BALL_SIZE / t.BALL_EVERY_CUT), t.BULLET_SPEED = 1e3, t.MIN_SHOW_BALL_NUM = 20, t.FROZEN_TIME = 4, t.TOTAL_TIME = 120, t.CARE_URL = "http://mp.weixin.qq.com/s?__biz=MzA4NzQyNzQwMw==&mid=402641000&idx=1&sn=b22935e7e5ad77ed85e60bb3ee249f26&scene=1&srcid=02019ogTeECxzGexTnDQ1tD6&from=singlemessage&isappinstalled=0#wechat_redirect", t.REWARD_LIST_URL = "http://www.huhugame.com/index.php?m=api&c=sqapi&a=paihang", t.IS_ACTIVE_OVER = !1, t.IS_REWARD_OPEN = !0, t.ACTIVE_OVER_TIP_STR = "活动已经结束,请查看中奖信息。", t.CONFIG_DATA_NAME = "zuma.db", t.VERTIFY_KEY = "zuma.1024", t.VERSION = "v.103", t } (); __reflect(Consts.prototype, "Consts"); var GameEditorScene = function(t) { function e() { var e = t.call(this) || this; return e.allPos = [], e.skinName = new GameEditorSceneSkin, e } return __extends(e, t), e.prototype.createChildren = function() { t.prototype.createChildren.call(this); var e = new egret.Shape; this.g = e.graphics, this.gameContainer.addChild(e), this.g.lineStyle(2, 16711680) }, e.prototype.onTouchTap = function(t) { var e = t.target; if (e == this.outBtn) for (var i = "", n = 0; n < this.allPos.length; n++) i += this.allPos[n].x + "," + this.allPos[n].y + ","; else if (e == this.clearBtn) this.allPos = [], this.g.clear(); else { var a = t.stageX, o = t.stageY; this.allPos.push(new egret.Point(a, o)), this.g.lineTo(a, o) } }, e } (SceneBase); __reflect(GameEditorScene.prototype, "GameEditorScene"); var GameManager = function() { function t() { this._isSound = !0, this._isEff = !0, this.hasPlayCG = !1, this.isGuided = !1 } return Object.defineProperty(t, "instance", { get: function() { return t._instance || (t._instance = new t), t._instance }, enumerable: !0, configurable: !0 }), t.prototype.init = function() {}, Object.defineProperty(t.prototype, "isSound", { get: function() { return this._isSound }, enumerable: !0, configurable: !0 }), Object.defineProperty(t.prototype, "isEff", { get: function() { return this._isEff }, set: function(t) { this._isEff = t }, enumerable: !0, configurable: !0 }), t.prototype.useInitFullData = function() { this._score = 0, this.isGuided = !1, this.winLevelInfo = [] }, Object.defineProperty(t.prototype, "state", { get: function() { return this._state }, set: function(t) { this.state != t && (this.lastState = this.state, this._state = t) }, enumerable: !0, configurable: !0 }), Object.defineProperty(t.prototype, "score", { get: function() { return this._score }, set: function(t) { this._score = t }, enumerable: !0, configurable: !0 }), t.prototype.updateWinLevelStar = function(t, e) { this.winLevelInfo[t - 1] = e }, t.prototype.getStar = function(t) { return this.winLevelInfo.length < t ? -1 : this.winLevelInfo[t - 1] }, Object.defineProperty(t.prototype, "winLevelCount", { get: function() { return this.winLevelInfo.length }, enumerable: !0, configurable: !0 }), Object.defineProperty(t.prototype, "starCount", { get: function() { for (var t = 0, e = 0; e < this.winLevelInfo.length; e++) t += this.winLevelInfo[e]; return t }, enumerable: !0, configurable: !0 }), t } (); __reflect(GameManager.prototype, "GameManager"); var game; ! function(t) { var e = function() { function t() {} return t.to_command_id1 = "1", t[0] = PanelNotify.OPEN_FRIEND_GIVE_LIST, t[3] = ClientNotify.SHOW_CONFIRM_ALERT, t[4] = ClientNotify.GIVE_SUCCESS, t[6] = SysNotify.SHOW_MESSAGE, t } (); t.SocketCommand = e, __reflect(e.prototype, "game.SocketCommand") } (game || (game = {})); var Ball = function(t) { function e(e, i, n) { void 0 === n && (n = !0); var a = t.call(this, RES.getRes("zuma_item_" + i + "_png")) || this; return a.index = 0, a.type = 1, a.type = i, a.path = e, a.isPathBall = n, a.anchorOffsetX = a.width / 2, a.anchorOffsetY = a.height / 2, a.beginShow(), a } return __extends(e, t), e.prototype.beginShow = function() { if (this.isPathBall) { this.index = 0; var t = this.path[this.index]; this.x = t.x, this.y = t.y } else this.x = 0, this.y = this.height / 2; this.moveV = new egret.Point(0, -1), this.scaleX = this.scaleY = 0, egret.Tween.get(this).to({ scaleX: 1, scaleY: 1 }, 150) }, e.prototype.toNext = function(t) { void 0 === t && (t = 1), this.index += t, this.index = Util.limit(this.index, 0, this.path.length - 1); var e = this.path[this.index]; Math.atan2(e.y - this.y, e.x - this.x); this.moveV.x = e.x - this.x, this.moveV.y = e.y - this.y }, e.prototype.update = function() { var t = this.path[this.index]; this.y += (t.y - this.y) / 3, this.x += (t.x - this.x) / 3 }, Object.defineProperty(e.prototype, "isPathEnd", { get: function() { return this.index >= this.path.length - 1 }, enumerable: !0, configurable: !0 }), e.prototype.setSpeed = function(t) { t.normalize(1), this.speedX = t.x * Consts.BULLET_SPEED, this.speedY = t.y * Consts.BULLET_SPEED }, e.prototype.bulletUpdate = function(t) { this.x += this.speedX * t, this.y += this.speedY * t }, e.prototype.moveToPathIndex = function(t) { this.index = t, this.toNext(0) }, e } (egret.Bitmap); __reflect(Ball.prototype, "Ball"); var BallType; ! function(t) { t[t.TYPE1 = 1] = "TYPE1", t[t.TYPE2 = 2] = "TYPE2", t[t.TYPE3 = 3] = "TYPE3", t[t.TYPE4 = 4] = "TYPE4", t[t.TYPE5 = 5] = "TYPE5", t[t.ICE = 6] = "ICE", t[t.FIRE = 7] = "FIRE" } (BallType || (BallType = {})); var Combo = function(t) { function e(e) { var i = t.call(this) || this; return i.num = e, i.skinName = new ComboSkin, i } return __extends(e, t), e.prototype.createChildren = function() { t.prototype.createChildren.call(this), this.numTF.text = this.num + "" }, e.show = function(t) { var i = new e(t); i.anchorOffsetX = i.width / 2, i.anchorOffsetY = i.height / 2, i.x = Const.WIN_W / 2 + Util.rang( - 100, 100), i.y = Const.WIN_H / 2 + Util.rang( - 100, 100), GameLayerManager.instance.popLayer.addChild(i), i.scaleX = i.scaleY = 0, egret.Tween.get(i).to({ scaleX: 1, scaleY: 1 }, 250).wait(550).call(game.UIUtils.removeSelf, this, [i]) }, e } (eui.Component); __reflect(Combo.prototype, "Combo"); var AnimalTips = function(t) { function e() { var e = t.call(this) || this; return e.skinName = new PlantCdTipSkin, e } return __extends(e, t), e.show = function(t, i) { var n = e._instance; if (n || (n = new e, e._instance = n), t) { var a = Global.gameProxy.getPlantConfigbase(t.crop_config_id); t.status; if (n.barTime.visible = !0, t.status == AnimalStatus.YOUZI) { n.labelName.text = a.name + "(幼崽期)", n.labelTime.text = game.Utils.showTimeFormat(t.currPhaseNeedTime); var o = t.currPhaseRunTime / t.currPhaseTotalTime; n.barTime.value = game.Utils.limit(100 * o, 0, 100) } else if (t.status == AnimalStatus.YOUZHAN) { n.labelName.text = a.name + "(幼年期)", n.labelTime.text = game.Utils.showTimeFormat(t.currPhaseNeedTime); var o = t.currPhaseRunTime / t.currPhaseTotalTime; n.barTime.value = game.Utils.limit(100 * o, 0, 100) } else if (t.status == AnimalStatus.CHENGZHANG) { n.labelName.text = a.name + "(成长期)", n.labelTime.text = game.Utils.showTimeFormat(t.currPhaseNeedTime); var o = t.currPhaseRunTime / t.currPhaseTotalTime; n.barTime.value = game.Utils.limit(100 * o, 0, 100) } else if (t.status == AnimalStatus.CHENGSHU) { n.labelName.text = a.name + "(成熟期)", n.labelTime.text = game.Utils.showTimeFormat(t.currPhaseNeedTime); var o = t.currPhaseRunTime / t.currPhaseTotalTime; n.barTime.value = game.Utils.limit(100 * o, 0, 100) } else if (t.status == AnimalStatus.CHANCHU) switch (n.labelName.text = a.name + "(产出期)", n.barTime.visible = !1, t.type) { case AnimalType.JI: 1 == t.is_output ? n.labelTime.text = "产出鸡蛋X" + t.output + "个": n.labelTime.text = "产出鸡蛋X" + a.output + "个"; break; case AnimalType.YANG: 1 == t.is_output ? n.labelTime.text = "产出便便X" + t.output + "斤": n.labelTime.text = "产出便便X" + a.output + "斤"; break; case AnimalType.NIU: 1 == t.is_output ? n.labelTime.text = "产出牛奶X" + t.output + "瓶": n.labelTime.text = "产出牛奶X" + a.output + "瓶" } } egret.callLater(function() { n.anchorOffsetX = n.width / 2, n.anchorOffsetY = n.height / 2; var t = i.x, e = i.y - n.height / 2 - 16; i.x < n.width / 2 ? t = n.width / 2 : i.x > Const.WIN_W - n.width / 2 && (t = Const.WIN_W - n.width / 2), i.y < .2 * Const.WIN_H && (e = i.y + n.height / 2 + 20), n.x = t, n.y = e }, this), n.scaleX = n.scaleY = 0, GameLayerManager.instance.tipLayer.addChild(n), egret.Tween.get(n).to({ scaleX: 1, scaleY: 1 }, 150) }, e.hide = function() { var t = e._instance; t && t.stage && egret.Tween.get(t).to({ scaleX: 0, scaleY: 0 }, 150).call(game.UIUtils.removeSelf, t, [t]) }, e } (eui.Component); __reflect(AnimalTips.prototype, "AnimalTips"); var game; ! function(t) { var e = function(e) { function i(t) { var i = e.call(this) || this; return i.isMine = t, i.isMine ? i.playerProxy = Global.playerProxy: i.playerProxy = Global.otherPlayerProxy, i.skinName = GameScence2Skin, i } return __extends(i, e), i.prototype.update = function(t) {}, i.prototype.changeDog = function() { this.showDog() }, i.prototype.onAdded = function() { e.prototype.onAdded.call(this), manager.UpdateTickerManager.instance.add(this), t.EventManager.instance.addEvent(SysNotify.DOG_UPDAT, this.changeDog, this) this.radioGroup.addEventListener(egret.Event.CHANGE, this.onChange, this), this.backtoOtherHome.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onBackToOtherHome, this), this.touquButton.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTouqu, this), this.isMine && (this.goimg.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onGoDog, this), this.fangImg.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onFang, this)) }, i.prototype.onRemoved = function() { e.prototype.onRemoved.call(this), manager.UpdateTickerManager.instance.remove(this), this.radioGroup.removeEventListener(egret.Event.REMOVED, this.onChange, this), this.backtoOtherHome.removeEventListener(egret.TouchEvent.TOUCH_TAP, this.onBackToOtherHome, this), this.touquButton.removeEventListener(egret.TouchEvent.TOUCH_TAP, this.onTouqu, this), this.isMine && (this.goimg.removeEventListener(egret.TouchEvent.TOUCH_TAP, this.onGoDog, this), this.fangImg.removeEventListener(egret.TouchEvent.TOUCH_TAP, this.onFang, this)) }, i.prototype.onGoDog = function(e) { this.isMine && t.AppFacade.getInstance().sendNotification(PanelNotify.OPEN_DOG) }, i.prototype.onFang = function(e) { this.isMine && t.AppFacade.getInstance().sendNotification(PanelNotify.OPEN_SHOP) }, i.prototype.onBackToOtherHome = function(e) { var i = GameScenceManager.getInstance().be_user_id; t.AppFacade.getInstance().sendNotification(ClientNotify.GO_OTHER_FARM, { uid: i }), t.AppFacade.getInstance().sendNotification(SceneNotify.CLOSE_MGAME) }, i.prototype.onTouqu = function(t) { GameScenceManager.getInstance().sendNetSteal() }, i.prototype.onChange = function(t) { GameScenceManager.getInstance().selectedLogicAnimal = null, this.gameView.animalType = this.radioGroup.selectedValue, GameScenceManager.getInstance().type = this.radioGroup.selectedValue, this.isMine ? GameScenceManager.getInstance().sendNetmuchangInfo() : GameScenceManager.getInstance().sendNetOthermuchangInfo() }, i.prototype.onTouchTap = function(e) { switch (e.target) { case this.btnBackHome: Global.otherPlayerProxy.clearPlayerData(), t.AppFacade.getInstance().sendNotification(SceneNotify.BACK_MINE_GAME), t.AppFacade.getInstance().sendNotification(SceneNotify.CLOSE_MGAME) } }, i.prototype.createChildren = function() { e.prototype.createChildren.call(this), this.radioGroup = new eui.RadioButtonGroup, this.rButton0.value = AnimalType.JI, this.rButton0.group = this.radioGroup, this.rButton1.value = AnimalType.YANG, this.rButton1.group = this.radioGroup, this.rButton2.value = AnimalType.NIU, this.rButton2.group = this.radioGroup, this.rButton0.selected = !0, this.gameView = new t.GameView2(this), this.gview.addChild(this.gameView), this.gameView.y = 550, this.isMine ? (this.leftMenu = new t.LeftMenu, this.addChild(this.leftMenu), this.mainMenu = new t.MainMenu, this.addChild(this.mainMenu), this.btnBackHome.visible = !1, this.otherg.visible = !1) : (this.otherg.visible = !0, this.btnBackHome.visible = !0, this.addChild(this.btnBackHome)), this.topLayer = new t.GameTopLayer(this), this.addChild(this.topLayer); //this.showDog() if((this.isMine&&Global.playerProxy.playerData.use_dog_item_id>0)||(!this.isMine&&Global.otherPlayerProxy.playerData.use_dog_item_id>0)){ console.log('显示狗狗'); this.showDog(); } }, i.prototype.childrenCreated = function() { e.prototype.childrenCreated.call(this), GameScenceManager.getInstance().type = this.gameView.animalType, this.isMine ? GameScenceManager.getInstance().sendNetmuchangInfo() : GameScenceManager.getInstance().sendNetOthermuchangInfo() }, i.prototype.showDog = function() { this.gougroup.removeChildren(); var e = new t.WidgetDog(this.playerProxy); e.dx = 25, e.dy = 20, this.gougroup.addChild(e), e.showType(106002), e.runTypeAni() }, i } (t.BaseComponent); t.GameScence2 = e, __reflect(e.prototype, "game.GameScence2", ["IUpdate"]) } (game || (game = {})); var GameScenceManager = function(t) { function e() { var e = t.call(this) || this; return e.jArr = [], e.yArr = [], e.nArr = [], e } return __extends(e, t), e.getInstance = function() { return this._instance || (this._instance = new e), this._instance }, e.prototype.AlaysLogicAnimal = function(t) { for (var e = t.data, i = 0; i < e.length; i++) { var n = new LogicAnimal; n.updateData(e[i]), e[i].type == AnimalType.JI ? this.jArr.push(n) : e[i].type == AnimalType.YANG ? this.yArr.push(n) : e[i].type == AnimalType.NIU && this.nArr.push(n) } }, e.prototype.sendNetToufang = function() { console.log(this.tou_item_id); this.tou_item_id && Global.netProxy.sendRequest(GameConfig.SERVER_PATH + "farm/meadow-culture", { item_id: this.tou_item_id }, this.onSendNetToufang.bind(this)) }, e.prototype.onSendNetToufang = function(t) { if (0 == t.status) { var e = new LogicAnimal; e.updateData(t.data), e.type == AnimalType.JI ? (this.jArr.push(e), Global.playerProxy.sellWareHouseItem1("200330:1")) : e.type == AnimalType.YANG ? (this.yArr.push(e), Global.playerProxy.sellWareHouseItem1("200320:1")) : e.type == AnimalType.NIU && (this.nArr.push(e), Global.playerProxy.sellWareHouseItem1("200340:1")), game.EventManager.instance.dispatch(ClientNotify.TOUFANG_SUCCES, e) } else TipsUtils.showTipsDownToUp(GameConfig.ServerCode[t.status]) }, e.prototype.sendNetmuchangInfo = function() { //alert(this.type); console.log('当前牧场分类'+this.type); Global.netProxy.sendRequest(GameConfig.SERVER_PATH + "farm/get-meadow-list", { type: this.type }, this.onSendNetmuchangInfo.bind(this)) }, e.prototype.onSendNetmuchangInfo = function(t) { console.log(t); console.log('00000000000000000'); 0 == t.status ? (this.type == AnimalType.JI ? this.jArr.length = 0 : this.type == AnimalType.YANG ? this.yArr.length = 0 : this.type == AnimalType.NIU && (this.nArr.length = 0), this.AlaysLogicAnimal(t), game.EventManager.instance.dispatch(ClientNotify.CLEAR_ANIMALS)) : TipsUtils.showTipsDownToUp(GameConfig.ServerCode[t.status]) }, e.prototype.sendNetmuchangFeed = function() { if (this.selectedLogicAnimal && this.feed_item_id) { var t = Global.playerProxy.playerData.id, e = this.selectedLogicAnimal.id, i = this.feed_item_id; Global.netProxy.sendRequest(GameConfig.SERVER_PATH + "farm/meadow-feed", { user_id: t, id: e, item_id: i }, this.onSendNetmuchangFeed.bind(this)) } }, e.prototype.onSendNetmuchangFeed = function(t) { if (0 == t.status) { Global.playerProxy.sellWareHouseItem1(this.feed_item_id + ":1"); var e = new LogicAnimal; e.updateData(t.data); //for (var i = 0; i < this.jArr.length; i++) this.jArr[i].id == e.id && (this.jArr[i] = e); //for (var i = 0; i < this.yArr.length; i++) this.yArr[i].id == e.id && (this.yArr[i] = e); // for (var i = 0; i < this.nArr.length; i++) this.nArr[i].id == e.id && (this.nArr[i] = e); game.EventManager.instance.dispatch(ClientNotify.UPDATA_SIMPLE_ANIMAL, e) } else TipsUtils.showTipsDownToUp(GameConfig.ServerCode[t.status]) }, e.prototype.sendNetmuchangShou = function() { if (this.selectedLogicAnimal) { var t = Global.playerProxy.playerData.id; Global.netProxy.sendRequest(GameConfig.SERVER_PATH + "farm/meadow-gather", { user_id: t, id: this.selectedLogicAnimal.id }, this.onSendNetmuchangShou.bind(this)) } else TipsUtils.showTipsDownToUp("请选择动物") }, e.prototype.onSendNetmuchangShou = function(t) { if (0 == t.status) { var e = ""; e = t.data.meat_item_id + ":" + t.data.meat_num; var i = Global.gameProxy.getItemConfig(t.data.meat_item_id), n = Global.gameProxy.getItemConfig(t.data.output_item_id); if(t.data.output_num>0){ TipsUtils.showTipsDownToUp("获得" + n.name + "X" + t.data.output_num); e = t.data.meat_item_id + ":" + t.data.meat_num + "," + t.data.output_item_id + ":" + t.data.output_num; } egret.setTimeout(function() { TipsUtils.showTipsDownToUp("获得" + i.name + "X" + t.data.meat_num) }, this, 1e3), Global.playerProxy.addItem1(e, !1), Global.playerProxy.addExp(t.data.add_exp); if(t.data.output_num>0){ for (var a = 0; a < this.jArr.length; a++) this.jArr[a].id == this.selectedLogicAnimal.id && this.jArr.splice(a, 1); for (var a = 0; a < this.yArr.length; a++) this.yArr[a].id == this.selectedLogicAnimal.id && this.yArr.splice(a, 1); for (var a = 0; a < this.nArr.length; a++) this.nArr[a].id == this.selectedLogicAnimal.id && this.nArr.splice(a, 1); game.EventManager.instance.dispatch(ClientNotify.DELETE_ANIMAL, this.selectedLogicAnimal); }else{ var e = new LogicAnimal; e.updateData(t.data.muchang); //for (var a = 0; a < this.jArr.length; a++) this.jArr[a].id == e.id && (this.jArr[a] = e); //for (var a = 0; a < this.yArr.length; a++) this.yArr[a].id == e.id && (this.yArr[a] = e); //for (var a = 0; a < this.nArr.length; a++) this.nArr[a].id == e.id && (this.nArr[a] = e); game.EventManager.instance.dispatch(ClientNotify.UPDATA_SIMPLE_ANIMAL, e); } } else TipsUtils.showTipsDownToUp(GameConfig.ServerCode[t.status]) }, e.prototype.sendNetOthermuchangInfo = function() { var t = Global.playerProxy.playerData.id; Global.netProxy.sendRequest(GameConfig.SERVER_PATH + "farm/get-other-meadow-list", { type: this.type, user_id: t, be_user_id: this.be_user_id }, this.onSendNetOthermuchangInfo.bind(this)) }, e.prototype.onSendNetOthermuchangInfo = function(t) { 0 == t.status ? (this.type == AnimalType.JI ? this.jArr.length = 0 : this.type == AnimalType.YANG ? this.yArr.length = 0 : this.type == AnimalType.NIU && (this.nArr.length = 0), this.AlaysLogicAnimal(t), game.EventManager.instance.dispatch(ClientNotify.CLEAR_ANIMALS)) : TipsUtils.showTipsDownToUp(GameConfig.ServerCode[t.status]) }, e.prototype.sendNetSteal = function() { var t = Global.playerProxy.playerData.id, e = this.be_user_id; if (this.selectedLogicAnimal) { var i = this.selectedLogicAnimal.id; Global.netProxy.sendRequest(GameConfig.SERVER_PATH + "farm/meadow-steal", { id: i, user_id: t, be_user_id: e }, this.onSendnetSteal.bind(this)) } else TipsUtils.showTipsDownToUp("请选择家畜") }, e.prototype.onSendnetSteal = function(t) { if (0 == t.status) { if (t.data.deduct_gold > 0) return TipsUtils.showTipsDownToUp("被狗咬,损失金币" + t.data.deduct_gold), Global.playerProxy.playerData.gold -= t.data.deduct_gold, Global.playerProxy.playerData.gold < 0 && (Global.playerProxy.playerData.gold = 0), void game.EventManager.instance.dispatch(SysNotify.TOPLAYER_INFO_UPDATE); var e = new LogicAnimal; e.updateData(t.data.meadow); var i = Global.gameProxy.getPlantConfigbase(e.crop_config_id); Global.playerProxy.addItem1(i.item_id + ":" + t.data.steal_count); // for (var n = 0; n < this.jArr.length; n++) this.jArr[n].id == e.id && (this.jArr[n] = e); //for (var n = 0; n < this.yArr.length; n++) this.yArr[n].id == e.id && (this.yArr[n] = e); // for (var n = 0; n < this.nArr.length; n++) this.nArr[n].id == e.id && (this.nArr[n] = e); game.EventManager.instance.dispatch(ClientNotify.UPDATA_SIMPLE_ANIMAL, e) } else 2e3 == t.status ? (this.sendNetOthermuchangInfo(), TipsUtils.showTipsDownToUp(GameConfig.ServerCode[t.status])) : TipsUtils.showTipsDownToUp(GameConfig.ServerCode[t.status]) }, e.codeArr = ["", "幼崽", "成长", "成熟", "产出"], e } (egret.EventDispatcher); __reflect(GameScenceManager.prototype, "GameScenceManager"); var LogicAnimal = function() { function t() { this.status = 0, this.lastStatus = -1, this.plantAllStatusTime = [] } return t.prototype.updateData = function(t) { t && (this.id = t.id, this.user_id = t.user_id, this.crop_config_id = t.crop_config_id, this.item_config_id = t.item_config_id, this.start_time = t.start_time, this.gather_time = t.gather_time, this.is_ripe = t.is_ripe, this.num = t.num, this.type = t.type, this.is_output = t.is_output, this.output = t.output, this.min_output = t.min_output, this.setStatus()) }, t.prototype.setStatus = function() { var t = Global.gameProxy.getPlantConfig(this.crop_config_id), e = Global.gameProxy.getCommonConfig()[16], i = DateTimer.instance.now, n = i - this.start_time, a = e.min, o = t.time3, s = t.time2, r = t.time1; r > n ? this.status = AnimalStatus.YOUZI: n >= r && r + s > n ? this.status = AnimalStatus.YOUZHAN: n >= r + s && r + s + o > n ? this.status = AnimalStatus.CHENGZHANG: n >= r + s + o && r + s + o + a > n ? this.status = AnimalStatus.CHENGSHU: this.status = AnimalStatus.CHANCHU, this.plantAllStatusTime = [t.time1, t.time2, t.time3, a] }, Object.defineProperty(t.prototype, "currPhaseTotalTime", { get: function() { return this.status < 4 ? 1e3 * this.plantAllStatusTime[this.status] : -1 }, enumerable: !0, configurable: !0 }), Object.defineProperty(t.prototype, "currPhaseRunTime", { get: function() { for (var t = DateTimer.instance.now - this.start_time, e = 0, i = 0; i < this.status; i++) e += this.plantAllStatusTime[i]; return 1e3 * (t - e) }, enumerable: !0, configurable: !0 }), Object.defineProperty(t.prototype, "currPhaseNeedTime", { get: function() { var t = this.currPhaseTotalTime - this.currPhaseRunTime; return 0 > t && (t = 0), t }, enumerable: !0, configurable: !0 }), t } (); __reflect(LogicAnimal.prototype, "LogicAnimal"); var AnimalType; ! function(t) { t[t.JI = 104] = "JI", t[t.YANG = 103] = "YANG", t[t.NIU = 105] = "NIU" } (AnimalType || (AnimalType = {})); var AnimalStatus; ! function(t) { t[t.YOUZI = 0] = "YOUZI", t[t.YOUZHAN = 1] = "YOUZHAN", t[t.CHENGZHANG = 2] = "CHENGZHANG", t[t.CHENGSHU = 3] = "CHENGSHU", t[t.CHANCHU = 4] = "CHANCHU" } (AnimalStatus || (AnimalStatus = {})); var game; ! function(t) { var e = function(e) { function i(t) { void 0 === t && (t = null); var n = e.call(this, i.NAME, t) || this; return n.type = "scene", n.GroupName = "muchang", n.ismine = !0, n } return __extends(i, e), i.prototype.listNotificationInterests = function() { return [SceneNotify.OPEN_MINE_MGAME, SceneNotify.OPEN_OTHER_MGAME, SceneNotify.BACK_MINE_MGAME, SceneNotify.CLOSE_MGAME] }, i.prototype.onRegister = function() { e.prototype.onRegister.call(this), this.facade.registerMediator(new t.ShopMediator), this.facade.registerMediator(new t.WareHouseMediator), this.facade.registerMediator(new t.BagMediator), this.facade.registerMediator(new t.SkinMediator), this.facade.registerMediator(new t.HelpMediator), this.facade.registerMediator(new t.LandExtendMediator), this.facade.registerMediator(new t.LandUpgradeMediator), this.facade.registerMediator(new t.HouseUpgradeMediator), this.facade.registerMediator(new t.DogMediator), this.facade.registerMediator(new t.FriendMediator), this.facade.registerMediator(new t.PlayerInfoMediator), this.facade.registerMediator(new t.LogMediator), this.facade.registerMediator(new t.FriendGiveMediator), this.facade.registerMediator(new t.FriendGiveListMediator), this.facade.registerMediator(new t.LotteryMediator), this.facade.registerMediator(new t.SendMesageMediator), this.facade.registerMediator(new t.SayMediator), this.facade.registerMediator(new t.ExGoldMediator), this.facade.registerMediator(new t.PayMediator), this.facade.registerMediator(new t.NoticeMediator), this.facade.registerMediator(new t.MofajiagongMediter), this.facade.registerMediator(new t.MofahechengMidter), this.facade.registerMediator(new LevelGiftMediter), this.facade.registerMediator(new OnlineGiftMediter), this.facade.registerMediator(new SignMediter), this.facade.registerMediator(new SignsTipsMediter), this.facade.registerMediator(new FuliMediter), this.facade.registerMediator(new FulibaoTipsMediter), this.facade.registerMediator(new BattlePetMediator), this.facade.registerMediator(new BattlePetTipsMeditor), this.facade.registerMediator(new SportsMeditor), this.facade.registerMediator(new BattlePetSenceMediator), this.facade.registerMediator(new UseBattlePetTipsMediator), this.facade.registerMediator(new BattleFruitTipsMediator), this.facade.registerMediator(new AsumentParkMediator), this.facade.registerMediator(new ZumaMediator), this.facade.registerMediator(new t.TianbingMediator), this.facade.registerMediator(new RewardTipsMediator), this.facade.registerMediator(new ZhuawawaMediator), this.facade.registerMediator(new ChengjiuMediator), this.facade.registerMediator(new BoxMediator), this.facade.registerMediator(new DogTipsMediter), this.facade.registerMediator(new BagMediator2) }, i.prototype.handleNotification = function(t) { t.getBody(); switch (t.getName()) { case SceneNotify.OPEN_MINE_MGAME: this.ismine = !0, this.onGetInfo(); break; case SceneNotify.OPEN_OTHER_MGAME: this.ismine = !1, this.onGetInfo(); break; case SceneNotify.BACK_MINE_MGAME: this.backToMineScene(); break; case SceneNotify.CLOSE_MGAME: this.closeViewComponent(1) } }, i.prototype.onGetInfo = function() { RES.isGroupLoaded(this.GroupName) ? this.ismine ? this.showViewComponent(!0) : this.showOtherGameScene() : (LoadingCompoment.getInstance().show(), RES.addEventListener(RES.ResourceEvent.GROUP_COMPLETE, this.onResourceLoadComplete, this), RES.addEventListener(RES.ResourceEvent.GROUP_LOAD_ERROR, this.onResourceLoadError, this), RES.addEventListener(RES.ResourceEvent.GROUP_PROGRESS, this.onResourceProgress, this), RES.loadGroup(this.GroupName)) }, i.prototype.onResourceLoadComplete = function(t) { t.groupName == this.GroupName && (RES.removeEventListener(RES.ResourceEvent.GROUP_COMPLETE, this.onResourceLoadComplete, this), RES.removeEventListener(RES.ResourceEvent.GROUP_LOAD_ERROR, this.onResourceLoadError, this), RES.removeEventListener(RES.ResourceEvent.GROUP_PROGRESS, this.onResourceProgress, this), LoadingCompoment.getInstance().hide(), this.ismine ? this.showViewComponent(!0) : this.showOtherGameScene()) }, i.prototype.onResourceLoadError = function(t) { console.warn("Group:" + t.groupName + " has failed to load"), this.onResourceLoadComplete(t) }, i.prototype.onResourceProgress = function(t) { t.groupName == this.GroupName && LoadingCompoment.getInstance().prossBar.setPross(t.itemsLoaded, t.itemsTotal) }, i.prototype.backToMineScene = function() { var e = 250, i = new t.GameScene(!0); i.x = -Const.WIN_W, PopUpManager.addSceneUp(i), egret.Tween.get(i).to({ x: 0 }, e); var n = this.viewComponent; egret.Tween.get(n).to({ x: Const.WIN_W }, e).call(function() { this.closeViewComponent(1), this.viewComponent = i, t.EventManager.instance.dispatch(SysNotify.FRIEND_REFRESH), t.AppFacade.getInstance().sendNotification(PanelNotify.SHOW_FRIEND) }, this), egret.Tween.get(GameLayerManager.instance.popLayer).to({ x: 0 }, e) }, i.prototype.showOtherGameScene = function(m) { var e = 250, i = new t.GameScence2(!1); this.viewComponent = new t.GameScene(m); i.x = Const.WIN_W, PopUpManager.addSceneUp(i), egret.Tween.get(i).to({ x: 0 }, e); var n = t.AppFacade.getInstance().retrieveMediator(t.GameMediator.NAME), a = n.viewComponent; console.log(Const,'检测这里'); egret.Tween.get(a).to({ x: -Const.WIN_W }, e).call(function() { t.UIUtils.removeSelf(a), a = null, this.viewComponent = i }, this), egret.Tween.get(GameLayerManager.instance.popLayer).to({ x: -Const.WIN_W }, e) }, i.prototype.showViewComponent = function(e) { this.viewComponent = new t.GameScence2(e), this.viewComponent.mediator = this, PopUpManager.addSceneUp(this.viewComponent) }, i.prototype.initUI = function() {}, i.prototype.initData = function() {}, i.NAME = "GameScenceMediter2", i } (BaseMediator); t.GameScenceMediter2 = e, __reflect(e.prototype, "game.GameScenceMediter2") } (game || (game = {})); var game; ! function(t) { var e = function(e) { function i(t) { var i = e.call(this) || this; return i.animalsArr = [], i.animalType = AnimalType.JI, i.gameScene = t, i.skinName = GameView2Skin, i.addEventListener(egret.Event.ADDED_TO_STAGE, i.onAdd, i), i.addEventListener(egret.Event.REMOVED_FROM_STAGE, i.onRemove, i), i } return __extends(i, e), i.prototype.onAdd = function() { manager.UpdateTickerManager.instance.add(this), this.gs.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onSelected, this), t.EventManager.instance.addEvent(ClientNotify.TOUFANG_SUCCES, this.ontoufang, this), t.EventManager.instance.addEvent(ClientNotify.CLEAR_ANIMALS, this.onClearAnimals, this), t.EventManager.instance.addEvent(ClientNotify.UPDATA_SIMPLE_ANIMAL, this.onUpdataSimpleAnimals, this), t.EventManager.instance.addEvent(ClientNotify.DELETE_ANIMAL, this.onDeleteAnimals, this) }, i.prototype.onRemove = function() { manager.UpdateTickerManager.instance.remove(this), this.gs.removeEventListener(egret.TouchEvent.TOUCH_TAP, this.onSelected, this), t.EventManager.instance.removeEvent(ClientNotify.TOUFANG_SUCCES, this.ontoufang, this), t.EventManager.instance.removeEvent(ClientNotify.CLEAR_ANIMALS, this.onClearAnimals, this), t.EventManager.instance.removeEvent(ClientNotify.UPDATA_SIMPLE_ANIMAL, this.onUpdataSimpleAnimals, this), t.EventManager.instance.removeEvent(ClientNotify.DELETE_ANIMAL, this.onDeleteAnimals, this), this.clearAnimals() }, i.prototype.onClearAnimals = function() { this.updataAnimals() }, i.prototype.onUpdataSimpleAnimals = function(t) { for (var e = 0; e < this.animalsArr.length; e++) { var i = this.animalsArr[e]; t.data.id == i._logicAnimal.id && (i._logicAnimal = t.data, i.playAnimation()) } }, i.prototype.onDeleteAnimals = function(t) { for (var e = 0; e < this.animalsArr.length; e++) { var i = this.animalsArr[e]; t.data.id == i._logicAnimal.id && (this.gs.removeChild(i), this.animalsArr.splice(e, 1)) } GameScenceManager.getInstance().selectedLogicAnimal = null }, i.prototype.onSelected = function(t) { for (var e = t.target.parent, i = 0; i < this.gs.numChildren; i++) { var n = this.gs.getChildAt(i); n.hideSelected() } e._logicAnimal && (e.showSelected(), GameScenceManager.getInstance().selectedLogicAnimal = e._logicAnimal) }, i.prototype.ontoufang = function(t) { t.data.type == this.animalType && this.addAnimal(t.data) }, i.prototype.update = function(t) { this.animalsArr.sort(function(t, e) { return t.y > e.y ? 1 : -1 }); for (var e = 0; e < this.animalsArr.length; e++) this.gs.addChild(this.animalsArr[e]), this.animalsArr[e].updata() }, i.prototype.childrenCreated = function() { e.prototype.childrenCreated.call(this), this.updataAnimals() }, i.prototype.updataAnimals = function() { this.clearAnimals(); var t; switch (this.animalType) { case AnimalType.JI: t = GameScenceManager.getInstance().jArr; break; case AnimalType.YANG: t = GameScenceManager.getInstance().yArr; break; case AnimalType.NIU: t = GameScenceManager.getInstance().nArr } for (var e = 0; e < t.length; e++) { var i = t[e], n = new UIAnimals(i), a = Math.floor(10 * Math.random()); n.x = UIAnimals.pointArr[a].x, n.y = UIAnimals.pointArr[a].y, this.gs.addChild(n), this.animalsArr.push(n) } }, i.prototype.addAnimal = function(t) { var e = Math.floor(10 * Math.random()), i = new UIAnimals(t); i.x = UIAnimals.pointArr[e].x, i.y = UIAnimals.pointArr[e].y, this.gs.addChild(i), this.animalsArr.push(i) }, i.prototype.deleteAnimal = function(t) { for (var e = 0; e < this.animalsArr.length; e++) t.id == this.animalsArr[e]._logicAnimal.id && this.animalsArr.splice(e, 1) }, i.prototype.clearAnimals = function() { this.gs.removeChildren(), this.animalsArr.length = 0 }, i.prototype.change = function(t) { this.animalType = t, this.updataAnimals() }, i } (eui.Component); t.GameView2 = e, __reflect(e.prototype, "game.GameView2", ["IUpdate"]) } (game || (game = {})); var UIAnimals = function(t) { function e(e) { var i = t.call(this) || this; return i._logicAnimal = e, i.skinName = UIAnimalSkinSkin, i.addEventListener(egret.Event.ADDED_TO_STAGE, i.onAdd, i), i.addEventListener(egret.Event.REMOVED_FROM_STAGE, i.onRemove, i), i } return __extends(e, t), e.prototype.onAdd = function() { this.playAnimation(), game.UIUtils.addLongTouch(this, this.onlongTouchBegin.bind(this), this.onlongTouchEnd.bind(this)) }, e.prototype.onRemove = function() { this.stopAnimation(), game.UIUtils.removeLongTouch(this) }, e.prototype.updata = function() { var t = this._logicAnimal.status; this._logicAnimal.setStatus(), t != this._logicAnimal.status && this.playAnimation() }, e.prototype.onlongTouchBegin = function() { var t = this.mc.localToGlobal(0, 0); this.resumeAnimation(), AnimalTips.show(this._logicAnimal, t) }, e.prototype.onlongTouchEnd = function() { AnimalTips.hide(), this.playAnimation() }, e.prototype.childrenCreated = function() { switch (t.prototype.childrenCreated.call(this), this._logicAnimal.type) { case AnimalType.JI: this.mc = game.MCUtils.getMc("muchang_jimc", null), this.iconimg.source = "chanchu_ji_png"; break; case AnimalType.YANG: this.mc = game.MCUtils.getMc("muchang_yangmc", null), this.iconimg.source = "chanchu_yang_png"; break; case AnimalType.NIU: this.mc = game.MCUtils.getMc("muchang_niumc", null), this.iconimg.source = "chanchu_niu_png" } console.log(this.gs); this.iconimg.visible = !1, this.gs.addChild(this.mc), this.mc.anchorOffsetX = this.mc.width / 2, this.mc.anchorOffsetY = this.mc.height }, e.prototype.playAnimation = function() { var t = this; this.iconimg.visible = !1, egret.Tween.removeTweens(this); var i = Math.floor(10 * Math.random()), n = e.pointArr[i], a = this.x; this.y; if (n.x >= a ? this.mc.scaleX = 1 : this.mc.scaleX = -1, n.x == a) switch (this._logicAnimal.status) { case AnimalStatus.YOUZI: this.mc.gotoAndPlay("small_a0", -1); case AnimalStatus.YOUZHAN: this.mc.gotoAndPlay("small_a0", -1); break; case AnimalStatus.CHENGZHANG: this.mc.gotoAndPlay("middle_a0", -1); break; case AnimalStatus.CHENGSHU: this.mc.gotoAndPlay("big_a0", -1); break; case AnimalStatus.CHANCHU: this.mc.gotoAndPlay("big_a0", -1), this.updataAnimal() } else switch (this._logicAnimal.status) { case AnimalStatus.YOUZI: this.mc.gotoAndPlay("small_a1", -1); break; case AnimalStatus.YOUZHAN: this.mc.gotoAndPlay("small_a1", -1); break; case AnimalStatus.CHENGZHANG: this.mc.gotoAndPlay("middle_a1", -1); break; case AnimalStatus.CHENGSHU: this.mc.gotoAndPlay("big_a1", -1); break; case AnimalStatus.CHANCHU: this.mc.gotoAndPlay("big_a1", -1), this.updataAnimal() } egret.Tween.get(this).to({ x: n.x, y: n.y }, 200 * (i + 50)).call(function() { switch (t._logicAnimal.status) { case AnimalStatus.YOUZI: t.mc.gotoAndPlay("small_a0", -1); case AnimalStatus.YOUZHAN: t.mc.gotoAndPlay("small_a0", -1); break; case AnimalStatus.CHENGZHANG: t.mc.gotoAndPlay("middle_a0", -1); break; case AnimalStatus.CHENGSHU: t.mc.gotoAndPlay("big_a0", -1); break; case AnimalStatus.CHANCHU: t.mc.gotoAndPlay("big_a0", -1), t.updataAnimal() } }).wait(100 * (i + 10)).call(this.playAnimation, this), this.mc.anchorOffsetX = this.mc.width / 2, this.mc.anchorOffsetY = this.mc.height, this.selectedImg.x = this.mc.x, this.selectedImg.y = this.mc.y - this.mc.height / 2 }, e.prototype.stopAnimation = function() { egret.Tween.removeTweens(this), this.gs.removeChild(this.mc), this.mc.stop(), this.mc = null }, e.prototype.updataAnimal = function() { this.iconimg.visible = !0, this.iconimg.y = this.mc.x - this.mc.height - this.iconimg.height + 20 }, e.prototype.resumeAnimation = function() { switch (egret.Tween.removeTweens(this), this._logicAnimal.status) { case AnimalStatus.YOUZI: this.mc.gotoAndPlay("small_a0", -1); break; case AnimalStatus.YOUZHAN: this.mc.gotoAndPlay("small_a0", -1); break; case AnimalStatus.CHENGZHANG: this.mc.gotoAndPlay("middle_a0", -1); break; case AnimalStatus.CHENGSHU: this.mc.gotoAndPlay("big_a0", -1); break; case AnimalStatus.CHANCHU: this.mc.gotoAndPlay("big_a0", -1), this.updataAnimal() } }, e.prototype.showSelected = function() { this.selectedImg.visible = !0, this.selectedImg.scaleX = 1, this.selectedImg.scaleY = 1, egret.Tween.get(this.selectedImg, { loop: !0 }).to({ scaleX: .5, scaleY: .5 }, 500, egret.Ease.circIn).to({ scaleX: 1, scaleY: 1 }, 500, egret.Ease.circOut) }, e.prototype.hideSelected = function() { this.selectedImg.visible = !1, egret.Tween.removeTweens(this.selectedImg) }, e.pointArr = [new egret.Point(220, 50), new egret.Point(60, 150), new egret.Point(310, 250), new egret.Point(540, 110), new egret.Point(202, 189), new egret.Point(431, 95), new egret.Point(306, 82), new egret.Point(208, 155), new egret.Point(379, 152), new egret.Point(184, 39), new egret.Point(425, 55)], e } (eui.Component); __reflect(UIAnimals.prototype, "UIAnimals"); var BattlePetScence = function(t) { function e() { var e = t.call(this) || this; return e.selectedArr = [], e.itemArr = [[null, null, null, null, null, null, null, null], [null, null, null, null, null, null, null, null], [null, null, null, null, null, null, null, null], [null, null, null, null, null, null, null, null], [null, null, null, null, null, null, null, null], [null, null, null, null, null, null, null, null], [null, null, null, null, null, null, null, null]], e.isCanTouch = !0, e.moveIsComplete = !0, e.isOnMove = !0, e.isEnd = !1, e.len = 0, e.isSend = !0, e.skinName = BattleScenceSkin, e.addEventListener(egret.Event.ADDED_TO_STAGE, e.onAdd, e), e.addEventListener(egret.Event.REMOVED_FROM_STAGE, e.onRemove, e), e } return __extends(e, t), e.prototype.onAdd = function(t) { game.EventManager.instance.addEvent(SysNotify.BE_ATTACK, this.onBeAttck, this), game.EventManager.instance.addEvent(SysNotify.START_ATTACK, this.onAttack, this), game.EventManager.instance.addEvent(SysNotify.BE_END_ATTACK, this.onEndBeAttck, this), game.EventManager.instance.addEvent(SysNotify.END_ATTACK, this.onEndAttack, this), game.EventManager.instance.addEvent(SysNotify.DODGE, this.onEndDodge, this), this.gfruit.addEventListener(egret.TouchEvent.TOUCH_BEGIN, this.onBegin, this), this.gfruit.addEventListener(egret.TouchEvent.TOUCH_MOVE, this.onMove, this), this.stage.addEventListener(egret.TouchEvent.TOUCH_END, this.onEnd, this), this.backButton.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onBack, this) }, e.prototype.onRemove = function(t) { this.removeEventListener(egret.Event.ADDED_TO_STAGE, this.onAdd, this), this.removeEventListener(egret.Event.REMOVED_FROM_STAGE, this.onRemove, this), game.EventManager.instance.removeEvent(SysNotify.BE_ATTACK, this.onBeAttck, this), game.EventManager.instance.removeEvent(SysNotify.START_ATTACK, this.onAttack, this), this.backButton.removeEventListener(egret.TouchEvent.TOUCH_TAP, this.onBack, this), game.EventManager.instance.removeEvent(SysNotify.BE_END_ATTACK, this.onEndBeAttck, this), game.EventManager.instance.removeEvent(SysNotify.END_ATTACK, this.onEndAttack, this), game.EventManager.instance.removeEvent(SysNotify.DODGE, this.onEndDodge, this), this.gfruit.removeEventListener(egret.TouchEvent.TOUCH_BEGIN, this.onBegin, this), this.gfruit.removeEventListener(egret.TouchEvent.TOUCH_MOVE, this.onMove, this), this.stage.removeEventListener(egret.TouchEvent.TOUCH_END, this.onEnd, this), this.mc1.removeEventListener(egret.Event.COMPLETE, this.onAttackPlayComplete, this), this.mc2.removeEventListener(egret.Event.COMPLETE, this.onOtherAttackPlayComplete, this), egret.Tween.removeTweens(this) }, e.prototype.onBack = function(t) { GuideManager.getInsatance().target > 11 && game.AppFacade.instance.sendNotification(SceneNotify.OPEN_MINE_GAME) }, e.prototype.createChildren = function() { t.prototype.createChildren.call(this) }, e.prototype.childrenCreated = function() { t.prototype.childrenCreated.call(this), this.initItem(), this.intAnimation(), this.initHead(), GuideManager.getInsatance().isShowGuide && 8 == GuideManager.getInsatance().target && 0 == GuideManager.getInsatance().step && (GuideManager.getInsatance().des = TextConst.textObj[35], GuideManager.getInsatance().show(this.gfruit)) }, e.prototype.initHead = function() { this.otherHead.prosslabel.scaleX = -1 }, e.prototype.intAnimation = function() { this.myPet.setV( - 1); var t = BattleFruitManager.getInstance().myPet, e = (Global.gameProxy.getItemImageId(t.pet_config_id), Global.playerProxy.playerData), i = e.avatar.toString(); this.myhead.setHead(i), this.myPet.setData(t), this.myPet.sleep(), this.otherPet.setV(1), this.otherPet.sleep(); var n = BattleFruitManager.getInstance().otherPet, i = BattleFruitManager.getInstance().friendData.avatar; this.otherHead.setHead(i), this.otherPet.setData(n), this.updata() }, e.prototype.updata = function() { var t = BattleFruitManager.getInstance().myPet, e = BattleFruitManager.getInstance().otherPet; this.stepLabel.text = BattleFruitManager.getInstance().battleData.step + "", this.myhead.setPross(t.curBlood, t.petData.blood), this.otherHead.setPross(e.curBlood, e.petData.blood) }, e.prototype.onBeAttck = function(t) {}, e.prototype.onAttack = function(t) { var e = ["lion", "wolf", "snake", "bear", "dragon"], i = [new egret.Point(80, 40), new egret.Point(30, 220), new egret.Point(70, 200), new egret.Point(100, 60), new egret.Point(100, 150)], n = [new egret.Point(520, 40), new egret.Point(600, 220), new egret.Point(580, 200), new egret.Point(510, 60), new egret.Point(500, 150)]; if (this.datas = t.data, -1 == t.data.status) { if (!this.mc1) { var a = e[t.data.pettype]; this.mc1 = game.MCUtils.getMc(a, null), this.ga.addChild(this.mc1), this.mc1.addEventListener(egret.Event.COMPLETE, this.onAttackPlayComplete, this) } this.mc1.x = i[t.data.pettype].x, this.mc1.y = i[t.data.pettype].y, this.mc1.visible = !0, this.mc1.gotoAndPlay(1, 1) } else { if (!this.mc2) { var a = e[t.data.pettype]; this.mc2 = game.MCUtils.getMc(a, null), this.ga.addChild(this.mc2), this.mc2.addEventListener(egret.Event.COMPLETE, this.onOtherAttackPlayComplete, this) } this.mc2.scaleX = -1, this.mc2.visible = !0, this.mc2.x = n[t.data.pettype].x, this.mc2.y = n[t.data.pettype].y, this.mc2.gotoAndPlay(1, 1) } }, e.prototype.onEndBeAttck = function(t) { if ( - 1 == t.data.status) { var e = BattleFruitManager.getInstance().myPet, i = BattleFruitManager.getInstance().otherPet, n = (e.level ? e.level: 1, Math.ceil(i.petData.attack * (1 - e.petData.anti / (10 * i.level + e.petData.anti)))); 0 > n && (n = 0); var a = 2 * n, o = Math.ceil(i.petData.crit / 10), s = Math.ceil(100 * Math.random()) < o ? !0 : !1, r = e.petData.dodge / 10, h = Math.ceil(100 * Math.random()) < r ? !0 : !1, l = h ? 0 : s ? a: n; BattleFruitManager.getInstance().myPet.curBlood - l > 0 ? (BattleFruitManager.getInstance().myPet.curBlood -= l, 0 == BattleFruitManager.getInstance().battleData.step && this.isSend && (this.isSend = !1, BattleFruitManager.getInstance().battleData.result = 1, 1 == BattleFruitManager.getInstance().openType ? BattleFruitManager.getInstance().sendNetWarResult() : SportsManager.getInstance().sendNetEndGame())) : (BattleFruitManager.getInstance().myPet.curBlood = 0, this.myPet.die(), this.moveIsComplete = !1, this.isSend && (this.isSend = !1, BattleFruitManager.getInstance().battleData.result = 1, 1 == BattleFruitManager.getInstance().openType ? BattleFruitManager.getInstance().sendNetWarResult() : SportsManager.getInstance().sendNetEndGame())), BloodTips.getInstance().createTips(this.myPet.x, this.myPet.y - this.myPet.icons.height, "s" + l, 0, 1e3) } else { var e = BattleFruitManager.getInstance().myPet, i = BattleFruitManager.getInstance().otherPet, n = (i.level ? i.level: 1, Math.ceil(e.petData.attack * (1 - i.petData.anti / (10 * e.level + i.petData.anti)))); 0 > n && (n = 0), GuideManager.getInsatance().isShowGuide && 8 == GuideManager.getInsatance().target && 0 == GuideManager.getInsatance().step && (n = Math.ceil(i.petData.blood / 8)); var a = 2 * n, o = Math.ceil(e.petData.crit / 10), s = Math.ceil(100 * Math.random()) < o ? !0 : !1, r = i.petData.dodge / 10, h = Math.ceil(100 * Math.random()) < r ? !0 : !1, l = h ? 0 : s ? a: n; BattleFruitManager.getInstance().otherPet.curBlood - l > 0 ? (BattleFruitManager.getInstance().otherPet.curBlood -= l, this.otherPet.attack()) : (BattleFruitManager.getInstance().otherPet.curBlood = 0, this.moveIsComplete = !1, this.otherPet.die(), this.isSend && (this.isSend = !1, BattleFruitManager.getInstance().battleData.result = 0, 1 == BattleFruitManager.getInstance().openType ? BattleFruitManager.getInstance().sendNetWarResult() : SportsManager.getInstance().sendNetEndGame())), BloodTips.getInstance().createTips(this.otherPet.x, this.otherPet.y - this.otherPet.icons.height, "s" + l, 0, 1e3) } this.updata() }, e.prototype.onEndAttack = function(t) { - 1 == t.data.status ? this.myPet.sleep() : this.otherPet.sleep() }, e.prototype.onEndDodge = function(t) {}, e.prototype.onAttackPlayComplete = function(t) { this.mc1.visible = !1, this.otherPet.beAttack() }, e.prototype.onOtherAttackPlayComplete = function(t) { this.mc2.visible = !1, this.myPet.beAttack() }, e.prototype.callSleep = function(t) { - 1 == t.status ? this.myPet.sleep() : this.otherPet.sleep() }, e.prototype.initItem = function() { BattleFruitManager.getInstance().initRandomArr(); for (var t = 0; t < BattleFruitManager.getInstance().fruitRadomArr.length; t++) for (var e = 0; e < BattleFruitManager.getInstance().fruitRadomArr[t].length; e++) { var i = new BattlePetUnit(t, e); this.gfruit.addChild(i), this.itemArr[t][e] = i, i.setType(BattleFruitManager.getInstance().fruitRadomArr[t][e]), i.gotoPoint() } }, e.prototype.onBegin = function(t) { this.moveIsComplete && (this.moveIsComplete = !1, this.clearLine(), this.isCanTouch = !0, this.isOnMove = !0, this.isEnd = !1, this.selectedArr.length = 0, GuideManager.getInsatance().isShowGuide && 8 == GuideManager.getInsatance().target && 0 == GuideManager.getInsatance().step && GuideManager.getInsatance().setsVisable(!1)) }, e.prototype.onMove = function(t) { if (this.isCanTouch && this.isOnMove) { var e = t.stageX / (GameConfig.curWidth() / Const.DESGIN_W) - this.gfruit.x, i = t.stageY / (GameConfig.curHeight() / Const.DESGIN_H) - this.gfruit.y, n = Math.floor(e / (BattlePetUnit.W + BattlePetUnit.JIANGE)), a = Math.floor(i / (BattlePetUnit.H + BattlePetUnit.JIANGE)); if (a >= 0 && 7 > a && 8 > n && n >= 0) { var o = this.itemArr[a][n]; if (o.types > 0 && BattleFruitManager.getInstance().isCanSelected(o, this.selectedArr) && (this.selectedArr.push(o), console.log(this.selectedArr.length), this.selectedArr.length > 1)) { var s = new egret.Point(this.selectedArr[this.selectedArr.length - 2].x, this.selectedArr[this.selectedArr.length - 2].y), r = new egret.Point(this.selectedArr[this.selectedArr.length - 1].x, this.selectedArr[this.selectedArr.length - 1].y); this.drawLine(s, r) } } this.selectedArr.length > 0 && this.updataLine(new egret.Point(this.selectedArr[this.selectedArr.length - 1].x, this.selectedArr[this.selectedArr.length - 1].y), new egret.Point(t.stageX / (GameConfig.curWidth() / Const.DESGIN_W) - this.gLine0.x, t.stageY / (GameConfig.curHeight() / Const.DESGIN_H) - this.gLine0.y)) } }, e.prototype.onEnd = function(t) { this.isOnMove = !1, this.isEnd || (this.isEnd = !0, this.gLine0.removeChildren(), this.g0Line = null, this.clearLine(), this.selectedArr.length >= 3 ? this.startClearItem() : this.moveIsComplete = !0) }, e.prototype.drawLine = function(t, e) { var i = MYUtils.pointAmongAngle(t.x, t.y, e.x, e.y), n = MYUtils.distance(t, e), a = new BattleFruitLine; this.gLine.addChild(a), a.anchorOffsetY = 5, a.width = n + 5, a.rotation = i, a.x = t.x, a.y = t.y }, e.prototype.clearLine = function() { this.gLine.removeChildren() }, e.prototype.updataLine = function(t, e) { if (this.isCanTouch) { this.g0Line || (this.g0Line = new BattleFruitLine, this.gLine0.addChild(this.g0Line)); var i = MYUtils.pointAmongAngle(t.x, t.y, e.x, e.y), n = MYUtils.distance(t, e); this.g0Line.anchorOffsetY = 5, this.g0Line.width = n + 5, this.g0Line.rotation = i, this.g0Line.x = t.x, this.g0Line.y = t.y } }, e.prototype.startClearItem = function() { for (var t = 0; t < this.selectedArr.length; t++) egret.Tween.get(this.selectedArr[t]).to({ scaleX: 1.5, scaleY: 1.5 }, 100, egret.Ease.backIn).to({ scaleX: 1.2, scaleY: 1.2 }, 100, egret.Ease.backOut), this.itemArr[this.selectedArr[t].i][this.selectedArr[t].j] = null; egret.Tween.get(this).wait(200).call(this.clearItem, this) }, e.prototype.clearItem = function() { Global.audioProxy.playSound("battle_xiaochu_mp3"); for (var t = 0; t < this.selectedArr.length; t++) this.gfruit.removeChild(this.selectedArr[t]); for (var e = this.itemArr[0].length - 1; e >= 0;) { for (var i = this.itemArr.length - 1, n = this.itemArr.length - 1; n >= 0; n--) if (null != this.itemArr[n][e]) { var a = this.itemArr[n][e]; this.itemArr[n][e] = null, this.itemArr[i][e] = a, this.itemArr[i][e].i = i, this.itemArr[i][e].j = e, i-- } for (var o = 0; i >= o; o++) { var a = new BattlePetUnit(i, e); this.itemArr[o][e] = a, this.itemArr[o][e].setPoint(new egret.Point(o - i - 1, e)), this.gfruit.addChild(a), a.i = o, a.j = e, a.setType(Math.floor(1 + 5 * Math.random())) } e-- } this.onUpDataItem() }, e.prototype.onUpDataItem = function() { this.moveIsComplete = !0, this.len = this.selectedArr.length; for (var t = 0; t < this.itemArr.length; t++) for (var e = 0; e < this.itemArr[t].length; e++) this.itemArr[t][e] && this.itemArr[t][e].gotoPoint(); this.len >= 3 && this.sattack() }, e.prototype.sattack = function() { BattleFruitManager.getInstance().battleData.step > 0 ? (this.myPet.attack(), BattleFruitManager.getInstance().battleData.step -= 1) : TipsUtils.showTipsDownToUp("没有足够的步数") }, e } (game.BaseComponent); __reflect(BattlePetScence.prototype, "BattlePetScence"); var game; ! function(t) { var e = function(e) { function i() { var t = e.call(this) || this; return t.selectIconId = 1, t.skinName = new CreateRoleSceneSkin, t } return __extends(i, e), i.prototype.createChildren = function() { e.prototype.createChildren.call(this), this.setSelectHeadIcon(t.Utils.rang(1, 6e4) % 6 + 1) }, i.prototype.setSelectHeadIcon = function(t) { this.selectIconId = t; for (var e = 1; 6 >= e; e++) { var i = this["groupHead" + e]; i.touchChildren = !1, i.name = "groupHead" + e; var n = i.getChildByName("imgSelect"); n.visible = t == e } }, i.prototype.onTouchTap = function(t) { switch (t.target) { case this.btnOk: this.createRole() } var e = t.target.name; if (e.indexOf("groupHead") > -1) { var i = parseInt(e.replace("groupHead", "")); this.setSelectHeadIcon(i) } }, i.prototype.createRole = function() { var e = this.inpName.text.trim(); if (!e) return void TipsUtils.showTipsDownToUp("请输入名称", !0); if (e.length > 7) TipsUtils.showTipsDownToUp("输入的名称太长了", !0); else { var i = GameConfig.SERVER_PATH + "user/modify-user-info", n = { nickname: e, avatar: this.selectIconId + "" }; Global.netProxy.sendRequest(i, n, function(i) { return 0 === i.status ? (Global.playerProxy.setPlayerDataProperty("nickname", e), Global.playerProxy.setPlayerDataProperty("avatar", n.avatar), TipsUtils.showTipsDownToUp("创建成功"), t.AppFacade.getInstance().sendNotification(SceneNotify.CLOSE_CREATEROLE), void t.AppFacade.getInstance().sendNotification(SceneNotify.OPEN_MINE_GAME)) : void TipsUtils.showTipsDownToUp(GameConfig.ServerCode[i.status], !0) }) } }, i } (t.BaseComponent); t.CreateRoleScene = e, __reflect(e.prototype, "game.CreateRoleScene") } (game || (game = {})); var game; ! function(t) { var e = function(e) { function i(t) { var i = e.call(this) || this; return i.isMine = t, i.isMine ? i.playerProxy = Global.playerProxy: i.playerProxy = Global.otherPlayerProxy, i.skinName = new GameSceneSkin, i } return __extends(i, e), i.prototype.update = function(t) {}, i.prototype.flushGameScene = function() { this.isMine && (this.topLayer.updateTopInfo(), this.gameView.flushGameView()) }, i.prototype.changeDog = function() { this.showDog() }, i.prototype.onAdded = function() { e.prototype.onAdded.call(this), manager.UpdateTickerManager.instance.add(this), this.isMine && (t.EventManager.instance.addEvent(SysNotify.USER_HOUSE_CHANGE, this.updateHouse, this), t.EventManager.instance.addEvent(SysNotify.USER_SKIN_CHANGE, this.updateGround, this), t.EventManager.instance.addEvent(SysNotify.DOG_UPDAT, this.changeDog, this), 0 == Global.playerProxy.playerData.is_get_new_gift && (this.giftmc = t.MCUtils1.getMc("firstGiftmc"), this.addChild(this.giftmc), this.giftmc.gotoAndPlay(1, -1), this.giftmc.x = 100, this.giftmc.y = 300, this.giftmc.touchEnabled = !0, this.giftmc.addEventListener(egret.TouchEvent.TOUCH_TAP, this.getFirstGift, this)), this.updateTimer || (this.updateTimer = new egret.Timer(3e4, Number.MAX_VALUE), this.updateTimer.addEventListener(egret.TimerEvent.TIMER, this.onUpdatePlantTimer, this)), this.updateTimer.reset(), this.updateTimer.start()), this.nuchangButton.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onGoMuchang, this) }, i.prototype.onRemoved = function() { e.prototype.onRemoved.call(this), manager.UpdateTickerManager.instance.remove(this), this.updateTimer || (t.EventManager.instance.removeEvent(SysNotify.USER_HOUSE_CHANGE, this.updateHouse, this), t.EventManager.instance.removeEvent(SysNotify.USER_SKIN_CHANGE, this.updateGround, this), t.EventManager.instance.removeEvent(SysNotify.DOG_UPDAT, this.changeDog, this), this.giftmc && this.giftmc.removeEventListener(egret.TouchEvent.TOUCH_TAP, this.getFirstGift, this), this.updateTimer && this.updateTimer.stop()), this.nuchangButton.removeEventListener(egret.TouchEvent.TOUCH_TAP, this.onGoMuchang, this) }, i.prototype.getFirstGift = function(t) { var e = this; Global.netProxy.sendRequest(GameConfig.SERVER_PATH + "user/get-new-user-gift", { item_id: 330200 }, function(t) { if (0 == t.status) { var i = Global.gameProxy.getFirstGiftConfig(), n = i[330200]; Global.playerProxy.addItem1(n.item_id), Global.playerProxy.playerData.is_get_new_gift = 1, e.removeChild(e.giftmc) } else TipsUtils.showTipsDownToUp(GameConfig.ServerCode[t.status]) }) }, i.prototype.onGoMuchang = function(e) { this.isMine ? t.AppFacade.instance.sendNotification(SceneNotify.OPEN_MINE_MGAME) : t.AppFacade.instance.sendNotification(SceneNotify.OPEN_OTHER_MGAME), t.AppFacade.instance.sendNotification(SceneNotify.CLOSE_GAME) }, i.prototype.createChildren = function() { e.prototype.createChildren.call(this), this.imgHouse = new eui.Image, this.groupHouse.addChild(this.imgHouse), this.updateHouse(), //this.showDog(), this.updateGround(!1), this.gameView = new t.GameView(this), this.addChild(this.gameView), this.gameView.x = 280, this.gameView.y = Const.DESGIN_H - 460, this.imgFenceFront.touchEnabled = this.imgFenceBack.touchEnabled = !1, this.addChild(this.imgFenceFront), this.isMine ? (this.mainMenu = new t.MainMenu, this.addChild(this.mainMenu), this.btnBackHome.visible = !1) : (this.btnBackHome.visible = !0, this.addChild(this.btnBackHome)), this.topLayer = new t.GameTopLayer(this), this.addChild(this.topLayer); if((this.isMine&&Global.playerProxy.playerData.use_dog_item_id>0)||(!this.isMine&&Global.otherPlayerProxy.playerData.use_dog_item_id>0)){ console.log('显示狗狗'); this.showDog(); } }, i.prototype.childrenCreated = function() { e.prototype.childrenCreated.call(this), this.isMine }, i.prototype.onUpdatePlantTimer = function() { this.isMine && t.AppFacade.getInstance().sendNotification(ClientNotify.FLUSH_FARM) }, i.prototype.onTouchTap = function(e) { switch (e.target) { case this.btnBackHome: Global.otherPlayerProxy.clearPlayerData(), t.AppFacade.getInstance().sendNotification(SceneNotify.BACK_MINE_GAME); break; case this.imgDogHouse: this.isMine && t.AppFacade.getInstance().sendNotification(PanelNotify.OPEN_DOG); break; case this.imgHouse: this.isMine && t.AppFacade.getInstance().sendNotification(PanelNotify.OPEN_HOUSEUPGRADE) } }, i.prototype.showDog = function() { this.groupDog.removeChildren(); var e = new t.WidgetDog(this.playerProxy); this.groupDog.addChild(e), e.showType(106002), e.runTypeAni() }, i.prototype.updateHouse = function(e) { var i = this; void 0 === e && (e = null); var n = this.playerProxy.playerData, a = n.farm_level; e && e.data && (a = e.data), a = t.Utils.limit(a, 1, 12), n.farm_level = a; var o = t.URLConfig.getHouse(a); RES.getResByUrl(o, function(t) { if (t) { var e = t.textureWidth, n = t.textureHeight; i.imgHouse.source = t, i.imgHouse.anchorOffsetX = .46 * e, i.imgHouse.anchorOffsetY = .8673 * n } }, this) }, i.prototype.updateGround = function(e) { void 0 === e && (e = !0); var i = this.playerProxy.playerData, n = Global.gameProxy.getItemImageId(i.bg_image_id); this.imgGround.source = t.URLConfig.getGround(n), this.imgFenceFront.source = t.URLConfig.getGroundFenceFront(n), this.imgFenceBack.source = t.URLConfig.getGroundFenceBack(n), e || (GameConfig.curHeight() > 1024 ? (this.imgGround.scale9Grid = new egret.Rectangle(0, 1, 1, 1), this.imgGround.top = 0) : (this.imgGround.scale9Grid = null, this.imgGround.top = 0 / 0)) }, i } (t.BaseComponent); t.GameScene = e, __reflect(e.prototype, "game.GameScene", ["IUpdate"]) } (game || (game = {})); var game; ! function(t) { var e = function(e) { function i() { var t = e.call(this) || this; return t.skinName = new LoginSceneSkin, t } return __extends(i, e), i.prototype.createChildren = function() { e.prototype.createChildren.call(this); var t = NativeApi.getLocalData("usernames"); if (t) { var i = t.split(":"), n = i[0]; if (n) { var a = n.split(","); this.inpKey.text = a[0], this.inpPw.text = a[1] } } this.inpPw.displayAsPassword = !0, this.usernameGroup.visible = !1 }, i.prototype.childrenCreated = function() { e.prototype.childrenCreated.call(this); var t = JSON.parse(egret.localStorage.getItem("isRemember")); t ? this.check2.selected = !0 : this.check2.selected = !1 }, i.prototype.xialaImageTouchEnded = function() { this.usernameGroup.visible = !this.usernameGroup.visible; var t = NativeApi.getLocalData("usernames"); if (t) for (var e = t.split(":"), i = 0; i < e.length; i++) { var n = e[i].split(","); n && (this["label" + (i + 1)].text = n[0]) } }, i.prototype.label1TouchEnded = function() { this.showUser(1) }, i.prototype.label2TouchEnded = function() { this.showUser(2) }, i.prototype.label3TouchEnded = function() { this.showUser(3) }, i.prototype.label4TouchEnded = function() { this.showUser(4) }, i.prototype.showUser = function(t) { var e = NativeApi.getLocalData("usernames"), i = e.split(":"), n = i[t - 1], a = n.split(","); this.inpKey.text = a[0], this.inpPw.text = a[1], this.usernameGroup.visible = !1 }, i.prototype.btnRegTouchEnded = function() { t.AppFacade.getInstance().sendNotification(PanelNotify.OPEN_REGIST) }, i.prototype.btnFindpwdTouchEnded = function() { t.AppFacade.getInstance().sendNotification(PanelNotify.OPEN_FIND_PASSWORD) }, i.prototype.setPlayerDataLocal = function(e, i) { var n = e + "," + i, a = NativeApi.getLocalData("usernames"); if (a) { var o = a.split(":"); o.indexOf(n) > -1 && t.Utils.removeArrayItem(o, n), o.unshift(n); for (var s = "", r = 0; r < o.length && !(r > 3); r++) s += o[r] + ":"; s = s.substring(0, s.length - 1), NativeApi.setLocalData("usernames", s) } else NativeApi.setLocalData("usernames", n) }, i.prototype.btnLoginTouchEnded = function() { return __awaiter(this, void 0, void 0, function() { var e, i, n, a = this; return __generator(this, function(o) { return e = this.inpKey.text, i = this.inpPw.text, e && i ? (Global.netProxy.setToken(null), n = { username: e, password: i }, Global.netProxy.sendRequest(GameConfig.SERVER_PATH + "user/login", n, function(n) { //登录 0 === n.status && (Global.netProxy.setToken(n.data.token), TipsUtils.showTipsDownToUp("登陆成功"), egret.localStorage.setItem("isRemember", JSON.stringify(a.check2.selected)), Global.playerProxy.setPlayerData(n.data), a.check2.selected ? a.setPlayerDataLocal(e, i) : a.setPlayerDataLocal(e, ""), Global.gameProxy.getGameConfigJson(function() { Global.playerProxy.setPlayerLandData(n.data), Global.playerProxy.getPlayerStoreHouse(function() { egret.setTimeout(function() { t.AppFacade.getInstance().sendNotification(SceneNotify.CLOSE_LOGIN), t.GamePaoMa.instance.show(), window.parent && window.parent.openiframe && window.parent.gonggaoUrl && window.parent.openiframe(window.parent.gonggaoUrl), n.data.nickname ? (t.AppFacade.getInstance().sendNotification(SceneNotify.OPEN_MINE_MGAME),Global.audioProxy.startBgMusic()) : t.AppFacade.getInstance().sendNotification(SceneNotify.OPEN_CREATEROLE) }, a, 200) }) })), TipsUtils.showTipsDownToUp(GameConfig.ServerCode[n.status], !0) }), [2]) : (TipsUtils.showTipsDownToUp("请输入账号", !0), [2]) }) }) }, i } (t.BaseComponent); t.LoginScene = e, __reflect(e.prototype, "game.LoginScene") } (game || (game = {})); var game; ! function(t) { var e = function(e) { function i() { var t = e.call(this) || this; return t.maxLength = 0, t.skinName = new LogoSceneSkin, t } return __extends(i, e), i.prototype.createChildren = function() { e.prototype.createChildren.call(this), this.resGroup = "main", this.maxLength = 560, this.beganLoadResGroup() }, i.prototype.beganLoadResGroup = function() { this.startTime = (new Date).getTime(), RES.addEventListener(RES.ResourceEvent.GROUP_COMPLETE, this.onResourceLoadComplete, this), RES.addEventListener(RES.ResourceEvent.GROUP_LOAD_ERROR, this.onResourceLoadComplete, this), RES.addEventListener(RES.ResourceEvent.GROUP_PROGRESS, this.onResourceProgress, this), RES.loadGroup(this.resGroup) }, i.prototype.onResourceLoadComplete = function(t) { t.groupName == this.resGroup && (RES.removeEventListener(RES.ResourceEvent.GROUP_COMPLETE, this.onResourceLoadComplete, this), RES.removeEventListener(RES.ResourceEvent.GROUP_LOAD_ERROR, this.onResourceLoadComplete, this), RES.removeEventListener(RES.ResourceEvent.GROUP_PROGRESS, this.onResourceProgress, this), this.onResourceLoadOver()) }, i.prototype.onResourceProgress = function(t) { if (t.groupName == this.resGroup) { var e = t.itemsLoaded / t.itemsTotal; this.progressBar.width = this.maxLength * e, this.textLabel.text = Math.floor(100 * e) + "%" } }, i.prototype.onResourceLoadOver = function() { var e = (new Date).getTime(); e - this.startTime; egret.Tween.get(this).to({ alpha: 0 }, 1e3).call(function() { t.AppFacade.getInstance().sendNotification(SceneNotify.CLOSE_LOADING), t.AppFacade.getInstance().sendNotification(SceneNotify.OPEN_LOGIN) }, this) }, i } (t.BaseComponent); t.LogoScene = e, __reflect(e.prototype, "game.LogoScene") } (game || (game = {})); var game; ! function(t) { var e = function(e) { function i() { var t = e.call(this) || this; return t.skinName = new SaySceneSkin, t } return __extends(i, e), i.prototype.createChildren = function() { e.prototype.createChildren.call(this) }, i.prototype.onTouchTap = function() { t.AppFacade.getInstance().sendNotification(SceneNotify.CLOSE_SAY) }, i } (t.BasePanel); t.SayScene = e, __reflect(e.prototype, "game.SayScene") } (game || (game = {})); var BattleFruitLine = function(t) { function e() { var e = t.call(this) || this; return e.skinName = Battle_fruitLineSkin, e } return __extends(e, t), e.prototype.childrenCreated = function() { t.prototype.childrenCreated.call(this), this.addAction() }, e.prototype.addAction = function() { egret.Tween.get(this, { loop: !0 }).to({ scaleY: 2 }, 300).to({ scaleY: 1 }, 300) }, e.prototype.deleteAction = function() { egret.Tween.removeTweens(this) }, e } (eui.Component); __reflect(BattleFruitLine.prototype, "BattleFruitLine"); var BattleFruitTipsMediator = function(t) { function e() { return t.call(this, "BattleFruitTipsMediator") || this } return __extends(e, t), e.prototype.listNotificationInterests = function() { return [PanelNotify.OPEN_BATTLE_FRUIT_TIPS, PanelNotify.CLOSE_BATTLE_FRUIT_TIPS] }, e.prototype.onRegister = function() { t.prototype.onRegister.call(this) }, e.prototype.showViewComponent = function(t) { void 0 === t && (t = 7), this.viewComponent = new BattleFruitTipss, this.showUI(this.viewComponent, !0, 0, 0, t) }, e.prototype.handleNotification = function(t) { t.getBody(); switch (t.getName()) { case PanelNotify.OPEN_BATTLE_FRUIT_TIPS: this.showViewComponent(); break; case PanelNotify.CLOSE_BATTLE_FRUIT_TIPS: this.closeViewComponent() } }, e.NAME = "BattleFruitTipsMediator", e } (BaseMediator); __reflect(BattleFruitTipsMediator.prototype, "BattleFruitTipsMediator"); var BattleFruitTipss = function(t) { function e() { var e = t.call(this) || this; return e.skinName = RewardTipsSkin, e } return __extends(e, t), e.prototype.childrenCreated = function() { t.prototype.childrenCreated.call(this) }, e } (eui.Component); __reflect(BattleFruitTipss.prototype, "BattleFruitTipss"); var BattlePetHead = function(t) { function e() { var e = t.call(this) || this; return e.skinName = BattlePetHeadSkin, e } return __extends(e, t), e.prototype.childrenCreated = function() { t.prototype.childrenCreated.call(this), this.gs.mask = this.masks, this.headImg.mask = this.headmask }, e.prototype.setPross = function(t, e) { var i = t / e; this.imgProssBar.x = this.imgProssBar.width * i - this.imgProssBar.width, this.prosslabel.text = t + "/" + e }, e.prototype.setHead = function(t) { "" == t && (t = "1"); var e = t.toString(); console.log('22222222222222'+e); if (t.indexOf("http") > -1) this.headImg.source = e; else { var i = game.URLConfig.getHead(t); this.headImg.source = i } }, e } (eui.Component); __reflect(BattlePetHead.prototype, "BattlePetHead"); var BattlePetUnit = function(t) { function e(e, i) { var n = t.call(this) || this; return n.skinName = BattlePetUnitSkin, n.anchorOffsetX = 37, n.anchorOffsetY = 37, n.i = e, n.j = i, n } return __extends(e, t), e.prototype.childrenCreated = function() { t.prototype.childrenCreated.call(this) }, e.prototype.setType = function(t) { this.types = t, this.icons.source = "battle_fruit" + this.types + "_png" }, e.prototype.gotoPoint = function(t) { void 0 === t && (t = null), this.isgoComplete = !1, t ? egret.Tween.get(this).to({ x: t.y * e.W + e.W / 2 + t.y * e.JIANGE, y: t.x * e.H + e.H / 2 + t.x * e.JIANGE }, 200).call(this.playComplete, this) : egret.Tween.get(this).to({ x: e.W * this.j + e.W / 2 + this.j * e.JIANGE, y: e.H * this.i + e.H / 2 + this.i * e.JIANGE }, 200).call(this.playComplete, this) }, e.prototype.setPoint = function(t) { void 0 === t && (t = null), this.isgoComplete = !1, t ? (this.x = t.y * e.W + e.W / 2 + t.y * e.JIANGE, this.y = t.x * e.H + e.H / 2 + t.x * e.JIANGE) : (this.x = e.W * this.j + e.W / 2 + this.j * e.JIANGE, this.y = e.H * this.i + e.H / 2 + this.i * e.JIANGE) }, e.prototype.playComplete = function() { this.isgoComplete = !0 }, e.W = 74, e.H = 74, e.JIANGE = 1.5, e } (eui.Component); __reflect(BattlePetUnit.prototype, "BattlePetUnit"); var PetAnimation = function(t) { function e() { var e = t.call(this) || this; return e.addEventListener(egret.Event.ADDED_TO_STAGE, e.onAdd, e), e.addEventListener(egret.Event.REMOVED_FROM_STAGE, e.onRemove, e), e } return __extends(e, t), e.prototype.onAdd = function() {}, e.prototype.onRemove = function() { this.removeEventListener(egret.Event.ADDED_TO_STAGE, this.onAdd, this), this.removeEventListener(egret.Event.REMOVED_FROM_STAGE, this.onRemove, this), egret.Tween.removeTweens(this) }, e.prototype.setV = function(t) { this.icons.scaleX = t, this.t = t }, e.prototype.setIcon = function(t) { this.icons.source = t + "_png" }, e.prototype.setData = function(t) { this.data = t; var i = t.pet_config_id; this.petType = e.getTypeForID(i); var n = Global.gameProxy.getItemImageId(i); this.setIcon(n) }, e.prototype.sleep = function() { var t = this.y; egret.Tween.get(this, { loop: !0 }).to({ scaleY: 1.03, y: t - 5 }, 200).to({ scaleY: 1, y: t }, 300) }, e.prototype.dodge = function() { game.EventManager.instance.dispatch(SysNotify.DODGE, { status: this.t }), egret.Tween.get(this).to({ rotation: -20 }, 300).to({ rotation: 0 }, 200, egret.Ease.backIn).call(this.dodgeCompete, this) }, e.prototype.dodgeCompete = function() { game.EventManager.instance.dispatch(SysNotify.DODGE_END, { status: this.t, pettype: this.petType }) }, e.prototype.beAttack = function() { game.EventManager.instance.dispatch(SysNotify.BE_ATTACK, { status: this.t, pettype: this.petType }); var t = this.x; egret.Tween.get(this).to({ x: t + 20 * this.t }, 50, egret.Ease.backIn).to({ x: t }, 100, egret.Ease.backIn).call(this.beAttackCompete) }, e.prototype.beAttackCompete = function() { game.EventManager.instance.dispatch(SysNotify.BE_END_ATTACK, { status: this.t, pettype: this.petType }) }, e.prototype.attack = function() { game.EventManager.instance.dispatch(SysNotify.START_ATTACK, { status: this.t, pettype: this.petType }); this.x, this.y; switch (this.petType) { case AlimalsType.LION: -1 == this.t ? egret.Tween.get(this).to({ rotation: 20 }, 50).to({ rotation: -20 }, 50).to({ rotation: 0 }, 300).wait(1e3).call(this.attackComplete) : egret.Tween.get(this).to({ rotation: 20 }, 50).to({ rotation: -20 }, 50).to({ rotation: 0 }, 300).wait(1e3).call(this.attackComplete); break; case AlimalsType.WOLF: -1 == this.t ? egret.Tween.get(this).wait(300).to({ x: e.AW1, y: e.AH1 - 50 }, 300).to({ x: e.W1, y: e.H1 }, 300).call(this.attackComplete) : egret.Tween.get(this).wait(300).to({ x: e.AW2, y: e.AH2 - 50 }, 300).to({ x: e.AW1, y: e.AH1 }, 300).call(this.attackComplete); break; case AlimalsType.SNAKE: -1 == this.t ? egret.Tween.get(this).to({ x: e.AW1, y: e.AH1 - 50 }, 100).to({ x: e.W1, y: e.H1 }, 100).call(this.attackComplete) : egret.Tween.get(this).to({ x: e.AW2, y: e.AH2 - 50 }, 100).to({ x: e.AW1, y: e.AH1 }, 100).call(this.attackComplete); break; case AlimalsType.BEAR: -1 == this.t ? egret.Tween.get(this).to({ rotation: 20 }, 50).to({ rotation: -20 }, 50).to({ rotation: 0 }, 300).wait(1e3).call(this.attackComplete) : egret.Tween.get(this).to({ rotation: 20 }, 50).to({ rotation: -20 }, 50).to({ rotation: 0 }, 300).wait(1e3).call(this.attackComplete); break; case AlimalsType.DRAGON: -1 == this.t ? egret.Tween.get(this).to({ rotation: 20 }, 50).to({ rotation: -20 }, 50).to({ rotation: 0 }, 300).wait(1e3).call(this.attackComplete) : egret.Tween.get(this).to({ rotation: 20 }, 50).to({ rotation: -20 }, 50).to({ rotation: 0 }, 300).wait(1e3).call(this.attackComplete) } }, e.prototype.die = function() { egret.Tween.get(this).to({ scaleX: .8, scaleY: .8 }, 200, egret.Ease.backIn).to({ scaleX: 1.1, scaleY: 1.1 }, 200, egret.Ease.backOut).to({ scaleX: 0, scaleY: 0 }, 200, egret.Ease.backOut).call(this.callDie, this) }, e.prototype.callDie = function() { - 1 == this.t ? BattleFruitManager.getInstance().battleData.result = 1 : BattleFruitManager.getInstance().battleData.result = 0 }, e.prototype.attackComplete = function() {}, e.prototype.callSleep = function() { this.sleep() }, e.getTypeForID = function(t) { return t >= 501e3 && 501003 >= t ? AlimalsType.LION: t >= 501004 && 501007 >= t ? AlimalsType.WOLF: t >= 501008 && 501011 >= t ? AlimalsType.SNAKE: t >= 501012 && 501015 >= t ? AlimalsType.BEAR: t >= 501016 && 501019 >= t ? AlimalsType.DRAGON: void 0 }, e.W1 = 97, e.H1 = 421, e.AW1 = 547, e.AH1 = 416, e.W2 = 547, e.H2 = 416, e.AW2 = 97, e.AH2 = 421, e } (eui.Component); __reflect(PetAnimation.prototype, "PetAnimation"); var AlimalsType = function() { function t() {} return t.LION = 0, t.WOLF = 1, t.SNAKE = 2, t.BEAR = 3, t.DRAGON = 4, t } (); __reflect(AlimalsType.prototype, "AlimalsType"); var BattleFruitManager = function(t) { function e() { var e = t.call(this) || this; return e.fruitRadomArr = [[1, 1, 1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1, 1]], e } return __extends(e, t), e.getInstance = function() { return this._insatance || (this._insatance = new e), this._insatance }, e.prototype.initRandomArr = function() { for (var t = 0; t < this.fruitRadomArr.length; t++) for (var e = 0; e < this.fruitRadomArr[t].length; e++) this.fruitRadomArr[t][e] = Math.floor(1 + 5 * Math.random()) }, e.prototype.isCanSelected = function(t, e) { if (this.isSame(t, e)) return ! 1; if (!this.isSameType(t, e)) return ! 1; if (e.length > 0) { if (Math.abs(t.i - e[e.length - 1].i) > 1) return ! 1; if (Math.abs(t.j - e[e.length - 1].j) > 1) return ! 1 } return ! 0 }, e.prototype.isSame = function(t, e) { for (var i = 0; i < e.length; i++) if (t.i == e[i].i && t.j == e[i].j) return ! 0; return ! 1 }, e.prototype.isSameType = function(t, e) { for (var i = 0; i < e.length; i++) if (t.types == e[i].types) return ! 0; return 0 == e.length ? !0 : !1 }, e.prototype.initanimalData = function(t) { this.battleData = new AnimalBattleData, this.battleData.init(), this.myPet = new Pet, this.myPet.readData(t.from_pet), this.otherPet = new Pet, this.otherPet.readData(t.be_pet), this.friendData = t.be_user }, e.prototype.sendNetWarResult = function() { GuideManager.getInsatance().isShowGuide && 8 == GuideManager.getInsatance().target && 0 == GuideManager.getInsatance().step && (GuideManager.getInsatance().target = 9, GuideManager.getInsatance().step = 0, GuideManager.getInsatance().sendNetMessage()), Global.netProxy.sendRequest(GameConfig.SERVER_PATH + "pet/battle", { user_id: Global.playerProxy.playerData.id, pet_id: this.myPet.id, be_user_id: this.friendData.user_id, type: this.battleData.result }, this.onSendNetWarResult.bind(this)) }, e.prototype.onSendNetWarResult = function(t) { if (0 == t.status) { var e = Global.gameProxy.getItemSFConfig(); if (0 == this.battleData.result) { Global.audioProxy.playSound("battlesuc_mp3"); var i = e[1], n = i.outcome_id; Global.playerProxy.addItem1(n), Global.playerProxy.addExp(i.experience_outcome), AsumentParkManager.getInstance().sucfaildType = 0, game.AppFacade.getInstance().sendNotification(PanelNotify.OPEN_REWARD_TIPS) } else { Global.audioProxy.playSound("battlefail_mp3"); var a = e[2], n = a.outcome_id; Global.playerProxy.addItem1(n), AsumentParkManager.getInstance().sucfaildType = 1, game.AppFacade.getInstance().sendNotification(PanelNotify.OPEN_REWARD_TIPS) } game.EventManager.instance.dispatch(SysNotify.TOPLAYER_INFO_UPDATE) } else TipsUtils.showTipsDownToUp(GameConfig.ServerCode[t.status]) }, e } (egret.EventDispatcher); __reflect(BattleFruitManager.prototype, "BattleFruitManager"); var AnimalBattleData = function() { function t() {} return t.prototype.init = function() { this.step = 30, this.result = 0 }, t } (); __reflect(AnimalBattleData.prototype, "AnimalBattleData"); var BattlePetSenceMediator = function(t) { function e(i) { void 0 === i && (i = null); var n = t.call(this, e.NAME, i) || this; return n.type = "scene", n.GroupName = "battlescence", n.isSendReq = !0, n } return __extends(e, t), e.prototype.listNotificationInterests = function() { return [SceneNotify.OPEN_BATTLEPET, SceneNotify.CLOSE_BATTLEPET] }, e.prototype.onRegister = function() { t.prototype.onRegister.call(this) }, e.prototype.handleNotification = function(t) { var e = t.getBody(); switch (t.getName()) { case SceneNotify.OPEN_BATTLEPET: this.id = e.uid, RES.isGroupLoaded(this.GroupName) ? this.showPre() : (LoadingCompoment.getInstance().show(), RES.addEventListener(RES.ResourceEvent.GROUP_COMPLETE, this.onResourceLoadComplete, this), RES.addEventListener(RES.ResourceEvent.GROUP_LOAD_ERROR, this.onResourceLoadError, this), RES.addEventListener(RES.ResourceEvent.GROUP_PROGRESS, this.onResourceProgress, this), RES.loadGroup(this.GroupName)); break; case SceneNotify.CLOSE_BATTLEPET: this.closeViewComponent(1), Global.audioProxy.closeBgMusic(), Global.audioProxy.startBgMusic() } }, e.prototype.showViewComponent = function() { this.viewComponent = new BattlePetScence; var t = GameLayerManager.gameLayer().sceneLayer; t.addChild(this.viewComponent), Global.audioProxy.closeBgMusic(), Global.audioProxy.startBgMusic1() }, e.prototype.showPre = function() { if (this.isSendReq) { this.isSendReq = !1; var t = BattleFruitManager.getInstance().openType; Global.netProxy.sendRequest(GameConfig.SERVER_PATH + "pet/get-battle-info", { be_user_id: this.id, type: t }, this.onGetBattleInfo.bind(this)) } var e = this; egret.setTimeout(function() { e.isSendReq = !0 }, this, 2e3) }, e.prototype.onGetBattleInfo = function(t) { if (0 == t.status) if (1 == BattleFruitManager.getInstance().openType) if (null == t.data.be_pet) game.AppFacade.getInstance().sendNotification(ClientNotify.GO_OTHER_FARM, { uid: t.data.be_user.user_id }), game.AppFacade.instance.sendNotification(PanelNotify.CLOSE_FRIEND); else { var e = Global.gameProxy.getPetBaseConfigForID(t.data.from_pet.pet_config_id); if (8 == GuideManager.getInsatance().target && 0 == GuideManager.getInsatance().step && 1 == GuideManager.getInsatance().isShowGuide); else if (e.hunger > t.data.from_pet.feed) return void TipsUtils.showTipsDownToUp("宠物饥饿度不足"); BattleFruitManager.getInstance().initanimalData(t.data), this.showViewComponent(), game.AppFacade.instance.sendNotification(SceneNotify.CLOSE_GAME), game.AppFacade.instance.sendNotification(PanelNotify.CLOSE_FRIEND) } else { var e = Global.gameProxy.getPetBaseConfigForID(t.data.from_pet.pet_config_id); if (8 == GuideManager.getInsatance().target && 0 == GuideManager.getInsatance().step && 1 == GuideManager.getInsatance().isShowGuide); else if (e.hunger > t.data.from_pet.feed) return void TipsUtils.showTipsDownToUp("宠物饥饿度不足"); BattleFruitManager.getInstance().initanimalData(t.data), this.showViewComponent(), game.AppFacade.instance.sendNotification(SceneNotify.CLOSE_GAME), game.AppFacade.instance.sendNotification(PanelNotify.CLOSE_SPORTS) } else TipsUtils.showTipsDownToUp(GameConfig.ServerCode[t.status]) }, e.prototype.initUI = function() {}, e.prototype.initData = function() {}, e.prototype.onResourceLoadComplete = function(t) { t.groupName == this.GroupName && (RES.removeEventListener(RES.ResourceEvent.GROUP_COMPLETE, this.onResourceLoadComplete, this), RES.removeEventListener(RES.ResourceEvent.GROUP_LOAD_ERROR, this.onResourceLoadError, this), RES.removeEventListener(RES.ResourceEvent.GROUP_PROGRESS, this.onResourceProgress, this), LoadingCompoment.getInstance().hide(), this.showPre()) }, e.prototype.onResourceLoadError = function(t) { console.warn("Group:" + t.groupName + " has failed to load"), this.onResourceLoadComplete(t) }, e.prototype.onResourceProgress = function(t) { t.groupName == this.GroupName && LoadingCompoment.getInstance().prossBar.setPross(t.itemsLoaded, t.itemsTotal) }, e.NAME = "BattlePetSenceMediator", e } (BaseMediator); __reflect(BattlePetSenceMediator.prototype, "BattlePetSenceMediator"); var game; ! function(t) { var e = function(e) { function i() { var t = e.call(this, i.NAME) || this; return t.type = "scene", t } return __extends(i, e), i.prototype.listNotificationInterests = function() { return [SceneNotify.OPEN_CREATEROLE, SceneNotify.CLOSE_CREATEROLE] }, i.prototype.onRegister = function() { e.prototype.onRegister.call(this) }, i.prototype.showViewComponent = function() { this.viewComponent = new t.CreateRoleScene; var e = GameLayerManager.gameLayer().sceneLayer; e.addChild(this.viewComponent) }, i.prototype.handleNotification = function(t) { switch (t.getName()) { case SceneNotify.OPEN_CREATEROLE: this.showViewComponent(); break; case SceneNotify.CLOSE_CREATEROLE: this.closeViewComponent(1) } }, i.NAME = "CreateRoleMediator", i } (BaseMediator); t.CreateRoleMediator = e, __reflect(e.prototype, "game.CreateRoleMediator") } (game || (game = {})); var game; ! function(t) { var e = function(e) { function i(t) { void 0 === t && (t = null); var n = e.call(this, i.NAME, t) || this; return n.type = "scene", n } return __extends(i, e), i.prototype.listNotificationInterests = function() { return [SceneNotify.OPEN_MINE_GAME, SceneNotify.OPEN_OTHER_GAME, SceneNotify.BACK_MINE_GAME, SceneNotify.CLOSE_GAME, ClientNotify.LAND_SHOUHUO, ClientNotify.LAND_CHANCHU, ClientNotify.FLUSH_FARM, ClientNotify.KICK_BUG, ClientNotify.KICK_GRASS, ClientNotify.KICK_WATER, ClientNotify.GAO_SHI, ClientNotify.USE_FERTILIZE] }, i.prototype.onRegister = function() { e.prototype.onRegister.call(this), this.facade.registerMediator(new t.ShopMediator), this.facade.registerMediator(new t.WareHouseMediator), this.facade.registerMediator(new t.BagMediator), this.facade.registerMediator(new t.SkinMediator), this.facade.registerMediator(new t.HelpMediator), this.facade.registerMediator(new t.LandExtendMediator), this.facade.registerMediator(new t.LandUpgradeMediator), this.facade.registerMediator(new t.HouseUpgradeMediator), this.facade.registerMediator(new t.DogMediator), this.facade.registerMediator(new t.FriendMediator), this.facade.registerMediator(new t.PlayerInfoMediator), this.facade.registerMediator(new t.LogMediator), this.facade.registerMediator(new t.FriendGiveMediator), this.facade.registerMediator(new t.FriendGiveListMediator), this.facade.registerMediator(new t.LotteryMediator), this.facade.registerMediator(new t.SendMesageMediator), this.facade.registerMediator(new t.SayMediator), this.facade.registerMediator(new t.ExGoldMediator), this.facade.registerMediator(new t.PayMediator), this.facade.registerMediator(new t.NoticeMediator), this.facade.registerMediator(new t.MofajiagongMediter), this.facade.registerMediator(new t.MofahechengMidter), this.facade.registerMediator(new LevelGiftMediter), this.facade.registerMediator(new OnlineGiftMediter), this.facade.registerMediator(new SignMediter), this.facade.registerMediator(new SignsTipsMediter), this.facade.registerMediator(new FuliMediter), this.facade.registerMediator(new FulibaoTipsMediter), this.facade.registerMediator(new BattlePetMediator), this.facade.registerMediator(new BattlePetTipsMeditor), this.facade.registerMediator(new SportsMeditor), this.facade.registerMediator(new BattlePetSenceMediator), this.facade.registerMediator(new UseBattlePetTipsMediator), this.facade.registerMediator(new BattleFruitTipsMediator), this.facade.registerMediator(new AsumentParkMediator), this.facade.registerMediator(new ZumaMediator), this.facade.registerMediator(new t.TianbingMediator), this.facade.registerMediator(new RewardTipsMediator), this.facade.registerMediator(new ZhuawawaMediator), this.facade.registerMediator(new ChengjiuMediator), this.facade.registerMediator(new BoxMediator), this.facade.registerMediator(new DogTipsMediter), this.facade.registerMediator(new t.GameScenceMediter2), this.facade.registerMediator(new Changemediater) }, i.prototype.handleNotification = function(t) { var e = t.getBody(); switch (t.getName()) { case SceneNotify.OPEN_MINE_GAME: this.showViewComponent(!0); break; case SceneNotify.OPEN_OTHER_GAME: this.showOtherGameScene(); break; case SceneNotify.BACK_MINE_GAME: this.backToMineScene(); break; case SceneNotify.CLOSE_GAME: this.closeViewComponent(1); break; case ClientNotify.LAND_SHOUHUO: this.shouhuo(); break; case ClientNotify.LAND_CHANCHU: this.chanchu(); break; case ClientNotify.FLUSH_FARM: this.flushFarm(); break; case ClientNotify.KICK_BUG: this.kickDisease(1); break; case ClientNotify.KICK_GRASS: this.kickDisease(2); break; case ClientNotify.KICK_WATER: this.kickDisease(0); break; case ClientNotify.GAO_SHI: this.putOtherPlayerAction(e) } }, i.prototype.putOtherPlayerAction = function(t) { var e = GameConfig.SERVER_PATH + "interaction/interaction", i = Const.clickLandIndex, n = { type: t.type, be_user_id: t.id, position: i }; Global.netProxy.sendRequest(e, n, function(e) { if (0 === e.status) { switch (e.data.type) { case 1: PopUpManager.popTip("放虫成功"); break; case 2: PopUpManager.popTip("放草成功"); break; case 3: PopUpManager.popTip("浇水成功"); break; case 4: PopUpManager.popTip("除虫成功"); break; case 5: PopUpManager.popTip("除草成功") } Global.otherPlayerProxy.updateLandData(i, e.data.land), t.callback && t.callback(e.data, i) } else TipsUtils.showErrorCodeTips(e.status) }) }, i.prototype.backToMineScene = function() { var e = 250, i = new t.GameScene(!0); i.x = -Const.WIN_W, PopUpManager.addSceneUp(i), egret.Tween.get(i).to({ x: 0 }, e); var n = this.viewComponent; egret.Tween.get(n).to({ x: Const.WIN_W }, e).call(function() { this.closeViewComponent(1), this.viewComponent = i, t.EventManager.instance.dispatch(SysNotify.FRIEND_REFRESH), t.AppFacade.getInstance().sendNotification(PanelNotify.SHOW_FRIEND) }, this), egret.Tween.get(GameLayerManager.instance.popLayer).to({ x: 0 }, e) }, i.prototype.showOtherGameScene = function(m) { var e = 250, i = new t.GameScene(!1); this.viewComponent = new t.GameScene(m); i.x = Const.WIN_W, PopUpManager.addSceneUp(i), egret.Tween.get(i).to({ x: 0 }, e); var n = this.viewComponent; console.log(n,'检测这里'); egret.Tween.get(n).to({ x: -Const.WIN_W }, e).call(function() { t.UIUtils.removeSelf(n), n = null, this.viewComponent = i, t.AppFacade.getInstance().sendNotification(PanelNotify.HIDE_FRIEND) }, this), egret.Tween.get(GameLayerManager.instance.popLayer).to({ x: -Const.WIN_W }, e) }, i.prototype.useFertilize = function(t) { var e = GameConfig.SERVER_PATH + "farm/fertilize", i = Const.clickLandIndex, n = { position: i, item_id: t.id }; Global.netProxy.sendRequest(e, n, function(e) { 0 == e.status ? (PopUpManager.popTip("施肥成功"), Global.playerProxy.sellWareHouseItem(t, 1), Global.playerProxy.updateLandData(i, e.data)) : TipsUtils.showErrorCodeTips(e.status) }) }, i.prototype.kickDisease = function(t) { var e = GameConfig.SERVER_PATH + "farm/disease", i = Const.clickLandIndex, n = { position: i, type: t }; Global.netProxy.sendRequest(e, n, function(e) { if (0 == e.status) PopUpManager.popTip("操作成功"), 1 == t ? Global.playerProxy.sellWareHouseItem({ id: 108001 }, 1) : 2 == t && Global.playerProxy.sellWareHouseItem({ id: 109001 }, 1), Global.playerProxy.updateLandData(i, e.data); else { if (1012 === e.status) return void(1 == t ? PopUpManager.popTip("除虫剂数量不足") : 2 == t && PopUpManager.popTip("除草剂数量不足")); TipsUtils.showErrorCodeTips(e.status) } }) }, i.prototype.flushFarm = function() { var t = GameConfig.SERVER_PATH + "farm", e = this; Global.netProxy.sendRequest(t, {}, function(t) { 0 == t.status ? (Global.playerProxy.setPlayerData(t.data), Global.playerProxy.setPlayerLandData(t.data), e.viewComponent.flushGameScene()) : TipsUtils.showErrorCodeTips(t.status) }) }, i.prototype.showViewComponent = function(e) { this.viewComponent = new t.GameScene(e), this.viewComponent.mediator = this, PopUpManager.addSceneUp(this.viewComponent) }, i.prototype.initUI = function() {}, i.prototype.initData = function() {}, i.prototype.plantSeed = function(t, e) { var i = GameConfig.SERVER_PATH + "farm/sow-seeds", n = { position: t, item_id: e.id }; return new Promise(function(a, o) { Global.netProxy.sendRequest(i, n, function(i) { 0 == i.status ? (Global.playerProxy.sellWareHouseItem(e, 1), Global.playerProxy.updateLandData(t, i.data), TipsUtils.showTipsDownToUp("播种成功"), a(i.status)) : TipsUtils.showErrorCodeTips(i.status) }) }) }, i.prototype.shouhuo = function() { var e = Const.clickLandIndex, i = { position: e }, n = GameConfig.SERVER_PATH + "farm/gather-crop"; Global.netProxy.sendRequest(n, i, function(i) { if (0 === i.status) { var n = Global.playerProxy; n.updateWareHouseItem(i.data, i.data.item_add_num), n.updateLandData(e, i.data), n.addExp(i.data.add_exp), t.EventManager.instance.dispatch(SysNotify.TOPLAYER_INFO_UPDATE), t.EventManager.instance.dispatch(SysNotify.PLANT_REAP, i.data.item_add_num) } else TipsUtils.showErrorCodeTips(i.status) }) }, i.prototype.chanchu = function() { var t = Const.clickLandIndex, e = { position: t }, i = GameConfig.SERVER_PATH + "farm/clear-land"; Global.netProxy.sendRequest(i, e, function(e) { if (0 === e.status) { PopUpManager.popTip("铲除成功"); var i = Global.playerProxy; i.updateLandData(t, e.data) } else TipsUtils.showErrorCodeTips(e.status) }) }, i.NAME = "GameMediator", i } (BaseMediator); t.GameMediator = e, __reflect(e.prototype, "game.GameMediator") } (game || (game = {})); var game; ! function(t) { var e = function(e) { function i(t) { void 0 === t && (t = null); var n = e.call(this, i.NAME, t) || this; return n.type = "scene", n.isSendReq = !1, n } return __extends(i, e), i.prototype.listNotificationInterests = function() { return [SceneNotify.OPEN_LOGIN, SceneNotify.CLOSE_LOGIN] }, i.prototype.onRegister = function() { e.prototype.onRegister.call(this), this.facade.registerMediator(new t.CreateRoleMediator), this.facade.registerMediator(new t.GameMediator) }, i.prototype.handleNotification = function(e) { e.getBody(); switch (e.getName()) { case SceneNotify.OPEN_LOGIN: this.showViewComponent(), window.parent && window.parent && getURLQueryString("code") && t.AppFacade.getInstance().sendNotification(PanelNotify.OPEN_REGIST); break; case SceneNotify.CLOSE_LOGIN: this.closeViewComponent(1), this.facade.removeMediator(i.NAME) } }, i.prototype.showViewComponent = function() { this.viewComponent = new t.LoginScene; var e = GameLayerManager.gameLayer().sceneLayer; e.addChild(this.viewComponent) }, i.prototype.initUI = function() {}, i.prototype.initData = function() {}, i.NAME = "LoginMediator", i } (BaseMediator); t.LoginMediator = e, __reflect(e.prototype, "game.LoginMediator") } (game || (game = {})); var game; ! function(t) { var e = function(e) { function i() { var t = e.call(this, i.NAME) || this; return t.type = "scene", t } return __extends(i, e), i.prototype.listNotificationInterests = function() { return [SysNotify.START_GAME, SceneNotify.CLOSE_LOADING] }, i.prototype.onRegister = function() { e.prototype.onRegister.call(this), this.facade.registerMediator(new t.LoginMediator), this.facade.registerMediator(new t.FindPasswordMediator) }, i.prototype.showViewComponent = function() { this.viewComponent = new t.LogoScene; var e = GameLayerManager.gameLayer().sceneLayer; e.addChild(this.viewComponent) }, i.prototype.handleNotification = function(t) { switch (t.getName()) { case SysNotify.START_GAME: this.showViewComponent(); break; case SceneNotify.CLOSE_LOADING: this.closeViewComponent(1) } }, i.NAME = "LogoMediator", i } (BaseMediator); t.LogoMediator = e, __reflect(e.prototype, "game.LogoMediator") } (game || (game = {})); var game; ! function(t) { var e = function(e) { function i() { return e.call(this, i.NAME) || this } return __extends(i, e), i.prototype.listNotificationInterests = function() { return [SceneNotify.OPEN_SAY, SceneNotify.CLOSE_SAY] }, i.prototype.onRegister = function() { e.prototype.onRegister.call(this) }, i.prototype.showViewComponent = function() { this.viewComponent = new t.SayScene; var e = GameLayerManager.gameLayer().sceneLayer; e.addChild(this.viewComponent) }, i.prototype.handleNotification = function(t) { switch (t.getName()) { case SceneNotify.OPEN_SAY: this.showViewComponent(); break; case SceneNotify.CLOSE_SAY: this.closeViewComponent(1) } }, i.NAME = "SayMediator", i } (BaseMediator); t.SayMediator = e, __reflect(e.prototype, "game.SayMediator") } (game || (game = {})); var DateTimer = function() { function t() { if (this._deltaTime = 0, t._instance) throw new Error("DateTimer使用单例") } return Object.defineProperty(t, "instance", { get: function() { return t._instance || (t._instance = new t), t._instance }, enumerable: !0, configurable: !0 }), Object.defineProperty(t, "deltatime", { get: function() { return t.instance._deltaTime }, enumerable: !0, configurable: !0 }), t.prototype.updateServerTime = function(t) { this._deltaTime = Date.now() - t, console.log(this._deltaTime) }, Object.defineProperty(t.prototype, "now", { get: function() { return Math.floor((Date.now() - this._deltaTime) / 1e3) }, enumerable: !0, configurable: !0 }), t.prototype.run = function() { this.run1sTicker(), this.runTicker() }, t.prototype.runSyncTicker = function() { var t = new egret.Timer(15e3); t.addEventListener(egret.TimerEvent.TIMER, this.onSyncTimer, this), t.start() }, t.prototype.onSyncTimer = function() {}, t.prototype.run1sTicker = function() { var t = new egret.Timer(1e3); t.addEventListener(egret.TimerEvent.TIMER, this.onOneSecondTimer, this), t.start(), this._last1sTime = egret.getTimer() }, t.prototype.onOneSecondTimer = function() { var t = egret.getTimer(), e = t - this._last1sTime; this._last1sTime = t, manager.UpdateTickerManager.onesec.update(e) }, t.prototype.runTicker = function() { var t = new egret.Timer(33); t.addEventListener(egret.TimerEvent.TIMER, this.onEnterFrameTimer, this), t.start(), this._lastFpsTime = egret.getTimer() }, t.prototype.onEnterFrameTimer = function() { var t = egret.getTimer(), e = t - this._lastFpsTime; this._lastFpsTime = t, manager.UpdateTickerManager.instance.update(e) }, t } (); __reflect(DateTimer.prototype, "DateTimer"); var game; ! function(t) { var e = function() { function t(t, e, i) { this.type = t, this.callback = e, this.thisObj = i } return t } (); t.EventAutoRelease = e, __reflect(e.prototype, "game.EventAutoRelease"); var i = function(t) { function i(e) { var n = t.call(this, e) || this; if (n.autoReleaseArr = [], i._instance) throw new Error("EventManager使用单例 "); return n.init(), n } return __extends(i, t), Object.defineProperty(i, "instance", { get: function() { return i._instance || (i._instance = new i), i._instance }, enumerable: !0, configurable: !0 }), i.prototype.init = function() { var t = new egret.Timer(2e3); t.addEventListener(egret.TimerEvent.TIMER, this.autoReleaseTick, this), t.start() }, i.prototype.addEvent = function(t, i, n, a) { void 0 === a && (a = !1), this.addEventListener(t, i, n), a && n instanceof egret.DisplayObject && this.autoReleaseArr.push(new e(t, i, n)) }, i.prototype.removeEvent = function(t, e, i) { this.removeEventListener(t, e, i) }, i.prototype.dispatch = function(t, e) { void 0 === e && (e = null), this.dispatchEventWith(t, !1, e) }, i.prototype.autoReleaseTick = function() { for (var t = this.autoReleaseArr.length - 1; t >= 0; t--) { var e = this.autoReleaseArr[t]; e.thisObj.stage || (this.removeEvent(e.type, e.callback, e.thisObj), this.autoReleaseArr.splice(t, 1)) } }, i } (egret.EventDispatcher); t.EventManager = i, __reflect(i.prototype, "game.EventManager") } (game || (game = {})); var GameLayerManager = function(t) { function e() { var e = t.call(this) || this; return e.sceneLayer = new eui.UILayer, e.mainLayer = new eui.UILayer, e.panelLayer = new eui.UILayer, e.effectLayer = new eui.UILayer, e.maskLayer = new eui.UILayer, e.loadLayer = new eui.UILayer, e.tipLayer = new eui.UILayer, e.popLayer = new eui.UILayer, e.guideLayer = new eui.Group, e.init(), e } return __extends(e, t), Object.defineProperty(e, "instance", { get: function() { return this._instance || (this._instance = new e), this._instance }, enumerable: !0, configurable: !0 }), e.gameLayer = function() { return this._instance || (this._instance = new e), this._instance }, e.prototype.init = function() { this.touchThrough = !1, this.sceneLayer.touchThrough = !0, this.mainLayer.touchThrough = !0, this.panelLayer.touchThrough = !0, this.effectLayer.touchThrough = !0, this.maskLayer.touchThrough = !0, this.loadLayer.touchThrough = !0, this.popLayer.touchThrough = !0, this.tipLayer.touchThrough = !0, this.guideLayer.touchEnabled = !1, this.addChild(this.sceneLayer), this.addChild(this.mainLayer), this.addChild(this.panelLayer), this.addChild(this.popLayer), this.addChild(this.tipLayer), this.addChild(this.loadLayer), this.addChild(this.effectLayer), this.addChild(this.maskLayer), this.addChild(this.guideLayer) }, e } (eui.UILayer); __reflect(GameLayerManager.prototype, "GameLayerManager"); var PopUpManager; ! function(t) { function e(t) { return GameLayerManager.gameLayer().panelLayer.contains(t) ? !0 : !1 } function i(t) { return GameLayerManager.gameLayer().sceneLayer.contains(t) ? !0 : !1 } function n(t, e, i, n, a, o) { if (void 0 === e && (e = !1), void 0 === i && (i = 0), void 0 === n && (n = 0), void 0 === a && (a = 0), void 0 === o && (o = !1), !GameLayerManager.gameLayer().panelLayer.contains(t)) { if (t.name = "Panel" + t.hashCode, t.scaleX = GameConfig.curWidth() / Const.DESGIN_W, t.scaleY = GameConfig.curHeight() / Const.DESGIN_H, t.x = 0, t.y = 0, t.alpha = 1, e) { var s = new egret.Sprite; s.graphics.clear(), s.graphics.beginFill(0, .03), s.graphics.drawRect(0, 0, Const.DESGIN_W, Const.DESGIN_H), s.graphics.endFill(), s.name = "Drak" + t.hashCode, s.width = Const.DESGIN_W, s.height = Const.DESGIN_H, GameLayerManager.gameLayer().panelLayer.contains(s) || GameLayerManager.gameLayer().panelLayer.addChild(s), s.touchEnabled = !0, egret.Tween.get(s).to({ alpha: 1 }, 150), s.visible = !0 } GameLayerManager.gameLayer().panelLayer.addChild(t), GameConfig.curPanel = t, 0 != i ? (t.x = Const.DESGIN_W / 2 - i / 2, t.y = Const.DESGIN_H / 2 - n / 2 - t.anchorOffsetY) : (i = t.width, n = t.height); var r = Const.DESGIN_W / 2 - i / 2, h = Const.DESGIN_H / 2 - n / 2, l = GameConfig.curWidth() / Const.DESGIN_W, c = GameConfig.curHeight() / Const.DESGIN_H; switch (a) { case 0: break; case 7: t.alpha = 0, t.scaleX = .5, t.scaleY = .5, t.x = t.x + i / 4, t.y = t.y + n / 4, egret.Tween.get(t).to({ alpha: 1, scaleX: l, scaleY: c, x: t.x - i / 4 + t.anchorOffsetX, y: t.y - n / 4 + t.anchorOffsetY }, 250, egret.Ease.backOut); break; case 1: t.alpha = 0, t.scaleX = .5, t.scaleY = .5, t.x = t.x + i / 4, t.y = t.y + n / 4, egret.Tween.get(t).to({ alpha: 1, scaleX: l, scaleY: c, x: t.x - i / 4 + t.anchorOffsetX, y: t.y - n / 4 + t.anchorOffsetY }, 300, egret.Ease.backOut); break; case 2: t.alpha = 0, t.scaleX = .5, t.scaleY = .5, egret.Tween.get(t).to({ alpha: 1, scaleX: l, scaleY: c, x: t.x, y: t.y }, 600, egret.Ease.elasticOut); break; case 3: o ? (t.x = -i, egret.Tween.get(t).to({ x: r }, 500, egret.Ease.cubicOut)) : (t.x = -i, egret.Tween.get(t).to({ x: 0 }, 500, egret.Ease.cubicOut)); break; case 4: o ? (t.x = i, egret.Tween.get(t).to({ x: r }, 500, egret.Ease.cubicOut)) : (t.x = i, egret.Tween.get(t).to({ x: 0 }, 500, egret.Ease.cubicOut)); break; case 5: o ? (t.y = -n, egret.Tween.get(t).to({ y: h }, 500, egret.Ease.cubicOut)) : (t.y = -n, egret.Tween.get(t).to({ y: 0 }, 500, egret.Ease.cubicOut)); break; case 6: o ? (t.y = GameConfig.curHeight(), egret.Tween.get(t).to({ y: h }, 500, egret.Ease.cubicOut)) : (t.y = n, egret.Tween.get(t).to({ y: 0 }, 500, egret.Ease.cubicOut)) } } } function a(t) { egret.Tween.removeTweens(t); t.anchorOffsetX, t.anchorOffsetY; t.anchorOffsetX = t.width / 2, t.anchorOffsetY = t.height / 2, t.x = t.anchorOffsetX, t.y = t.anchorOffsetY; var e = "Drak" + t.hashCode, i = GameLayerManager.gameLayer().panelLayer.getChildByName(e); i && (i.visible = !0), t.visible = !0, egret.Tween.get(t).to({ alpha: 1, scaleX: 1, scaleY: 1 }, 250, egret.Ease.backIn).call(function() { t.anchorOffsetX = 0, t.anchorOffsetY = 0, t.x = 0, t.y = 0 }) } function o(t) { egret.Tween.removeTweens(t); var e = this, i = "Drak" + t.hashCode, n = GameLayerManager.gameLayer().panelLayer.getChildByName(i); egret.Tween.get(t).to({ alpha: 0, scaleX: 0, scaleY: 0, x: t.x + t.width / 2, y: t.y + t.height / 2 }, 250, egret.Ease.backIn); var a = 500; egret.setTimeout(function() { n && (n.visible = !1), t.visible = !1 }, e, a) } function s(t, e, i) { if (void 0 === e && (e = 0), t) { egret.Tween.removeTweens(t); var n = this, a = "Drak" + t.hashCode, o = GameLayerManager.gameLayer().panelLayer.getChildByName(a), s = function() { GameLayerManager.gameLayer().panelLayer.contains(o) && GameLayerManager.gameLayer().panelLayer.removeChild(o) }; switch (o && (o.alpha = 0, egret.Tween.get(o).to({ alpha: 0 }, 100).call(s, n)), e) { case 10: t.onHide && t.onHide(); break; case 0: break; case 1: egret.Tween.get(t).to({ alpha: 0, scaleX: 0, scaleY: 0, x: t.x + t.width / 2, y: t.y + t.height / 2 }, 250, egret.Ease.backIn); break; case 2: break; case 3: egret.Tween.get(t).to({ x: t.width }, 500, egret.Ease.cubicOut); break; case 4: egret.Tween.get(t).to({ x: -t.width }, 500, egret.Ease.cubicOut); break; case 5: egret.Tween.get(t).to({ y: t.height }, 500, egret.Ease.cubicOut); break; case 6: egret.Tween.get(t).to({ y: -t.height }, 500, egret.Ease.cubicOut) } var r = 500; 0 == e && (r = 0), egret.setTimeout(function() { GameLayerManager.gameLayer().panelLayer.contains(t) && GameLayerManager.gameLayer().panelLayer.removeChild(t) }, n, r) } } function r(t, e, i) { void 0 === e && (e = 0), void 0 === i && (i = !1), GameLayerManager.gameLayer().sceneLayer.contains(t) || GameLayerManager.gameLayer().sceneLayer.addChild(t) } function h(t) { GameLayerManager.gameLayer().sceneLayer.contains(t) && GameLayerManager.gameLayer().sceneLayer.removeChild(t) } function l(t, e, i, n) { void 0 === n && (n = 16), game.SimpleTip.popTip(t, e, i, n) } function c(t, e, i) { void 0 === e && (e = 1e3), void 0 === i && (i = !1), game.ToastTip.popTip(t, e, i) } t.panelIsAdded = e, t.sceneIsAdded = i, t.addPopUp = n, t.showPanel = a, t.hidePanel = o, t.removePopUpAsync = s, t.addSceneUp = r, t.removeSceneUp = h, t.popSimpleTip = l, t.popTip = c } (PopUpManager || (PopUpManager = {})); var SocketManager; ! function(t) { function e() { this.sock.close(), Global.alertMediator.addAlert("网络已经断开,请重新连接", function() { window.location.href = window.location.href }, null, !0) } function i() { this.sock = new egret.WebSocket, this.sock.addEventListener(egret.ProgressEvent.SOCKET_DATA, this.onReceiveMessage, this), this.sock.addEventListener(egret.Event.CONNECT, this.onSocketOpen, this), this.sock.addEventListener(egret.Event.CLOSE, this.onSocketClose, this), this.sock.addEventListener(egret.IOErrorEvent.IO_ERROR, this.onSocketError, this), this.sock.connectByUrl("ws://" + GameConfig.SOKCET_PATH) } function n() {} function a() { console.log("连接成功"), this.sendMessage({ command_id: game.SocketCommand.to_command_id1, token: Global.netProxy.token }) } function o() { var t = JSON.parse(this.sock.readUTF()); return 0 == t.command_id ? void TipsUtils.showErrorCodeTips(t.status) : void(4 == t.command_id ? (t.data = JSON.parse(t.data), (1 == t.data.type || 2 == t.data.type) && game.EventManager.instance.dispatch(SysNotify.FRIEND_RED, t.data), game.SocketCommand[t.data.type] && game.AppFacade.getInstance().sendNotification(game.SocketCommand[t.data.type], t.data.detail_data)) : 6 == t.command_id && game.EventManager.instance.dispatch(SysNotify.SHOW_MESSAGE, t.data)) } function s(t) { this.sock.writeUTF(JSON.stringify(t)) } t.onSocketClose = e, t.connectServer = i, t.onSocketError = n, t.onSocketOpen = a, t.onReceiveMessage = o, t.sendMessage = s } (SocketManager || (SocketManager = {})); var manager; ! function(t) { var e = function() { function t() { this.allUpdateObjArr = [] } return Object.defineProperty(t, "instance", { get: function() { return t._instance || (t._instance = new t), t._instance }, enumerable: !0, configurable: !0 }), Object.defineProperty(t, "onesec", { get: function() { return t._onesec || (t._onesec = new t), t._onesec }, enumerable: !0, configurable: !0 }), t.prototype.add = function(t) { game.Utils.isElinArr(t, this.allUpdateObjArr) || this.allUpdateObjArr.push(t) }, t.prototype.remove = function(t) { for (var e = this.allUpdateObjArr.length, i = 0; e > i; i++) t == this.allUpdateObjArr[i] && this.allUpdateObjArr.splice(i, 1) }, t.prototype.update = function(t) { for (var e = 0; e < this.allUpdateObjArr.length; e++) this.allUpdateObjArr[e].update(t) }, t } (); t.UpdateTickerManager = e, __reflect(e.prototype, "manager.UpdateTickerManager") } (manager || (manager = {})); var SocketManager2 = function(t) { function e() { var e = t.call(this) || this; return e.socketObjArr = [], e } return __extends(e, t), e.getInstance = function() { return this._instance || (this._instance = new e), this._instance }, e.prototype.init = function() { this.socketObjArr.length = 0 }, e.prototype.connectServer = function(t) { this.sock = new egret.WebSocket, this.sock.addEventListener(egret.ProgressEvent.SOCKET_DATA, this.onReceiveMessage, this), this.sock.addEventListener(egret.Event.CONNECT, this.onSocketOpen, this), this.sock.addEventListener(egret.Event.CLOSE, this.onSocketClose, this), this.sock.addEventListener(egret.IOErrorEvent.IO_ERROR, this.onSocketError, this), this.sock.connectByUrl("ws://" + t) }, e.prototype.onSocketClose = function() { this.sock.close(), console.log("连接关闭") }, e.prototype.onSocketError = function() { console.log("连接异常") }, e.prototype.onSocketOpen = function() { console.log("连接成功") }, e.prototype.onReceiveMessage = function() { var t = JSON.parse(this.sock.readUTF()); if (t.command_id > 500 && t.command_id < 1e3); else if (t.command_id < 500) for (var e = 0; e < this.socketObjArr.length; e++) if (this.socketObjArr[e].commondID == t.command_id) { var i = this.socketObjArr.splice(e); i.callFunc.call(i.callObj, t) } }, e.prototype.sendMessage = function(t, e, i, n) { var a = new SocketObject; a.commondID = t, a.callFunc = i, a.callObj = n; var o = {}; o.commondID = a.commondID, o.data = e, this.sock.writeUTF(JSON.stringify(o)), this.socketObjArr.push(a) }, e } (egret.EventDispatcher); __reflect(SocketManager2.prototype, "SocketManager2"); var SocketObject = function() { function t() {} return t } (); __reflect(SocketObject.prototype, "SocketObject"); var SokcetCommond = function() { function t() {} return t.LOGIN = 100, t.ONLOGIN = 500, t } (); __reflect(SokcetCommond.prototype, "SokcetCommond"); var core; ! function(t) { var e = function() { function t() {} return t.initEncodeChar = function() { for (var t = new Array(64), e = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", i = 0, n = e.length; n > i; i++) t[i] = e.charCodeAt(i); return t }, t.initDecodeChar = function() { var t = [ - 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 62, -1, -1, -1, 63, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, -1, -1, -1, -1, -1, -1, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, -1, -1, -1, -1, -1, -1, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1]; return t }, t.encode = function(e) { var i = new egret.ByteArray, n = 0, a = e.length, o = a % 3, s = a - o, r = 0; for (e.position = 0; s > n;) r = (255 & e.readByte()) << 16 | (255 & e.readByte()) << 8 | 255 & e.readByte(), i.writeByte(t.s_encodeChars[r >>> 18]), i.writeByte(t.s_encodeChars[r >>> 12 & 63]), i.writeByte(t.s_encodeChars[r >>> 6 & 63]), i.writeByte(t.s_encodeChars[63 & r]), n += 3; return 1 == o ? (r = 255 & e.readByte(), i.writeByte(t.s_encodeChars[r >>> 2]), i.writeByte(t.s_encodeChars[3 & r]), i.writeByte(61), i.writeByte(61)) : 2 == o && (r = (255 & e.readByte()) << 8 | 255 & e.readByte(), i.writeByte(t.s_encodeChars[r >>> 10]), i.writeByte(t.s_encodeChars[r >>> 4 & 63]), i.writeByte(t.s_encodeChars[(15 & r) << 2]), i.writeByte(61)), n += o, i.position = 0, i.readUTFBytes(i.length) }, t.decode = function(e) { var i = new egret.ByteArray, n = new egret.ByteArray; n.writeUTFBytes(e), n.position = 0; for (var a, o, s, r, h = 0, l = n.length; l > h && (a = t.s_decodeChars[255 & n.readByte()], -1 != a) && (o = t.s_decodeChars[255 & n.readByte()], -1 != o) && (i.writeByte(a << 2 | 3 & o), s = 255 & n.readByte(), 61 != s) && (s = t.s_decodeChars[s], -1 != s) && (i.writeByte(240 & o | 15 & s), r = 255 & n.readByte(), 61 != r) && (r = t.s_decodeChars[r], -1 != r);) i.writeByte(192 & s | r), h += 4; return i.position = 0, i }, t.encodeStr = function(e) { if (null != e && "" != e) { var i = new egret.ByteArray; return i.writeUTFBytes(e), t.encode(i) } return "" }, t.decodeStr = function(e) { if (null != e && "" != e) { var i = t.decode(e); return i.readUTFBytes(i.length) } return "" }, t.s_encodeChars = t.initEncodeChar(), t.s_decodeChars = t.initDecodeChar(), t } (); t.Base64 = e, __reflect(e.prototype, "core.Base64") } (core || (core = {})); var BloodTips = function(t) { function e() { return t.call(this) || this } return __extends(e, t), e.getInstance = function() { return this._insatance || (this._insatance = new e), this._insatance }, e.prototype.createTips = function(t, e, i, n, a, o) { void 0 === n && (n = 0), void 0 === o && (o = "battle_pet_zi_fnt"); var s = new eui.BitmapLabel; s.font = o, s.text = i, GameLayerManager.gameLayer().effectLayer.contains(s) || GameLayerManager.gameLayer().effectLayer.addChild(s), s.x = t, s.y = e, s.anchorOffsetX = s.width / 2, s.anchorOffsetY = s.height / 2; var r = function() { GameLayerManager.gameLayer().effectLayer.contains(s) && (GameLayerManager.gameLayer().effectLayer.removeChild(s), s = null) }; switch (n) { case 0: egret.Tween.get(s).to({ scaleX: 1.3, scaleY: 1.3 }, 200, egret.Ease.backIn).to({ scaleX: 1, scaleY: 1 }, 200, egret.Ease.backOut).to({ y: e - 200, alpha: 0 }, a).call(r, this) } }, e } (egret.EventDispatcher); __reflect(BloodTips.prototype, "BloodTips"); var core; ! function(t) { var e = function() { function t() { this.m_factorys = {} } return Object.defineProperty(t, "instance", { get: function() { return null == t.s_instance && (t.s_instance = new t), t.s_instance }, enumerable: !0, configurable: !0 }), t } (); t.DBFactory = e, __reflect(e.prototype, "core.DBFactory") } (core || (core = {})); var EffectUtils; ! function(t) { function e(t, e) { if (void 0 === e && (e = 1e3), null == this.rotationArr && (this.rotationArr = []), !this.rotationArr[t.hashCode]) { null != this.rotationArr[t.hashCode] && this.rotationArr[t.hashCode] || (this.rotationArr[t.hashCode] = !0); var i = function() { this.rotationArr[t.hashCode] && null != t && (t.rotation = 0, egret.Tween.get(t).to({ rotation: 360 }, e).call(i, this)) }; t.rotation = 0, egret.Tween.get(t).to({ rotation: 360 }, e).call(i, this) } } function i(t, e) { return new Promise(function(i, n) { egret.Tween.get(t).to({ alpha: 1 }, e).call(i) }) } function n(t) { null == this.rotationArr && (this.rotationArr = []), this.rotationArr[t.hashCode] = !1 } function a(t, e) { void 0 === e && (e = 1e3), new BitmapBlink(t, e) } function o(t) { var e = 80, i = t.x; egret.Tween.get(t).to({ x: t.x - 10 }, e), egret.setTimeout(function() { egret.Tween.get(t).to({ x: t.x + 20 }, e) }, this, 2 * e), egret.setTimeout(function() { egret.Tween.get(t).to({ x: t.x - 20 }, e) }, this, 3 * e), egret.setTimeout(function() { egret.Tween.get(t).to({ x: t.x + 20 }, e) }, this, 4 * e), egret.setTimeout(function() { egret.Tween.get(t).to({ x: i }, e) }, this, 5 * e) } function s(t) { void 0 === t && (t = 1); var e = GameConfig.curPanel, i = 40, n = e.x, a = e.y; 1 == t ? (egret.Tween.get(e).to({ x: e.x - 10 }, i), egret.setTimeout(function() { egret.Tween.get(e).to({ x: e.x + 20 }, i) }, this, 2 * i), egret.setTimeout(function() { egret.Tween.get(e).to({ x: e.x - 20 }, i) }, this, 3 * i), egret.setTimeout(function() { egret.Tween.get(e).to({ x: e.x + 20 }, i) }, this, 4 * i), egret.setTimeout(function() { egret.Tween.get(e).to({ x: n }, i) }, this, 5 * i)) : (egret.Tween.get(e).to({ x: e.x - 10, y: e.y }, i), egret.setTimeout(function() { egret.Tween.get(e).to({ x: e.x + 20, y: e.y }, i) }, this, 2 * i), egret.setTimeout(function() { egret.Tween.get(e).to({ x: e.x, y: e.y + 15 }, i) }, this, 3 * i), egret.setTimeout(function() { egret.Tween.get(e).to({ x: e.x, y: e.y - 20 }, i) }, this, 4 * i), egret.setTimeout(function() { egret.Tween.get(e).to({ x: e.x, y: e.y + 10 }, i) }, this, 5 * i), egret.setTimeout(function() { egret.Tween.get(e).to({ x: n, y: a }, i) }, this, 6 * i)) } function r(t, e, i) { switch (void 0 === t && (t = ""), void 0 === e && (e = 1), void 0 === i && (i = !1), e) { case 1: TipsUtils.showTipsDownToUp(t, i); break; case 2: TipsUtils.showTipsLeftOrRight(t, i, !0); break; case 3: TipsUtils.showTipsLeftOrRight(t, i, !1); break; case 4: TipsUtils.showTipsFromCenter(t, i); break; case 5: TipsUtils.showTipsBigToSmall(t, i) } } function h(t, e) { if (void 0 === e && (e = 1), !this.isPlayEffectPlay) { this.isPlayEffectPlay = !0; var i = function() { this.isPlayEffectPlay = !1 }, n = function() { 1 == e ? egret.Tween.get(t).to({ scaleX: 1, scaleY: 1 }, 500, egret.Ease.elasticOut).call(i, this) : 2 == e ? egret.Tween.get(t).to({ scaleX: 1, scaleY: 1, x: t.x - t.width / 4, y: t.y - t.height / 4 }, 500, egret.Ease.backOut).call(i, this) : 3 == e && egret.Tween.get(t).to({ scaleX: 1, scaleY: 1, x: t.x - t.width / 4, y: t.y - t.height / 4 }, 100).call(i, this) }; egret.Tween.get(t).to({ scaleX: .5, scaleY: .5 }, 100, egret.Ease.sineIn).call(n, this) } } function l(t) { var e = function() { if (null != t) { var i = function() { t.scaleX = 1, t.scaleY = 1, egret.Tween.get(t).to({ alpha: 1 }, 1e3).call(e, self) }; t.alpha = 1, egret.Tween.get(t).to({ scaleX: 1.5, scaleY: 1.5, alpha: 0 }, 1e3).call(i, self) } }; e() } function c(t, e, i) { void 0 === i && (i = 50); var n = function() { if (null != t) { var a = function() { egret.Tween.get(t).to({ y: t.y - i }, e).call(n, this) }; egret.Tween.get(t).to({ y: t.y + i }, e).call(a, this) } }; n() } function p(t, e, i) { void 0 === i && (i = 20); var n = function() { if (null != t) { var a = function() { egret.Tween.get(t).to({ rotation: -i }, e).call(n, this) }; egret.Tween.get(t).to({ rotation: i }, e).call(a, this) } }; n() } function u(t, e, i) { void 0 === e && (e = ""), void 0 === i && (i = 200); for (var n = e.split(""), a = n.length, o = 0; a > o; o++) egret.setTimeout(function() { t.appendText(n[Number(this)]) }, o, i * o) } t.rotationEffect = e, t.showAlphaEffect = i, t.removeRotationEffect = n, t.blinkEffect = a, t.shakeObj = o, t.shakeScreen = s, t.showTips = r; t.playEffect = h, t.playScaleEffect = l, t.flyObj = c, t.rockObj = p, t.typerEffect = u } (EffectUtils || (EffectUtils = {})); var FontUtils = function() { function t() {} return t.setColor = function(t, e) { return '' + t + "" }, t.setSize = function(t, e) { return '' + t + "" }, t.setColorSize = function(t, e, i) { return '' + t + "" }, t.html = function(t) { return (new egret.HtmlTextParser).parser(t) }, t } (); __reflect(FontUtils.prototype, "FontUtils"); var Global; ! function(t) { function e() { t.waitPanel = new WaitPanel(1), GameLayerManager.gameLayer().maskLayer.removeChildren(), GameLayerManager.gameLayer().maskLayer.addChild(t.waitPanel) } function i() { null != t.waitPanel && GameLayerManager.gameLayer().maskLayer.contains(t.waitPanel) && GameLayerManager.gameLayer().maskLayer.removeChild(t.waitPanel) } function n(t) { var e = new egret.HtmlTextParser; return e.parser(t) } function a(t) {} function o(t) { switch (t) { case 0: return "零"; case 1: return "一"; case 2: return "二"; case 3: return "三"; case 4: return "四"; case 5: return "五"; case 6: return "六"; case 7: return "七"; case 8: return "八"; case 9: return "九"; default: console.log("default case") } } t.showWaritPanel = e, t.hideWaritPanel = i, t.getTextFlow = n, t.getMessage = a, t.getNumber = o } (Global || (Global = {})); var game; ! function(t) { var e = function() { function t() {} return t.diamonds_recharge = "pay_list", t.init = "init", t.item_list = "item_list", t.farm_level = "farm_level", t.dog_level = "dog_level", t.lottery = "lottery", t.store_list = "store_list", t.common = "common", t.txt_list = "txt_list", t.land_extend = "land_extend", t.land_upgrade = "land_upgrade", t.player_level = "player_level", t.crop_list = "crop_list", t } (); t.TabelName = e, __reflect(e.prototype, "game.TabelName") } (game || (game = {})); var game; ! function(t) { var e = function() { function t() {} return t.getMc = function(t, e, i) { function n(e) { var i = RES.getRes(t + "_png"), n = RES.getRes(t + "_json"), a = new egret.MovieClipDataFactory(n, i), o = new egret.MovieClip(a.generateMovieClipData(e)); return o.fac = a, o.touchEnabled = !1, o } var a = this; void 0 === e && (e = null), void 0 === i && (i = ""); var o = RES.getRes(t + "_png"); if (o) { var s = n(i); return e && e(s), s } return RES.getResAsync(t + "_png", function() { RES.getResAsync(t + "_json", function() { e && e(n(i)) }, a) }, this), null }, t.changeAction = function(t, e) { var i = t.fac; t.movieClipData = i.generateMovieClipData(e) }, t } (); t.MCUtils = e, __reflect(e.prototype, "game.MCUtils") } (game || (game = {})); var game; ! function(t) { var e = function() { function t() {} return t.getMc = function(t, e, i) { function n(e) { var i = RES.getRes(t + "_tex_png"), n = RES.getRes(t + "_mc_json"), a = new egret.MovieClipDataFactory(n, i), o = new egret.MovieClip(a.generateMovieClipData(e)); return o.fac = a, o.touchEnabled = !1, o } var a = this; void 0 === e && (e = null), void 0 === i && (i = ""); var o = RES.getRes(t + "_tex_png"); if (o) { var s = n(i); return e && e(s), s } return RES.getResAsync(t + "_tex_png", function() { RES.getResAsync(t + "_mc_json", function() { e && e(n(i)) }, a) }, this), null }, t.changeAction = function(t, e) { var i = t.fac; t.movieClipData = i.generateMovieClipData(e) }, t } (); t.MCUtils1 = e, __reflect(e.prototype, "game.MCUtils1") } (game || (game = {})); var Mta; ! function(t) { function e(t, e) { var i = window.MtaH5; i && i.clickStat(t, e) } function i() { var t = window.MtaH5; return t } t.clickStar2 = e, t.getMathH5 = i } (Mta || (Mta = {})); var MYUtils = function() { function t() {} return t.setAnchorCenter = function(t) { t.anchorOffsetX = t.width / 2, t.anchorOffsetY = t.height / 2 }, t.distance = function(t, e) { return Math.sqrt(Math.pow(t.x - e.x, 2) + Math.pow(t.y - e.y, 2)) }, t.lineIntersectSide = function(t, e, i, n) { var a = (i.y - t.y) * (t.x - e.x) - (i.x - t.x) * (t.y - e.y), o = (n.y - t.y) * (t.x - e.x) - (n.x - t.x) * (t.y - e.y); return a * o > 0 ? !1 : !0 }, t.sideIntersectSide = function(e, i, n, a) { return t.lineIntersectSide(e, i, n, a) && t.lineIntersectSide(n, a, e, i) ? !0 : !1 }, t.getAngleBySide = function(t, e) { return Math.atan(t / e) * (180 / Math.PI) }, t.setRichText = function(t, e) { if (t) if (e) { var i = new egret.HtmlTextParser; t.textFlow = i.parse(e) } else t.text = e }, t.hitTest = function(t, e) { if (null != t.getBounds && null != e.getBounds) { var i = t.getBounds(), n = e.getBounds(); return i.x = t.x, i.y = t.y, n.x = e.x, n.y = e.y, i.intersects(n) } }, t.checkLength = function(t) { var e = new egret.ByteArray; return e.writeUTF(t), e.length }, t.pointAmongAngle = function(t, e, i, n) { var a = i - t, o = n - e, s = 0; return 0 == a && 0 == o ? 0 : (a >= 0 && o >= 0 ? s = 180 * Math.atan(o / a) / Math.PI: 0 >= a && o >= 0 ? s = 180 * Math.atan(Math.abs(a) / o) / Math.PI + 90 : 0 >= a && 0 >= o ? s = 180 * Math.atan(Math.abs(o) / Math.abs(a)) / Math.PI + 180 : a >= 0 && 0 >= o && (s = 180 * Math.atan(a / Math.abs(o)) / Math.PI + 270), s) }, t.arrToArr2 = function(t, e) { var i = []; if (t) for (var n = void 0, a = 0, o = t.length; o > a; a++) a % e === 0 && (n = [], i.push(n)), n.push(t[a]); return i }, t } (); __reflect(MYUtils.prototype, "MYUtils"); var NativeApi; ! function(t) { function e(t, e) { egret.localStorage.setItem(t, e) } function i(t) { return egret.localStorage.getItem(t) } function n(t) { egret.localStorage.removeItem(t) } function a() { egret.localStorage.clear() } function o() {} function s() {} function r(t) { window.open("tel:" + t, "_self") } function h(t) { window.open("sms:" + t, "_self") } function l() { return window.location.href } t.setLocalData = e, t.getLocalData = i, t.deleteLocalData = n, t.clearLocalData = a, t.getMic = o, t.getScreen = s, t.callPhone = r, t.sendMessage = h, t.getCurUrl = l, t.curAngle = Number(window.orientation) } (NativeApi || (NativeApi = {})); var QRCode = function() { function t(t) { var e = document.getElementById("gameDiv"); this.htmlCode = document.createElement("img"), this.htmlCode.src = t, this.htmlCode.style.position = "absolute", this.htmlCode.style.display = "none", e.appendChild(this.htmlCode) } return t.prototype.showHtmlCode = function() { this.htmlCode && (this.htmlCode.style.display = "inline") }, t.prototype.hideHtmlCode = function() { this.htmlCode && (this.htmlCode.style.display = "none") }, t.prototype.setPosition = function(t, e, i, n) { if (null != this.htmlCode) if (document.body.clientWidth < document.body.clientHeight) { var a = document.body.clientWidth / GameConfig.curWidth(), o = document.body.clientHeight / GameConfig.curHeight(); this.htmlCode.style.width = i * a + "px", this.htmlCode.style.height = n * o + "px", this.htmlCode.style.left = t * a + "px", this.htmlCode.style.top = e * o + "px" } else { var a = document.body.clientWidth / GameConfig.curHeight(), o = document.body.clientHeight / GameConfig.curWidth(); this.htmlCode.style.width = n * a + "px", this.htmlCode.style.height = i * o + "px", this.htmlCode.style.top = (GameConfig.curWidth() - t - i) * o + "px", this.htmlCode.style.left = e * a + "px" } }, t.prototype.destroy = function() { this.htmlCode && (this.htmlCode.parentNode.removeChild(this.htmlCode), this.htmlCode = null) }, t } (); __reflect(QRCode.prototype, "QRCode"); var RegUtils; ! function(t) { function e(t) { var e = /^[\w-]+(\.[\w-]+)*@[\w-]+(\.[\w-]+)+$/; return e.test(t) ? !0 : !1 } function i(t) { if (o(t)) return ! 1; var e = /^(\d+)\.(\d+)\.(\d+)\.(\d+)$/g; return e.test(t) && Number(RegExp.$1) < 256 && Number(RegExp.$2) < 256 && Number(RegExp.$3) < 256 && Number(RegExp.$4) < 256 ? !0 : !1 } function n(t) { var e = /^(((13[0-9]{1})|(15[0-9]{1})|(17[0-9]{1})|(18[0-9]{1}))+\d{8})$/; return e.test(t) ? !0 : !1 } function a(t) { var e = /^[0][1-9]{2,3}-[0-9]{5,10}$/, i = /^[1-9]{1}[0-9]{5,8}$/; return t.length > 9 ? e.test(t) ? !0 : !1 : i.test(t) ? !0 : !1 } function o(t) { if ("" == t) return ! 0; var e = "^[ ]+$", i = new RegExp(e); return i.test(t) } function s(t) { var e = /^[-]{0,1}[0-9]{1,}$/; return e.test(t) } function r(t) { var e = "^[0-9]+$", i = new RegExp(e); return - 1 != t.search(i) ? !0 : !1 } function h(t) { var e = "^[0-9]+[.][0-9]{0,3}$", i = new RegExp(e); return i.test(t) ? !0 : !1 } function l(t) { if (o(t)) return ! 1; var e = /^[\u4E00-\u9FA5]{2,4}$/; return e.test(t) } function c(t) { var e = /^[\u4E00-\u9FA5]/; return e.test(t) } function p(t, e) { var i = " ", n = -1; if (0 == e || 1 == e) { for (; " " == i;)++n, i = t.substr(n, 1); t = t.substring(n) } if (0 == e || 2 == e) { for (i = " ", n = t.length; " " == i;)--n, i = t.substr(n, 1); t = t.substring(0, n + 1) } return t } function u(t) { var e = /^[a-z0-9]+$/; return e.test(t) } function d(t) { var e = /^[a-z]+$/; return e.test(t) } function g(t) { var e = /^[0-9]+$/; return e.test(t) } t.checkEmail = e, t.isIP = i, t.checkMobile = n, t.checkPhone = a, t.isNull = o, t.isInteger = s, t.isNumber = r, t.isMoney = h, t.isRealName = l, t.checkIsChinese = c, t.cTrim = p, t.isAccount = u, t.isAccountaz = d, t.isAccount09 = g } (RegUtils || (RegUtils = {})); var TimeFormat = function() { function t() {} return t.showDDHH = function(t) { var e = Math.floor(t / 864e5); t %= 864e5; var i = Math.floor(t / 36e5); return 0 > e ? i + "小时": e + "天" + i + "小时" }, t.showHHMMSS = function(t) { var e = Math.floor(t / 36e5); t %= 36e5; var i = Math.floor(t / 6e4); t %= 6e4; var n = Math.floor(t / 1e3); return (10 > e ? "0" + e: e) + ":" + (10 > i ? "0" + i: i) + ":" + (10 > n ? "0" + n: n) }, t.showDayOrDate = function(t) { var e = new Date(DateTimer.instance.now), i = new Date(1e3 * t), n = (e.getDate(), i.getDate()), a = (DateTimer.instance.now - t, i.getHours()), o = i.getMinutes(), s = i.getSeconds(), r = "", h = i.getFullYear(), l = i.getMonth() + 1; return r = h + "-" + l + "-" + n + " " + (10 > a ? "0" + a: a) + ":" + (10 > o ? "0" + o: o) + ":" + (10 > s ? "0" + s: s) }, t } (); __reflect(TimeFormat.prototype, "TimeFormat"); var TimerUtils = function() { function t() { this.lastMonthDate.setDate(1), this.lastMonthDate.setMonth(this.lastMonthDate.getMonth() - 1) } return t.prototype.init = function() { this.now = new Date(DateTimer.instance.now), this.nowDayOfWeek = this.now.getDay(), this.nowDay = this.now.getDate(), this.nowMonth = this.now.getMonth(), this.nowYear = this.now.getFullYear(), this.nowYear += this.nowYear < 2e3 ? 1900 : 0, this.lastMonthDate = new Date, this.lastYear = this.lastMonthDate.getFullYear(), this.lastMonth = this.lastMonthDate.getMonth() }, t.getInstance = function() { return this._instance || (this._instance = new t), this._instance }, t.prototype.formatDate = function(t) { var e = t.getFullYear(), i = t.getMonth() + 1, n = t.getDate(); return 10 > i && (i = "0" + i), 10 > n && (n = "0" + n), e + "-" + i + "-" + n }, t.prototype.getMonthDays = function(t) { var e = new Date(this.nowYear, t, 1), i = new Date(this.nowYear, t + 1, 1), n = (i - e) / 864e5; return n }, t.prototype.getQuarterStartMonth = function() { var t = 0; return this.nowMonth < 3 && (t = 0), 2 < this.nowMonth && this.nowMonth < 6 && (t = 3), 5 < this.nowMonth && this.nowMonth < 9 && (t = 6), this.nowMonth > 8 && (t = 9), t }, t.prototype.getWeekStartDate = function() { var t = new Date(this.nowYear, this.nowMonth, this.nowDay - this.nowDayOfWeek); return this.formatDate(t) }, t.prototype.getWeekEndDate = function() { this.init(); var t = new Date(this.nowYear, this.nowMonth, this.nowDay + (6 - this.nowDayOfWeek), 24); return t }, t.prototype.getMonthStartDate = function() { var t = new Date(this.nowYear, this.nowMonth, 1); return this.formatDate(t) }, t.prototype.getMonthEndDate = function() { var t = new Date(this.nowYear, this.nowMonth, this.getMonthDays(this.nowMonth)); return this.formatDate(t) }, t.prototype.getLastMonthStartDate = function() { var t = new Date(this.nowYear, this.lastMonth, 1); return this.formatDate(t) }, t.prototype.getLastMonthEndDate = function() { var t = new Date(this.nowYear, this.lastMonth, this.getMonthDays(this.lastMonth)); return this.formatDate(t) }, t.prototype.getQuarterStartDate = function() { var t = new Date(this.nowYear, this.getQuarterStartMonth(), 1); return this.formatDate(t) }, t.prototype.getQuarterEndDate = function() { var t = this.getQuarterStartMonth() + 2, e = new Date(this.nowYear, t, this.getMonthDays(t)); return this.formatDate(e) }, t } (); __reflect(TimerUtils.prototype, "TimerUtils"); var TipsManager; ! function(t) { function e(t, e, i) { void 0 === e && (e = ""), void 0 === i && (i = 0), null == this._dict && (this._dict = []), t.addEventListener(egret.TouchEvent.TOUCH_BEGIN, this.showTips, this), t.addEventListener(egret.TouchEvent.TOUCH_END, this.removeTips, this), t.addEventListener(egret.TouchEvent.TOUCH_RELEASE_OUTSIDE, this.removeTips, this), null == this._dict[t.hashCode] && (this._dict[t.hashCode] = [], this._dict[t.hashCode].descStr = e, this._dict[t.hashCode].effectType = i) } function i(t) { var e = t.currentTarget, i = "", n = 0; if (null == this._tips) { null != this._dict[e.hashCode] && (i = this._dict[e.hashCode].descStr, n = this._dict[e.hashCode].effectType), this._tips = new TipsPanel(this._dict[e.hashCode].descStr), GameLayerManager.gameLayer().effectLayer.contains(this._tips) || GameLayerManager.gameLayer().effectLayer.addChild(this._tips); var a = e.parent.localToGlobal(e.x, e.y); switch (a.x = a.x + e.width / 2, a.y = a.y - this._tips.getHeight(), a.x + this._tips.getWidth() > GameConfig.curWidth() ? a.x = GameConfig.curWidth() - this._tips.getWidth() : a.x < 0 && (a.x = 0), a.y + this._tips.getHeight() > GameConfig.curHeight() ? a.y = GameConfig.curHeight() - this._tips.getHeight() : a.y < 0 && (a.y = 0), this._tips.x = a.x, this._tips.y = a.y, n) { case 0: this._tips.alpha = 0, egret.Tween.get(this._tips).to({ alpha: 1 }, 300); break; case 1: this._tips.alpha = 0, this._tips.y += this._tips.getHeight(), egret.Tween.get(this._tips).to({ alpha: 1, y: this._tips.y - this._tips.getHeight() }, 500, egret.Ease.backOut); break; case 2: this._tips.alpha = 0, this._tips.x -= this._tips.getWidth(), egret.Tween.get(this._tips).to({ alpha: 1, x: this._tips.x + this._tips.getWidth() }, 500, egret.Ease.backOut); break; case 3: this._tips.alpha = 0, this._tips.x += this._tips.getWidth(), egret.Tween.get(this._tips).to({ alpha: 1, x: this._tips.x - this._tips.getWidth() }, 500, egret.Ease.backOut) } } } function n(t) { t.currentTarget; if (null != this._tips) { var e = function() { GameLayerManager.gameLayer().effectLayer.contains(this._tips) && (GameLayerManager.gameLayer().effectLayer.removeChild(this._tips), this._tips = null) }; egret.Tween.get(this._tips).to({ alpha: 0 }, 300).call(e, this) } } t.addTips = e, t.showTips = i, t.removeTips = n } (TipsManager || (TipsManager = {})); var TipsPanel = function(t) { function e(e) { void 0 === e && (e = ""); var i = t.call(this) || this; return i.descStr = "", i.descStr = e, i.initUI(), i } return __extends(e, t), e.prototype.initUI = function() { this.bg = new egret.Bitmap, this.bg.texture = RES.getRes("tipsBg_png"), this.addChild(this.bg), this.bg.touchEnabled = !0, this.descTF = new egret.TextField, this.addChild(this.descTF), this.descTF.textColor = 0, this.descTF.size = 20, this.descTF.x = 5, this.descTF.textAlign = "center", this.descTF.text = this.descStr; var t = new egret.Rectangle(5, 5, 5, 5); this.bg.scale9Grid = t, this.bg.width = this.descTF.width + 10, this.bg.height = 3 * this.descTF.height, this.descTF.y = this.bg.height / 2 - this.descTF.height / 2 + 2 }, e.prototype.getHeight = function() { return this.bg.height }, e.prototype.getWidth = function() { return this.bg.width }, e } (eui.Component); __reflect(TipsPanel.prototype, "TipsPanel"); var game; ! function(t) { var e = function() { function t() {} return t.removeFromParent = function(t) { t && t.parent && t.parent.removeChild(t) }, t.resetAnchorPoint = function(t) { t.x -= t.anchorOffsetX, t.y -= t.anchorOffsetY, t.anchorOffsetX = 0, t.anchorOffsetY = 0 }, t.addButtonScaleEffects = function(e, i) { if (void 0 === i && (i = !1), e) if (i) e.addEventListener(egret.TouchEvent.TOUCH_BEGIN, t.onButtonTouchBegan, e); else if (egret.is(e, egret.getQualifiedClassName(eui.Button))) e.addEventListener(egret.TouchEvent.TOUCH_BEGIN, t.onButtonTouchBegan, e); else for (var n = e.numChildren, a = 0; n > a; a++) { var o = e.getChildAt(a); t.addButtonScaleEffects(o) } }, t.onButtonTouchBegan = function(t) { var e = t.target; egret.Tween.get(e).to({ scaleX: .9, scaleY: .9 }, 50).to({ scaleX: 1, scaleY: 1 }, 50) }, t.removeButtonScaleEffects = function(e, i) { if (void 0 === i && (i = !1), e) if (i) e.removeEventListener(egret.TouchEvent.TOUCH_BEGIN, t.onButtonTouchBegan, e); else if (egret.is(e, egret.getQualifiedClassName(eui.Button))) e.removeEventListener(egret.TouchEvent.TOUCH_BEGIN, t.onButtonTouchBegan, e); else for (var n = e.numChildren, a = 0; n > a; a++) { var o = e.getChildAt(a); t.removeButtonScaleEffects(o) } }, t.setAnchorPot = function(t) { t.anchorOffsetX = t.width / 2, t.anchorOffsetY = t.height / 2, t.x += t.width / 2, t.y += t.height / 2 }, t.removeSelf = function(e) { t.removeFromParent(e) }, t.removeSelfByAmi = function(e, i) { return new Promise(function(n, a) { egret.Tween.get(e).to({ alpha: 0 }, i).call(function() { t.removeFromParent(e), n("success") }, e) }) }, t.getParentByClass = function(e, i) { var n = e.parent; return n ? n instanceof i ? n: t.getParentByClass(n, i) : null }, t.addShortTouch = function(e, i, n) { e.shortTouchCallback = i, e.shortTouchEndCallback = n, e.addEventListener(egret.TouchEvent.TOUCH_BEGIN, t._onShortTouchBegan, e) }, t._onShortTouchBegan = function(e) { var i = e.currentTarget; i.shortTouchCallback && i.shortTouchCallback(e), Const.stage.once(egret.TouchEvent.TOUCH_END, t._onShortTouchEnd, this, !0, Number.MAX_VALUE) }, t._onShortTouchEnd = function(t) { t.stopImmediatePropagation(), t.stopPropagation(); var e = this; e.shortTouchEndCallback && e.shortTouchEndCallback(t) }, t.addLongTouch = function(e, i, n) { e.longTouchCallback = i, e.longTouchEndCallback = n, e.longTouchTrigger = !1, e.addEventListener(egret.TouchEvent.TOUCH_BEGIN, t._onLongTouchBegan, e) }, t._onLongTouchBegan = function(e) { var i = this, n = e.currentTarget; Const.stage.once(egret.TouchEvent.TOUCH_END, t._onLongTouchEnd, this, !0, Number.MAX_VALUE), egret.clearTimeout(t.longTouchDelayId), t.longTouchDelayId = egret.setTimeout(function() { n.longTouchTrigger = !0, n.longTouchCallback && n.longTouchCallback(e), n.once(egret.TouchEvent.TOUCH_TAP, t._stopTapEvent, i, !0, Number.MAX_VALUE) }, this, 350) }, t._stopTapEvent = function(t) { t.stopImmediatePropagation(), t.stopPropagation() }, t._onLongTouchEnd = function(e) { e.stopImmediatePropagation(), e.stopPropagation(); var i = this; i.longTouchTrigger ? i.longTouchEndCallback && i.longTouchEndCallback(e) : egret.clearTimeout(t.longTouchDelayId), i.longTouchTrigger = !1 }, t.removeLongTouch = function(e) { e.removeEventListener(egret.TouchEvent.TOUCH_BEGIN, t._onLongTouchBegan, e) }, t.showTimeFormat = function(t) { t = parseInt(t / 1e3 + ""); var e = parseInt(t / 86400 + ""); t %= 86400; var i = parseInt(t / 3600 + ""); t %= 3600; var n = parseInt(t / 60 + ""); t %= 60; var a = parseInt(t + ""); return 0 >= e && 0 >= i && 0 >= n ? a + "秒": 0 >= e && 0 >= i ? n + "分" + (a > 9 ? a: "0" + a) + "秒": 0 >= e ? i + "时" + (n > 0 ? n: "0" + n) + "分" + (a > 9 ? a: "0" + a) + "秒": e + "天" + (i > 0 ? i: "0" + i) + "时" + (n > 0 ? n: "0" + n) + "分" + (a > 9 ? a: "0" + a) + "秒" }, t } (); t.UIUtils = e, __reflect(e.prototype, "game.UIUtils") } (game || (game = {})); var game; ! function(t) { var e = function() { function t() {} return t.rang = function(t, e) { return Math.round(Math.random() * (e - t) + t) }, t.isRang = function(t, e, i) { return t >= e && i >= t }, t.limit = function(t, e, i) { return Math.max(e, Math.min(i, t)) }, t.ang2rad = function(t) { return t / 180 * Math.PI }, t.rad2ang = function(t) { return t / Math.PI * 180 }, t.getBigNumberShow = function(t) { return 1e4 > t ? t + "": (t /= 1e3, t.toFixed(1) + "K") }, t.isElinArr = function(t, e) { return e.indexOf(t) > -1 }, t.isArrCrossing = function(e, i) { for (var n = 0; n < e.length; n++) if (t.isElinArr(e[n], i)) return ! 0; return ! 1 }, t.getURLQueryString = function(t) { if (egret.Capabilities.runtimeType == egret.RuntimeType.WEB) { var e = decodeURIComponent(window.location.href); e = e.replace(/"/g, '"'); var i; return e.indexOf("#?") > 0 ? (e = e.replace("#?", "&"), i = e.match(new RegExp("(^|&)" + t + "=([^&]*)(&|$)"))) : i = window.location.search.substr(1).match(new RegExp("(^|&)" + t + "=([^&]*)(&|$)")), i ? i[2] : null } }, t.getMaxStr = function(t) { return t.length <= 5 ? t: t.substr(0, 5) + "..." }, t.removeArrayItem = function(t, e) { var i = t.indexOf(e); i > -1 && t.splice(i, 1) }, t.mtaChainSdk = function(t) { var e = window.MtaH5; if (e && e.clickStat) { var i = {}; i[t.toLocaleLowerCase()] = "true", e.clickStat("yemianshendu", i) } }, t.isCollsionRect2 = function(t, e, i, n, a, o, s, r) { return t >= a && t >= a + s || a >= t && a >= t + i || e >= o && e >= o + r || o >= e && o >= e + n ? !1 : !0 }, t.rect1CollsionRect2 = function(e, i) { return t.isCollsionRect2(e.x, e.y, e.width, e.height, i.x, i.y, i.width, i.height) }, t.showTimeFormat = function(t) { t = parseInt(t / 1e3 + ""); var e = parseInt(t / 86400 + ""); t %= 86400; var i = parseInt(t / 3600 + ""); t %= 3600; var n = parseInt(t / 60 + ""); t %= 60; var a = parseInt(t + ""); return 0 >= e && 0 >= i && 0 >= n ? a + "秒": 0 >= e && 0 >= i ? n + "分" + (a > 9 ? a: "0" + a) + "秒": 0 >= e ? i + "时" + (n > 0 ? n: "0" + n) + "分" + (a > 9 ? a: "0" + a) + "秒": e + "天" + (i > 0 ? i: "0" + i) + "时" + (n > 0 ? n: "0" + n) + "分" + (a > 9 ? a: "0" + a) + "秒" }, t.BigNumTostring = function(e) { var i = e.toString(); return e >= t.MAXK && e < t.MAXM ? i = (e / 1e3).toFixed(2) + "K": e >= 1e6 && (i = (e / t.MAXM).toFixed(2) + "M"), i.toString() }, t.formatDate = function(t) { var e = t.getFullYear(), i = t.getMonth() + 1, n = t.getDate(), a = t.getHours(), o = t.getMinutes(), s = t.getSeconds(); return 10 > i && (i = "0" + i), 10 > n && (n = "0" + n), e + "-" + i + "-" + n + " " + a + ":" + o + ":" + s }, t.MAXK = 1e5, t.MAXM = 1e6, t } (); t.Utils = e, __reflect(e.prototype, "game.Utils") } (game || (game = {})); var WebView = function(t) { function e(e) { var i = t.call(this) || this; i._x = 0, i._y = 0, i._width = 0, i._height = 0, i._src = "", i._scaleMode = egret.MainContext.instance.stage.scaleMode, i._iframeWrapper = null, i._iframe = null; var n = document.getElementById("StageDelegateDiv"), a = n.parentElement, o = document.getElementById("iframe-wrapper"); o || (o = document.createElement("div"), o.style.display = "none", o.id = "iframe-wrapper", n.appendChild(o)), i._iframeWrapper = o, i._iframeWrapper.style.display = "none", i._iframeWrapper.style.opacity = "0"; var s = (Date.now(), document.createElement("iframe")), r = (new Date).getTime(); s.src = e, s.id = "webview-iframe-" + r, s.name = "webview-iframe-" + r, s.style.position = "absolute", s.style.top = "0", s.style.left = "0", s.style.opacity = "0", s.style.display = "none", s.frameBorder = "0", s.border = "0", i._iframeWrapper.appendChild(s), i._iframe = document.getElementById("webview-iframe-" + r); var h = i; i._iframe.onload = function() { h._iframeWrapper.style.opacity = "1", h._iframe.style.opacity = "1" }, i._stageW = egret.MainContext.instance.stage.stageWidth, i._stageH = egret.MainContext.instance.stage.stageHeight, i._windowW = window.innerWidth, i._windowH = window.innerHeight, i._designH = parseInt(a.attributes["data-content-height"].value), i._designW = parseInt(a.attributes["data-content-width"].value); var l = egret.sys.screenAdapter.calculateStageSize(egret.MainContext.instance.stage.scaleMode, i._windowW, i._windowH, i._designW, i._designH); return i._displayH = l.displayHeight, i._displayW = l.displayWidth, i } return __extends(e, t), e.prototype.show = function() { this._iframe.style.display = "block", this._iframeWrapper.style.display = "block" }, e.prototype.destroy = function() { this._iframe && (this._iframeWrapper.style.display = "none", this._iframeWrapper.removeChild(this._iframe)) }, Object.defineProperty(e.prototype, "width", { get: function() { return this._width }, set: function(t) { this._width = t, (this._scaleMode == egret.StageScaleMode.FIXED_WIDTH || this._scaleMode == egret.StageScaleMode.FIXED_HEIGHT) && (this._iframe.width = this._width / this._stageW * this._windowW + "px", this._iframeWrapper.style.width = this._width / this._stageW * this._windowW + "px"), (this._scaleMode == egret.StageScaleMode.SHOW_ALL || this._scaleMode == egret.StageScaleMode.NO_BORDER) && (this._windowW == this._displayW ? (this._iframe.style.width = this._width / this._stageW * this._windowW + "px", this._iframeWrapper.style.width = this._width / this._stageW * this._windowW + "px") : (this._iframe.style.width = this._width / this._stageW * this._displayW + "px", this._iframeWrapper.style.width = this._width / this._stageW * this._displayW + "px")) }, enumerable: !0, configurable: !0 }), Object.defineProperty(e.prototype, "height", { get: function() { return this._height }, set: function(t) { this._height = t, (this._scaleMode == egret.StageScaleMode.FIXED_WIDTH || this._scaleMode == egret.StageScaleMode.FIXED_HEIGHT) && (this._iframe.height = this._height / this._stageH * this._windowH + "px", this._iframeWrapper.style.height = this._height / this._stageH * this._windowH + "px"), (this._scaleMode == egret.StageScaleMode.SHOW_ALL || this._scaleMode == egret.StageScaleMode.NO_BORDER) && (this._windowH == this._displayH ? (this._iframe.style.height = this._height / this._stageH * this._windowH + "px", this._iframeWrapper.style.height = this._height / this._stageH * this._windowH + "px") : (this._iframe.style.height = this._height / this._stageH * this._displayH + "px", this._iframeWrapper.style.height = this._height / this._stageH * this._displayH + "px")) }, enumerable: !0, configurable: !0 }), Object.defineProperty(e.prototype, "x", { get: function() { return this._x }, set: function(t) { this._x = t, (this._scaleMode == egret.StageScaleMode.FIXED_WIDTH || this._scaleMode == egret.StageScaleMode.FIXED_HEIGHT) && (this._iframeWrapper.style.left = this._x / this._stageW * this._windowW + "px"), (this._scaleMode == egret.StageScaleMode.SHOW_ALL || this._scaleMode == egret.StageScaleMode.NO_BORDER) && (this._windowW == this._displayW ? this._iframeWrapper.style.left = this._x / this._stageW * this._windowW + "px": this._iframeWrapper.style.left = this._x / this._stageW * this._displayW + "px") }, enumerable: !0, configurable: !0 }), Object.defineProperty(e.prototype, "y", { get: function() { return this._y }, set: function(t) { this._y = t, (this._scaleMode == egret.StageScaleMode.FIXED_WIDTH || this._scaleMode == egret.StageScaleMode.FIXED_HEIGHT) && (this._iframeWrapper.style.top = this._y / this._stageH * this._windowH + "px"), (this._scaleMode == egret.StageScaleMode.SHOW_ALL || this._scaleMode == egret.StageScaleMode.NO_BORDER) && (this._windowH == this._displayH ? this._iframeWrapper.style.top = this._y / this._stageH * this._windowH + "px": this._iframeWrapper.style.top = this._y / this._stageH * this._displayH + "px") }, enumerable: !0, configurable: !0 }), Object.defineProperty(e.prototype, "src", { get: function() { return this._src }, set: function(t) { this._src = t }, enumerable: !0, configurable: !0 }), e } (egret.DisplayObjectContainer); __reflect(WebView.prototype, "WebView"); var game; ! function(t) { var e = function() { function t(t, e, i, n, a, o) { void 0 === a && (a = !1), void 0 === o && (o = !1), this.isFlip = !1, this.isBackFlip = !1, this.time = 0, this.point = t, this.forwardName = e, this.backName = i, this.time = n, this.isFlip = a, this.isBackFlip = o } return t } (); t.AnimateNode = e, __reflect(e.prototype, "game.AnimateNode") } (game || (game = {})); var game; ! function(t) { var e = function() { function t(t) { for (var e = [], i = 1; i < arguments.length; i++) e[i - 1] = arguments[i]; if (this.isForward = !0, this.animIndex = 0, this.animLen = 2, this.target = t, e.length > 0) if (1 == e.length && e[0] instanceof Array) this.animNodeList = e[0]; else { this.animNodeList = []; for (var n = 0; n < e.length; n++) this.animNodeList.push(e[n]) } if (!this.animNodeList || this.animNodeList.length < 2) throw new Error("动画必须2个点以上"); this.init() } return t.prototype.init = function() { this.animLen = this.animNodeList.length, this.animIndex = 0; var t = this.animNodeList[0]; this.target.x = t.point.x, this.target.y = t.point.y, this.target.gotoAndPlay(t.forwardName, -1) }, t.prototype.loopRun = function() { this.loop() }, t.prototype.loop = function() { var t, e, i, n, a = this.animNodeList[this.animIndex]; this.isForward ? (t = this.animNodeList[++this.animIndex], e = t.point, i = a.time, n = a.forwardName, this.animIndex >= this.animLen - 1 && (this.isForward = !1), a.isFlip ? this.target.scaleX = -1 : this.target.scaleX = 1) : (t = this.animNodeList[--this.animIndex], e = t.point, i = t.time, n = t.backName, this.animIndex <= 0 && (this.isForward = !0), t.isBackFlip ? this.target.scaleX = -1 : this.target.scaleX = 1), this.target.gotoAndPlay(n, -1), egret.Tween.get(this.target).to({ x: e.x, y: e.y }, i).call(this.loop, this) }, t } (); t.Animator = e, __reflect(e.prototype, "game.Animator") } (game || (game = {})); var BitmapBlink = function(t) { function e(e, i, n) { void 0 === n && (n = !0); var a = t.call(this) || this; return a._target = e, a._time = i, n && a.start(), a } return __extends(e, t), e.prototype.start = function() { this._currTime = egret.getTimer(), this._target.addEventListener(egret.Event.ENTER_FRAME, this.runDown, this) }, e.prototype.runDown = function(t) { this._target.alpha -= .045, this.checkOver() || this._target.alpha <= .6 && (this._target.removeEventListener(egret.Event.ENTER_FRAME, this.runDown, this), this._target.addEventListener(egret.Event.ENTER_FRAME, this.runUp, this)) }, e.prototype.runUp = function(t) { this._target.alpha += .045, this.checkOver() || this._target.alpha >= 1 && (this._target.removeEventListener(egret.Event.ENTER_FRAME, this.runUp, this), this._target.addEventListener(egret.Event.ENTER_FRAME, this.runDown, this)) }, e.prototype.checkOver = function() { var t = egret.getTimer(); return t - this._currTime >= this._time ? (this.destroy(), !0) : !1 }, e.prototype.destroy = function() { this._target.alpha = 1, this._target.removeEventListener(egret.Event.ENTER_FRAME, this.runDown, this), this._target.removeEventListener(egret.Event.ENTER_FRAME, this.runUp, this), this.dispatchEventWith(egret.Event.COMPLETE, !1, this._target), this._target = null }, e } (egret.EventDispatcher); __reflect(BitmapBlink.prototype, "BitmapBlink"); var TipsUtils; ! function(t) { function e(t, e) { return void 0 === t && (t = ""), void 0 === e && (e = !1), void game.ToastTip.popTip(t) } function i(t, e, i) { void 0 === t && (t = ""), void 0 === e && (e = !1), void 0 === i && (i = !0); var n = new egret.TextField; n.size = 24, n.y = GameConfig.curHeight() / 2, e ? n.textColor = GameConfig.TextColors.red: n.textColor = GameConfig.TextColors.green, n.alpha = 0, n.text = t, n.strokeColor = 0, i ? n.x = -n.width: n.x = GameConfig.curWidth(), n.stroke = 2, n.bold = !0, n.textAlign = egret.HorizontalAlign.CENTER, GameLayerManager.gameLayer().effectLayer.contains(n) || GameLayerManager.gameLayer().effectLayer.addChild(n), i ? egret.Tween.get(n).to({ x: GameConfig.curWidth() / 2 - n.width / 2 - 50, alpha: 1 }, 300, egret.Ease.sineInOut) : egret.Tween.get(n).to({ x: GameConfig.curWidth() / 2 - n.width / 2 + 50, alpha: 1 }, 300, egret.Ease.sineInOut), egret.setTimeout(function() { i ? egret.Tween.get(n).to({ x: n.x + 100 }, 500) : egret.Tween.get(n).to({ x: n.x - 100 }, 500) }, this, 300), egret.setTimeout(function() { i ? egret.Tween.get(n).to({ x: GameConfig.curWidth() }, 300, egret.Ease.sineIn) : egret.Tween.get(n).to({ x: -n.width }, 300, egret.Ease.sineIn) }, this, 800), egret.setTimeout(function() { GameLayerManager.gameLayer().effectLayer.contains(n) && (GameLayerManager.gameLayer().effectLayer.removeChild(n), n = null) }, this, 1100) } function n(t, e) { void 0 === t && (t = ""), void 0 === e && (e = !1); var i = new egret.TextField; i.size = 24, i.y = GameConfig.curHeight() / 2, e ? i.textColor = GameConfig.TextColors.red: i.textColor = GameConfig.TextColors.green, i.alpha = 0, i.text = t, i.strokeColor = 0, i.x = GameConfig.curWidth() / 2, i.stroke = 2, i.bold = !0, i.textAlign = egret.HorizontalAlign.CENTER, GameLayerManager.gameLayer().effectLayer.contains(i) || GameLayerManager.gameLayer().effectLayer.addChild(i), i.anchorOffsetX = i.width / 2, i.anchorOffsetY = i.height / 2, i.scaleX = 0, i.scaleY = 0; var n = function() { GameLayerManager.gameLayer().effectLayer.contains(i) && (GameLayerManager.gameLayer().effectLayer.removeChild(i), i = null) }; egret.Tween.get(i).to({ scaleX: 1, scaleY: 1, alpha: 1 }, 200), egret.setTimeout(function() { egret.Tween.get(i).to({ alpha: 0 }, 500).call(n, this) }, this, 1e3) } function a(t, e) { void 0 === t && (t = ""), void 0 === e && (e = !1); var i = new egret.TextField; i.size = 24, i.y = GameConfig.curHeight() / 2, e ? i.textColor = GameConfig.TextColors.red: i.textColor = GameConfig.TextColors.green, i.alpha = 0, i.text = t, i.strokeColor = 0, i.x = GameConfig.curWidth() / 2, i.stroke = 2, i.bold = !0, i.textAlign = egret.HorizontalAlign.CENTER, GameLayerManager.gameLayer().effectLayer.contains(i) || GameLayerManager.gameLayer().effectLayer.addChild(i), i.anchorOffsetX = i.width / 2, i.anchorOffsetY = i.height / 2, i.scaleX = 4, i.scaleY = 4; var n = function() { GameLayerManager.gameLayer().effectLayer.contains(i) && (GameLayerManager.gameLayer().effectLayer.removeChild(i), i = null) }; egret.Tween.get(i).to({ scaleX: 1, scaleY: 1, alpha: 1 }, 200), egret.setTimeout(function() { egret.Tween.get(i).to({ alpha: 0 }, 500).call(n, this) }, this, 1e3) } function o(t) { game.ToastTip.popTip(GameConfig.ServerCode[t]) } t.showTipsDownToUp = e, t.showTipsLeftOrRight = i, t.showTipsFromCenter = n, t.showTipsBigToSmall = a, t.showErrorCodeTips = o } (TipsUtils || (TipsUtils = {}));