warscript 0.0.1-dev.32c305a → 0.0.1-dev.32e76f5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/attributes.d.ts +1 -0
- package/attributes.lua +9 -0
- package/core/types/frame.lua +24 -21
- package/core/types/player.d.ts +16 -0
- package/core/types/player.lua +60 -15
- package/core/types/playerCamera.d.ts +2 -0
- package/core/types/playerCamera.lua +123 -5
- package/core/types/sound.lua +1 -1
- package/core/types/tileCell.d.ts +11 -1
- package/core/types/tileCell.lua +97 -0
- package/core/types/timer.d.ts +3 -1
- package/core/types/timer.lua +27 -2
- package/decl/native.d.ts +6 -4
- package/destroyable.d.ts +1 -0
- package/destroyable.lua +9 -0
- package/engine/behavior.d.ts +14 -1
- package/engine/behavior.lua +230 -70
- package/engine/behaviour/ability/apply-buff.lua +5 -5
- package/engine/behaviour/ability/emulate-impact.d.ts +1 -1
- package/engine/behaviour/ability/emulate-impact.lua +2 -1
- package/engine/behaviour/ability/remove-buffs.d.ts +9 -0
- package/engine/behaviour/ability/remove-buffs.lua +21 -0
- package/engine/behaviour/ability/restore-mana.d.ts +1 -1
- package/engine/behaviour/ability/restore-mana.lua +6 -6
- package/engine/behaviour/ability.d.ts +11 -6
- package/engine/behaviour/ability.lua +37 -16
- 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 +26 -5
- package/engine/behaviour/unit.lua +180 -27
- package/engine/buff.d.ts +65 -21
- package/engine/buff.lua +369 -181
- package/engine/internal/ability.d.ts +3 -1
- package/engine/internal/ability.lua +34 -11
- package/engine/internal/item/ability.lua +51 -1
- package/engine/internal/item+owner.lua +12 -6
- package/engine/internal/item.d.ts +14 -15
- package/engine/internal/item.lua +70 -52
- package/engine/internal/mechanics/cast-ability.lua +6 -3
- package/engine/internal/misc/frame-coordinates.lua +21 -0
- package/engine/internal/misc/get-terrain-z.d.ts +2 -0
- package/engine/internal/misc/get-terrain-z.lua +11 -0
- package/engine/internal/misc/player-local-handle.d.ts +2 -0
- package/engine/internal/misc/player-local-handle.lua +5 -0
- package/engine/internal/object-data/armor-bonus.d.ts +2 -0
- package/engine/internal/object-data/attribute-bonus.lua +2 -2
- package/engine/internal/object-data/health-bonus.d.ts +2 -0
- package/engine/internal/object-data/health-bonus.lua +16 -0
- package/engine/internal/object-data/mana-bonus.d.ts +2 -0
- package/engine/internal/object-data/mana-bonus.lua +16 -0
- package/engine/internal/object-data/mana-regeneration-rate-increase-factor.d.ts +2 -0
- package/engine/internal/object-data/mana-regeneration-rate-increase-factor.lua +16 -0
- package/engine/internal/unit/ability.d.ts +35 -5
- package/engine/internal/unit/ability.lua +96 -21
- package/engine/internal/unit/attributes.d.ts +17 -0
- package/engine/internal/unit/attributes.lua +46 -0
- package/engine/internal/unit/bonus.d.ts +6 -0
- package/engine/internal/unit/bonus.lua +33 -3
- package/engine/internal/unit/fly-height.d.ts +7 -0
- package/engine/internal/unit/fly-height.lua +20 -0
- package/engine/internal/unit/interrupts.d.ts +12 -0
- package/engine/internal/unit/interrupts.lua +28 -0
- package/engine/internal/unit/item.lua +1 -1
- package/engine/internal/unit/main-selected.lua +12 -27
- 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 +10 -1
- package/engine/internal/unit+bonus.lua +3 -3
- package/engine/internal/unit-missile-launch.lua +52 -14
- package/engine/internal/unit.d.ts +20 -24
- package/engine/internal/unit.lua +232 -240
- package/engine/local-client.d.ts +2 -0
- package/engine/local-client.lua +30 -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/health-regeneration-type.d.ts +8 -0
- package/engine/object-data/auxiliary/health-regeneration-type.lua +2 -0
- package/engine/object-data/auxiliary/unit-attribute.lua +1 -1
- 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/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/reincarnation.d.ts +8 -0
- package/engine/object-data/entry/ability-type/reincarnation.lua +26 -0
- package/engine/object-data/entry/ability-type.d.ts +2 -0
- package/engine/object-data/entry/ability-type.lua +89 -8
- package/engine/object-data/entry/buff-type/applicable.lua +113 -109
- package/engine/object-data/entry/destructible-type.d.ts +27 -1
- package/engine/object-data/entry/destructible-type.lua +155 -0
- package/engine/object-data/entry/unit-type.d.ts +15 -2
- package/engine/object-data/entry/unit-type.lua +135 -33
- package/engine/object-field/ability.d.ts +3 -3
- package/engine/object-field/ability.lua +7 -6
- package/engine/object-field/unit.d.ts +31 -5
- package/engine/object-field/unit.lua +95 -0
- package/engine/object-field.d.ts +17 -6
- package/engine/object-field.lua +291 -134
- package/engine/random.d.ts +10 -0
- package/engine/random.lua +21 -0
- package/engine/standard/fields/ability.d.ts +2 -2
- package/engine/standard/fields/ability.lua +2 -2
- 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 +6 -0
- package/engine/unit.lua +6 -0
- package/lualib_bundle.lua +118 -47
- package/net/socket.lua +1 -1
- package/objutil/buff.lua +10 -8
- package/objutil/object.lua +1 -1
- package/operation.lua +23 -17
- package/package.json +5 -5
- package/patch-lua.lua +15 -0
- package/patch-lualib.lua +1 -1
- package/utility/arrays.d.ts +1 -0
- package/utility/arrays.lua +8 -0
- package/utility/callback-array.d.ts +17 -0
- package/utility/callback-array.lua +61 -0
- package/utility/functions.d.ts +7 -0
- package/utility/functions.lua +12 -0
- package/utility/linked-map.d.ts +34 -0
- package/utility/linked-map.lua +101 -0
- package/utility/linked-set.d.ts +3 -1
- package/utility/linked-set.lua +40 -1
- package/utility/lua-maps.d.ts +12 -2
- package/utility/lua-maps.lua +37 -2
- package/utility/lua-sets.d.ts +1 -0
- package/utility/lua-sets.lua +4 -0
- package/utility/records.lua +20 -1
- package/utility/types.d.ts +3 -0
- package/core/types/order.d.ts +0 -26
- package/core/types/order.lua +0 -65
- /package/engine/internal/{object-data/armor-increase.d.ts → misc/frame-coordinates.d.ts} +0 -0
- /package/engine/internal/object-data/{armor-increase.lua → armor-bonus.lua} +0 -0
- /package/engine/object-data/entry/ability-type/{attribute-increase.d.ts → attribute-bonus.d.ts} +0 -0
- /package/engine/object-data/entry/ability-type/{attribute-increase.lua → attribute-bonus.lua} +0 -0
package/engine/buff.d.ts
CHANGED
|
@@ -13,6 +13,7 @@ import { UnitBehavior } from "./behaviour/unit";
|
|
|
13
13
|
import type { Widget } from "../core/types/widget";
|
|
14
14
|
import { Destructor } from "../destroyable";
|
|
15
15
|
import { Event } from "../event";
|
|
16
|
+
import { AbilityBehavior } from "./behaviour/ability";
|
|
16
17
|
export type BuffConstructor<T extends Buff<any> = Buff<any>, Args extends any[] = any> = OmitConstructor<typeof Buff<any>> & (new (...args: Args) => T);
|
|
17
18
|
type EnumParameterValueType<T extends number> = T | AbilityEnumLevelField<T>;
|
|
18
19
|
type NumberParameterValueType = number | AbilityNumberField | AbilityNumberLevelField;
|
|
@@ -30,8 +31,10 @@ export type BuffParameters<T extends Buff<any> = Buff> = Buff extends T ? {
|
|
|
30
31
|
source?: Unit;
|
|
31
32
|
behaviorConstructors?: (new (unit: Unit) => UnitBehavior)[];
|
|
32
33
|
abilityTypeIds?: Record<AbilityTypeId, {
|
|
33
|
-
|
|
34
|
-
|
|
34
|
+
readonly fields?: [
|
|
35
|
+
AbilityNumberField | AbilityNumberLevelField,
|
|
36
|
+
NumberParameterValueType
|
|
37
|
+
][];
|
|
35
38
|
/** Default `true`. */
|
|
36
39
|
readonly isButtonVisible?: boolean;
|
|
37
40
|
/** Default is the level of the source ability or 0 if it is absent. */
|
|
@@ -53,9 +56,11 @@ export type BuffParameters<T extends Buff<any> = Buff> = Buff extends T ? {
|
|
|
53
56
|
damageIncrease?: NumberParameterValueType;
|
|
54
57
|
damageIncreaseFactor?: NumberParameterValueType;
|
|
55
58
|
armorIncrease?: NumberParameterValueType;
|
|
56
|
-
|
|
59
|
+
maxHealthIncrease?: NumberParameterValueType;
|
|
60
|
+
maxManaIncrease?: NumberParameterValueType;
|
|
57
61
|
attackSpeedIncreaseFactor?: NumberParameterValueType;
|
|
58
62
|
movementSpeedIncreaseFactor?: NumberParameterValueType;
|
|
63
|
+
manaRegenerationRateIncreaseFactor?: NumberParameterValueType;
|
|
59
64
|
evasionProbability?: NumberParameterValueType;
|
|
60
65
|
missProbability?: NumberParameterValueType;
|
|
61
66
|
damageFactor?: NumberParameterValueType;
|
|
@@ -75,10 +80,14 @@ export type BuffParameters<T extends Buff<any> = Buff> = Buff extends T ? {
|
|
|
75
80
|
maximumAutoAttackCount?: IntegerParameterValueType;
|
|
76
81
|
maximumDamageDealtEventCount?: IntegerParameterValueType;
|
|
77
82
|
maximumDamageReceivedEventCount?: IntegerParameterValueType;
|
|
83
|
+
absorbedDamageFactor?: NumberParameterValueType;
|
|
84
|
+
maximumDamageAbsorbed?: NumberParameterValueType;
|
|
85
|
+
destroysOnMaximumDamageAbsorbed?: BooleanParameterValueType;
|
|
78
86
|
damageOnExpiration?: NumberParameterValueType;
|
|
79
87
|
healingOnExpiration?: NumberParameterValueType;
|
|
80
88
|
killsOnExpiration?: BooleanParameterValueType;
|
|
81
89
|
explodesOnExpiration?: BooleanParameterValueType;
|
|
90
|
+
abilityCooldownFactor?: NumberParameterValueType;
|
|
82
91
|
uniqueGroup?: BuffUniqueGroup;
|
|
83
92
|
} : BuffParameters & (T extends Buff<infer AdditionalParameters> ? AdditionalParameters : object);
|
|
84
93
|
declare const enum BuffPropertyKey {
|
|
@@ -117,20 +126,26 @@ declare const enum BuffPropertyKey {
|
|
|
117
126
|
MAXIMUM_DAMAGE_DEALT_EVENT_COUNT = 132,
|
|
118
127
|
DAMAGE_RECEIVED_EVENT_COUNT = 133,
|
|
119
128
|
MAXIMUM_DAMAGE_RECEIVED_EVENT_COUNT = 134,
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
129
|
+
ABSORBED_DAMAGE_FACTOR = 135,
|
|
130
|
+
MAXIMUM_DAMAGE_ABSORBED = 136,
|
|
131
|
+
DAMAGE_ABSORBED = 137,
|
|
132
|
+
DESTROYS_ON_MAXIMUM_DAMAGE_ABSORBED = 138,
|
|
133
|
+
TURNS_INTO_GHOST = 139,
|
|
134
|
+
STUNS = 140,
|
|
135
|
+
IGNORES_STUN_IMMUNITY = 141,
|
|
136
|
+
DISABLES_AUTO_ATTACK = 142,
|
|
137
|
+
PROVIDES_INVULNERABILITY = 143,
|
|
138
|
+
KILLS_ON_EXPIRATION = 144,
|
|
139
|
+
EXPLODES_ON_EXPIRATION = 145,
|
|
140
|
+
MISS_PROBABILITY = 146,
|
|
141
|
+
ABILITY_COOLDOWN_FACTOR = 147,
|
|
142
|
+
ABILITY_COOLDOWN_MODIFIER = 148
|
|
128
143
|
}
|
|
129
144
|
export declare const enum BuffTypeIdSelectionPolicy {
|
|
130
145
|
LEAST_DURATION = 0
|
|
131
146
|
}
|
|
132
147
|
export type BuffAdditionalParameters = Prohibit<Record<string, any>, keyof BuffParameters>;
|
|
133
|
-
export type BuffConstructorParameters<
|
|
148
|
+
export type BuffConstructorParameters<T extends Buff<BuffAdditionalParameters>> = T extends Buff<infer AdditionalParameters> ? [
|
|
134
149
|
...typeId: [ApplicableBuffTypeId] | [
|
|
135
150
|
typeIds: ReadonlyNonEmptyArray<ApplicableBuffTypeId>,
|
|
136
151
|
typeIdSelectionPolicy: BuffTypeIdSelectionPolicy
|
|
@@ -138,10 +153,12 @@ export type BuffConstructorParameters<AdditionalParameters extends BuffAdditiona
|
|
|
138
153
|
polarity: BuffPolarityParameterType,
|
|
139
154
|
resistanceType: BuffResistanceTypeParameterType,
|
|
140
155
|
...abilityOrParameters: [
|
|
141
|
-
ability?: Ability,
|
|
156
|
+
ability?: Ability | AbilityBehavior,
|
|
142
157
|
parameters?: BuffParameters & Omit<AdditionalParameters, keyof BuffParameters>
|
|
143
|
-
] | [
|
|
144
|
-
|
|
158
|
+
] | [
|
|
159
|
+
parameters?: BuffParameters & Omit<AdditionalParameters, keyof BuffParameters>
|
|
160
|
+
]
|
|
161
|
+
] : never;
|
|
145
162
|
export declare class Buff<AdditionalParameters extends Prohibit<Record<string, any>, keyof BuffParameters> = object> extends UnitBehavior {
|
|
146
163
|
private _unit;
|
|
147
164
|
protected readonly __additionalParametersBrand?: AdditionalParameters;
|
|
@@ -180,6 +197,10 @@ export declare class Buff<AdditionalParameters extends Prohibit<Record<string, a
|
|
|
180
197
|
private [BuffPropertyKey.DAMAGE_DEALT_EVENT_COUNT]?;
|
|
181
198
|
private [BuffPropertyKey.MAXIMUM_DAMAGE_RECEIVED_EVENT_COUNT]?;
|
|
182
199
|
private [BuffPropertyKey.DAMAGE_RECEIVED_EVENT_COUNT]?;
|
|
200
|
+
private [BuffPropertyKey.ABSORBED_DAMAGE_FACTOR]?;
|
|
201
|
+
private [BuffPropertyKey.MAXIMUM_DAMAGE_ABSORBED]?;
|
|
202
|
+
private [BuffPropertyKey.DAMAGE_ABSORBED]?;
|
|
203
|
+
private [BuffPropertyKey.DESTROYS_ON_MAXIMUM_DAMAGE_ABSORBED]?;
|
|
183
204
|
private [BuffPropertyKey.TURNS_INTO_GHOST]?;
|
|
184
205
|
private [BuffPropertyKey.STUNS]?;
|
|
185
206
|
private [BuffPropertyKey.IGNORES_STUN_IMMUNITY]?;
|
|
@@ -187,6 +208,8 @@ export declare class Buff<AdditionalParameters extends Prohibit<Record<string, a
|
|
|
187
208
|
private [BuffPropertyKey.PROVIDES_INVULNERABILITY]?;
|
|
188
209
|
private [BuffPropertyKey.KILLS_ON_EXPIRATION]?;
|
|
189
210
|
private [BuffPropertyKey.EXPLODES_ON_EXPIRATION]?;
|
|
211
|
+
private [BuffPropertyKey.ABILITY_COOLDOWN_FACTOR]?;
|
|
212
|
+
private [BuffPropertyKey.ABILITY_COOLDOWN_MODIFIER]?;
|
|
190
213
|
protected static readonly defaultParameters: BuffParameters;
|
|
191
214
|
get source(): Unit;
|
|
192
215
|
readonly typeId: ApplicableBuffTypeId;
|
|
@@ -201,12 +224,9 @@ export declare class Buff<AdditionalParameters extends Prohibit<Record<string, a
|
|
|
201
224
|
private readonly _spellStealPriority?;
|
|
202
225
|
private readonly _learnLevelMinimum?;
|
|
203
226
|
private readonly [BuffPropertyKey.MISS_PROBABILITY]?;
|
|
204
|
-
private _bonusIdByBonusType?;
|
|
205
227
|
private readonly _abilityTypeIds?;
|
|
206
228
|
private _behaviors?;
|
|
207
|
-
|
|
208
|
-
private addOrUpdateOrRemoveUnitBonus;
|
|
209
|
-
constructor(target: Unit, ...parameters: BuffConstructorParameters<AdditionalParameters>);
|
|
229
|
+
constructor(target: Unit, ...parameters: BuffConstructorParameters<Buff<AdditionalParameters>>);
|
|
210
230
|
get level(): number;
|
|
211
231
|
get remainingDamageOverDuration(): number;
|
|
212
232
|
set remainingDamageOverDuration(remainingDamageOverDuration: number);
|
|
@@ -234,6 +254,10 @@ export declare class Buff<AdditionalParameters extends Prohibit<Record<string, a
|
|
|
234
254
|
set receivedDamageFactor(receivedDamageFactor: number);
|
|
235
255
|
get armorIncrease(): number;
|
|
236
256
|
set armorIncrease(armorIncrease: number);
|
|
257
|
+
get maxHealthIncrease(): number;
|
|
258
|
+
set maxHealthIncrease(maxHealthIncrease: number);
|
|
259
|
+
get maxManaIncrease(): number;
|
|
260
|
+
set maxManaIncrease(maxManaIncrease: number);
|
|
237
261
|
get turnsIntoGhost(): boolean;
|
|
238
262
|
set turnsIntoGhost(turnsIntoGhost: boolean);
|
|
239
263
|
get stuns(): boolean;
|
|
@@ -262,14 +286,33 @@ export declare class Buff<AdditionalParameters extends Prohibit<Record<string, a
|
|
|
262
286
|
set movementSpeedIncreaseFactor(movementSpeedIncreaseFactor: number);
|
|
263
287
|
get evasionProbability(): number;
|
|
264
288
|
set evasionProbability(evasionProbability: number);
|
|
289
|
+
get manaRegenerationRateIncreaseFactor(): number;
|
|
290
|
+
set manaRegenerationRateIncreaseFactor(manaRegenerationRateIncreaseFactor: number);
|
|
265
291
|
get duration(): number;
|
|
292
|
+
set duration(duration: number);
|
|
266
293
|
get remainingDuration(): number;
|
|
267
294
|
set remainingDuration(remainingDuration: number);
|
|
295
|
+
get absorbedDamageFactor(): number;
|
|
296
|
+
set absorbedDamageFactor(absorbedDamageFactor: number);
|
|
297
|
+
get maximumDamageAbsorbed(): number;
|
|
298
|
+
set maximumDamageAbsorbed(maximumDamageAbsorbed: number);
|
|
299
|
+
get damageAbsorbed(): number;
|
|
300
|
+
get destroysOnMaximumDamageAbsorbed(): boolean;
|
|
301
|
+
set destroysOnMaximumDamageAbsorbed(destroysOnMaximumDamageAbsorbed: boolean);
|
|
302
|
+
get abilityCooldownFactor(): number;
|
|
303
|
+
set abilityCooldownFactor(abilityCooldownFactor: number);
|
|
304
|
+
onAbilityGained(ability: Ability): void;
|
|
305
|
+
onAbilityLost(ability: Ability): void;
|
|
268
306
|
flashEffect(...parameters: [
|
|
269
307
|
...widgetOrXY: [] | [Widget] | [x: number, x: number],
|
|
270
308
|
...parametersOrDuration: [] | [EffectParameters] | [number]
|
|
271
309
|
]): void;
|
|
272
|
-
flashSpecialEffect(...parameters: [
|
|
310
|
+
flashSpecialEffect(...parameters: [
|
|
311
|
+
...widgetOrXY: [] | [Widget] | [x: number, x: number],
|
|
312
|
+
...parametersOrDuration: [] | [EffectParameters] | [number]
|
|
313
|
+
]): void;
|
|
314
|
+
private flash;
|
|
315
|
+
expire(): void;
|
|
273
316
|
protected onCreate(): void;
|
|
274
317
|
protected onDestroy(): Destructor;
|
|
275
318
|
static apply<T extends Buff<any>, Args extends any[]>(this: BuffConstructor<T, Args>, ...args: Args): T | undefined;
|
|
@@ -278,6 +321,7 @@ export declare class Buff<AdditionalParameters extends Prohibit<Record<string, a
|
|
|
278
321
|
onDeath(source: Unit | undefined): void;
|
|
279
322
|
onDamageDealt(target: Unit, event: DamageEvent): void;
|
|
280
323
|
onDamageReceived(source: Unit | undefined, event: DamageEvent): void;
|
|
281
|
-
static readonly
|
|
324
|
+
static readonly createdEvent: Event<[Buff<object>]>;
|
|
325
|
+
static readonly beingDestroyedEvent: Event<[Buff<object>]>;
|
|
282
326
|
}
|
|
283
327
|
export {};
|