warscript 0.0.1-dev.6912057 → 0.0.1-dev.69b6655
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/frame.d.ts +1 -0
- package/core/types/frame.lua +136 -58
- package/core/types/handle.lua +6 -9
- package/core/types/item.d.ts +1 -0
- package/core/types/item.lua +1 -0
- package/core/types/player.d.ts +18 -1
- package/core/types/player.lua +76 -26
- package/core/types/playerCamera.d.ts +2 -0
- package/core/types/playerCamera.lua +123 -5
- package/core/types/playerColor.lua +4 -3
- package/core/types/sound.d.ts +1 -1
- package/core/types/sound.lua +14 -9
- package/core/types/tileCell.d.ts +11 -1
- package/core/types/tileCell.lua +97 -0
- package/core/types/timer.d.ts +3 -2
- package/core/types/timer.lua +22 -2
- package/core/types/unit.d.ts +4 -0
- package/core/types/unit.lua +4 -0
- package/decl/native.d.ts +711 -11
- package/destroyable.d.ts +1 -0
- package/destroyable.lua +9 -0
- package/engine/behavior.d.ts +12 -1
- package/engine/behavior.lua +199 -65
- package/engine/behaviour/ability/apply-buff.lua +4 -4
- package/engine/behaviour/ability/damage.d.ts +3 -0
- package/engine/behaviour/ability/damage.lua +18 -15
- package/engine/behaviour/ability/emulate-impact.lua +5 -4
- package/engine/behaviour/ability/remove-buffs.d.ts +9 -0
- package/engine/behaviour/ability/remove-buffs.lua +21 -0
- package/engine/behaviour/ability/restore-mana.d.ts +1 -1
- package/engine/behaviour/ability/restore-mana.lua +6 -6
- package/engine/behaviour/ability.d.ts +12 -6
- package/engine/behaviour/ability.lua +42 -1
- package/engine/behaviour/unit/stun-immunity.d.ts +9 -5
- package/engine/behaviour/unit/stun-immunity.lua +17 -7
- package/engine/behaviour/unit.d.ts +16 -5
- package/engine/behaviour/unit.lua +127 -22
- package/engine/buff.d.ts +73 -27
- package/engine/buff.lua +424 -193
- package/engine/index.d.ts +2 -1
- package/engine/internal/ability.d.ts +7 -1
- package/engine/internal/ability.lua +78 -42
- package/engine/internal/item/fields.d.ts +12 -0
- package/engine/internal/item/fields.lua +33 -0
- package/engine/internal/item+owner.d.ts +1 -0
- package/engine/internal/item+owner.lua +19 -6
- package/engine/internal/item.d.ts +23 -14
- package/engine/internal/item.lua +169 -82
- package/engine/internal/mechanics/cast-ability.lua +6 -3
- package/engine/internal/misc/frame-coordinates.lua +21 -0
- package/engine/internal/misc/get-terrain-z.d.ts +2 -0
- package/engine/internal/misc/get-terrain-z.lua +11 -0
- package/engine/internal/misc/player-local-handle.d.ts +2 -0
- package/engine/internal/misc/player-local-handle.lua +5 -0
- package/engine/internal/object-data/armor-bonus.d.ts +2 -0
- package/engine/internal/object-data/attribute-bonus.lua +2 -2
- package/engine/internal/object-data/health-bonus.d.ts +2 -0
- package/engine/internal/object-data/health-bonus.lua +16 -0
- package/engine/internal/object-data/mana-bonus.d.ts +2 -0
- package/engine/internal/object-data/mana-bonus.lua +16 -0
- package/engine/internal/object-data/mana-regeneration-rate-increase-factor.d.ts +2 -0
- package/engine/internal/object-data/mana-regeneration-rate-increase-factor.lua +16 -0
- package/engine/internal/unit/ability.d.ts +14 -14
- package/engine/internal/unit/ability.lua +86 -47
- package/engine/internal/unit/appearance.d.ts +15 -0
- package/engine/internal/unit/appearance.lua +85 -0
- package/engine/internal/unit/attributes.d.ts +17 -0
- package/engine/internal/unit/attributes.lua +46 -0
- package/engine/internal/unit/bag.d.ts +18 -0
- package/engine/internal/unit/bag.lua +63 -0
- package/engine/internal/unit/bonus.d.ts +6 -0
- package/engine/internal/unit/bonus.lua +33 -3
- package/engine/internal/unit/buff.d.ts +2 -2
- package/engine/internal/unit/buff.lua +34 -19
- package/engine/internal/unit/equipment.d.ts +36 -0
- package/engine/internal/unit/equipment.lua +169 -0
- package/engine/internal/unit/fly-height.d.ts +7 -0
- package/engine/internal/unit/fly-height.lua +20 -0
- package/engine/internal/unit/interrupts.d.ts +12 -0
- package/engine/internal/unit/interrupts.lua +28 -0
- package/engine/internal/unit/{item.d.ts → inventory.d.ts} +3 -3
- package/engine/internal/unit/{item.lua → inventory.lua} +25 -26
- package/engine/internal/unit/main-selected.lua +12 -27
- package/engine/internal/unit/pseudo-passive-abilities.d.ts +2 -0
- package/engine/internal/unit/pseudo-passive-abilities.lua +11 -0
- package/engine/internal/unit/range-event.d.ts +12 -0
- package/engine/internal/unit/range-event.lua +90 -0
- package/engine/internal/unit/scale.d.ts +7 -0
- package/engine/internal/unit/scale.lua +20 -0
- package/engine/internal/unit+ability.lua +10 -1
- package/engine/internal/unit+bonus.lua +3 -3
- package/engine/internal/unit+damage.d.ts +9 -0
- package/engine/internal/unit+damage.lua +33 -0
- package/engine/internal/unit-missile-data.lua +58 -32
- package/engine/internal/unit-missile-launch.lua +52 -14
- package/engine/internal/unit.d.ts +17 -22
- package/engine/internal/unit.lua +180 -206
- package/engine/local-client.d.ts +27 -0
- package/engine/local-client.lua +394 -54
- package/engine/object-data/auxiliary/armor-type.d.ts +11 -0
- package/engine/object-data/auxiliary/armor-type.lua +46 -0
- package/engine/object-data/auxiliary/equipment-slot.d.ts +12 -0
- package/engine/object-data/auxiliary/equipment-slot.lua +2 -0
- package/engine/object-data/auxiliary/equipment-type.d.ts +13 -0
- package/engine/object-data/auxiliary/equipment-type.lua +2 -0
- package/engine/object-data/auxiliary/health-regeneration-type.d.ts +8 -0
- package/engine/object-data/auxiliary/health-regeneration-type.lua +2 -0
- package/engine/object-data/auxiliary/item-tag.d.ts +12 -0
- package/engine/object-data/auxiliary/item-tag.lua +2 -0
- package/engine/object-data/auxiliary/sound-set-name.d.ts +14 -3
- package/engine/object-data/auxiliary/unit-attribute.lua +1 -1
- package/engine/object-data/entry/ability-type/apprehend.d.ts +22 -0
- package/engine/object-data/entry/ability-type/apprehend.lua +66 -0
- package/engine/object-data/entry/ability-type/armor-bonus.d.ts +8 -0
- package/engine/object-data/entry/ability-type/{armor-increase.lua → armor-bonus.lua} +9 -9
- package/engine/object-data/entry/ability-type/banshee.d.ts +8 -0
- package/engine/object-data/entry/ability-type/banshee.lua +13 -0
- package/engine/object-data/entry/ability-type/banshees-wail-damage-amp.d.ts +12 -0
- package/engine/object-data/entry/ability-type/banshees-wail-damage-amp.lua +27 -0
- package/engine/object-data/entry/ability-type/banshees-wail.d.ts +31 -0
- package/engine/object-data/entry/ability-type/banshees-wail.lua +117 -0
- package/engine/object-data/entry/ability-type/battering-ram.d.ts +33 -0
- package/engine/object-data/entry/ability-type/battering-ram.lua +130 -0
- package/engine/object-data/entry/ability-type/blank-configurable.d.ts +3 -0
- package/engine/object-data/entry/ability-type/blank-configurable.lua +30 -0
- package/engine/object-data/entry/ability-type/cleansing-fire.d.ts +27 -0
- package/engine/object-data/entry/ability-type/cleansing-fire.lua +104 -0
- package/engine/object-data/entry/ability-type/consecration.d.ts +15 -0
- package/engine/object-data/entry/ability-type/consecration.lua +52 -0
- package/engine/object-data/entry/ability-type/cooldown-reduction.d.ts +12 -0
- package/engine/object-data/entry/ability-type/cooldown-reduction.lua +39 -0
- package/engine/object-data/entry/ability-type/critical-strike-system.d.ts +18 -0
- package/engine/object-data/entry/ability-type/critical-strike-system.lua +65 -0
- package/engine/object-data/entry/ability-type/deathseeker-arrows.d.ts +21 -0
- package/engine/object-data/entry/ability-type/deathseeker-arrows.lua +78 -0
- package/engine/object-data/entry/ability-type/equipment-inventory-interface.d.ts +8 -0
- package/engine/object-data/entry/ability-type/equipment-inventory-interface.lua +13 -0
- package/engine/object-data/entry/ability-type/equipment-inventory.d.ts +13 -0
- package/engine/object-data/entry/ability-type/equipment-inventory.lua +27 -0
- package/engine/object-data/entry/ability-type/equipment.d.ts +13 -0
- package/engine/object-data/entry/ability-type/equipment.lua +27 -0
- package/engine/object-data/entry/ability-type/grant-talent-point.d.ts +8 -0
- package/engine/object-data/entry/ability-type/grant-talent-point.lua +13 -0
- package/engine/object-data/entry/ability-type/grim-conviction.d.ts +36 -0
- package/engine/object-data/entry/ability-type/grim-conviction.lua +131 -0
- package/engine/object-data/entry/ability-type/grit.d.ts +18 -0
- package/engine/object-data/entry/ability-type/grit.lua +65 -0
- package/engine/object-data/entry/ability-type/guiding-hand.d.ts +27 -0
- package/engine/object-data/entry/ability-type/guiding-hand.lua +104 -0
- package/engine/object-data/entry/ability-type/headsplitter.d.ts +27 -0
- package/engine/object-data/entry/ability-type/headsplitter.lua +104 -0
- package/engine/object-data/entry/ability-type/{armor-increase.d.ts → healing-modifier.d.ts} +4 -3
- package/engine/object-data/entry/ability-type/healing-modifier.lua +26 -0
- package/engine/object-data/entry/ability-type/health-bonus.d.ts +8 -0
- package/engine/object-data/entry/ability-type/health-bonus.lua +26 -0
- package/engine/object-data/entry/ability-type/heroic-slash.d.ts +18 -0
- package/engine/object-data/entry/ability-type/heroic-slash.lua +65 -0
- package/engine/object-data/entry/ability-type/holy-wrath.d.ts +30 -0
- package/engine/object-data/entry/ability-type/holy-wrath.lua +117 -0
- package/engine/object-data/entry/ability-type/inspire-courage.d.ts +18 -0
- package/engine/object-data/entry/ability-type/inspire-courage.lua +65 -0
- package/engine/object-data/entry/ability-type/lights-mercy.d.ts +27 -0
- package/engine/object-data/entry/ability-type/lights-mercy.lua +104 -0
- package/engine/object-data/entry/ability-type/mana-bonus.d.ts +8 -0
- package/engine/object-data/entry/ability-type/mana-bonus.lua +26 -0
- package/engine/object-data/entry/ability-type/mana-efficiency.d.ts +12 -0
- package/engine/object-data/entry/ability-type/mana-efficiency.lua +39 -0
- package/engine/object-data/entry/ability-type/mana-regeneration.d.ts +8 -0
- package/engine/object-data/entry/ability-type/mana-regeneration.lua +26 -0
- package/engine/object-data/entry/ability-type/mind-control.d.ts +21 -0
- package/engine/object-data/entry/ability-type/mind-control.lua +78 -0
- package/engine/object-data/entry/ability-type/on-attack-cast-spell.d.ts +21 -0
- package/engine/object-data/entry/ability-type/on-attack-cast-spell.lua +52 -0
- package/engine/object-data/entry/ability-type/on-basic-attack-cast-spell.d.ts +19 -0
- package/engine/object-data/entry/ability-type/on-basic-attack-cast-spell.lua +65 -0
- package/engine/object-data/entry/ability-type/on-hit-cast-spell.d.ts +15 -0
- package/engine/object-data/entry/ability-type/on-hit-cast-spell.lua +26 -0
- package/engine/object-data/entry/ability-type/on-magic-attack-cast-spell.d.ts +6 -0
- package/engine/object-data/entry/ability-type/on-magic-attack-cast-spell.lua +12 -0
- package/engine/object-data/entry/ability-type/provoke.d.ts +21 -0
- package/engine/object-data/entry/ability-type/provoke.lua +66 -0
- package/engine/object-data/entry/ability-type/raise-the-banner.d.ts +9 -0
- package/engine/object-data/entry/ability-type/raise-the-banner.lua +26 -0
- package/engine/object-data/entry/ability-type/reincarnation.d.ts +8 -0
- package/engine/object-data/entry/ability-type/reincarnation.lua +26 -0
- package/engine/object-data/entry/ability-type/resolve.d.ts +12 -0
- package/engine/object-data/entry/ability-type/resolve.lua +39 -0
- package/engine/object-data/entry/ability-type/righteous-fury.d.ts +33 -0
- package/engine/object-data/entry/ability-type/righteous-fury.lua +130 -0
- package/engine/object-data/entry/ability-type/sacred-aura.d.ts +27 -0
- package/engine/object-data/entry/ability-type/sacred-aura.lua +104 -0
- package/engine/object-data/entry/ability-type/soul-lantern.d.ts +30 -0
- package/engine/object-data/entry/ability-type/soul-lantern.lua +117 -0
- package/engine/object-data/entry/ability-type/spell-amp.d.ts +15 -0
- package/engine/object-data/entry/ability-type/spell-amp.lua +52 -0
- package/engine/object-data/entry/ability-type/spell-critical-strike.d.ts +12 -0
- package/engine/object-data/entry/ability-type/spell-critical-strike.lua +39 -0
- package/engine/object-data/entry/ability-type/spell-vamp.d.ts +12 -0
- package/engine/object-data/entry/ability-type/spell-vamp.lua +39 -0
- package/engine/object-data/entry/ability-type/stackable-evasion.d.ts +9 -0
- package/engine/object-data/entry/ability-type/stackable-evasion.lua +13 -0
- package/engine/object-data/entry/ability-type/stackable-hardened-skin.d.ts +21 -0
- package/engine/object-data/entry/ability-type/stackable-hardened-skin.lua +78 -0
- package/engine/object-data/entry/ability-type/stackable-life-steal.d.ts +9 -0
- package/engine/object-data/entry/ability-type/stackable-life-steal.lua +26 -0
- package/engine/object-data/entry/ability-type/stackable-spell-damage-reduction.d.ts +9 -0
- package/engine/object-data/entry/ability-type/stackable-spell-damage-reduction.lua +13 -0
- package/engine/object-data/entry/ability-type/stackable-thorn-shield.d.ts +9 -0
- package/engine/object-data/entry/ability-type/stackable-thorn-shield.lua +13 -0
- package/engine/object-data/entry/ability-type/stat-details.d.ts +12 -0
- package/engine/object-data/entry/ability-type/stat-details.lua +27 -0
- package/engine/object-data/entry/ability-type/surge-of-light.d.ts +33 -0
- package/engine/object-data/entry/ability-type/surge-of-light.lua +130 -0
- package/engine/object-data/entry/ability-type/sweeping-strike.d.ts +57 -0
- package/engine/object-data/entry/ability-type/sweeping-strike.lua +234 -0
- package/engine/object-data/entry/ability-type/talents.d.ts +12 -0
- package/engine/object-data/entry/ability-type/talents.lua +27 -0
- package/engine/object-data/entry/ability-type/unyielding-guard.d.ts +30 -0
- package/engine/object-data/entry/ability-type/unyielding-guard.lua +117 -0
- package/engine/object-data/entry/ability-type/valiant-charge.d.ts +27 -0
- package/engine/object-data/entry/ability-type/valiant-charge.lua +104 -0
- package/engine/object-data/entry/ability-type/warcry.d.ts +9 -0
- package/engine/object-data/entry/ability-type/warcry.lua +26 -0
- package/engine/object-data/entry/ability-type/withering-fire.d.ts +21 -0
- package/engine/object-data/entry/ability-type/withering-fire.lua +78 -0
- package/engine/object-data/entry/ability-type.d.ts +12 -3
- package/engine/object-data/entry/ability-type.lua +141 -5
- package/engine/object-data/entry/buff-type/applicable.lua +113 -109
- package/engine/object-data/entry/buff-type.d.ts +6 -2
- package/engine/object-data/entry/buff-type.lua +26 -0
- package/engine/object-data/entry/destructible-type.d.ts +32 -2
- package/engine/object-data/entry/destructible-type.lua +181 -0
- package/engine/object-data/entry/item-type.d.ts +12 -3
- package/engine/object-data/entry/item-type.lua +52 -0
- package/engine/object-data/entry/lightning-type.d.ts +2 -2
- package/engine/object-data/entry/sound-preset.d.ts +2 -2
- package/engine/object-data/entry/unit-type.d.ts +62 -4
- package/engine/object-data/entry/unit-type.lua +474 -38
- package/engine/object-data/entry/upgrade.d.ts +2 -2
- package/engine/object-data/entry.d.ts +4 -1
- package/engine/object-field/ability.d.ts +3 -3
- package/engine/object-field/ability.lua +9 -8
- package/engine/object-field/item.d.ts +22 -0
- package/engine/object-field/item.lua +118 -0
- package/engine/object-field/unit.d.ts +20 -5
- package/engine/object-field/unit.lua +61 -0
- package/engine/object-field.d.ts +12 -4
- package/engine/object-field.lua +273 -126
- package/engine/random.d.ts +10 -0
- package/engine/random.lua +21 -0
- package/engine/standard/entries/ability-type.d.ts +3102 -7
- package/engine/standard/entries/ability-type.lua +0 -6
- package/engine/standard/entries/item-type.d.ts +1299 -0
- package/engine/standard/entries/item-type.lua +2 -0
- package/engine/standard/entries/unit-type.d.ts +5 -0
- package/engine/standard/entries/unit-type.lua +5 -0
- package/engine/standard/fields/ability.d.ts +2 -2
- package/engine/standard/fields/ability.lua +2 -2
- package/engine/standard/fields/item.d.ts +4 -0
- package/engine/standard/fields/item.lua +6 -0
- package/engine/standard/fields/unit.d.ts +11 -3
- package/engine/standard/fields/unit.lua +15 -2
- package/engine/synchronization.d.ts +11 -0
- package/engine/synchronization.lua +77 -0
- package/engine/text-tag.d.ts +1 -1
- package/engine/text-tag.lua +92 -17
- package/engine/unit.d.ts +9 -1
- package/engine/unit.lua +9 -1
- package/event.d.ts +1 -1
- package/lualib_bundle.lua +1 -1
- package/math.d.ts +2 -0
- package/math.lua +14 -0
- package/net/socket.lua +1 -1
- package/network.lua +25 -1
- package/objutil/buff.lua +10 -8
- package/objutil/object.lua +1 -1
- package/operation.d.ts +8 -1
- package/operation.lua +38 -18
- package/package.json +3 -23
- package/patch-lua.lua +15 -0
- package/patch-lualib.lua +1 -1
- package/utility/arrays.d.ts +1 -0
- package/utility/arrays.lua +8 -0
- package/utility/callback-array.d.ts +17 -0
- package/utility/callback-array.lua +61 -0
- package/utility/functions.d.ts +2 -0
- package/utility/functions.lua +7 -0
- package/utility/linked-map.d.ts +35 -0
- package/utility/linked-map.lua +107 -0
- package/utility/linked-set.d.ts +4 -1
- package/utility/linked-set.lua +46 -1
- package/utility/lua-maps.d.ts +11 -2
- package/utility/lua-maps.lua +33 -2
- package/utility/lua-sets.d.ts +1 -0
- package/utility/lua-sets.lua +4 -0
- package/utility/random.d.ts +102 -0
- package/utility/random.lua +273 -0
- package/utility/records.lua +20 -1
- package/utility/types.d.ts +3 -0
- package/utility/unordered-map.d.ts +27 -0
- package/utility/unordered-map.lua +99 -0
- /package/engine/internal/{object-data/armor-increase.d.ts → misc/frame-coordinates.d.ts} +0 -0
- /package/engine/internal/object-data/{armor-increase.lua → armor-bonus.lua} +0 -0
- /package/engine/object-data/entry/ability-type/{attribute-increase.d.ts → attribute-bonus.d.ts} +0 -0
- /package/engine/object-data/entry/ability-type/{attribute-increase.lua → attribute-bonus.lua} +0 -0
package/engine/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/** @noSelfInFile */
|
|
2
|
-
import { Handle } from "../../core/types/handle";
|
|
2
|
+
import { Handle, HandleDestructor } from "../../core/types/handle";
|
|
3
3
|
import { Event } from "../../event";
|
|
4
4
|
import type { Item } from "../../core/types/item";
|
|
5
5
|
import type { Unit } from "./unit";
|
|
@@ -64,9 +64,14 @@ export declare class UnitAbility extends Ability {
|
|
|
64
64
|
get isDisabled(): boolean;
|
|
65
65
|
get level(): number;
|
|
66
66
|
set level(v: number);
|
|
67
|
+
/** Uses the native percentage scale. */
|
|
68
|
+
get cooldownRemainingPercent(): number;
|
|
69
|
+
set cooldownRemainingPercent(percent: number);
|
|
67
70
|
get cooldownRemaining(): number;
|
|
68
71
|
set cooldownRemaining(cooldownRemaining: number);
|
|
72
|
+
startCooldown(cooldown: number): void;
|
|
69
73
|
interruptCast(): void;
|
|
74
|
+
protected onDestroy(): HandleDestructor;
|
|
70
75
|
static get onCreate(): Event<[UnitAbility]>;
|
|
71
76
|
static get onDestroy(): Event<[UnitAbility]>;
|
|
72
77
|
}
|
|
@@ -93,6 +98,7 @@ export declare class ItemAbility extends Ability {
|
|
|
93
98
|
get cooldownRemaining(): number;
|
|
94
99
|
set cooldownRemaining(cooldownRemaining: number);
|
|
95
100
|
interruptCast(): void;
|
|
101
|
+
protected onDestroy(): HandleDestructor;
|
|
96
102
|
static get onCreate(): Event<[ItemAbility]>;
|
|
97
103
|
static get onDestroy(): Event<[ItemAbility]>;
|
|
98
104
|
}
|
|
@@ -14,31 +14,33 @@ local abilityActionDummy = ____ability.abilityActionDummy
|
|
|
14
14
|
local doAbilityAction = ____ability.doAbilityAction
|
|
15
15
|
local doAbilityActionForceDummy = ____ability.doAbilityActionForceDummy
|
|
16
16
|
local startItemCooldown = ____ability.startItemCooldown
|
|
17
|
-
local getUnitAbilityLevel = GetUnitAbilityLevel
|
|
18
|
-
local setUnitAbilityLevel = SetUnitAbilityLevel
|
|
19
|
-
local setAbilityIntegerField = BlzSetAbilityIntegerField
|
|
20
|
-
local setAbilityRealField = BlzSetAbilityRealField
|
|
21
|
-
local setAbilityBooleanField = BlzSetAbilityBooleanField
|
|
22
|
-
local setAbilityStringField = BlzSetAbilityStringField
|
|
23
|
-
local setAbilityIntegerLevelField = BlzSetAbilityIntegerLevelField
|
|
24
|
-
local setAbilityRealLevelField = BlzSetAbilityRealLevelField
|
|
25
|
-
local setAbilityBooleanLevelField = BlzSetAbilityBooleanLevelField
|
|
26
|
-
local setAbilityStringLevelField = BlzSetAbilityStringLevelField
|
|
27
|
-
local getAbilityIntegerField = BlzGetAbilityIntegerField
|
|
28
|
-
local getAbilityRealField = BlzGetAbilityRealField
|
|
29
17
|
local getAbilityBooleanField = BlzGetAbilityBooleanField
|
|
30
|
-
local
|
|
18
|
+
local getAbilityBooleanLevelField = BlzGetAbilityBooleanLevelField
|
|
19
|
+
local getAbilityIntegerField = BlzGetAbilityIntegerField
|
|
31
20
|
local getAbilityIntegerLevelField = BlzGetAbilityIntegerLevelField
|
|
21
|
+
local getAbilityRealField = BlzGetAbilityRealField
|
|
32
22
|
local getAbilityRealLevelField = BlzGetAbilityRealLevelField
|
|
33
|
-
local
|
|
23
|
+
local getAbilityStringField = BlzGetAbilityStringField
|
|
34
24
|
local getAbilityStringLevelField = BlzGetAbilityStringLevelField
|
|
25
|
+
local getHandleId = GetHandleId
|
|
26
|
+
local getUnitAbilityCooldownPercent = BlzGetUnitAbilityCooldownPercent
|
|
35
27
|
local getUnitAbilityCooldownRemaining = BlzGetUnitAbilityCooldownRemaining
|
|
28
|
+
local getUnitAbilityLevel = GetUnitAbilityLevel
|
|
29
|
+
local order2orderId = _G.OrderId
|
|
30
|
+
local setAbilityBooleanField = BlzSetAbilityBooleanField
|
|
31
|
+
local setAbilityBooleanLevelField = BlzSetAbilityBooleanLevelField
|
|
32
|
+
local setAbilityIntegerField = BlzSetAbilityIntegerField
|
|
33
|
+
local setAbilityIntegerLevelField = BlzSetAbilityIntegerLevelField
|
|
34
|
+
local setAbilityRealField = BlzSetAbilityRealField
|
|
35
|
+
local setAbilityRealLevelField = BlzSetAbilityRealLevelField
|
|
36
|
+
local setAbilityStringField = BlzSetAbilityStringField
|
|
37
|
+
local setAbilityStringLevelField = BlzSetAbilityStringLevelField
|
|
38
|
+
local setUnitAbilityCooldownPercent = BlzSetUnitAbilityCooldownPercent
|
|
39
|
+
local setUnitAbilityCooldownRemaining = BlzSetUnitAbilityCooldownRemaining
|
|
40
|
+
local setUnitAbilityLevel = SetUnitAbilityLevel
|
|
36
41
|
local startUnitAbilityCooldown = BlzStartUnitAbilityCooldown
|
|
37
|
-
local getHandleId = GetHandleId
|
|
38
|
-
local getItemBooleanField = BlzGetItemBooleanField
|
|
39
|
-
local setItemBooleanField = BlzSetItemBooleanField
|
|
40
|
-
local unitHideAbility = BlzUnitHideAbility
|
|
41
42
|
local unitDisableAbility = BlzUnitDisableAbility
|
|
43
|
+
local unitHideAbility = BlzUnitHideAbility
|
|
42
44
|
local match = string.match
|
|
43
45
|
local ____type = _G.type
|
|
44
46
|
local ____tostring = _G.tostring
|
|
@@ -215,7 +217,6 @@ local levelRefreshFields = {
|
|
|
215
217
|
[fourCC("Neg1")] = true
|
|
216
218
|
}
|
|
217
219
|
local levelsField = ABILITY_IF_LEVELS
|
|
218
|
-
local order2orderId = _G.OrderId
|
|
219
220
|
local orderIdFieldByParentTypeId = {
|
|
220
221
|
[fourCC("ANcl")] = ABILITY_SLF_BASE_ORDER_ID_NCL6,
|
|
221
222
|
[fourCC("Aspb")] = ABILITY_SLF_BASE_ORDER_ID_SPB5,
|
|
@@ -232,6 +233,19 @@ ____exports.getOrderIdByAbilityTypeId = function(abilityTypeId)
|
|
|
232
233
|
local parentTypeId = availableFields[abilityTypeId]
|
|
233
234
|
return order2orderId(orders[____type(parentTypeId) == "number" and parentTypeId or abilityTypeId] or "")
|
|
234
235
|
end
|
|
236
|
+
---
|
|
237
|
+
-- @internal For use by internal systems only.
|
|
238
|
+
____exports.abilityTypeHasField = function(abilityTypeId, field)
|
|
239
|
+
field = ____type(field) == "number" and field or getHandleId(field)
|
|
240
|
+
if commonFields[field] then
|
|
241
|
+
return true
|
|
242
|
+
end
|
|
243
|
+
local id = availableFields[abilityTypeId]
|
|
244
|
+
if ____type(id) == "number" then
|
|
245
|
+
id = availableFields[id]
|
|
246
|
+
end
|
|
247
|
+
return not not (id and id[field])
|
|
248
|
+
end
|
|
235
249
|
____exports.Ability = __TS__Class()
|
|
236
250
|
local Ability = ____exports.Ability
|
|
237
251
|
Ability.name = "Ability"
|
|
@@ -247,15 +261,7 @@ function Ability.prototype.getSnapshot(self)
|
|
|
247
261
|
return nil
|
|
248
262
|
end
|
|
249
263
|
function Ability.prototype.hasField(self, field)
|
|
250
|
-
|
|
251
|
-
if commonFields[field] then
|
|
252
|
-
return true
|
|
253
|
-
end
|
|
254
|
-
local id = availableFields[self.typeId]
|
|
255
|
-
if ____type(id) == "number" then
|
|
256
|
-
id = availableFields[id]
|
|
257
|
-
end
|
|
258
|
-
return not not (id and id[field])
|
|
264
|
+
return ____exports.abilityTypeHasField(self.typeId, field)
|
|
259
265
|
end
|
|
260
266
|
function Ability.prototype.getField(self, field, level)
|
|
261
267
|
local fieldType = match(
|
|
@@ -417,9 +423,18 @@ function UnitAbility.prototype.decrementDisableCounter(self)
|
|
|
417
423
|
unitHideAbility(unit, typeId, true)
|
|
418
424
|
self.d = (self.d or 0) - 1
|
|
419
425
|
end
|
|
426
|
+
function UnitAbility.prototype.startCooldown(self, cooldown)
|
|
427
|
+
startUnitAbilityCooldown(self.u, self.typeId, cooldown)
|
|
428
|
+
end
|
|
420
429
|
function UnitAbility.prototype.interruptCast(self)
|
|
421
430
|
self.owner:interruptCast(self.typeId)
|
|
422
431
|
end
|
|
432
|
+
function UnitAbility.prototype.onDestroy(self)
|
|
433
|
+
if self.owner.state ~= 2 then
|
|
434
|
+
self.owner:removeAbility(self.typeId)
|
|
435
|
+
end
|
|
436
|
+
return UnitAbility.____super.prototype.onDestroy(self)
|
|
437
|
+
end
|
|
423
438
|
__TS__SetDescriptor(
|
|
424
439
|
UnitAbility.prototype,
|
|
425
440
|
"isDisabled",
|
|
@@ -441,6 +456,19 @@ __TS__SetDescriptor(
|
|
|
441
456
|
},
|
|
442
457
|
true
|
|
443
458
|
)
|
|
459
|
+
__TS__SetDescriptor(
|
|
460
|
+
UnitAbility.prototype,
|
|
461
|
+
"cooldownRemainingPercent",
|
|
462
|
+
{
|
|
463
|
+
get = function(self)
|
|
464
|
+
return getUnitAbilityCooldownPercent(self.u, self.typeId)
|
|
465
|
+
end,
|
|
466
|
+
set = function(self, percent)
|
|
467
|
+
setUnitAbilityCooldownPercent(self.u, self.typeId, percent)
|
|
468
|
+
end
|
|
469
|
+
},
|
|
470
|
+
true
|
|
471
|
+
)
|
|
444
472
|
__TS__SetDescriptor(
|
|
445
473
|
UnitAbility.prototype,
|
|
446
474
|
"cooldownRemaining",
|
|
@@ -449,7 +477,7 @@ __TS__SetDescriptor(
|
|
|
449
477
|
return getUnitAbilityCooldownRemaining(self.u, self.typeId)
|
|
450
478
|
end,
|
|
451
479
|
set = function(self, cooldownRemaining)
|
|
452
|
-
|
|
480
|
+
setUnitAbilityCooldownRemaining(self.u, self.typeId, cooldownRemaining)
|
|
453
481
|
end
|
|
454
482
|
},
|
|
455
483
|
true
|
|
@@ -505,12 +533,20 @@ function ItemAbility.prototype.setField(self, field, levelOrValue, value)
|
|
|
505
533
|
)
|
|
506
534
|
end
|
|
507
535
|
function ItemAbility.prototype.interruptCast(self)
|
|
508
|
-
local
|
|
509
|
-
local
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
536
|
+
local item = self.owner
|
|
537
|
+
local itemHandle = item.handle
|
|
538
|
+
local ____opt_1 = item.owner
|
|
539
|
+
local itemOwnerHandle = ____opt_1 and ____opt_1.handle
|
|
540
|
+
local cooldownRemaining = doAbilityActionForceDummy(itemHandle, itemOwnerHandle, getAbilityCooldown, self.typeId)
|
|
541
|
+
if cooldownRemaining == 0 then
|
|
542
|
+
startItemCooldown(itemHandle, itemOwnerHandle, 0.015625)
|
|
543
|
+
end
|
|
544
|
+
end
|
|
545
|
+
function ItemAbility.prototype.onDestroy(self)
|
|
546
|
+
if self.owner.state ~= 2 then
|
|
547
|
+
self.owner:removeAbility(self.typeId)
|
|
513
548
|
end
|
|
549
|
+
return ItemAbility.____super.prototype.onDestroy(self)
|
|
514
550
|
end
|
|
515
551
|
__TS__SetDescriptor(
|
|
516
552
|
ItemAbility.prototype,
|
|
@@ -526,17 +562,17 @@ __TS__SetDescriptor(
|
|
|
526
562
|
{
|
|
527
563
|
get = function(self)
|
|
528
564
|
local item = self.owner
|
|
529
|
-
local
|
|
530
|
-
local
|
|
531
|
-
local
|
|
532
|
-
return
|
|
565
|
+
local ____doAbilityActionForceDummy_6 = doAbilityActionForceDummy
|
|
566
|
+
local ____item_handle_5 = item.handle
|
|
567
|
+
local ____opt_3 = item.owner
|
|
568
|
+
return ____doAbilityActionForceDummy_6(____item_handle_5, ____opt_3 and ____opt_3.handle, getAbilityCooldown, self.typeId)
|
|
533
569
|
end,
|
|
534
570
|
set = function(self, cooldownRemaining)
|
|
535
571
|
local item = self.owner
|
|
536
|
-
local
|
|
537
|
-
local
|
|
538
|
-
local
|
|
539
|
-
|
|
572
|
+
local ____startItemCooldown_10 = startItemCooldown
|
|
573
|
+
local ____item_handle_9 = item.handle
|
|
574
|
+
local ____opt_7 = item.owner
|
|
575
|
+
____startItemCooldown_10(____item_handle_9, ____opt_7 and ____opt_7.handle, cooldownRemaining)
|
|
540
576
|
end
|
|
541
577
|
},
|
|
542
578
|
true
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
local ____lualib = require("lualib_bundle")
|
|
2
|
+
local __TS__ObjectDefineProperty = ____lualib.__TS__ObjectDefineProperty
|
|
3
|
+
local ____exports = {}
|
|
4
|
+
local ____item = require("engine.internal.item")
|
|
5
|
+
local Item = ____item.Item
|
|
6
|
+
local ____item = require("engine.standard.fields.item")
|
|
7
|
+
local CAN_BE_SOLD_TO_MERCHANTS_ITEM_FIELD = ____item.CAN_BE_SOLD_TO_MERCHANTS_ITEM_FIELD
|
|
8
|
+
local IS_ACTIVELY_USED_ITEM_FIELD = ____item.IS_ACTIVELY_USED_ITEM_FIELD
|
|
9
|
+
__TS__ObjectDefineProperty(
|
|
10
|
+
Item.prototype,
|
|
11
|
+
"canBeSold",
|
|
12
|
+
{
|
|
13
|
+
get = function(self)
|
|
14
|
+
return CAN_BE_SOLD_TO_MERCHANTS_ITEM_FIELD:getValue(self)
|
|
15
|
+
end,
|
|
16
|
+
set = function(self, value)
|
|
17
|
+
CAN_BE_SOLD_TO_MERCHANTS_ITEM_FIELD:setValue(self, value)
|
|
18
|
+
end
|
|
19
|
+
}
|
|
20
|
+
)
|
|
21
|
+
__TS__ObjectDefineProperty(
|
|
22
|
+
Item.prototype,
|
|
23
|
+
"isActivelyUsed",
|
|
24
|
+
{
|
|
25
|
+
get = function(self)
|
|
26
|
+
return IS_ACTIVELY_USED_ITEM_FIELD:getValue(self)
|
|
27
|
+
end,
|
|
28
|
+
set = function(self, value)
|
|
29
|
+
IS_ACTIVELY_USED_ITEM_FIELD:setValue(self, value)
|
|
30
|
+
end
|
|
31
|
+
}
|
|
32
|
+
)
|
|
33
|
+
return ____exports
|
|
@@ -5,13 +5,26 @@ local ____item = require("engine.internal.item")
|
|
|
5
5
|
local Item = ____item.Item
|
|
6
6
|
local ____unit = require("engine.internal.unit")
|
|
7
7
|
local Unit = ____unit.Unit
|
|
8
|
+
require("engine.internal.unit.equipment")
|
|
8
9
|
local ownerByItem = setmetatable({}, {__mode = "kv"})
|
|
9
|
-
Unit.itemPickedUpEvent:addListener(
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
10
|
+
Unit.itemPickedUpEvent:addListener(
|
|
11
|
+
4,
|
|
12
|
+
function(unit, item)
|
|
13
|
+
ownerByItem[item] = unit
|
|
14
|
+
end
|
|
15
|
+
)
|
|
16
|
+
Unit.itemEquippedEvent:addListener(
|
|
17
|
+
4,
|
|
18
|
+
function(unit, item)
|
|
19
|
+
ownerByItem[item] = unit
|
|
20
|
+
end
|
|
21
|
+
)
|
|
22
|
+
Unit.itemDroppedEvent:addListener(
|
|
23
|
+
4,
|
|
24
|
+
function(unit, item)
|
|
25
|
+
ownerByItem[item] = nil
|
|
26
|
+
end
|
|
27
|
+
)
|
|
15
28
|
__TS__ObjectDefineProperty(
|
|
16
29
|
Item.prototype,
|
|
17
30
|
"owner",
|
|
@@ -2,6 +2,9 @@
|
|
|
2
2
|
import { Handle, HandleDestructor } from "../../core/types/handle";
|
|
3
3
|
import { Color } from "../../core/types/color";
|
|
4
4
|
import { Event } from "../../event";
|
|
5
|
+
import { PlayerColor } from "../../core/types/playerColor";
|
|
6
|
+
import { EquipmentType } from "../object-data/auxiliary/equipment-type";
|
|
7
|
+
import { ItemTag } from "../object-data/auxiliary/item-tag";
|
|
5
8
|
import { ReadonlyRect } from "../../core/types/rect";
|
|
6
9
|
import { ItemAbility } from "./ability";
|
|
7
10
|
import { AbilityTypeId } from "../object-data/entry/ability-type";
|
|
@@ -9,14 +12,23 @@ import type { ItemTypeId } from "../object-data/entry/item-type";
|
|
|
9
12
|
type DefenseType = 0 | 1 | 2 | 3 | 4 | 5;
|
|
10
13
|
declare const enum ItemPropertyKey {
|
|
11
14
|
ABILITIES = 100,
|
|
12
|
-
|
|
15
|
+
DEATH_TRIGGER = 101,
|
|
16
|
+
COLOR = 102
|
|
13
17
|
}
|
|
14
18
|
export declare class Item extends Handle<jitem> {
|
|
15
19
|
private readonly [ItemPropertyKey.ABILITIES];
|
|
16
|
-
private readonly [ItemPropertyKey.
|
|
20
|
+
private readonly [ItemPropertyKey.DEATH_TRIGGER];
|
|
21
|
+
private [ItemPropertyKey.COLOR]?;
|
|
17
22
|
constructor(handle: jitem);
|
|
18
23
|
protected onDestroy(): HandleDestructor;
|
|
19
24
|
static create<T extends Item>(this: typeof Item & (new (handle: jitem) => T), id: number, x: number, y: number, skinId?: number): T;
|
|
25
|
+
get isEquipped(): boolean;
|
|
26
|
+
get isInBag(): boolean;
|
|
27
|
+
get equipmentType(): EquipmentType;
|
|
28
|
+
get tag(): ItemTag;
|
|
29
|
+
get color(): PlayerColor;
|
|
30
|
+
set color(color: PlayerColor);
|
|
31
|
+
static getRandomTypeId(level: number, equipmentType?: EquipmentType, tag?: ItemTag, itemType?: jitemtype): ItemTypeId | undefined;
|
|
20
32
|
get typeId(): ItemTypeId;
|
|
21
33
|
set skinId(v: number);
|
|
22
34
|
get skinId(): number;
|
|
@@ -30,22 +42,18 @@ export declare class Item extends Handle<jitem> {
|
|
|
30
42
|
get extendedTooltip(): string;
|
|
31
43
|
set iconPath(v: string);
|
|
32
44
|
get iconPath(): string;
|
|
33
|
-
set
|
|
34
|
-
get
|
|
35
|
-
set
|
|
36
|
-
get
|
|
37
|
-
set
|
|
38
|
-
get
|
|
39
|
-
set
|
|
40
|
-
get
|
|
41
|
-
set powerup(v: boolean);
|
|
42
|
-
get powerup(): boolean;
|
|
45
|
+
set dropsOnDeath(dropsOnDeath: boolean);
|
|
46
|
+
get dropsOnDeath(): boolean;
|
|
47
|
+
set canBeDropped(canBeDropped: boolean);
|
|
48
|
+
get canBeDropped(): boolean;
|
|
49
|
+
set perishes(perishes: boolean);
|
|
50
|
+
get perishes(): boolean;
|
|
51
|
+
set isPowerUp(isPowerUp: boolean);
|
|
52
|
+
get isPowerUp(): boolean;
|
|
43
53
|
get isAlive(): boolean;
|
|
44
54
|
get isDead(): boolean;
|
|
45
55
|
set isInvulnerable(isInvulnerable: boolean);
|
|
46
56
|
get isInvulnerable(): boolean;
|
|
47
|
-
set usable(v: boolean);
|
|
48
|
-
get usable(): boolean;
|
|
49
57
|
set visible(v: boolean);
|
|
50
58
|
get visible(): boolean;
|
|
51
59
|
set level(v: number);
|
|
@@ -84,6 +92,7 @@ export declare class Item extends Handle<jitem> {
|
|
|
84
92
|
static getInRect(rect: ReadonlyRect): Item[];
|
|
85
93
|
static get onCreate(): Event<[Item]>;
|
|
86
94
|
static get destroyEvent(): Event<[Item]>;
|
|
95
|
+
static readonly deathEvent: Event<[Item]>;
|
|
87
96
|
static readonly chargesChangedEvent: Event<[Item]>;
|
|
88
97
|
}
|
|
89
98
|
export {};
|