warscript 0.0.1-dev.65ee461 → 0.0.1-dev.66ce6c9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/core/types/effect.d.ts +3 -1
- package/core/types/effect.lua +29 -26
- package/core/types/sound.d.ts +25 -17
- package/core/types/sound.lua +44 -80
- package/core/types/timer.d.ts +7 -6
- package/core/types/timer.lua +21 -18
- package/engine/behaviour/ability/apply-unit-behavior.lua +0 -1
- package/engine/behaviour/ability/damage.d.ts +0 -3
- package/engine/behaviour/ability/damage.lua +2 -2
- package/engine/behaviour/ability.d.ts +1 -4
- package/engine/behaviour/ability.lua +4 -6
- package/engine/behaviour/unit.d.ts +0 -2
- package/engine/buff.d.ts +8 -13
- package/engine/buff.lua +50 -81
- package/engine/internal/mechanics/ability-duration.lua +1 -1
- package/engine/internal/unit.d.ts +1 -6
- package/engine/internal/unit.lua +2 -8
- package/engine/object-data/auxiliary/attachment-preset.d.ts +2 -7
- package/engine/object-data/auxiliary/attachment-preset.lua +3 -4
- package/engine/object-data/entry/ability-type/shock-wave.d.ts +0 -4
- package/engine/object-data/entry/ability-type/shock-wave.lua +0 -26
- package/engine/object-data/entry/ability-type.d.ts +11 -11
- package/engine/object-data/entry/ability-type.lua +10 -24
- package/engine/object-data/entry/sound-preset.d.ts +0 -17
- package/engine/object-data/entry/sound-preset.lua +0 -104
- package/package.json +2 -2
- package/engine/object-data/auxiliary/sound-eax.d.ts +0 -10
- package/engine/object-data/auxiliary/sound-eax.lua +0 -2
- package/engine/object-data/entry/ability-type/carrion-swarm.d.ts +0 -14
- package/engine/object-data/entry/ability-type/carrion-swarm.lua +0 -65
- package/engine/object-data/entry/ability-type/ensnare.d.ts +0 -12
- package/engine/object-data/entry/ability-type/ensnare.lua +0 -52
- package/engine/object-data/entry/ability-type/phase-shift.d.ts +0 -10
- package/engine/object-data/entry/ability-type/phase-shift.lua +0 -39
- package/engine/object-data/entry/ability-type/web.d.ts +0 -12
- package/engine/object-data/entry/ability-type/web.lua +0 -52
package/engine/buff.lua
CHANGED
|
@@ -109,7 +109,6 @@ local buffParametersKeys = {
|
|
|
109
109
|
durationIncreaseOnAutoAttack = true,
|
|
110
110
|
maximumDuration = true,
|
|
111
111
|
maximumRemainingDuration = true,
|
|
112
|
-
turnsIntoGhost = true,
|
|
113
112
|
stuns = true,
|
|
114
113
|
ignoresStunImmunity = true,
|
|
115
114
|
providesStunImmunity = true,
|
|
@@ -175,7 +174,6 @@ local function resolveAndSetNumberValue(buff, property, ability, level, value, d
|
|
|
175
174
|
end
|
|
176
175
|
end
|
|
177
176
|
local buffBooleanParameters = {
|
|
178
|
-
"turnsIntoGhost",
|
|
179
177
|
"stuns",
|
|
180
178
|
"ignoresStunImmunity",
|
|
181
179
|
"disablesAutoAttack",
|
|
@@ -323,7 +321,7 @@ function Buff.prototype.____constructor(self, _unit, typeIdOrTypeIds, polarityOr
|
|
|
323
321
|
typeId = selectBuffTypeIdWithLeastDuration(typeIdOrTypeIds, _unit)
|
|
324
322
|
polarity = resistanceTypeOrPolarity
|
|
325
323
|
resistanceType = abilityOrParametersOrResistanceType
|
|
326
|
-
if __TS__InstanceOf(parametersOrAbility, Ability)
|
|
324
|
+
if __TS__InstanceOf(parametersOrAbility, Ability) then
|
|
327
325
|
ability = parametersOrAbility
|
|
328
326
|
else
|
|
329
327
|
ability = nil
|
|
@@ -333,7 +331,7 @@ function Buff.prototype.____constructor(self, _unit, typeIdOrTypeIds, polarityOr
|
|
|
333
331
|
typeId = typeIdOrTypeIds
|
|
334
332
|
polarity = polarityOrTypeIdSelectionPolicy
|
|
335
333
|
resistanceType = resistanceTypeOrPolarity
|
|
336
|
-
if __TS__InstanceOf(abilityOrParametersOrResistanceType, Ability)
|
|
334
|
+
if __TS__InstanceOf(abilityOrParametersOrResistanceType, Ability) then
|
|
337
335
|
ability = abilityOrParametersOrResistanceType
|
|
338
336
|
parameters = parametersOrAbility
|
|
339
337
|
else
|
|
@@ -342,7 +340,7 @@ function Buff.prototype.____constructor(self, _unit, typeIdOrTypeIds, polarityOr
|
|
|
342
340
|
end
|
|
343
341
|
end
|
|
344
342
|
self.typeId = typeId
|
|
345
|
-
if not
|
|
343
|
+
if not __TS__InstanceOf(ability, Ability) then
|
|
346
344
|
parameters = ability
|
|
347
345
|
ability = nil
|
|
348
346
|
end
|
|
@@ -373,7 +371,7 @@ function Buff.prototype.____constructor(self, _unit, typeIdOrTypeIds, polarityOr
|
|
|
373
371
|
local missProbability = parameters and parameters.missProbability or defaultParameters.missProbability
|
|
374
372
|
if missProbability ~= nil then
|
|
375
373
|
missProbability = resolveNumberValue(ability, level, missProbability)
|
|
376
|
-
self[
|
|
374
|
+
self[141] = missProbability
|
|
377
375
|
end
|
|
378
376
|
local buffByTypeId = buffByTypeIdByUnit[_unit]
|
|
379
377
|
if buffByTypeId == nil then
|
|
@@ -594,21 +592,15 @@ function Buff.prototype.onDestroy(self)
|
|
|
594
592
|
behavior:destroy()
|
|
595
593
|
end
|
|
596
594
|
end
|
|
597
|
-
if self[
|
|
598
|
-
unit:decrementInvulnerabilityCounter()
|
|
599
|
-
end
|
|
600
|
-
if self[138] then
|
|
595
|
+
if self[137] then
|
|
601
596
|
unit:decrementDisableAutoAttackCounter()
|
|
602
597
|
end
|
|
603
|
-
if self[
|
|
604
|
-
if self[
|
|
598
|
+
if self[135] then
|
|
599
|
+
if self[136] then
|
|
605
600
|
unit:decrementStunCounter()
|
|
606
601
|
end
|
|
607
602
|
unit:decrementStunCounter()
|
|
608
603
|
end
|
|
609
|
-
if self[135] then
|
|
610
|
-
unit:decrementGhostCounter()
|
|
611
|
-
end
|
|
612
604
|
if self._abilityTypeIds ~= nil then
|
|
613
605
|
for abilityTypeId in pairs(self._abilityTypeIds) do
|
|
614
606
|
unit:removeAbility(abilityTypeId)
|
|
@@ -663,9 +655,9 @@ function Buff.prototype.onExpiration(self)
|
|
|
663
655
|
if self[121] ~= nil then
|
|
664
656
|
(self[102] or unit):healTarget(unit, self[120] or 0)
|
|
665
657
|
end
|
|
666
|
-
if self[
|
|
658
|
+
if self[140] then
|
|
667
659
|
unit:explode()
|
|
668
|
-
elseif self[
|
|
660
|
+
elseif self[139] then
|
|
669
661
|
unit:kill()
|
|
670
662
|
end
|
|
671
663
|
end
|
|
@@ -971,7 +963,7 @@ __TS__SetDescriptor(
|
|
|
971
963
|
)
|
|
972
964
|
__TS__SetDescriptor(
|
|
973
965
|
Buff.prototype,
|
|
974
|
-
"
|
|
966
|
+
"stuns",
|
|
975
967
|
{
|
|
976
968
|
get = function(self)
|
|
977
969
|
local ____self__135_54 = self[135]
|
|
@@ -980,12 +972,18 @@ __TS__SetDescriptor(
|
|
|
980
972
|
end
|
|
981
973
|
return ____self__135_54
|
|
982
974
|
end,
|
|
983
|
-
set = function(self,
|
|
984
|
-
if not
|
|
985
|
-
self
|
|
975
|
+
set = function(self, stuns)
|
|
976
|
+
if not stuns and self[135] then
|
|
977
|
+
if self[136] then
|
|
978
|
+
self.object:decrementStunCounter()
|
|
979
|
+
end
|
|
980
|
+
self.object:decrementStunCounter()
|
|
986
981
|
self[135] = nil
|
|
987
|
-
elseif
|
|
988
|
-
self
|
|
982
|
+
elseif stuns and not self[135] then
|
|
983
|
+
if self[136] then
|
|
984
|
+
self.object:incrementStunCounter()
|
|
985
|
+
end
|
|
986
|
+
self.object:incrementStunCounter()
|
|
989
987
|
self[135] = true
|
|
990
988
|
end
|
|
991
989
|
end
|
|
@@ -994,7 +992,7 @@ __TS__SetDescriptor(
|
|
|
994
992
|
)
|
|
995
993
|
__TS__SetDescriptor(
|
|
996
994
|
Buff.prototype,
|
|
997
|
-
"
|
|
995
|
+
"ignoresStunImmunity",
|
|
998
996
|
{
|
|
999
997
|
get = function(self)
|
|
1000
998
|
local ____self__136_55 = self[136]
|
|
@@ -1003,18 +1001,16 @@ __TS__SetDescriptor(
|
|
|
1003
1001
|
end
|
|
1004
1002
|
return ____self__136_55
|
|
1005
1003
|
end,
|
|
1006
|
-
set = function(self,
|
|
1007
|
-
if not
|
|
1008
|
-
if self[
|
|
1004
|
+
set = function(self, ignoresStunImmunity)
|
|
1005
|
+
if not ignoresStunImmunity and self[136] then
|
|
1006
|
+
if self[135] then
|
|
1009
1007
|
self.object:decrementStunCounter()
|
|
1010
1008
|
end
|
|
1011
|
-
self.object:decrementStunCounter()
|
|
1012
1009
|
self[136] = nil
|
|
1013
|
-
elseif
|
|
1014
|
-
if self[
|
|
1010
|
+
elseif ignoresStunImmunity and not self[136] then
|
|
1011
|
+
if self[135] then
|
|
1015
1012
|
self.object:incrementStunCounter()
|
|
1016
1013
|
end
|
|
1017
|
-
self.object:incrementStunCounter()
|
|
1018
1014
|
self[136] = true
|
|
1019
1015
|
end
|
|
1020
1016
|
end
|
|
@@ -1023,7 +1019,7 @@ __TS__SetDescriptor(
|
|
|
1023
1019
|
)
|
|
1024
1020
|
__TS__SetDescriptor(
|
|
1025
1021
|
Buff.prototype,
|
|
1026
|
-
"
|
|
1022
|
+
"disablesAutoAttack",
|
|
1027
1023
|
{
|
|
1028
1024
|
get = function(self)
|
|
1029
1025
|
local ____self__137_56 = self[137]
|
|
@@ -1032,16 +1028,12 @@ __TS__SetDescriptor(
|
|
|
1032
1028
|
end
|
|
1033
1029
|
return ____self__137_56
|
|
1034
1030
|
end,
|
|
1035
|
-
set = function(self,
|
|
1036
|
-
if not
|
|
1037
|
-
|
|
1038
|
-
self.object:decrementStunCounter()
|
|
1039
|
-
end
|
|
1031
|
+
set = function(self, disablesAutoAttack)
|
|
1032
|
+
if not disablesAutoAttack and self[137] then
|
|
1033
|
+
self.object:decrementDisableAutoAttackCounter()
|
|
1040
1034
|
self[137] = nil
|
|
1041
|
-
elseif
|
|
1042
|
-
|
|
1043
|
-
self.object:incrementStunCounter()
|
|
1044
|
-
end
|
|
1035
|
+
elseif disablesAutoAttack and not self[137] then
|
|
1036
|
+
self.object:incrementDisableAutoAttackCounter()
|
|
1045
1037
|
self[137] = true
|
|
1046
1038
|
end
|
|
1047
1039
|
end
|
|
@@ -1050,7 +1042,7 @@ __TS__SetDescriptor(
|
|
|
1050
1042
|
)
|
|
1051
1043
|
__TS__SetDescriptor(
|
|
1052
1044
|
Buff.prototype,
|
|
1053
|
-
"
|
|
1045
|
+
"providesInvulnerability",
|
|
1054
1046
|
{
|
|
1055
1047
|
get = function(self)
|
|
1056
1048
|
local ____self__138_57 = self[138]
|
|
@@ -1059,12 +1051,12 @@ __TS__SetDescriptor(
|
|
|
1059
1051
|
end
|
|
1060
1052
|
return ____self__138_57
|
|
1061
1053
|
end,
|
|
1062
|
-
set = function(self,
|
|
1063
|
-
if not
|
|
1064
|
-
self.object:
|
|
1054
|
+
set = function(self, providesInvulnerability)
|
|
1055
|
+
if not providesInvulnerability and self[138] then
|
|
1056
|
+
self.object:decrementInvulnerabilityCounter()
|
|
1065
1057
|
self[138] = nil
|
|
1066
|
-
elseif
|
|
1067
|
-
self.object:
|
|
1058
|
+
elseif providesInvulnerability and not self[138] then
|
|
1059
|
+
self.object:incrementInvulnerabilityCounter()
|
|
1068
1060
|
self[138] = true
|
|
1069
1061
|
end
|
|
1070
1062
|
end
|
|
@@ -1073,7 +1065,7 @@ __TS__SetDescriptor(
|
|
|
1073
1065
|
)
|
|
1074
1066
|
__TS__SetDescriptor(
|
|
1075
1067
|
Buff.prototype,
|
|
1076
|
-
"
|
|
1068
|
+
"killsOnExpiration",
|
|
1077
1069
|
{
|
|
1078
1070
|
get = function(self)
|
|
1079
1071
|
local ____self__139_58 = self[139]
|
|
@@ -1082,12 +1074,10 @@ __TS__SetDescriptor(
|
|
|
1082
1074
|
end
|
|
1083
1075
|
return ____self__139_58
|
|
1084
1076
|
end,
|
|
1085
|
-
set = function(self,
|
|
1086
|
-
if not
|
|
1087
|
-
self.object:decrementInvulnerabilityCounter()
|
|
1077
|
+
set = function(self, killsOnExpiration)
|
|
1078
|
+
if not killsOnExpiration and self[139] then
|
|
1088
1079
|
self[139] = nil
|
|
1089
|
-
elseif
|
|
1090
|
-
self.object:incrementInvulnerabilityCounter()
|
|
1080
|
+
elseif killsOnExpiration and not self[139] then
|
|
1091
1081
|
self[139] = true
|
|
1092
1082
|
end
|
|
1093
1083
|
end
|
|
@@ -1096,7 +1086,7 @@ __TS__SetDescriptor(
|
|
|
1096
1086
|
)
|
|
1097
1087
|
__TS__SetDescriptor(
|
|
1098
1088
|
Buff.prototype,
|
|
1099
|
-
"
|
|
1089
|
+
"explodesOnExpiration",
|
|
1100
1090
|
{
|
|
1101
1091
|
get = function(self)
|
|
1102
1092
|
local ____self__140_59 = self[140]
|
|
@@ -1115,27 +1105,6 @@ __TS__SetDescriptor(
|
|
|
1115
1105
|
},
|
|
1116
1106
|
true
|
|
1117
1107
|
)
|
|
1118
|
-
__TS__SetDescriptor(
|
|
1119
|
-
Buff.prototype,
|
|
1120
|
-
"explodesOnExpiration",
|
|
1121
|
-
{
|
|
1122
|
-
get = function(self)
|
|
1123
|
-
local ____self__141_60 = self[141]
|
|
1124
|
-
if ____self__141_60 == nil then
|
|
1125
|
-
____self__141_60 = false
|
|
1126
|
-
end
|
|
1127
|
-
return ____self__141_60
|
|
1128
|
-
end,
|
|
1129
|
-
set = function(self, killsOnExpiration)
|
|
1130
|
-
if not killsOnExpiration and self[141] then
|
|
1131
|
-
self[141] = nil
|
|
1132
|
-
elseif killsOnExpiration and not self[141] then
|
|
1133
|
-
self[141] = true
|
|
1134
|
-
end
|
|
1135
|
-
end
|
|
1136
|
-
},
|
|
1137
|
-
true
|
|
1138
|
-
)
|
|
1139
1108
|
__TS__SetDescriptor(
|
|
1140
1109
|
Buff.prototype,
|
|
1141
1110
|
"maximumDamageDealtEventCount",
|
|
@@ -1252,13 +1221,13 @@ __TS__SetDescriptor(
|
|
|
1252
1221
|
"remainingDuration",
|
|
1253
1222
|
{
|
|
1254
1223
|
get = function(self)
|
|
1255
|
-
local
|
|
1256
|
-
return
|
|
1224
|
+
local ____opt_60 = self._timer
|
|
1225
|
+
return ____opt_60 and ____opt_60.remaining or 0
|
|
1257
1226
|
end,
|
|
1258
1227
|
set = function(self, remainingDuration)
|
|
1259
|
-
local
|
|
1260
|
-
local
|
|
1261
|
-
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)
|
|
1262
1231
|
if remainingDurationDelta ~= 0 then
|
|
1263
1232
|
self[103] = self[103] + remainingDurationDelta
|
|
1264
1233
|
if remainingDuration <= 0 then
|
|
@@ -1273,7 +1242,7 @@ __TS__SetDescriptor(
|
|
|
1273
1242
|
remainingDuration,
|
|
1274
1243
|
self._spellStealPriority,
|
|
1275
1244
|
self._learnLevelMinimum,
|
|
1276
|
-
self[
|
|
1245
|
+
self[141]
|
|
1277
1246
|
) then
|
|
1278
1247
|
local timer = self._timer
|
|
1279
1248
|
if timer == nil then
|
|
@@ -8,6 +8,6 @@ local DURATION_NORMAL_ABILITY_FLOAT_LEVEL_FIELD = ____ability.DURATION_NORMAL_AB
|
|
|
8
8
|
-- @internal For use by internal systems only.
|
|
9
9
|
____exports.getAbilityDuration = function(ability, target)
|
|
10
10
|
local level = ability.level
|
|
11
|
-
return target ~= nil and
|
|
11
|
+
return target ~= nil and target:hasClassification(UnitClassification.RESISTANT) and DURATION_HERO_ABILITY_FLOAT_LEVEL_FIELD:getValue(ability, level) or DURATION_NORMAL_ABILITY_FLOAT_LEVEL_FIELD:getValue(ability, level)
|
|
12
12
|
end
|
|
13
13
|
return ____exports
|
|
@@ -100,9 +100,7 @@ declare const enum UnitPropertyKey {
|
|
|
100
100
|
DELAY_HEALTH_CHECKS_COUNTER = 103,
|
|
101
101
|
DELAY_HEALTH_CHECKS_HEALTH_BONUS = 104,
|
|
102
102
|
PREVENT_DEATH_HEALTH_BONUS = 105,
|
|
103
|
-
IS_TEAM_GLOW_HIDDEN = 106
|
|
104
|
-
LAST_X = 107,
|
|
105
|
-
LAST_Y = 108
|
|
103
|
+
IS_TEAM_GLOW_HIDDEN = 106
|
|
106
104
|
}
|
|
107
105
|
export type UnitSyncId = number & {
|
|
108
106
|
readonly __unitSyncId: unique symbol;
|
|
@@ -115,8 +113,6 @@ export declare class Unit extends Handle<junit> {
|
|
|
115
113
|
private [UnitPropertyKey.DELAY_HEALTH_CHECKS_HEALTH_BONUS]?;
|
|
116
114
|
private [UnitPropertyKey.PREVENT_DEATH_HEALTH_BONUS]?;
|
|
117
115
|
private [UnitPropertyKey.IS_TEAM_GLOW_HIDDEN]?;
|
|
118
|
-
private [UnitPropertyKey.LAST_X]?;
|
|
119
|
-
private [UnitPropertyKey.LAST_Y]?;
|
|
120
116
|
private _owner?;
|
|
121
117
|
private _timeScale?;
|
|
122
118
|
private events?;
|
|
@@ -152,7 +148,6 @@ export declare class Unit extends Handle<junit> {
|
|
|
152
148
|
isEnemyOf(unit: Unit): boolean;
|
|
153
149
|
playAnimation(animation: string, rarity?: jraritycontrol): void;
|
|
154
150
|
playAnimation(animation: number): void;
|
|
155
|
-
resetAnimation(): void;
|
|
156
151
|
queueAnimation(animation: string): void;
|
|
157
152
|
get weapons(): [UnitWeapon, UnitWeapon];
|
|
158
153
|
get firstWeapon(): UnitWeapon;
|
package/engine/internal/unit.lua
CHANGED
|
@@ -58,7 +58,6 @@ local ____tostring = _G.tostring
|
|
|
58
58
|
local setUnitAnimation = SetUnitAnimation
|
|
59
59
|
local setUnitAnimationWithRarity = SetUnitAnimationWithRarity
|
|
60
60
|
local setUnitAnimationByIndex = SetUnitAnimationByIndex
|
|
61
|
-
local resetUnitAnimation = ResetUnitAnimation
|
|
62
61
|
local queueUnitAnimation = QueueUnitAnimation
|
|
63
62
|
local getUnitIntegerField = BlzGetUnitIntegerField
|
|
64
63
|
local getUnitRealField = BlzGetUnitRealField
|
|
@@ -681,8 +680,6 @@ function Unit.prototype.getEvent(self, event, collector)
|
|
|
681
680
|
end
|
|
682
681
|
function Unit.prototype.onDestroy(self)
|
|
683
682
|
local handle = self.handle
|
|
684
|
-
self[107] = getUnitX(handle)
|
|
685
|
-
self[108] = getUnitY(handle)
|
|
686
683
|
if not self._owner then
|
|
687
684
|
self._owner = Player:of(getOwningPlayer(handle))
|
|
688
685
|
end
|
|
@@ -798,9 +795,6 @@ function Unit.prototype.playAnimation(self, animation, rarity)
|
|
|
798
795
|
setUnitAnimation(self.handle, animation)
|
|
799
796
|
end
|
|
800
797
|
end
|
|
801
|
-
function Unit.prototype.resetAnimation(self)
|
|
802
|
-
resetUnitAnimation(self.handle)
|
|
803
|
-
end
|
|
804
798
|
function Unit.prototype.queueAnimation(self, animation)
|
|
805
799
|
queueUnitAnimation(self.handle, animation)
|
|
806
800
|
end
|
|
@@ -1603,7 +1597,7 @@ __TS__SetDescriptor(
|
|
|
1603
1597
|
"x",
|
|
1604
1598
|
{
|
|
1605
1599
|
get = function(self)
|
|
1606
|
-
return
|
|
1600
|
+
return getUnitX(self.handle)
|
|
1607
1601
|
end,
|
|
1608
1602
|
set = function(self, v)
|
|
1609
1603
|
SetUnitX(self.handle, v)
|
|
@@ -1616,7 +1610,7 @@ __TS__SetDescriptor(
|
|
|
1616
1610
|
"y",
|
|
1617
1611
|
{
|
|
1618
1612
|
get = function(self)
|
|
1619
|
-
return
|
|
1613
|
+
return getUnitY(self.handle)
|
|
1620
1614
|
end,
|
|
1621
1615
|
set = function(self, v)
|
|
1622
1616
|
SetUnitY(self.handle, v)
|
|
@@ -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
|
|
12
|
-
|
|
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.
|
|
7
|
-
return type(
|
|
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
|
|
15
|
+
return table.concat(
|
|
17
16
|
{
|
|
18
17
|
attachmentPresetInput.nodeName,
|
|
19
18
|
table.unpack(attachmentPresetInput.nodeQualifiers 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 {
|
|
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():
|
|
31
|
-
set casterCastingEffectPresets(casterCastingEffectPresets:
|
|
32
|
-
get casterChannelingEffectPresets():
|
|
33
|
-
set casterChannelingEffectPresets(casterChannelingEffectPresets:
|
|
34
|
-
get casterAttachmentPresets(): TupleOf<
|
|
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():
|
|
66
|
+
get specialAttachmentPreset(): AttachmentPreset | undefined;
|
|
67
67
|
set specialAttachmentPreset(specialAttachmentPreset: AttachmentPresetInput | undefined);
|
|
68
|
-
get targetCastingEffectPresets():
|
|
68
|
+
get targetCastingEffectPresets(): AttachmentPreset[];
|
|
69
69
|
set targetCastingEffectPresets(targetCastingEffectPresets: AttachmentPresetInput[]);
|
|
70
|
-
get targetEffectPresets(): TupleOf<
|
|
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<
|
|
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<
|
|
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
|
|
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
|
|
@@ -36,7 +36,7 @@ local ____upgrade = require("engine.object-data.entry.upgrade")
|
|
|
36
36
|
local Upgrade = ____upgrade.Upgrade
|
|
37
37
|
local ____sound = require("core.types.sound")
|
|
38
38
|
local Sound3D = ____sound.Sound3D
|
|
39
|
-
local
|
|
39
|
+
local SoundPreset = ____sound.SoundPreset
|
|
40
40
|
local castAnimationFQNByAbilityTypeId = {}
|
|
41
41
|
local isButtonVisibleFalseAbilityTypes = {}
|
|
42
42
|
local casterCastingEffectPresetsByAbilityTypeId = {}
|
|
@@ -118,7 +118,7 @@ __TS__SetDescriptor(
|
|
|
118
118
|
return casterCastingEffectPresetsByAbilityTypeId[self.id] or ({})
|
|
119
119
|
end,
|
|
120
120
|
set = function(self, casterCastingEffectPresets)
|
|
121
|
-
casterCastingEffectPresetsByAbilityTypeId[self.id] = map(casterCastingEffectPresets,
|
|
121
|
+
casterCastingEffectPresetsByAbilityTypeId[self.id] = map(casterCastingEffectPresets, 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,
|
|
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,
|
|
373
|
+
targetCastingEffectPresetsByAbilityTypeId[self.id] = map(targetCastingEffectPresets, toAttachmentPreset)
|
|
374
374
|
end
|
|
375
375
|
},
|
|
376
376
|
true
|
|
@@ -991,16 +991,16 @@ for abilityTypeId, soundPresetId in pairs(postcompile(function() return targetEf
|
|
|
991
991
|
4,
|
|
992
992
|
function(caster, ability, target)
|
|
993
993
|
if __TS__InstanceOf(target, Unit) then
|
|
994
|
-
Sound3D:playFromLabel(soundPresetId,
|
|
994
|
+
Sound3D:playFromLabel(soundPresetId, SoundPreset.Ability, target)
|
|
995
995
|
else
|
|
996
|
-
Sound3D:playFromLabel(soundPresetId,
|
|
996
|
+
Sound3D:playFromLabel(soundPresetId, SoundPreset.Ability, target.x, target.y)
|
|
997
997
|
end
|
|
998
998
|
end
|
|
999
999
|
)
|
|
1000
1000
|
Unit.abilityPointTargetChannelingStartEvent[abilityTypeId]:addListener(
|
|
1001
1001
|
4,
|
|
1002
1002
|
function(caster, ability, x, y)
|
|
1003
|
-
Sound3D:playFromLabel(soundPresetId,
|
|
1003
|
+
Sound3D:playFromLabel(soundPresetId, SoundPreset.Ability, x, y)
|
|
1004
1004
|
end
|
|
1005
1005
|
)
|
|
1006
1006
|
end
|
|
@@ -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:
|
|
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:
|
|
1075
|
+
effects[i] = Effect:createTarget(effectModelPath, caster, attachmentPoint)
|
|
1090
1076
|
end
|
|
1091
1077
|
end
|
|
1092
1078
|
casterChannelingEffectsByCaster[caster] = effects
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
/** @noSelfInFile */
|
|
2
2
|
import { ObjectDataEntry, ObjectDataEntryId } from "../entry";
|
|
3
|
-
import { SoundEax } from "../auxiliary/sound-eax";
|
|
4
3
|
export type SoundPresetId = ObjectDataEntryId & string & {
|
|
5
4
|
readonly __soundPresetId: unique symbol;
|
|
6
5
|
};
|
|
@@ -14,20 +13,4 @@ export declare class SoundPreset extends ObjectDataEntry<SoundPresetId> {
|
|
|
14
13
|
protected static getObjectData(map: WarMap): WarObjects;
|
|
15
14
|
get filePaths(): string[];
|
|
16
15
|
set filePaths(filePaths: string[]);
|
|
17
|
-
get volume(): number;
|
|
18
|
-
set volume(volume: number);
|
|
19
|
-
get pitch(): number;
|
|
20
|
-
set pitch(pitch: number);
|
|
21
|
-
get priority(): number;
|
|
22
|
-
set priority(priority: number);
|
|
23
|
-
get channel(): number;
|
|
24
|
-
set channel(channel: number);
|
|
25
|
-
get minimumDistance(): number;
|
|
26
|
-
set minimumDistance(minimumDistance: number);
|
|
27
|
-
get maximumDistance(): number;
|
|
28
|
-
set maximumDistance(maximumDistance: number);
|
|
29
|
-
get distanceCutoff(): number;
|
|
30
|
-
set distanceCutoff(distanceCutoff: number);
|
|
31
|
-
get eax(): SoundEax;
|
|
32
|
-
set eax(eax: SoundEax);
|
|
33
16
|
}
|