123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081 |
- var t = require;
- var e = module;
- var i = exports;
- Object.defineProperty(i, "__esModule", {value: !0});
- const s = t("GameText"),
- o = t("GlobalAttr"),
- a = t("MyBigLong"),
- n = t("DeskService"),
- r = t("MachineService"),
- l = t("MapService"),
- h = t("StageUpgradeService");
- i.default = class {
- constructor() {
- (this.cfg = null), (this.cost = 0), (this._baseCost = 0), (this._desc = ""), (this.title = "");
- }
- init(t) {
- (this.cfg = t),
- (this._baseCost = a.default.unpackData(t.cost)),
- (this.title = s.GameText.getTextByStr(`str_title_stage_${this.cfg.ability_type}`)),
- this.calCost();
- }
- calCost() {
- this.cost = Math.ceil(o.default.ins.upgradeDiscount * this._baseCost);
- }
- canBuy() {
- return l.default.ins.mapSaveData.money >= this.cost;
- }
- get desc() {
- if (!this._desc) {
- let t = "";
- switch (this.cfg.ability_type) {
- case h.AbilityType.menuprofit:
- (t = r.default.ins.machineDatas[this.cfg.ability_target - 1].name),
- (this._desc = s.GameText.getTextByStr(`stage_upgrade_type_${this.cfg.ability_type}`).format(
- this.cfg.ability_value,
- s.GameText.getTextByStr(t)
- ));
- break;
- case h.AbilityType.fastermenu:
- (t = r.default.ins.machineDatas[this.cfg.ability_target - 1].name),
- (this._desc = s.GameText.getTextByStr(`stage_upgrade_type_${this.cfg.ability_type}`).format(
- s.GameText.getTextByStr(t)
- ));
- break;
- case h.AbilityType.addcustomer2:
- this._desc = s.GameText.getTextByStr(`stage_upgrade_type_${this.cfg.ability_type}`).format(
- n.default.ins.deskDatas[this.cfg.ability_target].customers.length
- );
- break;
- case h.AbilityType.chefspeed:
- case h.AbilityType.cashirespeed:
- this._desc = s.GameText.getTextByStr(`stage_upgrade_type_${this.cfg.ability_type}`);
- break;
- default:
- this._desc = s.GameText.getTextByStr(`stage_upgrade_type_${this.cfg.ability_type}`).format(
- this.cfg.ability_value
- );
- }
- }
- return this._desc;
- }
- getIconUrl() {
- let t = "Texture/stageUpgradeIcon/icon_";
- switch (this.cfg.ability_type) {
- case h.AbilityType.cashirespeed:
- case h.AbilityType.chefspeed:
- t += 50;
- break;
- case h.AbilityType.menuprofit:
- case h.AbilityType.fastermenu:
- t = "";
- break;
- default:
- t += this.cfg.ability_type;
- }
- return t;
- }
- getFoodImg() {
- return r.default.ins.machineDatas[this.cfg.ability_target - 1].foodImg;
- }
- };
|