isaacscript-common 9.7.0 → 9.8.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/functions/doors.d.ts +8 -0
- package/dist/functions/doors.d.ts.map +1 -1
- package/dist/functions/doors.lua +17 -3
- package/dist/index.d.ts +10 -0
- package/package.json +1 -1
- package/src/functions/doors.ts +15 -0
|
@@ -15,6 +15,13 @@ export declare function doorSlotToDoorSlotFlag(doorSlot: DoorSlot): DoorSlotFlag
|
|
|
15
15
|
*/
|
|
16
16
|
export declare function doorSlotsToDoorSlotFlags(doorSlots: DoorSlot[] | readonly DoorSlot[] | Set<DoorSlot> | ReadonlySet<DoorSlot>): BitFlags<DoorSlotFlag>;
|
|
17
17
|
export declare function getAngelRoomDoor(): GridEntityDoor | undefined;
|
|
18
|
+
/**
|
|
19
|
+
* Helper function to get the door that leads to the off-grid room that contains the hole to the
|
|
20
|
+
* Blue Womb.
|
|
21
|
+
*
|
|
22
|
+
* Returns undefined if the room has no Blue Womb doors.
|
|
23
|
+
*/
|
|
24
|
+
export declare function getBlueWombDoor(): GridEntityDoor | undefined;
|
|
18
25
|
export declare function getDevilRoomDoor(): GridEntityDoor | undefined;
|
|
19
26
|
/**
|
|
20
27
|
* If there is both a Devil Room and an Angel Room door, this function will return door with the
|
|
@@ -81,6 +88,7 @@ export declare function getRoomShapeDoorSlotCoordinates(roomShape: RoomShape, do
|
|
|
81
88
|
/** Helper function to find unused door slots in the room that can be used to make custom doors. */
|
|
82
89
|
export declare function getUnusedDoorSlots(): DoorSlot[];
|
|
83
90
|
export declare function isAngelRoomDoor(door: GridEntityDoor): boolean;
|
|
91
|
+
export declare function isBlueWombDoor(door: GridEntityDoor): boolean;
|
|
84
92
|
export declare function isDevilRoomDoor(door: GridEntityDoor): boolean;
|
|
85
93
|
/** Helper function to see if a door slot could exist for a given room shape. */
|
|
86
94
|
export declare function isDoorSlotInRoomShape(doorSlot: DoorSlot, roomShape: RoomShape):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GAGG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,cAAc,GAAG,OAAO,CAU/D;AAED,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,cAAc,GAAG,OAAO,CAKpE;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,cAAc,GAAG,OAAO,CAE9D;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,cAAc,GAAG,OAAO,CAM9D;AAED;;;;;;;GAOG;AACH,wBAAgB,QAAQ,CAAC,IAAI,EAAE,cAAc,GAAG,IAAI,CAUnD;AAED;;;GAGG;AACH,wBAAgB,YAAY,IAAI,IAAI,CAMnC;AAED;;;GAGG;AACH,wBAAgB,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"}
|
package/dist/functions/doors.lua
CHANGED
|
@@ -2,9 +2,9 @@ local ____lualib = require("lualib_bundle")
|
|
|
2
2
|
local Set = ____lualib.Set
|
|
3
3
|
local __TS__Spread = ____lualib.__TS__Spread
|
|
4
4
|
local __TS__ArrayMap = ____lualib.__TS__ArrayMap
|
|
5
|
+
local __TS__ArrayFind = ____lualib.__TS__ArrayFind
|
|
5
6
|
local __TS__New = ____lualib.__TS__New
|
|
6
7
|
local __TS__ArrayFilter = ____lualib.__TS__ArrayFilter
|
|
7
|
-
local __TS__ArrayFind = ____lualib.__TS__ArrayFind
|
|
8
8
|
local __TS__Iterator = ____lualib.__TS__Iterator
|
|
9
9
|
local ____exports = {}
|
|
10
10
|
local ____isaac_2Dtypescript_2Ddefinitions = require("isaac-typescript-definitions")
|
|
@@ -70,16 +70,19 @@ function ____exports.getDoors(self, ...)
|
|
|
70
70
|
do
|
|
71
71
|
local door = room:GetDoor(doorSlot)
|
|
72
72
|
if door == nil then
|
|
73
|
-
goto
|
|
73
|
+
goto __continue25
|
|
74
74
|
end
|
|
75
75
|
if roomTypesSet.size == 0 or roomTypesSet:has(door.TargetRoomType) then
|
|
76
76
|
doors[#doors + 1] = door
|
|
77
77
|
end
|
|
78
78
|
end
|
|
79
|
-
::
|
|
79
|
+
::__continue25::
|
|
80
80
|
end
|
|
81
81
|
return doors
|
|
82
82
|
end
|
|
83
|
+
function ____exports.isBlueWombDoor(self, door)
|
|
84
|
+
return door.TargetRoomIndex == asNumber(nil, GridRoom.BLUE_WOMB)
|
|
85
|
+
end
|
|
83
86
|
--- Helper function to check if the provided door leads to the "secret exit" off-grid room that takes
|
|
84
87
|
-- you to the Repentance floor.
|
|
85
88
|
function ____exports.isRepentanceDoor(self, door)
|
|
@@ -156,6 +159,17 @@ function ____exports.getAngelRoomDoor(self)
|
|
|
156
159
|
end
|
|
157
160
|
return ____temp_0
|
|
158
161
|
end
|
|
162
|
+
--- Helper function to get the door that leads to the off-grid room that contains the hole to the
|
|
163
|
+
-- Blue Womb.
|
|
164
|
+
--
|
|
165
|
+
-- Returns undefined if the room has no Blue Womb doors.
|
|
166
|
+
function ____exports.getBlueWombDoor(self)
|
|
167
|
+
local doors = ____exports.getDoors(nil)
|
|
168
|
+
return __TS__ArrayFind(
|
|
169
|
+
doors,
|
|
170
|
+
function(____, door) return ____exports.isBlueWombDoor(nil, door) end
|
|
171
|
+
)
|
|
172
|
+
end
|
|
159
173
|
function ____exports.getDevilRoomDoor(self)
|
|
160
174
|
local devilRoomDoors = ____exports.getDoors(nil, RoomType.DEVIL)
|
|
161
175
|
local ____temp_1
|
package/dist/index.d.ts
CHANGED
|
@@ -2402,6 +2402,14 @@ export declare function getAzazelBrimstoneDistance(playerOrTearHeight: EntityPla
|
|
|
2402
2402
|
*/
|
|
2403
2403
|
export declare function getBatteries(batterySubType?: BatterySubType): EntityPickupBattery[];
|
|
2404
2404
|
|
|
2405
|
+
/**
|
|
2406
|
+
* Helper function to get the door that leads to the off-grid room that contains the hole to the
|
|
2407
|
+
* Blue Womb.
|
|
2408
|
+
*
|
|
2409
|
+
* Returns undefined if the room has no Blue Womb doors.
|
|
2410
|
+
*/
|
|
2411
|
+
export declare function getBlueWombDoor(): GridEntityDoor | undefined;
|
|
2412
|
+
|
|
2405
2413
|
/**
|
|
2406
2414
|
* Helper function to get all of the bomb entities in the room. (Specifically, this refers to bomb
|
|
2407
2415
|
* pickups, not the `EntityBomb` class.)
|
|
@@ -5591,6 +5599,8 @@ export declare function isBitSet128(object: unknown): object is BitSet128;
|
|
|
5591
5599
|
/** Returns true if the collectible has a red question mark sprite. */
|
|
5592
5600
|
export declare function isBlindCollectible(collectible: EntityPickup): boolean;
|
|
5593
5601
|
|
|
5602
|
+
export declare function isBlueWombDoor(door: GridEntityDoor): boolean;
|
|
5603
|
+
|
|
5594
5604
|
/** Helper function to detect if a variable is of type `EntityBomb`. */
|
|
5595
5605
|
export declare function isBomb(variable: unknown): variable is EntityBomb;
|
|
5596
5606
|
|
package/package.json
CHANGED
package/src/functions/doors.ts
CHANGED
|
@@ -97,6 +97,17 @@ export function getAngelRoomDoor(): GridEntityDoor | undefined {
|
|
|
97
97
|
return angelRoomDoors.length === 0 ? undefined : angelRoomDoors[0];
|
|
98
98
|
}
|
|
99
99
|
|
|
100
|
+
/**
|
|
101
|
+
* Helper function to get the door that leads to the off-grid room that contains the hole to the
|
|
102
|
+
* Blue Womb.
|
|
103
|
+
*
|
|
104
|
+
* Returns undefined if the room has no Blue Womb doors.
|
|
105
|
+
*/
|
|
106
|
+
export function getBlueWombDoor(): GridEntityDoor | undefined {
|
|
107
|
+
const doors = getDoors();
|
|
108
|
+
return doors.find((door) => isBlueWombDoor(door));
|
|
109
|
+
}
|
|
110
|
+
|
|
100
111
|
export function getDevilRoomDoor(): GridEntityDoor | undefined {
|
|
101
112
|
const devilRoomDoors = getDoors(RoomType.DEVIL);
|
|
102
113
|
return devilRoomDoors.length === 0 ? undefined : devilRoomDoors[0];
|
|
@@ -262,6 +273,10 @@ export function isAngelRoomDoor(door: GridEntityDoor): boolean {
|
|
|
262
273
|
return door.TargetRoomType === RoomType.ANGEL;
|
|
263
274
|
}
|
|
264
275
|
|
|
276
|
+
export function isBlueWombDoor(door: GridEntityDoor): boolean {
|
|
277
|
+
return door.TargetRoomIndex === asNumber(GridRoom.BLUE_WOMB);
|
|
278
|
+
}
|
|
279
|
+
|
|
265
280
|
export function isDevilRoomDoor(door: GridEntityDoor): boolean {
|
|
266
281
|
return door.TargetRoomType === RoomType.DEVIL;
|
|
267
282
|
}
|