warscript 0.0.1-dev.524f1b8 → 0.0.1-dev.5619a0e

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.
@@ -30,10 +30,12 @@ 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), modelPath: string, xOrWidget: number | Widget, yOrAttachmentPoint?: number | string, parameters?: EffectParameters): T;
33
+ static create<T extends Effect>(this: typeof Effect & (new (handle: jeffect) => T), model: string, pos: Vec2): T;
34
+ static createTarget<T extends Effect>(this: typeof Effect & (new (handle: jeffect) => T), model: string, target: Widget, attachPoint: string): T;
34
35
  static flash(modelPath: string, ...args: [
35
36
  ...pointOrWidget: [x: number, y: number] | [widget: Widget, attachmentPoint?: string],
36
37
  ...parametersOrDuration: [parametersOrDuration?: EffectParameters | number] | [duration?: number, parameters?: EffectParameters]
37
38
  ]): void;
39
+ static flashTarget(model: string, target: Widget, attachPoint: string, duration?: number): void;
38
40
  }
39
41
  export {};
@@ -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, addSpecialEffectInternal, flash
7
+ local dummyPlayer, flash
8
8
  local ____handle = require("core.types.handle")
9
9
  local Handle = ____handle.Handle
10
10
  local ____playerColor = require("core.types.playerColor")
@@ -119,7 +119,6 @@ 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"}
123
122
  dummyPlayer = Player.neutralExtra
124
123
  local temporaryEffects = {}
125
124
  local temporaryEffectsDurations = {}
@@ -178,14 +177,11 @@ function Effect.prototype.onDestroy(self)
178
177
  destroyEffect(self.handle)
179
178
  return Handle.prototype.onDestroy(self)
180
179
  end
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
180
+ function Effect.create(self, model, pos)
181
+ return self:of(addSpecialEffect(model, pos.x, pos.y))
182
+ end
183
+ function Effect.createTarget(self, model, target, attachPoint)
184
+ return self:of(addSpecialEffectTarget(model, target.handle, attachPoint))
189
185
  end
190
186
  function Effect.flash(self, modelPath, xOrWidget, yOrOrAttachmentPoint, parametersOrDuration, parameters)
191
187
  if type(parametersOrDuration) ~= "number" then
@@ -210,12 +206,24 @@ function Effect.flash(self, modelPath, xOrWidget, yOrOrAttachmentPoint, paramete
210
206
  parameters
211
207
  )
212
208
  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
213
221
  __TS__SetDescriptor(
214
222
  Effect.prototype,
215
223
  "color",
216
224
  {
217
225
  get = function(self)
218
- return self[100] or PlayerColor.red
226
+ return self[100] or PlayerColor.black
219
227
  end,
220
228
  set = function(self, color)
221
229
  setSpecialEffectColor(self.handle, color)
@@ -265,35 +273,30 @@ __TS__SetDescriptor(
265
273
  },
266
274
  true
267
275
  )
268
- addSpecialEffectInternal = function(modelPath, xOrWidget, yOrAttachmentPoint, parameters)
276
+ flash = function(modelPath, xOrWidget, yOrOrAttachmentPoint, duration, parameters)
269
277
  local coordinatesProvided = type(xOrWidget) == "number"
270
278
  local isPositional = coordinatesProvided or (parameters and parameters.detached) == true
271
279
  local x = not isPositional and 0 or (coordinatesProvided and xOrWidget or xOrWidget.x)
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")
280
+ local y = not isPositional and 0 or (coordinatesProvided and yOrOrAttachmentPoint or xOrWidget.y)
281
+ local effect = isPositional and addSpecialEffect(modelPath, x, y) or addSpecialEffectTarget(modelPath, xOrWidget.handle, yOrOrAttachmentPoint or "origin")
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
274
285
  if parameters ~= nil then
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)
286
+ for key, value in ____pairs(parameters) do
287
+ if key ~= "zOffset" and key ~= "detached" and key ~= "scaleZOffset" and key ~= "delay" then
288
+ setters[key](effect, value)
282
289
  end
283
290
  end
284
291
  if isPositional and parameters.zOffset ~= nil then
285
292
  moveLocation(location, x, y)
286
293
  local z = __TS__InstanceOf(xOrWidget, Unit) and getLocationZ(location) + xOrWidget.flyHeight or getLocationZ(location)
287
- setSpecialEffectZ(
294
+ BlzSetSpecialEffectZ(
288
295
  effect,
289
296
  z + parameters.zOffset * (parameters.scaleZOffset and getSpecialEffectScale(effect) or 1)
290
297
  )
291
298
  end
292
299
  end
293
- return effect
294
- end
295
- flash = function(modelPath, xOrWidget, yOrAttachmentPoint, duration, parameters)
296
- local effect = addSpecialEffectInternal(modelPath, xOrWidget, yOrAttachmentPoint, parameters)
297
300
  if duration ~= nil and duration > 0 then
298
301
  temporaryEffectsCount = temporaryEffectsCount + 1
299
302
  temporaryEffects[temporaryEffectsCount] = effect
@@ -121,11 +121,6 @@ local customSoundPresetDataByLabel = postcompile(function()
121
121
  end
122
122
  return customSoundPresetDataByLabel
123
123
  end)
124
- ---
125
- -- @internal For use by internal systems only.
126
- ____exports.isSoundLabelCustom = function(label)
127
- return customSoundPresetDataByLabel[label] ~= nil
128
- end
129
124
  local function createPresetSound(fileName, preset)
130
125
  local ____fileName_1 = fileName
131
126
  local ____preset_looping_0 = preset.looping
@@ -1,26 +1,27 @@
1
1
  /** @noSelfInFile */
2
2
  import { Event } from "../../event";
3
- import { AbstractDestroyable, Destructor } from "../../destroyable";
4
3
  declare const enum TimerPropertyKey {
5
4
  HANDLE = 0,
6
- DESTROY_ON_EXPIRATION = 1,
7
- CALLBACK = 2,
8
- ARGS_LENGTH = 3
5
+ DESTROYED = 1,
6
+ DESTROY_ON_EXPIRATION = 2,
7
+ CALLBACK = 3,
8
+ ARGS_LENGTH = 4
9
9
  }
10
- export declare class Timer extends AbstractDestroyable {
10
+ export declare class Timer implements Destroyable {
11
11
  private readonly [TimerPropertyKey.HANDLE];
12
+ private [TimerPropertyKey.DESTROYED]?;
12
13
  private [TimerPropertyKey.DESTROY_ON_EXPIRATION]?;
13
14
  private [TimerPropertyKey.CALLBACK]?;
14
15
  private [TimerPropertyKey.ARGS_LENGTH]?;
15
16
  private constructor();
16
17
  get handle(): jtimer;
17
18
  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;
24
25
  static create(): Timer;
25
26
  static run<Args extends any[]>(callback: (...args: Args) => void, ...args: Args): void;
26
27
  static simple<Args extends any[]>(timeout: number, callback: (...args: Args) => void, ...args: Args): Timer;
@@ -1,7 +1,6 @@
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
5
4
  local __TS__SetDescriptor = ____lualib.__TS__SetDescriptor
6
5
  local __TS__Promise = ____lualib.__TS__Promise
7
6
  local ____exports = {}
@@ -10,8 +9,8 @@ local Event = ____event.Event
10
9
  local InitializingEvent = ____event.InitializingEvent
11
10
  local ____objectPool = require("util.objectPool")
12
11
  local ObjectPool = ____objectPool.ObjectPool
13
- local ____destroyable = require("destroyable")
14
- local AbstractDestroyable = ____destroyable.AbstractDestroyable
12
+ local ____exception = require("exception")
13
+ local IllegalStateException = ____exception.IllegalStateException
15
14
  local createTimer = CreateTimer
16
15
  local timerStart = TimerStart
17
16
  local pauseTimer = PauseTimer
@@ -36,14 +35,14 @@ local timerByHandleId = {}
36
35
  local function timerSafeCall()
37
36
  local timer = timerByHandleId[getHandleId(getExpiredTimer())]
38
37
  if timer ~= nil then
39
- if timer[1] then
38
+ if timer[2] then
40
39
  timer:destroy()
41
40
  end
42
- local callback = timer[2]
41
+ local callback = timer[3]
43
42
  if callback ~= nil then
44
43
  safeCall(
45
44
  callback,
46
- ____unpack(timer, 3 + 1, 3 + (timer[3] or 0))
45
+ ____unpack(timer, 4 + 1, 4 + (timer[4] or 0))
47
46
  )
48
47
  end
49
48
  end
@@ -51,33 +50,37 @@ end
51
50
  ____exports.Timer = __TS__Class()
52
51
  local Timer = ____exports.Timer
53
52
  Timer.name = "Timer"
54
- __TS__ClassExtends(Timer, AbstractDestroyable)
55
53
  function Timer.prototype.____constructor(self)
56
- AbstractDestroyable.prototype.____constructor(self)
57
54
  self[0] = get()
58
55
  timerByHandleId[getHandleId(self[0])] = self
59
56
  end
60
57
  function Timer.prototype.start(self, timeout, periodic, callback, ...)
61
- self[2] = callback
58
+ self[3] = callback
62
59
  local argsLength = select("#", ...)
63
- self[3] = argsLength
60
+ self[4] = argsLength
64
61
  for i = 1, argsLength do
65
- self[3 + i] = (select(i, ...))
62
+ self[4 + i] = (select(i, ...))
66
63
  end
67
64
  timerStart(self.handle, timeout, periodic, timerSafeCall)
68
65
  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
75
66
  function Timer.prototype.pause(self)
76
67
  pauseTimer(self[0])
77
68
  end
78
69
  function Timer.prototype.resume(self)
79
70
  resumeTimer(self[0])
80
71
  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
81
84
  function Timer.create(self)
82
85
  return __TS__New(____exports.Timer)
83
86
  end
@@ -86,7 +89,7 @@ function Timer.run(self, callback, ...)
86
89
  end
87
90
  function Timer.simple(self, timeout, callback, ...)
88
91
  local timer = __TS__New(____exports.Timer)
89
- timer[1] = true
92
+ timer[2] = true
90
93
  timer:start(timeout, false, callback, ...)
91
94
  return timer
92
95
  end
@@ -29,10 +29,7 @@ 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: [
33
- ...pointOrWidget: [x: number, y: number] | [widget: Widget],
34
- ...parametersOrDuration: [parameters?: EffectParameters] | [duration?: number, parameters?: EffectParameters]
35
- ]): void;
32
+ protected flashSpecialEffect(...args: [...pointOrWidget: [x: number, y: number] | [widget: Widget], duration?: number]): void;
36
33
  private static MissileLaunchConfig;
37
34
  private get missileLaunchConfig();
38
35
  protected onCreate(): void;
@@ -148,14 +148,13 @@ function AbilityBehavior.prototype.flashEffect(self, x, y, ...)
148
148
  ...
149
149
  )
150
150
  end
151
- function AbilityBehavior.prototype.flashSpecialEffect(self, xOrWidget, yOrParametersOrDuration, durationOrParameters, parameters)
151
+ function AbilityBehavior.prototype.flashSpecialEffect(self, xOrWidget, yOrDuration, duration)
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
- yOrParametersOrDuration,
157
- durationOrParameters,
158
- parameters
156
+ yOrDuration,
157
+ duration
159
158
  )
160
159
  else
161
160
  local attachmentPoint = SPECIAL_EFFECT_ATTACHMENT_POINT_STRING_FIELD:getValue(self.ability)
@@ -163,8 +162,7 @@ function AbilityBehavior.prototype.flashSpecialEffect(self, xOrWidget, yOrParame
163
162
  SPECIAL_EFFECT_MODEL_PATHS_ABILITY_STRING_ARRAY_FIELD:getValue(self.ability, 0),
164
163
  xOrWidget,
165
164
  attachmentPoint ~= "" and attachmentPoint or "origin",
166
- yOrParametersOrDuration,
167
- durationOrParameters
165
+ yOrDuration
168
166
  )
169
167
  end
170
168
  end
@@ -2,18 +2,13 @@
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";
6
5
  export type AttachmentPreset = {
7
6
  modelPath: string;
8
7
  nodeName: ModelNodeName;
9
8
  nodeQualifiers: ModelNodeQualifier[];
10
9
  };
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;
10
+ export type AttachmentPresetInput = Optional<AttachmentPreset, "nodeQualifiers"> | string;
11
+ export declare const toAttachmentPreset: (attachmentPresetInput: AttachmentPresetInput) => AttachmentPreset;
17
12
  export declare const extractAttachmentPresetInputModelPath: (attachmentPresetInput: AttachmentPresetInput | undefined) => string;
18
13
  export declare const extractAttachmentPresetInputNodeFQN: (attachmentPresetInput: AttachmentPresetInput | undefined) => string;
19
14
  export declare const splitAttachmentNodeFQN: (attachmentNodeFQN: string) => LuaMultiReturn<[attachmentNodeName: ModelNodeName, attachmentNodeQualifiers: ModelNodeQualifier[]]>;
@@ -1,10 +1,9 @@
1
1
  local ____lualib = require("lualib_bundle")
2
- local __TS__ArrayJoin = ____lualib.__TS__ArrayJoin
3
2
  local __TS__StringSplit = ____lualib.__TS__StringSplit
4
3
  local __TS__ArraySlice = ____lualib.__TS__ArraySlice
5
4
  local ____exports = {}
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})
5
+ ____exports.toAttachmentPreset = function(attachmentPresetInput)
6
+ return type(attachmentPresetInput) == "string" and ({modelPath = attachmentPresetInput, nodeName = "origin", nodeQualifiers = {}}) or ({modelPath = attachmentPresetInput.modelPath, nodeName = attachmentPresetInput.nodeName, nodeQualifiers = attachmentPresetInput.nodeQualifiers or ({})})
8
7
  end
9
8
  ____exports.extractAttachmentPresetInputModelPath = function(attachmentPresetInput)
10
9
  return type(attachmentPresetInput) == "string" and attachmentPresetInput or (attachmentPresetInput and attachmentPresetInput.modelPath or "")
@@ -13,7 +12,7 @@ ____exports.extractAttachmentPresetInputNodeFQN = function(attachmentPresetInput
13
12
  if type(attachmentPresetInput) == "string" or attachmentPresetInput == nil then
14
13
  return ""
15
14
  end
16
- return __TS__ArrayJoin(
15
+ return table.concat(
17
16
  {
18
17
  attachmentPresetInput.nodeName,
19
18
  table.unpack(attachmentPresetInput.nodeQualifiers or ({}))
@@ -7,6 +7,4 @@ export declare class BerserkAbilityType extends AbilityType {
7
7
  set movementSpeedIncreaseFactor(movementSpeedIncreaseFactor: ObjectDataEntryLevelFieldValueSupplier<number>);
8
8
  get attackSpeedIncreaseFactor(): number[];
9
9
  set attackSpeedIncreaseFactor(attackSpeedIncreaseFactor: ObjectDataEntryLevelFieldValueSupplier<number>);
10
- get receivedDamageIncreaseFactor(): number[];
11
- set receivedDamageIncreaseFactor(receivedDamageIncreaseFactor: ObjectDataEntryLevelFieldValueSupplier<number>);
12
10
  }
@@ -36,17 +36,4 @@ __TS__SetDescriptor(
36
36
  },
37
37
  true
38
38
  )
39
- __TS__SetDescriptor(
40
- BerserkAbilityType.prototype,
41
- "receivedDamageIncreaseFactor",
42
- {
43
- get = function(self)
44
- return self:getNumberLevelField("bsk3")
45
- end,
46
- set = function(self, receivedDamageIncreaseFactor)
47
- self:setNumberLevelField("bsk3", receivedDamageIncreaseFactor)
48
- end
49
- },
50
- true
51
- )
52
39
  return ____exports
@@ -9,14 +9,4 @@ export declare class SlowPoisonAbilityType extends AbilityType {
9
9
  set movementSpeedDecreaseFactor(movementSpeedDecreaseFactor: ObjectDataEntryLevelFieldValueSupplier<number>);
10
10
  get attackSpeedDecreaseFactor(): number[];
11
11
  set attackSpeedDecreaseFactor(attackSpeedDecreaseFactor: ObjectDataEntryLevelFieldValueSupplier<number>);
12
- get isDamageStacking(): boolean[];
13
- set isDamageStacking(isDamageStacking: ObjectDataEntryLevelFieldValueSupplier<boolean>);
14
- get isMovementSpeedFactorStacking(): boolean[];
15
- set isMovementSpeedFactorStacking(isMovementSpeedFactorStacking: ObjectDataEntryLevelFieldValueSupplier<boolean>);
16
- get isAttackSpeedFactorStacking(): boolean[];
17
- set isAttackSpeedFactorStacking(isAttackSpeedFactorStacking: ObjectDataEntryLevelFieldValueSupplier<boolean>);
18
- get isAbleToKill(): boolean[];
19
- set isAbleToKill(isAbleToKill: ObjectDataEntryLevelFieldValueSupplier<boolean>);
20
- private setOption;
21
- private getOption;
22
12
  }
@@ -9,12 +9,6 @@ ____exports.SlowPoisonAbilityType = __TS__Class()
9
9
  local SlowPoisonAbilityType = ____exports.SlowPoisonAbilityType
10
10
  SlowPoisonAbilityType.name = "SlowPoisonAbilityType"
11
11
  __TS__ClassExtends(SlowPoisonAbilityType, AbilityType)
12
- function SlowPoisonAbilityType.prototype.setOption(self, option, supplier)
13
- self:setFlagLevelFieldValue("Spo4", option, supplier)
14
- end
15
- function SlowPoisonAbilityType.prototype.getOption(self, option)
16
- return self:getFlagLevelFieldValue("Spo4", option)
17
- end
18
12
  SlowPoisonAbilityType.BASE_ID = fourCC("Aspo")
19
13
  __TS__SetDescriptor(
20
14
  SlowPoisonAbilityType.prototype,
@@ -55,56 +49,4 @@ __TS__SetDescriptor(
55
49
  },
56
50
  true
57
51
  )
58
- __TS__SetDescriptor(
59
- SlowPoisonAbilityType.prototype,
60
- "isDamageStacking",
61
- {
62
- get = function(self)
63
- return self:getOption(1)
64
- end,
65
- set = function(self, isDamageStacking)
66
- self:setOption(1, isDamageStacking)
67
- end
68
- },
69
- true
70
- )
71
- __TS__SetDescriptor(
72
- SlowPoisonAbilityType.prototype,
73
- "isMovementSpeedFactorStacking",
74
- {
75
- get = function(self)
76
- return self:getOption(2)
77
- end,
78
- set = function(self, isMovementSpeedFactorStacking)
79
- self:setOption(2, isMovementSpeedFactorStacking)
80
- end
81
- },
82
- true
83
- )
84
- __TS__SetDescriptor(
85
- SlowPoisonAbilityType.prototype,
86
- "isAttackSpeedFactorStacking",
87
- {
88
- get = function(self)
89
- return self:getOption(4)
90
- end,
91
- set = function(self, isAttackSpeedFactorStacking)
92
- self:setOption(4, isAttackSpeedFactorStacking)
93
- end
94
- },
95
- true
96
- )
97
- __TS__SetDescriptor(
98
- SlowPoisonAbilityType.prototype,
99
- "isAbleToKill",
100
- {
101
- get = function(self)
102
- return self:getOption(8)
103
- end,
104
- set = function(self, isAbleToKill)
105
- self:setOption(8, isAbleToKill)
106
- end
107
- },
108
- true
109
- )
110
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 { AttachmentPresetInput, EffectPresetWithParameters, EffectPresetWithParametersInput } from "../auxiliary/attachment-preset";
6
+ import { AttachmentPreset, AttachmentPresetInput } 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(): EffectPresetWithParameters[];
31
- set casterCastingEffectPresets(casterCastingEffectPresets: EffectPresetWithParametersInput[]);
32
- get casterChannelingEffectPresets(): EffectPresetWithParameters[];
33
- set casterChannelingEffectPresets(casterChannelingEffectPresets: EffectPresetWithParametersInput[]);
34
- get casterAttachmentPresets(): TupleOf<EffectPresetWithParameters, 0 | 1 | 2>;
30
+ get casterCastingEffectPresets(): AttachmentPreset[];
31
+ set casterCastingEffectPresets(casterCastingEffectPresets: AttachmentPresetInput[]);
32
+ get casterChannelingEffectPresets(): AttachmentPreset[];
33
+ set casterChannelingEffectPresets(casterChannelingEffectPresets: AttachmentPresetInput[]);
34
+ get casterAttachmentPresets(): TupleOf<AttachmentPreset, 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(): EffectPresetWithParameters | undefined;
66
+ get specialAttachmentPreset(): AttachmentPreset | undefined;
67
67
  set specialAttachmentPreset(specialAttachmentPreset: AttachmentPresetInput | undefined);
68
- get targetCastingEffectPresets(): EffectPresetWithParameters[];
68
+ get targetCastingEffectPresets(): AttachmentPreset[];
69
69
  set targetCastingEffectPresets(targetCastingEffectPresets: AttachmentPresetInput[]);
70
- get targetEffectPresets(): TupleOf<EffectPresetWithParameters, 0 | 1 | 2 | 3 | 4 | 5 | 6>;
70
+ get targetEffectPresets(): TupleOf<AttachmentPreset, 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<EffectPresetWithParameters, 0 | 1 | 2 | 3 | 4 | 5 | 6>;
72
+ get targetEffectPresetsSD(): TupleOf<AttachmentPreset, 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<EffectPresetWithParameters, 0 | 1 | 2 | 3 | 4 | 5 | 6>;
74
+ get targetEffectPresetsHD(): TupleOf<AttachmentPreset, 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 toEffectPreset = ____attachment_2Dpreset.toEffectPreset
23
+ local toAttachmentPreset = ____attachment_2Dpreset.toAttachmentPreset
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
@@ -35,7 +35,6 @@ local abilityTypeIdGenerator = ____object_2Ddata_2Dentry_2Did_2Dgenerator.abilit
35
35
  local ____upgrade = require("engine.object-data.entry.upgrade")
36
36
  local Upgrade = ____upgrade.Upgrade
37
37
  local ____sound = require("core.types.sound")
38
- local isSoundLabelCustom = ____sound.isSoundLabelCustom
39
38
  local Sound3D = ____sound.Sound3D
40
39
  local SoundSettings = ____sound.SoundSettings
41
40
  local castAnimationFQNByAbilityTypeId = {}
@@ -119,7 +118,7 @@ __TS__SetDescriptor(
119
118
  return casterCastingEffectPresetsByAbilityTypeId[self.id] or ({})
120
119
  end,
121
120
  set = function(self, casterCastingEffectPresets)
122
- casterCastingEffectPresetsByAbilityTypeId[self.id] = map(casterCastingEffectPresets, toEffectPreset)
121
+ casterCastingEffectPresetsByAbilityTypeId[self.id] = map(casterCastingEffectPresets, toAttachmentPreset)
123
122
  end
124
123
  },
125
124
  true
@@ -132,7 +131,7 @@ __TS__SetDescriptor(
132
131
  return casterChannelingEffectPresetsByAbilityTypeId[self.id] or ({})
133
132
  end,
134
133
  set = function(self, casterChannelingEffectPresets)
135
- casterChannelingEffectPresetsByAbilityTypeId[self.id] = map(casterChannelingEffectPresets, toEffectPreset)
134
+ casterChannelingEffectPresetsByAbilityTypeId[self.id] = map(casterChannelingEffectPresets, toAttachmentPreset)
136
135
  end
137
136
  },
138
137
  true
@@ -371,7 +370,7 @@ __TS__SetDescriptor(
371
370
  return targetCastingEffectPresetsByAbilityTypeId[self.id] or ({})
372
371
  end,
373
372
  set = function(self, targetCastingEffectPresets)
374
- targetCastingEffectPresetsByAbilityTypeId[self.id] = map(targetCastingEffectPresets, toEffectPreset)
373
+ targetCastingEffectPresetsByAbilityTypeId[self.id] = map(targetCastingEffectPresets, toAttachmentPreset)
375
374
  end
376
375
  },
377
376
  true
@@ -1006,12 +1005,6 @@ for abilityTypeId, soundPresetId in pairs(postcompile(function() return targetEf
1006
1005
  )
1007
1006
  end
1008
1007
  end
1009
- Unit.abilityChannelingStartEvent:addListener(function(caster, ability)
1010
- local soundPresetId = ability:getField(ABILITY_SF_EFFECT_SOUND)
1011
- if isSoundLabelCustom(soundPresetId) then
1012
- Sound3D:playFromLabel(soundPresetId, SoundSettings.Ability, caster)
1013
- end
1014
- end)
1015
1008
  local casterCastingEffectModelPathsByAbilityTypeId = postcompile(function()
1016
1009
  return mapValues(
1017
1010
  casterCastingEffectPresetsByAbilityTypeId,
@@ -1024,17 +1017,10 @@ local casterCastingEffectAttachmentPointsByAbilityTypeId = postcompile(function(
1024
1017
  function(casterCastingEffectPresets) return map(casterCastingEffectPresets, extractAttachmentPresetInputNodeFQN) end
1025
1018
  )
1026
1019
  end)
1027
- local casterCastingEffectParametersByAbilityTypeId = postcompile(function()
1028
- return mapValues(
1029
- casterCastingEffectPresetsByAbilityTypeId,
1030
- function(casterCastingEffectPresets) return map(casterCastingEffectPresets, "parameters") end
1031
- )
1032
- end)
1033
1020
  local casterCastingEffectsByCaster = {}
1034
1021
  local function handleAbilityCastingStartEvent(caster, ability)
1035
1022
  local effectModelPaths = casterCastingEffectModelPathsByAbilityTypeId[ability.typeId]
1036
1023
  local attachmentPoints = casterCastingEffectAttachmentPointsByAbilityTypeId[ability.typeId]
1037
- local parameters = casterCastingEffectParametersByAbilityTypeId[ability.typeId]
1038
1024
  local effects = {}
1039
1025
  if effectModelPaths ~= nil then
1040
1026
  for i = 1, #effectModelPaths do
@@ -1043,7 +1029,7 @@ local function handleAbilityCastingStartEvent(caster, ability)
1043
1029
  if attachmentPoint == nil or attachmentPoint == "" then
1044
1030
  attachmentPoint = "origin"
1045
1031
  end
1046
- effects[i] = Effect:create(effectModelPath, caster, attachmentPoint, parameters and parameters[i])
1032
+ effects[i] = Effect:createTarget(effectModelPath, caster, attachmentPoint)
1047
1033
  end
1048
1034
  end
1049
1035
  casterCastingEffectsByCaster[caster] = effects
@@ -1074,17 +1060,10 @@ local casterChannelingEffectAttachmentPointsByAbilityTypeId = postcompile(functi
1074
1060
  function(casterChannelingEffectPresets) return map(casterChannelingEffectPresets, extractAttachmentPresetInputNodeFQN) end
1075
1061
  )
1076
1062
  end)
1077
- local casterChannelingEffectParametersByAbilityTypeId = postcompile(function()
1078
- return mapValues(
1079
- casterChannelingEffectPresetsByAbilityTypeId,
1080
- function(casterChannelingEffectPresets) return map(casterChannelingEffectPresets, "parameters") end
1081
- )
1082
- end)
1083
1063
  local casterChannelingEffectsByCaster = {}
1084
1064
  local function handleAbilityChannelingStartEvent(caster, ability)
1085
1065
  local effectModelPaths = casterChannelingEffectModelPathsByAbilityTypeId[ability.typeId]
1086
1066
  local attachmentPoints = casterChannelingEffectAttachmentPointsByAbilityTypeId[ability.typeId]
1087
- local parameters = casterChannelingEffectParametersByAbilityTypeId[ability.typeId]
1088
1067
  local effects = {}
1089
1068
  if effectModelPaths ~= nil then
1090
1069
  for i = 1, #effectModelPaths do
@@ -1093,7 +1072,7 @@ local function handleAbilityChannelingStartEvent(caster, ability)
1093
1072
  if attachmentPoint == nil or attachmentPoint == "" then
1094
1073
  attachmentPoint = "origin"
1095
1074
  end
1096
- effects[i] = Effect:create(effectModelPath, caster, attachmentPoint, parameters and parameters[i])
1075
+ effects[i] = Effect:createTarget(effectModelPath, caster, attachmentPoint)
1097
1076
  end
1098
1077
  end
1099
1078
  casterChannelingEffectsByCaster[caster] = effects
@@ -121,10 +121,6 @@ local applicatorAbilityTypeIdByApplicatorTypeByApplicableBuffTypeId, applicatorU
121
121
  applicatorAbilityType.damagePerSecond = 0
122
122
  applicatorAbilityType.movementSpeedDecreaseFactor = 0
123
123
  applicatorAbilityType.attackSpeedDecreaseFactor = 0
124
- applicatorAbilityType.isDamageStacking = false
125
- applicatorAbilityType.isMovementSpeedFactorStacking = false
126
- applicatorAbilityType.isAttackSpeedFactorStacking = false
127
- applicatorAbilityType.isAbleToKill = false
128
124
  applicatorAbilityType.buffTypeIds = {applicableBuffType.id, applicableBuffType.id}
129
125
  applicatorAbilityTypeIdByApplicatorType[852173] = applicatorAbilityType.id
130
126
  end
@@ -132,7 +128,6 @@ local applicatorAbilityTypeIdByApplicatorTypeByApplicableBuffTypeId, applicatorU
132
128
  local applicatorAbilityType = prepareAbilityType(BerserkAbilityType, applicableBuffType)
133
129
  applicatorAbilityType.attackSpeedIncreaseFactor = 0
134
130
  applicatorAbilityType.movementSpeedIncreaseFactor = 0
135
- applicatorAbilityType.receivedDamageIncreaseFactor = 0
136
131
  applicatorAbilityType.buffTypeIds = {applicableBuffType.id}
137
132
  if applicatorAbilityType.levelCount > 1 then
138
133
  multilevelPhysicalPositiveApplicatorAbilityTypes[#multilevelPhysicalPositiveApplicatorAbilityTypes + 1] = applicatorAbilityType
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.524f1b8",
4
+ "version": "0.0.1-dev.5619a0e",
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.8e8a660"
27
+ "warpack": "0.0.1-dev.9a8d1de"
28
28
  },
29
29
  "devDependencies": {
30
30
  "@typescript-eslint/eslint-plugin": "^8.13.0",
@@ -1,10 +0,0 @@
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
- }
@@ -1,39 +0,0 @@
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
@@ -1,12 +0,0 @@
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
- }
@@ -1,52 +0,0 @@
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