warscript 0.0.1-dev.ee6f224 → 0.0.1-dev.ef189a5
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/attributes.d.ts +1 -0
- package/attributes.lua +9 -0
- package/core/types/player.d.ts +16 -0
- package/core/types/player.lua +57 -14
- package/core/types/tileCell.d.ts +2 -1
- package/core/types/tileCell.lua +5 -0
- package/core/types/timer.d.ts +3 -2
- package/core/types/timer.lua +8 -2
- package/engine/behavior.d.ts +7 -1
- package/engine/behavior.lua +88 -65
- package/engine/behaviour/ability/apply-buff.lua +4 -4
- package/engine/behaviour/ability/remove-buffs.d.ts +9 -0
- package/engine/behaviour/ability/remove-buffs.lua +21 -0
- package/engine/behaviour/ability.d.ts +2 -1
- package/engine/behaviour/ability.lua +2 -1
- package/engine/behaviour/unit/stun-immunity.d.ts +8 -4
- package/engine/behaviour/unit/stun-immunity.lua +12 -3
- package/engine/behaviour/unit.d.ts +9 -3
- package/engine/behaviour/unit.lua +94 -22
- package/engine/buff.d.ts +12 -2
- package/engine/buff.lua +80 -17
- package/engine/internal/item.d.ts +12 -12
- package/engine/internal/item.lua +41 -26
- package/engine/internal/unit/ability.d.ts +14 -14
- package/engine/internal/unit/ability.lua +72 -45
- package/engine/internal/unit/fly-height.d.ts +7 -0
- package/engine/internal/unit/fly-height.lua +20 -0
- package/engine/internal/unit/main-selected.lua +12 -27
- package/engine/internal/unit/scale.d.ts +7 -0
- package/engine/internal/unit/scale.lua +20 -0
- package/engine/internal/unit-missile-launch.lua +44 -20
- package/engine/internal/unit.d.ts +13 -10
- package/engine/internal/unit.lua +83 -64
- package/engine/local-client.d.ts +2 -0
- package/engine/local-client.lua +30 -0
- package/engine/object-data/entry/ability-type.lua +4 -1
- package/engine/object-data/entry/destructible-type.d.ts +5 -1
- package/engine/object-data/entry/destructible-type.lua +12 -0
- 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 +7 -1
- package/engine/object-field.lua +199 -112
- 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/synchronization.d.ts +11 -0
- package/engine/synchronization.lua +77 -0
- package/engine/text-tag.lua +3 -2
- package/engine/unit.d.ts +2 -0
- package/engine/unit.lua +2 -0
- package/net/socket.lua +1 -1
- package/objutil/buff.lua +1 -1
- package/package.json +2 -2
- package/utility/arrays.d.ts +1 -0
- package/utility/arrays.lua +8 -0
- package/utility/callback-array.d.ts +5 -1
- package/utility/callback-array.lua +16 -1
- package/utility/linked-set.d.ts +1 -0
- package/utility/linked-set.lua +19 -1
- package/utility/types.d.ts +3 -0
package/engine/internal/unit.lua
CHANGED
|
@@ -62,6 +62,8 @@ local ____attributes = require("attributes")
|
|
|
62
62
|
local isAttribute = ____attributes.isAttribute
|
|
63
63
|
local ____ability = require("engine.internal.item.ability")
|
|
64
64
|
local doUnitAbilityAction = ____ability.doUnitAbilityAction
|
|
65
|
+
local ____synchronization = require("engine.synchronization")
|
|
66
|
+
local synchronizer = ____synchronization.synchronizer
|
|
65
67
|
local match = string.match
|
|
66
68
|
local ____tostring = _G.tostring
|
|
67
69
|
local setUnitAnimation = SetUnitAnimation
|
|
@@ -410,6 +412,19 @@ function UnitWeapon.prototype.____constructor(self, unit, index)
|
|
|
410
412
|
self.unit = unit
|
|
411
413
|
self.index = index
|
|
412
414
|
end
|
|
415
|
+
__TS__SetDescriptor(
|
|
416
|
+
UnitWeapon.prototype,
|
|
417
|
+
"isEnabled",
|
|
418
|
+
{
|
|
419
|
+
get = function(self)
|
|
420
|
+
return BlzGetUnitWeaponBooleanField(self.unit.handle, UNIT_WEAPON_BF_ATTACKS_ENABLED, self.index)
|
|
421
|
+
end,
|
|
422
|
+
set = function(self, isEnabled)
|
|
423
|
+
BlzSetUnitWeaponBooleanField(self.unit.handle, UNIT_WEAPON_BF_ATTACKS_ENABLED, self.index, isEnabled)
|
|
424
|
+
end
|
|
425
|
+
},
|
|
426
|
+
true
|
|
427
|
+
)
|
|
413
428
|
__TS__SetDescriptor(
|
|
414
429
|
UnitWeapon.prototype,
|
|
415
430
|
"cooldown",
|
|
@@ -644,15 +659,15 @@ for ____, player in ipairs(Player.all) do
|
|
|
644
659
|
dummies[player] = dummy
|
|
645
660
|
end
|
|
646
661
|
local function delayHealthChecksCallback(unit)
|
|
647
|
-
local counter = (unit[
|
|
662
|
+
local counter = (unit[104] or 0) - 1
|
|
648
663
|
if counter ~= 0 then
|
|
649
|
-
unit[
|
|
664
|
+
unit[104] = counter
|
|
650
665
|
return
|
|
651
666
|
end
|
|
652
|
-
unit[
|
|
653
|
-
local healthBonus = unit[
|
|
667
|
+
unit[104] = nil
|
|
668
|
+
local healthBonus = unit[105]
|
|
654
669
|
if healthBonus ~= nil then
|
|
655
|
-
unit[
|
|
670
|
+
unit[105] = nil
|
|
656
671
|
local handle = unit.handle
|
|
657
672
|
BlzSetUnitMaxHP(
|
|
658
673
|
handle,
|
|
@@ -712,8 +727,8 @@ function Unit.prototype.getEvent(self, event, collector)
|
|
|
712
727
|
end
|
|
713
728
|
function Unit.prototype.onDestroy(self)
|
|
714
729
|
local handle = self.handle
|
|
715
|
-
self[
|
|
716
|
-
self[
|
|
730
|
+
self[108] = getUnitX(handle)
|
|
731
|
+
self[109] = getUnitY(handle)
|
|
717
732
|
if not self._owner then
|
|
718
733
|
self._owner = Player:of(getOwningPlayer(handle))
|
|
719
734
|
end
|
|
@@ -836,16 +851,18 @@ function Unit.prototype.queueAnimation(self, animation)
|
|
|
836
851
|
QueueUnitAnimation(self.handle, animation)
|
|
837
852
|
end
|
|
838
853
|
function Unit.prototype.chooseWeapon(self, target)
|
|
839
|
-
|
|
840
|
-
|
|
854
|
+
local firstWeapon = self.firstWeapon
|
|
855
|
+
if firstWeapon.isEnabled and target:isAllowedTarget(self, firstWeapon.allowedTargetCombatClassifications) then
|
|
856
|
+
return firstWeapon
|
|
841
857
|
end
|
|
842
|
-
|
|
843
|
-
|
|
858
|
+
local secondWeapon = self.secondWeapon
|
|
859
|
+
if secondWeapon.isEnabled and target:isAllowedTarget(target, secondWeapon.allowedTargetCombatClassifications) then
|
|
860
|
+
return secondWeapon
|
|
844
861
|
end
|
|
845
862
|
return nil
|
|
846
863
|
end
|
|
847
864
|
function Unit.prototype.delayHealthChecks(self)
|
|
848
|
-
self[
|
|
865
|
+
self[104] = (self[104] or 0) + 1
|
|
849
866
|
Timer:run(delayHealthChecksCallback, self)
|
|
850
867
|
end
|
|
851
868
|
function Unit.prototype.setPosition(self, x, y)
|
|
@@ -1051,18 +1068,44 @@ function Unit.prototype.unpauseEx(self)
|
|
|
1051
1068
|
end
|
|
1052
1069
|
function Unit.prototype.incrementStunCounter(self)
|
|
1053
1070
|
local stunCounter = self[102] or 0
|
|
1054
|
-
if not self[101] or stunCounter >= 0 then
|
|
1071
|
+
if not self[101] and (self[103] or 0) <= 0 or stunCounter >= 0 then
|
|
1055
1072
|
BlzPauseUnitEx(self.handle, true)
|
|
1056
1073
|
end
|
|
1057
1074
|
self[102] = stunCounter + 1
|
|
1058
1075
|
end
|
|
1059
1076
|
function Unit.prototype.decrementStunCounter(self)
|
|
1060
1077
|
local stunCounter = self[102] or 0
|
|
1061
|
-
if not self[101] or stunCounter >= 1 then
|
|
1078
|
+
if not self[101] and (self[103] or 0) <= 0 or stunCounter >= 1 then
|
|
1062
1079
|
BlzPauseUnitEx(self.handle, false)
|
|
1063
1080
|
end
|
|
1064
1081
|
self[102] = stunCounter - 1
|
|
1065
1082
|
end
|
|
1083
|
+
function Unit.prototype.incrementForceStunCounter(self)
|
|
1084
|
+
local forceStunCounter = self[103] or 0
|
|
1085
|
+
if forceStunCounter == 0 then
|
|
1086
|
+
local handle = self.handle
|
|
1087
|
+
if not self[101] then
|
|
1088
|
+
for _ = self[102] or 0, -1 do
|
|
1089
|
+
BlzPauseUnitEx(handle, true)
|
|
1090
|
+
end
|
|
1091
|
+
end
|
|
1092
|
+
BlzPauseUnitEx(handle, true)
|
|
1093
|
+
end
|
|
1094
|
+
self[103] = forceStunCounter + 1
|
|
1095
|
+
end
|
|
1096
|
+
function Unit.prototype.decrementForceStunCounter(self)
|
|
1097
|
+
local forceStunCounter = self[103] or 0
|
|
1098
|
+
if forceStunCounter == 1 then
|
|
1099
|
+
local handle = self.handle
|
|
1100
|
+
if not self[101] then
|
|
1101
|
+
for _ = self[102] or 0, -1 do
|
|
1102
|
+
BlzPauseUnitEx(handle, false)
|
|
1103
|
+
end
|
|
1104
|
+
end
|
|
1105
|
+
BlzPauseUnitEx(handle, false)
|
|
1106
|
+
end
|
|
1107
|
+
self[103] = forceStunCounter - 1
|
|
1108
|
+
end
|
|
1066
1109
|
function Unit.create(self, owner, id, x, y, facing, skinId)
|
|
1067
1110
|
local handle = skinId and BlzCreateUnitWithSkin(
|
|
1068
1111
|
owner.handle,
|
|
@@ -1470,7 +1513,7 @@ __TS__SetDescriptor(
|
|
|
1470
1513
|
"isTeamGlowVisible",
|
|
1471
1514
|
{
|
|
1472
1515
|
get = function(self)
|
|
1473
|
-
return not self[
|
|
1516
|
+
return not self[107]
|
|
1474
1517
|
end,
|
|
1475
1518
|
set = function(self, isTeamGlowVisible)
|
|
1476
1519
|
BlzShowUnitTeamGlow(self.handle, isTeamGlowVisible)
|
|
@@ -1480,7 +1523,7 @@ __TS__SetDescriptor(
|
|
|
1480
1523
|
else
|
|
1481
1524
|
____temp_7 = nil
|
|
1482
1525
|
end
|
|
1483
|
-
self[
|
|
1526
|
+
self[107] = ____temp_7
|
|
1484
1527
|
end
|
|
1485
1528
|
},
|
|
1486
1529
|
true
|
|
@@ -1490,7 +1533,7 @@ __TS__SetDescriptor(
|
|
|
1490
1533
|
"color",
|
|
1491
1534
|
{set = function(self, color)
|
|
1492
1535
|
SetUnitColor(self.handle, color.handle)
|
|
1493
|
-
if self[
|
|
1536
|
+
if self[107] then
|
|
1494
1537
|
BlzShowUnitTeamGlow(self.handle, false)
|
|
1495
1538
|
end
|
|
1496
1539
|
end},
|
|
@@ -1514,14 +1557,14 @@ __TS__SetDescriptor(
|
|
|
1514
1557
|
"maxHealth",
|
|
1515
1558
|
{
|
|
1516
1559
|
get = function(self)
|
|
1517
|
-
return BlzGetUnitMaxHP(self.handle) - (self[
|
|
1560
|
+
return BlzGetUnitMaxHP(self.handle) - (self[105] or 0) - (self[106] or 0)
|
|
1518
1561
|
end,
|
|
1519
1562
|
set = function(self, maxHealth)
|
|
1520
|
-
if maxHealth < 1 and self[
|
|
1521
|
-
self[
|
|
1563
|
+
if maxHealth < 1 and self[104] ~= nil then
|
|
1564
|
+
self[105] = (self[105] or 0) + (1 - maxHealth)
|
|
1522
1565
|
maxHealth = 1
|
|
1523
1566
|
end
|
|
1524
|
-
BlzSetUnitMaxHP(self.handle, maxHealth + (self[
|
|
1567
|
+
BlzSetUnitMaxHP(self.handle, maxHealth + (self[106] or 0))
|
|
1525
1568
|
end
|
|
1526
1569
|
},
|
|
1527
1570
|
true
|
|
@@ -1563,10 +1606,10 @@ __TS__SetDescriptor(
|
|
|
1563
1606
|
"health",
|
|
1564
1607
|
{
|
|
1565
1608
|
get = function(self)
|
|
1566
|
-
return GetWidgetLife(self.handle) - (self[
|
|
1609
|
+
return GetWidgetLife(self.handle) - (self[106] or 0)
|
|
1567
1610
|
end,
|
|
1568
1611
|
set = function(self, health)
|
|
1569
|
-
SetWidgetLife(self.handle, health + (self[
|
|
1612
|
+
SetWidgetLife(self.handle, health + (self[106] or 0))
|
|
1570
1613
|
end
|
|
1571
1614
|
},
|
|
1572
1615
|
true
|
|
@@ -1642,25 +1685,12 @@ __TS__SetDescriptor(
|
|
|
1642
1685
|
},
|
|
1643
1686
|
true
|
|
1644
1687
|
)
|
|
1645
|
-
__TS__SetDescriptor(
|
|
1646
|
-
Unit.prototype,
|
|
1647
|
-
"flyHeight",
|
|
1648
|
-
{
|
|
1649
|
-
get = function(self)
|
|
1650
|
-
return getUnitFlyHeight(self.handle)
|
|
1651
|
-
end,
|
|
1652
|
-
set = function(self, v)
|
|
1653
|
-
SetUnitFlyHeight(self.handle, v, 100000)
|
|
1654
|
-
end
|
|
1655
|
-
},
|
|
1656
|
-
true
|
|
1657
|
-
)
|
|
1658
1688
|
__TS__SetDescriptor(
|
|
1659
1689
|
Unit.prototype,
|
|
1660
1690
|
"x",
|
|
1661
1691
|
{
|
|
1662
1692
|
get = function(self)
|
|
1663
|
-
return self[
|
|
1693
|
+
return self[108] or getUnitX(self.handle)
|
|
1664
1694
|
end,
|
|
1665
1695
|
set = function(self, v)
|
|
1666
1696
|
SetUnitX(self.handle, v)
|
|
@@ -1673,7 +1703,7 @@ __TS__SetDescriptor(
|
|
|
1673
1703
|
"y",
|
|
1674
1704
|
{
|
|
1675
1705
|
get = function(self)
|
|
1676
|
-
return self[
|
|
1706
|
+
return self[109] or getUnitY(self.handle)
|
|
1677
1707
|
end,
|
|
1678
1708
|
set = function(self, v)
|
|
1679
1709
|
SetUnitY(self.handle, v)
|
|
@@ -1778,14 +1808,18 @@ __TS__SetDescriptor(
|
|
|
1778
1808
|
local handle = self.handle
|
|
1779
1809
|
if isPaused and not IsUnitPaused(handle) then
|
|
1780
1810
|
self[101] = true
|
|
1781
|
-
|
|
1782
|
-
|
|
1811
|
+
if (self[103] or 0) <= 0 then
|
|
1812
|
+
for _ = self[102] or 0, -1 do
|
|
1813
|
+
BlzPauseUnitEx(handle, true)
|
|
1814
|
+
end
|
|
1783
1815
|
end
|
|
1784
1816
|
PauseUnit(handle, true)
|
|
1785
1817
|
elseif not isPaused and IsUnitPaused(handle) then
|
|
1786
1818
|
PauseUnit(handle, false)
|
|
1787
|
-
|
|
1788
|
-
|
|
1819
|
+
if (self[103] or 0) <= 0 then
|
|
1820
|
+
for _ = self[102] or 0, -1 do
|
|
1821
|
+
BlzPauseUnitEx(handle, false)
|
|
1822
|
+
end
|
|
1789
1823
|
end
|
|
1790
1824
|
self[101] = nil
|
|
1791
1825
|
end
|
|
@@ -1843,20 +1877,6 @@ __TS__SetDescriptor(
|
|
|
1843
1877
|
},
|
|
1844
1878
|
true
|
|
1845
1879
|
)
|
|
1846
|
-
__TS__SetDescriptor(
|
|
1847
|
-
Unit.prototype,
|
|
1848
|
-
"scale",
|
|
1849
|
-
{
|
|
1850
|
-
get = function(self)
|
|
1851
|
-
return getUnitRealField(self.handle, UNIT_RF_SCALING_VALUE)
|
|
1852
|
-
end,
|
|
1853
|
-
set = function(self, v)
|
|
1854
|
-
setUnitScale(self.handle, v, v, v)
|
|
1855
|
-
setUnitRealField(self.handle, UNIT_RF_SCALING_VALUE, v)
|
|
1856
|
-
end
|
|
1857
|
-
},
|
|
1858
|
-
true
|
|
1859
|
-
)
|
|
1860
1880
|
__TS__SetDescriptor(
|
|
1861
1881
|
Unit.prototype,
|
|
1862
1882
|
"timeScale",
|
|
@@ -2468,12 +2488,7 @@ Unit.onDamaging = (function()
|
|
|
2468
2488
|
preventRetaliation = damagingEventPreventRetaliation
|
|
2469
2489
|
}
|
|
2470
2490
|
if data.isAttack and source then
|
|
2471
|
-
|
|
2472
|
-
if weapon == -1 then
|
|
2473
|
-
local targetsAllowed = BlzGetUnitWeaponIntegerField(source.handle, UNIT_WEAPON_IF_ATTACK_TARGETS_ALLOWED, 0)
|
|
2474
|
-
weapon = 0
|
|
2475
|
-
end
|
|
2476
|
-
data.weapon = assert(source.weapons[weapon + 1])
|
|
2491
|
+
data.weapon = source:chooseWeapon(target)
|
|
2477
2492
|
end
|
|
2478
2493
|
if not data.isAttack or not source or not source._attackHandlers then
|
|
2479
2494
|
invoke(
|
|
@@ -2618,7 +2633,7 @@ Unit.onDamage = __TS__New(
|
|
|
2618
2633
|
invoke(event, source, target, evData)
|
|
2619
2634
|
if evData[0] ~= nil and target.health - evData.amount < 0.405 then
|
|
2620
2635
|
local bonusHealth = math.ceil(evData.amount)
|
|
2621
|
-
target[
|
|
2636
|
+
target[106] = (target[106] or 0) + bonusHealth
|
|
2622
2637
|
BlzSetUnitMaxHP(
|
|
2623
2638
|
target.handle,
|
|
2624
2639
|
BlzGetUnitMaxHP(target.handle) + bonusHealth
|
|
@@ -2632,7 +2647,7 @@ Unit.onDamage = __TS__New(
|
|
|
2632
2647
|
evData[0],
|
|
2633
2648
|
table.unpack(evData, 1 + 1, 1 + (evData[1] or 0))
|
|
2634
2649
|
)
|
|
2635
|
-
target[
|
|
2650
|
+
target[106] = (target[106] or 0) - bonusHealth
|
|
2636
2651
|
SetWidgetLife(
|
|
2637
2652
|
target.handle,
|
|
2638
2653
|
GetWidgetLife(target.handle) - bonusHealth
|
|
@@ -2782,6 +2797,10 @@ __TS__ObjectDefineProperty(
|
|
|
2782
2797
|
rawset(self, "destroyEvent", destroyEvent)
|
|
2783
2798
|
return destroyEvent
|
|
2784
2799
|
end}
|
|
2800
|
+
)
|
|
2801
|
+
Unit.synchronize = synchronizer(
|
|
2802
|
+
function(unit) return unit.syncId end,
|
|
2803
|
+
function(syncId) return unitBySyncId[syncId] end
|
|
2785
2804
|
);
|
|
2786
2805
|
(function(self)
|
|
2787
2806
|
local leaveAbilityIds = postcompile(function()
|
package/engine/local-client.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ import { Unit } from "../core/types/unit";
|
|
|
3
3
|
import { Async } from "../core/types/async";
|
|
4
4
|
import { Event, TriggerEvent } from "../event";
|
|
5
5
|
import { GraphicsMode } from "./index";
|
|
6
|
+
import { Color } from "../core/types/color";
|
|
6
7
|
export declare class LocalClient {
|
|
7
8
|
private constructor();
|
|
8
9
|
static readonly locale: string;
|
|
@@ -11,6 +12,7 @@ export declare class LocalClient {
|
|
|
11
12
|
static get isHD(): boolean;
|
|
12
13
|
static get graphicsMode(): GraphicsMode;
|
|
13
14
|
static get isActive(): boolean;
|
|
15
|
+
static pingMinimap(x: number, y: number, duration: number, ...parameters: [] | [red: number, green: number, blue: number, extraEffects?: boolean] | [color: Color, extraEffects?: boolean]): void;
|
|
14
16
|
static get mouseFocusUnit(): Async<Unit> | undefined;
|
|
15
17
|
static get mainSelectedUnit(): Async<Unit> | undefined;
|
|
16
18
|
static get mainSelectedUnitChangeEvent(): Event<[
|
package/engine/local-client.lua
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
local ____lualib = require("lualib_bundle")
|
|
2
2
|
local __TS__ArrayMap = ____lualib.__TS__ArrayMap
|
|
3
3
|
local __TS__Class = ____lualib.__TS__Class
|
|
4
|
+
local __TS__InstanceOf = ____lualib.__TS__InstanceOf
|
|
4
5
|
local __TS__ObjectDefineProperty = ____lualib.__TS__ObjectDefineProperty
|
|
5
6
|
local __TS__New = ____lualib.__TS__New
|
|
6
7
|
local ____exports = {}
|
|
@@ -15,6 +16,8 @@ local ____player = require("core.types.player")
|
|
|
15
16
|
local Player = ____player.Player
|
|
16
17
|
local ____timer = require("core.types.timer")
|
|
17
18
|
local Timer = ____timer.Timer
|
|
19
|
+
local ____color = require("core.types.color")
|
|
20
|
+
local Color = ____color.Color
|
|
18
21
|
local loadTOCFile = BlzLoadTOCFile
|
|
19
22
|
local getLocalClientWidth = BlzGetLocalClientWidth
|
|
20
23
|
local getLocalClientHeight = BlzGetLocalClientHeight
|
|
@@ -25,6 +28,8 @@ local getMouseFocusUnit = BlzGetMouseFocusUnit
|
|
|
25
28
|
local getUnitRealField = BlzGetUnitRealField
|
|
26
29
|
local getUnitTypeId = GetUnitTypeId
|
|
27
30
|
local getLocale = BlzGetLocale
|
|
31
|
+
local pingMinimap = PingMinimap
|
|
32
|
+
local pingMinimapEx = PingMinimapEx
|
|
28
33
|
local tableSort = table.sort
|
|
29
34
|
local tocPath = "_warscript\\IsHD.toc"
|
|
30
35
|
compiletime(function()
|
|
@@ -62,6 +67,31 @@ local LocalClient = ____exports.LocalClient
|
|
|
62
67
|
LocalClient.name = "LocalClient"
|
|
63
68
|
function LocalClient.prototype.____constructor(self)
|
|
64
69
|
end
|
|
70
|
+
function LocalClient.pingMinimap(self, x, y, duration, redOrColor, greenOrExtraEffects, blue, extraEffects)
|
|
71
|
+
if redOrColor == nil then
|
|
72
|
+
pingMinimap(x, y, duration)
|
|
73
|
+
elseif __TS__InstanceOf(redOrColor, Color) then
|
|
74
|
+
pingMinimapEx(
|
|
75
|
+
x,
|
|
76
|
+
y,
|
|
77
|
+
duration,
|
|
78
|
+
redOrColor.r,
|
|
79
|
+
redOrColor.g,
|
|
80
|
+
redOrColor.b,
|
|
81
|
+
greenOrExtraEffects or false
|
|
82
|
+
)
|
|
83
|
+
else
|
|
84
|
+
pingMinimapEx(
|
|
85
|
+
x,
|
|
86
|
+
y,
|
|
87
|
+
duration,
|
|
88
|
+
redOrColor,
|
|
89
|
+
greenOrExtraEffects,
|
|
90
|
+
blue,
|
|
91
|
+
extraEffects or false
|
|
92
|
+
)
|
|
93
|
+
end
|
|
94
|
+
end
|
|
65
95
|
LocalClient.locale = getLocale()
|
|
66
96
|
__TS__ObjectDefineProperty(
|
|
67
97
|
LocalClient,
|
|
@@ -38,6 +38,8 @@ local ____sound = require("core.types.sound")
|
|
|
38
38
|
local isSoundLabelCustom = ____sound.isSoundLabelCustom
|
|
39
39
|
local Sound3D = ____sound.Sound3D
|
|
40
40
|
local SoundSettings = ____sound.SoundSettings
|
|
41
|
+
local ____lua_2Dsets = require("utility.lua-sets")
|
|
42
|
+
local luaSetOf = ____lua_2Dsets.luaSetOf
|
|
41
43
|
local castAnimationFQNByAbilityTypeId = {}
|
|
42
44
|
local isButtonVisibleFalseAbilityTypes = {}
|
|
43
45
|
local casterCastingEffectPresetsByAbilityTypeId = {}
|
|
@@ -1004,9 +1006,10 @@ for abilityTypeId, soundPresetId in pairs(postcompile(function() return targetEf
|
|
|
1004
1006
|
)
|
|
1005
1007
|
end
|
|
1006
1008
|
end
|
|
1009
|
+
local unsupportedEffectSoundAbilityTypeIds = luaSetOf(fourCC("AAns"))
|
|
1007
1010
|
Unit.abilityChannelingStartEvent:addListener(function(caster, ability)
|
|
1008
1011
|
local soundPresetId = ability:getField(ABILITY_SF_EFFECT_SOUND)
|
|
1009
|
-
if isSoundLabelCustom(soundPresetId) then
|
|
1012
|
+
if isSoundLabelCustom(soundPresetId) or soundPresetId ~= "" and unsupportedEffectSoundAbilityTypeIds[ability.parentTypeId] ~= nil then
|
|
1010
1013
|
Sound3D:playFromLabel(soundPresetId, SoundSettings.Ability, caster)
|
|
1011
1014
|
end
|
|
1012
1015
|
end)
|
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
/** @noSelfInFile */
|
|
2
2
|
import { ArmorSoundType } from "../auxiliary/armor-sound-type";
|
|
3
3
|
import { CombatClassifications } from "../auxiliary/combat-classification";
|
|
4
|
-
import { ObjectDataEntry, ObjectDataEntryId } from "../entry";
|
|
4
|
+
import { ObjectDataEntry, ObjectDataEntryConstructor, ObjectDataEntryId } from "../entry";
|
|
5
5
|
export type DestructibleTypeId = ObjectDataEntryId & number & {
|
|
6
6
|
readonly __destructibleTypeId: unique symbol;
|
|
7
7
|
};
|
|
8
|
+
export type StandardDestructibleTypeId = DestructibleTypeId & {
|
|
9
|
+
readonly __standardDestructibleTypeId: unique symbol;
|
|
10
|
+
};
|
|
8
11
|
export declare abstract class DestructibleType extends ObjectDataEntry<DestructibleTypeId> {
|
|
12
|
+
static readonly [id: StandardDestructibleTypeId]: ObjectDataEntryConstructor<DestructibleType>;
|
|
9
13
|
private static readonly idGenerator;
|
|
10
14
|
protected static generateId(): number;
|
|
11
15
|
protected static getObjectData(map: WarMap): WarObjects;
|
|
@@ -11,6 +11,8 @@ local ____entry = require("engine.object-data.entry")
|
|
|
11
11
|
local ObjectDataEntry = ____entry.ObjectDataEntry
|
|
12
12
|
local ____object_2Ddata_2Dentry_2Did_2Dgenerator = require("engine.object-data.utility.object-data-entry-id-generator")
|
|
13
13
|
local ObjectDataEntryIdGenerator = ____object_2Ddata_2Dentry_2Did_2Dgenerator.ObjectDataEntryIdGenerator
|
|
14
|
+
local ____reflection = require("utility.reflection")
|
|
15
|
+
local implementReadonlyNumberIndexSupplier = ____reflection.implementReadonlyNumberIndexSupplier
|
|
14
16
|
____exports.DestructibleType = __TS__Class()
|
|
15
17
|
local DestructibleType = ____exports.DestructibleType
|
|
16
18
|
DestructibleType.name = "DestructibleType"
|
|
@@ -80,4 +82,14 @@ __TS__SetDescriptor(
|
|
|
80
82
|
},
|
|
81
83
|
true
|
|
82
84
|
)
|
|
85
|
+
implementReadonlyNumberIndexSupplier(
|
|
86
|
+
____exports.DestructibleType,
|
|
87
|
+
function(id)
|
|
88
|
+
local ____class_0 = __TS__Class()
|
|
89
|
+
____class_0.name = ____class_0.name
|
|
90
|
+
__TS__ClassExtends(____class_0, ____exports.DestructibleType)
|
|
91
|
+
____class_0.BASE_ID = id
|
|
92
|
+
return ____class_0
|
|
93
|
+
end
|
|
94
|
+
)
|
|
83
95
|
return ____exports
|
|
@@ -42,6 +42,10 @@ export declare class UnitTypeWeapon {
|
|
|
42
42
|
set impactDelay(impactDelay: number);
|
|
43
43
|
get missileModelPath(): string;
|
|
44
44
|
set missileModelPath(missileModelPath: string);
|
|
45
|
+
get missileModelPathSD(): string;
|
|
46
|
+
set missileModelPathSD(missileModelPathSD: string);
|
|
47
|
+
get missileModelPathHD(): string;
|
|
48
|
+
set missileModelPathHD(missileModelPathHD: string);
|
|
45
49
|
get range(): number;
|
|
46
50
|
set range(range: number);
|
|
47
51
|
get soundType(): WeaponSoundType;
|
|
@@ -238,21 +238,21 @@ __TS__SetDescriptor(
|
|
|
238
238
|
)
|
|
239
239
|
__TS__SetDescriptor(
|
|
240
240
|
UnitTypeWeapon.prototype,
|
|
241
|
-
"
|
|
241
|
+
"missileModelPathSD",
|
|
242
242
|
{
|
|
243
243
|
get = function(self)
|
|
244
244
|
local ____self_17 = self.unitType
|
|
245
|
-
return ____self_17.
|
|
245
|
+
return ____self_17.getStringField(
|
|
246
246
|
____self_17,
|
|
247
|
-
("ua" .. tostring(self.index)) .. "
|
|
247
|
+
("ua" .. tostring(self.index)) .. "m:sd"
|
|
248
248
|
)
|
|
249
249
|
end,
|
|
250
|
-
set = function(self,
|
|
250
|
+
set = function(self, missileModelPathSD)
|
|
251
251
|
local ____self_18 = self.unitType
|
|
252
|
-
____self_18.
|
|
252
|
+
____self_18.setStringField(
|
|
253
253
|
____self_18,
|
|
254
|
-
("ua" .. tostring(self.index)) .. "
|
|
255
|
-
|
|
254
|
+
("ua" .. tostring(self.index)) .. "m:sd",
|
|
255
|
+
missileModelPathSD
|
|
256
256
|
)
|
|
257
257
|
end
|
|
258
258
|
},
|
|
@@ -260,21 +260,21 @@ __TS__SetDescriptor(
|
|
|
260
260
|
)
|
|
261
261
|
__TS__SetDescriptor(
|
|
262
262
|
UnitTypeWeapon.prototype,
|
|
263
|
-
"
|
|
263
|
+
"missileModelPathHD",
|
|
264
264
|
{
|
|
265
265
|
get = function(self)
|
|
266
266
|
local ____self_19 = self.unitType
|
|
267
267
|
return ____self_19.getStringField(
|
|
268
268
|
____self_19,
|
|
269
|
-
"
|
|
269
|
+
("ua" .. tostring(self.index)) .. "m:hd"
|
|
270
270
|
)
|
|
271
271
|
end,
|
|
272
|
-
set = function(self,
|
|
272
|
+
set = function(self, missileModelPathHD)
|
|
273
273
|
local ____self_20 = self.unitType
|
|
274
274
|
____self_20.setStringField(
|
|
275
275
|
____self_20,
|
|
276
|
-
"
|
|
277
|
-
|
|
276
|
+
("ua" .. tostring(self.index)) .. "m:hd",
|
|
277
|
+
missileModelPathHD
|
|
278
278
|
)
|
|
279
279
|
end
|
|
280
280
|
},
|
|
@@ -282,21 +282,21 @@ __TS__SetDescriptor(
|
|
|
282
282
|
)
|
|
283
283
|
__TS__SetDescriptor(
|
|
284
284
|
UnitTypeWeapon.prototype,
|
|
285
|
-
"
|
|
285
|
+
"range",
|
|
286
286
|
{
|
|
287
287
|
get = function(self)
|
|
288
288
|
local ____self_21 = self.unitType
|
|
289
|
-
return ____self_21.
|
|
289
|
+
return ____self_21.getNumberField(
|
|
290
290
|
____self_21,
|
|
291
|
-
("
|
|
291
|
+
("ua" .. tostring(self.index)) .. "r"
|
|
292
292
|
)
|
|
293
293
|
end,
|
|
294
|
-
set = function(self,
|
|
294
|
+
set = function(self, range)
|
|
295
295
|
local ____self_22 = self.unitType
|
|
296
|
-
____self_22.
|
|
296
|
+
____self_22.setNumberField(
|
|
297
297
|
____self_22,
|
|
298
|
-
("
|
|
299
|
-
|
|
298
|
+
("ua" .. tostring(self.index)) .. "r",
|
|
299
|
+
range
|
|
300
300
|
)
|
|
301
301
|
end
|
|
302
302
|
},
|
|
@@ -304,19 +304,63 @@ __TS__SetDescriptor(
|
|
|
304
304
|
)
|
|
305
305
|
__TS__SetDescriptor(
|
|
306
306
|
UnitTypeWeapon.prototype,
|
|
307
|
-
"
|
|
307
|
+
"soundType",
|
|
308
308
|
{
|
|
309
309
|
get = function(self)
|
|
310
310
|
local ____self_23 = self.unitType
|
|
311
311
|
return ____self_23.getStringField(
|
|
312
312
|
____self_23,
|
|
313
|
-
|
|
313
|
+
"ucs" .. tostring(self.index)
|
|
314
314
|
)
|
|
315
315
|
end,
|
|
316
|
-
set = function(self,
|
|
316
|
+
set = function(self, soundType)
|
|
317
317
|
local ____self_24 = self.unitType
|
|
318
318
|
____self_24.setStringField(
|
|
319
319
|
____self_24,
|
|
320
|
+
"ucs" .. tostring(self.index),
|
|
321
|
+
soundType
|
|
322
|
+
)
|
|
323
|
+
end
|
|
324
|
+
},
|
|
325
|
+
true
|
|
326
|
+
)
|
|
327
|
+
__TS__SetDescriptor(
|
|
328
|
+
UnitTypeWeapon.prototype,
|
|
329
|
+
"soundTypeSD",
|
|
330
|
+
{
|
|
331
|
+
get = function(self)
|
|
332
|
+
local ____self_25 = self.unitType
|
|
333
|
+
return ____self_25.getStringField(
|
|
334
|
+
____self_25,
|
|
335
|
+
("ucs" .. tostring(self.index)) .. ":sd"
|
|
336
|
+
)
|
|
337
|
+
end,
|
|
338
|
+
set = function(self, soundTypeSD)
|
|
339
|
+
local ____self_26 = self.unitType
|
|
340
|
+
____self_26.setStringField(
|
|
341
|
+
____self_26,
|
|
342
|
+
("ucs" .. tostring(self.index)) .. ":sd",
|
|
343
|
+
soundTypeSD
|
|
344
|
+
)
|
|
345
|
+
end
|
|
346
|
+
},
|
|
347
|
+
true
|
|
348
|
+
)
|
|
349
|
+
__TS__SetDescriptor(
|
|
350
|
+
UnitTypeWeapon.prototype,
|
|
351
|
+
"soundTypeHD",
|
|
352
|
+
{
|
|
353
|
+
get = function(self)
|
|
354
|
+
local ____self_27 = self.unitType
|
|
355
|
+
return ____self_27.getStringField(
|
|
356
|
+
____self_27,
|
|
357
|
+
("ucs" .. tostring(self.index)) .. ":hd"
|
|
358
|
+
)
|
|
359
|
+
end,
|
|
360
|
+
set = function(self, soundTypeHD)
|
|
361
|
+
local ____self_28 = self.unitType
|
|
362
|
+
____self_28.setStringField(
|
|
363
|
+
____self_28,
|
|
320
364
|
("ucs" .. tostring(self.index)) .. ":hd",
|
|
321
365
|
soundTypeHD
|
|
322
366
|
)
|
|
@@ -1680,11 +1724,11 @@ __TS__SetDescriptor(
|
|
|
1680
1724
|
implementReadonlyNumberIndexSupplier(
|
|
1681
1725
|
____exports.UnitType,
|
|
1682
1726
|
function(id)
|
|
1683
|
-
local
|
|
1684
|
-
|
|
1685
|
-
__TS__ClassExtends(
|
|
1686
|
-
|
|
1687
|
-
return
|
|
1727
|
+
local ____class_29 = __TS__Class()
|
|
1728
|
+
____class_29.name = ____class_29.name
|
|
1729
|
+
__TS__ClassExtends(____class_29, ____exports.UnitType)
|
|
1730
|
+
____class_29.BASE_ID = id
|
|
1731
|
+
return ____class_29
|
|
1688
1732
|
end
|
|
1689
1733
|
)
|
|
1690
1734
|
____exports.HeroUnitType = __TS__Class()
|
|
@@ -1745,11 +1789,11 @@ __TS__SetDescriptor(
|
|
|
1745
1789
|
implementReadonlyNumberIndexSupplier(
|
|
1746
1790
|
____exports.HeroUnitType,
|
|
1747
1791
|
function(id)
|
|
1748
|
-
local
|
|
1749
|
-
|
|
1750
|
-
__TS__ClassExtends(
|
|
1751
|
-
|
|
1752
|
-
return
|
|
1792
|
+
local ____class_30 = __TS__Class()
|
|
1793
|
+
____class_30.name = ____class_30.name
|
|
1794
|
+
__TS__ClassExtends(____class_30, ____exports.HeroUnitType)
|
|
1795
|
+
____class_30.BASE_ID = id
|
|
1796
|
+
return ____class_30
|
|
1753
1797
|
end
|
|
1754
1798
|
)
|
|
1755
1799
|
return ____exports
|