warscript 0.0.1-dev.123f3ce → 0.0.1-dev.1427c55

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.
@@ -12,9 +12,6 @@ export type EffectParameters = {
12
12
  readonly color?: PlayerColor;
13
13
  readonly pitch?: number;
14
14
  readonly roll?: number;
15
- readonly detached?: boolean;
16
- readonly zOffset?: number;
17
- readonly scaleZOffset?: boolean;
18
15
  };
19
16
  export declare class Effect extends Handle<jeffect> {
20
17
  private [EffectPropertyKey.COLOR]?;
@@ -32,7 +29,7 @@ export declare class Effect extends Handle<jeffect> {
32
29
  static create<T extends Effect>(this: typeof Effect & (new (handle: jeffect) => T), model: string, pos: Vec2): T;
33
30
  static createTarget<T extends Effect>(this: typeof Effect & (new (handle: jeffect) => T), model: string, target: Widget, attachPoint: string): T;
34
31
  static flash(modelPath: string, ...args: [
35
- ...pointOrWidget: [x: number, y: number] | [widget: Widget, attachmentPoint?: string],
32
+ ...pointOrWidget: [x: number, y: number] | [widget: Widget, attachmentPoint: string],
36
33
  ...parametersOrDuration: [parametersOrDuration?: EffectParameters | number] | [duration?: number, parameters?: EffectParameters]
37
34
  ]): void;
38
35
  static flashTarget(model: string, target: Widget, attachPoint: string, duration?: number): void;
@@ -1,7 +1,6 @@
1
1
  local ____lualib = require("lualib_bundle")
2
2
  local __TS__Class = ____lualib.__TS__Class
3
3
  local __TS__ClassExtends = ____lualib.__TS__ClassExtends
4
- local __TS__InstanceOf = ____lualib.__TS__InstanceOf
5
4
  local __TS__SetDescriptor = ____lualib.__TS__SetDescriptor
6
5
  local ____exports = {}
7
6
  local dummyPlayer
@@ -13,8 +12,6 @@ local ____player = require("core.types.player")
13
12
  local Player = ____player.Player
14
13
  local ____timer = require("core.types.timer")
15
14
  local Timer = ____timer.Timer
16
- local ____unit = require("engine.unit")
17
- local Unit = ____unit.Unit
18
15
  local ____pairs = _G.pairs
19
16
  local select = _G.select
20
17
  local mathRad = math.rad
@@ -30,11 +27,6 @@ local setSpecialEffectColorByPlayer = BlzSetSpecialEffectColorByPlayer
30
27
  local specialEffectAddSubAnimation = BlzSpecialEffectAddSubAnimation
31
28
  local specialEffectClearSubAnimations = BlzSpecialEffectClearSubAnimations
32
29
  local specialEffectRemoveSubAnimation = BlzSpecialEffectRemoveSubAnimation
33
- local setSpecialEffectZ = BlzSetSpecialEffectZ
34
- local getLocationZ = GetLocationZ
35
- local getUnitZ = BlzGetUnitZ
36
- local moveLocation = MoveLocation
37
- local location = Location(0, 0)
38
30
  local function setSpecialEffectPitchDegrees(effect, pitch)
39
31
  setSpecialEffectPitch(
40
32
  effect,
@@ -157,27 +149,10 @@ function Effect.flash(self, modelPath, xOrWidget, yOrOrAttachmentPoint, paramete
157
149
  parameters = parametersOrDuration
158
150
  parametersOrDuration = nil
159
151
  end
160
- local coordinatesProvided = type(xOrWidget) == "number"
161
- local isPositional = coordinatesProvided or (parameters and parameters.detached) == true
162
- local x = not isPositional and 0 or (coordinatesProvided and xOrWidget or xOrWidget.x)
163
- local y = not isPositional and 0 or (coordinatesProvided and yOrOrAttachmentPoint or xOrWidget.y)
164
- local effect = isPositional and addSpecialEffect(modelPath, x, y) or addSpecialEffectTarget(modelPath, xOrWidget.handle, yOrOrAttachmentPoint or "origin")
165
- if isPositional and not coordinatesProvided and (parameters and parameters.scale) == nil and __TS__InstanceOf(xOrWidget, Unit) then
166
- setSpecialEffectScale(effect, xOrWidget.scale)
167
- end
152
+ local effect = type(xOrWidget) == "number" and addSpecialEffect(modelPath, xOrWidget, yOrOrAttachmentPoint) or addSpecialEffectTarget(modelPath, xOrWidget.handle, yOrOrAttachmentPoint)
168
153
  if parameters ~= nil then
169
154
  for key, value in ____pairs(parameters) do
170
- if key ~= "zOffset" and key ~= "detached" and key ~= "scaleZOffset" then
171
- setters[key](effect, value)
172
- end
173
- end
174
- if isPositional and parameters.zOffset ~= nil then
175
- moveLocation(location, x, y)
176
- local z = __TS__InstanceOf(xOrWidget, Unit) and getLocationZ(location) + xOrWidget.flyHeight or getLocationZ(location)
177
- BlzSetSpecialEffectZ(
178
- effect,
179
- z + parameters.zOffset * (parameters.scaleZOffset and getSpecialEffectScale(effect) or 1)
180
- )
155
+ setters[key](effect, value)
181
156
  end
182
157
  end
183
158
  if parametersOrDuration ~= nil and parametersOrDuration > 0 then
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.123f3ce",
4
+ "version": "0.0.1-dev.1427c55",
5
5
  "description": "A typescript library for Warcraft III using Warpack.",
6
6
  "keywords": [
7
7
  "warcraft",