warscript 0.0.1-dev.f40f923 → 0.0.1-dev.f5421e8
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/core/types/effect.d.ts +1 -3
- package/core/types/effect.lua +26 -29
- package/core/types/timer.d.ts +6 -7
- package/core/types/timer.lua +18 -21
- package/engine/behaviour/ability.d.ts +4 -1
- package/engine/behaviour/ability.lua +6 -4
- package/engine/object-data/auxiliary/attachment-preset.d.ts +7 -2
- package/engine/object-data/auxiliary/attachment-preset.lua +4 -3
- package/engine/object-data/entry/ability-type/phase-shift.d.ts +10 -0
- package/engine/object-data/entry/ability-type/phase-shift.lua +39 -0
- package/engine/object-data/entry/ability-type/shock-wave.d.ts +4 -0
- package/engine/object-data/entry/ability-type/shock-wave.lua +26 -0
- package/engine/object-data/entry/ability-type/web.d.ts +12 -0
- package/engine/object-data/entry/ability-type/web.lua +52 -0
- package/engine/object-data/entry/ability-type.d.ts +11 -11
- package/engine/object-data/entry/ability-type.lua +20 -6
- package/package.json +2 -2
package/core/types/effect.d.ts
CHANGED
|
@@ -30,12 +30,10 @@ export declare class Effect extends Handle<jeffect> {
|
|
|
30
30
|
set pitch(pitch: number);
|
|
31
31
|
get roll(): number;
|
|
32
32
|
set roll(roll: number);
|
|
33
|
-
static create<T extends Effect>(this: typeof Effect & (new (handle: jeffect) => T),
|
|
34
|
-
static createTarget<T extends Effect>(this: typeof Effect & (new (handle: jeffect) => T), model: string, target: Widget, attachPoint: string): T;
|
|
33
|
+
static create<T extends Effect>(this: typeof Effect & (new (handle: jeffect) => T), modelPath: string, xOrWidget: number | Widget, yOrAttachmentPoint?: number | string, parameters?: EffectParameters): T;
|
|
35
34
|
static flash(modelPath: string, ...args: [
|
|
36
35
|
...pointOrWidget: [x: number, y: number] | [widget: Widget, attachmentPoint?: string],
|
|
37
36
|
...parametersOrDuration: [parametersOrDuration?: EffectParameters | number] | [duration?: number, parameters?: EffectParameters]
|
|
38
37
|
]): void;
|
|
39
|
-
static flashTarget(model: string, target: Widget, attachPoint: string, duration?: number): void;
|
|
40
38
|
}
|
|
41
39
|
export {};
|
package/core/types/effect.lua
CHANGED
|
@@ -4,7 +4,7 @@ local __TS__ClassExtends = ____lualib.__TS__ClassExtends
|
|
|
4
4
|
local __TS__SetDescriptor = ____lualib.__TS__SetDescriptor
|
|
5
5
|
local __TS__InstanceOf = ____lualib.__TS__InstanceOf
|
|
6
6
|
local ____exports = {}
|
|
7
|
-
local dummyPlayer, flash
|
|
7
|
+
local dummyPlayer, addSpecialEffectInternal, flash
|
|
8
8
|
local ____handle = require("core.types.handle")
|
|
9
9
|
local Handle = ____handle.Handle
|
|
10
10
|
local ____playerColor = require("core.types.playerColor")
|
|
@@ -119,6 +119,7 @@ local function setSpecialEffectColor(effect, color)
|
|
|
119
119
|
dummyPlayer.color = dummyColor
|
|
120
120
|
end
|
|
121
121
|
local setters = {scale = setSpecialEffectScale, color = setSpecialEffectColor, pitch = setSpecialEffectPitchDegrees, roll = setSpecialEffectRollDegrees}
|
|
122
|
+
local setterProperties = {"scale", "color", "pitch", "roll"}
|
|
122
123
|
dummyPlayer = Player.neutralExtra
|
|
123
124
|
local temporaryEffects = {}
|
|
124
125
|
local temporaryEffectsDurations = {}
|
|
@@ -177,11 +178,14 @@ function Effect.prototype.onDestroy(self)
|
|
|
177
178
|
destroyEffect(self.handle)
|
|
178
179
|
return Handle.prototype.onDestroy(self)
|
|
179
180
|
end
|
|
180
|
-
function Effect.create(self,
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
181
|
+
function Effect.create(self, modelPath, xOrWidget, yOrAttachmentPoint, parameters)
|
|
182
|
+
local effect = self:of(addSpecialEffectInternal(modelPath, xOrWidget, yOrAttachmentPoint, parameters))
|
|
183
|
+
if parameters ~= nil then
|
|
184
|
+
effect[100] = parameters.color
|
|
185
|
+
effect[101] = parameters.pitch
|
|
186
|
+
effect[102] = parameters.roll
|
|
187
|
+
end
|
|
188
|
+
return effect
|
|
185
189
|
end
|
|
186
190
|
function Effect.flash(self, modelPath, xOrWidget, yOrOrAttachmentPoint, parametersOrDuration, parameters)
|
|
187
191
|
if type(parametersOrDuration) ~= "number" then
|
|
@@ -206,24 +210,12 @@ function Effect.flash(self, modelPath, xOrWidget, yOrOrAttachmentPoint, paramete
|
|
|
206
210
|
parameters
|
|
207
211
|
)
|
|
208
212
|
end
|
|
209
|
-
function Effect.flashTarget(self, model, target, attachPoint, duration)
|
|
210
|
-
local effect = addSpecialEffectTarget(model, target.handle, attachPoint)
|
|
211
|
-
if effect ~= nil then
|
|
212
|
-
if duration and duration > 0 then
|
|
213
|
-
temporaryEffectsCount = temporaryEffectsCount + 1
|
|
214
|
-
temporaryEffects[temporaryEffectsCount] = effect
|
|
215
|
-
temporaryEffectsDurations[temporaryEffectsCount] = duration
|
|
216
|
-
else
|
|
217
|
-
destroyEffect(effect)
|
|
218
|
-
end
|
|
219
|
-
end
|
|
220
|
-
end
|
|
221
213
|
__TS__SetDescriptor(
|
|
222
214
|
Effect.prototype,
|
|
223
215
|
"color",
|
|
224
216
|
{
|
|
225
217
|
get = function(self)
|
|
226
|
-
return self[100] or PlayerColor.
|
|
218
|
+
return self[100] or PlayerColor.red
|
|
227
219
|
end,
|
|
228
220
|
set = function(self, color)
|
|
229
221
|
setSpecialEffectColor(self.handle, color)
|
|
@@ -273,30 +265,35 @@ __TS__SetDescriptor(
|
|
|
273
265
|
},
|
|
274
266
|
true
|
|
275
267
|
)
|
|
276
|
-
|
|
268
|
+
addSpecialEffectInternal = function(modelPath, xOrWidget, yOrAttachmentPoint, parameters)
|
|
277
269
|
local coordinatesProvided = type(xOrWidget) == "number"
|
|
278
270
|
local isPositional = coordinatesProvided or (parameters and parameters.detached) == true
|
|
279
271
|
local x = not isPositional and 0 or (coordinatesProvided and xOrWidget or xOrWidget.x)
|
|
280
|
-
local y = not isPositional and 0 or (coordinatesProvided and
|
|
281
|
-
local effect = isPositional and addSpecialEffect(modelPath, x, y) or addSpecialEffectTarget(modelPath, xOrWidget.handle,
|
|
282
|
-
if isPositional and not coordinatesProvided and (parameters and parameters.scale) == nil and __TS__InstanceOf(xOrWidget, Unit) then
|
|
283
|
-
setSpecialEffectScale(effect, xOrWidget.scale)
|
|
284
|
-
end
|
|
272
|
+
local y = not isPositional and 0 or (coordinatesProvided and yOrAttachmentPoint or xOrWidget.y)
|
|
273
|
+
local effect = isPositional and addSpecialEffect(modelPath, x, y) or addSpecialEffectTarget(modelPath, xOrWidget.handle, yOrAttachmentPoint or "origin")
|
|
285
274
|
if parameters ~= nil then
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
275
|
+
if isPositional and parameters.scale == nil and __TS__InstanceOf(xOrWidget, Unit) then
|
|
276
|
+
setSpecialEffectScale(effect, xOrWidget.scale)
|
|
277
|
+
end
|
|
278
|
+
for ____, property in ipairs(setterProperties) do
|
|
279
|
+
local value = parameters[property]
|
|
280
|
+
if value ~= nil then
|
|
281
|
+
setters[property](effect, value)
|
|
289
282
|
end
|
|
290
283
|
end
|
|
291
284
|
if isPositional and parameters.zOffset ~= nil then
|
|
292
285
|
moveLocation(location, x, y)
|
|
293
286
|
local z = __TS__InstanceOf(xOrWidget, Unit) and getLocationZ(location) + xOrWidget.flyHeight or getLocationZ(location)
|
|
294
|
-
|
|
287
|
+
setSpecialEffectZ(
|
|
295
288
|
effect,
|
|
296
289
|
z + parameters.zOffset * (parameters.scaleZOffset and getSpecialEffectScale(effect) or 1)
|
|
297
290
|
)
|
|
298
291
|
end
|
|
299
292
|
end
|
|
293
|
+
return effect
|
|
294
|
+
end
|
|
295
|
+
flash = function(modelPath, xOrWidget, yOrAttachmentPoint, duration, parameters)
|
|
296
|
+
local effect = addSpecialEffectInternal(modelPath, xOrWidget, yOrAttachmentPoint, parameters)
|
|
300
297
|
if duration ~= nil and duration > 0 then
|
|
301
298
|
temporaryEffectsCount = temporaryEffectsCount + 1
|
|
302
299
|
temporaryEffects[temporaryEffectsCount] = effect
|
package/core/types/timer.d.ts
CHANGED
|
@@ -1,27 +1,26 @@
|
|
|
1
1
|
/** @noSelfInFile */
|
|
2
2
|
import { Event } from "../../event";
|
|
3
|
+
import { AbstractDestroyable, Destructor } from "../../destroyable";
|
|
3
4
|
declare const enum TimerPropertyKey {
|
|
4
5
|
HANDLE = 0,
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
ARGS_LENGTH = 4
|
|
6
|
+
DESTROY_ON_EXPIRATION = 1,
|
|
7
|
+
CALLBACK = 2,
|
|
8
|
+
ARGS_LENGTH = 3
|
|
9
9
|
}
|
|
10
|
-
export declare class Timer
|
|
10
|
+
export declare class Timer extends AbstractDestroyable {
|
|
11
11
|
private readonly [TimerPropertyKey.HANDLE];
|
|
12
|
-
private [TimerPropertyKey.DESTROYED]?;
|
|
13
12
|
private [TimerPropertyKey.DESTROY_ON_EXPIRATION]?;
|
|
14
13
|
private [TimerPropertyKey.CALLBACK]?;
|
|
15
14
|
private [TimerPropertyKey.ARGS_LENGTH]?;
|
|
16
15
|
private constructor();
|
|
17
16
|
get handle(): jtimer;
|
|
18
17
|
start<Args extends any[]>(timeout: number, periodic: boolean, callback: (...args: Args) => void, ...args: Args): void;
|
|
18
|
+
onDestroy(): Destructor;
|
|
19
19
|
get elapsed(): number;
|
|
20
20
|
get remaining(): number;
|
|
21
21
|
get timeout(): number;
|
|
22
22
|
pause(): void;
|
|
23
23
|
resume(): void;
|
|
24
|
-
destroy(): void;
|
|
25
24
|
static create(): Timer;
|
|
26
25
|
static run<Args extends any[]>(callback: (...args: Args) => void, ...args: Args): void;
|
|
27
26
|
static simple<Args extends any[]>(timeout: number, callback: (...args: Args) => void, ...args: Args): Timer;
|
package/core/types/timer.lua
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
local ____lualib = require("lualib_bundle")
|
|
2
2
|
local __TS__New = ____lualib.__TS__New
|
|
3
3
|
local __TS__Class = ____lualib.__TS__Class
|
|
4
|
+
local __TS__ClassExtends = ____lualib.__TS__ClassExtends
|
|
4
5
|
local __TS__SetDescriptor = ____lualib.__TS__SetDescriptor
|
|
5
6
|
local __TS__Promise = ____lualib.__TS__Promise
|
|
6
7
|
local ____exports = {}
|
|
@@ -9,8 +10,8 @@ local Event = ____event.Event
|
|
|
9
10
|
local InitializingEvent = ____event.InitializingEvent
|
|
10
11
|
local ____objectPool = require("util.objectPool")
|
|
11
12
|
local ObjectPool = ____objectPool.ObjectPool
|
|
12
|
-
local
|
|
13
|
-
local
|
|
13
|
+
local ____destroyable = require("destroyable")
|
|
14
|
+
local AbstractDestroyable = ____destroyable.AbstractDestroyable
|
|
14
15
|
local createTimer = CreateTimer
|
|
15
16
|
local timerStart = TimerStart
|
|
16
17
|
local pauseTimer = PauseTimer
|
|
@@ -35,14 +36,14 @@ local timerByHandleId = {}
|
|
|
35
36
|
local function timerSafeCall()
|
|
36
37
|
local timer = timerByHandleId[getHandleId(getExpiredTimer())]
|
|
37
38
|
if timer ~= nil then
|
|
38
|
-
if timer[
|
|
39
|
+
if timer[1] then
|
|
39
40
|
timer:destroy()
|
|
40
41
|
end
|
|
41
|
-
local callback = timer[
|
|
42
|
+
local callback = timer[2]
|
|
42
43
|
if callback ~= nil then
|
|
43
44
|
safeCall(
|
|
44
45
|
callback,
|
|
45
|
-
____unpack(timer,
|
|
46
|
+
____unpack(timer, 3 + 1, 3 + (timer[3] or 0))
|
|
46
47
|
)
|
|
47
48
|
end
|
|
48
49
|
end
|
|
@@ -50,37 +51,33 @@ end
|
|
|
50
51
|
____exports.Timer = __TS__Class()
|
|
51
52
|
local Timer = ____exports.Timer
|
|
52
53
|
Timer.name = "Timer"
|
|
54
|
+
__TS__ClassExtends(Timer, AbstractDestroyable)
|
|
53
55
|
function Timer.prototype.____constructor(self)
|
|
56
|
+
AbstractDestroyable.prototype.____constructor(self)
|
|
54
57
|
self[0] = get()
|
|
55
58
|
timerByHandleId[getHandleId(self[0])] = self
|
|
56
59
|
end
|
|
57
60
|
function Timer.prototype.start(self, timeout, periodic, callback, ...)
|
|
58
|
-
self[
|
|
61
|
+
self[2] = callback
|
|
59
62
|
local argsLength = select("#", ...)
|
|
60
|
-
self[
|
|
63
|
+
self[3] = argsLength
|
|
61
64
|
for i = 1, argsLength do
|
|
62
|
-
self[
|
|
65
|
+
self[3 + i] = (select(i, ...))
|
|
63
66
|
end
|
|
64
67
|
timerStart(self.handle, timeout, periodic, timerSafeCall)
|
|
65
68
|
end
|
|
69
|
+
function Timer.prototype.onDestroy(self)
|
|
70
|
+
local handle = self[0]
|
|
71
|
+
timerByHandleId[getHandleId(handle)] = nil
|
|
72
|
+
release(handle)
|
|
73
|
+
return AbstractDestroyable.prototype.onDestroy(self)
|
|
74
|
+
end
|
|
66
75
|
function Timer.prototype.pause(self)
|
|
67
76
|
pauseTimer(self[0])
|
|
68
77
|
end
|
|
69
78
|
function Timer.prototype.resume(self)
|
|
70
79
|
resumeTimer(self[0])
|
|
71
80
|
end
|
|
72
|
-
function Timer.prototype.destroy(self)
|
|
73
|
-
if self[1] then
|
|
74
|
-
error(
|
|
75
|
-
__TS__New(IllegalStateException, "Double-destroy run for timer"),
|
|
76
|
-
0
|
|
77
|
-
)
|
|
78
|
-
end
|
|
79
|
-
local handle = self[0]
|
|
80
|
-
timerByHandleId[getHandleId(handle)] = nil
|
|
81
|
-
release(handle)
|
|
82
|
-
self[1] = true
|
|
83
|
-
end
|
|
84
81
|
function Timer.create(self)
|
|
85
82
|
return __TS__New(____exports.Timer)
|
|
86
83
|
end
|
|
@@ -89,7 +86,7 @@ function Timer.run(self, callback, ...)
|
|
|
89
86
|
end
|
|
90
87
|
function Timer.simple(self, timeout, callback, ...)
|
|
91
88
|
local timer = __TS__New(____exports.Timer)
|
|
92
|
-
timer[
|
|
89
|
+
timer[1] = true
|
|
93
90
|
timer:start(timeout, false, callback, ...)
|
|
94
91
|
return timer
|
|
95
92
|
end
|
|
@@ -29,7 +29,10 @@ export declare abstract class AbilityBehavior<Parameters extends {
|
|
|
29
29
|
protected flashTargetEffect(widget: Widget, ...parametersOrDuration: [parameters?: EffectParameters] | [duration?: number, parameters?: EffectParameters]): void;
|
|
30
30
|
protected flashAreaEffect(x: number, y: number, ...parametersOrDuration: [parameters?: EffectParameters] | [duration?: number, parameters?: EffectParameters]): void;
|
|
31
31
|
protected flashEffect(x: number, y: number, ...parametersOrDuration: [parameters?: EffectParameters] | [duration?: number, parameters?: EffectParameters]): void;
|
|
32
|
-
protected flashSpecialEffect(...args: [
|
|
32
|
+
protected flashSpecialEffect(...args: [
|
|
33
|
+
...pointOrWidget: [x: number, y: number] | [widget: Widget],
|
|
34
|
+
...parametersOrDuration: [parameters?: EffectParameters] | [duration?: number, parameters?: EffectParameters]
|
|
35
|
+
]): void;
|
|
33
36
|
private static MissileLaunchConfig;
|
|
34
37
|
private get missileLaunchConfig();
|
|
35
38
|
protected onCreate(): void;
|
|
@@ -148,13 +148,14 @@ function AbilityBehavior.prototype.flashEffect(self, x, y, ...)
|
|
|
148
148
|
...
|
|
149
149
|
)
|
|
150
150
|
end
|
|
151
|
-
function AbilityBehavior.prototype.flashSpecialEffect(self, xOrWidget,
|
|
151
|
+
function AbilityBehavior.prototype.flashSpecialEffect(self, xOrWidget, yOrParametersOrDuration, durationOrParameters, parameters)
|
|
152
152
|
if type(xOrWidget) == "number" then
|
|
153
153
|
Effect:flash(
|
|
154
154
|
SPECIAL_EFFECT_MODEL_PATHS_ABILITY_STRING_ARRAY_FIELD:getValue(self.ability, 0),
|
|
155
155
|
xOrWidget,
|
|
156
|
-
|
|
157
|
-
|
|
156
|
+
yOrParametersOrDuration,
|
|
157
|
+
durationOrParameters,
|
|
158
|
+
parameters
|
|
158
159
|
)
|
|
159
160
|
else
|
|
160
161
|
local attachmentPoint = SPECIAL_EFFECT_ATTACHMENT_POINT_STRING_FIELD:getValue(self.ability)
|
|
@@ -162,7 +163,8 @@ function AbilityBehavior.prototype.flashSpecialEffect(self, xOrWidget, yOrDurati
|
|
|
162
163
|
SPECIAL_EFFECT_MODEL_PATHS_ABILITY_STRING_ARRAY_FIELD:getValue(self.ability, 0),
|
|
163
164
|
xOrWidget,
|
|
164
165
|
attachmentPoint ~= "" and attachmentPoint or "origin",
|
|
165
|
-
|
|
166
|
+
yOrParametersOrDuration,
|
|
167
|
+
durationOrParameters
|
|
166
168
|
)
|
|
167
169
|
end
|
|
168
170
|
end
|
|
@@ -2,13 +2,18 @@
|
|
|
2
2
|
import { ModelNodeName } from "./model-node-name";
|
|
3
3
|
import { ModelNodeQualifier } from "./model-node-qualifier";
|
|
4
4
|
import { Optional } from "../../../utility/types";
|
|
5
|
+
import { EffectParameters } from "../../../core/types/effect";
|
|
5
6
|
export type AttachmentPreset = {
|
|
6
7
|
modelPath: string;
|
|
7
8
|
nodeName: ModelNodeName;
|
|
8
9
|
nodeQualifiers: ModelNodeQualifier[];
|
|
9
10
|
};
|
|
10
|
-
export type
|
|
11
|
-
|
|
11
|
+
export type EffectPresetWithParameters = AttachmentPreset & {
|
|
12
|
+
parameters?: EffectParameters;
|
|
13
|
+
};
|
|
14
|
+
export type AttachmentPresetInput<T extends AttachmentPreset = AttachmentPreset> = Optional<T, "nodeName" | "nodeQualifiers"> | string;
|
|
15
|
+
export type EffectPresetWithParametersInput = AttachmentPresetInput<EffectPresetWithParameters>;
|
|
16
|
+
export declare const toEffectPreset: (effectPresetInput: EffectPresetWithParametersInput) => EffectPresetWithParameters;
|
|
12
17
|
export declare const extractAttachmentPresetInputModelPath: (attachmentPresetInput: AttachmentPresetInput | undefined) => string;
|
|
13
18
|
export declare const extractAttachmentPresetInputNodeFQN: (attachmentPresetInput: AttachmentPresetInput | undefined) => string;
|
|
14
19
|
export declare const splitAttachmentNodeFQN: (attachmentNodeFQN: string) => LuaMultiReturn<[attachmentNodeName: ModelNodeName, attachmentNodeQualifiers: ModelNodeQualifier[]]>;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
local ____lualib = require("lualib_bundle")
|
|
2
|
+
local __TS__ArrayJoin = ____lualib.__TS__ArrayJoin
|
|
2
3
|
local __TS__StringSplit = ____lualib.__TS__StringSplit
|
|
3
4
|
local __TS__ArraySlice = ____lualib.__TS__ArraySlice
|
|
4
5
|
local ____exports = {}
|
|
5
|
-
____exports.
|
|
6
|
-
return type(
|
|
6
|
+
____exports.toEffectPreset = function(effectPresetInput)
|
|
7
|
+
return type(effectPresetInput) == "string" and ({modelPath = effectPresetInput, nodeName = "origin", nodeQualifiers = {}}) or ({modelPath = effectPresetInput.modelPath, nodeName = effectPresetInput.nodeName or "origin", nodeQualifiers = effectPresetInput.nodeQualifiers or ({}), parameters = effectPresetInput.parameters})
|
|
7
8
|
end
|
|
8
9
|
____exports.extractAttachmentPresetInputModelPath = function(attachmentPresetInput)
|
|
9
10
|
return type(attachmentPresetInput) == "string" and attachmentPresetInput or (attachmentPresetInput and attachmentPresetInput.modelPath or "")
|
|
@@ -12,7 +13,7 @@ ____exports.extractAttachmentPresetInputNodeFQN = function(attachmentPresetInput
|
|
|
12
13
|
if type(attachmentPresetInput) == "string" or attachmentPresetInput == nil then
|
|
13
14
|
return ""
|
|
14
15
|
end
|
|
15
|
-
return
|
|
16
|
+
return __TS__ArrayJoin(
|
|
16
17
|
{
|
|
17
18
|
attachmentPresetInput.nodeName,
|
|
18
19
|
table.unpack(attachmentPresetInput.nodeQualifiers or ({}))
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/** @noSelfInFile */
|
|
2
|
+
import { AbilityType, AbilityTypeId } from "../ability-type";
|
|
3
|
+
import { ObjectDataEntryLevelFieldValueSupplier } from "../../entry";
|
|
4
|
+
export declare class PhaseShiftAbilityType extends AbilityType {
|
|
5
|
+
static readonly BASE_ID: AbilityTypeId;
|
|
6
|
+
get movementSpeedDecreaseFactor(): number[];
|
|
7
|
+
set movementSpeedDecreaseFactor(movementSpeedDecreaseFactor: ObjectDataEntryLevelFieldValueSupplier<number>);
|
|
8
|
+
get attackSpeedDecreaseFactor(): number[];
|
|
9
|
+
set attackSpeedDecreaseFactor(attackSpeedDecreaseFactor: ObjectDataEntryLevelFieldValueSupplier<number>);
|
|
10
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
local ____lualib = require("lualib_bundle")
|
|
2
|
+
local __TS__Class = ____lualib.__TS__Class
|
|
3
|
+
local __TS__ClassExtends = ____lualib.__TS__ClassExtends
|
|
4
|
+
local __TS__SetDescriptor = ____lualib.__TS__SetDescriptor
|
|
5
|
+
local ____exports = {}
|
|
6
|
+
local ____ability_2Dtype = require("engine.object-data.entry.ability-type")
|
|
7
|
+
local AbilityType = ____ability_2Dtype.AbilityType
|
|
8
|
+
____exports.PhaseShiftAbilityType = __TS__Class()
|
|
9
|
+
local PhaseShiftAbilityType = ____exports.PhaseShiftAbilityType
|
|
10
|
+
PhaseShiftAbilityType.name = "PhaseShiftAbilityType"
|
|
11
|
+
__TS__ClassExtends(PhaseShiftAbilityType, AbilityType)
|
|
12
|
+
PhaseShiftAbilityType.BASE_ID = fourCC("Apsh")
|
|
13
|
+
__TS__SetDescriptor(
|
|
14
|
+
PhaseShiftAbilityType.prototype,
|
|
15
|
+
"movementSpeedDecreaseFactor",
|
|
16
|
+
{
|
|
17
|
+
get = function(self)
|
|
18
|
+
return self:getNumberLevelField("Hbn1")
|
|
19
|
+
end,
|
|
20
|
+
set = function(self, movementSpeedDecreaseFactor)
|
|
21
|
+
self:setNumberLevelField("Hbn1", movementSpeedDecreaseFactor)
|
|
22
|
+
end
|
|
23
|
+
},
|
|
24
|
+
true
|
|
25
|
+
)
|
|
26
|
+
__TS__SetDescriptor(
|
|
27
|
+
PhaseShiftAbilityType.prototype,
|
|
28
|
+
"attackSpeedDecreaseFactor",
|
|
29
|
+
{
|
|
30
|
+
get = function(self)
|
|
31
|
+
return self:getNumberLevelField("Hbn2")
|
|
32
|
+
end,
|
|
33
|
+
set = function(self, attackSpeedDecreaseFactor)
|
|
34
|
+
self:setNumberLevelField("Hbn2", attackSpeedDecreaseFactor)
|
|
35
|
+
end
|
|
36
|
+
},
|
|
37
|
+
true
|
|
38
|
+
)
|
|
39
|
+
return ____exports
|
|
@@ -7,4 +7,8 @@ export declare class ShockWaveAbilityType extends AbilityType {
|
|
|
7
7
|
set damagePerTarget(damagePerTarget: ObjectDataEntryLevelFieldValueSupplier<number>);
|
|
8
8
|
get maximumTotalDamage(): number[];
|
|
9
9
|
set maximumTotalDamage(maximumTotalDamage: ObjectDataEntryLevelFieldValueSupplier<number>);
|
|
10
|
+
get distance(): number[];
|
|
11
|
+
set distance(distance: ObjectDataEntryLevelFieldValueSupplier<number>);
|
|
12
|
+
get finalAreaOfEffect(): number[];
|
|
13
|
+
set finalAreaOfEffect(finalAreaOfEffect: ObjectDataEntryLevelFieldValueSupplier<number>);
|
|
10
14
|
}
|
|
@@ -36,4 +36,30 @@ __TS__SetDescriptor(
|
|
|
36
36
|
},
|
|
37
37
|
true
|
|
38
38
|
)
|
|
39
|
+
__TS__SetDescriptor(
|
|
40
|
+
ShockWaveAbilityType.prototype,
|
|
41
|
+
"distance",
|
|
42
|
+
{
|
|
43
|
+
get = function(self)
|
|
44
|
+
return self:getNumberLevelField("Osh3")
|
|
45
|
+
end,
|
|
46
|
+
set = function(self, distance)
|
|
47
|
+
self:setNumberLevelField("Osh3", distance)
|
|
48
|
+
end
|
|
49
|
+
},
|
|
50
|
+
true
|
|
51
|
+
)
|
|
52
|
+
__TS__SetDescriptor(
|
|
53
|
+
ShockWaveAbilityType.prototype,
|
|
54
|
+
"finalAreaOfEffect",
|
|
55
|
+
{
|
|
56
|
+
get = function(self)
|
|
57
|
+
return self:getNumberLevelField("Osh4")
|
|
58
|
+
end,
|
|
59
|
+
set = function(self, finalAreaOfEffect)
|
|
60
|
+
self:setNumberLevelField("Osh4", finalAreaOfEffect)
|
|
61
|
+
end
|
|
62
|
+
},
|
|
63
|
+
true
|
|
64
|
+
)
|
|
39
65
|
return ____exports
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/** @noSelfInFile */
|
|
2
|
+
import { AbilityType, AbilityTypeId } from "../ability-type";
|
|
3
|
+
import { ObjectDataEntryLevelFieldValueSupplier } from "../../entry";
|
|
4
|
+
export declare class WebAbilityType extends AbilityType {
|
|
5
|
+
static readonly BASE_ID: AbilityTypeId;
|
|
6
|
+
get airUnitLoweringDuration(): number[];
|
|
7
|
+
set airUnitLoweringDuration(airUnitLoweringDuration: ObjectDataEntryLevelFieldValueSupplier<number>);
|
|
8
|
+
get airUnitHeight(): number[];
|
|
9
|
+
set airUnitHeight(airUnitHeight: ObjectDataEntryLevelFieldValueSupplier<number>);
|
|
10
|
+
get meleeAttackRange(): number[];
|
|
11
|
+
set meleeAttackRange(meleeAttackRange: ObjectDataEntryLevelFieldValueSupplier<number>);
|
|
12
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
local ____lualib = require("lualib_bundle")
|
|
2
|
+
local __TS__Class = ____lualib.__TS__Class
|
|
3
|
+
local __TS__ClassExtends = ____lualib.__TS__ClassExtends
|
|
4
|
+
local __TS__SetDescriptor = ____lualib.__TS__SetDescriptor
|
|
5
|
+
local ____exports = {}
|
|
6
|
+
local ____ability_2Dtype = require("engine.object-data.entry.ability-type")
|
|
7
|
+
local AbilityType = ____ability_2Dtype.AbilityType
|
|
8
|
+
____exports.WebAbilityType = __TS__Class()
|
|
9
|
+
local WebAbilityType = ____exports.WebAbilityType
|
|
10
|
+
WebAbilityType.name = "WebAbilityType"
|
|
11
|
+
__TS__ClassExtends(WebAbilityType, AbilityType)
|
|
12
|
+
WebAbilityType.BASE_ID = fourCC("Aweb")
|
|
13
|
+
__TS__SetDescriptor(
|
|
14
|
+
WebAbilityType.prototype,
|
|
15
|
+
"airUnitLoweringDuration",
|
|
16
|
+
{
|
|
17
|
+
get = function(self)
|
|
18
|
+
return self:getNumberLevelField("Ens1")
|
|
19
|
+
end,
|
|
20
|
+
set = function(self, airUnitLoweringDuration)
|
|
21
|
+
self:setNumberLevelField("Ens1", airUnitLoweringDuration)
|
|
22
|
+
end
|
|
23
|
+
},
|
|
24
|
+
true
|
|
25
|
+
)
|
|
26
|
+
__TS__SetDescriptor(
|
|
27
|
+
WebAbilityType.prototype,
|
|
28
|
+
"airUnitHeight",
|
|
29
|
+
{
|
|
30
|
+
get = function(self)
|
|
31
|
+
return self:getNumberLevelField("Ens2")
|
|
32
|
+
end,
|
|
33
|
+
set = function(self, airUnitHeight)
|
|
34
|
+
self:setNumberLevelField("Ens2", airUnitHeight)
|
|
35
|
+
end
|
|
36
|
+
},
|
|
37
|
+
true
|
|
38
|
+
)
|
|
39
|
+
__TS__SetDescriptor(
|
|
40
|
+
WebAbilityType.prototype,
|
|
41
|
+
"meleeAttackRange",
|
|
42
|
+
{
|
|
43
|
+
get = function(self)
|
|
44
|
+
return self:getNumberLevelField("Ens3")
|
|
45
|
+
end,
|
|
46
|
+
set = function(self, meleeAttackRange)
|
|
47
|
+
self:setNumberLevelField("Ens3", meleeAttackRange)
|
|
48
|
+
end
|
|
49
|
+
},
|
|
50
|
+
true
|
|
51
|
+
)
|
|
52
|
+
return ____exports
|
|
@@ -3,7 +3,7 @@ import "../../internal/unit/ability";
|
|
|
3
3
|
import { TupleOf } from "../../../utility/types";
|
|
4
4
|
import { AnimationName } from "../auxiliary/animation-name";
|
|
5
5
|
import { AnimationQualifier } from "../auxiliary/animation-qualifier";
|
|
6
|
-
import {
|
|
6
|
+
import { AttachmentPresetInput, EffectPresetWithParameters, EffectPresetWithParametersInput } from "../auxiliary/attachment-preset";
|
|
7
7
|
import { CombatClassifications } from "../auxiliary/combat-classification";
|
|
8
8
|
import { Race } from "../auxiliary/race";
|
|
9
9
|
import { TechTreeDependency, TechTreeDependencyInput } from "../auxiliary/tech-tree-dependency";
|
|
@@ -27,11 +27,11 @@ export declare abstract class AbilityType extends ObjectDataEntry<AbilityTypeId>
|
|
|
27
27
|
set buttonPositionX(buttonPositionX: number);
|
|
28
28
|
get buttonPositionY(): number;
|
|
29
29
|
set buttonPositionY(buttonPositionY: number);
|
|
30
|
-
get casterCastingEffectPresets():
|
|
31
|
-
set casterCastingEffectPresets(casterCastingEffectPresets:
|
|
32
|
-
get casterChannelingEffectPresets():
|
|
33
|
-
set casterChannelingEffectPresets(casterChannelingEffectPresets:
|
|
34
|
-
get casterAttachmentPresets(): TupleOf<
|
|
30
|
+
get casterCastingEffectPresets(): EffectPresetWithParameters[];
|
|
31
|
+
set casterCastingEffectPresets(casterCastingEffectPresets: EffectPresetWithParametersInput[]);
|
|
32
|
+
get casterChannelingEffectPresets(): EffectPresetWithParameters[];
|
|
33
|
+
set casterChannelingEffectPresets(casterChannelingEffectPresets: EffectPresetWithParametersInput[]);
|
|
34
|
+
get casterAttachmentPresets(): TupleOf<EffectPresetWithParameters, 0 | 1 | 2>;
|
|
35
35
|
set casterAttachmentPresets(casterAttachmentPresets: TupleOf<AttachmentPresetInput, 0 | 1 | 2>);
|
|
36
36
|
get effectModelPaths(): string[];
|
|
37
37
|
set effectModelPaths(effectModelPaths: string[]);
|
|
@@ -63,15 +63,15 @@ export declare abstract class AbilityType extends ObjectDataEntry<AbilityTypeId>
|
|
|
63
63
|
set missileMovementArc(missileMovementArc: number);
|
|
64
64
|
get missileMovementSpeed(): number;
|
|
65
65
|
set missileMovementSpeed(missileMovementSpeed: number);
|
|
66
|
-
get specialAttachmentPreset():
|
|
66
|
+
get specialAttachmentPreset(): EffectPresetWithParameters | undefined;
|
|
67
67
|
set specialAttachmentPreset(specialAttachmentPreset: AttachmentPresetInput | undefined);
|
|
68
|
-
get targetCastingEffectPresets():
|
|
68
|
+
get targetCastingEffectPresets(): EffectPresetWithParameters[];
|
|
69
69
|
set targetCastingEffectPresets(targetCastingEffectPresets: AttachmentPresetInput[]);
|
|
70
|
-
get targetEffectPresets(): TupleOf<
|
|
70
|
+
get targetEffectPresets(): TupleOf<EffectPresetWithParameters, 0 | 1 | 2 | 3 | 4 | 5 | 6>;
|
|
71
71
|
set targetEffectPresets(targetEffectPresets: TupleOf<AttachmentPresetInput, 0 | 1 | 2 | 3 | 4 | 5 | 6>);
|
|
72
|
-
get targetEffectPresetsSD(): TupleOf<
|
|
72
|
+
get targetEffectPresetsSD(): TupleOf<EffectPresetWithParameters, 0 | 1 | 2 | 3 | 4 | 5 | 6>;
|
|
73
73
|
set targetEffectPresetsSD(targetEffectPresetsSD: TupleOf<AttachmentPresetInput, 0 | 1 | 2 | 3 | 4 | 5 | 6>);
|
|
74
|
-
get targetEffectPresetsHD(): TupleOf<
|
|
74
|
+
get targetEffectPresetsHD(): TupleOf<EffectPresetWithParameters, 0 | 1 | 2 | 3 | 4 | 5 | 6>;
|
|
75
75
|
set targetEffectPresetsHD(targetEffectPresetsHD: TupleOf<AttachmentPresetInput, 0 | 1 | 2 | 3 | 4 | 5 | 6>);
|
|
76
76
|
get turnOffButtonPositionX(): number;
|
|
77
77
|
set turnOffButtonPositionX(buttonPositionX: number);
|
|
@@ -20,7 +20,7 @@ local mapIndexed = ____arrays.mapIndexed
|
|
|
20
20
|
local ____attachment_2Dpreset = require("engine.object-data.auxiliary.attachment-preset")
|
|
21
21
|
local extractAttachmentPresetInputModelPath = ____attachment_2Dpreset.extractAttachmentPresetInputModelPath
|
|
22
22
|
local extractAttachmentPresetInputNodeFQN = ____attachment_2Dpreset.extractAttachmentPresetInputNodeFQN
|
|
23
|
-
local
|
|
23
|
+
local toEffectPreset = ____attachment_2Dpreset.toEffectPreset
|
|
24
24
|
local ____combat_2Dclassification = require("engine.object-data.auxiliary.combat-classification")
|
|
25
25
|
local combatClassificationsToStringArray = ____combat_2Dclassification.combatClassificationsToStringArray
|
|
26
26
|
local stringArrayToCombatClassifications = ____combat_2Dclassification.stringArrayToCombatClassifications
|
|
@@ -118,7 +118,7 @@ __TS__SetDescriptor(
|
|
|
118
118
|
return casterCastingEffectPresetsByAbilityTypeId[self.id] or ({})
|
|
119
119
|
end,
|
|
120
120
|
set = function(self, casterCastingEffectPresets)
|
|
121
|
-
casterCastingEffectPresetsByAbilityTypeId[self.id] = map(casterCastingEffectPresets,
|
|
121
|
+
casterCastingEffectPresetsByAbilityTypeId[self.id] = map(casterCastingEffectPresets, toEffectPreset)
|
|
122
122
|
end
|
|
123
123
|
},
|
|
124
124
|
true
|
|
@@ -131,7 +131,7 @@ __TS__SetDescriptor(
|
|
|
131
131
|
return casterChannelingEffectPresetsByAbilityTypeId[self.id] or ({})
|
|
132
132
|
end,
|
|
133
133
|
set = function(self, casterChannelingEffectPresets)
|
|
134
|
-
casterChannelingEffectPresetsByAbilityTypeId[self.id] = map(casterChannelingEffectPresets,
|
|
134
|
+
casterChannelingEffectPresetsByAbilityTypeId[self.id] = map(casterChannelingEffectPresets, toEffectPreset)
|
|
135
135
|
end
|
|
136
136
|
},
|
|
137
137
|
true
|
|
@@ -370,7 +370,7 @@ __TS__SetDescriptor(
|
|
|
370
370
|
return targetCastingEffectPresetsByAbilityTypeId[self.id] or ({})
|
|
371
371
|
end,
|
|
372
372
|
set = function(self, targetCastingEffectPresets)
|
|
373
|
-
targetCastingEffectPresetsByAbilityTypeId[self.id] = map(targetCastingEffectPresets,
|
|
373
|
+
targetCastingEffectPresetsByAbilityTypeId[self.id] = map(targetCastingEffectPresets, toEffectPreset)
|
|
374
374
|
end
|
|
375
375
|
},
|
|
376
376
|
true
|
|
@@ -1017,10 +1017,17 @@ local casterCastingEffectAttachmentPointsByAbilityTypeId = postcompile(function(
|
|
|
1017
1017
|
function(casterCastingEffectPresets) return map(casterCastingEffectPresets, extractAttachmentPresetInputNodeFQN) end
|
|
1018
1018
|
)
|
|
1019
1019
|
end)
|
|
1020
|
+
local casterCastingEffectParametersByAbilityTypeId = postcompile(function()
|
|
1021
|
+
return mapValues(
|
|
1022
|
+
casterCastingEffectPresetsByAbilityTypeId,
|
|
1023
|
+
function(casterCastingEffectPresets) return map(casterCastingEffectPresets, "parameters") end
|
|
1024
|
+
)
|
|
1025
|
+
end)
|
|
1020
1026
|
local casterCastingEffectsByCaster = {}
|
|
1021
1027
|
local function handleAbilityCastingStartEvent(caster, ability)
|
|
1022
1028
|
local effectModelPaths = casterCastingEffectModelPathsByAbilityTypeId[ability.typeId]
|
|
1023
1029
|
local attachmentPoints = casterCastingEffectAttachmentPointsByAbilityTypeId[ability.typeId]
|
|
1030
|
+
local parameters = casterCastingEffectParametersByAbilityTypeId[ability.typeId]
|
|
1024
1031
|
local effects = {}
|
|
1025
1032
|
if effectModelPaths ~= nil then
|
|
1026
1033
|
for i = 1, #effectModelPaths do
|
|
@@ -1029,7 +1036,7 @@ local function handleAbilityCastingStartEvent(caster, ability)
|
|
|
1029
1036
|
if attachmentPoint == nil or attachmentPoint == "" then
|
|
1030
1037
|
attachmentPoint = "origin"
|
|
1031
1038
|
end
|
|
1032
|
-
effects[i] = Effect:
|
|
1039
|
+
effects[i] = Effect:create(effectModelPath, caster, attachmentPoint, parameters and parameters[i])
|
|
1033
1040
|
end
|
|
1034
1041
|
end
|
|
1035
1042
|
casterCastingEffectsByCaster[caster] = effects
|
|
@@ -1060,10 +1067,17 @@ local casterChannelingEffectAttachmentPointsByAbilityTypeId = postcompile(functi
|
|
|
1060
1067
|
function(casterChannelingEffectPresets) return map(casterChannelingEffectPresets, extractAttachmentPresetInputNodeFQN) end
|
|
1061
1068
|
)
|
|
1062
1069
|
end)
|
|
1070
|
+
local casterChannelingEffectParametersByAbilityTypeId = postcompile(function()
|
|
1071
|
+
return mapValues(
|
|
1072
|
+
casterChannelingEffectPresetsByAbilityTypeId,
|
|
1073
|
+
function(casterChannelingEffectPresets) return map(casterChannelingEffectPresets, "parameters") end
|
|
1074
|
+
)
|
|
1075
|
+
end)
|
|
1063
1076
|
local casterChannelingEffectsByCaster = {}
|
|
1064
1077
|
local function handleAbilityChannelingStartEvent(caster, ability)
|
|
1065
1078
|
local effectModelPaths = casterChannelingEffectModelPathsByAbilityTypeId[ability.typeId]
|
|
1066
1079
|
local attachmentPoints = casterChannelingEffectAttachmentPointsByAbilityTypeId[ability.typeId]
|
|
1080
|
+
local parameters = casterChannelingEffectParametersByAbilityTypeId[ability.typeId]
|
|
1067
1081
|
local effects = {}
|
|
1068
1082
|
if effectModelPaths ~= nil then
|
|
1069
1083
|
for i = 1, #effectModelPaths do
|
|
@@ -1072,7 +1086,7 @@ local function handleAbilityChannelingStartEvent(caster, ability)
|
|
|
1072
1086
|
if attachmentPoint == nil or attachmentPoint == "" then
|
|
1073
1087
|
attachmentPoint = "origin"
|
|
1074
1088
|
end
|
|
1075
|
-
effects[i] = Effect:
|
|
1089
|
+
effects[i] = Effect:create(effectModelPath, caster, attachmentPoint, parameters and parameters[i])
|
|
1076
1090
|
end
|
|
1077
1091
|
end
|
|
1078
1092
|
casterChannelingEffectsByCaster[caster] = effects
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json.schemastore.org/package",
|
|
3
3
|
"name": "warscript",
|
|
4
|
-
"version": "0.0.1-dev.
|
|
4
|
+
"version": "0.0.1-dev.f5421e8",
|
|
5
5
|
"description": "A typescript library for Warcraft III using Warpack.",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"warcraft",
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"@warscript/language-extensions": "^0.0.1",
|
|
25
25
|
"@warscript/tstl-plugin": "^0.0.4",
|
|
26
26
|
"lua-types": "^2.13.1",
|
|
27
|
-
"warpack": "0.0.1-dev.
|
|
27
|
+
"warpack": "0.0.1-dev.8e8a660"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
30
|
"@typescript-eslint/eslint-plugin": "^8.13.0",
|