warscript 0.0.1-dev.fd21394 → 0.0.1-dev.ff2a62d
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/binaryreader.d.ts +1 -0
- package/binaryreader.lua +3 -0
- package/core/types/frame.d.ts +2 -0
- package/core/types/frame.lua +2 -0
- package/engine/behaviour/ability/damage.d.ts +33 -11
- package/engine/behaviour/ability/damage.lua +89 -31
- package/engine/behaviour/ability/heal.d.ts +33 -6
- package/engine/behaviour/ability/heal.lua +89 -10
- package/engine/behaviour/ability/restore-mana.d.ts +15 -0
- package/engine/behaviour/ability/restore-mana.lua +29 -0
- package/engine/buff.d.ts +34 -13
- package/engine/buff.lua +154 -58
- package/engine/game-map.d.ts +7 -0
- package/engine/game-map.lua +32 -0
- package/engine/internal/unit+transport.lua +4 -10
- package/lualib_bundle.lua +7 -2
- package/package.json +2 -2
- package/property.d.ts +55 -0
- package/property.lua +374 -0
- package/core/mapbounds.d.ts +0 -8
- package/core/mapbounds.lua +0 -12
package/binaryreader.d.ts
CHANGED
package/binaryreader.lua
CHANGED
|
@@ -9,6 +9,9 @@ function BinaryReader.prototype.____constructor(self, data)
|
|
|
9
9
|
self.i = 1
|
|
10
10
|
self.s = data
|
|
11
11
|
end
|
|
12
|
+
function BinaryReader.prototype.__tostring(self)
|
|
13
|
+
return self.s
|
|
14
|
+
end
|
|
12
15
|
function BinaryReader.prototype.read(self, fmt)
|
|
13
16
|
local value, pos = ____unpack(">" .. fmt, self.s, self.i)
|
|
14
17
|
self.i = pos
|
package/core/types/frame.d.ts
CHANGED
|
@@ -25,6 +25,8 @@ export declare class Frame extends Handle<jframehandle> {
|
|
|
25
25
|
static readonly GAME_UI: Frame;
|
|
26
26
|
static readonly CONSOLE_UI: Frame;
|
|
27
27
|
static readonly CONSOLE_UI_BACKDROP: Frame;
|
|
28
|
+
static readonly CONSOLE_TOP_BAR: Frame;
|
|
29
|
+
static readonly CONSOLE_BOTTOM_BAR: Frame;
|
|
28
30
|
static readonly WORLD: Frame;
|
|
29
31
|
static readonly CHAT: Frame;
|
|
30
32
|
static readonly TIME_OF_DAY_CLOCK: Frame;
|
package/core/types/frame.lua
CHANGED
|
@@ -293,6 +293,8 @@ end
|
|
|
293
293
|
Frame.GAME_UI = ____exports.Frame:byOrigin(ORIGIN_FRAME_GAME_UI)
|
|
294
294
|
Frame.CONSOLE_UI = ____exports.Frame:byOrigin(ORIGIN_FRAME_SIMPLE_UI_PARENT)
|
|
295
295
|
Frame.CONSOLE_UI_BACKDROP = ____exports.Frame:byName("ConsoleUIBackdrop")
|
|
296
|
+
Frame.CONSOLE_TOP_BAR = ____exports.Frame:byName("ConsoleTopBar")
|
|
297
|
+
Frame.CONSOLE_BOTTOM_BAR = ____exports.Frame:byName("ConsoleBottomBar")
|
|
296
298
|
Frame.WORLD = ____exports.Frame:byOrigin(ORIGIN_FRAME_WORLD_FRAME)
|
|
297
299
|
Frame.CHAT = ____exports.Frame:byOrigin(ORIGIN_FRAME_CHAT_MSG)
|
|
298
300
|
Frame.TIME_OF_DAY_CLOCK = ____exports.Frame.GAME_UI:getChild(5):getChild(0)
|
|
@@ -4,22 +4,44 @@ import { Ability } from "../../internal/ability";
|
|
|
4
4
|
import { Unit } from "../../internal/unit";
|
|
5
5
|
import { AbilityDependentValue } from "../../object-field/ability";
|
|
6
6
|
import { Widget } from "../../../core/types/widget";
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
import { AttackType, DamageType, WeaponType } from "../../internal/unit+damage";
|
|
8
|
+
export type DamageAbilityBehaviorParameters = {
|
|
9
|
+
damagePerStrength?: AbilityDependentValue<number>;
|
|
10
|
+
damagePerAgility?: AbilityDependentValue<number>;
|
|
11
|
+
damagePerIntelligence?: AbilityDependentValue<number>;
|
|
12
|
+
attackType?: AttackType;
|
|
13
|
+
damageType?: DamageType;
|
|
14
|
+
weaponType?: WeaponType;
|
|
15
|
+
};
|
|
16
|
+
export type DamageAreaAbilityBehaviorParameters = DamageAbilityBehaviorParameters & {
|
|
17
|
+
maximumDamage?: AbilityDependentValue<number>;
|
|
18
|
+
};
|
|
19
|
+
declare abstract class DamageAbilityBehavior<T extends DamageAbilityBehaviorParameters = DamageAbilityBehaviorParameters> extends AbilityBehavior {
|
|
20
|
+
protected readonly damage: AbilityDependentValue<number>;
|
|
21
|
+
protected readonly parameters?: T | undefined;
|
|
22
|
+
protected constructor(ability: Ability, damage: AbilityDependentValue<number>, parameters?: T | undefined);
|
|
23
|
+
protected calculateDamage(caster: Unit): number;
|
|
24
|
+
}
|
|
25
|
+
export declare class DamageSelfAbilityBehavior extends DamageAbilityBehavior {
|
|
26
|
+
constructor(ability: Ability, damage: AbilityDependentValue<number>, parameters?: DamageAbilityBehaviorParameters);
|
|
10
27
|
onImpact(caster: Unit): void;
|
|
11
28
|
}
|
|
12
|
-
export declare class DamageTargetAbilityBehavior extends
|
|
13
|
-
|
|
14
|
-
constructor(ability: Ability, damage: AbilityDependentValue<number>);
|
|
29
|
+
export declare class DamageTargetAbilityBehavior extends DamageAbilityBehavior {
|
|
30
|
+
constructor(ability: Ability, damage: AbilityDependentValue<number>, parameters?: DamageAbilityBehaviorParameters);
|
|
15
31
|
onWidgetTargetImpact(caster: Unit, target: Widget): void;
|
|
16
32
|
}
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
33
|
+
declare abstract class DamageAreaAbilityBehavior extends DamageAbilityBehavior<DamageAreaAbilityBehaviorParameters> {
|
|
34
|
+
protected constructor(ability: Ability, damage: AbilityDependentValue<number>, parameters?: DamageAreaAbilityBehaviorParameters);
|
|
35
|
+
protected damageArea(caster: Unit, x: number, y: number): void;
|
|
36
|
+
}
|
|
37
|
+
export declare class DamageSelfAreaAbilityBehavior extends DamageAreaAbilityBehavior {
|
|
38
|
+
constructor(ability: Ability, damage: AbilityDependentValue<number>, parameters?: DamageAreaAbilityBehaviorParameters);
|
|
39
|
+
onImpact(caster: Unit): void;
|
|
40
|
+
}
|
|
41
|
+
export declare class DamageTargetAreaAbilityBehavior extends DamageAreaAbilityBehavior {
|
|
42
|
+
constructor(ability: Ability, damage: AbilityDependentValue<number>, parameters?: DamageAreaAbilityBehaviorParameters);
|
|
21
43
|
onNoTargetImpact(caster: Unit): void;
|
|
22
44
|
onWidgetTargetImpact(caster: Unit, target: Widget): void;
|
|
23
45
|
onPointTargetImpact(caster: Unit, x: number, y: number): void;
|
|
24
|
-
private damageArea;
|
|
25
46
|
}
|
|
47
|
+
export {};
|
|
@@ -9,53 +9,77 @@ local Unit = ____unit.Unit
|
|
|
9
9
|
local ____ability = require("engine.standard.fields.ability")
|
|
10
10
|
local ALLOWED_TARGETS_ABILITY_COMBAT_CLASSIFICATIONS_LEVEL_FIELD = ____ability.ALLOWED_TARGETS_ABILITY_COMBAT_CLASSIFICATIONS_LEVEL_FIELD
|
|
11
11
|
local AREA_OF_EFFECT_ABILITY_FLOAT_LEVEL_FIELD = ____ability.AREA_OF_EFFECT_ABILITY_FLOAT_LEVEL_FIELD
|
|
12
|
+
local DamageAbilityBehavior = __TS__Class()
|
|
13
|
+
DamageAbilityBehavior.name = "DamageAbilityBehavior"
|
|
14
|
+
__TS__ClassExtends(DamageAbilityBehavior, AbilityBehavior)
|
|
15
|
+
function DamageAbilityBehavior.prototype.____constructor(self, ability, damage, parameters)
|
|
16
|
+
AbilityBehavior.prototype.____constructor(self, ability)
|
|
17
|
+
self.damage = damage
|
|
18
|
+
self.parameters = parameters
|
|
19
|
+
end
|
|
20
|
+
function DamageAbilityBehavior.prototype.calculateDamage(self, caster)
|
|
21
|
+
local parameters = self.parameters
|
|
22
|
+
local damage = self:resolveCurrentAbilityDependentValue(self.damage)
|
|
23
|
+
local damagePerStrength = self:resolveCurrentAbilityDependentValue(parameters and parameters.damagePerStrength or 0)
|
|
24
|
+
if damagePerStrength ~= 0 then
|
|
25
|
+
damage = damage + damagePerStrength * caster.strength
|
|
26
|
+
end
|
|
27
|
+
local damagePerAgility = self:resolveCurrentAbilityDependentValue(parameters and parameters.damagePerAgility or 0)
|
|
28
|
+
if damagePerAgility ~= 0 then
|
|
29
|
+
damage = damage + damagePerAgility * caster.agility
|
|
30
|
+
end
|
|
31
|
+
local damagePerIntelligence = self:resolveCurrentAbilityDependentValue(parameters and parameters.damagePerIntelligence or 0)
|
|
32
|
+
if damagePerIntelligence ~= 0 then
|
|
33
|
+
damage = damage + damagePerIntelligence * caster.intelligence
|
|
34
|
+
end
|
|
35
|
+
return damage
|
|
36
|
+
end
|
|
12
37
|
____exports.DamageSelfAbilityBehavior = __TS__Class()
|
|
13
38
|
local DamageSelfAbilityBehavior = ____exports.DamageSelfAbilityBehavior
|
|
14
39
|
DamageSelfAbilityBehavior.name = "DamageSelfAbilityBehavior"
|
|
15
|
-
__TS__ClassExtends(DamageSelfAbilityBehavior,
|
|
16
|
-
function DamageSelfAbilityBehavior.prototype.____constructor(self, ability, damage)
|
|
17
|
-
|
|
18
|
-
self.damage = damage
|
|
40
|
+
__TS__ClassExtends(DamageSelfAbilityBehavior, DamageAbilityBehavior)
|
|
41
|
+
function DamageSelfAbilityBehavior.prototype.____constructor(self, ability, damage, parameters)
|
|
42
|
+
DamageAbilityBehavior.prototype.____constructor(self, ability, damage, parameters)
|
|
19
43
|
end
|
|
20
44
|
function DamageSelfAbilityBehavior.prototype.onImpact(self, caster)
|
|
45
|
+
local parameters = self.parameters
|
|
21
46
|
caster:damageTarget(
|
|
22
47
|
caster,
|
|
23
|
-
self:
|
|
48
|
+
self:calculateDamage(caster),
|
|
49
|
+
nil,
|
|
50
|
+
nil,
|
|
51
|
+
parameters and parameters.attackType,
|
|
52
|
+
parameters and parameters.damageType,
|
|
53
|
+
parameters and parameters.weaponType
|
|
24
54
|
)
|
|
25
55
|
end
|
|
26
56
|
____exports.DamageTargetAbilityBehavior = __TS__Class()
|
|
27
57
|
local DamageTargetAbilityBehavior = ____exports.DamageTargetAbilityBehavior
|
|
28
58
|
DamageTargetAbilityBehavior.name = "DamageTargetAbilityBehavior"
|
|
29
|
-
__TS__ClassExtends(DamageTargetAbilityBehavior,
|
|
30
|
-
function DamageTargetAbilityBehavior.prototype.____constructor(self, ability, damage)
|
|
31
|
-
|
|
32
|
-
self.damage = damage
|
|
59
|
+
__TS__ClassExtends(DamageTargetAbilityBehavior, DamageAbilityBehavior)
|
|
60
|
+
function DamageTargetAbilityBehavior.prototype.____constructor(self, ability, damage, parameters)
|
|
61
|
+
DamageAbilityBehavior.prototype.____constructor(self, ability, damage, parameters)
|
|
33
62
|
end
|
|
34
63
|
function DamageTargetAbilityBehavior.prototype.onWidgetTargetImpact(self, caster, target)
|
|
64
|
+
local parameters = self.parameters
|
|
35
65
|
caster:damageTarget(
|
|
36
66
|
target,
|
|
37
|
-
self:
|
|
67
|
+
self:calculateDamage(caster),
|
|
68
|
+
nil,
|
|
69
|
+
nil,
|
|
70
|
+
parameters and parameters.attackType,
|
|
71
|
+
parameters and parameters.damageType,
|
|
72
|
+
parameters and parameters.weaponType
|
|
38
73
|
)
|
|
39
74
|
end
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
AbilityBehavior.prototype.____constructor(self, ability)
|
|
46
|
-
self.damage = damage
|
|
47
|
-
self.maximumDamage = maximumDamage
|
|
75
|
+
local DamageAreaAbilityBehavior = __TS__Class()
|
|
76
|
+
DamageAreaAbilityBehavior.name = "DamageAreaAbilityBehavior"
|
|
77
|
+
__TS__ClassExtends(DamageAreaAbilityBehavior, DamageAbilityBehavior)
|
|
78
|
+
function DamageAreaAbilityBehavior.prototype.____constructor(self, ability, damage, parameters)
|
|
79
|
+
DamageAbilityBehavior.prototype.____constructor(self, ability, damage, parameters)
|
|
48
80
|
end
|
|
49
|
-
function
|
|
50
|
-
|
|
51
|
-
end
|
|
52
|
-
function DamageTargetAreaAbilityBehavior.prototype.onWidgetTargetImpact(self, caster, target)
|
|
53
|
-
self:damageArea(caster, target.x, target.y)
|
|
54
|
-
end
|
|
55
|
-
function DamageTargetAreaAbilityBehavior.prototype.onPointTargetImpact(self, caster, x, y)
|
|
56
|
-
self:damageArea(caster, x, y)
|
|
57
|
-
end
|
|
58
|
-
function DamageTargetAreaAbilityBehavior.prototype.damageArea(self, caster, x, y)
|
|
81
|
+
function DamageAreaAbilityBehavior.prototype.damageArea(self, caster, x, y)
|
|
82
|
+
local parameters = self.parameters
|
|
59
83
|
local targets = Unit.getAllowedTargetsInCollisionRange(
|
|
60
84
|
caster,
|
|
61
85
|
self:resolveCurrentAbilityDependentValue(ALLOWED_TARGETS_ABILITY_COMBAT_CLASSIFICATIONS_LEVEL_FIELD),
|
|
@@ -63,13 +87,47 @@ function DamageTargetAreaAbilityBehavior.prototype.damageArea(self, caster, x, y
|
|
|
63
87
|
y,
|
|
64
88
|
self:resolveCurrentAbilityDependentValue(AREA_OF_EFFECT_ABILITY_FLOAT_LEVEL_FIELD)
|
|
65
89
|
)
|
|
66
|
-
local damage = self:
|
|
67
|
-
local maximumDamage = self:resolveCurrentAbilityDependentValue(
|
|
90
|
+
local damage = self:calculateDamage(caster)
|
|
91
|
+
local maximumDamage = self:resolveCurrentAbilityDependentValue(parameters and parameters.maximumDamage or 0)
|
|
68
92
|
if maximumDamage ~= 0 and damage > maximumDamage then
|
|
69
93
|
damage = maximumDamage / #targets
|
|
70
94
|
end
|
|
71
95
|
for ____, target in ipairs(targets) do
|
|
72
|
-
caster:damageTarget(
|
|
96
|
+
caster:damageTarget(
|
|
97
|
+
target,
|
|
98
|
+
damage,
|
|
99
|
+
nil,
|
|
100
|
+
nil,
|
|
101
|
+
parameters and parameters.attackType,
|
|
102
|
+
parameters and parameters.damageType,
|
|
103
|
+
parameters and parameters.weaponType
|
|
104
|
+
)
|
|
73
105
|
end
|
|
74
106
|
end
|
|
107
|
+
____exports.DamageSelfAreaAbilityBehavior = __TS__Class()
|
|
108
|
+
local DamageSelfAreaAbilityBehavior = ____exports.DamageSelfAreaAbilityBehavior
|
|
109
|
+
DamageSelfAreaAbilityBehavior.name = "DamageSelfAreaAbilityBehavior"
|
|
110
|
+
__TS__ClassExtends(DamageSelfAreaAbilityBehavior, DamageAreaAbilityBehavior)
|
|
111
|
+
function DamageSelfAreaAbilityBehavior.prototype.____constructor(self, ability, damage, parameters)
|
|
112
|
+
DamageAreaAbilityBehavior.prototype.____constructor(self, ability, damage, parameters)
|
|
113
|
+
end
|
|
114
|
+
function DamageSelfAreaAbilityBehavior.prototype.onImpact(self, caster)
|
|
115
|
+
self:damageArea(caster, caster.x, caster.y)
|
|
116
|
+
end
|
|
117
|
+
____exports.DamageTargetAreaAbilityBehavior = __TS__Class()
|
|
118
|
+
local DamageTargetAreaAbilityBehavior = ____exports.DamageTargetAreaAbilityBehavior
|
|
119
|
+
DamageTargetAreaAbilityBehavior.name = "DamageTargetAreaAbilityBehavior"
|
|
120
|
+
__TS__ClassExtends(DamageTargetAreaAbilityBehavior, DamageAreaAbilityBehavior)
|
|
121
|
+
function DamageTargetAreaAbilityBehavior.prototype.____constructor(self, ability, damage, parameters)
|
|
122
|
+
DamageAreaAbilityBehavior.prototype.____constructor(self, ability, damage, parameters)
|
|
123
|
+
end
|
|
124
|
+
function DamageTargetAreaAbilityBehavior.prototype.onNoTargetImpact(self, caster)
|
|
125
|
+
self:damageArea(caster, caster.x, caster.y)
|
|
126
|
+
end
|
|
127
|
+
function DamageTargetAreaAbilityBehavior.prototype.onWidgetTargetImpact(self, caster, target)
|
|
128
|
+
self:damageArea(caster, target.x, target.y)
|
|
129
|
+
end
|
|
130
|
+
function DamageTargetAreaAbilityBehavior.prototype.onPointTargetImpact(self, caster, x, y)
|
|
131
|
+
self:damageArea(caster, x, y)
|
|
132
|
+
end
|
|
75
133
|
return ____exports
|
|
@@ -4,13 +4,40 @@ import { Ability } from "../../internal/ability";
|
|
|
4
4
|
import { Unit } from "../../internal/unit";
|
|
5
5
|
import { AbilityDependentValue } from "../../object-field/ability";
|
|
6
6
|
import { AbilityBehavior } from "../ability";
|
|
7
|
-
export
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
export type HealAbilityBehaviorParameters = {
|
|
8
|
+
healingPerStrength?: AbilityDependentValue<number>;
|
|
9
|
+
healingPerAgility?: AbilityDependentValue<number>;
|
|
10
|
+
healingPerIntelligence?: AbilityDependentValue<number>;
|
|
11
|
+
};
|
|
12
|
+
export type HealAreaAbilityBehaviorParameters = HealAbilityBehaviorParameters & {
|
|
13
|
+
maximumHealing?: AbilityDependentValue<number>;
|
|
14
|
+
};
|
|
15
|
+
declare abstract class HealAbilityBehavior<T extends HealAbilityBehaviorParameters = HealAbilityBehaviorParameters> extends AbilityBehavior {
|
|
16
|
+
protected readonly healing: AbilityDependentValue<number>;
|
|
17
|
+
protected readonly parameters?: T | undefined;
|
|
18
|
+
protected constructor(ability: Ability, healing: AbilityDependentValue<number>, parameters?: T | undefined);
|
|
19
|
+
protected calculateHealing(caster: Unit): number;
|
|
20
|
+
}
|
|
21
|
+
export declare class HealSelfAbilityBehavior extends HealAbilityBehavior {
|
|
22
|
+
constructor(ability: Ability, healing: AbilityDependentValue<number>, parameters?: HealAbilityBehaviorParameters);
|
|
23
|
+
onImpact(caster: Unit): void;
|
|
24
|
+
}
|
|
25
|
+
export declare class HealTargetAbilityBehavior extends HealAbilityBehavior {
|
|
26
|
+
constructor(ability: Ability, healing: AbilityDependentValue<number>, parameters?: HealAbilityBehaviorParameters);
|
|
27
|
+
onWidgetTargetImpact(caster: Unit, target: Widget): void;
|
|
28
|
+
}
|
|
29
|
+
declare abstract class HealAreaAbilityBehavior extends HealAbilityBehavior<HealAreaAbilityBehaviorParameters> {
|
|
30
|
+
protected constructor(ability: Ability, healing: AbilityDependentValue<number>, parameters?: HealAreaAbilityBehaviorParameters);
|
|
31
|
+
protected healArea(caster: Unit, x: number, y: number): void;
|
|
32
|
+
}
|
|
33
|
+
export declare class HealSelfAreaAbilityBehavior extends HealAreaAbilityBehavior {
|
|
34
|
+
constructor(ability: Ability, healing: AbilityDependentValue<number>, parameters?: HealAreaAbilityBehaviorParameters);
|
|
10
35
|
onImpact(caster: Unit): void;
|
|
11
36
|
}
|
|
12
|
-
export declare class
|
|
13
|
-
|
|
14
|
-
|
|
37
|
+
export declare class HealTargetAreaAbilityBehavior extends HealAreaAbilityBehavior {
|
|
38
|
+
constructor(ability: Ability, healing: AbilityDependentValue<number>, parameters?: HealAreaAbilityBehaviorParameters);
|
|
39
|
+
onNoTargetImpact(caster: Unit): void;
|
|
15
40
|
onWidgetTargetImpact(caster: Unit, target: Widget): void;
|
|
41
|
+
onPointTargetImpact(caster: Unit, x: number, y: number): void;
|
|
16
42
|
}
|
|
43
|
+
export {};
|
|
@@ -2,34 +2,113 @@ local ____lualib = require("lualib_bundle")
|
|
|
2
2
|
local __TS__Class = ____lualib.__TS__Class
|
|
3
3
|
local __TS__ClassExtends = ____lualib.__TS__ClassExtends
|
|
4
4
|
local ____exports = {}
|
|
5
|
+
local ____unit = require("engine.internal.unit")
|
|
6
|
+
local Unit = ____unit.Unit
|
|
5
7
|
local ____ability = require("engine.behaviour.ability")
|
|
6
8
|
local AbilityBehavior = ____ability.AbilityBehavior
|
|
9
|
+
local ____ability = require("engine.standard.fields.ability")
|
|
10
|
+
local ALLOWED_TARGETS_ABILITY_COMBAT_CLASSIFICATIONS_LEVEL_FIELD = ____ability.ALLOWED_TARGETS_ABILITY_COMBAT_CLASSIFICATIONS_LEVEL_FIELD
|
|
11
|
+
local AREA_OF_EFFECT_ABILITY_FLOAT_LEVEL_FIELD = ____ability.AREA_OF_EFFECT_ABILITY_FLOAT_LEVEL_FIELD
|
|
12
|
+
local HealAbilityBehavior = __TS__Class()
|
|
13
|
+
HealAbilityBehavior.name = "HealAbilityBehavior"
|
|
14
|
+
__TS__ClassExtends(HealAbilityBehavior, AbilityBehavior)
|
|
15
|
+
function HealAbilityBehavior.prototype.____constructor(self, ability, healing, parameters)
|
|
16
|
+
AbilityBehavior.prototype.____constructor(self, ability)
|
|
17
|
+
self.healing = healing
|
|
18
|
+
self.parameters = parameters
|
|
19
|
+
end
|
|
20
|
+
function HealAbilityBehavior.prototype.calculateHealing(self, caster)
|
|
21
|
+
local parameters = self.parameters
|
|
22
|
+
local healing = self:resolveCurrentAbilityDependentValue(self.healing)
|
|
23
|
+
local healingPerStrength = self:resolveCurrentAbilityDependentValue(parameters and parameters.healingPerStrength or 0)
|
|
24
|
+
if healingPerStrength ~= 0 then
|
|
25
|
+
healing = healing + healingPerStrength * caster.strength
|
|
26
|
+
end
|
|
27
|
+
local healingPerAgility = self:resolveCurrentAbilityDependentValue(parameters and parameters.healingPerAgility or 0)
|
|
28
|
+
if healingPerAgility ~= 0 then
|
|
29
|
+
healing = healing + healingPerAgility * caster.agility
|
|
30
|
+
end
|
|
31
|
+
local healingPerIntelligence = self:resolveCurrentAbilityDependentValue(parameters and parameters.healingPerIntelligence or 0)
|
|
32
|
+
if healingPerIntelligence ~= 0 then
|
|
33
|
+
healing = healing + healingPerIntelligence * caster.intelligence
|
|
34
|
+
end
|
|
35
|
+
return healing
|
|
36
|
+
end
|
|
7
37
|
____exports.HealSelfAbilityBehavior = __TS__Class()
|
|
8
38
|
local HealSelfAbilityBehavior = ____exports.HealSelfAbilityBehavior
|
|
9
39
|
HealSelfAbilityBehavior.name = "HealSelfAbilityBehavior"
|
|
10
|
-
__TS__ClassExtends(HealSelfAbilityBehavior,
|
|
11
|
-
function HealSelfAbilityBehavior.prototype.____constructor(self, ability, healing)
|
|
12
|
-
|
|
13
|
-
self.healing = healing
|
|
40
|
+
__TS__ClassExtends(HealSelfAbilityBehavior, HealAbilityBehavior)
|
|
41
|
+
function HealSelfAbilityBehavior.prototype.____constructor(self, ability, healing, parameters)
|
|
42
|
+
HealAbilityBehavior.prototype.____constructor(self, ability, healing, parameters)
|
|
14
43
|
end
|
|
15
44
|
function HealSelfAbilityBehavior.prototype.onImpact(self, caster)
|
|
16
45
|
caster:healTarget(
|
|
17
46
|
caster,
|
|
18
|
-
self:
|
|
47
|
+
self:calculateHealing(caster)
|
|
19
48
|
)
|
|
20
49
|
end
|
|
21
50
|
____exports.HealTargetAbilityBehavior = __TS__Class()
|
|
22
51
|
local HealTargetAbilityBehavior = ____exports.HealTargetAbilityBehavior
|
|
23
52
|
HealTargetAbilityBehavior.name = "HealTargetAbilityBehavior"
|
|
24
|
-
__TS__ClassExtends(HealTargetAbilityBehavior,
|
|
25
|
-
function HealTargetAbilityBehavior.prototype.____constructor(self, ability, healing)
|
|
26
|
-
|
|
27
|
-
self.healing = healing
|
|
53
|
+
__TS__ClassExtends(HealTargetAbilityBehavior, HealAbilityBehavior)
|
|
54
|
+
function HealTargetAbilityBehavior.prototype.____constructor(self, ability, healing, parameters)
|
|
55
|
+
HealAbilityBehavior.prototype.____constructor(self, ability, healing, parameters)
|
|
28
56
|
end
|
|
29
57
|
function HealTargetAbilityBehavior.prototype.onWidgetTargetImpact(self, caster, target)
|
|
30
58
|
caster:healTarget(
|
|
31
59
|
target,
|
|
32
|
-
self:
|
|
60
|
+
self:calculateHealing(caster)
|
|
61
|
+
)
|
|
62
|
+
end
|
|
63
|
+
local HealAreaAbilityBehavior = __TS__Class()
|
|
64
|
+
HealAreaAbilityBehavior.name = "HealAreaAbilityBehavior"
|
|
65
|
+
__TS__ClassExtends(HealAreaAbilityBehavior, HealAbilityBehavior)
|
|
66
|
+
function HealAreaAbilityBehavior.prototype.____constructor(self, ability, healing, parameters)
|
|
67
|
+
HealAbilityBehavior.prototype.____constructor(self, ability, healing, parameters)
|
|
68
|
+
end
|
|
69
|
+
function HealAreaAbilityBehavior.prototype.healArea(self, caster, x, y)
|
|
70
|
+
local targets = Unit.getAllowedTargetsInCollisionRange(
|
|
71
|
+
caster,
|
|
72
|
+
self:resolveCurrentAbilityDependentValue(ALLOWED_TARGETS_ABILITY_COMBAT_CLASSIFICATIONS_LEVEL_FIELD),
|
|
73
|
+
x,
|
|
74
|
+
y,
|
|
75
|
+
self:resolveCurrentAbilityDependentValue(AREA_OF_EFFECT_ABILITY_FLOAT_LEVEL_FIELD)
|
|
33
76
|
)
|
|
77
|
+
local healing = self:calculateHealing(caster)
|
|
78
|
+
local ____self_resolveCurrentAbilityDependentValue_8 = self.resolveCurrentAbilityDependentValue
|
|
79
|
+
local ____opt_6 = self.parameters
|
|
80
|
+
local maximumHealing = ____self_resolveCurrentAbilityDependentValue_8(self, ____opt_6 and ____opt_6.maximumHealing or 0)
|
|
81
|
+
if maximumHealing ~= 0 and healing > maximumHealing then
|
|
82
|
+
healing = maximumHealing / #targets
|
|
83
|
+
end
|
|
84
|
+
for ____, target in ipairs(targets) do
|
|
85
|
+
caster:healTarget(target, healing)
|
|
86
|
+
end
|
|
87
|
+
end
|
|
88
|
+
____exports.HealSelfAreaAbilityBehavior = __TS__Class()
|
|
89
|
+
local HealSelfAreaAbilityBehavior = ____exports.HealSelfAreaAbilityBehavior
|
|
90
|
+
HealSelfAreaAbilityBehavior.name = "HealSelfAreaAbilityBehavior"
|
|
91
|
+
__TS__ClassExtends(HealSelfAreaAbilityBehavior, HealAreaAbilityBehavior)
|
|
92
|
+
function HealSelfAreaAbilityBehavior.prototype.____constructor(self, ability, healing, parameters)
|
|
93
|
+
HealAreaAbilityBehavior.prototype.____constructor(self, ability, healing, parameters)
|
|
94
|
+
end
|
|
95
|
+
function HealSelfAreaAbilityBehavior.prototype.onImpact(self, caster)
|
|
96
|
+
self:healArea(caster, caster.x, caster.y)
|
|
97
|
+
end
|
|
98
|
+
____exports.HealTargetAreaAbilityBehavior = __TS__Class()
|
|
99
|
+
local HealTargetAreaAbilityBehavior = ____exports.HealTargetAreaAbilityBehavior
|
|
100
|
+
HealTargetAreaAbilityBehavior.name = "HealTargetAreaAbilityBehavior"
|
|
101
|
+
__TS__ClassExtends(HealTargetAreaAbilityBehavior, HealAreaAbilityBehavior)
|
|
102
|
+
function HealTargetAreaAbilityBehavior.prototype.____constructor(self, ability, healing, parameters)
|
|
103
|
+
HealAreaAbilityBehavior.prototype.____constructor(self, ability, healing, parameters)
|
|
104
|
+
end
|
|
105
|
+
function HealTargetAreaAbilityBehavior.prototype.onNoTargetImpact(self, caster)
|
|
106
|
+
self:healArea(caster, caster.x, caster.y)
|
|
107
|
+
end
|
|
108
|
+
function HealTargetAreaAbilityBehavior.prototype.onWidgetTargetImpact(self, caster, target)
|
|
109
|
+
self:healArea(caster, target.x, target.y)
|
|
110
|
+
end
|
|
111
|
+
function HealTargetAreaAbilityBehavior.prototype.onPointTargetImpact(self, caster, x, y)
|
|
112
|
+
self:healArea(caster, x, y)
|
|
34
113
|
end
|
|
35
114
|
return ____exports
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/** @noSelfInFile */
|
|
2
|
+
import { Ability } from "../../internal/ability";
|
|
3
|
+
import { Unit } from "../../internal/unit";
|
|
4
|
+
import { AbilityDependentValue } from "../../object-field/ability";
|
|
5
|
+
import { AbilityBehavior } from "../ability";
|
|
6
|
+
export declare class RestoreManaSelfAbilityBehavior extends AbilityBehavior {
|
|
7
|
+
private readonly mana;
|
|
8
|
+
constructor(ability: Ability, mana: AbilityDependentValue<number>);
|
|
9
|
+
onImpact(caster: Unit): void;
|
|
10
|
+
}
|
|
11
|
+
export declare class RestoreManaAbilityBehavior extends AbilityBehavior {
|
|
12
|
+
private readonly mana;
|
|
13
|
+
constructor(ability: Ability, mana: AbilityDependentValue<number>);
|
|
14
|
+
onUnitTargetImpact(caster: Unit, target: Unit): void;
|
|
15
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
local ____lualib = require("lualib_bundle")
|
|
2
|
+
local __TS__Class = ____lualib.__TS__Class
|
|
3
|
+
local __TS__ClassExtends = ____lualib.__TS__ClassExtends
|
|
4
|
+
local ____exports = {}
|
|
5
|
+
local ____ability = require("engine.behaviour.ability")
|
|
6
|
+
local AbilityBehavior = ____ability.AbilityBehavior
|
|
7
|
+
____exports.RestoreManaSelfAbilityBehavior = __TS__Class()
|
|
8
|
+
local RestoreManaSelfAbilityBehavior = ____exports.RestoreManaSelfAbilityBehavior
|
|
9
|
+
RestoreManaSelfAbilityBehavior.name = "RestoreManaSelfAbilityBehavior"
|
|
10
|
+
__TS__ClassExtends(RestoreManaSelfAbilityBehavior, AbilityBehavior)
|
|
11
|
+
function RestoreManaSelfAbilityBehavior.prototype.____constructor(self, ability, mana)
|
|
12
|
+
AbilityBehavior.prototype.____constructor(self, ability)
|
|
13
|
+
self.mana = mana
|
|
14
|
+
end
|
|
15
|
+
function RestoreManaSelfAbilityBehavior.prototype.onImpact(self, caster)
|
|
16
|
+
caster.mana = caster.mana + self:resolveCurrentAbilityDependentValue(self.mana)
|
|
17
|
+
end
|
|
18
|
+
____exports.RestoreManaAbilityBehavior = __TS__Class()
|
|
19
|
+
local RestoreManaAbilityBehavior = ____exports.RestoreManaAbilityBehavior
|
|
20
|
+
RestoreManaAbilityBehavior.name = "RestoreManaAbilityBehavior"
|
|
21
|
+
__TS__ClassExtends(RestoreManaAbilityBehavior, AbilityBehavior)
|
|
22
|
+
function RestoreManaAbilityBehavior.prototype.____constructor(self, ability, mana)
|
|
23
|
+
AbilityBehavior.prototype.____constructor(self, ability)
|
|
24
|
+
self.mana = mana
|
|
25
|
+
end
|
|
26
|
+
function RestoreManaAbilityBehavior.prototype.onUnitTargetImpact(self, caster, target)
|
|
27
|
+
target.mana = target.mana + self:resolveCurrentAbilityDependentValue(self.mana)
|
|
28
|
+
end
|
|
29
|
+
return ____exports
|
package/engine/buff.d.ts
CHANGED
|
@@ -64,6 +64,10 @@ export type BuffParameters<T extends Buff<any> = Buff> = Buff extends T ? {
|
|
|
64
64
|
disablesAutoAttack?: BooleanParameterValueType;
|
|
65
65
|
destroysOnDamage?: BooleanParameterValueType;
|
|
66
66
|
maximumAutoAttackCount?: IntegerParameterValueType;
|
|
67
|
+
damageOnExpiration?: NumberParameterValueType;
|
|
68
|
+
healingOnExpiration?: NumberParameterValueType;
|
|
69
|
+
killsOnExpiration?: BooleanParameterValueType;
|
|
70
|
+
explodesOnExpiration?: BooleanParameterValueType;
|
|
67
71
|
uniqueGroup?: BuffUniqueGroup;
|
|
68
72
|
} : BuffParameters & (T extends Buff<infer AdditionalParameters> ? AdditionalParameters : object);
|
|
69
73
|
declare const enum BuffPropertyKey {
|
|
@@ -86,19 +90,23 @@ declare const enum BuffPropertyKey {
|
|
|
86
90
|
HEALING_INTERVAL = 116,
|
|
87
91
|
REMAINING_HEALING_OVER_DURATION = 117,
|
|
88
92
|
HEALING_INTERVAL_TIMER = 118,
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
93
|
+
DAMAGE_ON_EXPIRATION = 119,
|
|
94
|
+
HEALING_ON_EXPIRATION = 120,
|
|
95
|
+
DAMAGE_UPON_DEATH_ALLOWED_TARGET_CLASSIFICATIONS = 121,
|
|
96
|
+
DAMAGE_UPON_DEATH = 122,
|
|
97
|
+
DAMAGE_UPON_DEATH_RANGE = 123,
|
|
98
|
+
MEDIUM_DAMAGE_UPON_DEATH = 124,
|
|
99
|
+
MEDIUM_DAMAGE_UPON_DEATH_RANGE = 125,
|
|
100
|
+
SMALL_DAMAGE_UPON_DEATH = 126,
|
|
101
|
+
SMALL_DAMAGE_UPON_DEATH_RANGE = 127,
|
|
102
|
+
AUTO_ATTACK_COUNT = 128,
|
|
103
|
+
MAXIMUM_AUTO_ATTACK_COUNT = 129,
|
|
104
|
+
STUNS = 130,
|
|
105
|
+
IGNORES_STUN_IMMUNITY = 131,
|
|
106
|
+
DISABLES_AUTO_ATTACK = 132,
|
|
107
|
+
PROVIDES_INVULNERABILITY = 133,
|
|
108
|
+
KILLS_ON_EXPIRATION = 134,
|
|
109
|
+
EXPLODES_ON_EXPIRATION = 135
|
|
102
110
|
}
|
|
103
111
|
export declare const enum BuffTypeIdSelectionPolicy {
|
|
104
112
|
LEAST_DURATION = 0
|
|
@@ -138,6 +146,8 @@ export declare class Buff<AdditionalParameters extends Prohibit<Record<string, a
|
|
|
138
146
|
private [BuffPropertyKey.HEALING_INTERVAL]?;
|
|
139
147
|
private [BuffPropertyKey.REMAINING_HEALING_OVER_DURATION]?;
|
|
140
148
|
private [BuffPropertyKey.HEALING_INTERVAL_TIMER]?;
|
|
149
|
+
private [BuffPropertyKey.DAMAGE_ON_EXPIRATION]?;
|
|
150
|
+
private [BuffPropertyKey.HEALING_ON_EXPIRATION]?;
|
|
141
151
|
private [BuffPropertyKey.DAMAGE_UPON_DEATH_ALLOWED_TARGET_CLASSIFICATIONS]?;
|
|
142
152
|
private [BuffPropertyKey.DAMAGE_UPON_DEATH]?;
|
|
143
153
|
private [BuffPropertyKey.DAMAGE_UPON_DEATH_RANGE]?;
|
|
@@ -151,6 +161,8 @@ export declare class Buff<AdditionalParameters extends Prohibit<Record<string, a
|
|
|
151
161
|
private [BuffPropertyKey.IGNORES_STUN_IMMUNITY]?;
|
|
152
162
|
private [BuffPropertyKey.DISABLES_AUTO_ATTACK]?;
|
|
153
163
|
private [BuffPropertyKey.PROVIDES_INVULNERABILITY]?;
|
|
164
|
+
private [BuffPropertyKey.KILLS_ON_EXPIRATION]?;
|
|
165
|
+
private [BuffPropertyKey.EXPLODES_ON_EXPIRATION]?;
|
|
154
166
|
protected static readonly defaultParameters: BuffParameters;
|
|
155
167
|
get source(): Unit;
|
|
156
168
|
readonly typeId: ApplicableBuffTypeId;
|
|
@@ -187,6 +199,10 @@ export declare class Buff<AdditionalParameters extends Prohibit<Record<string, a
|
|
|
187
199
|
set healingPerInterval(healingPerInterval: number);
|
|
188
200
|
get healingInterval(): number;
|
|
189
201
|
set healingInterval(healingInterval: number);
|
|
202
|
+
get damageOnExpiration(): number;
|
|
203
|
+
set damageOnExpiration(damageOnExpiration: number);
|
|
204
|
+
get healingOnExpiration(): number;
|
|
205
|
+
set healingOnExpiration(healingOnExpiration: number);
|
|
190
206
|
get receivedDamageFactor(): number;
|
|
191
207
|
set receivedDamageFactor(receivedDamageFactor: number);
|
|
192
208
|
get armorIncrease(): number;
|
|
@@ -199,6 +215,10 @@ export declare class Buff<AdditionalParameters extends Prohibit<Record<string, a
|
|
|
199
215
|
set disablesAutoAttack(disablesAutoAttack: boolean);
|
|
200
216
|
get providesInvulnerability(): boolean;
|
|
201
217
|
set providesInvulnerability(providesInvulnerability: boolean);
|
|
218
|
+
get killsOnExpiration(): boolean;
|
|
219
|
+
set killsOnExpiration(killsOnExpiration: boolean);
|
|
220
|
+
get explodesOnExpiration(): boolean;
|
|
221
|
+
set explodesOnExpiration(killsOnExpiration: boolean);
|
|
202
222
|
get maximumAutoAttackCount(): number;
|
|
203
223
|
set maximumAutoAttackCount(maximumAutoAttackCount: number);
|
|
204
224
|
get durationIncreaseOnAutoAttack(): number;
|
|
@@ -215,6 +235,7 @@ export declare class Buff<AdditionalParameters extends Prohibit<Record<string, a
|
|
|
215
235
|
protected onDestroy(): Destructor;
|
|
216
236
|
static apply<T extends Buff<any>, Args extends any[]>(this: BuffConstructor<T, Args>, ...args: Args): T | undefined;
|
|
217
237
|
static getByTypeId<T extends Buff<any>, Args extends any[]>(this: BuffConstructor<T, Args>, unit: Unit, typeId: ApplicableBuffTypeId): T | undefined;
|
|
238
|
+
onExpiration(): void;
|
|
218
239
|
onDeath(source: Unit | undefined): void;
|
|
219
240
|
onDamageDealt(target: Unit, event: DamageEvent): void;
|
|
220
241
|
}
|