123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263 |
- var t = require;
- var e = module;
- var i = exports;
- Object.defineProperty(i, "__esModule", {value: !0}),
- (i.BUFF_TYPE = i.BuffAttr = void 0),
- (i.BuffAttr = class {
- constructor() {
- (this.ObjectPoolKey = null), (this.attr = null), (this.defaultAttr = null);
- }
- static create(t) {
- const e = ObjectPool.pop("BuffAttr");
- return (e.defaultAttr = t || Object.create(null)), e;
- }
- setBuffValue(t, e) {
- this.attr[t] = e;
- }
- getBuffValue(t) {
- return this.attr[t];
- }
- resetBuffByType(t) {
- this.setBuffValue(t, 0);
- }
- addBuffValue(t, e) {
- -1 < o.indexOf(t)
- ? ((this.attr[t] = (this.attr[t] * e) / 100), this.attr[t] <= 0 && (this.attr[t] = 0.01))
- : (this.attr[t] += e);
- }
- addBuffAttr(t) {
- if (t) {
- const e = this.attr,
- i = t.attr;
- for (const s in i) {
- const t = i[s];
- -1 < a.indexOf(s)
- ? ((e[s] = (100 * e[s] - 100 + (100 * t - 100) + 100) / 100), e[s] <= 0 && (e[s] = 0.01))
- : -1 < o.indexOf(s)
- ? ((e[s] = e[s] * t), e[s] <= 0 && (e[s] = 0.01))
- : (e[s] += t);
- }
- }
- }
- claFinish() {
- for (let t = 0; t < a.length; t++) {
- var e = a[t],
- i = 100 + this[e];
- this.attr[e] = i < 0 ? 0.01 : i / 100;
- }
- }
- reset() {
- this.attr = Object.assign(Object.create(null), this.defaultAttr);
- }
- });
- let s = [];
- ((i = e = i.BUFF_TYPE || (i.BUFF_TYPE = {}))[(i.ADD_IDLE = 0)] = "ADD_IDLE"),
- (i[(i.CUSTOMER_MOVE_SPEED = 1)] = "CUSTOMER_MOVE_SPEED"),
- (i[(i.WAITER_SPEED = 2)] = "WAITER_SPEED"),
- (i[(i.CHEF_SPEED = 3)] = "CHEF_SPEED"),
- (i[(i.COOK_SPEED = 4)] = "COOK_SPEED"),
- (i[(i.FOOD_SELL_RATE = 5)] = "FOOD_SELL_RATE"),
- (i[(i.ALL_EMPLOYEES_MOVE_SPEED = 6)] = "ALL_EMPLOYEES_MOVE_SPEED");
- const o = [e[e.ADD_IDLE], e[e.FOOD_SELL_RATE]],
- a = [];
- for (const n in e) isNaN(n) && s.push(n);
|