CookData.js 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. var t = require;
  2. var e = module;
  3. var i = exports;
  4. Object.defineProperty(i, "__esModule", {value: !0});
  5. const a = t("App"),
  6. n = t("LabelTip"),
  7. r = t("GlobalAttr"),
  8. l = t("MyBigLong"),
  9. h = t("CurrencyService"),
  10. c = t("MapService"),
  11. d = t("OrderService");
  12. i.default = class {
  13. constructor() {
  14. (this.slot = null),
  15. (this.order = null),
  16. (this.foodValue = 0),
  17. (this.isPerfect = !1),
  18. (this.cookTime = 0),
  19. (this.cookMoneyRate = 1);
  20. }
  21. init(t) {
  22. (this.cookTime = Math.ceil(this.order.machine.attr.manufactureTime / t.getCookSpeedRate())),
  23. (this.cookMoneyRate = t.getCookMoneyRate());
  24. }
  25. finishCook(t) {
  26. (this.isPerfect = t), this.slot.stopCook(), this.calValue(t);
  27. }
  28. getCookTime() {
  29. return this.cookTime;
  30. }
  31. finishOrder() {
  32. const t = r.default.ins,
  33. e = this.order.customer.posData.tipAndValueUp;
  34. let i = this.foodValue,
  35. s = l.default.toString(this.foodValue);
  36. var o;
  37. 1 < t.moneyRate && ((i *= t.moneyRate), (s = l.default.toString(i))),
  38. a.default.NodePoolMsr.flyLabel
  39. .pop()
  40. .getComponent(n.default)
  41. .init(c.default.ins.uiLayer, s, 35)
  42. .flyUp(e.pos.x, e.pos.y + 100, !0),
  43. d.default.ins.finshOrder(this.order),
  44. t.tipChance &&
  45. t.tipChance > Math.random() &&
  46. ((o =
  47. t.generousTipRate && t.generousTipRate > Math.random()
  48. ? t.define.costume_ability204_value / 100
  49. : t.tipRate),
  50. e.addValue(
  51. Math.floor((this.foodValue * this.order.machine.attr.slotCnt * o) / (this.getCookTime() + 10))
  52. )),
  53. h.default.ins.moneyChange(i);
  54. }
  55. calValue(t) {
  56. var e = r.default.ins;
  57. (this.foodValue = t
  58. ? (this.order.getFoodValue() * this.cookMoneyRate * e.define.costume_ability403_value) / 100
  59. : this.order.getFoodValue() * this.cookMoneyRate),
  60. (this.foodValue = Math.floor(this.foodValue));
  61. }
  62. };