warscript 0.0.1-dev.e7b1f67 → 0.0.1-dev.ebee5b2
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 +4 -0
- package/core/types/frame.lua +22 -1
- package/engine/behavior.d.ts +4 -4
- package/engine/behaviour/ability/apply-buff.d.ts +3 -5
- 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/behaviour/unit.d.ts +5 -0
- package/engine/behaviour/unit.lua +20 -0
- package/engine/buff.d.ts +60 -18
- package/engine/buff.lua +239 -62
- package/engine/game-map.d.ts +7 -0
- package/engine/game-map.lua +32 -0
- package/engine/internal/item+owner.lua +2 -2
- package/engine/internal/unit/bonus.d.ts +4 -2
- package/engine/internal/unit/bonus.lua +6 -1
- package/engine/internal/unit+ability.lua +2 -2
- package/engine/internal/unit+transport.lua +4 -10
- package/engine/internal/unit.d.ts +23 -4
- package/engine/internal/unit.lua +94 -33
- package/engine/object-field/ability.d.ts +17 -0
- package/engine/object-field/ability.lua +50 -0
- package/lualib_bundle.lua +7 -2
- 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 +1 -1
- package/package.json +2 -2
- package/property.d.ts +55 -0
- package/property.lua +374 -0
- package/utility/linked-set.d.ts +11 -2
- package/utility/linked-set.lua +5 -2
- package/utility/types.d.ts +1 -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,9 +25,13 @@ 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
|
+
private static readonly CONSOLE_UI_BACKDROP_UI_SCALE_HELPER_CHILD;
|
|
29
|
+
static readonly CONSOLE_TOP_BAR: Frame;
|
|
30
|
+
static readonly CONSOLE_BOTTOM_BAR: Frame;
|
|
28
31
|
static readonly WORLD: Frame;
|
|
29
32
|
static readonly CHAT: Frame;
|
|
30
33
|
static readonly TIME_OF_DAY_CLOCK: Frame;
|
|
34
|
+
static get uiScale(): number;
|
|
31
35
|
static get leftBorder(): Frame;
|
|
32
36
|
static get rightBorder(): Frame;
|
|
33
37
|
static get minX(): number;
|
package/core/types/frame.lua
CHANGED
|
@@ -62,8 +62,10 @@ local function updateBorders()
|
|
|
62
62
|
local width4by3 = (w - h / 600 * 800) / 2
|
|
63
63
|
local pxtodpi = 0.6 / h
|
|
64
64
|
BlzFrameSetAbsPoint(leftBorder, FRAMEPOINT_TOPLEFT, -width4by3 * pxtodpi, 0.6)
|
|
65
|
+
BlzFrameSetScale(leftBorder, 1)
|
|
65
66
|
BlzFrameSetSize(leftBorder, 0.001, 0.6)
|
|
66
67
|
BlzFrameSetAbsPoint(rightBorder, FRAMEPOINT_TOPRIGHT, (-width4by3 + w) * pxtodpi, 0.6)
|
|
68
|
+
BlzFrameSetScale(rightBorder, 1)
|
|
67
69
|
BlzFrameSetSize(rightBorder, 0.001, 0.6)
|
|
68
70
|
end
|
|
69
71
|
local worldFrame = BlzGetOriginFrame(ORIGIN_FRAME_WORLD_FRAME, 0)
|
|
@@ -267,7 +269,16 @@ function Frame.createSimple(self, name, parent, createContext)
|
|
|
267
269
|
))
|
|
268
270
|
end
|
|
269
271
|
function Frame.create(self, name, parent, priority, createContext)
|
|
270
|
-
|
|
272
|
+
if parent == ____exports.Frame.CONSOLE_UI_BACKDROP then
|
|
273
|
+
local helper = ____exports.Frame.CONSOLE_UI_BACKDROP_UI_SCALE_HELPER_CHILD.handle
|
|
274
|
+
BlzFrameSetScale(helper, 1)
|
|
275
|
+
local frame = BlzCreateFrame(name, helper, priority or 0, createContext or 0)
|
|
276
|
+
BlzFrameSetScale(helper, ____exports.Frame.uiScale)
|
|
277
|
+
BlzFrameSetParent(frame, ____exports.Frame.CONSOLE_UI_BACKDROP.handle)
|
|
278
|
+
return self:of(frame)
|
|
279
|
+
else
|
|
280
|
+
return self:of(BlzCreateFrame(name, parent.handle, priority or 0, createContext or 0))
|
|
281
|
+
end
|
|
271
282
|
end
|
|
272
283
|
function Frame.createByType(self, typeName, name, parent, inherits, createContext)
|
|
273
284
|
return self:of(BlzCreateFrameByType(
|
|
@@ -293,9 +304,19 @@ end
|
|
|
293
304
|
Frame.GAME_UI = ____exports.Frame:byOrigin(ORIGIN_FRAME_GAME_UI)
|
|
294
305
|
Frame.CONSOLE_UI = ____exports.Frame:byOrigin(ORIGIN_FRAME_SIMPLE_UI_PARENT)
|
|
295
306
|
Frame.CONSOLE_UI_BACKDROP = ____exports.Frame:byName("ConsoleUIBackdrop")
|
|
307
|
+
Frame.CONSOLE_UI_BACKDROP_UI_SCALE_HELPER_CHILD = ____exports.Frame:createByType("FRAME", "ConsoleUIBackdropUIScaleHelperChild", ____exports.Frame.CONSOLE_UI_BACKDROP)
|
|
308
|
+
Frame.CONSOLE_TOP_BAR = ____exports.Frame:byName("ConsoleTopBar")
|
|
309
|
+
Frame.CONSOLE_BOTTOM_BAR = ____exports.Frame:byName("ConsoleBottomBar")
|
|
296
310
|
Frame.WORLD = ____exports.Frame:byOrigin(ORIGIN_FRAME_WORLD_FRAME)
|
|
297
311
|
Frame.CHAT = ____exports.Frame:byOrigin(ORIGIN_FRAME_CHAT_MSG)
|
|
298
312
|
Frame.TIME_OF_DAY_CLOCK = ____exports.Frame.GAME_UI:getChild(5):getChild(0)
|
|
313
|
+
__TS__ObjectDefineProperty(
|
|
314
|
+
Frame,
|
|
315
|
+
"uiScale",
|
|
316
|
+
{get = function(self)
|
|
317
|
+
return ____exports.Frame.CONSOLE_BOTTOM_BAR.width / 0.8
|
|
318
|
+
end}
|
|
319
|
+
)
|
|
299
320
|
__TS__ObjectDefineProperty(
|
|
300
321
|
Frame,
|
|
301
322
|
"leftBorder",
|
package/engine/behavior.d.ts
CHANGED
|
@@ -20,9 +20,9 @@ export declare abstract class Behavior<T extends AnyNotNil, PeriodicActionParame
|
|
|
20
20
|
static getFirst<T extends Behavior<AnyNotNil>, ConstructorParameters extends any[], Count extends [number] | []>(this: BehaviorConstructor<T, ConstructorParameters>, object: T extends Behavior<infer Object> ? Object : never, ...[count]: Count): Count extends [number] ? T[] : T | undefined;
|
|
21
21
|
static getLast<T extends Behavior<AnyNotNil>, ConstructorParameters extends any[]>(this: BehaviorConstructor<T, ConstructorParameters>, object: T extends Behavior<infer Object> ? Object : never): T | undefined;
|
|
22
22
|
static getAll<T extends Behavior<AnyNotNil>, ConstructorParameters extends any[]>(this: BehaviorConstructor<T, ConstructorParameters>, object: T extends Behavior<infer Object> ? Object : never): T[];
|
|
23
|
-
static forFirst<T extends Behavior<
|
|
24
|
-
static forFirst<T extends Behavior<
|
|
25
|
-
static forAll<T extends Behavior<
|
|
26
|
-
static forAll<T extends Behavior<
|
|
23
|
+
static forFirst<T extends Behavior<AnyNotNil>, ConstructorParameters extends any[], ConsumerParameters extends any[]>(this: BehaviorConstructor<T, ConstructorParameters>, object: T extends Behavior<infer Object> ? Object : never, count: number, consumer: (this: void, behavior: T, ...parameters: ConsumerParameters) => any, ...parameters: ConsumerParameters): number;
|
|
24
|
+
static forFirst<T extends Behavior<AnyNotNil>, ConstructorParameters extends any[], K extends KeysOfType<T, (this: T, ...args: any) => any>>(this: BehaviorConstructor<T, ConstructorParameters>, object: T extends Behavior<infer Object> ? Object : never, count: number, key: K, ...parameters: T[K] extends (this: T, ...args: any) => any ? Parameters<T[K]> : never): number;
|
|
25
|
+
static forAll<T extends Behavior<AnyNotNil>, ConstructorParameters extends any[], ConsumerParameters extends any[]>(this: BehaviorConstructor<T, ConstructorParameters>, object: T extends Behavior<infer Object> ? Object : never, consumer: (this: void, behavior: T, ...parameters: ConsumerParameters) => unknown, ...parameters: ConsumerParameters): number;
|
|
26
|
+
static forAll<T extends Behavior<AnyNotNil>, ConstructorParameters extends any[], K extends KeysOfType<T, (this: T, ...args: any) => any>>(this: BehaviorConstructor<T, ConstructorParameters>, object: T extends Behavior<infer Object> ? Object : never, key: K, ...parameters: T[K] extends (this: T, ...args: any) => any ? Parameters<T[K]> : never): number;
|
|
27
27
|
}
|
|
28
28
|
export {};
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
/** @noSelfInFile */
|
|
2
2
|
import { AbilityBehavior } from "../ability";
|
|
3
3
|
import { Ability } from "../../internal/ability";
|
|
4
|
-
import { Buff, BuffConstructor, BuffParameters, BuffTypeIdSelectionPolicy } from "../../buff";
|
|
4
|
+
import { Buff, BuffConstructor, BuffParameters, BuffPolarityParameterType, BuffResistanceTypeParameterType, BuffTypeIdSelectionPolicy } from "../../buff";
|
|
5
5
|
import { Unit } from "../../internal/unit";
|
|
6
6
|
import { ApplicableBuffTypeId } from "../../object-data/entry/buff-type/applicable";
|
|
7
|
-
import { BuffResistanceType } from "../../object-data/auxiliary/buff-resistance-type";
|
|
8
|
-
import { BuffPolarity } from "../../object-data/auxiliary/buff-polarity";
|
|
9
7
|
import { Widget } from "../../../core/types/widget";
|
|
10
8
|
type BuffParametersType<T extends BuffConstructor> = BuffParameters & Omit<BuffAdditionalParametersType<T>, keyof BuffParameters>;
|
|
11
9
|
type BuffAdditionalParametersType<T extends BuffConstructor> = T extends BuffConstructor<Buff<infer AdditionalParameters>> ? AdditionalParameters : never;
|
|
@@ -17,8 +15,8 @@ export declare abstract class ApplyBuffAbilityBehavior<T extends BuffConstructor
|
|
|
17
15
|
typeIds: [ApplicableBuffTypeId, ...ApplicableBuffTypeId[]],
|
|
18
16
|
typeIdSelectionPolicy: BuffTypeIdSelectionPolicy
|
|
19
17
|
],
|
|
20
|
-
polarity:
|
|
21
|
-
resistanceType:
|
|
18
|
+
polarity: BuffPolarityParameterType,
|
|
19
|
+
resistanceType: BuffResistanceTypeParameterType,
|
|
22
20
|
parameters?: BuffParametersType<T>
|
|
23
21
|
]);
|
|
24
22
|
}
|
|
@@ -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
|
|
@@ -4,6 +4,7 @@ import { Ability } from "../internal/ability";
|
|
|
4
4
|
import { DamageEvent, DamagingEvent, Unit } from "../internal/unit";
|
|
5
5
|
import "../internal/unit+ability";
|
|
6
6
|
import "../internal/unit-missile-launch";
|
|
7
|
+
import { Item } from "../internal/item";
|
|
7
8
|
export type UnitBehaviorConstructor<Args extends any[]> = new (unit: Unit, ...args: Args) => UnitBehavior;
|
|
8
9
|
export declare abstract class UnitBehavior<PeriodicActionParameters extends any[] = any[]> extends Behavior<Unit, PeriodicActionParameters> {
|
|
9
10
|
constructor(unit: Unit);
|
|
@@ -16,6 +17,10 @@ export declare abstract class UnitBehavior<PeriodicActionParameters extends any[
|
|
|
16
17
|
onDamageReceived(source: Unit | undefined, event: DamageEvent): void;
|
|
17
18
|
onAbilityGained(ability: Ability): void;
|
|
18
19
|
onAbilityLost(ability: Ability): void;
|
|
20
|
+
onItemDropped(item: Item): void;
|
|
21
|
+
onItemPickedUp(item: Item): void;
|
|
22
|
+
onItemUsed(item: Item): void;
|
|
23
|
+
onItemStacked(item: Item): void;
|
|
19
24
|
onKill(target: Unit): void;
|
|
20
25
|
onDeath(source: Unit | undefined): void;
|
|
21
26
|
}
|
|
@@ -32,6 +32,14 @@ function UnitBehavior.prototype.onAbilityGained(self, ability)
|
|
|
32
32
|
end
|
|
33
33
|
function UnitBehavior.prototype.onAbilityLost(self, ability)
|
|
34
34
|
end
|
|
35
|
+
function UnitBehavior.prototype.onItemDropped(self, item)
|
|
36
|
+
end
|
|
37
|
+
function UnitBehavior.prototype.onItemPickedUp(self, item)
|
|
38
|
+
end
|
|
39
|
+
function UnitBehavior.prototype.onItemUsed(self, item)
|
|
40
|
+
end
|
|
41
|
+
function UnitBehavior.prototype.onItemStacked(self, item)
|
|
42
|
+
end
|
|
35
43
|
function UnitBehavior.prototype.onKill(self, target)
|
|
36
44
|
end
|
|
37
45
|
function UnitBehavior.prototype.onDeath(self, source)
|
|
@@ -75,6 +83,18 @@ __TS__SetDescriptor(
|
|
|
75
83
|
end
|
|
76
84
|
____exports.UnitBehavior:forAll(target, "onDeath", source)
|
|
77
85
|
end)
|
|
86
|
+
Unit.itemDroppedEvent:addListener(function(unit, item)
|
|
87
|
+
____exports.UnitBehavior:forAll(unit, "onItemDropped", item)
|
|
88
|
+
end)
|
|
89
|
+
Unit.itemPickedUpEvent:addListener(function(unit, item)
|
|
90
|
+
____exports.UnitBehavior:forAll(unit, "onItemPickedUp", item)
|
|
91
|
+
end)
|
|
92
|
+
Unit.itemUsedEvent:addListener(function(unit, item)
|
|
93
|
+
____exports.UnitBehavior:forAll(unit, "onItemUsed", item)
|
|
94
|
+
end)
|
|
95
|
+
Unit.itemStackedEvent:addListener(function(unit, item)
|
|
96
|
+
____exports.UnitBehavior:forAll(unit, "onItemStacked", item)
|
|
97
|
+
end)
|
|
78
98
|
end)(UnitBehavior)
|
|
79
99
|
Unit.destroyEvent:addListener(function(unit)
|
|
80
100
|
____exports.UnitBehavior:forAll(unit, "destroy")
|