warscript 0.0.1-dev.f5421e8 → 0.0.1-dev.f70428f
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/attributes.d.ts +6 -0
- package/attributes.lua +17 -1
- package/core/types/frame.lua +24 -21
- package/core/types/player.d.ts +15 -0
- package/core/types/player.lua +56 -14
- package/core/types/playerCamera.d.ts +2 -0
- package/core/types/playerCamera.lua +123 -5
- package/core/types/sound.lua +5 -0
- package/core/types/tileCell.d.ts +11 -1
- package/core/types/tileCell.lua +97 -0
- package/core/types/timer.d.ts +3 -1
- package/core/types/timer.lua +27 -2
- package/decl/native.d.ts +846 -790
- package/engine/behavior.d.ts +12 -1
- package/engine/behavior.lua +172 -70
- package/engine/behaviour/ability/apply-buff.lua +1 -1
- package/engine/behaviour/ability/damage.d.ts +6 -3
- package/engine/behaviour/ability/damage.lua +24 -36
- package/engine/behaviour/ability/emulate-impact.d.ts +1 -1
- package/engine/behaviour/ability/emulate-impact.lua +18 -3
- package/engine/behaviour/ability/remove-buffs.d.ts +9 -0
- package/engine/behaviour/ability/remove-buffs.lua +21 -0
- package/engine/behaviour/ability/restore-mana.d.ts +1 -1
- package/engine/behaviour/ability/restore-mana.lua +6 -6
- package/engine/behaviour/ability.lua +8 -17
- package/engine/behaviour/unit/stun-immunity.d.ts +11 -5
- package/engine/behaviour/unit/stun-immunity.lua +53 -28
- package/engine/behaviour/unit.d.ts +34 -2
- package/engine/behaviour/unit.lua +192 -6
- package/engine/buff.d.ts +12 -5
- package/engine/buff.lua +125 -87
- package/engine/internal/ability.d.ts +7 -1
- package/engine/internal/ability.lua +49 -9
- package/engine/internal/item/ability.lua +63 -11
- package/engine/internal/item+owner.lua +12 -6
- package/engine/internal/item.d.ts +18 -17
- package/engine/internal/item.lua +135 -49
- package/engine/internal/misc/damage-metadata-by-target.d.ts +2 -0
- package/engine/internal/misc/damage-metadata-by-target.lua +5 -0
- package/engine/internal/misc/frame-coordinates.d.ts +2 -0
- package/engine/internal/misc/frame-coordinates.lua +21 -0
- package/engine/internal/misc/get-terrain-z.d.ts +2 -0
- package/engine/internal/misc/get-terrain-z.lua +11 -0
- package/engine/internal/misc/player-local-handle.d.ts +2 -0
- package/engine/internal/misc/player-local-handle.lua +5 -0
- package/engine/internal/unit/ability.d.ts +35 -0
- package/engine/internal/unit/ability.lua +98 -9
- package/engine/internal/unit/allowed-targets.d.ts +1 -1
- package/engine/internal/unit/allowed-targets.lua +9 -1
- package/engine/internal/unit/fly-height.d.ts +7 -0
- package/engine/internal/unit/fly-height.lua +20 -0
- package/engine/internal/unit/main-selected.lua +12 -27
- package/engine/internal/unit/order.d.ts +20 -0
- package/engine/internal/unit/order.lua +136 -0
- package/engine/internal/unit/scale.d.ts +7 -0
- package/engine/internal/unit/scale.lua +20 -0
- package/engine/internal/unit+ability.lua +10 -1
- package/engine/internal/unit+damage.d.ts +2 -11
- package/engine/internal/unit+damage.lua +10 -14
- package/engine/internal/unit+spellSteal.lua +1 -2
- package/engine/internal/unit-missile-launch.lua +45 -14
- package/engine/internal/unit.d.ts +39 -19
- package/engine/internal/unit.lua +329 -169
- package/engine/local-client.d.ts +2 -0
- package/engine/local-client.lua +30 -0
- package/engine/object-data/auxiliary/armor-type.d.ts +11 -0
- package/engine/object-data/auxiliary/armor-type.lua +46 -0
- package/engine/object-data/auxiliary/attack-type.d.ts +7 -8
- package/engine/object-data/auxiliary/attack-type.lua +42 -0
- package/engine/object-data/auxiliary/movement-type.d.ts +7 -7
- package/engine/object-data/auxiliary/movement-type.lua +22 -0
- package/engine/object-data/auxiliary/unit-attribute.d.ts +6 -0
- package/engine/object-data/auxiliary/unit-attribute.lua +9 -0
- package/engine/object-data/entry/ability-type/berserk.d.ts +2 -0
- package/engine/object-data/entry/ability-type/berserk.lua +13 -0
- package/engine/object-data/entry/ability-type/permanent-invisibility.d.ts +8 -0
- package/engine/object-data/entry/ability-type/permanent-invisibility.lua +26 -0
- package/engine/object-data/entry/ability-type/slow-poison.d.ts +10 -0
- package/engine/object-data/entry/ability-type/slow-poison.lua +58 -0
- package/engine/object-data/entry/ability-type.lua +11 -3
- package/engine/object-data/entry/buff-type/applicable.lua +5 -0
- package/engine/object-data/entry/buff-type.d.ts +5 -11
- package/engine/object-data/entry/buff-type.lua +11 -27
- package/engine/object-data/entry/unit-type.d.ts +13 -4
- package/engine/object-data/entry/unit-type.lua +153 -85
- package/engine/object-field/ability.d.ts +4 -4
- package/engine/object-field/ability.lua +7 -6
- package/engine/object-field/unit.d.ts +69 -3
- package/engine/object-field/unit.lua +264 -7
- package/engine/object-field.d.ts +23 -6
- package/engine/object-field.lua +309 -126
- package/engine/random.d.ts +9 -0
- package/engine/random.lua +13 -0
- package/engine/standard/entries/buff-type.d.ts +3 -0
- package/engine/standard/entries/buff-type.lua +3 -0
- package/engine/standard/fields/unit.d.ts +6 -0
- package/engine/standard/fields/unit.lua +11 -0
- package/engine/synchronization.d.ts +11 -0
- package/engine/synchronization.lua +77 -0
- package/engine/text-tag.d.ts +36 -2
- package/engine/text-tag.lua +250 -10
- package/engine/unit.d.ts +3 -0
- package/engine/unit.lua +3 -0
- package/net/socket.lua +1 -1
- package/objutil/buff.lua +2 -3
- package/package.json +2 -2
- package/patch-lualib.lua +1 -1
- package/utility/arrays.d.ts +2 -0
- package/utility/arrays.lua +11 -0
- package/utility/callback-array.d.ts +17 -0
- package/utility/callback-array.lua +61 -0
- package/utility/functions.d.ts +8 -0
- package/utility/functions.lua +13 -0
- package/utility/linked-set.d.ts +2 -0
- package/utility/linked-set.lua +22 -1
- package/utility/lua-maps.d.ts +15 -2
- package/utility/lua-maps.lua +53 -2
- package/utility/lua-sets.d.ts +2 -0
- package/utility/lua-sets.lua +7 -0
- package/utility/types.d.ts +3 -0
- package/core/types/order.d.ts +0 -25
- package/core/types/order.lua +0 -55
package/engine/behavior.d.ts
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
/** @noSelfInFile */
|
|
2
2
|
import { AbstractDestroyable, Destructor } from "../destroyable";
|
|
3
|
+
import { Event } from "../event";
|
|
4
|
+
export declare const enum BehaviorPriority {
|
|
5
|
+
HIGH = 0,
|
|
6
|
+
MEDIUM = 1,
|
|
7
|
+
LOW = 2
|
|
8
|
+
}
|
|
3
9
|
export type BehaviorConstructor<T extends Behavior<AnyNotNil>, Parameters extends any[] = any[]> = OmitConstructor<typeof Behavior<any>> & (abstract new (...parameters: Parameters) => T);
|
|
4
10
|
declare const enum BehaviorPropertyKey {
|
|
5
11
|
PREVIOUS_BEHAVIOR = 0,
|
|
@@ -8,11 +14,14 @@ declare const enum BehaviorPropertyKey {
|
|
|
8
14
|
}
|
|
9
15
|
export declare abstract class Behavior<T extends AnyNotNil, PeriodicActionParameters extends any[] = any[]> extends AbstractDestroyable {
|
|
10
16
|
protected readonly object: T;
|
|
17
|
+
readonly priority: BehaviorPriority;
|
|
11
18
|
private [BehaviorPropertyKey.PREVIOUS_BEHAVIOR]?;
|
|
12
19
|
private [BehaviorPropertyKey.NEXT_BEHAVIOR]?;
|
|
13
20
|
private [BehaviorPropertyKey.TIMER]?;
|
|
14
|
-
protected constructor(object: T);
|
|
21
|
+
protected constructor(object: T, priority?: BehaviorPriority);
|
|
15
22
|
protected onDestroy(): Destructor;
|
|
23
|
+
protected registerEvent<K extends string, Args extends any[]>(this: Behavior<any, PeriodicActionParameters> & Record<K, (this: this, ...args: Args) => unknown>, event: Event<[...Args]>, listener: K): void;
|
|
24
|
+
protected deregisterEvent(event: Event<any>): boolean;
|
|
16
25
|
protected onPeriod(...parameters: PeriodicActionParameters): void;
|
|
17
26
|
protected startPeriodicAction(interval: number, ...parameters: PeriodicActionParameters): void;
|
|
18
27
|
protected stopPeriodicAction(): void;
|
|
@@ -24,5 +33,7 @@ export declare abstract class Behavior<T extends AnyNotNil, PeriodicActionParame
|
|
|
24
33
|
static forFirst<T extends Behavior<AnyNotNil>, ConstructorParameters extends any[], K extends KeysOfType<T, (this: T, ...args: any) => any>>(this: BehaviorConstructor<T, ConstructorParameters>, object: T extends Behavior<infer Object> ? Object : never, count: number, key: K, ...parameters: T[K] extends (this: T, ...args: any) => any ? Parameters<T[K]> : never): number;
|
|
25
34
|
static forAll<T extends Behavior<AnyNotNil>, ConstructorParameters extends any[], ConsumerParameters extends any[]>(this: BehaviorConstructor<T, ConstructorParameters>, object: T extends Behavior<infer Object> ? Object : never, consumer: (this: void, behavior: T, ...parameters: ConsumerParameters) => unknown, ...parameters: ConsumerParameters): number;
|
|
26
35
|
static forAll<T extends Behavior<AnyNotNil>, ConstructorParameters extends any[], K extends KeysOfType<T, (this: T, ...args: any) => any>>(this: BehaviorConstructor<T, ConstructorParameters>, object: T extends Behavior<infer Object> ? Object : never, key: K, ...parameters: T[K] extends (this: T, ...args: any) => any ? Parameters<T[K]> : never): number;
|
|
36
|
+
static reduce<T extends Behavior<AnyNotNil>, ConstructorParameters extends any[], ConsumerParameters extends any[], Accumulator, R>(this: BehaviorConstructor<T, ConstructorParameters>, object: T extends Behavior<infer Object> ? Object : never, operation: (this: void, accumulator: Accumulator, value: R) => Accumulator, initial: Accumulator, consumer: (this: void, behavior: T, ...parameters: ConsumerParameters) => R, ...parameters: ConsumerParameters): Accumulator;
|
|
37
|
+
static reduce<T extends Behavior<AnyNotNil>, ConstructorParameters extends any[], Accumulator, R, K extends KeysOfType<T, (this: T, ...args: any) => R>>(this: BehaviorConstructor<T, ConstructorParameters>, object: T extends Behavior<infer Object> ? Object : never, operation: (this: void, accumulator: Accumulator, value: R) => Accumulator, initial: Accumulator, key: K, ...parameters: T[K] extends (this: T, ...args: any) => R ? Parameters<T[K]> : never): Accumulator;
|
|
27
38
|
}
|
|
28
39
|
export {};
|
package/engine/behavior.lua
CHANGED
|
@@ -1,28 +1,80 @@
|
|
|
1
1
|
local ____lualib = require("lualib_bundle")
|
|
2
|
+
local __TS__InstanceOf = ____lualib.__TS__InstanceOf
|
|
2
3
|
local __TS__Class = ____lualib.__TS__Class
|
|
3
4
|
local __TS__ClassExtends = ____lualib.__TS__ClassExtends
|
|
4
|
-
local
|
|
5
|
+
local __TS__New = ____lualib.__TS__New
|
|
5
6
|
local ____exports = {}
|
|
6
7
|
local ____destroyable = require("destroyable")
|
|
7
8
|
local AbstractDestroyable = ____destroyable.AbstractDestroyable
|
|
8
9
|
local ____timer = require("core.types.timer")
|
|
9
10
|
local Timer = ____timer.Timer
|
|
11
|
+
local ____functions = require("utility.functions")
|
|
12
|
+
local increment = ____functions.increment
|
|
13
|
+
local ____linked_2Dset = require("utility.linked-set")
|
|
14
|
+
local LinkedSet = ____linked_2Dset.LinkedSet
|
|
15
|
+
local ____lua_2Dmaps = require("utility.lua-maps")
|
|
16
|
+
local getOrPut = ____lua_2Dmaps.getOrPut
|
|
17
|
+
local mutableLuaMap = ____lua_2Dmaps.mutableLuaMap
|
|
18
|
+
local ____lua_2Dsets = require("utility.lua-sets")
|
|
19
|
+
local mutableLuaSet = ____lua_2Dsets.mutableLuaSet
|
|
10
20
|
local safeCall = warpack.safeCall
|
|
11
|
-
local
|
|
12
|
-
local
|
|
21
|
+
local firstBehaviorByObjectByPriority = {[0] = {}, [2] = {}, [1] = {}}
|
|
22
|
+
local lastBehaviorByObjectByPriority = {[0] = {}, [2] = {}, [1] = {}}
|
|
13
23
|
local function invokeBehaviorOnPeriod(behavior, ...)
|
|
14
24
|
behavior.onPeriod(behavior, ...)
|
|
15
25
|
end
|
|
26
|
+
local function reduceBehaviors(behaviorConstructor, object, operation, initial, consumerOrKey, ...)
|
|
27
|
+
local accumulator = initial
|
|
28
|
+
for priority = 0, 2 do
|
|
29
|
+
local behavior = firstBehaviorByObjectByPriority[priority][object]
|
|
30
|
+
if behavior ~= nil then
|
|
31
|
+
if type(consumerOrKey) == "function" then
|
|
32
|
+
repeat
|
|
33
|
+
do
|
|
34
|
+
if __TS__InstanceOf(behavior, behaviorConstructor) then
|
|
35
|
+
local isSuccessful, result = safeCall(consumerOrKey, behavior, ...)
|
|
36
|
+
if isSuccessful then
|
|
37
|
+
accumulator = operation(accumulator, result)
|
|
38
|
+
end
|
|
39
|
+
end
|
|
40
|
+
behavior = behavior[1]
|
|
41
|
+
end
|
|
42
|
+
until not (behavior ~= nil)
|
|
43
|
+
else
|
|
44
|
+
repeat
|
|
45
|
+
do
|
|
46
|
+
if __TS__InstanceOf(behavior, behaviorConstructor) then
|
|
47
|
+
local isSuccessful, result = safeCall(behavior[consumerOrKey], behavior, ...)
|
|
48
|
+
if isSuccessful then
|
|
49
|
+
accumulator = operation(accumulator, result)
|
|
50
|
+
end
|
|
51
|
+
end
|
|
52
|
+
behavior = behavior[1]
|
|
53
|
+
end
|
|
54
|
+
until not (behavior ~= nil)
|
|
55
|
+
end
|
|
56
|
+
end
|
|
57
|
+
end
|
|
58
|
+
return accumulator
|
|
59
|
+
end
|
|
60
|
+
local behaviorsByEvent = {}
|
|
61
|
+
local listenerByBehaviorByEvent = {}
|
|
62
|
+
local eventsByBehavior = {}
|
|
16
63
|
____exports.Behavior = __TS__Class()
|
|
17
64
|
local Behavior = ____exports.Behavior
|
|
18
65
|
Behavior.name = "Behavior"
|
|
19
66
|
__TS__ClassExtends(Behavior, AbstractDestroyable)
|
|
20
|
-
function Behavior.prototype.____constructor(self, object)
|
|
67
|
+
function Behavior.prototype.____constructor(self, object, priority)
|
|
68
|
+
if priority == nil then
|
|
69
|
+
priority = 1
|
|
70
|
+
end
|
|
21
71
|
AbstractDestroyable.prototype.____constructor(self)
|
|
22
72
|
self.object = object
|
|
73
|
+
self.priority = priority
|
|
74
|
+
local lastBehaviorByObject = lastBehaviorByObjectByPriority[priority]
|
|
23
75
|
local lastBehavior = lastBehaviorByObject[object]
|
|
24
76
|
if lastBehavior == nil then
|
|
25
|
-
|
|
77
|
+
firstBehaviorByObjectByPriority[priority][object] = self
|
|
26
78
|
lastBehaviorByObject[object] = self
|
|
27
79
|
else
|
|
28
80
|
self[0] = lastBehavior
|
|
@@ -35,20 +87,62 @@ function Behavior.prototype.onDestroy(self)
|
|
|
35
87
|
if ____opt_0 ~= nil then
|
|
36
88
|
____opt_0:destroy()
|
|
37
89
|
end
|
|
90
|
+
local events = eventsByBehavior[self]
|
|
91
|
+
if events ~= nil then
|
|
92
|
+
for event in pairs(events) do
|
|
93
|
+
local ____opt_2 = behaviorsByEvent[event]
|
|
94
|
+
if ____opt_2 ~= nil then
|
|
95
|
+
____opt_2:remove(self)
|
|
96
|
+
end
|
|
97
|
+
local ____opt_4 = listenerByBehaviorByEvent[event]
|
|
98
|
+
if ____opt_4 ~= nil then
|
|
99
|
+
____opt_4[self] = nil
|
|
100
|
+
end
|
|
101
|
+
end
|
|
102
|
+
eventsByBehavior[self] = nil
|
|
103
|
+
end
|
|
38
104
|
local previousBehavior = self[0]
|
|
39
105
|
local nextBehavior = self[1]
|
|
40
106
|
if previousBehavior ~= nil then
|
|
41
107
|
previousBehavior[1] = nextBehavior
|
|
42
108
|
else
|
|
43
|
-
|
|
109
|
+
firstBehaviorByObjectByPriority[self.priority][self.object] = nextBehavior
|
|
44
110
|
end
|
|
45
111
|
if nextBehavior ~= nil then
|
|
46
112
|
nextBehavior[0] = previousBehavior
|
|
47
113
|
else
|
|
48
|
-
|
|
114
|
+
lastBehaviorByObjectByPriority[self.priority][self.object] = previousBehavior
|
|
49
115
|
end
|
|
50
116
|
return AbstractDestroyable.prototype.onDestroy(self)
|
|
51
117
|
end
|
|
118
|
+
function Behavior.prototype.registerEvent(self, event, listener)
|
|
119
|
+
local listenerByBehavior = getOrPut(listenerByBehaviorByEvent, event, mutableLuaMap)
|
|
120
|
+
listenerByBehavior[self] = listener
|
|
121
|
+
getOrPut(eventsByBehavior, self, mutableLuaSet)[event] = true
|
|
122
|
+
local behaviors = behaviorsByEvent[event]
|
|
123
|
+
if behaviors == nil then
|
|
124
|
+
event:addListener(function(...)
|
|
125
|
+
local behaviors = behaviorsByEvent[event]
|
|
126
|
+
if behaviors ~= nil then
|
|
127
|
+
for behavior in pairs(behaviors) do
|
|
128
|
+
safeCall(behavior[listenerByBehavior[behavior]], behavior, ...)
|
|
129
|
+
end
|
|
130
|
+
end
|
|
131
|
+
end)
|
|
132
|
+
behaviors = __TS__New(LinkedSet)
|
|
133
|
+
behaviorsByEvent[event] = behaviors
|
|
134
|
+
end
|
|
135
|
+
behaviors:add(self)
|
|
136
|
+
end
|
|
137
|
+
function Behavior.prototype.deregisterEvent(self, event)
|
|
138
|
+
local behaviors = behaviorsByEvent[event]
|
|
139
|
+
if behaviors ~= nil and behaviors:remove(self) then
|
|
140
|
+
eventsByBehavior[self][event] = nil
|
|
141
|
+
listenerByBehaviorByEvent[event][self] = nil
|
|
142
|
+
return true
|
|
143
|
+
end
|
|
144
|
+
return false
|
|
145
|
+
end
|
|
52
146
|
function Behavior.prototype.onPeriod(self, ...)
|
|
53
147
|
end
|
|
54
148
|
function Behavior.prototype.startPeriodicAction(self, interval, ...)
|
|
@@ -74,108 +168,116 @@ function Behavior.prototype.stopPeriodicAction(self)
|
|
|
74
168
|
end
|
|
75
169
|
function Behavior.count(self, object, limit)
|
|
76
170
|
local behaviorsCount = 0
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
171
|
+
for priority = 0, 2 do
|
|
172
|
+
local behavior = firstBehaviorByObjectByPriority[priority][object]
|
|
173
|
+
while behavior ~= nil and (limit == nil or behaviorsCount < limit) do
|
|
174
|
+
if __TS__InstanceOf(behavior, self) then
|
|
175
|
+
behaviorsCount = behaviorsCount + 1
|
|
176
|
+
end
|
|
177
|
+
behavior = behavior[1]
|
|
81
178
|
end
|
|
82
|
-
behavior = behavior[1]
|
|
83
179
|
end
|
|
84
180
|
return behaviorsCount
|
|
85
181
|
end
|
|
86
182
|
function Behavior.getFirst(self, object, countOrPredicate, ...)
|
|
87
|
-
local behavior = firstBehaviorByObject[object]
|
|
88
183
|
if type(countOrPredicate) ~= "number" then
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
184
|
+
for priority = 0, 2 do
|
|
185
|
+
local behavior = firstBehaviorByObjectByPriority[priority][object]
|
|
186
|
+
while behavior ~= nil do
|
|
187
|
+
if __TS__InstanceOf(behavior, self) and (countOrPredicate == nil or countOrPredicate(behavior, ...)) then
|
|
188
|
+
return behavior
|
|
189
|
+
end
|
|
190
|
+
behavior = behavior[1]
|
|
92
191
|
end
|
|
93
|
-
behavior = behavior[1]
|
|
94
192
|
end
|
|
95
193
|
return nil
|
|
96
194
|
end
|
|
97
195
|
local behaviors = {}
|
|
98
196
|
local behaviorsCount = 0
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
197
|
+
for priority = 0, 2 do
|
|
198
|
+
local behavior = firstBehaviorByObjectByPriority[priority][object]
|
|
199
|
+
while behavior ~= nil and behaviorsCount < countOrPredicate do
|
|
200
|
+
if __TS__InstanceOf(behavior, self) then
|
|
201
|
+
behaviorsCount = behaviorsCount + 1
|
|
202
|
+
behaviors[behaviorsCount] = behavior
|
|
203
|
+
end
|
|
204
|
+
behavior = behavior[1]
|
|
103
205
|
end
|
|
104
|
-
behavior = behavior[1]
|
|
105
206
|
end
|
|
106
207
|
return behaviors
|
|
107
208
|
end
|
|
108
209
|
function Behavior.getLast(self, object)
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
210
|
+
for priority = 2, 0, -1 do
|
|
211
|
+
local behavior = lastBehaviorByObjectByPriority[priority][object]
|
|
212
|
+
while behavior ~= nil do
|
|
213
|
+
if __TS__InstanceOf(behavior, self) then
|
|
214
|
+
return behavior
|
|
215
|
+
end
|
|
216
|
+
behavior = behavior[0]
|
|
113
217
|
end
|
|
114
|
-
behavior = behavior[0]
|
|
115
218
|
end
|
|
116
219
|
return nil
|
|
117
220
|
end
|
|
118
221
|
function Behavior.getAll(self, object, predicate, ...)
|
|
119
222
|
local behaviors = {}
|
|
120
223
|
local behaviorsCount = 0
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
224
|
+
for priority = 0, 2 do
|
|
225
|
+
local behavior = firstBehaviorByObjectByPriority[priority][object]
|
|
226
|
+
while behavior ~= nil do
|
|
227
|
+
if __TS__InstanceOf(behavior, self) and (predicate == nil or predicate(behavior, ...)) then
|
|
228
|
+
behaviorsCount = behaviorsCount + 1
|
|
229
|
+
behaviors[behaviorsCount] = behavior
|
|
230
|
+
end
|
|
231
|
+
behavior = behavior[1]
|
|
126
232
|
end
|
|
127
|
-
behavior = behavior[1]
|
|
128
233
|
end
|
|
129
234
|
return behaviors
|
|
130
235
|
end
|
|
131
236
|
function Behavior.forFirst(self, object, count, consumerOrKey, ...)
|
|
132
237
|
local behaviorsCount = 0
|
|
133
|
-
local behavior = firstBehaviorByObject[object]
|
|
134
238
|
if type(consumerOrKey) == "function" then
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
239
|
+
for priority = 0, 2 do
|
|
240
|
+
local behavior = firstBehaviorByObjectByPriority[priority][object]
|
|
241
|
+
while behavior ~= nil and behaviorsCount < count do
|
|
242
|
+
if __TS__InstanceOf(behavior, self) then
|
|
243
|
+
safeCall(consumerOrKey, behavior, ...)
|
|
244
|
+
behaviorsCount = behaviorsCount + 1
|
|
245
|
+
end
|
|
246
|
+
behavior = behavior[1]
|
|
139
247
|
end
|
|
140
|
-
behavior = behavior[1]
|
|
141
248
|
end
|
|
142
249
|
else
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
250
|
+
for priority = 0, 2 do
|
|
251
|
+
local behavior = firstBehaviorByObjectByPriority[priority][object]
|
|
252
|
+
while behavior ~= nil and behaviorsCount < count do
|
|
253
|
+
if __TS__InstanceOf(behavior, self) then
|
|
254
|
+
safeCall(behavior[consumerOrKey], behavior, ...)
|
|
255
|
+
behaviorsCount = behaviorsCount + 1
|
|
256
|
+
end
|
|
257
|
+
behavior = behavior[1]
|
|
147
258
|
end
|
|
148
|
-
behavior = behavior[1]
|
|
149
259
|
end
|
|
150
260
|
end
|
|
151
261
|
return behaviorsCount
|
|
152
262
|
end
|
|
153
263
|
function Behavior.forAll(self, object, consumerOrKey, ...)
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
behaviorsCount = behaviorsCount + 1
|
|
173
|
-
end
|
|
174
|
-
behavior = behavior[1]
|
|
175
|
-
end
|
|
176
|
-
until not (behavior ~= nil)
|
|
177
|
-
end
|
|
178
|
-
end
|
|
179
|
-
return behaviorsCount
|
|
264
|
+
return reduceBehaviors(
|
|
265
|
+
self,
|
|
266
|
+
object,
|
|
267
|
+
increment,
|
|
268
|
+
0,
|
|
269
|
+
consumerOrKey,
|
|
270
|
+
...
|
|
271
|
+
)
|
|
272
|
+
end
|
|
273
|
+
function Behavior.reduce(self, object, operation, initial, consumerOrKey, ...)
|
|
274
|
+
return reduceBehaviors(
|
|
275
|
+
self,
|
|
276
|
+
object,
|
|
277
|
+
operation,
|
|
278
|
+
initial,
|
|
279
|
+
consumerOrKey,
|
|
280
|
+
...
|
|
281
|
+
)
|
|
180
282
|
end
|
|
181
283
|
return ____exports
|
|
@@ -148,7 +148,7 @@ function ApplyBuffChannelingTargetAbilityBehavior.prototype.onStop(self)
|
|
|
148
148
|
self.buff = nil
|
|
149
149
|
end
|
|
150
150
|
end
|
|
151
|
-
Buff.
|
|
151
|
+
Buff.beingDestroyedEvent:addListener(function(buff)
|
|
152
152
|
local behavior = behaviorByBuff[buff]
|
|
153
153
|
if behavior ~= nil then
|
|
154
154
|
behaviorByBuff[buff] = nil
|
|
@@ -4,26 +4,29 @@ import { Ability } from "../../internal/ability";
|
|
|
4
4
|
import { Unit } from "../../internal/unit";
|
|
5
5
|
import { AbilityDependentValue } from "../../object-field/ability";
|
|
6
6
|
import { Widget } from "../../../core/types/widget";
|
|
7
|
-
import {
|
|
7
|
+
import { DamageType, WeaponType } from "../../internal/unit+damage";
|
|
8
8
|
import { CombatClassifications } from "../../object-data/auxiliary/combat-classification";
|
|
9
|
+
import { AttackType } from "../../object-data/auxiliary/attack-type";
|
|
9
10
|
export type DamageAbilityBehaviorParameters = {
|
|
10
11
|
damagePerStrength?: AbilityDependentValue<number>;
|
|
11
12
|
damagePerAgility?: AbilityDependentValue<number>;
|
|
12
13
|
damagePerIntelligence?: AbilityDependentValue<number>;
|
|
13
|
-
attackType?: AttackType
|
|
14
|
+
attackType?: AbilityDependentValue<AttackType>;
|
|
14
15
|
damageType?: DamageType;
|
|
15
16
|
weaponType?: WeaponType;
|
|
17
|
+
metadata?: AbilityDependentValue<string | number | boolean>;
|
|
16
18
|
};
|
|
17
19
|
export type DamageAreaAbilityBehaviorParameters = DamageAbilityBehaviorParameters & {
|
|
18
20
|
maximumDamage?: AbilityDependentValue<number>;
|
|
19
21
|
areaOfEffect?: AbilityDependentValue<number>;
|
|
20
22
|
allowedTargetCombatClassifications?: AbilityDependentValue<CombatClassifications>;
|
|
21
23
|
};
|
|
22
|
-
declare abstract class DamageAbilityBehavior<T extends DamageAbilityBehaviorParameters = DamageAbilityBehaviorParameters> extends AbilityBehavior {
|
|
24
|
+
export declare abstract class DamageAbilityBehavior<T extends DamageAbilityBehaviorParameters = DamageAbilityBehaviorParameters> extends AbilityBehavior {
|
|
23
25
|
protected readonly damage: AbilityDependentValue<number>;
|
|
24
26
|
protected readonly parameters?: T | undefined;
|
|
25
27
|
protected constructor(ability: Ability, damage: AbilityDependentValue<number>, parameters?: T | undefined);
|
|
26
28
|
protected calculateDamage(caster: Unit): number;
|
|
29
|
+
protected damageTarget(caster: Unit, target: Widget, damage?: number): void;
|
|
27
30
|
}
|
|
28
31
|
export declare class DamageSelfAbilityBehavior extends DamageAbilityBehavior {
|
|
29
32
|
constructor(ability: Ability, damage: AbilityDependentValue<number>, parameters?: DamageAbilityBehaviorParameters);
|
|
@@ -9,7 +9,8 @@ local Unit = ____unit.Unit
|
|
|
9
9
|
local ____ability = require("engine.standard.fields.ability")
|
|
10
10
|
local ALLOWED_TARGETS_ABILITY_COMBAT_CLASSIFICATIONS_LEVEL_FIELD = ____ability.ALLOWED_TARGETS_ABILITY_COMBAT_CLASSIFICATIONS_LEVEL_FIELD
|
|
11
11
|
local AREA_OF_EFFECT_ABILITY_FLOAT_LEVEL_FIELD = ____ability.AREA_OF_EFFECT_ABILITY_FLOAT_LEVEL_FIELD
|
|
12
|
-
|
|
12
|
+
____exports.DamageAbilityBehavior = __TS__Class()
|
|
13
|
+
local DamageAbilityBehavior = ____exports.DamageAbilityBehavior
|
|
13
14
|
DamageAbilityBehavior.name = "DamageAbilityBehavior"
|
|
14
15
|
__TS__ClassExtends(DamageAbilityBehavior, AbilityBehavior)
|
|
15
16
|
function DamageAbilityBehavior.prototype.____constructor(self, ability, damage, parameters)
|
|
@@ -34,49 +35,44 @@ function DamageAbilityBehavior.prototype.calculateDamage(self, caster)
|
|
|
34
35
|
end
|
|
35
36
|
return damage
|
|
36
37
|
end
|
|
37
|
-
|
|
38
|
-
local DamageSelfAbilityBehavior = ____exports.DamageSelfAbilityBehavior
|
|
39
|
-
DamageSelfAbilityBehavior.name = "DamageSelfAbilityBehavior"
|
|
40
|
-
__TS__ClassExtends(DamageSelfAbilityBehavior, DamageAbilityBehavior)
|
|
41
|
-
function DamageSelfAbilityBehavior.prototype.____constructor(self, ability, damage, parameters)
|
|
42
|
-
DamageAbilityBehavior.prototype.____constructor(self, ability, damage, parameters)
|
|
43
|
-
end
|
|
44
|
-
function DamageSelfAbilityBehavior.prototype.onImpact(self, caster)
|
|
38
|
+
function DamageAbilityBehavior.prototype.damageTarget(self, caster, target, damage)
|
|
45
39
|
local parameters = self.parameters
|
|
46
40
|
caster:damageTarget(
|
|
47
|
-
|
|
48
|
-
self:calculateDamage(caster),
|
|
41
|
+
target,
|
|
42
|
+
damage or self:calculateDamage(caster),
|
|
49
43
|
nil,
|
|
50
44
|
nil,
|
|
51
|
-
parameters and parameters.attackType,
|
|
45
|
+
self:resolveCurrentAbilityDependentValue(parameters and parameters.attackType),
|
|
52
46
|
parameters and parameters.damageType,
|
|
53
|
-
parameters and parameters.weaponType
|
|
47
|
+
parameters and parameters.weaponType,
|
|
48
|
+
self:resolveCurrentAbilityDependentValue(parameters and parameters.metadata)
|
|
54
49
|
)
|
|
55
50
|
end
|
|
51
|
+
____exports.DamageSelfAbilityBehavior = __TS__Class()
|
|
52
|
+
local DamageSelfAbilityBehavior = ____exports.DamageSelfAbilityBehavior
|
|
53
|
+
DamageSelfAbilityBehavior.name = "DamageSelfAbilityBehavior"
|
|
54
|
+
__TS__ClassExtends(DamageSelfAbilityBehavior, ____exports.DamageAbilityBehavior)
|
|
55
|
+
function DamageSelfAbilityBehavior.prototype.____constructor(self, ability, damage, parameters)
|
|
56
|
+
DamageSelfAbilityBehavior.____super.prototype.____constructor(self, ability, damage, parameters)
|
|
57
|
+
end
|
|
58
|
+
function DamageSelfAbilityBehavior.prototype.onImpact(self, caster)
|
|
59
|
+
self:damageTarget(caster, caster)
|
|
60
|
+
end
|
|
56
61
|
____exports.DamageTargetAbilityBehavior = __TS__Class()
|
|
57
62
|
local DamageTargetAbilityBehavior = ____exports.DamageTargetAbilityBehavior
|
|
58
63
|
DamageTargetAbilityBehavior.name = "DamageTargetAbilityBehavior"
|
|
59
|
-
__TS__ClassExtends(DamageTargetAbilityBehavior, DamageAbilityBehavior)
|
|
64
|
+
__TS__ClassExtends(DamageTargetAbilityBehavior, ____exports.DamageAbilityBehavior)
|
|
60
65
|
function DamageTargetAbilityBehavior.prototype.____constructor(self, ability, damage, parameters)
|
|
61
|
-
|
|
66
|
+
DamageTargetAbilityBehavior.____super.prototype.____constructor(self, ability, damage, parameters)
|
|
62
67
|
end
|
|
63
68
|
function DamageTargetAbilityBehavior.prototype.onWidgetTargetImpact(self, caster, target)
|
|
64
|
-
|
|
65
|
-
caster:damageTarget(
|
|
66
|
-
target,
|
|
67
|
-
self:calculateDamage(caster),
|
|
68
|
-
nil,
|
|
69
|
-
nil,
|
|
70
|
-
parameters and parameters.attackType,
|
|
71
|
-
parameters and parameters.damageType,
|
|
72
|
-
parameters and parameters.weaponType
|
|
73
|
-
)
|
|
69
|
+
self:damageTarget(caster, target)
|
|
74
70
|
end
|
|
75
71
|
local DamageAreaAbilityBehavior = __TS__Class()
|
|
76
72
|
DamageAreaAbilityBehavior.name = "DamageAreaAbilityBehavior"
|
|
77
|
-
__TS__ClassExtends(DamageAreaAbilityBehavior, DamageAbilityBehavior)
|
|
73
|
+
__TS__ClassExtends(DamageAreaAbilityBehavior, ____exports.DamageAbilityBehavior)
|
|
78
74
|
function DamageAreaAbilityBehavior.prototype.____constructor(self, ability, damage, parameters)
|
|
79
|
-
|
|
75
|
+
DamageAreaAbilityBehavior.____super.prototype.____constructor(self, ability, damage, parameters)
|
|
80
76
|
end
|
|
81
77
|
function DamageAreaAbilityBehavior.prototype.damageArea(self, caster, x, y)
|
|
82
78
|
local parameters = self.parameters
|
|
@@ -93,15 +89,7 @@ function DamageAreaAbilityBehavior.prototype.damageArea(self, caster, x, y)
|
|
|
93
89
|
damage = maximumDamage / #targets
|
|
94
90
|
end
|
|
95
91
|
for ____, target in ipairs(targets) do
|
|
96
|
-
|
|
97
|
-
target,
|
|
98
|
-
damage,
|
|
99
|
-
nil,
|
|
100
|
-
nil,
|
|
101
|
-
parameters and parameters.attackType,
|
|
102
|
-
parameters and parameters.damageType,
|
|
103
|
-
parameters and parameters.weaponType
|
|
104
|
-
)
|
|
92
|
+
self:damageTarget(caster, target, damage)
|
|
105
93
|
end
|
|
106
94
|
end
|
|
107
95
|
____exports.DamageSelfAreaAbilityBehavior = __TS__Class()
|
|
@@ -2,5 +2,5 @@
|
|
|
2
2
|
import { AbilityBehavior } from "../ability";
|
|
3
3
|
import { Unit } from "../../internal/unit";
|
|
4
4
|
export declare abstract class EmulateImpactAbilityBehavior extends AbilityBehavior {
|
|
5
|
-
protected emulateImpact(caster: Unit):
|
|
5
|
+
protected emulateImpact(caster: Unit): boolean;
|
|
6
6
|
}
|
|
@@ -1,15 +1,25 @@
|
|
|
1
1
|
local ____lualib = require("lualib_bundle")
|
|
2
2
|
local __TS__Class = ____lualib.__TS__Class
|
|
3
3
|
local __TS__ClassExtends = ____lualib.__TS__ClassExtends
|
|
4
|
+
local __TS__InstanceOf = ____lualib.__TS__InstanceOf
|
|
4
5
|
local ____exports = {}
|
|
5
6
|
local ____ability = require("engine.behaviour.ability")
|
|
6
7
|
local AbilityBehavior = ____ability.AbilityBehavior
|
|
8
|
+
local ____unit = require("engine.internal.unit")
|
|
9
|
+
local Unit = ____unit.Unit
|
|
7
10
|
local ____ability = require("engine.standard.fields.ability")
|
|
8
11
|
local COOLDOWN_ABILITY_FLOAT_LEVEL_FIELD = ____ability.COOLDOWN_ABILITY_FLOAT_LEVEL_FIELD
|
|
9
12
|
local MANA_COST_ABILITY_INTEGER_LEVEL_FIELD = ____ability.MANA_COST_ABILITY_INTEGER_LEVEL_FIELD
|
|
10
13
|
local ____math = require("math")
|
|
11
14
|
local max = ____math.max
|
|
12
15
|
local MINIMUM_POSITIVE_NORMALIZED_FLOAT = ____math.MINIMUM_POSITIVE_NORMALIZED_FLOAT
|
|
16
|
+
local ____sound = require("core.types.sound")
|
|
17
|
+
local Sound3D = ____sound.Sound3D
|
|
18
|
+
local SoundSettings = ____sound.SoundSettings
|
|
19
|
+
local ____ability = require("engine.internal.ability")
|
|
20
|
+
local UnitAbility = ____ability.UnitAbility
|
|
21
|
+
local ____event = require("event")
|
|
22
|
+
local Event = ____event.Event
|
|
13
23
|
____exports.EmulateImpactAbilityBehavior = __TS__Class()
|
|
14
24
|
local EmulateImpactAbilityBehavior = ____exports.EmulateImpactAbilityBehavior
|
|
15
25
|
EmulateImpactAbilityBehavior.name = "EmulateImpactAbilityBehavior"
|
|
@@ -17,12 +27,17 @@ __TS__ClassExtends(EmulateImpactAbilityBehavior, AbilityBehavior)
|
|
|
17
27
|
function EmulateImpactAbilityBehavior.prototype.emulateImpact(self, caster)
|
|
18
28
|
local manaCost = self:resolveCurrentAbilityDependentValue(MANA_COST_ABILITY_INTEGER_LEVEL_FIELD)
|
|
19
29
|
local cooldown = self:resolveCurrentAbilityDependentValue(COOLDOWN_ABILITY_FLOAT_LEVEL_FIELD)
|
|
20
|
-
if self.ability.cooldownRemaining ~= 0 or caster.mana < manaCost then
|
|
21
|
-
return
|
|
30
|
+
if self.ability.cooldownRemaining ~= 0 or caster.mana < manaCost or __TS__InstanceOf(self.ability, UnitAbility) and self.ability.isDisabled then
|
|
31
|
+
return false
|
|
22
32
|
end
|
|
23
33
|
caster.mana = caster.mana - manaCost
|
|
24
34
|
self.ability.cooldownRemaining = max(cooldown, MINIMUM_POSITIVE_NORMALIZED_FLOAT)
|
|
25
35
|
self:flashCasterEffect(caster)
|
|
26
|
-
|
|
36
|
+
local soundPresetId = self.ability:getField(ABILITY_SF_EFFECT_SOUND)
|
|
37
|
+
if soundPresetId ~= "" then
|
|
38
|
+
Sound3D:playFromLabel(soundPresetId, SoundSettings.Ability, caster)
|
|
39
|
+
end
|
|
40
|
+
Event.invoke(Unit.abilityImpactEvent, caster, self.ability)
|
|
41
|
+
return true
|
|
27
42
|
end
|
|
28
43
|
return ____exports
|
|
@@ -14,3 +14,12 @@ export declare class RemoveBuffsSelfAbilityBehavior extends AbilityBehavior {
|
|
|
14
14
|
constructor(ability: Ability, polarity?: AbilityDependentValue<BuffPolarity> | undefined, resistanceType?: AbilityDependentValue<BuffResistanceType> | undefined, includeExpirationTimers?: AbilityDependentValue<boolean> | undefined, includeAuras?: AbilityDependentValue<boolean> | undefined, autoDispel?: AbilityDependentValue<boolean> | undefined);
|
|
15
15
|
onImpact(caster: Unit): void;
|
|
16
16
|
}
|
|
17
|
+
export declare class RemoveBuffsTargetAbilityBehavior extends AbilityBehavior {
|
|
18
|
+
private readonly polarity?;
|
|
19
|
+
private readonly resistanceType?;
|
|
20
|
+
private readonly includeExpirationTimers?;
|
|
21
|
+
private readonly includeAuras?;
|
|
22
|
+
private readonly autoDispel?;
|
|
23
|
+
constructor(ability: Ability, polarity?: AbilityDependentValue<BuffPolarity> | undefined, resistanceType?: AbilityDependentValue<BuffResistanceType> | undefined, includeExpirationTimers?: AbilityDependentValue<boolean> | undefined, includeAuras?: AbilityDependentValue<boolean> | undefined, autoDispel?: AbilityDependentValue<boolean> | undefined);
|
|
24
|
+
onUnitTargetImpact(_: Unit, target: Unit): void;
|
|
25
|
+
}
|
|
@@ -25,4 +25,25 @@ function RemoveBuffsSelfAbilityBehavior.prototype.onImpact(self, caster)
|
|
|
25
25
|
self:resolveCurrentAbilityDependentValue(self.autoDispel)
|
|
26
26
|
)
|
|
27
27
|
end
|
|
28
|
+
____exports.RemoveBuffsTargetAbilityBehavior = __TS__Class()
|
|
29
|
+
local RemoveBuffsTargetAbilityBehavior = ____exports.RemoveBuffsTargetAbilityBehavior
|
|
30
|
+
RemoveBuffsTargetAbilityBehavior.name = "RemoveBuffsTargetAbilityBehavior"
|
|
31
|
+
__TS__ClassExtends(RemoveBuffsTargetAbilityBehavior, AbilityBehavior)
|
|
32
|
+
function RemoveBuffsTargetAbilityBehavior.prototype.____constructor(self, ability, polarity, resistanceType, includeExpirationTimers, includeAuras, autoDispel)
|
|
33
|
+
AbilityBehavior.prototype.____constructor(self, ability)
|
|
34
|
+
self.polarity = polarity
|
|
35
|
+
self.resistanceType = resistanceType
|
|
36
|
+
self.includeExpirationTimers = includeExpirationTimers
|
|
37
|
+
self.includeAuras = includeAuras
|
|
38
|
+
self.autoDispel = autoDispel
|
|
39
|
+
end
|
|
40
|
+
function RemoveBuffsTargetAbilityBehavior.prototype.onUnitTargetImpact(self, _, target)
|
|
41
|
+
target:removeBuffs(
|
|
42
|
+
self:resolveCurrentAbilityDependentValue(self.polarity),
|
|
43
|
+
self:resolveCurrentAbilityDependentValue(self.resistanceType),
|
|
44
|
+
self:resolveCurrentAbilityDependentValue(self.includeExpirationTimers),
|
|
45
|
+
self:resolveCurrentAbilityDependentValue(self.includeAuras),
|
|
46
|
+
self:resolveCurrentAbilityDependentValue(self.autoDispel)
|
|
47
|
+
)
|
|
48
|
+
end
|
|
28
49
|
return ____exports
|
|
@@ -8,7 +8,7 @@ export declare class RestoreManaSelfAbilityBehavior extends AbilityBehavior {
|
|
|
8
8
|
constructor(ability: Ability, mana: AbilityDependentValue<number>);
|
|
9
9
|
onImpact(caster: Unit): void;
|
|
10
10
|
}
|
|
11
|
-
export declare class
|
|
11
|
+
export declare class RestoreManaTargetAbilityBehavior extends AbilityBehavior {
|
|
12
12
|
private readonly mana;
|
|
13
13
|
constructor(ability: Ability, mana: AbilityDependentValue<number>);
|
|
14
14
|
onUnitTargetImpact(caster: Unit, target: Unit): void;
|
|
@@ -15,15 +15,15 @@ end
|
|
|
15
15
|
function RestoreManaSelfAbilityBehavior.prototype.onImpact(self, caster)
|
|
16
16
|
caster.mana = caster.mana + self:resolveCurrentAbilityDependentValue(self.mana)
|
|
17
17
|
end
|
|
18
|
-
____exports.
|
|
19
|
-
local
|
|
20
|
-
|
|
21
|
-
__TS__ClassExtends(
|
|
22
|
-
function
|
|
18
|
+
____exports.RestoreManaTargetAbilityBehavior = __TS__Class()
|
|
19
|
+
local RestoreManaTargetAbilityBehavior = ____exports.RestoreManaTargetAbilityBehavior
|
|
20
|
+
RestoreManaTargetAbilityBehavior.name = "RestoreManaTargetAbilityBehavior"
|
|
21
|
+
__TS__ClassExtends(RestoreManaTargetAbilityBehavior, AbilityBehavior)
|
|
22
|
+
function RestoreManaTargetAbilityBehavior.prototype.____constructor(self, ability, mana)
|
|
23
23
|
AbilityBehavior.prototype.____constructor(self, ability)
|
|
24
24
|
self.mana = mana
|
|
25
25
|
end
|
|
26
|
-
function
|
|
26
|
+
function RestoreManaTargetAbilityBehavior.prototype.onUnitTargetImpact(self, caster, target)
|
|
27
27
|
target.mana = target.mana + self:resolveCurrentAbilityDependentValue(self.mana)
|
|
28
28
|
end
|
|
29
29
|
return ____exports
|