var t = require; var e = module; var i = exports; Object.defineProperty(i, "__esModule", { value: !0 }); const s = t("App"), o = t("ControllerConst"), a = t("CostumeConst"), n = t("BuffMgr"), r = t("IBuff"), l = t("GameConst"), h = t("AbilityInfoService"), c = t("MachineService"), d = t("MapService"), u = t("RoleService"), p = t("StageUpgradeService"); let f = null, g = null; class m { constructor() { (this.tipChance = 0), (this.generousTipRate = 0), (this.chefProductionSpeed = 1), (this.waiterProductionSpeed = 1), (this.moneyRate = 1), (this.customerMoveSpeed = 1), (this.chefspeed = 0), (this.waiterspeed = 0), (this.perfectDishRate = 0), (this.instaCompletedDishRate = 0), (this.menuItemUpgradeDiscount = 1), (this.cookMoneyRate = 0), (this.tipRate = 0), (this.upgradeDiscount = 1), (this.ad_booster_effect = 1), (this.gemsChanceAtAd = 0), (this.offlineRevenue = 1), (this.offlineRewardMaxTime = 1), (this.offlineRewardMinTime = 1), (this.adBoosterDuration = 1), (this.adRewardRevenue = 1), (this.define = null), (this.costumeAttr = null), (this.buffAttr = null); } static init() { (g = u.default.ins), (m.ins = new m()), (f = h.default.ins.dataMap), m.ins.init(); } init() { (this.buffAttr = n.default.ins.getRegionBuffAttrList(d.default.ins.curId)), (this.define = s.default.ConfigManager.getConfig("Define")), (this.offlineRewardMinTime = this.define.offline_reward_min_time), (this.costumeAttr = s.default.ControllerManager.getControllerModel(o.ControllerConst.Costume).attr), s.default.NotificationCenter.addListener(l.GameNotificationConst.UPDATE_BUFF, this.onUpdateBuff, this), s.default.NotificationCenter.addListener( l.GameNotificationConst.UPDATE_EQUIP_COSTUME_ATTR, this.onUpdateEquipCostume, this ); } onUpdateEquipCostume(t) { for (const e of t) switch (e) { case a.CostumeAbilityType.base: this.calCookMoneyRate(); break; case a.CostumeAbilityType.all_employees_production_speed: this.calChefProductionSpeed(), this.calWaiterProductionSpeed(); break; case a.CostumeAbilityType.all_employees_move_speed: this.calChefSpeed(), this.calWaiterSpeed(); break; case a.CostumeAbilityType.all_employees_perfect_dish_rate: this.calPerfectDishRate(); break; case a.CostumeAbilityType.extremely_generous_tip_rate: this.calGenerousTipRate(); break; case a.CostumeAbilityType.additional_cashier_charge: this.calMoneyRate(); break; case a.CostumeAbilityType.menu_item_upgrade_discount: this.calMenuItemUpgradeDiscount(); break; case a.CostumeAbilityType.waiter_production_speed: this.calWaiterProductionSpeed(); break; case a.CostumeAbilityType.chef_production_speed: this.calChefProductionSpeed(); break; case a.CostumeAbilityType.waiter_move_speed: this.calWaiterSpeed(); break; case a.CostumeAbilityType.chef_move_speed: this.calChefSpeed(); break; case a.CostumeAbilityType.instaCompleted_dish_rate: break; case a.CostumeAbilityType.upgrade_discount: this.calUpgradeDiscount(); break; case a.CostumeAbilityType.doublebase: } } destroy() { s.default.NotificationCenter.removeAll(this); } onUpdateBuff(t, e, i) { switch (r.BUFF_TYPE[i]) { case r.BUFF_TYPE.CHEF_SPEED: this.calChefSpeed(); break; case r.BUFF_TYPE.WAITER_SPEED: this.calWaiterSpeed(); break; case r.BUFF_TYPE.CUSTOMER_MOVE_SPEED: this.calCustomerMoveSpeed(); break; case r.BUFF_TYPE.COOK_SPEED: this.calChefProductionSpeed(), this.calWaiterProductionSpeed(); break; case r.BUFF_TYPE.FOOD_SELL_RATE: this.calMoneyRate(); break; case r.BUFF_TYPE.ALL_EMPLOYEES_MOVE_SPEED: this.calWaiterSpeed(), this.calChefSpeed(); } } calAll() { this.calTipChance(), this.calTipRate(), this.calMoneyRate(), this.calGemsChanceAtAd(), this.calAdBoosterEffect(), this.calOfflineRevenue(), this.calOfflineRewardTime(), this.calAdBoosterDuration(), this.calCustomerMoveSpeed(), this.calAdRewardRevenue(), this.calChefSpeed(), this.calWaiterSpeed(), this.calCookMoneyRate(), this.calGenerousTipRate(), this.calInstaCompletedDishRate(), this.calPerfectDishRate(), this.calMenuItemUpgradeDiscount(), this.calUpgradeDiscount(), this.calChefProductionSpeed(), this.calWaiterProductionSpeed(); } calUpgradeDiscount() { (this.upgradeDiscount = 1 - this.costumeAttr.getAttrValue(a.CostumeAbilityType.upgrade_discount, 0) / 100), p.default.ins.updateUpgradeDiscount(); } calMenuItemUpgradeDiscount() { (this.menuItemUpgradeDiscount = 1 - this.costumeAttr.getAttrValue(a.CostumeAbilityType.menu_item_upgrade_discount, 0) / 100), c.default.ins.reCalAllFoodCost(); } calInstaCompletedDishRate() { } calPerfectDishRate() { this.perfectDishRate = this.costumeAttr.getAttrValue(a.CostumeAbilityType.all_employees_perfect_dish_rate, 0) / 100; } calCookMoneyRate() { this.cookMoneyRate = 1 + this.costumeAttr.getAttrValue(a.CostumeAbilityType.base, 0) / 100; } calGenerousTipRate() { this.generousTipRate = this.costumeAttr.getAttrValue(a.CostumeAbilityType.extremely_generous_tip_rate, 0) / 100; } calMoneyRate() { this.moneyRate = this.buffAttr.attr.FOOD_SELL_RATE * (1 + this.costumeAttr.getAttrValue(a.CostumeAbilityType.additional_cashier_charge, 0) / 100); } calTipChance() { this.tipChance = f[h.PayAbilityType.get_tips_chance].getValue(0); } calChefProductionSpeed() { this.chefProductionSpeed = 1 + (this.costumeAttr.getAttrValue(a.CostumeAbilityType.chef_production_speed, 0) + this.costumeAttr.getAttrValue(a.CostumeAbilityType.all_employees_production_speed, 0) + this.buffAttr.attr.COOK_SPEED) / 100; } calWaiterProductionSpeed() { this.waiterProductionSpeed = 1 + (this.costumeAttr.getAttrValue(a.CostumeAbilityType.waiter_production_speed, 0) + this.costumeAttr.getAttrValue(a.CostumeAbilityType.all_employees_production_speed, 0) + this.buffAttr.attr.COOK_SPEED) / 100; } calChefSpeed() { (this.chefspeed = Math.floor( (this.define.crew_move_speed * (g.chefspeed + this.buffAttr.attr.ALL_EMPLOYEES_MOVE_SPEED + this.buffAttr.attr.CHEF_SPEED + this.costumeAttr.getAttrValue(a.CostumeAbilityType.chef_move_speed, 0) + this.costumeAttr.getAttrValue(a.CostumeAbilityType.all_employees_move_speed, 0))) / 100 )), g.updateChefSpeed(); } calWaiterSpeed() { (this.waiterspeed = Math.floor( (this.define.crew_move_speed * (g.waiterspeed + this.buffAttr.attr.WAITER_SPEED + this.buffAttr.attr.ALL_EMPLOYEES_MOVE_SPEED + this.costumeAttr.getAttrValue(a.CostumeAbilityType.waiter_move_speed, 0) + this.costumeAttr.getAttrValue(a.CostumeAbilityType.all_employees_move_speed, 0))) / 100 )), g.updateWaiterSpeed(); } calTipRate() { this.tipRate = f[h.PayAbilityType.tips_rate].getValue(1) * this.define.tip_value; } calGemsChanceAtAd() { console.error('取消掉 这个咯 '); return this.gemsChanceAtAd = f[h.PayAbilityType.gems_chance_at_ad].getValue(0); } calOfflineRevenue() { this.offlineRevenue = f[h.PayAbilityType.offline_revenue].getValue(1); } calOfflineRewardTime() { this.offlineRewardMaxTime = Math.floor( this.define.offline_reward_max_time * f[h.PayAbilityType.offline_reward_time].getValue(1) ); } calAdBoosterDuration() { console.error('取消掉 这个咯 '); return this.adBoosterDuration = Math.floor( f[h.PayAbilityType.ad_booster_duration].getValue(1) * this.define.booster_ad_time ); } calAdBoosterEffect() { console.error('取消掉 这个咯 '); return this.ad_booster_effect = this.define.booster_ad_value / 100 + f[h.PayAbilityType.ad_booster_effect].getValue(0); } calCustomerMoveSpeed() { this.customerMoveSpeed = this.define.customer_move_speed * (f[h.PayAbilityType.customer_move_speed].getValue(1) + this.buffAttr.attr.CUSTOMER_MOVE_SPEED / 100); } calAdRewardRevenue() { console.error('取消掉 这个咯 '); return this.adRewardRevenue = this.define.booster_ad_value / 100 + f[h.PayAbilityType.ad_reward_revenue].getValue(0); } } (i.default = m), (m.ins = null);