warscript 0.0.1-dev.e5e97e8 → 0.0.1-dev.e698bed
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/player.d.ts +1 -0
- package/core/types/player.lua +4 -1
- package/core/types/tileCell.d.ts +2 -1
- package/core/types/tileCell.lua +5 -0
- package/engine/behavior.d.ts +7 -1
- package/engine/behavior.lua +88 -65
- package/engine/behaviour/ability/apply-buff.lua +12 -4
- package/engine/behaviour/unit/stun-immunity.d.ts +6 -4
- package/engine/behaviour/unit/stun-immunity.lua +1 -1
- package/engine/behaviour/unit.d.ts +7 -3
- package/engine/behaviour/unit.lua +89 -22
- package/engine/buff.d.ts +10 -1
- package/engine/buff.lua +58 -2
- package/engine/internal/unit/fly-height.d.ts +7 -0
- package/engine/internal/unit/fly-height.lua +20 -0
- package/engine/internal/unit/scale.d.ts +7 -0
- package/engine/internal/unit/scale.lua +20 -0
- package/engine/internal/unit.d.ts +0 -4
- package/engine/internal/unit.lua +0 -27
- package/engine/object-data/entry/unit-type.d.ts +4 -0
- package/engine/object-data/entry/unit-type.lua +76 -32
- package/engine/object-field/unit.d.ts +13 -1
- package/engine/object-field/unit.lua +57 -0
- package/engine/object-field.d.ts +2 -2
- package/engine/object-field.lua +57 -59
- package/engine/standard/fields/ability.d.ts +2 -2
- package/engine/standard/fields/ability.lua +2 -2
- package/engine/standard/fields/unit.d.ts +3 -1
- package/engine/standard/fields/unit.lua +4 -0
- package/engine/unit.d.ts +2 -0
- package/engine/unit.lua +2 -0
- package/package.json +1 -1
package/engine/object-field.lua
CHANGED
|
@@ -100,7 +100,7 @@ function ObjectField.prototype.getValue(self, entry, includeModifiers)
|
|
|
100
100
|
end
|
|
101
101
|
return self.defaultValue
|
|
102
102
|
end
|
|
103
|
-
if includeModifiers
|
|
103
|
+
if not includeModifiers then
|
|
104
104
|
local originalValueByInstance = self.originalValueByInstance
|
|
105
105
|
if originalValueByInstance ~= nil then
|
|
106
106
|
local originalValue = originalValueByInstance[entry]
|
|
@@ -235,10 +235,8 @@ function ObjectField.prototype.setActualValue(self, instance, value)
|
|
|
235
235
|
____self_valueByInstance_instance_6_7 = self.defaultValue
|
|
236
236
|
end
|
|
237
237
|
local previousValue = ____self_valueByInstance_instance_6_7
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
self:invokeValueChangeEvent(instance, self, previousValue, value)
|
|
241
|
-
end
|
|
238
|
+
self.valueByInstance[instance] = value
|
|
239
|
+
self:invokeValueChangeEvent(instance, self, previousValue, value)
|
|
242
240
|
return true
|
|
243
241
|
end
|
|
244
242
|
end
|
|
@@ -246,12 +244,10 @@ function ObjectField.prototype.setActualValue(self, instance, value)
|
|
|
246
244
|
return false
|
|
247
245
|
end
|
|
248
246
|
local previousValue = self:getNativeFieldValue(instance)
|
|
249
|
-
if value ~= previousValue then
|
|
250
|
-
|
|
251
|
-
return false
|
|
252
|
-
end
|
|
253
|
-
self:invokeValueChangeEvent(instance, self, previousValue, value)
|
|
247
|
+
if value ~= previousValue and not self:setNativeFieldValue(instance, value) then
|
|
248
|
+
return false
|
|
254
249
|
end
|
|
250
|
+
self:invokeValueChangeEvent(instance, self, previousValue, value)
|
|
255
251
|
return true
|
|
256
252
|
end
|
|
257
253
|
function ObjectField.prototype.calculateActualValue(self, instance)
|
|
@@ -407,6 +403,12 @@ function ObjectLevelField.prototype.getValue(self, entry, level)
|
|
|
407
403
|
end
|
|
408
404
|
return self.defaultValue
|
|
409
405
|
end
|
|
406
|
+
local ____opt_19 = self.originalValueByLevelByInstance
|
|
407
|
+
local ____opt_17 = ____opt_19 and ____opt_19[entry]
|
|
408
|
+
local originalValue = ____opt_17 and ____opt_17[level]
|
|
409
|
+
if originalValue ~= nil then
|
|
410
|
+
return originalValue
|
|
411
|
+
end
|
|
410
412
|
return self:getActualValue(entry, level)
|
|
411
413
|
end
|
|
412
414
|
function ObjectLevelField.prototype.setValue(self, entry, levelOrValue, value)
|
|
@@ -477,11 +479,11 @@ function ObjectLevelField.prototype.applyModifier(self, instance, modifier)
|
|
|
477
479
|
local originalValueByLevel = getOrPut(originalValueByLevelByInstance, instance, mutableLuaMap)
|
|
478
480
|
local levelCount = self:getLevelCount(instance)
|
|
479
481
|
for level = 0, levelCount - 1 do
|
|
480
|
-
local
|
|
481
|
-
if
|
|
482
|
-
|
|
482
|
+
local ____originalValueByLevel_level_21 = originalValueByLevel[level]
|
|
483
|
+
if ____originalValueByLevel_level_21 == nil then
|
|
484
|
+
____originalValueByLevel_level_21 = self:getActualValue(instance, level)
|
|
483
485
|
end
|
|
484
|
-
originalValueByLevel[level] =
|
|
486
|
+
originalValueByLevel[level] = ____originalValueByLevel_level_21
|
|
485
487
|
self:setActualValue(
|
|
486
488
|
instance,
|
|
487
489
|
level,
|
|
@@ -528,23 +530,23 @@ function ObjectLevelField.prototype.getActualValue(self, instance, level)
|
|
|
528
530
|
if defaultValueByObjectDataEntryId ~= nil or self.isGlobal then
|
|
529
531
|
local defaultValueByLevel = (defaultValueByObjectDataEntryId or emptyLuaMap())[self:getObjectDataEntryId(instance)]
|
|
530
532
|
if defaultValueByLevel ~= nil or self.isGlobal then
|
|
531
|
-
local
|
|
532
|
-
local
|
|
533
|
-
if
|
|
534
|
-
|
|
533
|
+
local ____opt_22 = self.valueByInstance[instance]
|
|
534
|
+
local ____temp_24 = ____opt_22 and ____opt_22[level + 1]
|
|
535
|
+
if ____temp_24 == nil then
|
|
536
|
+
____temp_24 = (defaultValueByLevel or emptyArray())[level + 1]
|
|
535
537
|
end
|
|
536
|
-
local
|
|
537
|
-
if
|
|
538
|
-
|
|
538
|
+
local ____temp_24_25 = ____temp_24
|
|
539
|
+
if ____temp_24_25 == nil then
|
|
540
|
+
____temp_24_25 = self.defaultValue
|
|
539
541
|
end
|
|
540
|
-
return
|
|
542
|
+
return ____temp_24_25
|
|
541
543
|
end
|
|
542
544
|
end
|
|
543
|
-
local
|
|
544
|
-
if
|
|
545
|
-
|
|
545
|
+
local ____temp_26 = self:getNativeFieldValue(instance, level)
|
|
546
|
+
if ____temp_26 == nil then
|
|
547
|
+
____temp_26 = self.defaultValue
|
|
546
548
|
end
|
|
547
|
-
return
|
|
549
|
+
return ____temp_26
|
|
548
550
|
end
|
|
549
551
|
function ObjectLevelField.prototype.setActualValue(self, instance, level, value)
|
|
550
552
|
local defaultValueByObjectDataEntryId = defaultValueByObjectDataEntryIdByObjectFieldId[self.id]
|
|
@@ -557,25 +559,23 @@ function ObjectLevelField.prototype.setActualValue(self, instance, level, value)
|
|
|
557
559
|
valueByLevel = {}
|
|
558
560
|
self.valueByInstance[instance] = valueByLevel
|
|
559
561
|
end
|
|
560
|
-
local
|
|
561
|
-
if
|
|
562
|
-
|
|
563
|
-
end
|
|
564
|
-
local ____valueByLevel_index_23_24 = ____valueByLevel_index_23
|
|
565
|
-
if ____valueByLevel_index_23_24 == nil then
|
|
566
|
-
____valueByLevel_index_23_24 = self.defaultValue
|
|
562
|
+
local ____valueByLevel_index_27 = valueByLevel[level + 1]
|
|
563
|
+
if ____valueByLevel_index_27 == nil then
|
|
564
|
+
____valueByLevel_index_27 = (defaultValueByLevel or emptyArray())[level + 1]
|
|
567
565
|
end
|
|
568
|
-
local
|
|
569
|
-
if
|
|
570
|
-
|
|
571
|
-
self:invokeValueChangeEvent(
|
|
572
|
-
instance,
|
|
573
|
-
self,
|
|
574
|
-
level,
|
|
575
|
-
previousValue,
|
|
576
|
-
value
|
|
577
|
-
)
|
|
566
|
+
local ____valueByLevel_index_27_28 = ____valueByLevel_index_27
|
|
567
|
+
if ____valueByLevel_index_27_28 == nil then
|
|
568
|
+
____valueByLevel_index_27_28 = self.defaultValue
|
|
578
569
|
end
|
|
570
|
+
local previousValue = ____valueByLevel_index_27_28
|
|
571
|
+
valueByLevel[level + 1] = value
|
|
572
|
+
self:invokeValueChangeEvent(
|
|
573
|
+
instance,
|
|
574
|
+
self,
|
|
575
|
+
level,
|
|
576
|
+
previousValue,
|
|
577
|
+
value
|
|
578
|
+
)
|
|
579
579
|
return true
|
|
580
580
|
end
|
|
581
581
|
end
|
|
@@ -583,26 +583,24 @@ function ObjectLevelField.prototype.setActualValue(self, instance, level, value)
|
|
|
583
583
|
return false
|
|
584
584
|
end
|
|
585
585
|
local previousValue = self:getNativeFieldValue(instance, level)
|
|
586
|
-
if value ~= previousValue then
|
|
587
|
-
|
|
588
|
-
return false
|
|
589
|
-
end
|
|
590
|
-
self:invokeValueChangeEvent(
|
|
591
|
-
instance,
|
|
592
|
-
self,
|
|
593
|
-
level,
|
|
594
|
-
previousValue,
|
|
595
|
-
value
|
|
596
|
-
)
|
|
586
|
+
if value ~= previousValue and not self:setNativeFieldValue(instance, level, value) then
|
|
587
|
+
return false
|
|
597
588
|
end
|
|
589
|
+
self:invokeValueChangeEvent(
|
|
590
|
+
instance,
|
|
591
|
+
self,
|
|
592
|
+
level,
|
|
593
|
+
previousValue,
|
|
594
|
+
value
|
|
595
|
+
)
|
|
598
596
|
return true
|
|
599
597
|
end
|
|
600
598
|
function ObjectLevelField.prototype.calculateActualValue(self, instance, level)
|
|
601
|
-
local
|
|
602
|
-
local
|
|
603
|
-
local originalValue =
|
|
604
|
-
local
|
|
605
|
-
local modifiers =
|
|
599
|
+
local ____opt_31 = self.originalValueByLevelByInstance
|
|
600
|
+
local ____opt_29 = ____opt_31 and ____opt_31[instance]
|
|
601
|
+
local originalValue = ____opt_29 and ____opt_29[level]
|
|
602
|
+
local ____opt_33 = self.modifiersByInstance
|
|
603
|
+
local modifiers = ____opt_33 and ____opt_33[instance]
|
|
606
604
|
if originalValue ~= nil then
|
|
607
605
|
local value = originalValue
|
|
608
606
|
if modifiers ~= nil then
|
|
@@ -376,8 +376,8 @@ export declare const INVISIBILITY_TRANSITION_TIME_ABILITY_FLOAT_LEVEL_FIELD: Abi
|
|
|
376
376
|
export declare const ACTIVATION_RADIUS_ABILITY_FLOAT_LEVEL_FIELD: AbilityFloatLevelField & symbol;
|
|
377
377
|
export declare const AMOUNT_REGENERATED_ABILITY_FLOAT_LEVEL_FIELD: AbilityFloatLevelField & symbol;
|
|
378
378
|
export declare const DAMAGE_PER_SECOND_POI1_ABILITY_FLOAT_LEVEL_FIELD: AbilityFloatLevelField & symbol;
|
|
379
|
-
export declare const
|
|
380
|
-
export declare const
|
|
379
|
+
export declare const MOVEMENT_SPEED_FACTOR_POI2_ABILITY_FLOAT_LEVEL_FIELD: AbilityFloatLevelField & symbol;
|
|
380
|
+
export declare const ATTACK_SPEED_FACTOR_POI3_ABILITY_FLOAT_LEVEL_FIELD: AbilityFloatLevelField & symbol;
|
|
381
381
|
export declare const EXTRA_DAMAGE_POA1_ABILITY_FLOAT_LEVEL_FIELD: AbilityFloatLevelField & symbol;
|
|
382
382
|
export declare const DAMAGE_PER_SECOND_POA2_ABILITY_FLOAT_LEVEL_FIELD: AbilityFloatLevelField & symbol;
|
|
383
383
|
export declare const ATTACK_SPEED_FACTOR_POA3_ABILITY_FLOAT_LEVEL_FIELD: AbilityFloatLevelField & symbol;
|
|
@@ -387,8 +387,8 @@ ____exports.INVISIBILITY_TRANSITION_TIME_ABILITY_FLOAT_LEVEL_FIELD = AbilityFloa
|
|
|
387
387
|
____exports.ACTIVATION_RADIUS_ABILITY_FLOAT_LEVEL_FIELD = AbilityFloatLevelField:create(fourCC("Neu1"))
|
|
388
388
|
____exports.AMOUNT_REGENERATED_ABILITY_FLOAT_LEVEL_FIELD = AbilityFloatLevelField:create(fourCC("Arm1"))
|
|
389
389
|
____exports.DAMAGE_PER_SECOND_POI1_ABILITY_FLOAT_LEVEL_FIELD = AbilityFloatLevelField:create(fourCC("Poi1"))
|
|
390
|
-
____exports.
|
|
391
|
-
____exports.
|
|
390
|
+
____exports.MOVEMENT_SPEED_FACTOR_POI2_ABILITY_FLOAT_LEVEL_FIELD = AbilityFloatLevelField:create(fourCC("Poi2"))
|
|
391
|
+
____exports.ATTACK_SPEED_FACTOR_POI3_ABILITY_FLOAT_LEVEL_FIELD = AbilityFloatLevelField:create(fourCC("Poi3"))
|
|
392
392
|
____exports.EXTRA_DAMAGE_POA1_ABILITY_FLOAT_LEVEL_FIELD = AbilityFloatLevelField:create(fourCC("Poa1"))
|
|
393
393
|
____exports.DAMAGE_PER_SECOND_POA2_ABILITY_FLOAT_LEVEL_FIELD = AbilityFloatLevelField:create(fourCC("Poa2"))
|
|
394
394
|
____exports.ATTACK_SPEED_FACTOR_POA3_ABILITY_FLOAT_LEVEL_FIELD = AbilityFloatLevelField:create(fourCC("Poa3"))
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
/** @noSelfInFile */
|
|
2
|
-
import { UnitClassificationsField, UnitPropulsionWindowField } from "../../object-field/unit";
|
|
2
|
+
import { UnitClassificationsField, UnitFlyHeightField, UnitPropulsionWindowField, UnitScalingValueField } from "../../object-field/unit";
|
|
3
3
|
export declare const PROPULSION_WINDOW_UNIT_FLOAT_FIELD: UnitPropulsionWindowField & symbol;
|
|
4
4
|
export declare const UNIT_CLASSIFICATIONS_FIELD: UnitClassificationsField & symbol;
|
|
5
|
+
export declare const FLY_HEIGHT_UNIT_FLOAT_FIELD: UnitFlyHeightField & symbol;
|
|
6
|
+
export declare const SCALING_VALUE_UNIT_FLOAT_FIELD: UnitScalingValueField & symbol;
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
local ____exports = {}
|
|
2
2
|
local ____unit = require("engine.object-field.unit")
|
|
3
3
|
local UnitClassificationsField = ____unit.UnitClassificationsField
|
|
4
|
+
local UnitFlyHeightField = ____unit.UnitFlyHeightField
|
|
4
5
|
local UnitPropulsionWindowField = ____unit.UnitPropulsionWindowField
|
|
6
|
+
local UnitScalingValueField = ____unit.UnitScalingValueField
|
|
5
7
|
____exports.PROPULSION_WINDOW_UNIT_FLOAT_FIELD = UnitPropulsionWindowField:create(fourCC("urpw"))
|
|
6
8
|
____exports.UNIT_CLASSIFICATIONS_FIELD = UnitClassificationsField:create(fourCC("utyp"))
|
|
9
|
+
____exports.FLY_HEIGHT_UNIT_FLOAT_FIELD = UnitFlyHeightField:create(fourCC("ufyh"))
|
|
10
|
+
____exports.SCALING_VALUE_UNIT_FLOAT_FIELD = UnitScalingValueField:create(fourCC("usca"))
|
|
7
11
|
return ____exports
|
package/engine/unit.d.ts
CHANGED
|
@@ -19,6 +19,8 @@ import "./internal/unit/invulnerability-counter";
|
|
|
19
19
|
import "./internal/unit/detach-missiles";
|
|
20
20
|
import "./internal/unit/main-selected";
|
|
21
21
|
import "./internal/unit/add-item-to-slot-init";
|
|
22
|
+
import "./internal/unit/fly-height";
|
|
23
|
+
import "./internal/unit/scale";
|
|
22
24
|
import "./internal/unit/band-aids/ancestral-spirit-cannibalize";
|
|
23
25
|
export { Unit, DamagingEvent, DamageEvent } from "./internal/unit";
|
|
24
26
|
export * from "./internal/unit+damage";
|
package/engine/unit.lua
CHANGED
|
@@ -19,6 +19,8 @@ require("engine.internal.unit.invulnerability-counter")
|
|
|
19
19
|
require("engine.internal.unit.detach-missiles")
|
|
20
20
|
require("engine.internal.unit.main-selected")
|
|
21
21
|
require("engine.internal.unit.add-item-to-slot-init")
|
|
22
|
+
require("engine.internal.unit.fly-height")
|
|
23
|
+
require("engine.internal.unit.scale")
|
|
22
24
|
require("engine.internal.unit.band-aids.ancestral-spirit-cannibalize")
|
|
23
25
|
do
|
|
24
26
|
local ____unit = require("engine.internal.unit")
|
package/package.json
CHANGED