isaacscript-common 26.2.0 → 26.3.0
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/dist/index.rollup.d.ts +82 -8
- package/dist/isaacscript-common.lua +106 -57
- package/dist/src/classes/features/other/ModdedElementSets.d.ts.map +1 -1
- package/dist/src/classes/features/other/ModdedElementSets.lua +4 -2
- package/dist/src/classes/features/other/Pause.d.ts.map +1 -1
- package/dist/src/classes/features/other/Pause.lua +3 -2
- package/dist/src/functions/array.d.ts.map +1 -1
- package/dist/src/functions/array.lua +3 -2
- package/dist/src/functions/doors.d.ts.map +1 -1
- package/dist/src/functions/doors.lua +4 -2
- package/dist/src/functions/enums.d.ts.map +1 -1
- package/dist/src/functions/enums.lua +3 -2
- package/dist/src/functions/gridEntities.lua +3 -3
- package/dist/src/functions/logMisc.d.ts +51 -8
- package/dist/src/functions/logMisc.d.ts.map +1 -1
- package/dist/src/functions/logMisc.lua +69 -21
- package/dist/src/functions/players.d.ts.map +1 -1
- package/dist/src/functions/players.lua +6 -5
- package/dist/src/functions/random.d.ts.map +1 -1
- package/dist/src/functions/random.lua +3 -2
- package/dist/src/functions/roomShapeWalls.d.ts.map +1 -1
- package/dist/src/functions/roomShapeWalls.lua +12 -11
- package/dist/src/functions/rooms.d.ts.map +1 -1
- package/dist/src/functions/rooms.lua +3 -2
- package/dist/src/functions/set.d.ts.map +1 -1
- package/dist/src/functions/set.lua +3 -1
- package/dist/src/functions/utils.d.ts.map +1 -1
- package/dist/src/functions/utils.lua +3 -2
- package/dist/src/functions/vector.d.ts +7 -0
- package/dist/src/functions/vector.d.ts.map +1 -1
- package/dist/src/functions/vector.lua +5 -0
- package/dist/src/index.d.ts +1 -0
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.lua +8 -0
- package/package.json +1 -1
- package/src/classes/features/other/ModdedElementSets.ts +3 -2
- package/src/classes/features/other/Pause.ts +2 -1
- package/src/functions/array.ts +2 -1
- package/src/functions/doors.ts +3 -2
- package/src/functions/enums.ts +2 -1
- package/src/functions/gridEntities.ts +3 -3
- package/src/functions/logMisc.ts +99 -20
- package/src/functions/players.ts +5 -4
- package/src/functions/random.ts +2 -1
- package/src/functions/roomShapeWalls.ts +6 -5
- package/src/functions/rooms.ts +2 -1
- package/src/functions/set.ts +2 -1
- package/src/functions/utils.ts +2 -1
- package/src/functions/vector.ts +7 -0
- package/src/index.ts +1 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"array.d.ts","sourceRoot":"","sources":["../../../src/functions/array.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"array.d.ts","sourceRoot":"","sources":["../../../src/functions/array.ts"],"names":[],"mappings":";;;AAMA;;;GAGG;AACH,wBAAgB,WAAW,CAAC,CAAC,EAC3B,MAAM,EAAE,CAAC,EAAE,GAAG,SAAS,CAAC,EAAE,EAC1B,MAAM,EAAE,CAAC,EAAE,GAAG,SAAS,CAAC,EAAE,GACzB,OAAO,CAST;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,WAAW,CAAC,CAAC,EAC3B,aAAa,EAAE,CAAC,EAAE,GAAG,SAAS,CAAC,EAAE,EACjC,GAAG,gBAAgB,EAAE,CAAC,EAAE,GACvB,CAAC,EAAE,CAIL;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,cAAc,CAAC,CAAC,EAC9B,aAAa,EAAE,CAAC,EAAE,GAAG,SAAS,CAAC,EAAE,EACjC,GAAG,gBAAgB,EAAE,CAAC,EAAE,GACvB,CAAC,EAAE,CAIL;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,qBAAqB,CAAC,CAAC,EACrC,KAAK,EAAE,CAAC,EAAE,EACV,GAAG,gBAAgB,EAAE,CAAC,EAAE,GACvB,OAAO,CAcT;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,kBAAkB,CAAC,CAAC,EAClC,KAAK,EAAE,CAAC,EAAE,EACV,GAAG,gBAAgB,EAAE,CAAC,EAA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AAS,GAAE,IAAI,GAAG,GAAqB,GACtC,CAAC,EAAE,CAKL;AAED;;;;;;;;GAQG;AACH,wBAAgB,mBAAmB,CAAC,CAAC,EACnC,KAAK,EAAE,CAAC,EAAE,EACV,SAAS,GAAE,IAAI,GAAG,GAAqB,GACtC,IAAI,CAWN;AAED,+DAA+D;AAC/D,wBAAgB,QAAQ,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,SAAS,MAAM,EAAE,GAAG,MAAM,CAEpE;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,IAAI,CAM3E"}
|
|
@@ -2,7 +2,6 @@ local ____lualib = require("lualib_bundle")
|
|
|
2
2
|
local __TS__ArrayEvery = ____lualib.__TS__ArrayEvery
|
|
3
3
|
local __TS__ArrayIndexOf = ____lualib.__TS__ArrayIndexOf
|
|
4
4
|
local __TS__ArraySplice = ____lualib.__TS__ArraySplice
|
|
5
|
-
local Set = ____lualib.Set
|
|
6
5
|
local __TS__New = ____lualib.__TS__New
|
|
7
6
|
local __TS__ArrayForEach = ____lualib.__TS__ArrayForEach
|
|
8
7
|
local __TS__ArrayFilter = ____lualib.__TS__ArrayFilter
|
|
@@ -15,6 +14,8 @@ local __TS__ObjectKeys = ____lualib.__TS__ObjectKeys
|
|
|
15
14
|
local __TS__ArraySome = ____lualib.__TS__ArraySome
|
|
16
15
|
local __TS__ArrayReduce = ____lualib.__TS__ArrayReduce
|
|
17
16
|
local ____exports = {}
|
|
17
|
+
local ____ReadonlySet = require("src.types.ReadonlySet")
|
|
18
|
+
local ReadonlySet = ____ReadonlySet.ReadonlySet
|
|
18
19
|
local ____random = require("src.functions.random")
|
|
19
20
|
local getRandomInt = ____random.getRandomInt
|
|
20
21
|
local ____rng = require("src.functions.rng")
|
|
@@ -197,7 +198,7 @@ end
|
|
|
197
198
|
-- This function is variadic, meaning that you can specify N arguments to remove N elements.
|
|
198
199
|
function ____exports.arrayRemoveIndex(self, originalArray, ...)
|
|
199
200
|
local indexesToRemove = {...}
|
|
200
|
-
local indexesToRemoveSet = __TS__New(
|
|
201
|
+
local indexesToRemoveSet = __TS__New(ReadonlySet, indexesToRemove)
|
|
201
202
|
local array = {}
|
|
202
203
|
__TS__ArrayForEach(
|
|
203
204
|
originalArray,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"doors.d.ts","sourceRoot":"","sources":["../../../src/functions/doors.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,QAAQ,EACR,YAAY,EAKZ,SAAS,EACT,QAAQ,EACT,MAAM,8BAA8B,CAAC;
|
|
1
|
+
{"version":3,"file":"doors.d.ts","sourceRoot":"","sources":["../../../src/functions/doors.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,QAAQ,EACR,YAAY,EAKZ,SAAS,EACT,QAAQ,EACT,MAAM,8BAA8B,CAAC;AAuBtC,wBAAgB,aAAa,IAAI,IAAI,CAIpC;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,cAAc,GAAG,IAAI,CAKxD;AAED,wBAAgB,sBAAsB,CAAC,YAAY,EAAE,YAAY,GAAG,QAAQ,CAG3E;AAED,wBAAgB,wBAAwB,CACtC,aAAa,EAAE,QAAQ,CAAC,YAAY,CAAC,GACpC,QAAQ,EAAE,CAWZ;AAED,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,QAAQ,GAAG,SAAS,CAEjE;AAED,wBAAgB,sBAAsB,CAAC,QAAQ,EAAE,QAAQ,GAAG,YAAY,CAEvE;AAED;;;GAGG;AACH,wBAAgB,wBAAwB,CACtC,SAAS,EACL,QAAQ,EAAE,GACV,SAAS,QAAQ,EAAE,GACnB,GAAG,CAAC,QAAQ,CAAC,GACb,WAAW,CAAC,QAAQ,CAAC,GACxB,QAAQ,CAAC,YAAY,CAAC,CASxB;AAED,wBAAgB,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AAgB,YAAY,CAAC,IAAI,EAAE,cAAc,GAAG,IAAI,CAKvD;AAED;;;;;;GAMG;AACH,wBAAgB,cAAc,CAAC,GAAG,SAAS,EAAE,QAAQ,EAAE,GAAG,GAAG,CAK5D;AAED,+CAA+C;AAC/C,wBAAgB,UAAU,CAAC,IAAI,EAAE,cAAc,GAAG,IAAI,CAGrD;AAED;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,GAAG,KAAK,EAAE,cAAc,EAAE,GAAG,IAAI,CAI5D"}
|
|
@@ -35,6 +35,8 @@ local ____roomShapeToDoorSlotCoordinates = require("src.objects.roomShapeToDoorS
|
|
|
35
35
|
local ROOM_SHAPE_TO_DOOR_SLOT_COORDINATES = ____roomShapeToDoorSlotCoordinates.ROOM_SHAPE_TO_DOOR_SLOT_COORDINATES
|
|
36
36
|
local ____roomShapeToDoorSlots = require("src.objects.roomShapeToDoorSlots")
|
|
37
37
|
local ROOM_SHAPE_TO_DOOR_SLOTS = ____roomShapeToDoorSlots.ROOM_SHAPE_TO_DOOR_SLOTS
|
|
38
|
+
local ____ReadonlySet = require("src.types.ReadonlySet")
|
|
39
|
+
local ReadonlySet = ____ReadonlySet.ReadonlySet
|
|
38
40
|
local ____bitwise = require("src.functions.bitwise")
|
|
39
41
|
local arrayToBitFlags = ____bitwise.arrayToBitFlags
|
|
40
42
|
local ____direction = require("src.functions.direction")
|
|
@@ -70,7 +72,7 @@ function ____exports.getDoors(self, ...)
|
|
|
70
72
|
local roomTypes = {...}
|
|
71
73
|
local room = game:GetRoom()
|
|
72
74
|
local roomShape = room:GetRoomShape()
|
|
73
|
-
local roomTypesSet = __TS__New(
|
|
75
|
+
local roomTypesSet = __TS__New(ReadonlySet, roomTypes)
|
|
74
76
|
local possibleDoorSlots = ____exports.getDoorSlotsForRoomShape(nil, roomShape)
|
|
75
77
|
local doors = {}
|
|
76
78
|
for ____, doorSlot in __TS__Iterator(possibleDoorSlots) do
|
|
@@ -230,7 +232,7 @@ end
|
|
|
230
232
|
-- that match any of the N room grid indexes.
|
|
231
233
|
function ____exports.getDoorsToRoomIndex(self, ...)
|
|
232
234
|
local roomGridIndex = {...}
|
|
233
|
-
local roomGridIndexesSet = __TS__New(
|
|
235
|
+
local roomGridIndexesSet = __TS__New(ReadonlySet, roomGridIndex)
|
|
234
236
|
local doors = ____exports.getDoors(nil)
|
|
235
237
|
return __TS__ArrayFilter(
|
|
236
238
|
doors,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"enums.d.ts","sourceRoot":"","sources":["../../../src/functions/enums.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"enums.d.ts","sourceRoot":"","sources":["../../../src/functions/enums.ts"],"names":[],"mappings":";;;AAMA;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,cAAc,CAAC,CAAC,EAC9B,cAAc,EAAE,CAAC,GAChB,KAAK,CAAC,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAmBzC;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,WAAW,CAAC,CAAC,EAAE,cAAc,EAAE,CAAC,GAAG,MAAM,EAAE,CAG1D;AAED,sEAAsE;AACtE,wBAAgB,aAAa,CAAC,CAAC,EAAE,cAAc,EAAE,CAAC,GAAG,GAAG,CAGvD;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,aAAa,CAAC,CAAC,EAAE,cAAc,EAAE,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAGrE;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,CAAC,EAAE,cAAc,EAAE,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,CAAC,CAWpE;AAED;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,CAAC,CAAC,EAClC,cAAc,EAAE,CAAC,EACjB,SAAS,GAAE,IAAI,GAAG,GAAqB,EACvC,UAAU,GAAE,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,aAAa,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAM,GAC7D,CAAC,CAAC,MAAM,CAAC,CAAC,CAGZ;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,kBAAkB,CAChC,kBAAkB,EAAE,MAAM,EAC1B,cAAc,EAAE,OAAO,GACtB,IAAI,CAQN;AAED;;;;GAIG;AACH,wBAAgB,sBAAsB,CAAC,CAAC,EACtC,kBAAkB,EAAE,MAAM,EAC1B,cAAc,EAAE,CAAC,GAChB,IAAI,CAsBN;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,wBAAgB,4BAA4B,CAE1C,CAAC,SAAS,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,EAC/B,IAAI,SAAS,MAAM,GAAG,MAAM,KACzB,IAAI,CAAG"}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
local ____lualib = require("lualib_bundle")
|
|
2
2
|
local __TS__ArraySort = ____lualib.__TS__ArraySort
|
|
3
3
|
local __TS__ArrayMap = ____lualib.__TS__ArrayMap
|
|
4
|
-
local Set = ____lualib.Set
|
|
5
4
|
local __TS__New = ____lualib.__TS__New
|
|
6
5
|
local ____exports = {}
|
|
6
|
+
local ____ReadonlySet = require("src.types.ReadonlySet")
|
|
7
|
+
local ReadonlySet = ____ReadonlySet.ReadonlySet
|
|
7
8
|
local ____array = require("src.functions.array")
|
|
8
9
|
local getRandomArrayElement = ____array.getRandomArrayElement
|
|
9
10
|
local ____rng = require("src.functions.rng")
|
|
@@ -167,7 +168,7 @@ function ____exports.validateEnumContiguous(self, transpiledEnumName, transpiled
|
|
|
167
168
|
if type(lastValue) ~= "number" then
|
|
168
169
|
error("Failed to validate that an enum was contiguous, since the last value was not a number.")
|
|
169
170
|
end
|
|
170
|
-
local valuesSet = __TS__New(
|
|
171
|
+
local valuesSet = __TS__New(ReadonlySet, values)
|
|
171
172
|
for ____, value in ipairs(iRange(nil, lastValue)) do
|
|
172
173
|
if not valuesSet:has(value) then
|
|
173
174
|
error((("Failed to find a custom enum value of " .. tostring(value)) .. " for: ") .. transpiledEnumName)
|
|
@@ -248,7 +248,7 @@ function ____exports.getGridEntities(self, ...)
|
|
|
248
248
|
if #gridEntityTypes == 0 then
|
|
249
249
|
return gridEntities
|
|
250
250
|
end
|
|
251
|
-
local gridEntityTypesSet = __TS__New(
|
|
251
|
+
local gridEntityTypesSet = __TS__New(ReadonlySet, gridEntityTypes)
|
|
252
252
|
return __TS__ArrayFilter(
|
|
253
253
|
gridEntities,
|
|
254
254
|
function(____, gridEntity)
|
|
@@ -267,7 +267,7 @@ function ____exports.getGridEntitiesExcept(self, ...)
|
|
|
267
267
|
if #gridEntityTypes == 0 then
|
|
268
268
|
return gridEntities
|
|
269
269
|
end
|
|
270
|
-
local gridEntityTypesSet = __TS__New(
|
|
270
|
+
local gridEntityTypesSet = __TS__New(ReadonlySet, gridEntityTypes)
|
|
271
271
|
return __TS__ArrayFilter(
|
|
272
272
|
gridEntities,
|
|
273
273
|
function(____, gridEntity)
|
|
@@ -420,7 +420,7 @@ end
|
|
|
420
420
|
-- @returns The grid entities that were removed.
|
|
421
421
|
function ____exports.removeAllGridEntitiesExcept(self, ...)
|
|
422
422
|
local gridEntityTypes = {...}
|
|
423
|
-
local gridEntityTypeExceptions = __TS__New(
|
|
423
|
+
local gridEntityTypeExceptions = __TS__New(ReadonlySet, gridEntityTypes)
|
|
424
424
|
local gridEntities = ____exports.getGridEntities(nil)
|
|
425
425
|
local removedGridEntities = {}
|
|
426
426
|
for ____, gridEntity in ipairs(gridEntities) do
|
|
@@ -1,9 +1,26 @@
|
|
|
1
1
|
/// <reference types="@typescript-to-lua/language-extensions" />
|
|
2
2
|
import { CollectibleType, DamageFlag, EntityFlag, ProjectileFlag, TearFlag, UseFlag } from "isaac-typescript-definitions";
|
|
3
|
-
/**
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
3
|
+
/**
|
|
4
|
+
* Helper function to log all of the values in an array.
|
|
5
|
+
*
|
|
6
|
+
* @param array The array to log.
|
|
7
|
+
* @param name Optional. The name of the array, which will be logged before the elements.
|
|
8
|
+
*/
|
|
9
|
+
export declare function logArray<T>(this: void, array: T[] | readonly T[], name?: string): void;
|
|
10
|
+
/**
|
|
11
|
+
* Helper function to log the names of a collectible type array.
|
|
12
|
+
*
|
|
13
|
+
* @param collectibleTypes The collectible types to log.
|
|
14
|
+
* @param name Optional. The name of the array, which will be logged before the elements.
|
|
15
|
+
*/
|
|
16
|
+
export declare function logCollectibleTypes(this: void, collectibleTypes: CollectibleType[], name?: string): void;
|
|
17
|
+
/**
|
|
18
|
+
* Helper function to log a `Color` object.
|
|
19
|
+
*
|
|
20
|
+
* @param color The `Color` object to log.
|
|
21
|
+
* @param name Optional. The name of the object, which will be logged before the properties.
|
|
22
|
+
*/
|
|
23
|
+
export declare function logColor(this: void, color: Color, name?: string): void;
|
|
7
24
|
/** Helper function for printing out every damage flag that is turned on. Useful when debugging. */
|
|
8
25
|
export declare function logDamageFlags(this: void, flags: DamageFlag | BitFlags<DamageFlag>): void;
|
|
9
26
|
/** Helper function for printing out every entity flag that is turned on. Useful when debugging. */
|
|
@@ -22,12 +39,24 @@ export declare function logFlags<T extends BitFlag | BitFlag128>(this: void, fla
|
|
|
22
39
|
* Helper function for printing out every game state flag that is turned on. Useful when debugging.
|
|
23
40
|
*/
|
|
24
41
|
export declare function logGameStateFlags(this: void): void;
|
|
25
|
-
|
|
42
|
+
/**
|
|
43
|
+
* Helper function to log a `KColor` object.
|
|
44
|
+
*
|
|
45
|
+
* @param kColor The `KColor` object to log.
|
|
46
|
+
* @param name Optional. The name of the object, which will be logged before the properties.
|
|
47
|
+
*/
|
|
48
|
+
export declare function logKColor(this: void, kColor: KColor, name?: string): void;
|
|
26
49
|
/**
|
|
27
50
|
* Helper function for printing out every level state flag that is turned on. Useful when debugging.
|
|
28
51
|
*/
|
|
29
52
|
export declare function logLevelStateFlags(this: void): void;
|
|
30
|
-
|
|
53
|
+
/**
|
|
54
|
+
* Helper function to log a TSTL `Map`.
|
|
55
|
+
*
|
|
56
|
+
* @param map The TSTL `Map` to log.
|
|
57
|
+
* @param name Optional. The name of the map, which will be logged before the elements.
|
|
58
|
+
*/
|
|
59
|
+
export declare function logMap(this: void, map: Map<AnyNotNil, unknown>, name?: string): void;
|
|
31
60
|
export declare function logMusic(this: void): void;
|
|
32
61
|
export declare function logPlayerEffects(this: void, player: EntityPlayer): void;
|
|
33
62
|
export declare function logPlayerHealth(this: void, player: EntityPlayer): void;
|
|
@@ -42,7 +71,13 @@ export declare function logRoom(this: void): void;
|
|
|
42
71
|
* particular run.
|
|
43
72
|
*/
|
|
44
73
|
export declare function logSeedEffects(this: void): void;
|
|
45
|
-
|
|
74
|
+
/**
|
|
75
|
+
* Helper function to log a TSTL `Set`.
|
|
76
|
+
*
|
|
77
|
+
* @param set The TSTL `Set` to log.
|
|
78
|
+
* @param name Optional. The name of the set, which will be logged before the elements.
|
|
79
|
+
*/
|
|
80
|
+
export declare function logSet(this: void, set: Set<AnyNotNil> | ReadonlySet<AnyNotNil>, name?: string): void;
|
|
46
81
|
/** Helper function for logging every sound effect that is currently playing. */
|
|
47
82
|
export declare function logSounds(this: void): void;
|
|
48
83
|
/**
|
|
@@ -77,5 +112,13 @@ export declare function logUseFlags(this: void, flags: UseFlag | BitFlags<UseFla
|
|
|
77
112
|
* the Isaac API).
|
|
78
113
|
*/
|
|
79
114
|
export declare function logUserdata(this: void, userdata: unknown): void;
|
|
80
|
-
|
|
115
|
+
/**
|
|
116
|
+
* Helper function to log a `Vector` object.
|
|
117
|
+
*
|
|
118
|
+
* @param vector The `Vector` object to log.
|
|
119
|
+
* @param name Optional. The name of the object, which will be logged before the properties.
|
|
120
|
+
* @param round Optional. If true, will round the vector values to the nearest integer. Default is
|
|
121
|
+
* false.
|
|
122
|
+
*/
|
|
123
|
+
export declare function logVector(this: void, vector: Vector, name?: string, round?: boolean): void;
|
|
81
124
|
//# sourceMappingURL=logMisc.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logMisc.d.ts","sourceRoot":"","sources":["../../../src/functions/logMisc.ts"],"names":[],"mappings":";AAAA,OAAO,EACL,eAAe,EACf,UAAU,EACV,UAAU,EAMV,cAAc,EAGd,QAAQ,EACR,OAAO,EACR,MAAM,8BAA8B,CAAC;
|
|
1
|
+
{"version":3,"file":"logMisc.d.ts","sourceRoot":"","sources":["../../../src/functions/logMisc.ts"],"names":[],"mappings":";AAAA,OAAO,EACL,eAAe,EACf,UAAU,EACV,UAAU,EAMV,cAAc,EAGd,QAAQ,EACR,OAAO,EACR,MAAM,8BAA8B,CAAC;AAoBtC;;;;;GAKG;AACH,wBAAgB,QAAQ,CAAC,CAAC,EACxB,IAAI,EAAE,IAAI,EACV,KAAK,EAAE,CAAC,EAAE,GAAG,SAAS,CAAC,EAAE,EACzB,IAAI,CAAC,EAAE,MAAM,GACZ,IAAI,CAaN;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,CACjC,IAAI,EAAE,IAAI,EACV,gBAAgB,EAAE,eAAe,EAAE,EACnC,IAAI,CAAC,EAAE,MAAM,GACZ,IAAI,CAaN;AAED;;;;;GAKG;AACH,wBAAgB,QAAQ,CAAC,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAQtE;AAED,mGAAmG;AACnG,wBAAgB,cAAc,CAC5B,IAAI,EAAE,IAAI,EACV,KAAK,EAAE,UAAU,GAAG,QAAQ,CAAC,UAAU,CAAC,GACvC,IAAI,CAEN;AAED,mGAAmG;AACnG,wBAAgB,cAAc,CAC5B,IAAI,EAAE,IAAI,EACV,KAAK,EAAE,UAAU,GAAG,QAAQ,CAAC,UAAU,CAAC,GACvC,IAAI,CAEN;AAED,wBAAgB,WAAW,CAAC,IAAI,EAAE,IAAI,EAAE,MAAM,E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AS,CACvB,IAAI,EAAE,IAAI,EACV,MAAM,EAAE,MAAM,EACd,IAAI,CAAC,EAAE,MAAM,EACb,KAAK,UAAQ,GACZ,IAAI,CAON"}
|
|
@@ -25,6 +25,8 @@ local ____cachedClasses = require("src.core.cachedClasses")
|
|
|
25
25
|
local game = ____cachedClasses.game
|
|
26
26
|
local musicManager = ____cachedClasses.musicManager
|
|
27
27
|
local sfxManager = ____cachedClasses.sfxManager
|
|
28
|
+
local ____ReadonlySet = require("src.types.ReadonlySet")
|
|
29
|
+
local ReadonlySet = ____ReadonlySet.ReadonlySet
|
|
28
30
|
local ____array = require("src.functions.array")
|
|
29
31
|
local arrayToString = ____array.arrayToString
|
|
30
32
|
local isArray = ____array.isArray
|
|
@@ -40,6 +42,7 @@ local ____isaacAPIClass = require("src.functions.isaacAPIClass")
|
|
|
40
42
|
local getIsaacAPIClassName = ____isaacAPIClass.getIsaacAPIClassName
|
|
41
43
|
local ____log = require("src.functions.log")
|
|
42
44
|
local log = ____log.log
|
|
45
|
+
local logAndPrint = ____log.logAndPrint
|
|
43
46
|
local ____playerHealth = require("src.functions.playerHealth")
|
|
44
47
|
local getPlayerHealth = ____playerHealth.getPlayerHealth
|
|
45
48
|
local ____players = require("src.functions.players")
|
|
@@ -87,17 +90,30 @@ function ____exports.logFlags(flags, flagEnum, description)
|
|
|
87
90
|
log(" n/a (no flags)")
|
|
88
91
|
end
|
|
89
92
|
end
|
|
90
|
-
--- Helper function to
|
|
91
|
-
|
|
93
|
+
--- Helper function to log all of the values in an array.
|
|
94
|
+
--
|
|
95
|
+
-- @param array The array to log.
|
|
96
|
+
-- @param name Optional. The name of the array, which will be logged before the elements.
|
|
97
|
+
function ____exports.logArray(array, name)
|
|
92
98
|
if not isArray(nil, array, false) then
|
|
93
99
|
log("Tried to log an array, but the given object was not an array.")
|
|
94
100
|
return
|
|
95
101
|
end
|
|
96
102
|
local arrayString = arrayToString(nil, array)
|
|
97
|
-
|
|
103
|
+
if name == nil then
|
|
104
|
+
name = "array"
|
|
105
|
+
end
|
|
106
|
+
log((("Logging " .. name) .. ": ") .. arrayString)
|
|
98
107
|
end
|
|
99
|
-
function
|
|
100
|
-
|
|
108
|
+
--- Helper function to log the names of a collectible type array.
|
|
109
|
+
--
|
|
110
|
+
-- @param collectibleTypes The collectible types to log.
|
|
111
|
+
-- @param name Optional. The name of the array, which will be logged before the elements.
|
|
112
|
+
function ____exports.logCollectibleTypes(collectibleTypes, name)
|
|
113
|
+
if name == nil then
|
|
114
|
+
name = "collectibles"
|
|
115
|
+
end
|
|
116
|
+
log(("Logging " .. name) .. ":")
|
|
101
117
|
local i = 1
|
|
102
118
|
for ____, collectibleType in ipairs(collectibleTypes) do
|
|
103
119
|
local collectibleName = getCollectibleName(nil, collectibleType)
|
|
@@ -105,8 +121,15 @@ function ____exports.logCollectibleTypes(collectibleTypes)
|
|
|
105
121
|
i = i + 1
|
|
106
122
|
end
|
|
107
123
|
end
|
|
108
|
-
function
|
|
109
|
-
|
|
124
|
+
--- Helper function to log a `Color` object.
|
|
125
|
+
--
|
|
126
|
+
-- @param color The `Color` object to log.
|
|
127
|
+
-- @param name Optional. The name of the object, which will be logged before the properties.
|
|
128
|
+
function ____exports.logColor(color, name)
|
|
129
|
+
if name == nil then
|
|
130
|
+
name = "color"
|
|
131
|
+
end
|
|
132
|
+
log((((((((((((((("Logging " .. name) .. ": R") .. tostring(color.R)) .. ", G") .. tostring(color.G)) .. ", B") .. tostring(color.B)) .. ", A") .. tostring(color.A)) .. ", RO") .. tostring(color.RO)) .. ", BO") .. tostring(color.BO)) .. ", GO") .. tostring(color.GO))
|
|
110
133
|
end
|
|
111
134
|
--- Helper function for printing out every damage flag that is turned on. Useful when debugging.
|
|
112
135
|
function ____exports.logDamageFlags(flags)
|
|
@@ -118,7 +141,7 @@ function ____exports.logEntityFlags(flags)
|
|
|
118
141
|
end
|
|
119
142
|
function ____exports.logEntityID(entity)
|
|
120
143
|
local entityID = getEntityID(nil, entity)
|
|
121
|
-
log("
|
|
144
|
+
log("Logging entity: " .. entityID)
|
|
122
145
|
end
|
|
123
146
|
--- Helper function to log an error message and also print it to the console for better visibility.
|
|
124
147
|
--
|
|
@@ -126,8 +149,7 @@ end
|
|
|
126
149
|
-- prevents all of the subsequent code in the callback from running).
|
|
127
150
|
function ____exports.logError(msg)
|
|
128
151
|
local errorMsg = "Error: " .. msg
|
|
129
|
-
|
|
130
|
-
print(errorMsg)
|
|
152
|
+
logAndPrint(nil, errorMsg)
|
|
131
153
|
end
|
|
132
154
|
--- Helper function for printing out every game state flag that is turned on. Useful when debugging.
|
|
133
155
|
function ____exports.logGameStateFlags()
|
|
@@ -147,8 +169,15 @@ function ____exports.logGameStateFlags()
|
|
|
147
169
|
log(" n/a (no flags)")
|
|
148
170
|
end
|
|
149
171
|
end
|
|
150
|
-
function
|
|
151
|
-
|
|
172
|
+
--- Helper function to log a `KColor` object.
|
|
173
|
+
--
|
|
174
|
+
-- @param kColor The `KColor` object to log.
|
|
175
|
+
-- @param name Optional. The name of the object, which will be logged before the properties.
|
|
176
|
+
function ____exports.logKColor(kColor, name)
|
|
177
|
+
if name == nil then
|
|
178
|
+
name = "KColor"
|
|
179
|
+
end
|
|
180
|
+
log((((((((("Logging " .. name) .. ": R") .. tostring(kColor.Red)) .. ", G") .. tostring(kColor.Green)) .. ", B") .. tostring(kColor.Blue)) .. ", A") .. tostring(kColor.Alpha))
|
|
152
181
|
end
|
|
153
182
|
--- Helper function for printing out every level state flag that is turned on. Useful when debugging.
|
|
154
183
|
function ____exports.logLevelStateFlags()
|
|
@@ -169,12 +198,17 @@ function ____exports.logLevelStateFlags()
|
|
|
169
198
|
log(" n/a (no flags)")
|
|
170
199
|
end
|
|
171
200
|
end
|
|
172
|
-
function
|
|
201
|
+
--- Helper function to log a TSTL `Map`.
|
|
202
|
+
--
|
|
203
|
+
-- @param map The TSTL `Map` to log.
|
|
204
|
+
-- @param name Optional. The name of the map, which will be logged before the elements.
|
|
205
|
+
function ____exports.logMap(map, name)
|
|
173
206
|
if not isTSTLMap(nil, map) and not isDefaultMap(nil, map) then
|
|
174
207
|
log("Tried to log a TSTL map, but the given object was not a TSTL map.")
|
|
175
208
|
return
|
|
176
209
|
end
|
|
177
|
-
|
|
210
|
+
local suffix = name == nil and (" \"" .. tostring(name)) .. "\"" or ""
|
|
211
|
+
log(("Printing out a TSTL map" .. suffix) .. ":")
|
|
178
212
|
local mapKeys = {__TS__Spread(map:keys())}
|
|
179
213
|
__TS__ArraySort(mapKeys)
|
|
180
214
|
for ____, key in ipairs(mapKeys) do
|
|
@@ -244,7 +278,7 @@ function ____exports.logRoom()
|
|
|
244
278
|
local roomGridIndex = getRoomGridIndex(nil)
|
|
245
279
|
local roomListIndex = getRoomListIndex(nil)
|
|
246
280
|
local roomData = getRoomData(nil)
|
|
247
|
-
log("
|
|
281
|
+
log("Logging room information:")
|
|
248
282
|
if roomData == nil then
|
|
249
283
|
log("- Room data is undefined.")
|
|
250
284
|
else
|
|
@@ -280,12 +314,17 @@ function ____exports.logSeedEffects()
|
|
|
280
314
|
log(" n/a (no seed effects)")
|
|
281
315
|
end
|
|
282
316
|
end
|
|
283
|
-
function
|
|
317
|
+
--- Helper function to log a TSTL `Set`.
|
|
318
|
+
--
|
|
319
|
+
-- @param set The TSTL `Set` to log.
|
|
320
|
+
-- @param name Optional. The name of the set, which will be logged before the elements.
|
|
321
|
+
function ____exports.logSet(set, name)
|
|
284
322
|
if not isTSTLSet(nil, set) then
|
|
285
323
|
log("Tried to log a TSTL set, but the given object was not a TSTL set.")
|
|
286
324
|
return
|
|
287
325
|
end
|
|
288
|
-
|
|
326
|
+
local suffix = name == nil and (" \"" .. tostring(name)) .. "\"" or ""
|
|
327
|
+
log(("Printing out a TSTL set" .. suffix) .. ":")
|
|
289
328
|
local setValues = getSortedSetValues(nil, set)
|
|
290
329
|
for ____, value in ipairs(setValues) do
|
|
291
330
|
log(" Value: " .. tostring(value))
|
|
@@ -361,9 +400,9 @@ end
|
|
|
361
400
|
function ____exports.logTableDifferences(table1, table2)
|
|
362
401
|
log("Comparing two Lua tables:")
|
|
363
402
|
local table1Keys = __TS__ObjectKeys(table1)
|
|
364
|
-
local table1KeysSet = __TS__New(
|
|
403
|
+
local table1KeysSet = __TS__New(ReadonlySet, table1Keys)
|
|
365
404
|
local table2Keys = __TS__ObjectKeys(table2)
|
|
366
|
-
local table2KeysSet = __TS__New(
|
|
405
|
+
local table2KeysSet = __TS__New(ReadonlySet, table2Keys)
|
|
367
406
|
local keysSet = combineSets(nil, table1KeysSet, table2KeysSet)
|
|
368
407
|
local keys = {__TS__Spread(keysSet:values())}
|
|
369
408
|
__TS__ArraySort(keys)
|
|
@@ -430,11 +469,20 @@ function ____exports.logUserdata(userdata)
|
|
|
430
469
|
end
|
|
431
470
|
____exports.logTable(metatable)
|
|
432
471
|
end
|
|
433
|
-
function
|
|
472
|
+
--- Helper function to log a `Vector` object.
|
|
473
|
+
--
|
|
474
|
+
-- @param vector The `Vector` object to log.
|
|
475
|
+
-- @param name Optional. The name of the object, which will be logged before the properties.
|
|
476
|
+
-- @param round Optional. If true, will round the vector values to the nearest integer. Default is
|
|
477
|
+
-- false.
|
|
478
|
+
function ____exports.logVector(vector, name, round)
|
|
434
479
|
if round == nil then
|
|
435
480
|
round = false
|
|
436
481
|
end
|
|
482
|
+
if name == nil then
|
|
483
|
+
name = "vector"
|
|
484
|
+
end
|
|
437
485
|
local vectorString = vectorToString(nil, vector, round)
|
|
438
|
-
log("
|
|
486
|
+
log((("Logging " .. name) .. ": ") .. vectorString)
|
|
439
487
|
end
|
|
440
488
|
return ____exports
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"players.d.ts","sourceRoot":"","sources":["../../../src/functions/players.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EAEV,eAAe,EACf,eAAe,EAEf,UAAU,EACV,UAAU,EACV,WAAW,EACZ,MAAM,8BAA8B,CAAC;
|
|
1
|
+
{"version":3,"file":"players.d.ts","sourceRoot":"","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,CA6DN;AAED;;;;;;;;GAQG;AACH,wBAAgB,YAAY,CAC1B,MAAM,EAAE,YAAY,EACpB,OAAO,EAAE,OAAO,EAChB,aAAa,UAAO,GACnB,IAAI,CAsBN;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAC/B,MAAM,EAAE,YAAY,EACpB,eAAe,EAAE,eAAe,GAC/B,IAAI,CAEN"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
local ____lualib = require("lualib_bundle")
|
|
2
2
|
local __TS__ArraySome = ____lualib.__TS__ArraySome
|
|
3
|
-
local Set = ____lualib.Set
|
|
4
3
|
local __TS__New = ____lualib.__TS__New
|
|
5
4
|
local __TS__ArrayFilter = ____lualib.__TS__ArrayFilter
|
|
6
5
|
local __TS__ArrayMap = ____lualib.__TS__ArrayMap
|
|
@@ -22,6 +21,8 @@ local TRINKET_SLOT_VALUES = ____cachedEnumValues.TRINKET_SLOT_VALUES
|
|
|
22
21
|
local ____cachedClasses = require("src.core.cachedClasses")
|
|
23
22
|
local game = ____cachedClasses.game
|
|
24
23
|
local itemConfig = ____cachedClasses.itemConfig
|
|
24
|
+
local ____ReadonlySet = require("src.types.ReadonlySet")
|
|
25
|
+
local ReadonlySet = ____ReadonlySet.ReadonlySet
|
|
25
26
|
local ____array = require("src.functions.array")
|
|
26
27
|
local getLastElement = ____array.getLastElement
|
|
27
28
|
local sumArray = ____array.sumArray
|
|
@@ -52,7 +53,7 @@ end
|
|
|
52
53
|
-- for. Returns true if the player is any of the supplied characters.
|
|
53
54
|
function ____exports.isCharacter(self, player, ...)
|
|
54
55
|
local characters = {...}
|
|
55
|
-
local characterSet = __TS__New(
|
|
56
|
+
local characterSet = __TS__New(ReadonlySet, characters)
|
|
56
57
|
local character = player:GetPlayerType()
|
|
57
58
|
return characterSet:has(character)
|
|
58
59
|
end
|
|
@@ -107,7 +108,7 @@ end
|
|
|
107
108
|
-- for. Returns true if any of the characters supplied are present.
|
|
108
109
|
function ____exports.anyPlayerIs(self, ...)
|
|
109
110
|
local matchingCharacters = {...}
|
|
110
|
-
local matchingCharacterSet = __TS__New(
|
|
111
|
+
local matchingCharacterSet = __TS__New(ReadonlySet, matchingCharacters)
|
|
111
112
|
local characters = ____exports.getCharacters(nil)
|
|
112
113
|
return __TS__ArraySome(
|
|
113
114
|
characters,
|
|
@@ -308,7 +309,7 @@ end
|
|
|
308
309
|
-- for. Returns true if any of the characters supplied are present.
|
|
309
310
|
function ____exports.getPlayersOfType(self, ...)
|
|
310
311
|
local characters = {...}
|
|
311
|
-
local charactersSet = __TS__New(
|
|
312
|
+
local charactersSet = __TS__New(ReadonlySet, characters)
|
|
312
313
|
local players = getPlayers(nil)
|
|
313
314
|
return __TS__ArrayFilter(
|
|
314
315
|
players,
|
|
@@ -405,7 +406,7 @@ end
|
|
|
405
406
|
-- provided.
|
|
406
407
|
function ____exports.hasCollectibleInActiveSlot(self, player, collectibleType, ...)
|
|
407
408
|
local activeSlots = {...}
|
|
408
|
-
local matchingActiveSlotsSet = __TS__New(
|
|
409
|
+
local matchingActiveSlotsSet = __TS__New(ReadonlySet, activeSlots)
|
|
409
410
|
local activeItemSlots = ____exports.getActiveItemSlots(nil, player, collectibleType)
|
|
410
411
|
return __TS__ArraySome(
|
|
411
412
|
activeItemSlots,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"random.d.ts","sourceRoot":"","sources":["../../../src/functions/random.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"random.d.ts","sourceRoot":"","sources":["../../../src/functions/random.ts"],"names":[],"mappings":";;;AAGA;;;;;;GAMG;AACH,wBAAgB,SAAS,CAAC,SAAS,GAAE,IAAI,GAAG,GAAqB,GAAG,KAAK,CAGxE;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,cAAc,CAC5B,GAAG,EAAE,GAAG,EACR,GAAG,EAAE,GAAG,EACR,SAAS,GAAE,IAAI,GAAG,GAAqB,GACtC,KAAK,CAUP;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,YAAY,CAC1B,GAAG,EAAE,GAAG,EACR,GAAG,EAAE,GAAG,EACR,SAAS,GAAE,IAAI,GAAG,GAAqB,EACvC,UAAU,GAAE,GAAG,EAAE,GAAG,SAAS,GAAG,EAAO,GACtC,GAAG,CAqBL"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
local ____lualib = require("lualib_bundle")
|
|
2
|
-
local Set = ____lualib.Set
|
|
3
2
|
local __TS__New = ____lualib.__TS__New
|
|
4
3
|
local ____exports = {}
|
|
4
|
+
local ____ReadonlySet = require("src.types.ReadonlySet")
|
|
5
|
+
local ReadonlySet = ____ReadonlySet.ReadonlySet
|
|
5
6
|
local ____rng = require("src.functions.rng")
|
|
6
7
|
local getRandomSeed = ____rng.getRandomSeed
|
|
7
8
|
local isRNG = ____rng.isRNG
|
|
@@ -77,7 +78,7 @@ function ____exports.getRandomInt(self, min, max, seedOrRNG, exceptions)
|
|
|
77
78
|
min = oldMax
|
|
78
79
|
max = oldMin
|
|
79
80
|
end
|
|
80
|
-
local exceptionsSet = __TS__New(
|
|
81
|
+
local exceptionsSet = __TS__New(ReadonlySet, exceptions)
|
|
81
82
|
local randomInt
|
|
82
83
|
repeat
|
|
83
84
|
do
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"roomShapeWalls.d.ts","sourceRoot":"","sources":["../../../src/functions/roomShapeWalls.ts"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"roomShapeWalls.d.ts","sourceRoot":"","sources":["../../../src/functions/roomShapeWalls.ts"],"names":[],"mappings":";AAuTA;;;;;;;GAOG;AACH,wBAAgB,sBAAsB,CAAC,SAAS,EAAE,GAAG,GAAG,OAAO,CAqB9D"}
|