warscript 0.0.1-dev.46a1ede → 0.0.1-dev.47f470c
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/config.d.ts +5 -0
- package/config.lua +10 -0
- package/core/types/sound.d.ts +1 -0
- package/core/types/sound.lua +32 -2
- package/engine/buff.d.ts +4 -1
- package/engine/buff.lua +78 -68
- package/engine/object-data/auxiliary/animation-name.d.ts +1 -0
- package/engine/object-data/auxiliary/animation-name.lua +16 -0
- package/engine/object-data/auxiliary/tech-tree-dependency.d.ts +1 -1
- package/engine/object-data/entry/ability-type/blank-configurable.lua +21 -1
- package/engine/object-data/entry/ability-type/curse.lua +2 -2
- package/engine/object-data/entry/ability-type/disease-cloud.lua +2 -2
- package/engine/object-data/entry/ability-type/engineering-upgrade.lua +2 -2
- package/engine/object-data/entry/ability-type/feral-spirit.lua +2 -2
- package/engine/object-data/entry/ability-type/phoenix-morph.lua +4 -4
- package/engine/object-data/entry/ability-type/summon-quilbeast.lua +2 -2
- package/engine/object-data/entry/ability-type/summon-water-elemental.lua +2 -2
- package/engine/object-data/entry/ability-type.d.ts +1 -1
- package/engine/object-data/entry/ability-type.lua +8 -8
- package/engine/object-data/entry/buff-type/applicable.lua +10 -34
- package/engine/object-data/entry/buff-type.d.ts +1 -1
- package/engine/object-data/entry/buff-type.lua +2 -2
- package/engine/object-data/entry/destructible-type.d.ts +1 -1
- package/engine/object-data/entry/item-type.d.ts +1 -1
- package/engine/object-data/entry/item-type.lua +4 -4
- package/engine/object-data/entry/lightning-type.d.ts +1 -1
- package/engine/object-data/entry/sound-preset.d.ts +17 -0
- package/engine/object-data/entry/sound-preset.lua +50 -0
- package/engine/object-data/entry/unit-type.d.ts +8 -1
- package/engine/object-data/entry/unit-type.lua +61 -8
- package/engine/object-data/entry/upgrade.d.ts +1 -1
- package/engine/object-data/entry/upgrade.lua +4 -4
- package/engine/object-data/entry.d.ts +15 -13
- package/engine/object-data/entry.lua +53 -32
- package/engine/standard/entries/sound-preset.d.ts +10 -0
- package/engine/standard/entries/sound-preset.lua +10 -0
- package/objutil/unit.lua +8 -0
- package/package.json +2 -2
package/config.d.ts
ADDED
package/config.lua
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
local ____lualib = require("lualib_bundle")
|
|
2
|
+
local __TS__Class = ____lualib.__TS__Class
|
|
3
|
+
local ____exports = {}
|
|
4
|
+
____exports.WarscriptConfig = __TS__Class()
|
|
5
|
+
local WarscriptConfig = ____exports.WarscriptConfig
|
|
6
|
+
WarscriptConfig.name = "WarscriptConfig"
|
|
7
|
+
function WarscriptConfig.prototype.____constructor(self)
|
|
8
|
+
end
|
|
9
|
+
WarscriptConfig.AUTOMATICALLY_SET_UNIT_TYPE_PORTRAIT_MODEL_PATH = true
|
|
10
|
+
return ____exports
|
package/core/types/sound.d.ts
CHANGED
|
@@ -64,6 +64,7 @@ export declare class Sound extends Handle<jsound, [fadeOut?: boolean]> {
|
|
|
64
64
|
export declare class Sound3D extends Sound {
|
|
65
65
|
static playAtPosition(fileName: string, preset: Sound3DPreset, x?: number, y?: number, z?: number): void;
|
|
66
66
|
static playOnUnit(fileName: string, preset: Sound3DPreset, unit: Unit): void;
|
|
67
|
+
static playFromLabel(label: string, preset: Sound3DPreset, unit: Unit): void;
|
|
67
68
|
static createAtPosition(fileName: string, preset: Sound3DPreset, x?: number, y?: number, z?: number): Sound3D;
|
|
68
69
|
static createOnUnit(fileName: string, preset: Sound3DPreset, unit: Unit): Sound3D;
|
|
69
70
|
}
|
package/core/types/sound.lua
CHANGED
|
@@ -6,14 +6,13 @@ local ____exports = {}
|
|
|
6
6
|
local ____handle = require("core.types.handle")
|
|
7
7
|
local Handle = ____handle.Handle
|
|
8
8
|
local createSound = CreateSound
|
|
9
|
+
local createSoundFromLabel = CreateSoundFromLabel
|
|
9
10
|
local setSoundPitch = SetSoundPitch
|
|
10
11
|
local setSoundChannel = SetSoundChannel
|
|
11
12
|
local setSoundPosition = SetSoundPosition
|
|
12
13
|
local setSoundVolume = SetSoundVolume
|
|
13
14
|
local setSoundDistances = SetSoundDistances
|
|
14
15
|
local setSoundDistanceCutoff = SetSoundDistanceCutoff
|
|
15
|
-
local setSoundConeAngles = SetSoundConeAngles
|
|
16
|
-
local setSoundConeOrientation = SetSoundConeOrientation
|
|
17
16
|
local startSound = StartSound
|
|
18
17
|
local setSoundPlayPosition = SetSoundPlayPosition
|
|
19
18
|
local stopSound = StopSound
|
|
@@ -153,6 +152,31 @@ local function createPreset3DSound(fileName, preset)
|
|
|
153
152
|
setSoundDistanceCutoff(sound, preset.distanceCutoff or 1500)
|
|
154
153
|
return sound
|
|
155
154
|
end
|
|
155
|
+
local function createPreset3DSoundFromLabel(label, preset)
|
|
156
|
+
local ____label_7 = label
|
|
157
|
+
local ____preset_looping_5 = preset.looping
|
|
158
|
+
if ____preset_looping_5 == nil then
|
|
159
|
+
____preset_looping_5 = false
|
|
160
|
+
end
|
|
161
|
+
local ____preset_stopWhenOutOfRange_6 = preset.stopWhenOutOfRange
|
|
162
|
+
if ____preset_stopWhenOutOfRange_6 == nil then
|
|
163
|
+
____preset_stopWhenOutOfRange_6 = true
|
|
164
|
+
end
|
|
165
|
+
local sound = createSoundFromLabel(
|
|
166
|
+
____label_7,
|
|
167
|
+
____preset_looping_5,
|
|
168
|
+
true,
|
|
169
|
+
____preset_stopWhenOutOfRange_6,
|
|
170
|
+
preset.fadeInRate or 12700,
|
|
171
|
+
preset.fadeOutRate or 12700
|
|
172
|
+
)
|
|
173
|
+
setSoundChannel(sound, preset.channel or ____exports.SoundChannel.General)
|
|
174
|
+
setSoundVolume(sound, preset.volume or 127)
|
|
175
|
+
setSoundPitch(sound, preset.pitch or 1)
|
|
176
|
+
setSoundDistances(sound, preset.minDistance or 600, preset.maxDistance or 8000)
|
|
177
|
+
setSoundDistanceCutoff(sound, preset.distanceCutoff or 1500)
|
|
178
|
+
return sound
|
|
179
|
+
end
|
|
156
180
|
____exports.Sound = __TS__Class()
|
|
157
181
|
local Sound = ____exports.Sound
|
|
158
182
|
Sound.name = "Sound"
|
|
@@ -225,6 +249,12 @@ function Sound3D.playOnUnit(self, fileName, preset, unit)
|
|
|
225
249
|
startSound(sound)
|
|
226
250
|
killSoundWhenDone(sound)
|
|
227
251
|
end
|
|
252
|
+
function Sound3D.playFromLabel(self, label, preset, unit)
|
|
253
|
+
local sound = createPreset3DSoundFromLabel(label, preset)
|
|
254
|
+
attachSoundToUnit(sound, unit.handle)
|
|
255
|
+
startSound(sound)
|
|
256
|
+
killSoundWhenDone(sound)
|
|
257
|
+
end
|
|
228
258
|
function Sound3D.createAtPosition(self, fileName, preset, x, y, z)
|
|
229
259
|
if x == nil then
|
|
230
260
|
x = 0
|
package/engine/buff.d.ts
CHANGED
|
@@ -57,6 +57,7 @@ export type BuffParameters<T extends Buff<any> = Buff> = Buff extends T ? {
|
|
|
57
57
|
attackSpeedIncreaseFactor?: NumberParameterValueType;
|
|
58
58
|
movementSpeedIncreaseFactor?: NumberParameterValueType;
|
|
59
59
|
evasionProbability?: NumberParameterValueType;
|
|
60
|
+
missProbability?: NumberParameterValueType;
|
|
60
61
|
damageFactor?: NumberParameterValueType;
|
|
61
62
|
receivedDamageFactor?: NumberParameterValueType;
|
|
62
63
|
receivedMagicDamageFactor?: NumberParameterValueType;
|
|
@@ -120,7 +121,8 @@ declare const enum BuffPropertyKey {
|
|
|
120
121
|
DISABLES_AUTO_ATTACK = 137,
|
|
121
122
|
PROVIDES_INVULNERABILITY = 138,
|
|
122
123
|
KILLS_ON_EXPIRATION = 139,
|
|
123
|
-
EXPLODES_ON_EXPIRATION = 140
|
|
124
|
+
EXPLODES_ON_EXPIRATION = 140,
|
|
125
|
+
MISS_PROBABILITY = 141
|
|
124
126
|
}
|
|
125
127
|
export declare const enum BuffTypeIdSelectionPolicy {
|
|
126
128
|
LEAST_DURATION = 0
|
|
@@ -195,6 +197,7 @@ export declare class Buff<AdditionalParameters extends Prohibit<Record<string, a
|
|
|
195
197
|
private readonly _level?;
|
|
196
198
|
private readonly _spellStealPriority?;
|
|
197
199
|
private readonly _learnLevelMinimum?;
|
|
200
|
+
private readonly [BuffPropertyKey.MISS_PROBABILITY]?;
|
|
198
201
|
private _bonusIdByBonusType?;
|
|
199
202
|
private readonly _abilityTypeIds?;
|
|
200
203
|
private _behaviors?;
|
package/engine/buff.lua
CHANGED
|
@@ -102,6 +102,7 @@ local buffParametersKeys = {
|
|
|
102
102
|
attackSpeedIncreaseFactor = true,
|
|
103
103
|
movementSpeedIncreaseFactor = true,
|
|
104
104
|
evasionProbability = true,
|
|
105
|
+
missProbability = true,
|
|
105
106
|
damageFactor = true,
|
|
106
107
|
receivedDamageFactor = true,
|
|
107
108
|
receivedMagicDamageFactor = true,
|
|
@@ -367,14 +368,19 @@ function Buff.prototype.____constructor(self, _unit, typeIdOrTypeIds, polarityOr
|
|
|
367
368
|
end
|
|
368
369
|
self.polarity = resolveEnumValue(ability, level, polarity)
|
|
369
370
|
self.resistanceType = resolveEnumValue(ability, level, resistanceType)
|
|
371
|
+
local missProbability = parameters and parameters.missProbability or defaultParameters.missProbability
|
|
372
|
+
if missProbability ~= nil then
|
|
373
|
+
missProbability = resolveNumberValue(ability, level, missProbability)
|
|
374
|
+
self[141] = missProbability
|
|
375
|
+
end
|
|
370
376
|
local buffByTypeId = buffByTypeIdByUnit[_unit]
|
|
371
377
|
if buffByTypeId == nil then
|
|
372
378
|
buffByTypeId = {}
|
|
373
379
|
buffByTypeIdByUnit[_unit] = buffByTypeId
|
|
374
380
|
end
|
|
375
|
-
local
|
|
376
|
-
if
|
|
377
|
-
|
|
381
|
+
local ____opt_15 = buffByTypeId[typeId]
|
|
382
|
+
if ____opt_15 ~= nil then
|
|
383
|
+
____opt_15:destroy()
|
|
378
384
|
end
|
|
379
385
|
local uniqueGroup = parameters and parameters.uniqueGroup or defaultParameters and defaultParameters.uniqueGroup
|
|
380
386
|
if uniqueGroup ~= nil then
|
|
@@ -388,13 +394,16 @@ function Buff.prototype.____constructor(self, _unit, typeIdOrTypeIds, polarityOr
|
|
|
388
394
|
level,
|
|
389
395
|
duration,
|
|
390
396
|
spellStealPriority,
|
|
391
|
-
learnLevelMinimum
|
|
397
|
+
learnLevelMinimum,
|
|
398
|
+
missProbability
|
|
392
399
|
) then
|
|
400
|
+
self[100] = 1
|
|
393
401
|
UnitBehavior.prototype.destroy(self)
|
|
394
402
|
error(unsuccessfulApplicationMarker, 0)
|
|
395
403
|
end
|
|
396
404
|
local handle = BlzGetUnitAbility(_unit.handle, typeId)
|
|
397
405
|
if handle == nil then
|
|
406
|
+
self[100] = 1
|
|
398
407
|
UnitBehavior.prototype.destroy(self)
|
|
399
408
|
error(unsuccessfulApplicationMarker, 0)
|
|
400
409
|
end
|
|
@@ -410,13 +419,13 @@ function Buff.prototype.____constructor(self, _unit, typeIdOrTypeIds, polarityOr
|
|
|
410
419
|
self[106] = BlzGetAbilityStringLevelField(self.handle, ABILITY_SLF_SPECIAL, 0)
|
|
411
420
|
if parameters ~= nil or (next(defaultParameters)) ~= nil then
|
|
412
421
|
for ____, buffBooleanParameter in ipairs(buffBooleanParameters) do
|
|
413
|
-
local
|
|
414
|
-
local
|
|
415
|
-
local
|
|
416
|
-
if
|
|
417
|
-
|
|
422
|
+
local ____ability_24 = ability
|
|
423
|
+
local ____level_25 = level
|
|
424
|
+
local ____temp_23 = parameters and parameters[buffBooleanParameter]
|
|
425
|
+
if ____temp_23 == nil then
|
|
426
|
+
____temp_23 = defaultParameters[buffBooleanParameter]
|
|
418
427
|
end
|
|
419
|
-
if resolveBooleanValue(
|
|
428
|
+
if resolveBooleanValue(____ability_24, ____level_25, ____temp_23) then
|
|
420
429
|
self[buffBooleanParameter] = true
|
|
421
430
|
end
|
|
422
431
|
end
|
|
@@ -497,8 +506,8 @@ function Buff.prototype.____constructor(self, _unit, typeIdOrTypeIds, polarityOr
|
|
|
497
506
|
self[100] = 1
|
|
498
507
|
end
|
|
499
508
|
function Buff.prototype.getUnitBonus(self, bonusType)
|
|
500
|
-
local
|
|
501
|
-
local bonusId =
|
|
509
|
+
local ____opt_38 = self._bonusIdByBonusType
|
|
510
|
+
local bonusId = ____opt_38 and ____opt_38[bonusType]
|
|
502
511
|
return bonusId == nil and 0 or getUnitBonus(self._unit, bonusType, bonusId)
|
|
503
512
|
end
|
|
504
513
|
function Buff.prototype.addOrUpdateOrRemoveUnitBonus(self, bonusType, value)
|
|
@@ -514,45 +523,45 @@ function Buff.prototype.flashEffect(self, widgetOrXOrParametersOrDuration, yOrPa
|
|
|
514
523
|
Effect:flash(self[105], widgetOrXOrParametersOrDuration, yOrParametersOrDuration, parametersOrDuration)
|
|
515
524
|
else
|
|
516
525
|
local isWidgetProvided = __TS__InstanceOf(widgetOrXOrParametersOrDuration, Unit) or __TS__InstanceOf(widgetOrXOrParametersOrDuration, Item) or __TS__InstanceOf(widgetOrXOrParametersOrDuration, Destructable)
|
|
517
|
-
local
|
|
518
|
-
local
|
|
519
|
-
local
|
|
526
|
+
local ____Effect_42 = Effect
|
|
527
|
+
local ____Effect_flash_43 = Effect.flash
|
|
528
|
+
local ____array_41 = __TS__SparseArrayNew(
|
|
520
529
|
self[105],
|
|
521
530
|
isWidgetProvided and widgetOrXOrParametersOrDuration or self._unit,
|
|
522
531
|
stringValueByBuffTypeIdByFieldId[fourCC("feft")][self.typeId] or "origin"
|
|
523
532
|
)
|
|
524
|
-
local
|
|
533
|
+
local ____isWidgetProvided_40
|
|
525
534
|
if isWidgetProvided then
|
|
526
|
-
|
|
535
|
+
____isWidgetProvided_40 = yOrParametersOrDuration
|
|
527
536
|
else
|
|
528
|
-
|
|
537
|
+
____isWidgetProvided_40 = widgetOrXOrParametersOrDuration
|
|
529
538
|
end
|
|
530
|
-
__TS__SparseArrayPush(
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
__TS__SparseArraySpread(
|
|
539
|
+
__TS__SparseArrayPush(____array_41, ____isWidgetProvided_40)
|
|
540
|
+
____Effect_flash_43(
|
|
541
|
+
____Effect_42,
|
|
542
|
+
__TS__SparseArraySpread(____array_41)
|
|
534
543
|
)
|
|
535
544
|
end
|
|
536
545
|
end
|
|
537
546
|
function Buff.prototype.flashSpecialEffect(self, widgetOrDuration, duration)
|
|
538
547
|
local isWidgetProvided = type(widgetOrDuration) == "table"
|
|
539
|
-
local
|
|
540
|
-
local
|
|
541
|
-
local
|
|
548
|
+
local ____Effect_46 = Effect
|
|
549
|
+
local ____Effect_flash_47 = Effect.flash
|
|
550
|
+
local ____array_45 = __TS__SparseArrayNew(
|
|
542
551
|
self[106],
|
|
543
552
|
isWidgetProvided and widgetOrDuration or self._unit,
|
|
544
553
|
stringValueByBuffTypeIdByFieldId[fourCC("fspt")][self.typeId] or "origin"
|
|
545
554
|
)
|
|
546
|
-
local
|
|
555
|
+
local ____isWidgetProvided_44
|
|
547
556
|
if isWidgetProvided then
|
|
548
|
-
|
|
557
|
+
____isWidgetProvided_44 = duration
|
|
549
558
|
else
|
|
550
|
-
|
|
559
|
+
____isWidgetProvided_44 = widgetOrDuration
|
|
551
560
|
end
|
|
552
|
-
__TS__SparseArrayPush(
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
__TS__SparseArraySpread(
|
|
561
|
+
__TS__SparseArrayPush(____array_45, ____isWidgetProvided_44)
|
|
562
|
+
____Effect_flash_47(
|
|
563
|
+
____Effect_46,
|
|
564
|
+
__TS__SparseArraySpread(____array_45)
|
|
556
565
|
)
|
|
557
566
|
end
|
|
558
567
|
function Buff.prototype.onCreate(self)
|
|
@@ -631,8 +640,8 @@ function Buff.apply(self, ...)
|
|
|
631
640
|
end
|
|
632
641
|
end
|
|
633
642
|
function Buff.getByTypeId(self, unit, typeId)
|
|
634
|
-
local
|
|
635
|
-
local buff =
|
|
643
|
+
local ____opt_48 = buffByTypeIdByUnit[unit]
|
|
644
|
+
local buff = ____opt_48 and ____opt_48[typeId]
|
|
636
645
|
if __TS__InstanceOf(buff, self) then
|
|
637
646
|
return buff
|
|
638
647
|
end
|
|
@@ -790,8 +799,8 @@ __TS__SetDescriptor(
|
|
|
790
799
|
return
|
|
791
800
|
end
|
|
792
801
|
self[112] = damageInterval
|
|
793
|
-
local
|
|
794
|
-
local elapsed =
|
|
802
|
+
local ____opt_50 = self._timer
|
|
803
|
+
local elapsed = ____opt_50 and ____opt_50.elapsed or 0
|
|
795
804
|
local timer = self[114]
|
|
796
805
|
if timer == nil then
|
|
797
806
|
timer = Timer:create()
|
|
@@ -870,8 +879,8 @@ __TS__SetDescriptor(
|
|
|
870
879
|
return
|
|
871
880
|
end
|
|
872
881
|
self[117] = healingInterval
|
|
873
|
-
local
|
|
874
|
-
local elapsed =
|
|
882
|
+
local ____opt_52 = self._timer
|
|
883
|
+
local elapsed = ____opt_52 and ____opt_52.elapsed or 0
|
|
875
884
|
local timer = self[119]
|
|
876
885
|
if timer == nil then
|
|
877
886
|
timer = Timer:create()
|
|
@@ -957,11 +966,11 @@ __TS__SetDescriptor(
|
|
|
957
966
|
"stuns",
|
|
958
967
|
{
|
|
959
968
|
get = function(self)
|
|
960
|
-
local
|
|
961
|
-
if
|
|
962
|
-
|
|
969
|
+
local ____self__135_54 = self[135]
|
|
970
|
+
if ____self__135_54 == nil then
|
|
971
|
+
____self__135_54 = false
|
|
963
972
|
end
|
|
964
|
-
return
|
|
973
|
+
return ____self__135_54
|
|
965
974
|
end,
|
|
966
975
|
set = function(self, stuns)
|
|
967
976
|
if not stuns and self[135] then
|
|
@@ -986,11 +995,11 @@ __TS__SetDescriptor(
|
|
|
986
995
|
"ignoresStunImmunity",
|
|
987
996
|
{
|
|
988
997
|
get = function(self)
|
|
989
|
-
local
|
|
990
|
-
if
|
|
991
|
-
|
|
998
|
+
local ____self__136_55 = self[136]
|
|
999
|
+
if ____self__136_55 == nil then
|
|
1000
|
+
____self__136_55 = false
|
|
992
1001
|
end
|
|
993
|
-
return
|
|
1002
|
+
return ____self__136_55
|
|
994
1003
|
end,
|
|
995
1004
|
set = function(self, ignoresStunImmunity)
|
|
996
1005
|
if not ignoresStunImmunity and self[136] then
|
|
@@ -1013,11 +1022,11 @@ __TS__SetDescriptor(
|
|
|
1013
1022
|
"disablesAutoAttack",
|
|
1014
1023
|
{
|
|
1015
1024
|
get = function(self)
|
|
1016
|
-
local
|
|
1017
|
-
if
|
|
1018
|
-
|
|
1025
|
+
local ____self__137_56 = self[137]
|
|
1026
|
+
if ____self__137_56 == nil then
|
|
1027
|
+
____self__137_56 = false
|
|
1019
1028
|
end
|
|
1020
|
-
return
|
|
1029
|
+
return ____self__137_56
|
|
1021
1030
|
end,
|
|
1022
1031
|
set = function(self, disablesAutoAttack)
|
|
1023
1032
|
if not disablesAutoAttack and self[137] then
|
|
@@ -1036,11 +1045,11 @@ __TS__SetDescriptor(
|
|
|
1036
1045
|
"providesInvulnerability",
|
|
1037
1046
|
{
|
|
1038
1047
|
get = function(self)
|
|
1039
|
-
local
|
|
1040
|
-
if
|
|
1041
|
-
|
|
1048
|
+
local ____self__138_57 = self[138]
|
|
1049
|
+
if ____self__138_57 == nil then
|
|
1050
|
+
____self__138_57 = false
|
|
1042
1051
|
end
|
|
1043
|
-
return
|
|
1052
|
+
return ____self__138_57
|
|
1044
1053
|
end,
|
|
1045
1054
|
set = function(self, providesInvulnerability)
|
|
1046
1055
|
if not providesInvulnerability and self[138] then
|
|
@@ -1059,11 +1068,11 @@ __TS__SetDescriptor(
|
|
|
1059
1068
|
"killsOnExpiration",
|
|
1060
1069
|
{
|
|
1061
1070
|
get = function(self)
|
|
1062
|
-
local
|
|
1063
|
-
if
|
|
1064
|
-
|
|
1071
|
+
local ____self__139_58 = self[139]
|
|
1072
|
+
if ____self__139_58 == nil then
|
|
1073
|
+
____self__139_58 = false
|
|
1065
1074
|
end
|
|
1066
|
-
return
|
|
1075
|
+
return ____self__139_58
|
|
1067
1076
|
end,
|
|
1068
1077
|
set = function(self, killsOnExpiration)
|
|
1069
1078
|
if not killsOnExpiration and self[139] then
|
|
@@ -1080,11 +1089,11 @@ __TS__SetDescriptor(
|
|
|
1080
1089
|
"explodesOnExpiration",
|
|
1081
1090
|
{
|
|
1082
1091
|
get = function(self)
|
|
1083
|
-
local
|
|
1084
|
-
if
|
|
1085
|
-
|
|
1092
|
+
local ____self__140_59 = self[140]
|
|
1093
|
+
if ____self__140_59 == nil then
|
|
1094
|
+
____self__140_59 = false
|
|
1086
1095
|
end
|
|
1087
|
-
return
|
|
1096
|
+
return ____self__140_59
|
|
1088
1097
|
end,
|
|
1089
1098
|
set = function(self, killsOnExpiration)
|
|
1090
1099
|
if not killsOnExpiration and self[140] then
|
|
@@ -1212,13 +1221,13 @@ __TS__SetDescriptor(
|
|
|
1212
1221
|
"remainingDuration",
|
|
1213
1222
|
{
|
|
1214
1223
|
get = function(self)
|
|
1215
|
-
local
|
|
1216
|
-
return
|
|
1224
|
+
local ____opt_60 = self._timer
|
|
1225
|
+
return ____opt_60 and ____opt_60.remaining or 0
|
|
1217
1226
|
end,
|
|
1218
1227
|
set = function(self, remainingDuration)
|
|
1219
|
-
local
|
|
1220
|
-
local
|
|
1221
|
-
local remainingDurationDelta =
|
|
1228
|
+
local ____remainingDuration_64 = remainingDuration
|
|
1229
|
+
local ____opt_62 = self._timer
|
|
1230
|
+
local remainingDurationDelta = ____remainingDuration_64 - (____opt_62 and ____opt_62.remaining or 0)
|
|
1222
1231
|
if remainingDurationDelta ~= 0 then
|
|
1223
1232
|
self[103] = self[103] + remainingDurationDelta
|
|
1224
1233
|
if remainingDuration <= 0 then
|
|
@@ -1232,7 +1241,8 @@ __TS__SetDescriptor(
|
|
|
1232
1241
|
self._level,
|
|
1233
1242
|
remainingDuration,
|
|
1234
1243
|
self._spellStealPriority,
|
|
1235
|
-
self._learnLevelMinimum
|
|
1244
|
+
self._learnLevelMinimum,
|
|
1245
|
+
self[141]
|
|
1236
1246
|
) then
|
|
1237
1247
|
local timer = self._timer
|
|
1238
1248
|
if timer == nil then
|
|
@@ -1,2 +1,18 @@
|
|
|
1
1
|
local ____exports = {}
|
|
2
|
+
local animationNames = {
|
|
3
|
+
attack = true,
|
|
4
|
+
birth = true,
|
|
5
|
+
death = true,
|
|
6
|
+
decay = true,
|
|
7
|
+
dissipate = true,
|
|
8
|
+
morph = true,
|
|
9
|
+
portrait = true,
|
|
10
|
+
sleep = true,
|
|
11
|
+
spell = true,
|
|
12
|
+
stand = true,
|
|
13
|
+
walk = true
|
|
14
|
+
}
|
|
15
|
+
____exports.isAnimationName = function(value)
|
|
16
|
+
return animationNames[value] ~= nil
|
|
17
|
+
end
|
|
2
18
|
return ____exports
|
|
@@ -12,5 +12,5 @@ export type TechTreeDependency = {
|
|
|
12
12
|
level: number;
|
|
13
13
|
};
|
|
14
14
|
export type TechTreeDependencyInput = TechTreeDependency | UnitTypeId | UpgradeId;
|
|
15
|
-
export declare const extractTechTreeDependencyInputObjectDataEntryId: (techTreeDependencyInput: TechTreeDependencyInput) => ObjectDataEntryId;
|
|
15
|
+
export declare const extractTechTreeDependencyInputObjectDataEntryId: (techTreeDependencyInput: TechTreeDependencyInput) => ObjectDataEntryId & number;
|
|
16
16
|
export declare const extractTechTreeDependencyInputLevel: (techTreeDependencyInput: TechTreeDependencyInput) => number;
|
|
@@ -6,6 +6,8 @@ local __TS__New = ____lualib.__TS__New
|
|
|
6
6
|
local ____exports = {}
|
|
7
7
|
local ____channel = require("engine.object-data.entry.ability-type.channel")
|
|
8
8
|
local ChannelAbilityType = ____channel.ChannelAbilityType
|
|
9
|
+
local ____animation_2Dname = require("engine.object-data.auxiliary.animation-name")
|
|
10
|
+
local isAnimationName = ____animation_2Dname.isAnimationName
|
|
9
11
|
local ____order_2Dtype_2Dstring_2Did_2Dfactory = require("engine.object-data.utility.order-type-string-id-factory")
|
|
10
12
|
local orderTypeStringIdFactory = ____order_2Dtype_2Dstring_2Did_2Dfactory.orderTypeStringIdFactory
|
|
11
13
|
local ____timer = require("core.types.timer")
|
|
@@ -21,6 +23,9 @@ local ALLOWED_TARGETS_ABILITY_COMBAT_CLASSIFICATIONS_LEVEL_FIELD = ____ability.A
|
|
|
21
23
|
local AREA_OF_EFFECT_ABILITY_FLOAT_LEVEL_FIELD = ____ability.AREA_OF_EFFECT_ABILITY_FLOAT_LEVEL_FIELD
|
|
22
24
|
local ____linked_2Dset = require("utility.linked-set")
|
|
23
25
|
local LinkedSet = ____linked_2Dset.LinkedSet
|
|
26
|
+
local ____sound = require("core.types.sound")
|
|
27
|
+
local Sound3D = ____sound.Sound3D
|
|
28
|
+
local SoundPreset = ____sound.SoundPreset
|
|
24
29
|
local isChannelingAbilityTypeIds = {}
|
|
25
30
|
local usesAttackAnimationByAbilityTypeId = {}
|
|
26
31
|
____exports.BlankConfigurableAbilityType = __TS__Class()
|
|
@@ -211,11 +216,26 @@ for abilityTypeId, usesAttackAnimation in pairs(postcompile(function()
|
|
|
211
216
|
for abilityTypeId, usesAttackAnimation in pairs(usesAttackAnimationByAbilityTypeId) do
|
|
212
217
|
if usesAttackAnimation then
|
|
213
218
|
local abilityType = checkNotNull(____exports.BlankConfigurableAbilityType:of(abilityTypeId))
|
|
214
|
-
abilityType.channelingAnimation
|
|
219
|
+
if isAnimationName(abilityType.channelingAnimation[1]) then
|
|
220
|
+
if abilityType.channelingAnimation[1] ~= "attack" then
|
|
221
|
+
abilityType.channelingAnimation = {"attack"}
|
|
222
|
+
end
|
|
223
|
+
else
|
|
224
|
+
abilityType.channelingAnimation = {
|
|
225
|
+
"attack",
|
|
226
|
+
table.unpack(abilityType.channelingAnimation)
|
|
227
|
+
}
|
|
228
|
+
end
|
|
215
229
|
end
|
|
216
230
|
end
|
|
217
231
|
return usesAttackAnimationByAbilityTypeId
|
|
218
232
|
end)) do
|
|
233
|
+
Unit.abilityCastingFinishEvent[abilityTypeId]:addListener(function(caster, ability)
|
|
234
|
+
local effectSound = ability:getField(ABILITY_SF_EFFECT_SOUND)
|
|
235
|
+
if effectSound ~= "" then
|
|
236
|
+
Sound3D:playFromLabel(effectSound, SoundPreset.Ability, caster)
|
|
237
|
+
end
|
|
238
|
+
end)
|
|
219
239
|
if usesAttackAnimation then
|
|
220
240
|
Unit.abilityCastingStartEvent[abilityTypeId]:addListener(
|
|
221
241
|
4,
|
|
@@ -15,10 +15,10 @@ __TS__SetDescriptor(
|
|
|
15
15
|
"missProbability",
|
|
16
16
|
{
|
|
17
17
|
get = function(self)
|
|
18
|
-
return self:getNumberLevelField("
|
|
18
|
+
return self:getNumberLevelField("Crs1")
|
|
19
19
|
end,
|
|
20
20
|
set = function(self, missProbability)
|
|
21
|
-
self:setNumberLevelField("
|
|
21
|
+
self:setNumberLevelField("Crs1", missProbability)
|
|
22
22
|
end
|
|
23
23
|
},
|
|
24
24
|
true
|
|
@@ -54,10 +54,10 @@ __TS__SetDescriptor(
|
|
|
54
54
|
"plagueWardUnitTypeId",
|
|
55
55
|
{
|
|
56
56
|
get = function(self)
|
|
57
|
-
return self:
|
|
57
|
+
return self:getObjectDataEntryNumericIdLevelField("Aplu")
|
|
58
58
|
end,
|
|
59
59
|
set = function(self, plagueWardUnitTypeId)
|
|
60
|
-
self:
|
|
60
|
+
self:setObjectDataEntryNumericIdLevelField("Aplu", plagueWardUnitTypeId)
|
|
61
61
|
end
|
|
62
62
|
},
|
|
63
63
|
true
|
|
@@ -55,7 +55,7 @@ __TS__SetDescriptor(
|
|
|
55
55
|
get = function(self)
|
|
56
56
|
local abilityUpgrades = {}
|
|
57
57
|
for i = 0, 3 do
|
|
58
|
-
local abilityUpgrade = self:
|
|
58
|
+
local abilityUpgrade = self:getObjectDataEntryNumericIdsLevelField("Neg" .. tostring(3 + i))
|
|
59
59
|
for level = 0, #abilityUpgrade - 1 do
|
|
60
60
|
local levelAbilityUpgrade = abilityUpgrade[level + 1]
|
|
61
61
|
if #levelAbilityUpgrade == 2 then
|
|
@@ -71,7 +71,7 @@ __TS__SetDescriptor(
|
|
|
71
71
|
local ____opt_0 = abilityUpgrades[1]
|
|
72
72
|
local isArray = __TS__ArrayIsArray(____opt_0 and ____opt_0[1])
|
|
73
73
|
for i = 0, #abilityUpgrades - 1 do
|
|
74
|
-
self:
|
|
74
|
+
self:setObjectDataEntryNumericIdsLevelField(
|
|
75
75
|
"Neg" .. tostring(3 + i),
|
|
76
76
|
isArray and map(
|
|
77
77
|
abilityUpgrades,
|
|
@@ -15,10 +15,10 @@ __TS__SetDescriptor(
|
|
|
15
15
|
"summonedUnitTypeId",
|
|
16
16
|
{
|
|
17
17
|
get = function(self)
|
|
18
|
-
return self:
|
|
18
|
+
return self:getObjectDataEntryNumericIdLevelField("Osf1")
|
|
19
19
|
end,
|
|
20
20
|
set = function(self, summonedUnitTypeId)
|
|
21
|
-
self:
|
|
21
|
+
self:setObjectDataEntryNumericIdLevelField("Osf1", summonedUnitTypeId)
|
|
22
22
|
end
|
|
23
23
|
},
|
|
24
24
|
true
|
|
@@ -15,10 +15,10 @@ __TS__SetDescriptor(
|
|
|
15
15
|
"normalFormUnitTypeId",
|
|
16
16
|
{
|
|
17
17
|
get = function(self)
|
|
18
|
-
return self:
|
|
18
|
+
return self:getObjectDataEntryNumericIdLevelField("Eme1")
|
|
19
19
|
end,
|
|
20
20
|
set = function(self, normalFormUnitTypeId)
|
|
21
|
-
self:
|
|
21
|
+
self:setObjectDataEntryNumericIdLevelField("Eme1", normalFormUnitTypeId)
|
|
22
22
|
end
|
|
23
23
|
},
|
|
24
24
|
true
|
|
@@ -119,10 +119,10 @@ __TS__SetDescriptor(
|
|
|
119
119
|
"alternateFormUnitTypeId",
|
|
120
120
|
{
|
|
121
121
|
get = function(self)
|
|
122
|
-
return self:
|
|
122
|
+
return self:getObjectDataEntryNumericIdLevelField("Emeu")
|
|
123
123
|
end,
|
|
124
124
|
set = function(self, alternateFormUnitTypeId)
|
|
125
|
-
self:
|
|
125
|
+
self:setObjectDataEntryNumericIdLevelField("Emeu", alternateFormUnitTypeId)
|
|
126
126
|
end
|
|
127
127
|
},
|
|
128
128
|
true
|
|
@@ -15,10 +15,10 @@ __TS__SetDescriptor(
|
|
|
15
15
|
"summonedUnitTypeId",
|
|
16
16
|
{
|
|
17
17
|
get = function(self)
|
|
18
|
-
return self:
|
|
18
|
+
return self:getObjectDataEntryNumericIdLevelField("Hwe1")
|
|
19
19
|
end,
|
|
20
20
|
set = function(self, summonedUnitTypeId)
|
|
21
|
-
self:
|
|
21
|
+
self:setObjectDataEntryNumericIdLevelField("Hwe1", summonedUnitTypeId)
|
|
22
22
|
end
|
|
23
23
|
},
|
|
24
24
|
true
|
|
@@ -15,10 +15,10 @@ __TS__SetDescriptor(
|
|
|
15
15
|
"summonedUnitTypeId",
|
|
16
16
|
{
|
|
17
17
|
get = function(self)
|
|
18
|
-
return self:
|
|
18
|
+
return self:getObjectDataEntryNumericIdLevelField("Hwe1")
|
|
19
19
|
end,
|
|
20
20
|
set = function(self, summonedUnitTypeId)
|
|
21
|
-
self:
|
|
21
|
+
self:setObjectDataEntryNumericIdLevelField("Hwe1", summonedUnitTypeId)
|
|
22
22
|
end
|
|
23
23
|
},
|
|
24
24
|
true
|
|
@@ -11,7 +11,7 @@ import { TechTreeDependency, TechTreeDependencyInput } from "../auxiliary/tech-t
|
|
|
11
11
|
import { ObjectDataEntry, ObjectDataEntryId, ObjectDataEntryLevelFieldValueSupplier } from "../entry";
|
|
12
12
|
import { BuffTypeId } from "./buff-type";
|
|
13
13
|
import { LightningTypeId } from "./lightning-type";
|
|
14
|
-
export type AbilityTypeId = ObjectDataEntryId & {
|
|
14
|
+
export type AbilityTypeId = ObjectDataEntryId & number & {
|
|
15
15
|
readonly __abilityTypeId: unique symbol;
|
|
16
16
|
};
|
|
17
17
|
export declare abstract class AbilityType extends ObjectDataEntry<AbilityTypeId> {
|