warscript 0.0.1-dev.671d3cf → 0.0.1-dev.685e1bc
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 +6 -0
- package/attributes.lua +17 -1
- package/config.d.ts +5 -0
- package/config.lua +10 -0
- package/core/types/effect.d.ts +14 -6
- package/core/types/effect.lua +131 -35
- package/core/types/frame.d.ts +4 -0
- package/core/types/frame.lua +142 -22
- package/core/types/item.d.ts +1 -0
- package/core/types/item.lua +1 -0
- package/core/types/player.d.ts +17 -1
- package/core/types/player.lua +70 -24
- package/core/types/playerCamera.d.ts +2 -0
- package/core/types/playerCamera.lua +123 -5
- package/core/types/sound.d.ts +17 -24
- package/core/types/sound.lua +100 -25
- package/core/types/tileCell.d.ts +11 -1
- package/core/types/tileCell.lua +97 -0
- package/core/types/timer.d.ts +9 -8
- package/core/types/timer.lua +45 -23
- package/core/util.d.ts +1 -1
- package/core/util.lua +18 -1
- package/decl/native.d.ts +846 -790
- package/destroyable.d.ts +1 -0
- package/destroyable.lua +9 -0
- package/engine/behavior.d.ts +16 -3
- package/engine/behavior.lua +233 -73
- 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 +8 -5
- package/engine/behaviour/ability/apply-buff.lua +36 -4
- package/engine/behaviour/ability/apply-unit-behavior.lua +1 -0
- package/engine/behaviour/ability/damage.d.ts +12 -3
- package/engine/behaviour/ability/damage.lua +33 -39
- package/engine/behaviour/ability/emulate-impact.d.ts +6 -0
- package/engine/behaviour/ability/emulate-impact.lua +44 -0
- package/engine/behaviour/ability/instant-impact.d.ts +2 -2
- package/engine/behaviour/ability/instant-impact.lua +4 -19
- package/engine/behaviour/ability/on-command-impact.d.ts +8 -0
- package/engine/behaviour/ability/on-command-impact.lua +25 -0
- package/engine/behaviour/ability/remove-buffs.d.ts +25 -0
- package/engine/behaviour/ability/remove-buffs.lua +49 -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 +28 -7
- package/engine/behaviour/ability.lua +137 -43
- package/engine/behaviour/unit/stun-immunity.d.ts +12 -6
- package/engine/behaviour/unit/stun-immunity.lua +57 -31
- package/engine/behaviour/unit.d.ts +45 -2
- package/engine/behaviour/unit.lua +289 -6
- package/engine/buff.d.ts +141 -55
- package/engine/buff.lua +638 -290
- package/engine/internal/ability.d.ts +23 -14
- package/engine/internal/ability.lua +129 -85
- package/engine/internal/item/ability.lua +162 -4
- package/engine/internal/item/fields.d.ts +12 -0
- package/engine/internal/item/fields.lua +33 -0
- package/engine/internal/item+owner.lua +12 -6
- package/engine/internal/item.d.ts +18 -18
- package/engine/internal/item.lua +208 -94
- package/engine/internal/mechanics/ability-duration.lua +1 -1
- package/engine/internal/mechanics/cast-ability.lua +6 -3
- 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/misc/frame-coordinates.d.ts +2 -0
- 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/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/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 +45 -1
- package/engine/internal/unit/ability.lua +128 -17
- 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/attributes.d.ts +17 -0
- package/engine/internal/unit/attributes.lua +46 -0
- package/engine/internal/unit/bonus.d.ts +12 -2
- package/engine/internal/unit/bonus.lua +56 -4
- package/engine/internal/unit/fly-height.d.ts +7 -0
- package/engine/internal/unit/fly-height.lua +20 -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/interrupts.d.ts +12 -0
- package/engine/internal/unit/interrupts.lua +28 -0
- package/engine/internal/unit/item.d.ts +24 -0
- package/engine/internal/unit/item.lua +78 -0
- package/engine/internal/unit/main-selected.d.ts +13 -0
- package/engine/internal/unit/main-selected.lua +36 -0
- package/engine/internal/unit/order.d.ts +20 -0
- package/engine/internal/unit/order.lua +136 -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 +12 -3
- package/engine/internal/unit+bonus.lua +3 -3
- 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 +70 -13
- package/engine/internal/unit.d.ts +64 -30
- package/engine/internal/unit.lua +490 -285
- package/engine/internal/utility.lua +12 -0
- package/engine/lightning.d.ts +12 -5
- package/engine/lightning.lua +48 -14
- package/engine/local-client.d.ts +14 -2
- package/engine/local-client.lua +168 -1
- 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/armor-type.d.ts +11 -0
- package/engine/object-data/auxiliary/armor-type.lua +46 -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/health-regeneration-type.d.ts +8 -0
- package/engine/object-data/auxiliary/health-regeneration-type.lua +2 -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/sound-preset-name.d.ts +5 -1
- 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/{armor-increase.d.ts → armor-bonus.d.ts} +3 -3
- package/engine/object-data/entry/ability-type/{armor-increase.lua → armor-bonus.lua} +9 -9
- 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/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/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-regeneration.d.ts +8 -0
- package/engine/object-data/entry/ability-type/mana-regeneration.lua +26 -0
- 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/reincarnation.d.ts +8 -0
- package/engine/object-data/entry/ability-type/reincarnation.lua +26 -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 +21 -17
- package/engine/object-data/entry/ability-type.lua +177 -40
- package/engine/object-data/entry/buff-type/applicable.lua +122 -137
- 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 +28 -2
- package/engine/object-data/entry/destructible-type.lua +155 -0
- package/engine/object-data/entry/item-type.d.ts +15 -1
- package/engine/object-data/entry/item-type.lua +93 -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 +25 -5
- package/engine/object-data/entry/unit-type.lua +258 -93
- 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 +28 -5
- package/engine/object-field/ability.lua +61 -7
- package/engine/object-field/item.d.ts +22 -0
- package/engine/object-field/item.lua +118 -0
- package/engine/object-field/unit.d.ts +72 -3
- package/engine/object-field/unit.lua +268 -7
- package/engine/object-field.d.ts +26 -7
- package/engine/object-field.lua +362 -117
- package/engine/random.d.ts +10 -0
- package/engine/random.lua +21 -0
- 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 +4 -2
- package/engine/standard/fields/ability.lua +4 -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 +12 -0
- package/engine/standard/fields/unit.lua +20 -0
- package/engine/synchronization.d.ts +11 -0
- package/engine/synchronization.lua +77 -0
- package/engine/text-tag.d.ts +36 -2
- package/engine/text-tag.lua +250 -10
- package/engine/unit.d.ts +9 -0
- package/engine/unit.lua +9 -0
- package/index.d.ts +1 -0
- package/index.lua +1 -0
- package/lualib_bundle.lua +1 -1
- package/math.d.ts +2 -0
- package/math.lua +14 -0
- package/net/socket.d.ts +7 -1
- package/net/socket.lua +45 -4
- package/network.d.ts +1 -0
- package/network.lua +3 -2
- package/objutil/buff.lua +12 -11
- package/objutil/object.lua +1 -1
- package/objutil/unit.lua +8 -0
- package/operation.lua +1 -4
- package/package.json +5 -5
- package/patch-lua.d.ts +0 -0
- package/patch-lua.lua +25 -0
- package/patch-lualib.lua +1 -1
- package/utility/arrays.d.ts +10 -1
- package/utility/arrays.lua +45 -3
- package/utility/callback-array.d.ts +17 -0
- package/utility/callback-array.lua +61 -0
- package/utility/functions.d.ts +8 -0
- package/utility/functions.lua +13 -0
- package/utility/lazy.d.ts +2 -0
- package/utility/lazy.lua +14 -0
- package/utility/linked-map.d.ts +35 -0
- package/utility/linked-map.lua +107 -0
- package/utility/linked-set.d.ts +16 -3
- package/utility/linked-set.lua +54 -3
- package/utility/lua-maps.d.ts +15 -2
- package/utility/lua-maps.lua +53 -2
- package/utility/lua-sets.d.ts +2 -0
- package/utility/lua-sets.lua +7 -0
- package/utility/records.lua +20 -1
- package/utility/reflection.lua +11 -7
- package/utility/types.d.ts +4 -0
- package/utility/unordered-map.d.ts +27 -0
- package/utility/unordered-map.lua +99 -0
- package/core/types/order.d.ts +0 -25
- package/core/types/order.lua +0 -55
- /package/engine/internal/{object-data/armor-increase.d.ts → misc/ability-disable-counter.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
|
@@ -5,19 +5,19 @@ 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
|
-
export declare const addAndGetAbility: (handle: jitem, abilityTypeId: AbilityTypeId) => jability | null;
|
|
10
10
|
declare const enum ItemPropertyKey {
|
|
11
11
|
ABILITIES = 100,
|
|
12
|
-
|
|
12
|
+
DEATH_TRIGGER = 101
|
|
13
13
|
}
|
|
14
14
|
export declare class Item extends Handle<jitem> {
|
|
15
15
|
private readonly [ItemPropertyKey.ABILITIES];
|
|
16
|
-
private readonly [ItemPropertyKey.
|
|
16
|
+
private readonly [ItemPropertyKey.DEATH_TRIGGER];
|
|
17
17
|
constructor(handle: jitem);
|
|
18
18
|
protected onDestroy(): HandleDestructor;
|
|
19
19
|
static create<T extends Item>(this: typeof Item & (new (handle: jitem) => T), id: number, x: number, y: number, skinId?: number): T;
|
|
20
|
-
get typeId():
|
|
20
|
+
get typeId(): ItemTypeId;
|
|
21
21
|
set skinId(v: number);
|
|
22
22
|
get skinId(): number;
|
|
23
23
|
set name(v: string);
|
|
@@ -30,22 +30,18 @@ export declare class Item extends Handle<jitem> {
|
|
|
30
30
|
get extendedTooltip(): string;
|
|
31
31
|
set iconPath(v: string);
|
|
32
32
|
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;
|
|
33
|
+
set dropsOnDeath(dropsOnDeath: boolean);
|
|
34
|
+
get dropsOnDeath(): boolean;
|
|
35
|
+
set canBeDropped(canBeDropped: boolean);
|
|
36
|
+
get canBeDropped(): boolean;
|
|
37
|
+
set perishes(perishes: boolean);
|
|
38
|
+
get perishes(): boolean;
|
|
39
|
+
set isPowerUp(isPowerUp: boolean);
|
|
40
|
+
get isPowerUp(): boolean;
|
|
43
41
|
get isAlive(): boolean;
|
|
44
42
|
get isDead(): boolean;
|
|
45
43
|
set isInvulnerable(isInvulnerable: boolean);
|
|
46
44
|
get isInvulnerable(): boolean;
|
|
47
|
-
set usable(v: boolean);
|
|
48
|
-
get usable(): boolean;
|
|
49
45
|
set visible(v: boolean);
|
|
50
46
|
get visible(): boolean;
|
|
51
47
|
set level(v: number);
|
|
@@ -73,14 +69,18 @@ export declare class Item extends Handle<jitem> {
|
|
|
73
69
|
set position(v: Vec2);
|
|
74
70
|
set charges(v: number);
|
|
75
71
|
get charges(): number;
|
|
72
|
+
consumeCharge(): boolean;
|
|
73
|
+
consumeCharges(count: number): boolean;
|
|
76
74
|
addAbility(abilityTypeId: AbilityTypeId): ItemAbility | undefined;
|
|
77
75
|
removeAbility(abilityTypeId: AbilityTypeId): boolean;
|
|
78
76
|
hasAbility(abilityTypeId: AbilityTypeId): boolean;
|
|
79
77
|
getAbility(abilityTypeId: AbilityTypeId): ItemAbility | undefined;
|
|
80
78
|
get abilities(): readonly ItemAbility[];
|
|
81
|
-
static getInRange(
|
|
79
|
+
static getInRange(x: number, y: number, range: number): Item[];
|
|
82
80
|
static getInRect(rect: ReadonlyRect): Item[];
|
|
83
81
|
static get onCreate(): Event<[Item]>;
|
|
84
|
-
static get
|
|
82
|
+
static get destroyEvent(): Event<[Item]>;
|
|
83
|
+
static readonly deathEvent: Event<[Item]>;
|
|
84
|
+
static readonly chargesChangedEvent: Event<[Item]>;
|
|
85
85
|
}
|
|
86
86
|
export {};
|
package/engine/internal/item.lua
CHANGED
|
@@ -1,20 +1,39 @@
|
|
|
1
1
|
local ____lualib = require("lualib_bundle")
|
|
2
|
+
local __TS__New = ____lualib.__TS__New
|
|
2
3
|
local __TS__Class = ____lualib.__TS__Class
|
|
3
4
|
local __TS__ClassExtends = ____lualib.__TS__ClassExtends
|
|
4
5
|
local __TS__SetDescriptor = ____lualib.__TS__SetDescriptor
|
|
5
6
|
local __TS__ObjectDefineProperty = ____lualib.__TS__ObjectDefineProperty
|
|
6
7
|
local __TS__Delete = ____lualib.__TS__Delete
|
|
7
8
|
local ____exports = {}
|
|
9
|
+
local invoke
|
|
8
10
|
local ____handle = require("core.types.handle")
|
|
9
11
|
local Handle = ____handle.Handle
|
|
10
12
|
local ____color = require("core.types.color")
|
|
11
13
|
local Color = ____color.Color
|
|
14
|
+
local ____event = require("event")
|
|
15
|
+
local Event = ____event.Event
|
|
12
16
|
local ____rect = require("core.types.rect")
|
|
13
17
|
local Rect = ____rect.Rect
|
|
14
18
|
local ____ability = require("engine.internal.ability")
|
|
15
19
|
local ItemAbility = ____ability.ItemAbility
|
|
16
20
|
local ____ability = require("engine.internal.item.ability")
|
|
17
21
|
local doAbilityAction = ____ability.doAbilityAction
|
|
22
|
+
local doAbilityActionForceDummy = ____ability.doAbilityActionForceDummy
|
|
23
|
+
local itemAbilityDummy = ____ability.itemAbilityDummy
|
|
24
|
+
local ____dummy_2Ditem = require("engine.internal.object-data.dummy-item")
|
|
25
|
+
local DUMMY_ITEM_ID = ____dummy_2Ditem.DUMMY_ITEM_ID
|
|
26
|
+
local ____add_2Ditem_2Dto_2Dslot = require("engine.internal.unit.add-item-to-slot")
|
|
27
|
+
local SLOT_FILLER_ITEM_TYPE_ID = ____add_2Ditem_2Dto_2Dslot.SLOT_FILLER_ITEM_TYPE_ID
|
|
28
|
+
local ____vec2 = require("math.vec2")
|
|
29
|
+
local distance = ____vec2.distance
|
|
30
|
+
local ____timer = require("core.types.timer")
|
|
31
|
+
local Timer = ____timer.Timer
|
|
32
|
+
local createTrigger = CreateTrigger
|
|
33
|
+
local triggerAddCondition = TriggerAddCondition
|
|
34
|
+
local triggerRegisterDeathEvent = TriggerRegisterDeathEvent
|
|
35
|
+
local condition = Condition
|
|
36
|
+
local destroyTrigger = DestroyTrigger
|
|
18
37
|
local itemAddAbility = BlzItemAddAbility
|
|
19
38
|
local itemRemoveAbility = BlzItemRemoveAbility
|
|
20
39
|
local getItemAbility = BlzGetItemAbility
|
|
@@ -24,10 +43,41 @@ local getAbilityId = BlzGetAbilityId
|
|
|
24
43
|
local getWidgetLife = GetWidgetLife
|
|
25
44
|
local removeItem = RemoveItem
|
|
26
45
|
local getHandleId = GetHandleId
|
|
46
|
+
local setRect = SetRect
|
|
47
|
+
local enumItemsInRect = EnumItemsInRect
|
|
48
|
+
local getEnumItem = GetEnumItem
|
|
49
|
+
local getItemTypeId = GetItemTypeId
|
|
50
|
+
local getItemX = GetItemX
|
|
51
|
+
local getItemY = GetItemY
|
|
52
|
+
local getItemCharges = GetItemCharges
|
|
53
|
+
local setItemCharges = SetItemCharges
|
|
54
|
+
local unitRemoveAbility = UnitRemoveAbility
|
|
55
|
+
local unitRemoveItem = UnitRemoveItem
|
|
56
|
+
local unitUseItem = UnitUseItem
|
|
57
|
+
local unitUseItemPoint = UnitUseItemPoint
|
|
58
|
+
local unitUseItemTarget = UnitUseItemTarget
|
|
59
|
+
local setItemDropOnDeath = SetItemDropOnDeath
|
|
60
|
+
local setItemDroppable = SetItemDroppable
|
|
27
61
|
local getItemIntegerField = BlzGetItemIntegerField
|
|
28
62
|
local setItemBooleanField = BlzSetItemBooleanField
|
|
29
63
|
local getItemBooleanField = BlzGetItemBooleanField
|
|
64
|
+
local getTriggerWidget = GetTriggerWidget
|
|
65
|
+
local saveWidgetHandle = SaveWidgetHandle
|
|
66
|
+
local loadItemHandle = LoadItemHandle
|
|
67
|
+
local tableRemove = table.remove
|
|
68
|
+
local itemChargesChangeEvent = __TS__New(Event)
|
|
69
|
+
local itemDeathEvent = __TS__New(Event)
|
|
70
|
+
_G.SetItemCharges = function(whichItem, charges)
|
|
71
|
+
setItemCharges(whichItem, charges)
|
|
72
|
+
invoke(
|
|
73
|
+
itemChargesChangeEvent,
|
|
74
|
+
____exports.Item:of(whichItem)
|
|
75
|
+
)
|
|
76
|
+
end
|
|
77
|
+
invoke = Event.invoke
|
|
30
78
|
local enumRect = Rect:create(0, 0, 0, 0).handle
|
|
79
|
+
---
|
|
80
|
+
-- @internal For use by internal systems only.
|
|
31
81
|
____exports.addAndGetAbility = function(handle, abilityTypeId)
|
|
32
82
|
if itemAddAbility(handle, abilityTypeId) then
|
|
33
83
|
return getItemAbility(handle, abilityTypeId)
|
|
@@ -53,92 +103,179 @@ local function getItemAbilities(handle, item)
|
|
|
53
103
|
end
|
|
54
104
|
return abilities
|
|
55
105
|
end
|
|
106
|
+
local function consumeCharge(handle)
|
|
107
|
+
do
|
|
108
|
+
local i = 0
|
|
109
|
+
local ability = getItemAbilityByIndex(handle, i)
|
|
110
|
+
while ability ~= nil do
|
|
111
|
+
unitRemoveAbility(
|
|
112
|
+
itemAbilityDummy,
|
|
113
|
+
getAbilityId(ability)
|
|
114
|
+
)
|
|
115
|
+
do
|
|
116
|
+
i = i + 1
|
|
117
|
+
ability = getItemAbilityByIndex(handle, i)
|
|
118
|
+
end
|
|
119
|
+
end
|
|
120
|
+
end
|
|
121
|
+
return unitUseItem(itemAbilityDummy, handle) or unitUseItemPoint(itemAbilityDummy, handle, 0, 0) or unitUseItemTarget(itemAbilityDummy, handle, itemAbilityDummy)
|
|
122
|
+
end
|
|
123
|
+
local targetCollection
|
|
124
|
+
local targetCollectionNextIndex
|
|
125
|
+
local centerX
|
|
126
|
+
local centerY
|
|
127
|
+
local enumRange
|
|
128
|
+
local function collectIntoTarget()
|
|
129
|
+
local item = getEnumItem()
|
|
130
|
+
local typeId = getItemTypeId(item)
|
|
131
|
+
if typeId ~= DUMMY_ITEM_ID and typeId ~= SLOT_FILLER_ITEM_TYPE_ID then
|
|
132
|
+
targetCollection[targetCollectionNextIndex] = ____exports.Item:of(item)
|
|
133
|
+
targetCollectionNextIndex = targetCollectionNextIndex + 1
|
|
134
|
+
end
|
|
135
|
+
end
|
|
136
|
+
local function collectIntoTargetRange()
|
|
137
|
+
local item = getEnumItem()
|
|
138
|
+
local typeId = getItemTypeId(item)
|
|
139
|
+
if distance(
|
|
140
|
+
getItemX(item),
|
|
141
|
+
getItemY(item),
|
|
142
|
+
centerX,
|
|
143
|
+
centerY
|
|
144
|
+
) <= enumRange and typeId ~= DUMMY_ITEM_ID and typeId ~= SLOT_FILLER_ITEM_TYPE_ID then
|
|
145
|
+
targetCollection[targetCollectionNextIndex] = ____exports.Item:of(item)
|
|
146
|
+
targetCollectionNextIndex = targetCollectionNextIndex + 1
|
|
147
|
+
end
|
|
148
|
+
end
|
|
149
|
+
local hashtable = InitHashtable()
|
|
150
|
+
local deathTriggerCondition = condition(function()
|
|
151
|
+
saveWidgetHandle(
|
|
152
|
+
hashtable,
|
|
153
|
+
1,
|
|
154
|
+
1,
|
|
155
|
+
getTriggerWidget()
|
|
156
|
+
)
|
|
157
|
+
local item = ____exports.Item:of(loadItemHandle(hashtable, 1, 1))
|
|
158
|
+
if item ~= nil then
|
|
159
|
+
invoke(itemDeathEvent, item)
|
|
160
|
+
end
|
|
161
|
+
end)
|
|
162
|
+
itemDeathEvent:addListener(
|
|
163
|
+
999999,
|
|
164
|
+
function(item)
|
|
165
|
+
Timer:run(item, "destroy")
|
|
166
|
+
end
|
|
167
|
+
)
|
|
56
168
|
____exports.Item = __TS__Class()
|
|
57
169
|
local Item = ____exports.Item
|
|
58
170
|
Item.name = "Item"
|
|
59
171
|
__TS__ClassExtends(Item, Handle)
|
|
60
172
|
function Item.prototype.____constructor(self, handle)
|
|
61
173
|
Handle.prototype.____constructor(self, handle)
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
end
|
|
68
|
-
self[101] = luaIndexByAbilityTypeId
|
|
174
|
+
self[100] = doAbilityAction(handle, getItemAbilities, self)
|
|
175
|
+
local deathTrigger = createTrigger()
|
|
176
|
+
triggerRegisterDeathEvent(deathTrigger, handle)
|
|
177
|
+
triggerAddCondition(deathTrigger, deathTriggerCondition)
|
|
178
|
+
self[101] = deathTrigger
|
|
69
179
|
end
|
|
70
180
|
function Item.prototype.onDestroy(self)
|
|
181
|
+
local owner = self.owner
|
|
182
|
+
if owner ~= nil then
|
|
183
|
+
unitRemoveItem(owner.handle, self.handle)
|
|
184
|
+
end
|
|
71
185
|
local abilities = self[100]
|
|
72
186
|
for i = 1, #abilities do
|
|
73
187
|
abilities[i]:destroy()
|
|
74
188
|
end
|
|
75
189
|
removeItem(self.handle)
|
|
190
|
+
destroyTrigger(self[101])
|
|
76
191
|
return Handle.prototype.onDestroy(self)
|
|
77
192
|
end
|
|
78
193
|
function Item.create(self, id, x, y, skinId)
|
|
79
194
|
return self:of(BlzCreateItemWithSkin(id, x, y, skinId or id))
|
|
80
195
|
end
|
|
196
|
+
function Item.prototype.consumeCharge(self)
|
|
197
|
+
return self:consumeCharges(1)
|
|
198
|
+
end
|
|
199
|
+
function Item.prototype.consumeCharges(self, count)
|
|
200
|
+
local handle = self.handle
|
|
201
|
+
local charges = getItemCharges(handle)
|
|
202
|
+
if charges > count then
|
|
203
|
+
setItemCharges(handle, charges - count)
|
|
204
|
+
invoke(itemChargesChangeEvent, self)
|
|
205
|
+
return true
|
|
206
|
+
end
|
|
207
|
+
if charges == count then
|
|
208
|
+
if getItemBooleanField(handle, ITEM_BF_PERISHABLE) then
|
|
209
|
+
self:destroy()
|
|
210
|
+
return true
|
|
211
|
+
end
|
|
212
|
+
if not getItemBooleanField(handle, ITEM_BF_ACTIVELY_USED) then
|
|
213
|
+
setItemCharges(handle, 0)
|
|
214
|
+
invoke(itemChargesChangeEvent, self)
|
|
215
|
+
return true
|
|
216
|
+
end
|
|
217
|
+
setItemCharges(handle, 1)
|
|
218
|
+
local ____doAbilityActionForceDummy_2 = doAbilityActionForceDummy
|
|
219
|
+
local ____opt_0 = self.owner
|
|
220
|
+
____doAbilityActionForceDummy_2(handle, ____opt_0 and ____opt_0.handle, consumeCharge)
|
|
221
|
+
invoke(itemChargesChangeEvent, self)
|
|
222
|
+
return true
|
|
223
|
+
end
|
|
224
|
+
return false
|
|
225
|
+
end
|
|
81
226
|
function Item.prototype.addAbility(self, abilityTypeId)
|
|
82
227
|
local nativeAbility = doAbilityAction(self.handle, ____exports.addAndGetAbility, abilityTypeId)
|
|
83
228
|
if nativeAbility ~= nil then
|
|
84
229
|
local ability = ItemAbility:of(nativeAbility, abilityTypeId, self)
|
|
85
230
|
local abilities = self[100]
|
|
86
|
-
|
|
87
|
-
abilities[luaIndex] = ability
|
|
88
|
-
self[101][abilityTypeId] = luaIndex
|
|
231
|
+
abilities[#abilities + 1] = ability
|
|
89
232
|
return ability
|
|
90
233
|
end
|
|
91
234
|
return nil
|
|
92
235
|
end
|
|
93
236
|
function Item.prototype.removeAbility(self, abilityTypeId)
|
|
94
|
-
local
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
for j = luaIndex, abilityTypeIdsLength do
|
|
102
|
-
abilities[j] = abilities[j + 1]
|
|
237
|
+
local abilities = self[100]
|
|
238
|
+
for i = 1, #abilities do
|
|
239
|
+
if abilities[i].typeId == abilityTypeId then
|
|
240
|
+
local ability = abilities[i]
|
|
241
|
+
tableRemove(abilities, i)
|
|
242
|
+
ability:destroy()
|
|
243
|
+
return true
|
|
103
244
|
end
|
|
104
245
|
end
|
|
105
|
-
return
|
|
246
|
+
return doAbilityAction(self.handle, itemRemoveAbility, abilityTypeId)
|
|
106
247
|
end
|
|
107
248
|
function Item.prototype.hasAbility(self, abilityTypeId)
|
|
108
|
-
return self
|
|
249
|
+
return doAbilityAction(self.handle, getItemAbility, abilityTypeId) ~= nil
|
|
109
250
|
end
|
|
110
251
|
function Item.prototype.getAbility(self, abilityTypeId)
|
|
111
|
-
|
|
112
|
-
|
|
252
|
+
return ItemAbility:of(
|
|
253
|
+
doAbilityAction(self.handle, getItemAbility, abilityTypeId),
|
|
254
|
+
abilityTypeId,
|
|
255
|
+
self
|
|
256
|
+
)
|
|
113
257
|
end
|
|
114
|
-
function Item.getInRange(self,
|
|
115
|
-
|
|
116
|
-
|
|
258
|
+
function Item.getInRange(self, x, y, range)
|
|
259
|
+
targetCollection = {}
|
|
260
|
+
targetCollectionNextIndex = 1
|
|
261
|
+
centerX = x
|
|
262
|
+
centerY = y
|
|
263
|
+
enumRange = range
|
|
264
|
+
setRect(
|
|
117
265
|
enumRect,
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
266
|
+
x - range,
|
|
267
|
+
y - range,
|
|
268
|
+
x + range,
|
|
269
|
+
y + range
|
|
122
270
|
)
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
nil,
|
|
126
|
-
function()
|
|
127
|
-
collection[#collection + 1] = self:of(GetEnumItem())
|
|
128
|
-
end
|
|
129
|
-
)
|
|
130
|
-
return collection
|
|
271
|
+
enumItemsInRect(enumRect, nil, collectIntoTargetRange)
|
|
272
|
+
return targetCollection
|
|
131
273
|
end
|
|
132
274
|
function Item.getInRect(self, rect)
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
function()
|
|
138
|
-
collection[#collection + 1] = self:of(GetEnumItem())
|
|
139
|
-
end
|
|
140
|
-
)
|
|
141
|
-
return collection
|
|
275
|
+
targetCollection = {}
|
|
276
|
+
targetCollectionNextIndex = 1
|
|
277
|
+
enumItemsInRect(rect.handle, nil, collectIntoTarget)
|
|
278
|
+
return targetCollection
|
|
142
279
|
end
|
|
143
280
|
__TS__SetDescriptor(
|
|
144
281
|
Item.prototype,
|
|
@@ -228,65 +365,55 @@ __TS__SetDescriptor(
|
|
|
228
365
|
)
|
|
229
366
|
__TS__SetDescriptor(
|
|
230
367
|
Item.prototype,
|
|
231
|
-
"
|
|
232
|
-
{
|
|
233
|
-
get = function(self)
|
|
234
|
-
return BlzGetItemBooleanField(self.handle, ITEM_BF_DROPPED_WHEN_CARRIER_DIES)
|
|
235
|
-
end,
|
|
236
|
-
set = function(self, v)
|
|
237
|
-
SetItemDropOnDeath(self.handle, v)
|
|
238
|
-
end
|
|
239
|
-
},
|
|
240
|
-
true
|
|
241
|
-
)
|
|
242
|
-
__TS__SetDescriptor(
|
|
243
|
-
Item.prototype,
|
|
244
|
-
"droppable",
|
|
368
|
+
"dropsOnDeath",
|
|
245
369
|
{
|
|
246
370
|
get = function(self)
|
|
247
|
-
return
|
|
371
|
+
return getItemBooleanField(self.handle, ITEM_BF_DROPPED_WHEN_CARRIER_DIES)
|
|
248
372
|
end,
|
|
249
|
-
set = function(self,
|
|
250
|
-
|
|
373
|
+
set = function(self, dropsOnDeath)
|
|
374
|
+
setItemDropOnDeath(self.handle, dropsOnDeath)
|
|
251
375
|
end
|
|
252
376
|
},
|
|
253
377
|
true
|
|
254
378
|
)
|
|
255
379
|
__TS__SetDescriptor(
|
|
256
380
|
Item.prototype,
|
|
257
|
-
"
|
|
381
|
+
"canBeDropped",
|
|
258
382
|
{
|
|
259
383
|
get = function(self)
|
|
260
|
-
return
|
|
384
|
+
return getItemBooleanField(self.handle, ITEM_BF_CAN_BE_DROPPED)
|
|
261
385
|
end,
|
|
262
|
-
set = function(self,
|
|
263
|
-
|
|
386
|
+
set = function(self, canBeDropped)
|
|
387
|
+
setItemDroppable(self.handle, canBeDropped)
|
|
264
388
|
end
|
|
265
389
|
},
|
|
266
390
|
true
|
|
267
391
|
)
|
|
268
392
|
__TS__SetDescriptor(
|
|
269
393
|
Item.prototype,
|
|
270
|
-
"
|
|
394
|
+
"perishes",
|
|
271
395
|
{
|
|
272
396
|
get = function(self)
|
|
273
|
-
return
|
|
397
|
+
return getItemBooleanField(self.handle, ITEM_BF_PERISHABLE)
|
|
274
398
|
end,
|
|
275
|
-
set = function(self,
|
|
276
|
-
|
|
399
|
+
set = function(self, perishes)
|
|
400
|
+
local handle = self.handle
|
|
401
|
+
local powerUp = isItemPowerup(handle)
|
|
402
|
+
setItemBooleanField(handle, ITEM_BF_PERISHABLE, perishes)
|
|
403
|
+
setItemBooleanField(handle, ITEM_BF_USE_AUTOMATICALLY_WHEN_ACQUIRED, powerUp)
|
|
277
404
|
end
|
|
278
405
|
},
|
|
279
406
|
true
|
|
280
407
|
)
|
|
281
408
|
__TS__SetDescriptor(
|
|
282
409
|
Item.prototype,
|
|
283
|
-
"
|
|
410
|
+
"isPowerUp",
|
|
284
411
|
{
|
|
285
412
|
get = function(self)
|
|
286
413
|
return isItemPowerup(self.handle)
|
|
287
414
|
end,
|
|
288
|
-
set = function(self,
|
|
289
|
-
setItemBooleanField(self.handle, ITEM_BF_USE_AUTOMATICALLY_WHEN_ACQUIRED,
|
|
415
|
+
set = function(self, isPowerUp)
|
|
416
|
+
setItemBooleanField(self.handle, ITEM_BF_USE_AUTOMATICALLY_WHEN_ACQUIRED, isPowerUp)
|
|
290
417
|
end
|
|
291
418
|
},
|
|
292
419
|
true
|
|
@@ -320,22 +447,6 @@ __TS__SetDescriptor(
|
|
|
320
447
|
},
|
|
321
448
|
true
|
|
322
449
|
)
|
|
323
|
-
__TS__SetDescriptor(
|
|
324
|
-
Item.prototype,
|
|
325
|
-
"usable",
|
|
326
|
-
{
|
|
327
|
-
get = function(self)
|
|
328
|
-
return getItemBooleanField(self.handle, ITEM_BF_ACTIVELY_USED)
|
|
329
|
-
end,
|
|
330
|
-
set = function(self, v)
|
|
331
|
-
local handle = self.handle
|
|
332
|
-
local powerup = isItemPowerup(handle)
|
|
333
|
-
setItemBooleanField(handle, ITEM_BF_ACTIVELY_USED, v)
|
|
334
|
-
setItemBooleanField(handle, ITEM_BF_USE_AUTOMATICALLY_WHEN_ACQUIRED, powerup)
|
|
335
|
-
end
|
|
336
|
-
},
|
|
337
|
-
true
|
|
338
|
-
)
|
|
339
450
|
__TS__SetDescriptor(
|
|
340
451
|
Item.prototype,
|
|
341
452
|
"visible",
|
|
@@ -526,10 +637,11 @@ __TS__SetDescriptor(
|
|
|
526
637
|
"charges",
|
|
527
638
|
{
|
|
528
639
|
get = function(self)
|
|
529
|
-
return
|
|
640
|
+
return getItemCharges(self.handle)
|
|
530
641
|
end,
|
|
531
642
|
set = function(self, v)
|
|
532
|
-
|
|
643
|
+
setItemCharges(self.handle, v)
|
|
644
|
+
invoke(itemChargesChangeEvent, self)
|
|
533
645
|
end
|
|
534
646
|
},
|
|
535
647
|
true
|
|
@@ -551,11 +663,13 @@ __TS__ObjectDefineProperty(
|
|
|
551
663
|
)
|
|
552
664
|
__TS__ObjectDefineProperty(
|
|
553
665
|
Item,
|
|
554
|
-
"
|
|
666
|
+
"destroyEvent",
|
|
555
667
|
{get = function(self)
|
|
556
668
|
return self.onDestroyEvent
|
|
557
669
|
end}
|
|
558
670
|
)
|
|
671
|
+
Item.deathEvent = itemDeathEvent
|
|
672
|
+
Item.chargesChangedEvent = itemChargesChangeEvent
|
|
559
673
|
local getManipulatedItem = GetManipulatedItem
|
|
560
674
|
local trigger = CreateTrigger()
|
|
561
675
|
TriggerRegisterAnyUnitEventBJ(trigger, EVENT_PLAYER_UNIT_PICKUP_ITEM)
|
|
@@ -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
|
|
@@ -74,9 +74,12 @@ ____exports.castAbility = function(nativeUnit, abilityTypeId, prepareAbility, ..
|
|
|
74
74
|
unitRemoveAbility(nativeUnit, INVENTORY_ABILITY_TYPE_ID)
|
|
75
75
|
if latestInventoryAbilityTypeId ~= 0 then
|
|
76
76
|
unitAddAbility(nativeUnit, latestInventoryAbilityTypeId)
|
|
77
|
-
for slot,
|
|
78
|
-
|
|
79
|
-
|
|
77
|
+
for slot = 0, inventorySize - 1 do
|
|
78
|
+
local nativeItem = nativeItemBySlot[slot]
|
|
79
|
+
if nativeItem ~= nil then
|
|
80
|
+
unitAddItem(nativeUnit, nativeItem)
|
|
81
|
+
unitDropItemSlot(nativeUnit, nativeItem, slot)
|
|
82
|
+
end
|
|
80
83
|
end
|
|
81
84
|
end
|
|
82
85
|
end
|
|
@@ -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
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
local ____exports = {}
|
|
2
|
+
local getLocalClientWidth = BlzGetLocalClientWidth
|
|
3
|
+
local getLocalClientHeight = BlzGetLocalClientHeight
|
|
4
|
+
---
|
|
5
|
+
-- @internal For use by internal systems only.
|
|
6
|
+
____exports.getFrameMinXMaxX = function()
|
|
7
|
+
local w = getLocalClientWidth()
|
|
8
|
+
local h = getLocalClientHeight()
|
|
9
|
+
local width4by3 = (w - h / 600 * 800) / 2
|
|
10
|
+
local pxtodpi = 0.6 / h
|
|
11
|
+
local minX = -width4by3 * pxtodpi
|
|
12
|
+
local maxX = minX + w * pxtodpi
|
|
13
|
+
return minX, maxX
|
|
14
|
+
end
|
|
15
|
+
---
|
|
16
|
+
-- @internal For use by internal systems only.
|
|
17
|
+
____exports.FRAME_MIN_Y = 0
|
|
18
|
+
---
|
|
19
|
+
-- @internal For use by internal systems only.
|
|
20
|
+
____exports.FRAME_MAX_Y = 0.6
|
|
21
|
+
return ____exports
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
local ____exports = {}
|
|
2
|
+
local getLocationZ = GetLocationZ
|
|
3
|
+
local moveLocation = MoveLocation
|
|
4
|
+
local location = Location(0, 0)
|
|
5
|
+
---
|
|
6
|
+
-- @internal For use by internal systems only.
|
|
7
|
+
____exports.getTerrainZ = function(x, y)
|
|
8
|
+
moveLocation(location, x, y)
|
|
9
|
+
return getLocationZ(location)
|
|
10
|
+
end
|
|
11
|
+
return ____exports
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
local ____exports = {}
|
|
2
|
-
local
|
|
3
|
-
local AttributeBonusAbilityType =
|
|
2
|
+
local ____attribute_2Dbonus = require("engine.object-data.entry.ability-type.attribute-bonus")
|
|
3
|
+
local AttributeBonusAbilityType = ____attribute_2Dbonus.AttributeBonusAbilityType
|
|
4
4
|
---
|
|
5
5
|
-- @internal For use by internal systems.
|
|
6
6
|
____exports.ATTRIBUTE_BONUS_DUMMY_ABILITY_TYPE_ID = compiletime(function()
|
|
@@ -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
|