warscript 0.0.1-dev.d30161d → 0.0.1-dev.d63794c
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/core/types/effect.d.ts +13 -3
- package/core/types/effect.lua +116 -17
- package/core/types/frame.d.ts +6 -0
- package/core/types/frame.lua +91 -1
- package/core/util.d.ts +1 -1
- package/core/util.lua +12 -0
- package/engine/behavior.d.ts +2 -2
- package/engine/behavior.lua +6 -6
- 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 +3 -5
- package/engine/behaviour/ability/emulate-impact.d.ts +6 -0
- package/engine/behaviour/ability/emulate-impact.lua +29 -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 +18 -0
- package/engine/behaviour/ability/remove-buffs.d.ts +16 -0
- package/engine/behaviour/ability/remove-buffs.lua +28 -0
- package/engine/behaviour/ability.d.ts +9 -2
- package/engine/behaviour/ability.lua +47 -33
- package/engine/behaviour/unit.d.ts +5 -0
- package/engine/behaviour/unit.lua +20 -0
- package/engine/buff.d.ts +38 -12
- package/engine/buff.lua +171 -79
- package/engine/internal/ability.d.ts +16 -13
- package/engine/internal/ability.lua +87 -76
- package/engine/internal/item/ability.lua +32 -0
- package/engine/internal/item+owner.lua +2 -2
- package/engine/internal/misc/ability-disable-counter.d.ts +2 -0
- package/engine/internal/misc/ability-disable-counter.lua +13 -0
- package/engine/internal/unit/ability.d.ts +10 -1
- package/engine/internal/unit/ability.lua +36 -14
- package/engine/internal/unit/bonus.d.ts +4 -2
- package/engine/internal/unit/bonus.lua +6 -1
- package/engine/internal/unit/item.d.ts +24 -0
- package/engine/internal/unit/item.lua +79 -0
- package/engine/internal/unit/main-selected.d.ts +13 -0
- package/engine/internal/unit/main-selected.lua +51 -0
- package/engine/internal/unit+ability.lua +2 -2
- package/engine/internal/unit-missile-launch.lua +24 -5
- package/engine/internal/unit.d.ts +25 -10
- package/engine/internal/unit.lua +123 -71
- package/engine/internal/utility.lua +12 -0
- package/engine/local-client.d.ts +7 -2
- package/engine/local-client.lua +82 -0
- package/engine/object-data/auxiliary/sound-preset-name.d.ts +5 -1
- package/engine/object-data/entry/item-type.d.ts +12 -0
- package/engine/object-data/entry/item-type.lua +78 -0
- package/engine/object-field/ability.d.ts +21 -1
- package/engine/object-field/ability.lua +51 -1
- package/engine/standard/fields/ability.d.ts +2 -0
- package/engine/standard/fields/ability.lua +2 -0
- package/engine/unit.d.ts +2 -0
- package/engine/unit.lua +2 -0
- package/index.d.ts +1 -0
- package/index.lua +1 -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 +1 -1
- package/package.json +2 -2
- package/patch-lua.d.ts +0 -0
- package/patch-lua.lua +10 -0
- package/utility/arrays.d.ts +8 -1
- package/utility/arrays.lua +34 -3
- package/utility/lazy.d.ts +2 -0
- package/utility/lazy.lua +14 -0
- package/utility/linked-set.d.ts +11 -2
- package/utility/linked-set.lua +5 -2
- package/utility/types.d.ts +1 -0
package/utility/linked-set.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
/** @noSelfInFile */
|
|
2
|
+
import { NonEmptyArray, ReadonlyNonEmptyArray } from "./types";
|
|
2
3
|
type IteratorState<T extends AnyNotNil> = {
|
|
3
4
|
t: LuaMap<T, T>;
|
|
4
5
|
n?: T;
|
|
@@ -18,6 +19,11 @@ export interface ReadonlyLinkedSet<T extends AnyNotNil> extends LuaPairsKeyItera
|
|
|
18
19
|
toArray(): T[];
|
|
19
20
|
sumOf(selector: ((value: T) => number) | KeysOfType<T, number>): number;
|
|
20
21
|
}
|
|
22
|
+
export interface ReadonlyNonEmptyLinkedSet<T extends AnyNotNil> extends ReadonlyLinkedSet<T> {
|
|
23
|
+
first(): T;
|
|
24
|
+
last(): T;
|
|
25
|
+
toArray(): NonEmptyArray<T>;
|
|
26
|
+
}
|
|
21
27
|
export interface LinkedSet<T extends AnyNotNil> extends LuaPairsKeyIterable<T> {
|
|
22
28
|
readonly __linkedSet: unique symbol;
|
|
23
29
|
}
|
|
@@ -44,6 +50,9 @@ export declare class LinkedSet<T extends AnyNotNil> implements ReadonlyLinkedSet
|
|
|
44
50
|
protected __pairs(this: LinkedSet<T>): LuaIterator<T | undefined, IteratorState<T>>;
|
|
45
51
|
}
|
|
46
52
|
export declare const emptyLinkedSet: <T extends AnyNotNil>() => ReadonlyLinkedSet<T>;
|
|
47
|
-
export declare const
|
|
48
|
-
export declare const
|
|
53
|
+
export declare const mutableLinkedSetOf: <T extends AnyNotNil>(...elements: ReadonlyArray<T>) => LinkedSet<T>;
|
|
54
|
+
export declare const mutableLinkedSetOfNotNull: <T extends AnyNotNil>(...elements: readonly (T | undefined | null)[]) => LinkedSet<T>;
|
|
55
|
+
export declare const linkedSetOf: <T extends AnyNotNil>(...elements: ReadonlyArray<T>) => ReadonlyLinkedSet<T>;
|
|
56
|
+
export declare const linkedSetOfNotNull: <T extends AnyNotNil>(...elements: ReadonlyArray<T>) => ReadonlyLinkedSet<T>;
|
|
57
|
+
export declare const nonEmptyLinkedSetOf: <T extends AnyNotNil>(...elements: ReadonlyNonEmptyArray<T>) => ReadonlyNonEmptyLinkedSet<T>;
|
|
49
58
|
export {};
|
package/utility/linked-set.lua
CHANGED
|
@@ -177,14 +177,14 @@ local EMPTY_LINKED_SET = __TS__New(EmptyLinkedSet)
|
|
|
177
177
|
____exports.emptyLinkedSet = function()
|
|
178
178
|
return EMPTY_LINKED_SET
|
|
179
179
|
end
|
|
180
|
-
____exports.
|
|
180
|
+
____exports.mutableLinkedSetOf = function(...)
|
|
181
181
|
local linkedSet = __TS__New(____exports.LinkedSet)
|
|
182
182
|
for i = 1, select("#", ...) do
|
|
183
183
|
linkedSet:add((select(i, ...)))
|
|
184
184
|
end
|
|
185
185
|
return linkedSet
|
|
186
186
|
end
|
|
187
|
-
____exports.
|
|
187
|
+
____exports.mutableLinkedSetOfNotNull = function(...)
|
|
188
188
|
local linkedSet = __TS__New(____exports.LinkedSet)
|
|
189
189
|
for i = 1, select("#", ...) do
|
|
190
190
|
local element = (select(i, ...))
|
|
@@ -194,4 +194,7 @@ ____exports.linkedSetOfNotNull = function(...)
|
|
|
194
194
|
end
|
|
195
195
|
return linkedSet
|
|
196
196
|
end
|
|
197
|
+
____exports.linkedSetOf = function(...) return ____exports.mutableLinkedSetOf(...) end
|
|
198
|
+
____exports.linkedSetOfNotNull = function(...) return ____exports.mutableLinkedSetOfNotNull(...) end
|
|
199
|
+
____exports.nonEmptyLinkedSetOf = function(...) return ____exports.linkedSetOf(...) end
|
|
197
200
|
return ____exports
|
package/utility/types.d.ts
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
export type AnyNonNullable = {};
|
|
3
3
|
export type IsExactlyAny<T> = boolean extends (T extends never ? true : false) ? true : false;
|
|
4
4
|
export type NonEmptyArray<T> = [T, ...T[]];
|
|
5
|
+
export type ReadonlyNonEmptyArray<T> = readonly [T, ...T[]];
|
|
5
6
|
export type InvertRecordType<T extends Record<PropertyKey, PropertyKey | null | undefined>> = {
|
|
6
7
|
[P in keyof T as NonNullable<T[P]>]: P;
|
|
7
8
|
};
|