isaacscript-common 1.0.458 → 1.0.459
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/rooms.d.ts +10 -3
- package/dist/functions/rooms.lua +6 -16
- package/package.json +2 -2
|
@@ -79,10 +79,18 @@ export declare function getRoomVisitedCount(): int;
|
|
|
79
79
|
* equal to `Vector(80, 160)`.
|
|
80
80
|
*/
|
|
81
81
|
export declare function gridToPos(x: int, y: int): Vector;
|
|
82
|
+
/**
|
|
83
|
+
* Helper function to see if the current room shape is equal to `RoomShape.ROOMSHAPE_1x2` or
|
|
84
|
+
* `RoomShape.ROOMSHAPE_2x1`.
|
|
85
|
+
*/
|
|
82
86
|
export declare function in2x1Room(): boolean;
|
|
83
87
|
export declare function inAngelShop(): boolean;
|
|
84
88
|
export declare function inBeastRoom(): boolean;
|
|
85
|
-
|
|
89
|
+
/**
|
|
90
|
+
* Helper function to check if the current room is a boss room for a particular boss. This will only
|
|
91
|
+
* work for bosses that have dedicated boss rooms in the "00.special rooms.stb" file.
|
|
92
|
+
*/
|
|
93
|
+
export declare function inBossRoomOf(bossID: BossID): boolean;
|
|
86
94
|
/**
|
|
87
95
|
* Helper function for determining whether the current room is a crawlspace. Use this function over
|
|
88
96
|
* comparing to `GridRooms.ROOM_DUNGEON_IDX` directly since there is a special case of the player
|
|
@@ -95,8 +103,7 @@ export declare function inCrawlspace(): boolean;
|
|
|
95
103
|
*/
|
|
96
104
|
export declare function inDeathCertificateArea(): boolean;
|
|
97
105
|
export declare function inDimension(dimension: Dimension): boolean;
|
|
106
|
+
/** Helper function to see if the current room shape is one of the four L room shapes. */
|
|
98
107
|
export declare function inLRoom(): boolean;
|
|
99
|
-
export declare function inLambRoom(): boolean;
|
|
100
108
|
export declare function inGenesisRoom(): boolean;
|
|
101
|
-
export declare function inItLivesRoom(): boolean;
|
|
102
109
|
export declare function inStartingRoom(): boolean;
|
package/dist/functions/rooms.lua
CHANGED
|
@@ -17,9 +17,6 @@ function ____exports.getRoomIndex(self)
|
|
|
17
17
|
local roomDesc = level:GetCurrentRoomDesc()
|
|
18
18
|
return roomDesc.SafeGridIndex
|
|
19
19
|
end
|
|
20
|
-
local IT_LIVES_ROOM_VARIANTS = {1090, 1091, 1092, 1093, 1094}
|
|
21
|
-
local BLUE_BABY_ROOM_VARIANTS = {3390, 3391, 3392, 3393}
|
|
22
|
-
local LAMB_ROOM_VARIANTS = {5130}
|
|
23
20
|
function ____exports.changeRoom(self, roomIndex)
|
|
24
21
|
local game = Game()
|
|
25
22
|
local level = game:GetLevel()
|
|
@@ -145,10 +142,13 @@ function ____exports.inBeastRoom(self)
|
|
|
145
142
|
local roomSubType = ____exports.getRoomSubType(nil)
|
|
146
143
|
return (roomIndex == GridRooms.ROOM_DUNGEON_IDX) and (roomSubType == 4)
|
|
147
144
|
end
|
|
148
|
-
function ____exports.
|
|
145
|
+
function ____exports.inBossRoomOf(self, bossID)
|
|
146
|
+
local game = Game()
|
|
147
|
+
local room = game:GetRoom()
|
|
148
|
+
local roomType = room:GetType()
|
|
149
149
|
local roomStageID = ____exports.getRoomStageID(nil)
|
|
150
|
-
local
|
|
151
|
-
return (roomStageID == 0) and
|
|
150
|
+
local roomSubType = ____exports.getRoomSubType(nil)
|
|
151
|
+
return ((roomType == RoomType.ROOM_BOSS) and (roomStageID == 0)) and (roomSubType == bossID)
|
|
152
152
|
end
|
|
153
153
|
function ____exports.inCrawlspace(self)
|
|
154
154
|
local roomIndex = ____exports.getRoomIndex(nil)
|
|
@@ -169,11 +169,6 @@ function ____exports.inLRoom(self)
|
|
|
169
169
|
local roomShape = room:GetRoomShape()
|
|
170
170
|
return (((roomShape == RoomShape.ROOMSHAPE_LTL) or (roomShape == RoomShape.ROOMSHAPE_LTR)) or (roomShape == RoomShape.ROOMSHAPE_LBL)) or (roomShape == RoomShape.ROOMSHAPE_LBR)
|
|
171
171
|
end
|
|
172
|
-
function ____exports.inLambRoom(self)
|
|
173
|
-
local roomStageID = ____exports.getRoomStageID(nil)
|
|
174
|
-
local roomVariant = ____exports.getRoomVariant(nil)
|
|
175
|
-
return (roomStageID == 0) and __TS__ArrayIncludes(LAMB_ROOM_VARIANTS, roomVariant)
|
|
176
|
-
end
|
|
177
172
|
function ____exports.inGenesisRoom(self)
|
|
178
173
|
local game = Game()
|
|
179
174
|
local room = game:GetRoom()
|
|
@@ -182,11 +177,6 @@ function ____exports.inGenesisRoom(self)
|
|
|
182
177
|
local roomSubType = ____exports.getRoomSubType(nil)
|
|
183
178
|
return ((roomType == RoomType.ROOM_ISAACS) and (roomVariant == GENESIS_ROOM_VARIANT)) and (roomSubType == GENESIS_ROOM_SUBTYPE)
|
|
184
179
|
end
|
|
185
|
-
function ____exports.inItLivesRoom(self)
|
|
186
|
-
local roomStageID = ____exports.getRoomStageID(nil)
|
|
187
|
-
local roomVariant = ____exports.getRoomVariant(nil)
|
|
188
|
-
return (roomStageID == 0) and __TS__ArrayIncludes(IT_LIVES_ROOM_VARIANTS, roomVariant)
|
|
189
|
-
end
|
|
190
180
|
function ____exports.inStartingRoom(self)
|
|
191
181
|
local game = Game()
|
|
192
182
|
local level = game:GetLevel()
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "isaacscript-common",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.459",
|
|
4
4
|
"description": "Helper functions for IsaacScript mods",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"isaac",
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"dist/**/*.d.ts"
|
|
26
26
|
],
|
|
27
27
|
"devDependencies": {
|
|
28
|
-
"isaac-typescript-definitions": "^1.0.
|
|
28
|
+
"isaac-typescript-definitions": "^1.0.278",
|
|
29
29
|
"isaacscript-lint": "^1.0.67",
|
|
30
30
|
"typedoc": "^0.22.9",
|
|
31
31
|
"typescript": "4.4.4",
|