isaacscript-common 13.0.0 → 13.1.1
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.d.ts +96 -26
- package/dist/isaacscript-common.lua +613 -168
- package/dist/src/features/customStage/backdrop.lua +4 -4
- package/dist/src/features/customStage/versusScreen.lua +2 -2
- package/dist/src/features/deployJSONRoom.d.ts +0 -11
- package/dist/src/features/deployJSONRoom.d.ts.map +1 -1
- package/dist/src/features/deployJSONRoom.lua +10 -74
- package/dist/src/features/extraConsoleCommands/listCommands.lua +2 -2
- package/dist/src/features/firstLast.lua +8 -8
- package/dist/src/features/setHotkey.d.ts +27 -8
- package/dist/src/features/setHotkey.d.ts.map +1 -1
- package/dist/src/features/setHotkey.lua +41 -30
- package/dist/src/functions/array.lua +2 -2
- package/dist/src/functions/cards.lua +2 -2
- package/dist/src/functions/collectibles.lua +2 -2
- package/dist/src/functions/dimensions.lua +2 -2
- package/dist/src/functions/emptyRoom.d.ts +8 -0
- package/dist/src/functions/emptyRoom.d.ts.map +1 -0
- package/dist/src/functions/emptyRoom.lua +79 -0
- package/dist/src/functions/enums.d.ts.map +1 -1
- package/dist/src/functions/enums.lua +3 -3
- package/dist/src/functions/gridEntities.lua +2 -2
- package/dist/src/functions/gridIndex.d.ts +10 -0
- package/dist/src/functions/gridIndex.d.ts.map +1 -0
- package/dist/src/functions/gridIndex.lua +32 -0
- package/dist/src/functions/log.d.ts.map +1 -1
- package/dist/src/functions/log.lua +9 -8
- package/dist/src/functions/logEntities.d.ts.map +1 -1
- package/dist/src/functions/logEntities.lua +17 -9
- package/dist/src/functions/pills.lua +4 -4
- package/dist/src/functions/roomShape.d.ts +6 -1
- package/dist/src/functions/roomShape.d.ts.map +1 -1
- package/dist/src/functions/roomShape.lua +3 -0
- package/dist/src/functions/roomShapeWalls.d.ts +11 -0
- package/dist/src/functions/roomShapeWalls.d.ts.map +1 -0
- package/dist/src/functions/roomShapeWalls.lua +273 -0
- package/dist/src/functions/rooms.d.ts +7 -0
- package/dist/src/functions/rooms.d.ts.map +1 -1
- package/dist/src/functions/rooms.lua +16 -5
- package/dist/src/functions/set.d.ts +7 -0
- package/dist/src/functions/set.d.ts.map +1 -1
- package/dist/src/functions/set.lua +10 -0
- package/dist/src/functions/sprites.lua +2 -2
- package/dist/src/functions/trinkets.lua +2 -2
- package/dist/src/functions/utils.d.ts +18 -12
- package/dist/src/functions/utils.d.ts.map +1 -1
- package/dist/src/functions/utils.lua +26 -14
- package/dist/src/index.d.ts +3 -0
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.lua +24 -0
- package/dist/src/interfaces/Corner.d.ts +8 -0
- package/dist/src/interfaces/Corner.d.ts.map +1 -1
- package/dist/src/objects/roomShapeCorners.d.ts +6 -1
- package/dist/src/objects/roomShapeCorners.d.ts.map +1 -1
- package/dist/src/objects/roomShapeCorners.lua +71 -14
- package/package.json +2 -2
- package/src/features/customStage/backdrop.ts +3 -3
- package/src/features/customStage/versusScreen.ts +2 -2
- package/src/features/deployJSONRoom.ts +8 -98
- package/src/features/extraConsoleCommands/listCommands.ts +2 -2
- package/src/features/firstLast.ts +8 -8
- package/src/features/setHotkey.ts +60 -40
- package/src/functions/array.ts +2 -2
- package/src/functions/cards.ts +2 -2
- package/src/functions/collectibles.ts +2 -2
- package/src/functions/dimensions.ts +2 -2
- package/src/functions/emptyRoom.ts +92 -0
- package/src/functions/enums.ts +4 -3
- package/src/functions/gridEntities.ts +2 -2
- package/src/functions/gridIndex.ts +40 -0
- package/src/functions/log.ts +9 -10
- package/src/functions/logEntities.ts +25 -9
- package/src/functions/pills.ts +4 -4
- package/src/functions/roomShape.ts +6 -1
- package/src/functions/roomShapeWalls.ts +342 -0
- package/src/functions/rooms.ts +22 -3
- package/src/functions/set.ts +12 -0
- package/src/functions/sprites.ts +2 -2
- package/src/functions/trinkets.ts +2 -2
- package/src/functions/utils.ts +20 -14
- package/src/index.ts +3 -0
- package/src/interfaces/Corner.ts +9 -0
- package/src/objects/roomShapeCorners.ts +74 -16
|
@@ -11,7 +11,7 @@ local getRandomSeed = ____rng.getRandomSeed
|
|
|
11
11
|
local ____types = require("src.functions.types")
|
|
12
12
|
local isString = ____types.isString
|
|
13
13
|
local ____utils = require("src.functions.utils")
|
|
14
|
-
local
|
|
14
|
+
local iRange = ____utils.iRange
|
|
15
15
|
--- TypeScriptToLua will transpile TypeScript enums to Lua tables that have a double mapping. Thus,
|
|
16
16
|
-- when you iterate over them, you will get both the names of the enums and the values of the enums,
|
|
17
17
|
-- in a random order. Use this helper function to get the entries of the enum with the reverse
|
|
@@ -160,7 +160,6 @@ end
|
|
|
160
160
|
-- This is useful to automate checking large enums for typos.
|
|
161
161
|
function ____exports.validateEnumContiguous(self, transpiledEnumName, transpiledEnum)
|
|
162
162
|
local values = ____exports.getEnumValues(nil, transpiledEnum)
|
|
163
|
-
local valuesSet = __TS__New(Set, values)
|
|
164
163
|
local lastValue = values[#values]
|
|
165
164
|
if lastValue == nil then
|
|
166
165
|
error("Failed to validate that an enum was contiguous, since the last value was undefined.")
|
|
@@ -168,7 +167,8 @@ function ____exports.validateEnumContiguous(self, transpiledEnumName, transpiled
|
|
|
168
167
|
if type(lastValue) ~= "number" then
|
|
169
168
|
error("Failed to validate that an enum was contiguous, since the last value was not a number.")
|
|
170
169
|
end
|
|
171
|
-
|
|
170
|
+
local valuesSet = __TS__New(Set, values)
|
|
171
|
+
for ____, value in ipairs(iRange(nil, lastValue)) do
|
|
172
172
|
if not valuesSet:has(value) then
|
|
173
173
|
error((("Failed to find a custom enum value of " .. tostring(value)) .. " for: ") .. transpiledEnumName)
|
|
174
174
|
end
|
|
@@ -37,7 +37,7 @@ local ____types = require("src.functions.types")
|
|
|
37
37
|
local asNumber = ____types.asNumber
|
|
38
38
|
local isNumber = ____types.isNumber
|
|
39
39
|
local ____utils = require("src.functions.utils")
|
|
40
|
-
local
|
|
40
|
+
local eRange = ____utils.eRange
|
|
41
41
|
local ____vector = require("src.functions.vector")
|
|
42
42
|
local isVector = ____vector.isVector
|
|
43
43
|
local vectorEquals = ____vector.vectorEquals
|
|
@@ -47,7 +47,7 @@ local vectorEquals = ____vector.vectorEquals
|
|
|
47
47
|
function ____exports.getAllGridIndexes(self)
|
|
48
48
|
local room = game:GetRoom()
|
|
49
49
|
local gridSize = room:GetGridSize()
|
|
50
|
-
return
|
|
50
|
+
return eRange(nil, gridSize)
|
|
51
51
|
end
|
|
52
52
|
function getAllGridEntities(self)
|
|
53
53
|
local room = game:GetRoom()
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { RoomShape } from "isaac-typescript-definitions";
|
|
2
|
+
/**
|
|
3
|
+
* Helper function to get all of the grid indexes between two grid indexes on either a horizontal or
|
|
4
|
+
* vertical line, inclusive on both ends.
|
|
5
|
+
*
|
|
6
|
+
* This function will throw a run-time error if the two provided grid indexes are not on the same
|
|
7
|
+
* horizontal or vertical line.
|
|
8
|
+
*/
|
|
9
|
+
export declare function getGridIndexesBetween(gridIndex1: int, gridIndex2: int, roomShape: RoomShape): int[];
|
|
10
|
+
//# sourceMappingURL=gridIndex.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gridIndex.d.ts","sourceRoot":"","sources":["../../../src/functions/gridIndex.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AAIzD;;;;;;GAMG;AACH,wBAAgB,qBAAqB,CACnC,UAAU,EAAE,GAAG,EACf,UAAU,EAAE,GAAG,EACf,SAAS,EAAE,SAAS,GACnB,GAAG,EAAE,CAwBP"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
local ____exports = {}
|
|
2
|
+
local ____isaac_2Dtypescript_2Ddefinitions = require("isaac-typescript-definitions")
|
|
3
|
+
local RoomShape = ____isaac_2Dtypescript_2Ddefinitions.RoomShape
|
|
4
|
+
local ____roomShape = require("src.functions.roomShape")
|
|
5
|
+
local getRoomShapeWidth = ____roomShape.getRoomShapeWidth
|
|
6
|
+
local ____utils = require("src.functions.utils")
|
|
7
|
+
local iRange = ____utils.iRange
|
|
8
|
+
--- Helper function to get all of the grid indexes between two grid indexes on either a horizontal or
|
|
9
|
+
-- vertical line, inclusive on both ends.
|
|
10
|
+
--
|
|
11
|
+
-- This function will throw a run-time error if the two provided grid indexes are not on the same
|
|
12
|
+
-- horizontal or vertical line.
|
|
13
|
+
function ____exports.getGridIndexesBetween(self, gridIndex1, gridIndex2, roomShape)
|
|
14
|
+
if gridIndex1 > gridIndex2 then
|
|
15
|
+
local oldGridIndex1 = gridIndex1
|
|
16
|
+
local oldGridIndex2 = gridIndex2
|
|
17
|
+
gridIndex1 = oldGridIndex2
|
|
18
|
+
gridIndex2 = oldGridIndex1
|
|
19
|
+
end
|
|
20
|
+
local delta = gridIndex2 - gridIndex1
|
|
21
|
+
local gridWidth = getRoomShapeWidth(nil, roomShape)
|
|
22
|
+
local isOnHorizontalLine = delta <= gridWidth
|
|
23
|
+
if isOnHorizontalLine then
|
|
24
|
+
return iRange(nil, gridIndex1, gridIndex2)
|
|
25
|
+
end
|
|
26
|
+
local isOnVerticalLine = delta % gridWidth == 0
|
|
27
|
+
if isOnVerticalLine then
|
|
28
|
+
return iRange(nil, gridIndex1, gridIndex2, gridWidth)
|
|
29
|
+
end
|
|
30
|
+
error(((((((("Failed to get the grid indexes between " .. tostring(gridIndex1)) .. " and ") .. tostring(gridIndex2)) .. " for RoomShape.") .. tostring(RoomShape[roomShape])) .. " (") .. tostring(roomShape)) .. ") since they are not on the same horizontal or vertical line.")
|
|
31
|
+
end
|
|
32
|
+
return ____exports
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"log.d.ts","sourceRoot":"","sources":["../../../src/functions/log.ts"],"names":[],"mappings":";AAAA,OAAO,EACL,eAAe,EACf,UAAU,EACV,UAAU,EAKV,cAAc,EAGd,QAAQ,EACR,OAAO,EACR,MAAM,8BAA8B,CAAC;AAkBtC;;GAEG;AAC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AAE,CAAC,CAAC,EACpB,MAAM,EAAE,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,GACnB,IAAI,CA8BN;AAED,iGAAiG;AACjG,wBAAgB,YAAY,CAAC,KAAK,EAAE,QAAQ,GAAG,QAAQ,CAAC,QAAQ,CAAC,GAAG,IAAI,CAEvE;AAED,gGAAgG;AAChG,wBAAgB,WAAW,CAAC,KAAK,EAAE,OAAO,GAAG,QAAQ,CAAC,OAAO,CAAC,GAAG,IAAI,CAEpE;AAED;;;GAGG;AACH,wBAAgB,WAAW,CAAC,QAAQ,EAAE,OAAO,GAAG,IAAI,CAoBnD;AAED,wBAAgB,SAAS,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,UAAQ,GAAG,IAAI,CAG7D"}
|
|
@@ -311,38 +311,39 @@ function ____exports.logRoom(self)
|
|
|
311
311
|
local roomGridIndex = getRoomGridIndex(nil)
|
|
312
312
|
local roomListIndex = getRoomListIndex(nil)
|
|
313
313
|
local roomData = getRoomData(nil)
|
|
314
|
+
____exports.log(nil, "Current room information:")
|
|
314
315
|
if roomData == nil then
|
|
315
|
-
____exports.log(nil, "
|
|
316
|
+
____exports.log(nil, "- Room data is undefined.")
|
|
316
317
|
else
|
|
317
318
|
____exports.log(
|
|
318
319
|
nil,
|
|
319
|
-
"
|
|
320
|
+
"- Room stage ID: " .. tostring(roomData.StageID)
|
|
320
321
|
)
|
|
321
322
|
____exports.log(
|
|
322
323
|
nil,
|
|
323
|
-
(((("
|
|
324
|
+
(((("- Type/variant/sub-type: " .. tostring(roomData.Type)) .. ".") .. tostring(roomData.Variant)) .. ".") .. tostring(roomData.Subtype)
|
|
324
325
|
)
|
|
325
|
-
____exports.log(nil, "
|
|
326
|
+
____exports.log(nil, "- Name: " .. roomData.Name)
|
|
326
327
|
end
|
|
327
328
|
local roomGridIndexName = GridRoom[roomGridIndex]
|
|
328
329
|
if roomGridIndexName == nil then
|
|
329
330
|
____exports.log(
|
|
330
331
|
nil,
|
|
331
|
-
"
|
|
332
|
+
"- Grid index: " .. tostring(roomGridIndex)
|
|
332
333
|
)
|
|
333
334
|
else
|
|
334
335
|
____exports.log(
|
|
335
336
|
nil,
|
|
336
|
-
((("
|
|
337
|
+
((("- Grid index: GridRoom." .. roomGridIndexName) .. " (") .. tostring(roomGridIndex)) .. ")"
|
|
337
338
|
)
|
|
338
339
|
end
|
|
339
340
|
____exports.log(
|
|
340
341
|
nil,
|
|
341
|
-
"
|
|
342
|
+
"- List index: " .. tostring(roomListIndex)
|
|
342
343
|
)
|
|
343
344
|
____exports.log(
|
|
344
345
|
nil,
|
|
345
|
-
"
|
|
346
|
+
"- Boss ID: " .. tostring(bossID)
|
|
346
347
|
)
|
|
347
348
|
end
|
|
348
349
|
--- Helper function for printing out every seed effect (i.e. Easter Egg) that is turned on for the
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logEntities.d.ts","sourceRoot":"","sources":["../../../src/functions/logEntities.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"logEntities.d.ts","sourceRoot":"","sources":["../../../src/functions/logEntities.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,UAAU,EAEV,cAAc,EAOf,MAAM,8BAA8B,CAAC;AAiBtC,8FAA8F;AAC9F,wBAAgB,cAAc,CAC5B,wBAAwB,EAAE,OAAO,EACjC,gBAAgB,CAAC,EAAE,UAAU,GAC5B,IAAI,CAuCN;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAChC,YAAY,EAAE,OAAO,EACrB,oBAAoB,CAAC,EAAE,cAAc,GACpC,IAAI,CA6CN;AAED,iEAAiE;AACjE,wBAAgB,WAAW,CAAC,QAAQ,EAAE,MAAM,EAAE,GAAG,IAAI,CAIpD;AAED,kEAAkE;AAClE,wBAAgB,SAAS,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAG9C;AAmFD,sEAAsE;AACtE,wBAAgB,eAAe,CAAC,YAAY,EAAE,UAAU,EAAE,GAAG,IAAI,CAIhE;AAED,wEAAwE;AACxE,wBAAgB,aAAa,CAAC,UAAU,EAAE,UAAU,GAAG,IAAI,CAG1D;AA2DD;;;GAGG;AACH,wBAAgB,UAAU,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAQjD;AAED;;;GAGG;AACH,wBAAgB,YAAY,CAAC,SAAS,EAAE,OAAO,EAAE,GAAG,IAAI,CAIvD"}
|
|
@@ -5,8 +5,16 @@ local __TS__ArrayForEach = ____lualib.__TS__ArrayForEach
|
|
|
5
5
|
local ____exports = {}
|
|
6
6
|
local getEntityLogLine, getGridEntityLogLine
|
|
7
7
|
local ____isaac_2Dtypescript_2Ddefinitions = require("isaac-typescript-definitions")
|
|
8
|
+
local BombVariant = ____isaac_2Dtypescript_2Ddefinitions.BombVariant
|
|
8
9
|
local EffectVariant = ____isaac_2Dtypescript_2Ddefinitions.EffectVariant
|
|
10
|
+
local FamiliarVariant = ____isaac_2Dtypescript_2Ddefinitions.FamiliarVariant
|
|
9
11
|
local GridEntityType = ____isaac_2Dtypescript_2Ddefinitions.GridEntityType
|
|
12
|
+
local KnifeVariant = ____isaac_2Dtypescript_2Ddefinitions.KnifeVariant
|
|
13
|
+
local LaserVariant = ____isaac_2Dtypescript_2Ddefinitions.LaserVariant
|
|
14
|
+
local PickupVariant = ____isaac_2Dtypescript_2Ddefinitions.PickupVariant
|
|
15
|
+
local PlayerVariant = ____isaac_2Dtypescript_2Ddefinitions.PlayerVariant
|
|
16
|
+
local ProjectileVariant = ____isaac_2Dtypescript_2Ddefinitions.ProjectileVariant
|
|
17
|
+
local TearVariant = ____isaac_2Dtypescript_2Ddefinitions.TearVariant
|
|
10
18
|
local ____entities = require("src.functions.entities")
|
|
11
19
|
local getEntities = ____entities.getEntities
|
|
12
20
|
local getEntityFromPtrHash = ____entities.getEntityFromPtrHash
|
|
@@ -26,23 +34,23 @@ function getEntityLogLine(self, entity, num)
|
|
|
26
34
|
msg = msg .. getEntityID(nil, entity)
|
|
27
35
|
local bomb = entity:ToBomb()
|
|
28
36
|
if bomb ~= nil then
|
|
29
|
-
msg = msg .. " (bomb)"
|
|
37
|
+
msg = msg .. (" (bomb - BombVariant." .. tostring(BombVariant[bomb.Variant])) .. ")"
|
|
30
38
|
end
|
|
31
39
|
local effect = entity:ToEffect()
|
|
32
40
|
if effect ~= nil then
|
|
33
|
-
msg = msg .. (" (effect) (State: " .. tostring(effect.State)) .. ")"
|
|
41
|
+
msg = msg .. (((" (effect - EffectVariant." .. tostring(EffectVariant[effect.Variant])) .. ") (State: ") .. tostring(effect.State)) .. ")"
|
|
34
42
|
end
|
|
35
43
|
local familiar = entity:ToFamiliar()
|
|
36
44
|
if familiar ~= nil then
|
|
37
|
-
msg = msg .. (" (familiar) (State: " .. tostring(familiar.State)) .. ")"
|
|
45
|
+
msg = msg .. (((" (familiar - FamiliarVariant." .. tostring(FamiliarVariant[familiar.Variant])) .. ") (State: ") .. tostring(familiar.State)) .. ")"
|
|
38
46
|
end
|
|
39
47
|
local knife = entity:ToKnife()
|
|
40
48
|
if knife ~= nil then
|
|
41
|
-
msg = msg .. " (knife)"
|
|
49
|
+
msg = msg .. (" (knife - KnifeVariant." .. tostring(KnifeVariant[knife.Variant])) .. ")"
|
|
42
50
|
end
|
|
43
51
|
local laser = entity:ToLaser()
|
|
44
52
|
if laser ~= nil then
|
|
45
|
-
msg = msg .. " (laser)"
|
|
53
|
+
msg = msg .. (" (laser - LaserVariant." .. tostring(LaserVariant[laser.Variant])) .. ")"
|
|
46
54
|
end
|
|
47
55
|
local npc = entity:ToNPC()
|
|
48
56
|
if npc ~= nil then
|
|
@@ -50,19 +58,19 @@ function getEntityLogLine(self, entity, num)
|
|
|
50
58
|
end
|
|
51
59
|
local pickup = entity:ToPickup()
|
|
52
60
|
if pickup ~= nil then
|
|
53
|
-
msg = msg .. (" (pickup) (State: " .. tostring(pickup.State)) .. ")"
|
|
61
|
+
msg = msg .. (((" (pickup - PickupVariant." .. tostring(PickupVariant[pickup.Variant])) .. ") (State: ") .. tostring(pickup.State)) .. ")"
|
|
54
62
|
end
|
|
55
63
|
local player = entity:ToPlayer()
|
|
56
64
|
if player ~= nil then
|
|
57
|
-
msg = msg .. " (player)"
|
|
65
|
+
msg = msg .. (" (player - PlayerVariant." .. tostring(PlayerVariant[player.Variant])) .. ")"
|
|
58
66
|
end
|
|
59
67
|
local projectile = entity:ToProjectile()
|
|
60
68
|
if projectile ~= nil then
|
|
61
|
-
msg = msg .. " (projectile)"
|
|
69
|
+
msg = msg .. (" (projectile - ProjectileVariant." .. tostring(ProjectileVariant[projectile.Variant])) .. "))"
|
|
62
70
|
end
|
|
63
71
|
local tear = entity:ToTear()
|
|
64
72
|
if tear ~= nil then
|
|
65
|
-
msg = msg .. " (tear)"
|
|
73
|
+
msg = msg .. (" (tear - TearVariant." .. tostring(TearVariant[tear.Variant])) .. "))"
|
|
66
74
|
end
|
|
67
75
|
msg = msg .. "\n"
|
|
68
76
|
msg = msg .. (" - Index: " .. tostring(entity.Index)) .. "\n"
|
|
@@ -31,7 +31,7 @@ local ____types = require("src.functions.types")
|
|
|
31
31
|
local asNumber = ____types.asNumber
|
|
32
32
|
local asPillColor = ____types.asPillColor
|
|
33
33
|
local ____utils = require("src.functions.utils")
|
|
34
|
-
local
|
|
34
|
+
local iRange = ____utils.iRange
|
|
35
35
|
function ____exports.isVanillaPillEffect(self, pillEffect)
|
|
36
36
|
return pillEffect <= LAST_VANILLA_PILL_EFFECT
|
|
37
37
|
end
|
|
@@ -63,7 +63,7 @@ function ____exports.getHorsePillColor(self, pillColor)
|
|
|
63
63
|
end
|
|
64
64
|
--- Helper function to get an array with every non-gold horse pill color.
|
|
65
65
|
function ____exports.getHorsePillColors(self)
|
|
66
|
-
return
|
|
66
|
+
return iRange(nil, FIRST_HORSE_PILL_COLOR, LAST_HORSE_PILL_COLOR)
|
|
67
67
|
end
|
|
68
68
|
--- Helper function to get the corresponding normal pill color from a horse pill color.
|
|
69
69
|
--
|
|
@@ -79,7 +79,7 @@ function ____exports.getNormalPillColorFromHorse(self, pillColor)
|
|
|
79
79
|
end
|
|
80
80
|
--- Helper function to get an array with every non-gold and non-horse pill color.
|
|
81
81
|
function ____exports.getNormalPillColors(self)
|
|
82
|
-
return
|
|
82
|
+
return iRange(nil, FIRST_PILL_COLOR, LAST_NORMAL_PILL_COLOR)
|
|
83
83
|
end
|
|
84
84
|
--- Helper function to get the associated pill effect after PHD is acquired. If a pill effect is not
|
|
85
85
|
-- altered by PHD, then the same pill effect will be returned.
|
|
@@ -125,7 +125,7 @@ function ____exports.getPillEffectType(self, pillEffect)
|
|
|
125
125
|
end
|
|
126
126
|
--- Helper function to get an array with every vanilla pill effect.
|
|
127
127
|
function ____exports.getVanillaPillEffects(self)
|
|
128
|
-
return
|
|
128
|
+
return iRange(nil, FIRST_PILL_EFFECT, LAST_VANILLA_PILL_EFFECT)
|
|
129
129
|
end
|
|
130
130
|
function ____exports.isHorsePill(self, pillColor)
|
|
131
131
|
return asNumber(nil, pillColor) > HORSE_PILL_ADJUSTMENT
|
|
@@ -28,7 +28,12 @@ export declare function getRoomShapeBounds(roomShape: RoomShape): readonly [widt
|
|
|
28
28
|
* For example, `RoomShape.SHAPE_2x2` will return 2.
|
|
29
29
|
*/
|
|
30
30
|
export declare function getRoomShapeCharges(roomShape: RoomShape): int;
|
|
31
|
-
/**
|
|
31
|
+
/**
|
|
32
|
+
* Helper function to get the corners that exist in the given room shape.
|
|
33
|
+
*
|
|
34
|
+
* Note that these corner locations are not accurate for the Mother Boss Room and the Home closet
|
|
35
|
+
* rooms. (Those rooms have custom shapes.)
|
|
36
|
+
*/
|
|
32
37
|
export declare function getRoomShapeCorners(roomShape: RoomShape): readonly Corner[];
|
|
33
38
|
/**
|
|
34
39
|
* Helper function to get the dimensions of a room shape's layout. This is NOT the size of the
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"roomShape.d.ts","sourceRoot":"","sources":["../../../src/functions/roomShape.ts"],"names":[],"mappings":"AAAA,OAAO,EAA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E,SAAS,GAAG,SAAS,MAAM,EAAE,CAE3E;AAED;;;;;GAKG;AACH,wBAAgB,sBAAsB,CACpC,SAAS,EAAE,SAAS,GACnB,SAAS,CAAC,KAAK,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,CAAC,CAEpC;AAED;;;;;GAKG;AACH,wBAAgB,2BAA2B,CACzC,SAAS,EAAE,SAAS,GACnB,QAAQ,CAAC,MAAM,CAAC,CAElB;AAED;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,SAAS,EAAE,SAAS,GAAG,GAAG,CAE5D;AAED,wBAAgB,iBAAiB,CAAC,SAAS,EAAE,SAAS,GAAG,GAAG,CAE3D;AAED,wBAAgB,OAAO,CAAC,SAAS,EAAE,SAAS,GAAG,OAAO,CAErD;AAED,wBAAgB,YAAY,CAAC,SAAS,EAAE,SAAS,GAAG,OAAO,CAE1D;AAED;;;;;GAKG;AACH,wBAAgB,uBAAuB,CAAC,SAAS,EAAE,SAAS,GAAG,OAAO,CAGrE"}
|
|
@@ -60,6 +60,9 @@ function ____exports.getRoomShapeCharges(self, roomShape)
|
|
|
60
60
|
return ____exports.isRoomShapeDoubleCharge(nil, roomShape) and 2 or 1
|
|
61
61
|
end
|
|
62
62
|
--- Helper function to get the corners that exist in the given room shape.
|
|
63
|
+
--
|
|
64
|
+
-- Note that these corner locations are not accurate for the Mother Boss Room and the Home closet
|
|
65
|
+
-- rooms. (Those rooms have custom shapes.)
|
|
63
66
|
function ____exports.getRoomShapeCorners(self, roomShape)
|
|
64
67
|
return ROOM_SHAPE_CORNERS[roomShape]
|
|
65
68
|
end
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/// <reference types="isaac-typescript-definitions" />
|
|
2
|
+
/**
|
|
3
|
+
* Helper function to determine if a given grid index should have a wall generated by the vanilla
|
|
4
|
+
* game. This is useful as a mechanism to distinguish between real walls and custom walls spawned by
|
|
5
|
+
* mods.
|
|
6
|
+
*
|
|
7
|
+
* This function properly handles the special cases of the Mother boss room and the Home closet
|
|
8
|
+
* rooms, which are both non-standard room shapes.
|
|
9
|
+
*/
|
|
10
|
+
export declare function isVanillaWallGridIndex(gridIndex: int): boolean;
|
|
11
|
+
//# sourceMappingURL=roomShapeWalls.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"roomShapeWalls.d.ts","sourceRoot":"","sources":["../../../src/functions/roomShapeWalls.ts"],"names":[],"mappings":";AAwTA;;;;;;;GAOG;AACH,wBAAgB,sBAAsB,CAAC,SAAS,EAAE,GAAG,GAAG,OAAO,CAqB9D"}
|
|
@@ -0,0 +1,273 @@
|
|
|
1
|
+
local ____lualib = require("lualib_bundle")
|
|
2
|
+
local Map = ____lualib.Map
|
|
3
|
+
local __TS__New = ____lualib.__TS__New
|
|
4
|
+
local __TS__SparseArrayNew = ____lualib.__TS__SparseArrayNew
|
|
5
|
+
local __TS__SparseArrayPush = ____lualib.__TS__SparseArrayPush
|
|
6
|
+
local __TS__SparseArraySpread = ____lualib.__TS__SparseArraySpread
|
|
7
|
+
local Set = ____lualib.Set
|
|
8
|
+
local ____exports = {}
|
|
9
|
+
local getRoomShapeToWallGridIndexSet, getVanillaWallGridIndexSetForRoomShape, getWallGridIndexSetForRectangleRoomShape
|
|
10
|
+
local ____isaac_2Dtypescript_2Ddefinitions = require("isaac-typescript-definitions")
|
|
11
|
+
local BossID = ____isaac_2Dtypescript_2Ddefinitions.BossID
|
|
12
|
+
local RoomShape = ____isaac_2Dtypescript_2Ddefinitions.RoomShape
|
|
13
|
+
local ____cachedClasses = require("src.core.cachedClasses")
|
|
14
|
+
local game = ____cachedClasses.game
|
|
15
|
+
local ____CornerType = require("src.enums.CornerType")
|
|
16
|
+
local CornerType = ____CornerType.CornerType
|
|
17
|
+
local ____enums = require("src.functions.enums")
|
|
18
|
+
local getEnumValues = ____enums.getEnumValues
|
|
19
|
+
local ____gridIndex = require("src.functions.gridIndex")
|
|
20
|
+
local getGridIndexesBetween = ____gridIndex.getGridIndexesBetween
|
|
21
|
+
local ____rooms = require("src.functions.rooms")
|
|
22
|
+
local inBossRoomOf = ____rooms.inBossRoomOf
|
|
23
|
+
local inHomeCloset = ____rooms.inHomeCloset
|
|
24
|
+
local ____roomShape = require("src.functions.roomShape")
|
|
25
|
+
local getRoomShapeCorners = ____roomShape.getRoomShapeCorners
|
|
26
|
+
local isLRoom = ____roomShape.isLRoom
|
|
27
|
+
function getRoomShapeToWallGridIndexSet(self)
|
|
28
|
+
local roomShapeToWallGridIndexSet = __TS__New(Map)
|
|
29
|
+
for ____, roomShape in ipairs(getEnumValues(nil, RoomShape)) do
|
|
30
|
+
local gridIndexSet = getVanillaWallGridIndexSetForRoomShape(nil, roomShape)
|
|
31
|
+
roomShapeToWallGridIndexSet:set(roomShape, gridIndexSet)
|
|
32
|
+
end
|
|
33
|
+
return roomShapeToWallGridIndexSet
|
|
34
|
+
end
|
|
35
|
+
function getVanillaWallGridIndexSetForRoomShape(self, roomShape)
|
|
36
|
+
local corners = getRoomShapeCorners(nil, roomShape)
|
|
37
|
+
local lRoom = isLRoom(nil, roomShape)
|
|
38
|
+
if lRoom and #corners ~= 6 then
|
|
39
|
+
error(((("Failed to get the correct amount of corners for: RoomShape." .. tostring(RoomShape[roomShape])) .. " (") .. tostring(roomShape)) .. ")")
|
|
40
|
+
end
|
|
41
|
+
repeat
|
|
42
|
+
local ____switch7 = roomShape
|
|
43
|
+
local ____cond7 = ____switch7 == RoomShape.LTL
|
|
44
|
+
if ____cond7 then
|
|
45
|
+
do
|
|
46
|
+
local topMiddle, topRight, middleLeft, middle, bottomLeft, bottomRight = table.unpack(corners)
|
|
47
|
+
local ____Set_1 = Set
|
|
48
|
+
local ____array_0 = __TS__SparseArrayNew(table.unpack(getGridIndexesBetween(nil, topMiddle.gridIndex, topRight.gridIndex, roomShape)))
|
|
49
|
+
__TS__SparseArrayPush(
|
|
50
|
+
____array_0,
|
|
51
|
+
table.unpack(getGridIndexesBetween(nil, middleLeft.gridIndex, middle.gridIndex, roomShape))
|
|
52
|
+
)
|
|
53
|
+
__TS__SparseArrayPush(
|
|
54
|
+
____array_0,
|
|
55
|
+
table.unpack(getGridIndexesBetween(nil, bottomLeft.gridIndex, bottomRight.gridIndex, roomShape))
|
|
56
|
+
)
|
|
57
|
+
__TS__SparseArrayPush(
|
|
58
|
+
____array_0,
|
|
59
|
+
table.unpack(getGridIndexesBetween(nil, middleLeft.gridIndex, bottomLeft.gridIndex, roomShape))
|
|
60
|
+
)
|
|
61
|
+
__TS__SparseArrayPush(
|
|
62
|
+
____array_0,
|
|
63
|
+
table.unpack(getGridIndexesBetween(nil, topMiddle.gridIndex, middle.gridIndex, roomShape))
|
|
64
|
+
)
|
|
65
|
+
__TS__SparseArrayPush(
|
|
66
|
+
____array_0,
|
|
67
|
+
table.unpack(getGridIndexesBetween(nil, topRight.gridIndex, bottomRight.gridIndex, roomShape))
|
|
68
|
+
)
|
|
69
|
+
return __TS__New(
|
|
70
|
+
____Set_1,
|
|
71
|
+
{__TS__SparseArraySpread(____array_0)}
|
|
72
|
+
)
|
|
73
|
+
end
|
|
74
|
+
end
|
|
75
|
+
____cond7 = ____cond7 or ____switch7 == RoomShape.LTR
|
|
76
|
+
if ____cond7 then
|
|
77
|
+
do
|
|
78
|
+
local topLeft, topMiddle, middle, middleRight, bottomLeft, bottomRight = table.unpack(corners)
|
|
79
|
+
local ____Set_3 = Set
|
|
80
|
+
local ____array_2 = __TS__SparseArrayNew(table.unpack(getGridIndexesBetween(nil, topLeft.gridIndex, topMiddle.gridIndex, roomShape)))
|
|
81
|
+
__TS__SparseArrayPush(
|
|
82
|
+
____array_2,
|
|
83
|
+
table.unpack(getGridIndexesBetween(nil, middle.gridIndex, middleRight.gridIndex, roomShape))
|
|
84
|
+
)
|
|
85
|
+
__TS__SparseArrayPush(
|
|
86
|
+
____array_2,
|
|
87
|
+
table.unpack(getGridIndexesBetween(nil, bottomLeft.gridIndex, bottomRight.gridIndex, roomShape))
|
|
88
|
+
)
|
|
89
|
+
__TS__SparseArrayPush(
|
|
90
|
+
____array_2,
|
|
91
|
+
table.unpack(getGridIndexesBetween(nil, topLeft.gridIndex, bottomLeft.gridIndex, roomShape))
|
|
92
|
+
)
|
|
93
|
+
__TS__SparseArrayPush(
|
|
94
|
+
____array_2,
|
|
95
|
+
table.unpack(getGridIndexesBetween(nil, topMiddle.gridIndex, middle.gridIndex, roomShape))
|
|
96
|
+
)
|
|
97
|
+
__TS__SparseArrayPush(
|
|
98
|
+
____array_2,
|
|
99
|
+
table.unpack(getGridIndexesBetween(nil, middleRight.gridIndex, bottomRight.gridIndex, roomShape))
|
|
100
|
+
)
|
|
101
|
+
return __TS__New(
|
|
102
|
+
____Set_3,
|
|
103
|
+
{__TS__SparseArraySpread(____array_2)}
|
|
104
|
+
)
|
|
105
|
+
end
|
|
106
|
+
end
|
|
107
|
+
____cond7 = ____cond7 or ____switch7 == RoomShape.LBL
|
|
108
|
+
if ____cond7 then
|
|
109
|
+
do
|
|
110
|
+
local topLeft, topRight, middleLeft, middle, bottomMiddle, bottomRight = table.unpack(corners)
|
|
111
|
+
local ____Set_5 = Set
|
|
112
|
+
local ____array_4 = __TS__SparseArrayNew(table.unpack(getGridIndexesBetween(nil, topLeft.gridIndex, topRight.gridIndex, roomShape)))
|
|
113
|
+
__TS__SparseArrayPush(
|
|
114
|
+
____array_4,
|
|
115
|
+
table.unpack(getGridIndexesBetween(nil, middleLeft.gridIndex, middle.gridIndex, roomShape))
|
|
116
|
+
)
|
|
117
|
+
__TS__SparseArrayPush(
|
|
118
|
+
____array_4,
|
|
119
|
+
table.unpack(getGridIndexesBetween(nil, bottomMiddle.gridIndex, bottomRight.gridIndex, roomShape))
|
|
120
|
+
)
|
|
121
|
+
__TS__SparseArrayPush(
|
|
122
|
+
____array_4,
|
|
123
|
+
table.unpack(getGridIndexesBetween(nil, topLeft.gridIndex, middleLeft.gridIndex, roomShape))
|
|
124
|
+
)
|
|
125
|
+
__TS__SparseArrayPush(
|
|
126
|
+
____array_4,
|
|
127
|
+
table.unpack(getGridIndexesBetween(nil, middle.gridIndex, bottomMiddle.gridIndex, roomShape))
|
|
128
|
+
)
|
|
129
|
+
__TS__SparseArrayPush(
|
|
130
|
+
____array_4,
|
|
131
|
+
table.unpack(getGridIndexesBetween(nil, topRight.gridIndex, bottomRight.gridIndex, roomShape))
|
|
132
|
+
)
|
|
133
|
+
return __TS__New(
|
|
134
|
+
____Set_5,
|
|
135
|
+
{__TS__SparseArraySpread(____array_4)}
|
|
136
|
+
)
|
|
137
|
+
end
|
|
138
|
+
end
|
|
139
|
+
____cond7 = ____cond7 or ____switch7 == RoomShape.LBR
|
|
140
|
+
if ____cond7 then
|
|
141
|
+
do
|
|
142
|
+
local topLeft, topRight, middle, middleRight, bottomLeft, bottomMiddle = table.unpack(corners)
|
|
143
|
+
local ____Set_7 = Set
|
|
144
|
+
local ____array_6 = __TS__SparseArrayNew(table.unpack(getGridIndexesBetween(nil, topLeft.gridIndex, topRight.gridIndex, roomShape)))
|
|
145
|
+
__TS__SparseArrayPush(
|
|
146
|
+
____array_6,
|
|
147
|
+
table.unpack(getGridIndexesBetween(nil, middle.gridIndex, middleRight.gridIndex, roomShape))
|
|
148
|
+
)
|
|
149
|
+
__TS__SparseArrayPush(
|
|
150
|
+
____array_6,
|
|
151
|
+
table.unpack(getGridIndexesBetween(nil, bottomLeft.gridIndex, bottomMiddle.gridIndex, roomShape))
|
|
152
|
+
)
|
|
153
|
+
__TS__SparseArrayPush(
|
|
154
|
+
____array_6,
|
|
155
|
+
table.unpack(getGridIndexesBetween(nil, topLeft.gridIndex, bottomLeft.gridIndex, roomShape))
|
|
156
|
+
)
|
|
157
|
+
__TS__SparseArrayPush(
|
|
158
|
+
____array_6,
|
|
159
|
+
table.unpack(getGridIndexesBetween(nil, middle.gridIndex, bottomMiddle.gridIndex, roomShape))
|
|
160
|
+
)
|
|
161
|
+
__TS__SparseArrayPush(
|
|
162
|
+
____array_6,
|
|
163
|
+
table.unpack(getGridIndexesBetween(nil, topRight.gridIndex, middleRight.gridIndex, roomShape))
|
|
164
|
+
)
|
|
165
|
+
return __TS__New(
|
|
166
|
+
____Set_7,
|
|
167
|
+
{__TS__SparseArraySpread(____array_6)}
|
|
168
|
+
)
|
|
169
|
+
end
|
|
170
|
+
end
|
|
171
|
+
do
|
|
172
|
+
do
|
|
173
|
+
return getWallGridIndexSetForRectangleRoomShape(nil, roomShape, corners)
|
|
174
|
+
end
|
|
175
|
+
end
|
|
176
|
+
until true
|
|
177
|
+
end
|
|
178
|
+
function getWallGridIndexSetForRectangleRoomShape(self, roomShape, corners)
|
|
179
|
+
if #corners ~= 4 then
|
|
180
|
+
error("Failed to get the correct amount of corners for rectangular room shape.")
|
|
181
|
+
end
|
|
182
|
+
local topLeft, topRight, bottomLeft, bottomRight = table.unpack(corners)
|
|
183
|
+
local ____Set_9 = Set
|
|
184
|
+
local ____array_8 = __TS__SparseArrayNew(table.unpack(getGridIndexesBetween(nil, topLeft.gridIndex, topRight.gridIndex, roomShape)))
|
|
185
|
+
__TS__SparseArrayPush(
|
|
186
|
+
____array_8,
|
|
187
|
+
table.unpack(getGridIndexesBetween(nil, bottomLeft.gridIndex, bottomRight.gridIndex, roomShape))
|
|
188
|
+
)
|
|
189
|
+
__TS__SparseArrayPush(
|
|
190
|
+
____array_8,
|
|
191
|
+
table.unpack(getGridIndexesBetween(nil, topLeft.gridIndex, bottomLeft.gridIndex, roomShape))
|
|
192
|
+
)
|
|
193
|
+
__TS__SparseArrayPush(
|
|
194
|
+
____array_8,
|
|
195
|
+
table.unpack(getGridIndexesBetween(nil, topRight.gridIndex, bottomRight.gridIndex, roomShape))
|
|
196
|
+
)
|
|
197
|
+
return __TS__New(
|
|
198
|
+
____Set_9,
|
|
199
|
+
{__TS__SparseArraySpread(____array_8)}
|
|
200
|
+
)
|
|
201
|
+
end
|
|
202
|
+
local ROOM_SHAPE_TO_WALL_GRID_INDEX_SET = getRoomShapeToWallGridIndexSet(nil)
|
|
203
|
+
--- The Home closet is is 9x3, which is different from `RoomShape.IH` (which is 13x3).
|
|
204
|
+
local HOME_CLOSET_CORNERS = {
|
|
205
|
+
{
|
|
206
|
+
type = CornerType.TOP_LEFT,
|
|
207
|
+
gridIndex = 30,
|
|
208
|
+
position = Vector(60, 220)
|
|
209
|
+
},
|
|
210
|
+
{
|
|
211
|
+
type = CornerType.TOP_RIGHT,
|
|
212
|
+
gridIndex = 38,
|
|
213
|
+
position = Vector(340, 220)
|
|
214
|
+
},
|
|
215
|
+
{
|
|
216
|
+
type = CornerType.BOTTOM_LEFT,
|
|
217
|
+
gridIndex = 90,
|
|
218
|
+
position = Vector(60, 340)
|
|
219
|
+
},
|
|
220
|
+
{
|
|
221
|
+
type = CornerType.BOTTOM_RIGHT,
|
|
222
|
+
gridIndex = 98,
|
|
223
|
+
position = Vector(340, 340)
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
local HOME_CLOSET_CORNERS_SET = getWallGridIndexSetForRectangleRoomShape(nil, RoomShape.IH, HOME_CLOSET_CORNERS)
|
|
227
|
+
--- The Mother Boss Room is 15x11, which is different from `RoomShape.SHAPE_1x2` (which is 15x16).
|
|
228
|
+
local MOTHER_ROOM_CORNERS = {
|
|
229
|
+
{
|
|
230
|
+
type = CornerType.TOP_LEFT,
|
|
231
|
+
gridIndex = 0,
|
|
232
|
+
position = Vector(60, 140)
|
|
233
|
+
},
|
|
234
|
+
{
|
|
235
|
+
type = CornerType.TOP_RIGHT,
|
|
236
|
+
gridIndex = 14,
|
|
237
|
+
position = Vector(580, 140)
|
|
238
|
+
},
|
|
239
|
+
{
|
|
240
|
+
type = CornerType.BOTTOM_LEFT,
|
|
241
|
+
gridIndex = 150,
|
|
242
|
+
position = Vector(60, 500)
|
|
243
|
+
},
|
|
244
|
+
{
|
|
245
|
+
type = CornerType.BOTTOM_RIGHT,
|
|
246
|
+
gridIndex = 164,
|
|
247
|
+
position = Vector(580, 500)
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
local MOTHER_ROOM_CORNERS_SET = getWallGridIndexSetForRectangleRoomShape(nil, RoomShape.SHAPE_1x2, MOTHER_ROOM_CORNERS)
|
|
251
|
+
--- Helper function to determine if a given grid index should have a wall generated by the vanilla
|
|
252
|
+
-- game. This is useful as a mechanism to distinguish between real walls and custom walls spawned by
|
|
253
|
+
-- mods.
|
|
254
|
+
--
|
|
255
|
+
-- This function properly handles the special cases of the Mother boss room and the Home closet
|
|
256
|
+
-- rooms, which are both non-standard room shapes.
|
|
257
|
+
function ____exports.isVanillaWallGridIndex(self, gridIndex)
|
|
258
|
+
local room = game:GetRoom()
|
|
259
|
+
local roomShape = room:GetRoomShape()
|
|
260
|
+
local wallGridIndexSet
|
|
261
|
+
if inHomeCloset(nil) then
|
|
262
|
+
wallGridIndexSet = HOME_CLOSET_CORNERS_SET
|
|
263
|
+
elseif inBossRoomOf(nil, BossID.MOTHER) then
|
|
264
|
+
wallGridIndexSet = MOTHER_ROOM_CORNERS_SET
|
|
265
|
+
else
|
|
266
|
+
wallGridIndexSet = ROOM_SHAPE_TO_WALL_GRID_INDEX_SET:get(roomShape)
|
|
267
|
+
end
|
|
268
|
+
if wallGridIndexSet == nil then
|
|
269
|
+
error(((("Failed to find the wall grid index set for: RoomShape." .. tostring(RoomShape[roomShape])) .. " (") .. tostring(roomShape)) .. ")")
|
|
270
|
+
end
|
|
271
|
+
return wallGridIndexSet:has(gridIndex)
|
|
272
|
+
end
|
|
273
|
+
return ____exports
|
|
@@ -125,6 +125,13 @@ export declare function inDeathCertificateArea(): boolean;
|
|
|
125
125
|
export declare function inDevilsCrownTreasureRoom(): boolean;
|
|
126
126
|
export declare function inDoubleTrouble(): boolean;
|
|
127
127
|
export declare function inGenesisRoom(): boolean;
|
|
128
|
+
/**
|
|
129
|
+
* Helper function to check if the current room is either the left Home closet (behind the red door)
|
|
130
|
+
* or the right Home closet (with one random pickup).
|
|
131
|
+
*
|
|
132
|
+
* Home closets have a unique shape that is different from any other room in the game.
|
|
133
|
+
*/
|
|
134
|
+
export declare function inHomeCloset(): boolean;
|
|
128
135
|
/** Helper function to determine if the current room shape is one of the four L room shapes. */
|
|
129
136
|
export declare function inLRoom(): boolean;
|
|
130
137
|
/** Helper function to determine if the current room index is equal to `GridRoom.MEGA_SATAN`. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rooms.d.ts","sourceRoot":"","sources":["../../../src/functions/rooms.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,YAAY,EACZ,MAAM,EACN,SAAS,EAMT,YAAY,
|
|
1
|
+
{"version":3,"file":"rooms.d.ts","sourceRoot":"","sources":["../../../src/functions/rooms.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,YAAY,EACZ,MAAM,EACN,SAAS,EAMT,YAAY,EAEZ,UAAU,EAGV,QAAQ,EAGT,MAAM,8BAA8B,CAAC;AAkCtC;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,aAAa,EAAE,GAAG,GAAG,IAAI,CAenD;AAED;;;GAGG;AACH,wBAAgB,WAAW,IAAI,GAAG,CAGjC;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,gBAAgB,IAAI,KAAK,CAAC,QAAQ,CAAC,cAAc,CAAC,CAAC,CAiBlE;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,yBAAyB,CACvC,QAAQ,EAAE,QAAQ,EAClB,WAAW,EAAE,GAAG,EAChB,oBAAoB,UAAO,GAC1B,QAAQ,CAAC,UAAU,CAAC,GAAG,SAAS,CAUlC;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,IAAI,YAAY,CAOlD;AAED;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,QAAQ,EAAE,QAAQ,GAAG,MAAM,CAE1D;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,QAAQ,CACtB,4BAA4B,UAAQ,GACnC,cAAc,EAAE,CAOlB;AAED;;;;;;;;;GASG;AACH,wBAAgB,kBAAkB,CAChC,4BAA4B,UAAQ,GACnC,cAA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