123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129 |
- 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("App"),
- o = t("GlobalAttr"),
- a = t("MyBigLong"),
- n = t("MapService"),
- r = t("BaseMan"),
- {ccclass: l, property: h} = cc._decorator;
- t = class extends r.default {
- constructor() {
- super(...arguments),
- (this.progress = null),
- (this.food = null),
- (this.basePos = null),
- (this.frontFood = null),
- (this.backFood = null),
- (this.moneyLab = null),
- (this.fireNode = null),
- (this.skinName = "装备/服务员/waiter_02");
- }
- onLoad() {
- this.food.node.removeFromParent(), this.initSkin();
- }
- initSkin() {
- if (this.skinName) {
- var t = this.sp.skeletonData.getRuntimeData().findSkin(this.skinName),
- e = this.sp._skeleton.slots;
- for (const o in t.attachments) {
- var i = t.attachments[o];
- for (const a in i)
- if ("Cat_1" !== a) {
- let t = e[o];
- var s = i[a];
- t && t.setAttachment(s);
- }
- }
- }
- }
- showInstaCompletedDishEffect() {
- const t = new cc.Node(),
- e = t.addComponent(cc.Label);
- (e.string = "立即完成"),
- (e.fontSize = 30),
- n.default.ins.uiLayer.addChild(t),
- (t.position = this.node.position),
- (t.y += 100),
- cc
- .tween(t)
- .to(0.1, {scale: 1.1}, {easing: cc.easing.sineOut})
- .to(0.1, {scale: 1}, {easing: cc.easing.sineIn})
- .to(0.7, {y: t.y + 50})
- .delay(0.2)
- .to(0.3, {opacity: 0})
- .call(() => {
- t.destroy();
- })
- .start();
- }
- calSpeed() {
- this.moveSpeed = o.default.ins.chefspeed;
- }
- getCookMoneyRate() {
- return o.default.ins.cookMoneyRate;
- }
- getInstaCompletedDishRate() {
- return o.default.ins.instaCompletedDishRate;
- }
- getCookSpeedRate() {
- return o.default.ins.chefProductionSpeed;
- }
- getPerfectDishRate() {
- return o.default.ins.perfectDishRate;
- }
- showFood(t, e) {
- (this.food.spriteFrame = t),
- 4 === this._direction
- ? (this.food.node.removeFromParent(!1), this.backFood.addChild(this.food.node))
- : (this.food.node.removeFromParent(!1), this.frontFood.addChild(this.food.node));
- const i = (this.moneyLab = s.default.NodePoolMsr.moneyLabPool.pop());
- this.node.addChild(i), (i.getComponent(cc.Label).string = a.default.toString(e));
- }
- hideFood() {
- this.food.node.parent && this.food.node.removeFromParent(!1),
- (this.food.spriteFrame = null),
- this.moneyLab && this.moneyLab.pool.push(this.moneyLab);
- }
- set direction(t) {
- this.food.node.parent &&
- t !== this._direction &&
- (4 === t
- ? (this.food.node.removeFromParent(!1), this.backFood.addChild(this.food.node))
- : 4 === this._direction &&
- (this.food.node.removeFromParent(!1), this.frontFood.addChild(this.food.node))),
- (this._direction = t),
- (this.aniPre = r.aniMap[t]),
- (this.sp.node.scaleX = 4 < t ? -1 : 1),
- (this.state = this._state);
- }
- showFire() {
- this.fireNode ||
- (0 < o.default.ins.buffAttr.attr.COOK_SPEED &&
- ((this.fireNode = s.default.NodePoolMsr.fireAniPool.pop()),
- this.node.addChild(this.fireNode),
- this.fireNode.setSiblingIndex(0)));
- }
- removeFire() {
- this.fireNode && (s.default.NodePoolMsr.fireAniPool.push(this.fireNode), (this.fireNode = null));
- }
- };
- e([h(cc.ProgressBar)], t.prototype, "progress", void 0),
- e([h(cc.Sprite)], t.prototype, "food", void 0),
- e([h(cc.Node)], t.prototype, "frontFood", void 0),
- e([h(cc.Node)], t.prototype, "backFood", void 0),
- (t = e([l], t)),
- (i.default = t);
|