warscript 0.0.1-dev.d18f377 → 0.0.1-dev.d3ce64a
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 +5 -0
- package/attributes.lua +8 -1
- package/config.d.ts +5 -0
- package/config.lua +10 -0
- package/core/types/effect.d.ts +2 -3
- package/core/types/effect.lua +95 -48
- package/core/types/order.d.ts +1 -0
- package/core/types/order.lua +11 -1
- package/core/types/sound.d.ts +17 -24
- package/core/types/sound.lua +99 -24
- package/core/types/timer.d.ts +6 -7
- package/core/types/timer.lua +18 -21
- package/core/util.d.ts +1 -1
- package/core/util.lua +12 -1
- package/decl/native.d.ts +840 -786
- package/engine/behaviour/ability/always-enabled.d.ts +7 -0
- package/engine/behaviour/ability/always-enabled.lua +31 -0
- package/engine/behaviour/ability/apply-buff.d.ts +5 -0
- package/engine/behaviour/ability/apply-buff.lua +32 -0
- package/engine/behaviour/ability/apply-unit-behavior.lua +1 -0
- package/engine/behaviour/ability/damage.d.ts +9 -3
- package/engine/behaviour/ability/damage.lua +26 -38
- package/engine/behaviour/ability/emulate-impact.lua +12 -6
- package/engine/behaviour/ability/on-command-impact.lua +7 -0
- package/engine/behaviour/ability.d.ts +15 -3
- package/engine/behaviour/ability.lua +77 -5
- package/engine/behaviour/unit.d.ts +12 -0
- package/engine/behaviour/unit.lua +85 -0
- package/engine/buff.d.ts +56 -41
- package/engine/buff.lua +295 -228
- package/engine/internal/ability.d.ts +13 -1
- package/engine/internal/ability.lua +74 -2
- package/engine/internal/item/ability.lua +106 -0
- package/engine/internal/item.d.ts +4 -3
- package/engine/internal/item.lua +56 -25
- package/engine/internal/mechanics/ability-duration.lua +1 -1
- package/engine/internal/misc/ability-disable-counter.d.ts +2 -0
- package/engine/internal/misc/ability-disable-counter.lua +13 -0
- package/engine/internal/misc/damage-metadata-by-target.d.ts +2 -0
- package/engine/internal/misc/damage-metadata-by-target.lua +5 -0
- package/engine/internal/object-data/auto-attack-speed-increase.d.ts +1 -1
- package/engine/internal/object-data/auto-attack-speed-increase.lua +2 -0
- package/engine/internal/object-data/evasion-probability.d.ts +2 -0
- package/engine/internal/object-data/evasion-probability.lua +16 -0
- package/engine/internal/unit/add-item-to-slot-init.d.ts +2 -0
- package/engine/internal/unit/add-item-to-slot-init.lua +23 -0
- package/engine/internal/unit/add-item-to-slot.d.ts +2 -0
- package/engine/internal/unit/add-item-to-slot.lua +52 -0
- package/engine/internal/unit/allowed-targets.d.ts +1 -1
- package/engine/internal/unit/allowed-targets.lua +9 -1
- package/engine/internal/unit/bonus.d.ts +2 -0
- package/engine/internal/unit/bonus.lua +17 -0
- package/engine/internal/unit/ignore-events-items.d.ts +2 -0
- package/engine/internal/unit/ignore-events-items.lua +5 -0
- package/engine/internal/unit/item.lua +6 -12
- package/engine/internal/unit+damage.d.ts +2 -11
- package/engine/internal/unit+damage.lua +10 -14
- package/engine/internal/unit+spellSteal.lua +1 -2
- package/engine/internal/unit-missile-launch.lua +1 -1
- package/engine/internal/unit.d.ts +28 -5
- package/engine/internal/unit.lua +217 -50
- package/engine/internal/utility.lua +12 -0
- package/engine/lightning.d.ts +12 -5
- package/engine/lightning.lua +48 -14
- 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/attack-type.d.ts +7 -8
- package/engine/object-data/auxiliary/attack-type.lua +42 -0
- package/engine/object-data/auxiliary/movement-type.d.ts +7 -7
- package/engine/object-data/auxiliary/movement-type.lua +22 -0
- 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/auxiliary/unit-attribute.d.ts +6 -0
- package/engine/object-data/auxiliary/unit-attribute.lua +9 -0
- package/engine/object-data/entry/ability-type/berserk.d.ts +2 -0
- package/engine/object-data/entry/ability-type/berserk.lua +13 -0
- 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/permanent-invisibility.d.ts +8 -0
- package/engine/object-data/entry/ability-type/permanent-invisibility.lua +26 -0
- 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/slow-poison.d.ts +10 -0
- package/engine/object-data/entry/ability-type/slow-poison.lua +58 -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 +89 -33
- package/engine/object-data/entry/buff-type/applicable.lua +18 -37
- package/engine/object-data/entry/buff-type.d.ts +6 -12
- package/engine/object-data/entry/buff-type.lua +13 -29
- package/engine/object-data/entry/destructible-type.d.ts +1 -1
- package/engine/object-data/entry/item-type.d.ts +3 -1
- package/engine/object-data/entry/item-type.lua +15 -2
- 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 +10 -3
- package/engine/object-data/entry/unit-type.lua +155 -92
- 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/object-data/utility/object-data-entry-id-generator.lua +7 -0
- package/engine/object-field/ability.d.ts +10 -4
- package/engine/object-field/ability.lua +3 -0
- package/engine/object-field/unit.d.ts +46 -3
- package/engine/object-field/unit.lua +173 -7
- package/engine/object-field.d.ts +11 -3
- package/engine/object-field.lua +162 -76
- package/engine/standard/entries/buff-type.d.ts +3 -0
- package/engine/standard/entries/buff-type.lua +3 -0
- package/engine/standard/entries/sound-preset.d.ts +10 -0
- package/engine/standard/entries/sound-preset.lua +10 -0
- package/engine/standard/fields/ability.d.ts +2 -0
- package/engine/standard/fields/ability.lua +2 -0
- package/engine/unit.d.ts +1 -0
- package/engine/unit.lua +1 -0
- package/objutil/buff.lua +1 -2
- package/objutil/unit.lua +8 -0
- package/package.json +2 -2
- package/utility/arrays.d.ts +1 -0
- package/utility/arrays.lua +3 -0
- package/utility/functions.d.ts +1 -0
- package/utility/functions.lua +1 -0
- package/utility/linked-set.d.ts +1 -0
- package/utility/linked-set.lua +3 -0
- package/utility/lua-maps.d.ts +3 -0
- package/utility/lua-maps.lua +16 -0
- package/utility/lua-sets.d.ts +1 -0
- package/utility/lua-sets.lua +3 -0
- package/utility/reflection.lua +11 -7
|
@@ -35,6 +35,9 @@ export declare abstract class Ability extends Handle<jability> {
|
|
|
35
35
|
setField(field: jabilitystringlevelfield, level: number, value: string): boolean;
|
|
36
36
|
get levelCount(): number;
|
|
37
37
|
abstract get level(): number;
|
|
38
|
+
abstract get cooldownRemaining(): number;
|
|
39
|
+
abstract set cooldownRemaining(cooldownRemaining: number);
|
|
40
|
+
abstract interruptCast(): void;
|
|
38
41
|
static get onCreate(): Event<[Ability]>;
|
|
39
42
|
static get destroyEvent(): Event<[Ability]>;
|
|
40
43
|
}
|
|
@@ -45,6 +48,9 @@ export declare class UnrecognizedAbility extends Ability {
|
|
|
45
48
|
readonly owner: Unit;
|
|
46
49
|
constructor(typeId: number, owner: Unit);
|
|
47
50
|
get level(): number;
|
|
51
|
+
get cooldownRemaining(): number;
|
|
52
|
+
set cooldownRemaining(_: number);
|
|
53
|
+
interruptCast(): void;
|
|
48
54
|
}
|
|
49
55
|
export declare class UnitAbility extends Ability {
|
|
50
56
|
readonly owner: Unit;
|
|
@@ -52,10 +58,13 @@ export declare class UnitAbility extends Ability {
|
|
|
52
58
|
constructor(handle: jability, typeId: number, owner: Unit);
|
|
53
59
|
incrementHideCounter(): void;
|
|
54
60
|
decrementHideCounter(): void;
|
|
61
|
+
incrementDisableCounter(): void;
|
|
62
|
+
decrementDisableCounter(): void;
|
|
55
63
|
get level(): number;
|
|
56
64
|
set level(v: number);
|
|
57
65
|
get cooldownRemaining(): number;
|
|
58
|
-
set cooldownRemaining(
|
|
66
|
+
set cooldownRemaining(cooldownRemaining: number);
|
|
67
|
+
interruptCast(): void;
|
|
59
68
|
static get onCreate(): Event<[UnitAbility]>;
|
|
60
69
|
static get onDestroy(): Event<[UnitAbility]>;
|
|
61
70
|
}
|
|
@@ -79,6 +88,9 @@ export declare class ItemAbility extends Ability {
|
|
|
79
88
|
setField(field: jabilitybooleanlevelfield, level: number, value: boolean): boolean;
|
|
80
89
|
setField(field: jabilitystringlevelfield, level: number, value: string): boolean;
|
|
81
90
|
get level(): number;
|
|
91
|
+
get cooldownRemaining(): number;
|
|
92
|
+
set cooldownRemaining(cooldownRemaining: number);
|
|
93
|
+
interruptCast(): void;
|
|
82
94
|
static get onCreate(): Event<[ItemAbility]>;
|
|
83
95
|
static get onDestroy(): Event<[ItemAbility]>;
|
|
84
96
|
}
|
|
@@ -10,7 +10,10 @@ local ____exports = {}
|
|
|
10
10
|
local ____handle = require("core.types.handle")
|
|
11
11
|
local Handle = ____handle.Handle
|
|
12
12
|
local ____ability = require("engine.internal.item.ability")
|
|
13
|
+
local abilityActionDummy = ____ability.abilityActionDummy
|
|
13
14
|
local doAbilityAction = ____ability.doAbilityAction
|
|
15
|
+
local doAbilityActionForceDummy = ____ability.doAbilityActionForceDummy
|
|
16
|
+
local startItemCooldown = ____ability.startItemCooldown
|
|
14
17
|
local getUnitAbilityLevel = GetUnitAbilityLevel
|
|
15
18
|
local setUnitAbilityLevel = SetUnitAbilityLevel
|
|
16
19
|
local setAbilityIntegerField = BlzSetAbilityIntegerField
|
|
@@ -32,7 +35,10 @@ local getAbilityStringLevelField = BlzGetAbilityStringLevelField
|
|
|
32
35
|
local getUnitAbilityCooldownRemaining = BlzGetUnitAbilityCooldownRemaining
|
|
33
36
|
local startUnitAbilityCooldown = BlzStartUnitAbilityCooldown
|
|
34
37
|
local getHandleId = GetHandleId
|
|
38
|
+
local getItemBooleanField = BlzGetItemBooleanField
|
|
39
|
+
local setItemBooleanField = BlzSetItemBooleanField
|
|
35
40
|
local unitHideAbility = BlzUnitHideAbility
|
|
41
|
+
local unitDisableAbility = BlzUnitDisableAbility
|
|
36
42
|
local match = string.match
|
|
37
43
|
local ____type = _G.type
|
|
38
44
|
local ____tostring = _G.tostring
|
|
@@ -326,6 +332,17 @@ __TS__SetDescriptor(
|
|
|
326
332
|
end},
|
|
327
333
|
true
|
|
328
334
|
)
|
|
335
|
+
__TS__SetDescriptor(
|
|
336
|
+
Ability.prototype,
|
|
337
|
+
"cooldownRemaining",
|
|
338
|
+
{
|
|
339
|
+
get = function(self)
|
|
340
|
+
end,
|
|
341
|
+
set = function(self, cooldownRemaining)
|
|
342
|
+
end
|
|
343
|
+
},
|
|
344
|
+
true
|
|
345
|
+
)
|
|
329
346
|
__TS__ObjectDefineProperty(
|
|
330
347
|
Ability,
|
|
331
348
|
"onCreate",
|
|
@@ -349,6 +366,8 @@ function UnrecognizedAbility.prototype.____constructor(self, typeId, owner)
|
|
|
349
366
|
UnrecognizedAbility.____super.prototype.____constructor(self, nil, typeId)
|
|
350
367
|
self.owner = owner
|
|
351
368
|
end
|
|
369
|
+
function UnrecognizedAbility.prototype.interruptCast(self)
|
|
370
|
+
end
|
|
352
371
|
__TS__SetDescriptor(
|
|
353
372
|
UnrecognizedAbility.prototype,
|
|
354
373
|
"level",
|
|
@@ -357,6 +376,18 @@ __TS__SetDescriptor(
|
|
|
357
376
|
end},
|
|
358
377
|
true
|
|
359
378
|
)
|
|
379
|
+
__TS__SetDescriptor(
|
|
380
|
+
UnrecognizedAbility.prototype,
|
|
381
|
+
"cooldownRemaining",
|
|
382
|
+
{
|
|
383
|
+
get = function(self)
|
|
384
|
+
return 0
|
|
385
|
+
end,
|
|
386
|
+
set = function(self, _)
|
|
387
|
+
end
|
|
388
|
+
},
|
|
389
|
+
true
|
|
390
|
+
)
|
|
360
391
|
____exports.UnitAbility = __TS__Class()
|
|
361
392
|
local UnitAbility = ____exports.UnitAbility
|
|
362
393
|
UnitAbility.name = "UnitAbility"
|
|
@@ -372,6 +403,15 @@ end
|
|
|
372
403
|
function UnitAbility.prototype.decrementHideCounter(self)
|
|
373
404
|
unitHideAbility(self.u, self.typeId, false)
|
|
374
405
|
end
|
|
406
|
+
function UnitAbility.prototype.incrementDisableCounter(self)
|
|
407
|
+
unitDisableAbility(self.u, self.typeId, true, false)
|
|
408
|
+
end
|
|
409
|
+
function UnitAbility.prototype.decrementDisableCounter(self)
|
|
410
|
+
unitDisableAbility(self.u, self.typeId, false, false)
|
|
411
|
+
end
|
|
412
|
+
function UnitAbility.prototype.interruptCast(self)
|
|
413
|
+
self.owner:interruptCast(self.typeId)
|
|
414
|
+
end
|
|
375
415
|
__TS__SetDescriptor(
|
|
376
416
|
UnitAbility.prototype,
|
|
377
417
|
"level",
|
|
@@ -392,8 +432,8 @@ __TS__SetDescriptor(
|
|
|
392
432
|
get = function(self)
|
|
393
433
|
return getUnitAbilityCooldownRemaining(self.u, self.typeId)
|
|
394
434
|
end,
|
|
395
|
-
set = function(self,
|
|
396
|
-
startUnitAbilityCooldown(self.u, self.typeId,
|
|
435
|
+
set = function(self, cooldownRemaining)
|
|
436
|
+
startUnitAbilityCooldown(self.u, self.typeId, cooldownRemaining)
|
|
397
437
|
end
|
|
398
438
|
},
|
|
399
439
|
true
|
|
@@ -418,6 +458,9 @@ end
|
|
|
418
458
|
local function setAbilityField(_, ability, field, levelOrValue, value)
|
|
419
459
|
return ____exports.Ability.prototype.setField(ability, field, levelOrValue, value)
|
|
420
460
|
end
|
|
461
|
+
local function getAbilityCooldown(_, abilityTypeId)
|
|
462
|
+
return getUnitAbilityCooldownRemaining(abilityActionDummy, abilityTypeId)
|
|
463
|
+
end
|
|
421
464
|
____exports.ItemAbility = __TS__Class()
|
|
422
465
|
local ItemAbility = ____exports.ItemAbility
|
|
423
466
|
ItemAbility.name = "ItemAbility"
|
|
@@ -445,6 +488,14 @@ function ItemAbility.prototype.setField(self, field, levelOrValue, value)
|
|
|
445
488
|
value
|
|
446
489
|
)
|
|
447
490
|
end
|
|
491
|
+
function ItemAbility.prototype.interruptCast(self)
|
|
492
|
+
local handle = self.owner.handle
|
|
493
|
+
local activelyUsed = getItemBooleanField(handle, ITEM_BF_ACTIVELY_USED)
|
|
494
|
+
if activelyUsed then
|
|
495
|
+
setItemBooleanField(handle, ITEM_BF_ACTIVELY_USED, false)
|
|
496
|
+
setItemBooleanField(handle, ITEM_BF_ACTIVELY_USED, true)
|
|
497
|
+
end
|
|
498
|
+
end
|
|
448
499
|
__TS__SetDescriptor(
|
|
449
500
|
ItemAbility.prototype,
|
|
450
501
|
"level",
|
|
@@ -453,6 +504,27 @@ __TS__SetDescriptor(
|
|
|
453
504
|
end},
|
|
454
505
|
true
|
|
455
506
|
)
|
|
507
|
+
__TS__SetDescriptor(
|
|
508
|
+
ItemAbility.prototype,
|
|
509
|
+
"cooldownRemaining",
|
|
510
|
+
{
|
|
511
|
+
get = function(self)
|
|
512
|
+
local item = self.owner
|
|
513
|
+
local ____doAbilityActionForceDummy_4 = doAbilityActionForceDummy
|
|
514
|
+
local ____item_handle_3 = item.handle
|
|
515
|
+
local ____opt_1 = item.owner
|
|
516
|
+
return ____doAbilityActionForceDummy_4(____item_handle_3, ____opt_1 and ____opt_1.handle, getAbilityCooldown, self.typeId)
|
|
517
|
+
end,
|
|
518
|
+
set = function(self, cooldownRemaining)
|
|
519
|
+
local item = self.owner
|
|
520
|
+
local ____startItemCooldown_8 = startItemCooldown
|
|
521
|
+
local ____item_handle_7 = item.handle
|
|
522
|
+
local ____opt_5 = item.owner
|
|
523
|
+
____startItemCooldown_8(____item_handle_7, ____opt_5 and ____opt_5.handle, cooldownRemaining)
|
|
524
|
+
end
|
|
525
|
+
},
|
|
526
|
+
true
|
|
527
|
+
)
|
|
456
528
|
__TS__ObjectDefineProperty(
|
|
457
529
|
ItemAbility,
|
|
458
530
|
"onCreate",
|
|
@@ -1,16 +1,60 @@
|
|
|
1
1
|
local ____exports = {}
|
|
2
|
+
local restoreCooldownGroup
|
|
2
3
|
local ____player = require("core.types.player")
|
|
3
4
|
local Player = ____player.Player
|
|
4
5
|
local ____dummy = require("objutil.dummy")
|
|
5
6
|
local dummyUnitId = ____dummy.dummyUnitId
|
|
7
|
+
local ____utility = require("engine.internal.utility")
|
|
8
|
+
local findUnitItemSlot = ____utility.findUnitItemSlot
|
|
9
|
+
local ____blank = require("engine.object-data.entry.item-type.blank")
|
|
10
|
+
local BlankItemType = ____blank.BlankItemType
|
|
11
|
+
local ____object_2Ddata_2Dentry_2Did_2Dgenerator = require("engine.object-data.utility.object-data-entry-id-generator")
|
|
12
|
+
local abilityTypeIdGenerator = ____object_2Ddata_2Dentry_2Did_2Dgenerator.abilityTypeIdGenerator
|
|
13
|
+
local ____math = require("math")
|
|
14
|
+
local MINIMUM_POSITIVE_NORMALIZED_FLOAT = ____math.MINIMUM_POSITIVE_NORMALIZED_FLOAT
|
|
15
|
+
local ____timer = require("core.types.timer")
|
|
16
|
+
local Timer = ____timer.Timer
|
|
17
|
+
local ____ignore_2Devents_2Ditems = require("engine.internal.unit.ignore-events-items")
|
|
18
|
+
local ignoreEventsItems = ____ignore_2Devents_2Ditems.ignoreEventsItems
|
|
19
|
+
local ____add_2Ditem_2Dto_2Dslot = require("engine.internal.unit.add-item-to-slot")
|
|
20
|
+
local unitAddItemToSlot = ____add_2Ditem_2Dto_2Dslot.unitAddItemToSlot
|
|
6
21
|
local isItemOwned = IsItemOwned
|
|
7
22
|
local isItemPowerup = IsItemPowerup
|
|
8
23
|
local getItemX = GetItemX
|
|
9
24
|
local getItemY = GetItemY
|
|
25
|
+
local setAbilityRealLevelField = BlzSetAbilityRealLevelField
|
|
26
|
+
local setItemIntegerField = BlzSetItemIntegerField
|
|
27
|
+
local getItemIntegerField = BlzGetItemIntegerField
|
|
10
28
|
local setItemBooleanField = BlzSetItemBooleanField
|
|
11
29
|
local setItemPosition = SetItemPosition
|
|
12
30
|
local unitAddItem = UnitAddItem
|
|
13
31
|
local unitRemoveItem = UnitRemoveItem
|
|
32
|
+
local unitUseItem = UnitUseItem
|
|
33
|
+
local unitResetCooldown = UnitResetCooldown
|
|
34
|
+
local COOLDOWN_STARTER_ABILITY_TYPE_ID = compiletime(function()
|
|
35
|
+
if not currentMap then
|
|
36
|
+
return 0
|
|
37
|
+
end
|
|
38
|
+
local abilityType = currentMap.objects.ability:newObject(
|
|
39
|
+
util.id2s(abilityTypeIdGenerator:next()),
|
|
40
|
+
"Absk"
|
|
41
|
+
)
|
|
42
|
+
abilityType["bsk1+0"] = 0
|
|
43
|
+
abilityType["bsk2+0"] = 0
|
|
44
|
+
abilityType["bsk3+0"] = 0
|
|
45
|
+
abilityType["amcs+0"] = 0
|
|
46
|
+
abilityType["adur+0"] = MINIMUM_POSITIVE_NORMALIZED_FLOAT
|
|
47
|
+
abilityType["ahdu+0"] = MINIMUM_POSITIVE_NORMALIZED_FLOAT
|
|
48
|
+
return util.s2id(abilityType.id)
|
|
49
|
+
end)
|
|
50
|
+
local COOLDOWN_STARTER_ITEM_TYPE_ID = compiletime(function()
|
|
51
|
+
local itemType = BlankItemType:create()
|
|
52
|
+
itemType.name = "[Warscript/Dummy] Item Cooldown Starter"
|
|
53
|
+
itemType.abilityTypeIds = {COOLDOWN_STARTER_ABILITY_TYPE_ID}
|
|
54
|
+
itemType.cooldownGroupId = COOLDOWN_STARTER_ABILITY_TYPE_ID
|
|
55
|
+
itemType.activelyUsed = true
|
|
56
|
+
return itemType.id
|
|
57
|
+
end)
|
|
14
58
|
local dummy = assert(CreateUnit(
|
|
15
59
|
Player.neutralVictim.handle,
|
|
16
60
|
dummyUnitId,
|
|
@@ -18,10 +62,37 @@ local dummy = assert(CreateUnit(
|
|
|
18
62
|
0,
|
|
19
63
|
270
|
|
20
64
|
))
|
|
65
|
+
local cooldownStarterItem = UnitAddItemById(dummy, COOLDOWN_STARTER_ITEM_TYPE_ID)
|
|
66
|
+
local cooldownStarterAbility = BlzGetItemAbility(cooldownStarterItem, COOLDOWN_STARTER_ABILITY_TYPE_ID)
|
|
21
67
|
ShowUnit(dummy, false)
|
|
68
|
+
local function startItemCooldownInternal(handle, cooldown)
|
|
69
|
+
local cooldownGroup = getItemIntegerField(handle, ITEM_IF_COOLDOWN_GROUP)
|
|
70
|
+
setItemIntegerField(handle, ITEM_IF_COOLDOWN_GROUP, COOLDOWN_STARTER_ABILITY_TYPE_ID)
|
|
71
|
+
setAbilityRealLevelField(cooldownStarterAbility, ABILITY_RLF_COOLDOWN, 0, cooldown)
|
|
72
|
+
unitResetCooldown(dummy)
|
|
73
|
+
unitUseItem(dummy, cooldownStarterItem)
|
|
74
|
+
Timer:run(restoreCooldownGroup, handle, cooldownGroup)
|
|
75
|
+
end
|
|
76
|
+
restoreCooldownGroup = function(handle, cooldownGroup)
|
|
77
|
+
if getItemIntegerField(handle, ITEM_IF_COOLDOWN_GROUP) == COOLDOWN_STARTER_ABILITY_TYPE_ID then
|
|
78
|
+
setItemIntegerField(handle, ITEM_IF_COOLDOWN_GROUP, cooldownGroup)
|
|
79
|
+
end
|
|
80
|
+
end
|
|
81
|
+
---
|
|
82
|
+
-- @internal For use by internal systems only.
|
|
83
|
+
____exports.startItemCooldown = function(handle, owner, cooldown)
|
|
84
|
+
____exports.doAbilityActionForceDummy(handle, owner, startItemCooldownInternal, cooldown)
|
|
85
|
+
end
|
|
86
|
+
---
|
|
87
|
+
-- @internal For use by internal systems only.
|
|
88
|
+
____exports.abilityActionDummy = dummy
|
|
22
89
|
---
|
|
23
90
|
-- @internal For use by internal systems only.
|
|
24
91
|
____exports.doAbilityAction = function(handle, action, ...)
|
|
92
|
+
local isAlreadyIgnoredInEvents = ignoreEventsItems[handle] ~= nil
|
|
93
|
+
if not isAlreadyIgnoredInEvents then
|
|
94
|
+
ignoreEventsItems[handle] = true
|
|
95
|
+
end
|
|
25
96
|
local isOwned = isItemOwned(handle)
|
|
26
97
|
local isPowerup
|
|
27
98
|
local x
|
|
@@ -43,6 +114,41 @@ ____exports.doAbilityAction = function(handle, action, ...)
|
|
|
43
114
|
setItemBooleanField(handle, ITEM_BF_USE_AUTOMATICALLY_WHEN_ACQUIRED, true)
|
|
44
115
|
end
|
|
45
116
|
end
|
|
117
|
+
if not isAlreadyIgnoredInEvents then
|
|
118
|
+
ignoreEventsItems[handle] = nil
|
|
119
|
+
end
|
|
120
|
+
return result
|
|
121
|
+
end
|
|
122
|
+
---
|
|
123
|
+
-- @internal For use by internal systems only.
|
|
124
|
+
____exports.doAbilityActionForceDummy = function(handle, owner, action, ...)
|
|
125
|
+
if owner == nil then
|
|
126
|
+
return ____exports.doAbilityAction(handle, action, ...)
|
|
127
|
+
end
|
|
128
|
+
local slot = findUnitItemSlot(owner, handle)
|
|
129
|
+
if slot == nil then
|
|
130
|
+
return ____exports.doAbilityAction(handle, action, ...)
|
|
131
|
+
end
|
|
132
|
+
local isAlreadyIgnoredInEvents = ignoreEventsItems[handle] ~= nil
|
|
133
|
+
if not isAlreadyIgnoredInEvents then
|
|
134
|
+
ignoreEventsItems[handle] = true
|
|
135
|
+
end
|
|
136
|
+
local isPowerup
|
|
137
|
+
if isItemPowerup(handle) then
|
|
138
|
+
setItemBooleanField(handle, ITEM_BF_USE_AUTOMATICALLY_WHEN_ACQUIRED, false)
|
|
139
|
+
isPowerup = true
|
|
140
|
+
end
|
|
141
|
+
unitRemoveItem(owner, handle)
|
|
142
|
+
unitAddItem(dummy, handle)
|
|
143
|
+
local result = action(handle, ...)
|
|
144
|
+
unitRemoveItem(dummy, handle)
|
|
145
|
+
unitAddItemToSlot(owner, handle, slot)
|
|
146
|
+
if isPowerup then
|
|
147
|
+
setItemBooleanField(handle, ITEM_BF_USE_AUTOMATICALLY_WHEN_ACQUIRED, true)
|
|
148
|
+
end
|
|
149
|
+
if not isAlreadyIgnoredInEvents then
|
|
150
|
+
ignoreEventsItems[handle] = nil
|
|
151
|
+
end
|
|
46
152
|
return result
|
|
47
153
|
end
|
|
48
154
|
return ____exports
|
|
@@ -5,6 +5,7 @@ import { Event } from "../../event";
|
|
|
5
5
|
import { ReadonlyRect } from "../../core/types/rect";
|
|
6
6
|
import { ItemAbility } from "./ability";
|
|
7
7
|
import { AbilityTypeId } from "../object-data/entry/ability-type";
|
|
8
|
+
import type { ItemTypeId } from "../object-data/entry/item-type";
|
|
8
9
|
type DefenseType = 0 | 1 | 2 | 3 | 4 | 5;
|
|
9
10
|
export declare const addAndGetAbility: (handle: jitem, abilityTypeId: AbilityTypeId) => jability | null;
|
|
10
11
|
declare const enum ItemPropertyKey {
|
|
@@ -17,7 +18,7 @@ export declare class Item extends Handle<jitem> {
|
|
|
17
18
|
constructor(handle: jitem);
|
|
18
19
|
protected onDestroy(): HandleDestructor;
|
|
19
20
|
static create<T extends Item>(this: typeof Item & (new (handle: jitem) => T), id: number, x: number, y: number, skinId?: number): T;
|
|
20
|
-
get typeId():
|
|
21
|
+
get typeId(): ItemTypeId;
|
|
21
22
|
set skinId(v: number);
|
|
22
23
|
get skinId(): number;
|
|
23
24
|
set name(v: string);
|
|
@@ -78,9 +79,9 @@ export declare class Item extends Handle<jitem> {
|
|
|
78
79
|
hasAbility(abilityTypeId: AbilityTypeId): boolean;
|
|
79
80
|
getAbility(abilityTypeId: AbilityTypeId): ItemAbility | undefined;
|
|
80
81
|
get abilities(): readonly ItemAbility[];
|
|
81
|
-
static getInRange(
|
|
82
|
+
static getInRange(x: number, y: number, range: number): Item[];
|
|
82
83
|
static getInRect(rect: ReadonlyRect): Item[];
|
|
83
84
|
static get onCreate(): Event<[Item]>;
|
|
84
|
-
static get
|
|
85
|
+
static get destroyEvent(): Event<[Item]>;
|
|
85
86
|
}
|
|
86
87
|
export {};
|
package/engine/internal/item.lua
CHANGED
|
@@ -15,6 +15,12 @@ local ____ability = require("engine.internal.ability")
|
|
|
15
15
|
local ItemAbility = ____ability.ItemAbility
|
|
16
16
|
local ____ability = require("engine.internal.item.ability")
|
|
17
17
|
local doAbilityAction = ____ability.doAbilityAction
|
|
18
|
+
local ____dummy_2Ditem = require("engine.internal.object-data.dummy-item")
|
|
19
|
+
local DUMMY_ITEM_ID = ____dummy_2Ditem.DUMMY_ITEM_ID
|
|
20
|
+
local ____add_2Ditem_2Dto_2Dslot = require("engine.internal.unit.add-item-to-slot")
|
|
21
|
+
local SLOT_FILLER_ITEM_TYPE_ID = ____add_2Ditem_2Dto_2Dslot.SLOT_FILLER_ITEM_TYPE_ID
|
|
22
|
+
local ____vec2 = require("math.vec2")
|
|
23
|
+
local distance = ____vec2.distance
|
|
18
24
|
local itemAddAbility = BlzItemAddAbility
|
|
19
25
|
local itemRemoveAbility = BlzItemRemoveAbility
|
|
20
26
|
local getItemAbility = BlzGetItemAbility
|
|
@@ -24,6 +30,12 @@ local getAbilityId = BlzGetAbilityId
|
|
|
24
30
|
local getWidgetLife = GetWidgetLife
|
|
25
31
|
local removeItem = RemoveItem
|
|
26
32
|
local getHandleId = GetHandleId
|
|
33
|
+
local setRect = SetRect
|
|
34
|
+
local enumItemsInRect = EnumItemsInRect
|
|
35
|
+
local getEnumItem = GetEnumItem
|
|
36
|
+
local getItemTypeId = GetItemTypeId
|
|
37
|
+
local getItemX = GetItemX
|
|
38
|
+
local getItemY = GetItemY
|
|
27
39
|
local getItemIntegerField = BlzGetItemIntegerField
|
|
28
40
|
local setItemBooleanField = BlzSetItemBooleanField
|
|
29
41
|
local getItemBooleanField = BlzGetItemBooleanField
|
|
@@ -53,6 +65,32 @@ local function getItemAbilities(handle, item)
|
|
|
53
65
|
end
|
|
54
66
|
return abilities
|
|
55
67
|
end
|
|
68
|
+
local targetCollection
|
|
69
|
+
local targetCollectionNextIndex
|
|
70
|
+
local centerX
|
|
71
|
+
local centerY
|
|
72
|
+
local enumRange
|
|
73
|
+
local function collectIntoTarget()
|
|
74
|
+
local item = getEnumItem()
|
|
75
|
+
local typeId = getItemTypeId(item)
|
|
76
|
+
if typeId ~= DUMMY_ITEM_ID and typeId ~= SLOT_FILLER_ITEM_TYPE_ID then
|
|
77
|
+
targetCollection[targetCollectionNextIndex] = ____exports.Item:of(item)
|
|
78
|
+
targetCollectionNextIndex = targetCollectionNextIndex + 1
|
|
79
|
+
end
|
|
80
|
+
end
|
|
81
|
+
local function collectIntoTargetRange()
|
|
82
|
+
local item = getEnumItem()
|
|
83
|
+
local typeId = getItemTypeId(item)
|
|
84
|
+
if distance(
|
|
85
|
+
getItemX(item),
|
|
86
|
+
getItemY(item),
|
|
87
|
+
centerX,
|
|
88
|
+
centerY
|
|
89
|
+
) <= enumRange and typeId ~= DUMMY_ITEM_ID and typeId ~= SLOT_FILLER_ITEM_TYPE_ID then
|
|
90
|
+
targetCollection[targetCollectionNextIndex] = ____exports.Item:of(item)
|
|
91
|
+
targetCollectionNextIndex = targetCollectionNextIndex + 1
|
|
92
|
+
end
|
|
93
|
+
end
|
|
56
94
|
____exports.Item = __TS__Class()
|
|
57
95
|
local Item = ____exports.Item
|
|
58
96
|
Item.name = "Item"
|
|
@@ -111,34 +149,27 @@ function Item.prototype.getAbility(self, abilityTypeId)
|
|
|
111
149
|
local ability = self[101][abilityTypeId] ~= nil and doAbilityAction(self.handle, getItemAbility, abilityTypeId)
|
|
112
150
|
return ability and ItemAbility:of(ability, abilityTypeId, self) or nil
|
|
113
151
|
end
|
|
114
|
-
function Item.getInRange(self,
|
|
115
|
-
|
|
116
|
-
|
|
152
|
+
function Item.getInRange(self, x, y, range)
|
|
153
|
+
targetCollection = {}
|
|
154
|
+
targetCollectionNextIndex = 1
|
|
155
|
+
centerX = x
|
|
156
|
+
centerY = y
|
|
157
|
+
enumRange = range
|
|
158
|
+
setRect(
|
|
117
159
|
enumRect,
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
160
|
+
x - range,
|
|
161
|
+
y - range,
|
|
162
|
+
x + range,
|
|
163
|
+
y + range
|
|
122
164
|
)
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
nil,
|
|
126
|
-
function()
|
|
127
|
-
collection[#collection + 1] = self:of(GetEnumItem())
|
|
128
|
-
end
|
|
129
|
-
)
|
|
130
|
-
return collection
|
|
165
|
+
enumItemsInRect(enumRect, nil, collectIntoTargetRange)
|
|
166
|
+
return targetCollection
|
|
131
167
|
end
|
|
132
168
|
function Item.getInRect(self, rect)
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
function()
|
|
138
|
-
collection[#collection + 1] = self:of(GetEnumItem())
|
|
139
|
-
end
|
|
140
|
-
)
|
|
141
|
-
return collection
|
|
169
|
+
targetCollection = {}
|
|
170
|
+
targetCollectionNextIndex = 1
|
|
171
|
+
enumItemsInRect(rect.handle, nil, collectIntoTarget)
|
|
172
|
+
return targetCollection
|
|
142
173
|
end
|
|
143
174
|
__TS__SetDescriptor(
|
|
144
175
|
Item.prototype,
|
|
@@ -551,7 +582,7 @@ __TS__ObjectDefineProperty(
|
|
|
551
582
|
)
|
|
552
583
|
__TS__ObjectDefineProperty(
|
|
553
584
|
Item,
|
|
554
|
-
"
|
|
585
|
+
"destroyEvent",
|
|
555
586
|
{get = function(self)
|
|
556
587
|
return self.onDestroyEvent
|
|
557
588
|
end}
|
|
@@ -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
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
local ____exports = {}
|
|
2
|
+
local disableAbility = BlzUnitDisableAbility
|
|
3
|
+
---
|
|
4
|
+
-- @internal For use by internal systems only.
|
|
5
|
+
____exports.increaseAbilityDisableCounter = function(unit, abilityTypeId, times)
|
|
6
|
+
for _ = 1, times do
|
|
7
|
+
disableAbility(unit, abilityTypeId, true, false)
|
|
8
|
+
end
|
|
9
|
+
for _ = times, -1 do
|
|
10
|
+
disableAbility(unit, abilityTypeId, false, false)
|
|
11
|
+
end
|
|
12
|
+
end
|
|
13
|
+
return ____exports
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/** @noSelfInFile */
|
|
2
|
-
export
|
|
2
|
+
export {};
|
|
@@ -10,5 +10,7 @@ ____exports.AUTO_ATTACK_SPEED_INCREASE_DUMMY_ABILITY_TYPE_ID = compiletime(funct
|
|
|
10
10
|
abilityType.autoAttackSpeedIncreaseFactor = 0
|
|
11
11
|
return abilityType.id
|
|
12
12
|
end)
|
|
13
|
+
---
|
|
14
|
+
-- @internal For use by internal systems.
|
|
13
15
|
____exports.AUTO_ATTACK_SPEED_INCREASE_FACTOR_ABILITY_FIELD = ABILITY_RLF_ATTACK_SPEED_INCREASE_ISX1
|
|
14
16
|
return ____exports
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
local ____exports = {}
|
|
2
|
+
local ____evasion = require("engine.object-data.entry.ability-type.evasion")
|
|
3
|
+
local EvasionAbilityType = ____evasion.EvasionAbilityType
|
|
4
|
+
---
|
|
5
|
+
-- @internal For use by internal systems.
|
|
6
|
+
____exports.EVASION_PROBABILITY_DUMMY_ABILITY_TYPE_ID = compiletime(function()
|
|
7
|
+
local abilityType = EvasionAbilityType:create()
|
|
8
|
+
abilityType.isInternal = true
|
|
9
|
+
abilityType.isButtonVisible = false
|
|
10
|
+
abilityType.evasionProbability = 0
|
|
11
|
+
return abilityType.id
|
|
12
|
+
end)
|
|
13
|
+
---
|
|
14
|
+
-- @internal For use by internal systems.
|
|
15
|
+
____exports.EVASION_PROBABILITY_ABILITY_FIELD = ABILITY_RLF_CHANCE_TO_EVADE_EEV1
|
|
16
|
+
return ____exports
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
local ____exports = {}
|
|
2
|
+
local ____unit = require("engine.internal.unit")
|
|
3
|
+
local Unit = ____unit.Unit
|
|
4
|
+
local ____add_2Ditem_2Dto_2Dslot = require("engine.internal.unit.add-item-to-slot")
|
|
5
|
+
local fillerItems = ____add_2Ditem_2Dto_2Dslot.fillerItems
|
|
6
|
+
local unitsWithFillerItems = ____add_2Ditem_2Dto_2Dslot.unitsWithFillerItems
|
|
7
|
+
local setItemVisible = SetItemVisible
|
|
8
|
+
local unitRemoveItem = UnitRemoveItem
|
|
9
|
+
Unit.itemPickedUpEvent:addListener(
|
|
10
|
+
4,
|
|
11
|
+
function(unit)
|
|
12
|
+
local handle = unit.handle
|
|
13
|
+
if unitsWithFillerItems[handle] ~= nil then
|
|
14
|
+
for previousSlot = 1, 6 do
|
|
15
|
+
local fillerItem = fillerItems[previousSlot]
|
|
16
|
+
unitRemoveItem(handle, fillerItem)
|
|
17
|
+
setItemVisible(fillerItem, false)
|
|
18
|
+
end
|
|
19
|
+
unitsWithFillerItems[handle] = nil
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
)
|
|
23
|
+
return ____exports
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
local ____exports = {}
|
|
2
|
+
local ____blank = require("engine.object-data.entry.item-type.blank")
|
|
3
|
+
local BlankItemType = ____blank.BlankItemType
|
|
4
|
+
local ____arrays = require("utility.arrays")
|
|
5
|
+
local array = ____arrays.array
|
|
6
|
+
local ____ignore_2Devents_2Ditems = require("engine.internal.unit.ignore-events-items")
|
|
7
|
+
local ignoreEventsItems = ____ignore_2Devents_2Ditems.ignoreEventsItems
|
|
8
|
+
local setItemVisible = SetItemVisible
|
|
9
|
+
local unitAddItem = UnitAddItem
|
|
10
|
+
local unitItemInSlot = UnitItemInSlot
|
|
11
|
+
local unitRemoveItem = UnitRemoveItem
|
|
12
|
+
---
|
|
13
|
+
-- @internal For use by internal systems only.
|
|
14
|
+
____exports.SLOT_FILLER_ITEM_TYPE_ID = compiletime(function()
|
|
15
|
+
local itemType = BlankItemType:create()
|
|
16
|
+
itemType.name = "[Warscript/Dummy] Slot Filler"
|
|
17
|
+
return itemType.id
|
|
18
|
+
end)
|
|
19
|
+
---
|
|
20
|
+
-- @internal For use by internal systems only.
|
|
21
|
+
____exports.fillerItems = array(
|
|
22
|
+
6,
|
|
23
|
+
function()
|
|
24
|
+
local item = CreateItem(____exports.SLOT_FILLER_ITEM_TYPE_ID, 0, 0)
|
|
25
|
+
setItemVisible(item, false)
|
|
26
|
+
ignoreEventsItems[item] = true
|
|
27
|
+
return item
|
|
28
|
+
end
|
|
29
|
+
)
|
|
30
|
+
---
|
|
31
|
+
-- @internal For use by internal systems only.
|
|
32
|
+
____exports.unitsWithFillerItems = {}
|
|
33
|
+
---
|
|
34
|
+
-- @internal For use by internal systems only.
|
|
35
|
+
____exports.unitAddItemToSlot = function(unit, item, slot)
|
|
36
|
+
for previousSlot = 0, slot - 1 do
|
|
37
|
+
if unitItemInSlot(unit, previousSlot) == nil then
|
|
38
|
+
unitAddItem(unit, ____exports.fillerItems[previousSlot + 1])
|
|
39
|
+
____exports.unitsWithFillerItems[unit] = true
|
|
40
|
+
end
|
|
41
|
+
end
|
|
42
|
+
unitAddItem(unit, item)
|
|
43
|
+
if ____exports.unitsWithFillerItems[unit] ~= nil then
|
|
44
|
+
for previousSlot = 0, slot - 1 do
|
|
45
|
+
local fillerItem = ____exports.fillerItems[previousSlot + 1]
|
|
46
|
+
unitRemoveItem(unit, fillerItem)
|
|
47
|
+
setItemVisible(fillerItem, false)
|
|
48
|
+
end
|
|
49
|
+
____exports.unitsWithFillerItems[unit] = nil
|
|
50
|
+
end
|
|
51
|
+
end
|
|
52
|
+
return ____exports
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { CombatClassifications } from "../../object-data/auxiliary/combat-classification";
|
|
3
3
|
declare module "../unit" {
|
|
4
4
|
interface Unit {
|
|
5
|
-
isAllowedTarget(this: Unit, source: Unit, allowedTargetCombatClassifications
|
|
5
|
+
isAllowedTarget(this: Unit, source: Unit, allowedTargetCombatClassifications?: CombatClassifications): boolean;
|
|
6
6
|
}
|
|
7
7
|
}
|
|
8
8
|
declare module "../unit" {
|
|
@@ -5,7 +5,15 @@ local initializeFilterTargetState = ____combat_2Dclassification.initializeFilter
|
|
|
5
5
|
local ____unit = require("engine.internal.unit")
|
|
6
6
|
local Unit = ____unit.Unit
|
|
7
7
|
Unit.prototype.isAllowedTarget = function(self, source, allowedTargetCombatClassifications)
|
|
8
|
-
|
|
8
|
+
if allowedTargetCombatClassifications ~= nil then
|
|
9
|
+
initializeFilterTargetState(source, allowedTargetCombatClassifications)
|
|
10
|
+
return filterTarget(self)
|
|
11
|
+
end
|
|
12
|
+
initializeFilterTargetState(source, source.firstWeapon.allowedTargetCombatClassifications)
|
|
13
|
+
if filterTarget(self) then
|
|
14
|
+
return true
|
|
15
|
+
end
|
|
16
|
+
initializeFilterTargetState(source, source.secondWeapon.allowedTargetCombatClassifications)
|
|
9
17
|
return filterTarget(self)
|
|
10
18
|
end
|
|
11
19
|
Unit.getAllowedTargetsInRange = function(source, allowedTargetCombatClassifications, x, y, range)
|