var t = require; var e = module; var i = exports; e = (this && this.__decorate) || function (t, e, i, s) { var o, a = arguments.length, n = a < 3 ? e : null === s ? (s = Object.getOwnPropertyDescriptor(e, i)) : s; if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) n = Reflect.decorate(t, e, i, s); else for (var r = t.length - 1; 0 <= r; r--) (o = t[r]) && (n = (a < 3 ? o(n) : 3 < a ? o(e, i, n) : o(e, i)) || n); return 3 < a && n && Object.defineProperty(e, i, n), n; }; Object.defineProperty(i, "__esModule", {value: !0}); const s = t("CostumeConst"), o = t("GlobalAttr"), a = t("Chef"), d = { [s.CostumeParts.head]: { skin: "装备/帽子/hat_", slot1: "head1/maozi", slot2: "head4/maozi", targetAttaName1: "head1/maozi", targetAttaName2: "head4/maozi" }, [s.CostumeParts.body]: { skin: "装备/衣服/wear_", slot1: "cat1/lj2", slot2: "cat1/lj", targetAttaName1: "Cat1", targetAttaName2: "Cat1" }, [s.CostumeParts.hand]: { skin: "装备/手持/item_", slot1: "lam1/zhuangbei", slot2: "lam3/zhuangbei", targetAttaName1: "lam1/zhuangbei", targetAttaName2: "lam3/zhuangbei" } }, {ccclass: n} = cc._decorator; e = e( [n], (e = class extends a.default { constructor() { super(...arguments), (this.selfAttr = null), (this.isWaiter = !1), (this.curEquMap = Object.create(null)), (this.skinName = "装备/服务员/waiter_03"), (this.defaultAttachment = Object.create(null)); } resetSlot(t) { var e = this.defaultAttachment[t]; if (e) for (const i in e) { const t = e[i]; t.slot.setAttachment(t.attachment); } } updateSlot(e) { for (const r in d) { var i = d[r], s = e[r]; if (s) { if (!this.curEquMap[r] || this.curEquMap[r] !== s.cfg.idx) { this.resetSlot(r), (this.curEquMap[r] = s.cfg.idx), (this.defaultAttachment[r] = Object.create(null)); const e = s.cfg.idx % 100, l = i.skin + (e < 10 ? "0" + e : e); let t = this.sp.skeletonData.getRuntimeData(); var o = this.sp._skeleton.slots, a = t.findSkin(l); for (const h in a.attachments) { const e = a.attachments[h]; for (const c in e) if ("Cat_1" !== c) { var n = e[c]; let t = o[h]; t && ((this.defaultAttachment[r][c] = {slot: t, attachment: t.getAttachment()}), t.setAttachment(n)); } } } } else this.resetSlot(r), (this.curEquMap[r] = null), (this.defaultAttachment[r] = null); } } getPerfectDishRate() { return ( o.default.ins.perfectDishRate + this.selfAttr.getAttrValue(s.CostumeAbilityType.perfect_dish_rate, 0) / 100 ); } getCookMoneyRate() { return o.default.ins.cookMoneyRate; } calSpeed() { var t = o.default.ins, e = (this.selfAttr.getAttrValue(s.CostumeAbilityType.move_speed, 0) * t.define.crew_move_speed) / 100; this.isWaiter ? (this.moveSpeed = e + t.waiterspeed) : (this.moveSpeed = e + t.chefspeed); } getInstaCompletedDishRate() { return ( o.default.ins.instaCompletedDishRate + this.selfAttr.getAttrValue(s.CostumeAbilityType.instaCompleted_dish_rate, 0) / 100 ); } getCookSpeedRate() { return this.isWaiter ? o.default.ins.waiterProductionSpeed + this.selfAttr.getAttrValue(s.CostumeAbilityType.production_speed, 0) / 100 : o.default.ins.chefProductionSpeed + this.selfAttr.getAttrValue(s.CostumeAbilityType.production_speed, 0) / 100; } }) ); i.default = e;