warscript 0.0.1-dev.effa673 → 0.0.1-dev.f40f923

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
@@ -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, "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[]]>;
@@ -2,8 +2,8 @@ local ____lualib = require("lualib_bundle")
2
2
  local __TS__StringSplit = ____lualib.__TS__StringSplit
3
3
  local __TS__ArraySlice = ____lualib.__TS__ArraySlice
4
4
  local ____exports = {}
5
- ____exports.toEffectPreset = function(effectPresetInput)
6
- return type(effectPresetInput) == "string" and ({modelPath = effectPresetInput, nodeName = "origin", nodeQualifiers = {}}) or ({modelPath = effectPresetInput.modelPath, nodeName = effectPresetInput.nodeName, 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 ({})})
7
7
  end
8
8
  ____exports.extractAttachmentPresetInputModelPath = function(attachmentPresetInput)
9
9
  return type(attachmentPresetInput) == "string" and attachmentPresetInput or (attachmentPresetInput and attachmentPresetInput.modelPath or "")
@@ -7,8 +7,4 @@ 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>);
14
10
  }
@@ -36,30 +36,4 @@ __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
- )
65
39
  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
@@ -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, toEffectPreset)
121
+ casterCastingEffectPresetsByAbilityTypeId[self.id] = map(casterCastingEffectPresets, toAttachmentPreset)
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, toEffectPreset)
134
+ casterChannelingEffectPresetsByAbilityTypeId[self.id] = map(casterChannelingEffectPresets, toAttachmentPreset)
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, toEffectPreset)
373
+ targetCastingEffectPresetsByAbilityTypeId[self.id] = map(targetCastingEffectPresets, toAttachmentPreset)
374
374
  end
375
375
  },
376
376
  true
@@ -1017,17 +1017,10 @@ 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)
1026
1020
  local casterCastingEffectsByCaster = {}
1027
1021
  local function handleAbilityCastingStartEvent(caster, ability)
1028
1022
  local effectModelPaths = casterCastingEffectModelPathsByAbilityTypeId[ability.typeId]
1029
1023
  local attachmentPoints = casterCastingEffectAttachmentPointsByAbilityTypeId[ability.typeId]
1030
- local parameters = casterCastingEffectParametersByAbilityTypeId[ability.typeId]
1031
1024
  local effects = {}
1032
1025
  if effectModelPaths ~= nil then
1033
1026
  for i = 1, #effectModelPaths do
@@ -1036,7 +1029,7 @@ local function handleAbilityCastingStartEvent(caster, ability)
1036
1029
  if attachmentPoint == nil or attachmentPoint == "" then
1037
1030
  attachmentPoint = "origin"
1038
1031
  end
1039
- effects[i] = Effect:create(effectModelPath, caster, attachmentPoint, parameters and parameters[i])
1032
+ effects[i] = Effect:createTarget(effectModelPath, caster, attachmentPoint)
1040
1033
  end
1041
1034
  end
1042
1035
  casterCastingEffectsByCaster[caster] = effects
@@ -1067,17 +1060,10 @@ local casterChannelingEffectAttachmentPointsByAbilityTypeId = postcompile(functi
1067
1060
  function(casterChannelingEffectPresets) return map(casterChannelingEffectPresets, extractAttachmentPresetInputNodeFQN) end
1068
1061
  )
1069
1062
  end)
1070
- local casterChannelingEffectParametersByAbilityTypeId = postcompile(function()
1071
- return mapValues(
1072
- casterChannelingEffectPresetsByAbilityTypeId,
1073
- function(casterChannelingEffectPresets) return map(casterChannelingEffectPresets, "parameters") end
1074
- )
1075
- end)
1076
1063
  local casterChannelingEffectsByCaster = {}
1077
1064
  local function handleAbilityChannelingStartEvent(caster, ability)
1078
1065
  local effectModelPaths = casterChannelingEffectModelPathsByAbilityTypeId[ability.typeId]
1079
1066
  local attachmentPoints = casterChannelingEffectAttachmentPointsByAbilityTypeId[ability.typeId]
1080
- local parameters = casterChannelingEffectParametersByAbilityTypeId[ability.typeId]
1081
1067
  local effects = {}
1082
1068
  if effectModelPaths ~= nil then
1083
1069
  for i = 1, #effectModelPaths do
@@ -1086,7 +1072,7 @@ local function handleAbilityChannelingStartEvent(caster, ability)
1086
1072
  if attachmentPoint == nil or attachmentPoint == "" then
1087
1073
  attachmentPoint = "origin"
1088
1074
  end
1089
- effects[i] = Effect:create(effectModelPath, caster, attachmentPoint, parameters and parameters[i])
1075
+ effects[i] = Effect:createTarget(effectModelPath, caster, attachmentPoint)
1090
1076
  end
1091
1077
  end
1092
1078
  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.effa673",
4
+ "version": "0.0.1-dev.f40f923",
5
5
  "description": "A typescript library for Warcraft III using Warpack.",
6
6
  "keywords": [
7
7
  "warcraft",
@@ -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