warscript 0.0.1-dev.65d0014 → 0.0.1-dev.65ee461
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/effect.d.ts +1 -3
- package/core/types/effect.lua +26 -29
- package/core/types/sound.d.ts +17 -24
- package/core/types/sound.lua +94 -24
- package/core/types/timer.d.ts +6 -7
- package/core/types/timer.lua +18 -21
- package/core/util.lua +6 -1
- package/engine/behaviour/ability/apply-unit-behavior.lua +1 -0
- package/engine/behaviour/ability/damage.d.ts +3 -0
- package/engine/behaviour/ability/damage.lua +2 -2
- package/engine/behaviour/ability.d.ts +5 -1
- package/engine/behaviour/ability.lua +18 -4
- package/engine/behaviour/unit.d.ts +2 -0
- package/engine/buff.d.ts +13 -8
- package/engine/buff.lua +81 -50
- package/engine/internal/mechanics/ability-duration.lua +1 -1
- package/engine/internal/unit.d.ts +6 -1
- package/engine/internal/unit.lua +8 -2
- 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/attachment-preset.d.ts +7 -2
- package/engine/object-data/auxiliary/attachment-preset.lua +4 -3
- package/engine/object-data/auxiliary/sound-eax.d.ts +10 -0
- package/engine/object-data/auxiliary/sound-eax.lua +2 -0
- package/engine/object-data/auxiliary/tech-tree-dependency.d.ts +1 -1
- package/engine/object-data/entry/ability-type/blank-configurable.lua +12 -1
- package/engine/object-data/entry/ability-type/carrion-swarm.d.ts +14 -0
- package/engine/object-data/entry/ability-type/carrion-swarm.lua +65 -0
- 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/ensnare.d.ts +12 -0
- package/engine/object-data/entry/ability-type/ensnare.lua +52 -0
- package/engine/object-data/entry/ability-type/feral-spirit.lua +2 -2
- package/engine/object-data/entry/ability-type/phase-shift.d.ts +10 -0
- package/engine/object-data/entry/ability-type/phase-shift.lua +39 -0
- package/engine/object-data/entry/ability-type/phoenix-morph.lua +4 -4
- package/engine/object-data/entry/ability-type/raise-dead.d.ts +17 -0
- package/engine/object-data/entry/ability-type/raise-dead.lua +78 -0
- package/engine/object-data/entry/ability-type/shock-wave.d.ts +4 -0
- package/engine/object-data/entry/ability-type/shock-wave.lua +26 -0
- 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/web.d.ts +12 -0
- package/engine/object-data/entry/ability-type/web.lua +52 -0
- package/engine/object-data/entry/ability-type.d.ts +19 -17
- package/engine/object-data/entry/ability-type.lua +74 -21
- package/engine/object-data/entry/buff-type/applicable.lua +4 -4
- 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 +33 -0
- package/engine/object-data/entry/sound-preset.lua +140 -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 +16 -14
- package/engine/object-data/entry.lua +60 -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/utility/reflection.lua +11 -7
|
@@ -5,9 +5,11 @@ import { DamageEvent, DamagingEvent, Unit } from "../internal/unit";
|
|
|
5
5
|
import "../internal/unit+ability";
|
|
6
6
|
import "../internal/unit-missile-launch";
|
|
7
7
|
import { Item } from "../internal/item";
|
|
8
|
+
import type { AbilityBehavior } from "./ability";
|
|
8
9
|
export type UnitBehaviorConstructor<Args extends any[]> = new (unit: Unit, ...args: Args) => UnitBehavior;
|
|
9
10
|
export declare abstract class UnitBehavior<PeriodicActionParameters extends any[] = any[]> extends Behavior<Unit, PeriodicActionParameters> {
|
|
10
11
|
constructor(unit: Unit);
|
|
12
|
+
readonly sourceAbilityBehavior?: AbilityBehavior;
|
|
11
13
|
get unit(): Unit;
|
|
12
14
|
onAutoAttackStart(target: Unit): void;
|
|
13
15
|
onAutoAttackFinish(target: Unit): void;
|
package/engine/buff.d.ts
CHANGED
|
@@ -64,6 +64,7 @@ export type BuffParameters<T extends Buff<any> = Buff> = Buff extends T ? {
|
|
|
64
64
|
durationIncreaseOnAutoAttack?: NumberParameterValueType;
|
|
65
65
|
maximumRemainingDuration?: NumberParameterValueType;
|
|
66
66
|
maximumDuration?: NumberParameterValueType;
|
|
67
|
+
turnsIntoGhost?: BooleanParameterValueType;
|
|
67
68
|
stuns?: BooleanParameterValueType;
|
|
68
69
|
ignoresStunImmunity?: BooleanParameterValueType;
|
|
69
70
|
providesStunImmunity?: BooleanParameterValueType;
|
|
@@ -116,13 +117,14 @@ declare const enum BuffPropertyKey {
|
|
|
116
117
|
MAXIMUM_DAMAGE_DEALT_EVENT_COUNT = 132,
|
|
117
118
|
DAMAGE_RECEIVED_EVENT_COUNT = 133,
|
|
118
119
|
MAXIMUM_DAMAGE_RECEIVED_EVENT_COUNT = 134,
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
120
|
+
TURNS_INTO_GHOST = 135,
|
|
121
|
+
STUNS = 136,
|
|
122
|
+
IGNORES_STUN_IMMUNITY = 137,
|
|
123
|
+
DISABLES_AUTO_ATTACK = 138,
|
|
124
|
+
PROVIDES_INVULNERABILITY = 139,
|
|
125
|
+
KILLS_ON_EXPIRATION = 140,
|
|
126
|
+
EXPLODES_ON_EXPIRATION = 141,
|
|
127
|
+
MISS_PROBABILITY = 142
|
|
126
128
|
}
|
|
127
129
|
export declare const enum BuffTypeIdSelectionPolicy {
|
|
128
130
|
LEAST_DURATION = 0
|
|
@@ -136,7 +138,7 @@ export type BuffConstructorParameters<AdditionalParameters extends BuffAdditiona
|
|
|
136
138
|
polarity: BuffPolarityParameterType,
|
|
137
139
|
resistanceType: BuffResistanceTypeParameterType,
|
|
138
140
|
...abilityOrParameters: [
|
|
139
|
-
ability
|
|
141
|
+
ability?: Ability,
|
|
140
142
|
parameters?: BuffParameters & Omit<AdditionalParameters, keyof BuffParameters>
|
|
141
143
|
] | [parameters?: BuffParameters & Omit<AdditionalParameters, keyof BuffParameters>]
|
|
142
144
|
];
|
|
@@ -178,6 +180,7 @@ export declare class Buff<AdditionalParameters extends Prohibit<Record<string, a
|
|
|
178
180
|
private [BuffPropertyKey.DAMAGE_DEALT_EVENT_COUNT]?;
|
|
179
181
|
private [BuffPropertyKey.MAXIMUM_DAMAGE_RECEIVED_EVENT_COUNT]?;
|
|
180
182
|
private [BuffPropertyKey.DAMAGE_RECEIVED_EVENT_COUNT]?;
|
|
183
|
+
private [BuffPropertyKey.TURNS_INTO_GHOST]?;
|
|
181
184
|
private [BuffPropertyKey.STUNS]?;
|
|
182
185
|
private [BuffPropertyKey.IGNORES_STUN_IMMUNITY]?;
|
|
183
186
|
private [BuffPropertyKey.DISABLES_AUTO_ATTACK]?;
|
|
@@ -231,6 +234,8 @@ export declare class Buff<AdditionalParameters extends Prohibit<Record<string, a
|
|
|
231
234
|
set receivedDamageFactor(receivedDamageFactor: number);
|
|
232
235
|
get armorIncrease(): number;
|
|
233
236
|
set armorIncrease(armorIncrease: number);
|
|
237
|
+
get turnsIntoGhost(): boolean;
|
|
238
|
+
set turnsIntoGhost(turnsIntoGhost: boolean);
|
|
234
239
|
get stuns(): boolean;
|
|
235
240
|
set stuns(stuns: boolean);
|
|
236
241
|
get ignoresStunImmunity(): boolean;
|
package/engine/buff.lua
CHANGED
|
@@ -109,6 +109,7 @@ local buffParametersKeys = {
|
|
|
109
109
|
durationIncreaseOnAutoAttack = true,
|
|
110
110
|
maximumDuration = true,
|
|
111
111
|
maximumRemainingDuration = true,
|
|
112
|
+
turnsIntoGhost = true,
|
|
112
113
|
stuns = true,
|
|
113
114
|
ignoresStunImmunity = true,
|
|
114
115
|
providesStunImmunity = true,
|
|
@@ -174,6 +175,7 @@ local function resolveAndSetNumberValue(buff, property, ability, level, value, d
|
|
|
174
175
|
end
|
|
175
176
|
end
|
|
176
177
|
local buffBooleanParameters = {
|
|
178
|
+
"turnsIntoGhost",
|
|
177
179
|
"stuns",
|
|
178
180
|
"ignoresStunImmunity",
|
|
179
181
|
"disablesAutoAttack",
|
|
@@ -321,7 +323,7 @@ function Buff.prototype.____constructor(self, _unit, typeIdOrTypeIds, polarityOr
|
|
|
321
323
|
typeId = selectBuffTypeIdWithLeastDuration(typeIdOrTypeIds, _unit)
|
|
322
324
|
polarity = resistanceTypeOrPolarity
|
|
323
325
|
resistanceType = abilityOrParametersOrResistanceType
|
|
324
|
-
if __TS__InstanceOf(parametersOrAbility, Ability) then
|
|
326
|
+
if __TS__InstanceOf(parametersOrAbility, Ability) or parametersOrAbility == nil then
|
|
325
327
|
ability = parametersOrAbility
|
|
326
328
|
else
|
|
327
329
|
ability = nil
|
|
@@ -331,7 +333,7 @@ function Buff.prototype.____constructor(self, _unit, typeIdOrTypeIds, polarityOr
|
|
|
331
333
|
typeId = typeIdOrTypeIds
|
|
332
334
|
polarity = polarityOrTypeIdSelectionPolicy
|
|
333
335
|
resistanceType = resistanceTypeOrPolarity
|
|
334
|
-
if __TS__InstanceOf(abilityOrParametersOrResistanceType, Ability) then
|
|
336
|
+
if __TS__InstanceOf(abilityOrParametersOrResistanceType, Ability) or abilityOrParametersOrResistanceType == nil then
|
|
335
337
|
ability = abilityOrParametersOrResistanceType
|
|
336
338
|
parameters = parametersOrAbility
|
|
337
339
|
else
|
|
@@ -340,7 +342,7 @@ function Buff.prototype.____constructor(self, _unit, typeIdOrTypeIds, polarityOr
|
|
|
340
342
|
end
|
|
341
343
|
end
|
|
342
344
|
self.typeId = typeId
|
|
343
|
-
if not __TS__InstanceOf(ability, Ability) then
|
|
345
|
+
if not (__TS__InstanceOf(ability, Ability) or ability == nil) then
|
|
344
346
|
parameters = ability
|
|
345
347
|
ability = nil
|
|
346
348
|
end
|
|
@@ -371,7 +373,7 @@ function Buff.prototype.____constructor(self, _unit, typeIdOrTypeIds, polarityOr
|
|
|
371
373
|
local missProbability = parameters and parameters.missProbability or defaultParameters.missProbability
|
|
372
374
|
if missProbability ~= nil then
|
|
373
375
|
missProbability = resolveNumberValue(ability, level, missProbability)
|
|
374
|
-
self[
|
|
376
|
+
self[142] = missProbability
|
|
375
377
|
end
|
|
376
378
|
local buffByTypeId = buffByTypeIdByUnit[_unit]
|
|
377
379
|
if buffByTypeId == nil then
|
|
@@ -592,15 +594,21 @@ function Buff.prototype.onDestroy(self)
|
|
|
592
594
|
behavior:destroy()
|
|
593
595
|
end
|
|
594
596
|
end
|
|
595
|
-
if self[
|
|
597
|
+
if self[139] then
|
|
598
|
+
unit:decrementInvulnerabilityCounter()
|
|
599
|
+
end
|
|
600
|
+
if self[138] then
|
|
596
601
|
unit:decrementDisableAutoAttackCounter()
|
|
597
602
|
end
|
|
598
|
-
if self[
|
|
599
|
-
if self[
|
|
603
|
+
if self[136] then
|
|
604
|
+
if self[137] then
|
|
600
605
|
unit:decrementStunCounter()
|
|
601
606
|
end
|
|
602
607
|
unit:decrementStunCounter()
|
|
603
608
|
end
|
|
609
|
+
if self[135] then
|
|
610
|
+
unit:decrementGhostCounter()
|
|
611
|
+
end
|
|
604
612
|
if self._abilityTypeIds ~= nil then
|
|
605
613
|
for abilityTypeId in pairs(self._abilityTypeIds) do
|
|
606
614
|
unit:removeAbility(abilityTypeId)
|
|
@@ -655,9 +663,9 @@ function Buff.prototype.onExpiration(self)
|
|
|
655
663
|
if self[121] ~= nil then
|
|
656
664
|
(self[102] or unit):healTarget(unit, self[120] or 0)
|
|
657
665
|
end
|
|
658
|
-
if self[
|
|
666
|
+
if self[141] then
|
|
659
667
|
unit:explode()
|
|
660
|
-
elseif self[
|
|
668
|
+
elseif self[140] then
|
|
661
669
|
unit:kill()
|
|
662
670
|
end
|
|
663
671
|
end
|
|
@@ -963,7 +971,7 @@ __TS__SetDescriptor(
|
|
|
963
971
|
)
|
|
964
972
|
__TS__SetDescriptor(
|
|
965
973
|
Buff.prototype,
|
|
966
|
-
"
|
|
974
|
+
"turnsIntoGhost",
|
|
967
975
|
{
|
|
968
976
|
get = function(self)
|
|
969
977
|
local ____self__135_54 = self[135]
|
|
@@ -972,18 +980,12 @@ __TS__SetDescriptor(
|
|
|
972
980
|
end
|
|
973
981
|
return ____self__135_54
|
|
974
982
|
end,
|
|
975
|
-
set = function(self,
|
|
976
|
-
if not
|
|
977
|
-
|
|
978
|
-
self.object:decrementStunCounter()
|
|
979
|
-
end
|
|
980
|
-
self.object:decrementStunCounter()
|
|
983
|
+
set = function(self, turnsIntoGhost)
|
|
984
|
+
if not turnsIntoGhost and self[135] then
|
|
985
|
+
self.object:decrementGhostCounter()
|
|
981
986
|
self[135] = nil
|
|
982
|
-
elseif
|
|
983
|
-
|
|
984
|
-
self.object:incrementStunCounter()
|
|
985
|
-
end
|
|
986
|
-
self.object:incrementStunCounter()
|
|
987
|
+
elseif turnsIntoGhost and not self[135] then
|
|
988
|
+
self.object:incrementGhostCounter()
|
|
987
989
|
self[135] = true
|
|
988
990
|
end
|
|
989
991
|
end
|
|
@@ -992,7 +994,7 @@ __TS__SetDescriptor(
|
|
|
992
994
|
)
|
|
993
995
|
__TS__SetDescriptor(
|
|
994
996
|
Buff.prototype,
|
|
995
|
-
"
|
|
997
|
+
"stuns",
|
|
996
998
|
{
|
|
997
999
|
get = function(self)
|
|
998
1000
|
local ____self__136_55 = self[136]
|
|
@@ -1001,16 +1003,18 @@ __TS__SetDescriptor(
|
|
|
1001
1003
|
end
|
|
1002
1004
|
return ____self__136_55
|
|
1003
1005
|
end,
|
|
1004
|
-
set = function(self,
|
|
1005
|
-
if not
|
|
1006
|
-
if self[
|
|
1006
|
+
set = function(self, stuns)
|
|
1007
|
+
if not stuns and self[136] then
|
|
1008
|
+
if self[137] then
|
|
1007
1009
|
self.object:decrementStunCounter()
|
|
1008
1010
|
end
|
|
1011
|
+
self.object:decrementStunCounter()
|
|
1009
1012
|
self[136] = nil
|
|
1010
|
-
elseif
|
|
1011
|
-
if self[
|
|
1013
|
+
elseif stuns and not self[136] then
|
|
1014
|
+
if self[137] then
|
|
1012
1015
|
self.object:incrementStunCounter()
|
|
1013
1016
|
end
|
|
1017
|
+
self.object:incrementStunCounter()
|
|
1014
1018
|
self[136] = true
|
|
1015
1019
|
end
|
|
1016
1020
|
end
|
|
@@ -1019,7 +1023,7 @@ __TS__SetDescriptor(
|
|
|
1019
1023
|
)
|
|
1020
1024
|
__TS__SetDescriptor(
|
|
1021
1025
|
Buff.prototype,
|
|
1022
|
-
"
|
|
1026
|
+
"ignoresStunImmunity",
|
|
1023
1027
|
{
|
|
1024
1028
|
get = function(self)
|
|
1025
1029
|
local ____self__137_56 = self[137]
|
|
@@ -1028,12 +1032,16 @@ __TS__SetDescriptor(
|
|
|
1028
1032
|
end
|
|
1029
1033
|
return ____self__137_56
|
|
1030
1034
|
end,
|
|
1031
|
-
set = function(self,
|
|
1032
|
-
if not
|
|
1033
|
-
self
|
|
1035
|
+
set = function(self, ignoresStunImmunity)
|
|
1036
|
+
if not ignoresStunImmunity and self[137] then
|
|
1037
|
+
if self[136] then
|
|
1038
|
+
self.object:decrementStunCounter()
|
|
1039
|
+
end
|
|
1034
1040
|
self[137] = nil
|
|
1035
|
-
elseif
|
|
1036
|
-
self
|
|
1041
|
+
elseif ignoresStunImmunity and not self[137] then
|
|
1042
|
+
if self[136] then
|
|
1043
|
+
self.object:incrementStunCounter()
|
|
1044
|
+
end
|
|
1037
1045
|
self[137] = true
|
|
1038
1046
|
end
|
|
1039
1047
|
end
|
|
@@ -1042,7 +1050,7 @@ __TS__SetDescriptor(
|
|
|
1042
1050
|
)
|
|
1043
1051
|
__TS__SetDescriptor(
|
|
1044
1052
|
Buff.prototype,
|
|
1045
|
-
"
|
|
1053
|
+
"disablesAutoAttack",
|
|
1046
1054
|
{
|
|
1047
1055
|
get = function(self)
|
|
1048
1056
|
local ____self__138_57 = self[138]
|
|
@@ -1051,12 +1059,12 @@ __TS__SetDescriptor(
|
|
|
1051
1059
|
end
|
|
1052
1060
|
return ____self__138_57
|
|
1053
1061
|
end,
|
|
1054
|
-
set = function(self,
|
|
1055
|
-
if not
|
|
1056
|
-
self.object:
|
|
1062
|
+
set = function(self, disablesAutoAttack)
|
|
1063
|
+
if not disablesAutoAttack and self[138] then
|
|
1064
|
+
self.object:decrementDisableAutoAttackCounter()
|
|
1057
1065
|
self[138] = nil
|
|
1058
|
-
elseif
|
|
1059
|
-
self.object:
|
|
1066
|
+
elseif disablesAutoAttack and not self[138] then
|
|
1067
|
+
self.object:incrementDisableAutoAttackCounter()
|
|
1060
1068
|
self[138] = true
|
|
1061
1069
|
end
|
|
1062
1070
|
end
|
|
@@ -1065,7 +1073,7 @@ __TS__SetDescriptor(
|
|
|
1065
1073
|
)
|
|
1066
1074
|
__TS__SetDescriptor(
|
|
1067
1075
|
Buff.prototype,
|
|
1068
|
-
"
|
|
1076
|
+
"providesInvulnerability",
|
|
1069
1077
|
{
|
|
1070
1078
|
get = function(self)
|
|
1071
1079
|
local ____self__139_58 = self[139]
|
|
@@ -1074,10 +1082,12 @@ __TS__SetDescriptor(
|
|
|
1074
1082
|
end
|
|
1075
1083
|
return ____self__139_58
|
|
1076
1084
|
end,
|
|
1077
|
-
set = function(self,
|
|
1078
|
-
if not
|
|
1085
|
+
set = function(self, providesInvulnerability)
|
|
1086
|
+
if not providesInvulnerability and self[139] then
|
|
1087
|
+
self.object:decrementInvulnerabilityCounter()
|
|
1079
1088
|
self[139] = nil
|
|
1080
|
-
elseif
|
|
1089
|
+
elseif providesInvulnerability and not self[139] then
|
|
1090
|
+
self.object:incrementInvulnerabilityCounter()
|
|
1081
1091
|
self[139] = true
|
|
1082
1092
|
end
|
|
1083
1093
|
end
|
|
@@ -1086,7 +1096,7 @@ __TS__SetDescriptor(
|
|
|
1086
1096
|
)
|
|
1087
1097
|
__TS__SetDescriptor(
|
|
1088
1098
|
Buff.prototype,
|
|
1089
|
-
"
|
|
1099
|
+
"killsOnExpiration",
|
|
1090
1100
|
{
|
|
1091
1101
|
get = function(self)
|
|
1092
1102
|
local ____self__140_59 = self[140]
|
|
@@ -1105,6 +1115,27 @@ __TS__SetDescriptor(
|
|
|
1105
1115
|
},
|
|
1106
1116
|
true
|
|
1107
1117
|
)
|
|
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
|
+
)
|
|
1108
1139
|
__TS__SetDescriptor(
|
|
1109
1140
|
Buff.prototype,
|
|
1110
1141
|
"maximumDamageDealtEventCount",
|
|
@@ -1221,13 +1252,13 @@ __TS__SetDescriptor(
|
|
|
1221
1252
|
"remainingDuration",
|
|
1222
1253
|
{
|
|
1223
1254
|
get = function(self)
|
|
1224
|
-
local
|
|
1225
|
-
return
|
|
1255
|
+
local ____opt_61 = self._timer
|
|
1256
|
+
return ____opt_61 and ____opt_61.remaining or 0
|
|
1226
1257
|
end,
|
|
1227
1258
|
set = function(self, remainingDuration)
|
|
1228
|
-
local
|
|
1229
|
-
local
|
|
1230
|
-
local remainingDurationDelta =
|
|
1259
|
+
local ____remainingDuration_65 = remainingDuration
|
|
1260
|
+
local ____opt_63 = self._timer
|
|
1261
|
+
local remainingDurationDelta = ____remainingDuration_65 - (____opt_63 and ____opt_63.remaining or 0)
|
|
1231
1262
|
if remainingDurationDelta ~= 0 then
|
|
1232
1263
|
self[103] = self[103] + remainingDurationDelta
|
|
1233
1264
|
if remainingDuration <= 0 then
|
|
@@ -1242,7 +1273,7 @@ __TS__SetDescriptor(
|
|
|
1242
1273
|
remainingDuration,
|
|
1243
1274
|
self._spellStealPriority,
|
|
1244
1275
|
self._learnLevelMinimum,
|
|
1245
|
-
self[
|
|
1276
|
+
self[142]
|
|
1246
1277
|
) then
|
|
1247
1278
|
local timer = self._timer
|
|
1248
1279
|
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 target:hasClassification(UnitClassification.RESISTANT) and DURATION_HERO_ABILITY_FLOAT_LEVEL_FIELD:getValue(ability, level) or DURATION_NORMAL_ABILITY_FLOAT_LEVEL_FIELD:getValue(ability, level)
|
|
11
|
+
return target ~= nil and (target.isHero or target:getField(UNIT_IF_LEVEL) >= 6 or 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,7 +100,9 @@ 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
|
|
103
|
+
IS_TEAM_GLOW_HIDDEN = 106,
|
|
104
|
+
LAST_X = 107,
|
|
105
|
+
LAST_Y = 108
|
|
104
106
|
}
|
|
105
107
|
export type UnitSyncId = number & {
|
|
106
108
|
readonly __unitSyncId: unique symbol;
|
|
@@ -113,6 +115,8 @@ export declare class Unit extends Handle<junit> {
|
|
|
113
115
|
private [UnitPropertyKey.DELAY_HEALTH_CHECKS_HEALTH_BONUS]?;
|
|
114
116
|
private [UnitPropertyKey.PREVENT_DEATH_HEALTH_BONUS]?;
|
|
115
117
|
private [UnitPropertyKey.IS_TEAM_GLOW_HIDDEN]?;
|
|
118
|
+
private [UnitPropertyKey.LAST_X]?;
|
|
119
|
+
private [UnitPropertyKey.LAST_Y]?;
|
|
116
120
|
private _owner?;
|
|
117
121
|
private _timeScale?;
|
|
118
122
|
private events?;
|
|
@@ -148,6 +152,7 @@ export declare class Unit extends Handle<junit> {
|
|
|
148
152
|
isEnemyOf(unit: Unit): boolean;
|
|
149
153
|
playAnimation(animation: string, rarity?: jraritycontrol): void;
|
|
150
154
|
playAnimation(animation: number): void;
|
|
155
|
+
resetAnimation(): void;
|
|
151
156
|
queueAnimation(animation: string): void;
|
|
152
157
|
get weapons(): [UnitWeapon, UnitWeapon];
|
|
153
158
|
get firstWeapon(): UnitWeapon;
|
package/engine/internal/unit.lua
CHANGED
|
@@ -58,6 +58,7 @@ local ____tostring = _G.tostring
|
|
|
58
58
|
local setUnitAnimation = SetUnitAnimation
|
|
59
59
|
local setUnitAnimationWithRarity = SetUnitAnimationWithRarity
|
|
60
60
|
local setUnitAnimationByIndex = SetUnitAnimationByIndex
|
|
61
|
+
local resetUnitAnimation = ResetUnitAnimation
|
|
61
62
|
local queueUnitAnimation = QueueUnitAnimation
|
|
62
63
|
local getUnitIntegerField = BlzGetUnitIntegerField
|
|
63
64
|
local getUnitRealField = BlzGetUnitRealField
|
|
@@ -680,6 +681,8 @@ function Unit.prototype.getEvent(self, event, collector)
|
|
|
680
681
|
end
|
|
681
682
|
function Unit.prototype.onDestroy(self)
|
|
682
683
|
local handle = self.handle
|
|
684
|
+
self[107] = getUnitX(handle)
|
|
685
|
+
self[108] = getUnitY(handle)
|
|
683
686
|
if not self._owner then
|
|
684
687
|
self._owner = Player:of(getOwningPlayer(handle))
|
|
685
688
|
end
|
|
@@ -795,6 +798,9 @@ function Unit.prototype.playAnimation(self, animation, rarity)
|
|
|
795
798
|
setUnitAnimation(self.handle, animation)
|
|
796
799
|
end
|
|
797
800
|
end
|
|
801
|
+
function Unit.prototype.resetAnimation(self)
|
|
802
|
+
resetUnitAnimation(self.handle)
|
|
803
|
+
end
|
|
798
804
|
function Unit.prototype.queueAnimation(self, animation)
|
|
799
805
|
queueUnitAnimation(self.handle, animation)
|
|
800
806
|
end
|
|
@@ -1597,7 +1603,7 @@ __TS__SetDescriptor(
|
|
|
1597
1603
|
"x",
|
|
1598
1604
|
{
|
|
1599
1605
|
get = function(self)
|
|
1600
|
-
return getUnitX(self.handle)
|
|
1606
|
+
return self[107] or getUnitX(self.handle)
|
|
1601
1607
|
end,
|
|
1602
1608
|
set = function(self, v)
|
|
1603
1609
|
SetUnitX(self.handle, v)
|
|
@@ -1610,7 +1616,7 @@ __TS__SetDescriptor(
|
|
|
1610
1616
|
"y",
|
|
1611
1617
|
{
|
|
1612
1618
|
get = function(self)
|
|
1613
|
-
return getUnitY(self.handle)
|
|
1619
|
+
return self[108] or getUnitY(self.handle)
|
|
1614
1620
|
end,
|
|
1615
1621
|
set = function(self, v)
|
|
1616
1622
|
SetUnitY(self.handle, v)
|
|
@@ -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
|
|
@@ -2,13 +2,18 @@
|
|
|
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";
|
|
5
6
|
export type AttachmentPreset = {
|
|
6
7
|
modelPath: string;
|
|
7
8
|
nodeName: ModelNodeName;
|
|
8
9
|
nodeQualifiers: ModelNodeQualifier[];
|
|
9
10
|
};
|
|
10
|
-
export type
|
|
11
|
-
|
|
11
|
+
export type EffectPresetWithParameters = AttachmentPreset & {
|
|
12
|
+
parameters?: EffectParameters;
|
|
13
|
+
};
|
|
14
|
+
export type AttachmentPresetInput<T extends AttachmentPreset = AttachmentPreset> = Optional<T, "nodeName" | "nodeQualifiers"> | string;
|
|
15
|
+
export type EffectPresetWithParametersInput = AttachmentPresetInput<EffectPresetWithParameters>;
|
|
16
|
+
export declare const toEffectPreset: (effectPresetInput: EffectPresetWithParametersInput) => EffectPresetWithParameters;
|
|
12
17
|
export declare const extractAttachmentPresetInputModelPath: (attachmentPresetInput: AttachmentPresetInput | undefined) => string;
|
|
13
18
|
export declare const extractAttachmentPresetInputNodeFQN: (attachmentPresetInput: AttachmentPresetInput | undefined) => string;
|
|
14
19
|
export declare const splitAttachmentNodeFQN: (attachmentNodeFQN: string) => LuaMultiReturn<[attachmentNodeName: ModelNodeName, attachmentNodeQualifiers: ModelNodeQualifier[]]>;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
local ____lualib = require("lualib_bundle")
|
|
2
|
+
local __TS__ArrayJoin = ____lualib.__TS__ArrayJoin
|
|
2
3
|
local __TS__StringSplit = ____lualib.__TS__StringSplit
|
|
3
4
|
local __TS__ArraySlice = ____lualib.__TS__ArraySlice
|
|
4
5
|
local ____exports = {}
|
|
5
|
-
____exports.
|
|
6
|
-
return type(
|
|
6
|
+
____exports.toEffectPreset = function(effectPresetInput)
|
|
7
|
+
return type(effectPresetInput) == "string" and ({modelPath = effectPresetInput, nodeName = "origin", nodeQualifiers = {}}) or ({modelPath = effectPresetInput.modelPath, nodeName = effectPresetInput.nodeName or "origin", nodeQualifiers = effectPresetInput.nodeQualifiers or ({}), parameters = effectPresetInput.parameters})
|
|
7
8
|
end
|
|
8
9
|
____exports.extractAttachmentPresetInputModelPath = function(attachmentPresetInput)
|
|
9
10
|
return type(attachmentPresetInput) == "string" and attachmentPresetInput or (attachmentPresetInput and attachmentPresetInput.modelPath or "")
|
|
@@ -12,7 +13,7 @@ ____exports.extractAttachmentPresetInputNodeFQN = function(attachmentPresetInput
|
|
|
12
13
|
if type(attachmentPresetInput) == "string" or attachmentPresetInput == nil then
|
|
13
14
|
return ""
|
|
14
15
|
end
|
|
15
|
-
return
|
|
16
|
+
return __TS__ArrayJoin(
|
|
16
17
|
{
|
|
17
18
|
attachmentPresetInput.nodeName,
|
|
18
19
|
table.unpack(attachmentPresetInput.nodeQualifiers or ({}))
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/** @noSelfInFile */
|
|
2
|
+
export declare const enum SoundEax {
|
|
3
|
+
DEFAULT = "DefaultEAXON",
|
|
4
|
+
ACKNOWLEDGEMENTS = "HeroAcksEAX",
|
|
5
|
+
ENVIRONMENT = "DoodadsEAX",
|
|
6
|
+
DRUMS = "KotoDrumsEAX",
|
|
7
|
+
ATTACKS = "CombatSoundsEAX",
|
|
8
|
+
ABILITIES = "SpellsEAX",
|
|
9
|
+
MISSILES = "MissilesEAX"
|
|
10
|
+
}
|
|
@@ -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")
|
|
@@ -211,7 +213,16 @@ for abilityTypeId, usesAttackAnimation in pairs(postcompile(function()
|
|
|
211
213
|
for abilityTypeId, usesAttackAnimation in pairs(usesAttackAnimationByAbilityTypeId) do
|
|
212
214
|
if usesAttackAnimation then
|
|
213
215
|
local abilityType = checkNotNull(____exports.BlankConfigurableAbilityType:of(abilityTypeId))
|
|
214
|
-
abilityType.channelingAnimation
|
|
216
|
+
if isAnimationName(abilityType.channelingAnimation[1]) then
|
|
217
|
+
if abilityType.channelingAnimation[1] ~= "attack" then
|
|
218
|
+
abilityType.channelingAnimation = {"attack"}
|
|
219
|
+
end
|
|
220
|
+
else
|
|
221
|
+
abilityType.channelingAnimation = {
|
|
222
|
+
"attack",
|
|
223
|
+
table.unpack(abilityType.channelingAnimation)
|
|
224
|
+
}
|
|
225
|
+
end
|
|
215
226
|
end
|
|
216
227
|
end
|
|
217
228
|
return usesAttackAnimationByAbilityTypeId
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/** @noSelfInFile */
|
|
2
|
+
import { AbilityType, AbilityTypeId } from "../ability-type";
|
|
3
|
+
import { ObjectDataEntryLevelFieldValueSupplier } from "../../entry";
|
|
4
|
+
export declare class CarrionSwarmAbilityType extends AbilityType {
|
|
5
|
+
static readonly BASE_ID: AbilityTypeId;
|
|
6
|
+
get damagePerTarget(): number[];
|
|
7
|
+
set damagePerTarget(damagePerTarget: ObjectDataEntryLevelFieldValueSupplier<number>);
|
|
8
|
+
get maximumTotalDamage(): number[];
|
|
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
|
+
}
|
|
@@ -0,0 +1,65 @@
|
|
|
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.CarrionSwarmAbilityType = __TS__Class()
|
|
9
|
+
local CarrionSwarmAbilityType = ____exports.CarrionSwarmAbilityType
|
|
10
|
+
CarrionSwarmAbilityType.name = "CarrionSwarmAbilityType"
|
|
11
|
+
__TS__ClassExtends(CarrionSwarmAbilityType, AbilityType)
|
|
12
|
+
CarrionSwarmAbilityType.BASE_ID = fourCC("AUcs")
|
|
13
|
+
__TS__SetDescriptor(
|
|
14
|
+
CarrionSwarmAbilityType.prototype,
|
|
15
|
+
"damagePerTarget",
|
|
16
|
+
{
|
|
17
|
+
get = function(self)
|
|
18
|
+
return self:getNumberLevelField("Ucs1")
|
|
19
|
+
end,
|
|
20
|
+
set = function(self, damagePerTarget)
|
|
21
|
+
self:setNumberLevelField("Ucs1", damagePerTarget)
|
|
22
|
+
end
|
|
23
|
+
},
|
|
24
|
+
true
|
|
25
|
+
)
|
|
26
|
+
__TS__SetDescriptor(
|
|
27
|
+
CarrionSwarmAbilityType.prototype,
|
|
28
|
+
"maximumTotalDamage",
|
|
29
|
+
{
|
|
30
|
+
get = function(self)
|
|
31
|
+
return self:getNumberLevelField("Ucs2")
|
|
32
|
+
end,
|
|
33
|
+
set = function(self, maximumTotalDamage)
|
|
34
|
+
self:setNumberLevelField("Ucs2", maximumTotalDamage)
|
|
35
|
+
end
|
|
36
|
+
},
|
|
37
|
+
true
|
|
38
|
+
)
|
|
39
|
+
__TS__SetDescriptor(
|
|
40
|
+
CarrionSwarmAbilityType.prototype,
|
|
41
|
+
"distance",
|
|
42
|
+
{
|
|
43
|
+
get = function(self)
|
|
44
|
+
return self:getNumberLevelField("Ucs3")
|
|
45
|
+
end,
|
|
46
|
+
set = function(self, distance)
|
|
47
|
+
self:setNumberLevelField("Ucs3", distance)
|
|
48
|
+
end
|
|
49
|
+
},
|
|
50
|
+
true
|
|
51
|
+
)
|
|
52
|
+
__TS__SetDescriptor(
|
|
53
|
+
CarrionSwarmAbilityType.prototype,
|
|
54
|
+
"finalAreaOfEffect",
|
|
55
|
+
{
|
|
56
|
+
get = function(self)
|
|
57
|
+
return self:getNumberLevelField("Ucs4")
|
|
58
|
+
end,
|
|
59
|
+
set = function(self, finalAreaOfEffect)
|
|
60
|
+
self:setNumberLevelField("Ucs4", finalAreaOfEffect)
|
|
61
|
+
end
|
|
62
|
+
},
|
|
63
|
+
true
|
|
64
|
+
)
|
|
65
|
+
return ____exports
|
|
@@ -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
|