isaacscript-common 1.2.213 → 1.2.216
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/constants.d.ts +1 -0
- package/dist/constants.lua +1 -0
- package/dist/functions/color.lua +2 -1
- package/dist/functions/log.d.ts +6 -1
- package/dist/functions/log.lua +31 -5
- package/dist/functions/npc.d.ts +2 -0
- package/dist/functions/npc.lua +5 -0
- package/dist/functions/rng.lua +2 -1
- package/dist/functions/rooms.d.ts +7 -0
- package/dist/functions/rooms.lua +12 -3
- package/dist/functions/userdata.d.ts +12 -0
- package/dist/functions/userdata.lua +18 -0
- package/dist/functions/utils.d.ts +0 -5
- package/dist/functions/utils.lua +0 -12
- package/dist/functions/vector.lua +2 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.lua +8 -0
- package/dist/objects/roomShapeToGridIndexDelta.d.ts +8 -0
- package/dist/objects/roomShapeToGridIndexDelta.lua +85 -0
- package/dist/sets/sinEntityTypesSet.d.ts +2 -0
- package/dist/sets/sinEntityTypesSet.lua +14 -0
- package/package.json +2 -2
package/dist/constants.d.ts
CHANGED
|
@@ -37,6 +37,7 @@ export declare const FIRST_GLITCHED_COLLECTIBLE_TYPE: number;
|
|
|
37
37
|
export declare const GAME_FRAMES_PER_SECOND = 30;
|
|
38
38
|
export declare const GRID_INDEX_CENTER_OF_1X1_ROOM = 67;
|
|
39
39
|
export declare const ISAAC_FRAMES_PER_SECOND = 60;
|
|
40
|
+
export declare const LEVEL_GRID_ROW_LENGTH = 13;
|
|
40
41
|
/** In a 2x2 room, there can be 8 doors. */
|
|
41
42
|
export declare const MAX_NUM_DOORS = 8;
|
|
42
43
|
/**
|
package/dist/constants.lua
CHANGED
|
@@ -13,6 +13,7 @@ ____exports.FIRST_GLITCHED_COLLECTIBLE_TYPE = (1 << 32) - 1
|
|
|
13
13
|
____exports.GAME_FRAMES_PER_SECOND = 30
|
|
14
14
|
____exports.GRID_INDEX_CENTER_OF_1X1_ROOM = 67
|
|
15
15
|
____exports.ISAAC_FRAMES_PER_SECOND = 60
|
|
16
|
+
____exports.LEVEL_GRID_ROW_LENGTH = 13
|
|
16
17
|
____exports.MAX_NUM_DOORS = 8
|
|
17
18
|
____exports.MAX_NUM_FAMILIARS = 64
|
|
18
19
|
____exports.MAX_NUM_INPUTS = 4
|
package/dist/functions/color.lua
CHANGED
|
@@ -8,9 +8,10 @@ local SerializationType = ____SerializationType.SerializationType
|
|
|
8
8
|
local ____table = require("functions.table")
|
|
9
9
|
local copyValuesToTable = ____table.copyValuesToTable
|
|
10
10
|
local getNumbersFromTable = ____table.getNumbersFromTable
|
|
11
|
+
local ____userdata = require("functions.userdata")
|
|
12
|
+
local isUserdataObject = ____userdata.isUserdataObject
|
|
11
13
|
local ____utils = require("functions.utils")
|
|
12
14
|
local ensureAllCases = ____utils.ensureAllCases
|
|
13
|
-
local isUserdataObject = ____utils.isUserdataObject
|
|
14
15
|
function ____exports.isColor(self, object)
|
|
15
16
|
return isUserdataObject(nil, object, OBJECT_NAME)
|
|
16
17
|
end
|
package/dist/functions/log.d.ts
CHANGED
|
@@ -16,9 +16,9 @@ export declare function logColor(this: void, color: Color): void;
|
|
|
16
16
|
export declare function logDamageFlags(this: void, flags: int): void;
|
|
17
17
|
/** Helper function for printing out every entity (or filtered entity) in the current room. */
|
|
18
18
|
export declare function logEntities(this: void, includeBackgroundEffects: boolean, entityTypeFilter?: EntityType | int): void;
|
|
19
|
-
export declare function logEntity(this: void, entity: Entity): void;
|
|
20
19
|
/** Helper function for printing out every entity flag that is turned on. Useful when debugging. */
|
|
21
20
|
export declare function logEntityFlags(this: void, flags: int): void;
|
|
21
|
+
export declare function logEntityID(this: void, entity: Entity): void;
|
|
22
22
|
/**
|
|
23
23
|
* Helper function to log an error message and also print it to the console for better visibility.
|
|
24
24
|
* This is useful in combination with an early return when invoking the `error` function would be
|
|
@@ -59,6 +59,11 @@ export declare function logTearFlags(this: void, flags: int): void;
|
|
|
59
59
|
export declare function logTemporaryEffects(this: void, player: EntityPlayer): void;
|
|
60
60
|
/** Helper function for printing out every use flag that is turned on. Useful when debugging. */
|
|
61
61
|
export declare function logUseFlags(this: void, flags: int): void;
|
|
62
|
+
/**
|
|
63
|
+
* Helper function to enumerate all of the properties of a "userdata" object (i.e. an object from
|
|
64
|
+
* the Isaac API).
|
|
65
|
+
*/
|
|
66
|
+
export declare function logUserdata(this: void, userdata: unknown): void;
|
|
62
67
|
export declare function logVector(this: void, vector: Vector): void;
|
|
63
68
|
/**
|
|
64
69
|
* Converts every `isaacscript-common` function that begins with "log" to a global function.
|
package/dist/functions/log.lua
CHANGED
|
@@ -35,6 +35,8 @@ local ____set = require("functions.set")
|
|
|
35
35
|
local getSortedSetValues = ____set.getSortedSetValues
|
|
36
36
|
local ____trinkets = require("functions.trinkets")
|
|
37
37
|
local getTrinketName = ____trinkets.getTrinketName
|
|
38
|
+
local ____userdata = require("functions.userdata")
|
|
39
|
+
local getUserdataType = ____userdata.getUserdataType
|
|
38
40
|
local ____utils = require("functions.utils")
|
|
39
41
|
local printConsole = ____utils.printConsole
|
|
40
42
|
function ____exports.getDebugPrependString(self, msg, numParentFunctions)
|
|
@@ -190,12 +192,12 @@ function ____exports.logEntities(includeBackgroundEffects, entityTypeFilter)
|
|
|
190
192
|
____exports.log(("(" .. tostring(numMatchedEntities)) .. " total entities)")
|
|
191
193
|
end
|
|
192
194
|
end
|
|
193
|
-
function ____exports.logEntity(entity)
|
|
194
|
-
____exports.log((((("Entity: " .. tostring(entity.Type)) .. ".") .. tostring(entity.Variant)) .. ".") .. tostring(entity.SubType))
|
|
195
|
-
end
|
|
196
195
|
function ____exports.logEntityFlags(flags)
|
|
197
196
|
____exports.logFlags(flags, EntityFlag, "entity")
|
|
198
197
|
end
|
|
198
|
+
function ____exports.logEntityID(entity)
|
|
199
|
+
____exports.log((((("Entity: " .. tostring(entity.Type)) .. ".") .. tostring(entity.Variant)) .. ".") .. tostring(entity.SubType))
|
|
200
|
+
end
|
|
199
201
|
function ____exports.logError(msg)
|
|
200
202
|
local errorMsg = "Error: " .. msg
|
|
201
203
|
____exports.log(errorMsg)
|
|
@@ -379,7 +381,11 @@ function ____exports.logTable(____table, parentTables)
|
|
|
379
381
|
____exports.log((((indentation .. "Key: ") .. tostring(key)) .. ", Value: ") .. tostring(value))
|
|
380
382
|
local valueType = type(value)
|
|
381
383
|
if valueType == "table" then
|
|
382
|
-
|
|
384
|
+
if key == "__class" then
|
|
385
|
+
____exports.log(indentation .. "(skipping enumerating this key to avoid infinite recursion)")
|
|
386
|
+
else
|
|
387
|
+
____exports.logTable(value, parentTables + 1)
|
|
388
|
+
end
|
|
383
389
|
end
|
|
384
390
|
numKeys = numKeys + 1
|
|
385
391
|
end
|
|
@@ -415,6 +421,25 @@ end
|
|
|
415
421
|
function ____exports.logUseFlags(flags)
|
|
416
422
|
____exports.logFlags(flags, UseFlag, "use")
|
|
417
423
|
end
|
|
424
|
+
function ____exports.logUserdata(userdata)
|
|
425
|
+
local userdataType = type(userdata)
|
|
426
|
+
if userdataType ~= "userdata" then
|
|
427
|
+
____exports.log("Userdata: [not userdata]")
|
|
428
|
+
return
|
|
429
|
+
end
|
|
430
|
+
local metatable = getmetatable(userdata)
|
|
431
|
+
if metatable == nil then
|
|
432
|
+
____exports.log("Userdata: [no metatable]")
|
|
433
|
+
return
|
|
434
|
+
end
|
|
435
|
+
local classType = getUserdataType(nil, userdata)
|
|
436
|
+
if classType == nil then
|
|
437
|
+
____exports.log("Userdata: [no class type]")
|
|
438
|
+
else
|
|
439
|
+
____exports.log("Userdata: " .. classType)
|
|
440
|
+
end
|
|
441
|
+
____exports.logTable(metatable)
|
|
442
|
+
end
|
|
418
443
|
function ____exports.logVector(vector)
|
|
419
444
|
____exports.log(((("Vector: (" .. tostring(vector.X)) .. ", ") .. tostring(vector.Y)) .. ")")
|
|
420
445
|
end
|
|
@@ -425,7 +450,7 @@ function ____exports.setLogFunctionsGlobal(self)
|
|
|
425
450
|
globals.logColor = ____exports.logColor
|
|
426
451
|
globals.logDamageFlags = ____exports.logDamageFlags
|
|
427
452
|
globals.logEntities = ____exports.logEntities
|
|
428
|
-
globals.
|
|
453
|
+
globals.logEntityID = ____exports.logEntityID
|
|
429
454
|
globals.logEntityFlags = ____exports.logEntityFlags
|
|
430
455
|
globals.logError = ____exports.logError
|
|
431
456
|
globals.logFlags = ____exports.logFlags
|
|
@@ -443,6 +468,7 @@ function ____exports.setLogFunctionsGlobal(self)
|
|
|
443
468
|
globals.logTearFlags = ____exports.logTearFlags
|
|
444
469
|
globals.logTemporaryEffects = ____exports.logTemporaryEffects
|
|
445
470
|
globals.logUseFlags = ____exports.logUseFlags
|
|
471
|
+
globals.logUserdata = ____exports.logUserdata
|
|
446
472
|
globals.logVector = ____exports.logVector
|
|
447
473
|
end
|
|
448
474
|
return ____exports
|
package/dist/functions/npc.d.ts
CHANGED
|
@@ -49,6 +49,8 @@ export declare function isDyingEggyWithNoSpidersLeft(npc: EntityNPC): boolean;
|
|
|
49
49
|
* enemies.
|
|
50
50
|
*/
|
|
51
51
|
export declare function isRaglingDeathPatch(npc: EntityNPC): boolean;
|
|
52
|
+
/** Helper function to check if the provided NPC is a Sin miniboss, such as Sloth or Lust. */
|
|
53
|
+
export declare function isSin(npc: EntityNPC): boolean;
|
|
52
54
|
/**
|
|
53
55
|
* Helper function to remove all NPCs in the room.
|
|
54
56
|
*
|
package/dist/functions/npc.lua
CHANGED
|
@@ -7,6 +7,8 @@ local ____exports = {}
|
|
|
7
7
|
local NON_ALIVE_NPCS_TYPE_VARIANT, NON_ALIVE_NPCS_TYPE_VARIANT_SUBTYPE
|
|
8
8
|
local ____constants = require("constants")
|
|
9
9
|
local EGGY_STATE_FRAME_OF_FINAL_SPIDER = ____constants.EGGY_STATE_FRAME_OF_FINAL_SPIDER
|
|
10
|
+
local ____sinEntityTypesSet = require("sets.sinEntityTypesSet")
|
|
11
|
+
local SIN_ENTITY_TYPES_SET = ____sinEntityTypesSet.SIN_ENTITY_TYPES_SET
|
|
10
12
|
local ____entity = require("functions.entity")
|
|
11
13
|
local getEntities = ____entity.getEntities
|
|
12
14
|
local getFilteredNewEntities = ____entity.getFilteredNewEntities
|
|
@@ -139,6 +141,9 @@ function ____exports.getBosses(self, matchingEntityType, matchingVariant, matchi
|
|
|
139
141
|
function(____, npc) return npc:IsBoss() end
|
|
140
142
|
)
|
|
141
143
|
end
|
|
144
|
+
function ____exports.isSin(self, npc)
|
|
145
|
+
return SIN_ENTITY_TYPES_SET:has(npc.Type)
|
|
146
|
+
end
|
|
142
147
|
function ____exports.removeAllNPCs(self, cap)
|
|
143
148
|
local npcs = ____exports.getNPCs(nil)
|
|
144
149
|
return removeEntities(nil, npcs, cap)
|
package/dist/functions/rng.lua
CHANGED
|
@@ -11,9 +11,10 @@ local SerializationType = ____SerializationType.SerializationType
|
|
|
11
11
|
local ____table = require("functions.table")
|
|
12
12
|
local getNumbersFromTable = ____table.getNumbersFromTable
|
|
13
13
|
local tableHasKeys = ____table.tableHasKeys
|
|
14
|
+
local ____userdata = require("functions.userdata")
|
|
15
|
+
local isUserdataObject = ____userdata.isUserdataObject
|
|
14
16
|
local ____utils = require("functions.utils")
|
|
15
17
|
local ensureAllCases = ____utils.ensureAllCases
|
|
16
|
-
local isUserdataObject = ____utils.isUserdataObject
|
|
17
18
|
function ____exports.getRandomSeed(self)
|
|
18
19
|
local randomNumber = Random()
|
|
19
20
|
local safeRandomNumber = randomNumber == 0 and 1 or randomNumber
|
|
@@ -15,6 +15,13 @@ export declare function getAllRoomGridIndexes(): int[];
|
|
|
15
15
|
* tricky to properly detect.
|
|
16
16
|
*/
|
|
17
17
|
export declare function getCurrentDimension(): Dimension;
|
|
18
|
+
/**
|
|
19
|
+
* Helper function to get the grid index delta that a door out of the given room shape would lead
|
|
20
|
+
* to. For example, if you went through the bottom door in a room of `RoomShape.ROOMSHAPE_1x2`, you
|
|
21
|
+
* would end up in a room with a grid index that is +26 units from the `SafeGridIndex` of where you
|
|
22
|
+
* started.
|
|
23
|
+
*/
|
|
24
|
+
export declare function getGridIndexDelta(roomShape: RoomShape, doorSlot: DoorSlot): int | undefined;
|
|
18
25
|
/**
|
|
19
26
|
* Helper function to get an array of all of the safe grid indexes for rooms that match the
|
|
20
27
|
* specified room type.
|
package/dist/functions/rooms.lua
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
local ____lualib = require("lualib_bundle")
|
|
2
2
|
local __TS__ArrayMap = ____lualib.__TS__ArrayMap
|
|
3
|
+
local Map = ____lualib.Map
|
|
3
4
|
local Set = ____lualib.Set
|
|
4
5
|
local __TS__New = ____lualib.__TS__New
|
|
5
6
|
local __TS__ArrayFilter = ____lualib.__TS__ArrayFilter
|
|
6
7
|
local __TS__ArrayPush = ____lualib.__TS__ArrayPush
|
|
7
8
|
local __TS__ArrayEvery = ____lualib.__TS__ArrayEvery
|
|
8
|
-
local Map = ____lualib.Map
|
|
9
9
|
local ____exports = {}
|
|
10
10
|
local ____cachedClasses = require("cachedClasses")
|
|
11
11
|
local game = ____cachedClasses.game
|
|
@@ -13,6 +13,8 @@ local sfxManager = ____cachedClasses.sfxManager
|
|
|
13
13
|
local ____constants = require("constants")
|
|
14
14
|
local MAX_ROOM_INDEX = ____constants.MAX_ROOM_INDEX
|
|
15
15
|
local NUM_DIMENSIONS = ____constants.NUM_DIMENSIONS
|
|
16
|
+
local ____roomShapeToGridIndexDelta = require("objects.roomShapeToGridIndexDelta")
|
|
17
|
+
local ROOM_SHAPE_TO_DOOR_SLOTS_TO_GRID_INDEX_DELTA = ____roomShapeToGridIndexDelta.ROOM_SHAPE_TO_DOOR_SLOTS_TO_GRID_INDEX_DELTA
|
|
16
18
|
local ____doors = require("functions.doors")
|
|
17
19
|
local closeAllDoors = ____doors.closeAllDoors
|
|
18
20
|
local getDoors = ____doors.getDoors
|
|
@@ -106,6 +108,13 @@ function ____exports.getCurrentDimension(self)
|
|
|
106
108
|
end
|
|
107
109
|
return error("Failed to get the current dimension using the starting room index of: " .. tostring(startingRoomGridIndex))
|
|
108
110
|
end
|
|
111
|
+
function ____exports.getGridIndexDelta(self, roomShape, doorSlot)
|
|
112
|
+
local doorSlotToGridIndexMap = ROOM_SHAPE_TO_DOOR_SLOTS_TO_GRID_INDEX_DELTA[roomShape]
|
|
113
|
+
if doorSlotToGridIndexMap == nil then
|
|
114
|
+
return nil
|
|
115
|
+
end
|
|
116
|
+
return doorSlotToGridIndexMap:get(doorSlot)
|
|
117
|
+
end
|
|
109
118
|
function ____exports.getRoomGridIndexesForType(self, ...)
|
|
110
119
|
local roomTypesSet = __TS__New(Set, {...})
|
|
111
120
|
local rooms = ____exports.getRooms(nil)
|
|
@@ -246,12 +255,12 @@ function ____exports.setRoomCleared(self)
|
|
|
246
255
|
for ____, door in ipairs(getDoors(nil)) do
|
|
247
256
|
do
|
|
248
257
|
if isHiddenSecretRoomDoor(nil, door) then
|
|
249
|
-
goto
|
|
258
|
+
goto __continue48
|
|
250
259
|
end
|
|
251
260
|
openDoorFast(nil, door)
|
|
252
261
|
door.ExtraVisible = false
|
|
253
262
|
end
|
|
254
|
-
::
|
|
263
|
+
::__continue48::
|
|
255
264
|
end
|
|
256
265
|
sfxManager:Stop(SoundEffect.SOUND_DOOR_HEAVY_OPEN)
|
|
257
266
|
game:ShakeScreen(0)
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Helper function to get the type of a userdata object from the Isaac API. This is contained within
|
|
3
|
+
* the "__type" metatable key.
|
|
4
|
+
*
|
|
5
|
+
* For example, a `Vector` class is userdata with a type of "Vector".
|
|
6
|
+
*/
|
|
7
|
+
export declare function getUserdataType(object: unknown): string | undefined;
|
|
8
|
+
/**
|
|
9
|
+
* Helper function to check if something is an instantiated class from the Isaac API. (All classes
|
|
10
|
+
* from the Isaac API have a type of "userdata" in Lua with a metatable key of "__type".)
|
|
11
|
+
*/
|
|
12
|
+
export declare function isUserdataObject(object: unknown, objectType: string): boolean;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
--[[ Generated with https://github.com/TypeScriptToLua/TypeScriptToLua ]]
|
|
2
|
+
local ____exports = {}
|
|
3
|
+
function ____exports.getUserdataType(self, object)
|
|
4
|
+
local objectType = type(object)
|
|
5
|
+
if objectType ~= "userdata" then
|
|
6
|
+
return nil
|
|
7
|
+
end
|
|
8
|
+
local metatable = getmetatable(object)
|
|
9
|
+
if metatable == nil then
|
|
10
|
+
return nil
|
|
11
|
+
end
|
|
12
|
+
return metatable.__type
|
|
13
|
+
end
|
|
14
|
+
function ____exports.isUserdataObject(self, object, objectType)
|
|
15
|
+
local userdataType = ____exports.getUserdataType(nil, object)
|
|
16
|
+
return userdataType == objectType or userdataType == "const " .. objectType
|
|
17
|
+
end
|
|
18
|
+
return ____exports
|
|
@@ -93,11 +93,6 @@ export declare function hexToKColor(hexString: string, alpha: float): KColor;
|
|
|
93
93
|
* is enabled or not.
|
|
94
94
|
*/
|
|
95
95
|
export declare function isLuaDebugEnabled(): boolean;
|
|
96
|
-
/**
|
|
97
|
-
* Helper function to check if the something is an instantiated class from the Isaac API. (All
|
|
98
|
-
* classes from the Isaac API have a type of "userdata" in Lua.)
|
|
99
|
-
*/
|
|
100
|
-
export declare function isUserdataObject(object: unknown, objectName: string): boolean;
|
|
101
96
|
/**
|
|
102
97
|
* Helper function to print something to the in-game console. Use this instead of invoking the
|
|
103
98
|
* `Isaac.ConsoleOutput` method directly because it will automatically insert a newline at the end
|
package/dist/functions/utils.lua
CHANGED
|
@@ -66,18 +66,6 @@ end
|
|
|
66
66
|
function ____exports.isLuaDebugEnabled(self)
|
|
67
67
|
return package ~= nil
|
|
68
68
|
end
|
|
69
|
-
function ____exports.isUserdataObject(self, object, objectName)
|
|
70
|
-
local objectType = type(object)
|
|
71
|
-
if objectType ~= "userdata" then
|
|
72
|
-
return false
|
|
73
|
-
end
|
|
74
|
-
local metatable = getmetatable(object)
|
|
75
|
-
if metatable == nil then
|
|
76
|
-
return false
|
|
77
|
-
end
|
|
78
|
-
local vectorMetatable = metatable
|
|
79
|
-
return vectorMetatable.__type == objectName
|
|
80
|
-
end
|
|
81
69
|
function ____exports.printConsole(self, msg)
|
|
82
70
|
Isaac.ConsoleOutput(msg .. "\n")
|
|
83
71
|
end
|
|
@@ -11,9 +11,10 @@ local ____table = require("functions.table")
|
|
|
11
11
|
local copyValuesToTable = ____table.copyValuesToTable
|
|
12
12
|
local getNumbersFromTable = ____table.getNumbersFromTable
|
|
13
13
|
local tableHasKeys = ____table.tableHasKeys
|
|
14
|
+
local ____userdata = require("functions.userdata")
|
|
15
|
+
local isUserdataObject = ____userdata.isUserdataObject
|
|
14
16
|
local ____utils = require("functions.utils")
|
|
15
17
|
local ensureAllCases = ____utils.ensureAllCases
|
|
16
|
-
local isUserdataObject = ____utils.isUserdataObject
|
|
17
18
|
function ____exports.isVector(self, object)
|
|
18
19
|
return isUserdataObject(nil, object, OBJECT_NAME)
|
|
19
20
|
end
|
package/dist/index.d.ts
CHANGED
|
@@ -88,6 +88,7 @@ export * from "./functions/trinketGive";
|
|
|
88
88
|
export * from "./functions/trinkets";
|
|
89
89
|
export * from "./functions/trinketSet";
|
|
90
90
|
export * from "./functions/ui";
|
|
91
|
+
export * from "./functions/userdata";
|
|
91
92
|
export * from "./functions/utils";
|
|
92
93
|
export * from "./functions/vector";
|
|
93
94
|
export * from "./maps/cardMap";
|
package/dist/index.lua
CHANGED
|
@@ -704,6 +704,14 @@ do
|
|
|
704
704
|
end
|
|
705
705
|
end
|
|
706
706
|
end
|
|
707
|
+
do
|
|
708
|
+
local ____export = require("functions.userdata")
|
|
709
|
+
for ____exportKey, ____exportValue in pairs(____export) do
|
|
710
|
+
if ____exportKey ~= "default" then
|
|
711
|
+
____exports[____exportKey] = ____exportValue
|
|
712
|
+
end
|
|
713
|
+
end
|
|
714
|
+
end
|
|
707
715
|
do
|
|
708
716
|
local ____export = require("functions.utils")
|
|
709
717
|
for ____exportKey, ____exportValue in pairs(____export) do
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/// <reference types="isaac-typescript-definitions" />
|
|
2
|
+
/**
|
|
3
|
+
* Deltas are considered to be from the safe grid index of the room (i.e. the top left corner, or
|
|
4
|
+
* top right corner in the case of `RoomShape.ROOMSHAPE_LTL`).
|
|
5
|
+
*/
|
|
6
|
+
export declare const ROOM_SHAPE_TO_DOOR_SLOTS_TO_GRID_INDEX_DELTA: {
|
|
7
|
+
readonly [key in RoomShape]: Map<DoorSlot, int> | undefined;
|
|
8
|
+
};
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
local ____lualib = require("lualib_bundle")
|
|
2
|
+
local Map = ____lualib.Map
|
|
3
|
+
local __TS__New = ____lualib.__TS__New
|
|
4
|
+
local ____exports = {}
|
|
5
|
+
local ____constants = require("constants")
|
|
6
|
+
local LEVEL_GRID_ROW_LENGTH = ____constants.LEVEL_GRID_ROW_LENGTH
|
|
7
|
+
local LEFT = -1
|
|
8
|
+
local UP = -LEVEL_GRID_ROW_LENGTH
|
|
9
|
+
local RIGHT = 1
|
|
10
|
+
local DOWN = LEVEL_GRID_ROW_LENGTH
|
|
11
|
+
____exports.ROOM_SHAPE_TO_DOOR_SLOTS_TO_GRID_INDEX_DELTA = {
|
|
12
|
+
[RoomShape.ROOMSHAPE_1x1] = __TS__New(Map, {{DoorSlot.LEFT0, LEFT}, {DoorSlot.UP0, UP}, {DoorSlot.RIGHT0, RIGHT}, {DoorSlot.DOWN0, DOWN}}),
|
|
13
|
+
[RoomShape.ROOMSHAPE_IH] = __TS__New(Map, {{DoorSlot.LEFT0, LEFT}, {DoorSlot.RIGHT0, RIGHT}}),
|
|
14
|
+
[RoomShape.ROOMSHAPE_IV] = __TS__New(Map, {{DoorSlot.UP0, UP}, {DoorSlot.DOWN0, DOWN}}),
|
|
15
|
+
[RoomShape.ROOMSHAPE_1x2] = __TS__New(Map, {
|
|
16
|
+
{DoorSlot.LEFT0, LEFT},
|
|
17
|
+
{DoorSlot.UP0, UP},
|
|
18
|
+
{DoorSlot.RIGHT0, RIGHT},
|
|
19
|
+
{DoorSlot.DOWN0, DOWN + DOWN},
|
|
20
|
+
{DoorSlot.LEFT1, DOWN + LEFT},
|
|
21
|
+
{DoorSlot.RIGHT1, DOWN + RIGHT}
|
|
22
|
+
}),
|
|
23
|
+
[RoomShape.ROOMSHAPE_IIV] = __TS__New(Map, {{DoorSlot.UP0, UP}, {DoorSlot.DOWN0, DOWN + DOWN}}),
|
|
24
|
+
[RoomShape.ROOMSHAPE_2x1] = __TS__New(Map, {
|
|
25
|
+
{DoorSlot.LEFT0, LEFT},
|
|
26
|
+
{DoorSlot.UP0, UP},
|
|
27
|
+
{DoorSlot.RIGHT0, RIGHT + RIGHT},
|
|
28
|
+
{DoorSlot.DOWN0, DOWN},
|
|
29
|
+
{DoorSlot.UP1, RIGHT + UP},
|
|
30
|
+
{DoorSlot.DOWN1, RIGHT + DOWN}
|
|
31
|
+
}),
|
|
32
|
+
[RoomShape.ROOMSHAPE_IIH] = __TS__New(Map, {{DoorSlot.LEFT0, LEFT}, {DoorSlot.RIGHT0, RIGHT + RIGHT}}),
|
|
33
|
+
[RoomShape.ROOMSHAPE_2x2] = __TS__New(Map, {
|
|
34
|
+
{DoorSlot.LEFT0, LEFT},
|
|
35
|
+
{DoorSlot.UP0, UP},
|
|
36
|
+
{DoorSlot.RIGHT0, RIGHT + RIGHT},
|
|
37
|
+
{DoorSlot.DOWN0, DOWN + DOWN},
|
|
38
|
+
{DoorSlot.LEFT1, DOWN + LEFT},
|
|
39
|
+
{DoorSlot.UP1, RIGHT + UP},
|
|
40
|
+
{DoorSlot.RIGHT1, RIGHT + DOWN + RIGHT},
|
|
41
|
+
{DoorSlot.DOWN1, RIGHT + DOWN + DOWN}
|
|
42
|
+
}),
|
|
43
|
+
[RoomShape.ROOMSHAPE_LTL] = __TS__New(Map, {
|
|
44
|
+
{DoorSlot.LEFT0, LEFT},
|
|
45
|
+
{DoorSlot.UP0, DOWN + LEFT + UP},
|
|
46
|
+
{DoorSlot.RIGHT0, RIGHT},
|
|
47
|
+
{DoorSlot.DOWN0, DOWN + LEFT + DOWN},
|
|
48
|
+
{DoorSlot.LEFT1, DOWN + LEFT + LEFT},
|
|
49
|
+
{DoorSlot.UP1, UP},
|
|
50
|
+
{DoorSlot.RIGHT1, DOWN + RIGHT},
|
|
51
|
+
{DoorSlot.DOWN1, DOWN + DOWN}
|
|
52
|
+
}),
|
|
53
|
+
[RoomShape.ROOMSHAPE_LTR] = __TS__New(Map, {
|
|
54
|
+
{DoorSlot.LEFT0, LEFT},
|
|
55
|
+
{DoorSlot.UP0, UP},
|
|
56
|
+
{DoorSlot.RIGHT0, RIGHT},
|
|
57
|
+
{DoorSlot.DOWN0, DOWN + DOWN},
|
|
58
|
+
{DoorSlot.LEFT1, DOWN + LEFT},
|
|
59
|
+
{DoorSlot.UP1, DOWN + RIGHT + UP},
|
|
60
|
+
{DoorSlot.RIGHT1, DOWN + RIGHT + RIGHT},
|
|
61
|
+
{DoorSlot.DOWN1, DOWN + RIGHT + DOWN}
|
|
62
|
+
}),
|
|
63
|
+
[RoomShape.ROOMSHAPE_LBL] = __TS__New(Map, {
|
|
64
|
+
{DoorSlot.LEFT0, LEFT},
|
|
65
|
+
{DoorSlot.UP0, UP},
|
|
66
|
+
{DoorSlot.RIGHT0, RIGHT + RIGHT},
|
|
67
|
+
{DoorSlot.DOWN0, DOWN},
|
|
68
|
+
{DoorSlot.LEFT1, RIGHT + DOWN + LEFT},
|
|
69
|
+
{DoorSlot.UP1, RIGHT + UP},
|
|
70
|
+
{DoorSlot.RIGHT1, RIGHT + DOWN + RIGHT},
|
|
71
|
+
{DoorSlot.DOWN1, RIGHT + DOWN + DOWN}
|
|
72
|
+
}),
|
|
73
|
+
[RoomShape.ROOMSHAPE_LBR] = __TS__New(Map, {
|
|
74
|
+
{DoorSlot.LEFT0, LEFT},
|
|
75
|
+
{DoorSlot.UP0, UP},
|
|
76
|
+
{DoorSlot.RIGHT0, RIGHT + RIGHT},
|
|
77
|
+
{DoorSlot.DOWN0, DOWN + DOWN},
|
|
78
|
+
{DoorSlot.LEFT1, DOWN + LEFT},
|
|
79
|
+
{DoorSlot.UP1, RIGHT + UP},
|
|
80
|
+
{DoorSlot.RIGHT1, DOWN + RIGHT},
|
|
81
|
+
{DoorSlot.DOWN1, RIGHT + DOWN}
|
|
82
|
+
}),
|
|
83
|
+
[RoomShape.NUM_ROOMSHAPES] = nil
|
|
84
|
+
}
|
|
85
|
+
return ____exports
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
local ____lualib = require("lualib_bundle")
|
|
2
|
+
local Set = ____lualib.Set
|
|
3
|
+
local __TS__New = ____lualib.__TS__New
|
|
4
|
+
local ____exports = {}
|
|
5
|
+
____exports.SIN_ENTITY_TYPES_SET = __TS__New(Set, {
|
|
6
|
+
EntityType.ENTITY_SLOTH,
|
|
7
|
+
EntityType.ENTITY_LUST,
|
|
8
|
+
EntityType.ENTITY_WRATH,
|
|
9
|
+
EntityType.ENTITY_GLUTTONY,
|
|
10
|
+
EntityType.ENTITY_GREED,
|
|
11
|
+
EntityType.ENTITY_ENVY,
|
|
12
|
+
EntityType.ENTITY_PRIDE
|
|
13
|
+
})
|
|
14
|
+
return ____exports
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "isaacscript-common",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.216",
|
|
4
4
|
"description": "Helper functions for IsaacScript mods",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"isaac",
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"isaacscript-lint": "^1.0.95",
|
|
30
30
|
"isaacscript-tsconfig": "^1.1.8",
|
|
31
31
|
"typedoc": "^0.22.13",
|
|
32
|
-
"typescript": "4.6.
|
|
32
|
+
"typescript": "4.6.3",
|
|
33
33
|
"typescript-to-lua": "^1.4.2"
|
|
34
34
|
}
|
|
35
35
|
}
|