isaacscript-common 27.6.3 → 27.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.
@@ -1315,6 +1315,10 @@ export declare function clearFloorDisplayFlags(): void;
1315
1315
  *
1316
1316
  * This function automatically calls the `Level.UpdateVisibility` after setting the flags so that
1317
1317
  * the changes will be immediately visible.
1318
+ *
1319
+ * Note that if you clear the display flags of a room but then the player travels to the room (or an
1320
+ * adjacent room), the room will appear on the minimap again. If you want to permanently hide the
1321
+ * room even in this circumstance, use the `hideRoomOnMinimap` helper function instead.
1318
1322
  */
1319
1323
  export declare function clearRoomDisplayFlags(roomGridIndex: int): void;
1320
1324
 
@@ -7097,6 +7101,17 @@ export declare function hexToColor(hexString: string, alpha?: number): Readonly<
7097
7101
  */
7098
7102
  export declare function hexToKColor(hexString: string, alpha?: number): Readonly<KColor>;
7099
7103
 
7104
+ /**
7105
+ * Helper function to hide a specific room on the minimap.
7106
+ *
7107
+ * If you want the room to be permanently hidden, you must to call this function on every new room.
7108
+ * This is because if the player enters into the room or walks into an adjacent room, the room will
7109
+ * reappear on the minimap.
7110
+ *
7111
+ * This function automatically accounts for whether or not MinimapAPI is being used.
7112
+ */
7113
+ export declare function hideRoomOnMinimap(roomGridIndex: int): void;
7114
+
7100
7115
  /**
7101
7116
  * Helper type to make the given array/map/set/object recursively read-only.
7102
7117
  *
@@ -8152,9 +8167,18 @@ export declare function isSack(pickup: EntityPickup): pickup is EntityPickupSack
8152
8167
  * This refers to the hole in the wall that appears after bombing the entrance to a secret room.
8153
8168
  * Note that the door still exists before it has been bombed open. It has a sprite filename of
8154
8169
  * "gfx/grid/door_08_holeinwall.anm2".
8170
+ *
8171
+ * Note that since Ultra Secret Rooms do not use holes, this function will not detect an Ultra
8172
+ * Secret Room door.
8155
8173
  */
8156
8174
  export declare function isSecretRoomDoor(door: GridEntityDoor): boolean;
8157
8175
 
8176
+ /**
8177
+ * Helper function to detect if a room type is a Secret Room, a Super Secret Room, or an Ultra
8178
+ * Secret Room.
8179
+ */
8180
+ export declare function isSecretRoomType(roomType: RoomType): boolean;
8181
+
8158
8182
  /**
8159
8183
  * Helper function to determine whether damage to a player in the `ENTITY_TAKE_DMG` callback was
8160
8184
  * self-inflicted. For example, damage from a Curse Room door, a Razor, or a Blood Donation Machine
@@ -1,6 +1,6 @@
1
1
  --[[
2
2
 
3
- isaacscript-common 27.6.3
3
+ isaacscript-common 27.8.0
4
4
 
5
5
  This is the "isaacscript-common" library, which was created with the IsaacScript tool.
6
6
 
@@ -26614,11 +26614,11 @@ return ____exports
26614
26614
  end,
26615
26615
  ["src.functions.rooms"] = function(...)
26616
26616
  local ____lualib = require("lualib_bundle")
26617
+ local __TS__New = ____lualib.__TS__New
26617
26618
  local __TS__SparseArrayNew = ____lualib.__TS__SparseArrayNew
26618
26619
  local __TS__SparseArrayPush = ____lualib.__TS__SparseArrayPush
26619
26620
  local __TS__SparseArraySpread = ____lualib.__TS__SparseArraySpread
26620
26621
  local Map = ____lualib.Map
26621
- local __TS__New = ____lualib.__TS__New
26622
26622
  local __TS__Spread = ____lualib.__TS__Spread
26623
26623
  local __TS__ArrayFilter = ____lualib.__TS__ArrayFilter
26624
26624
  local __TS__ArrayMap = ____lualib.__TS__ArrayMap
@@ -26729,6 +26729,7 @@ function ____exports.getRoomsOutsideGrid(self)
26729
26729
  function(____, readOnlyRoomDescriptor) return getRoomDescriptor(nil, readOnlyRoomDescriptor.SafeGridIndex) end
26730
26730
  )
26731
26731
  end
26732
+ local SECRET_ROOM_TYPES = __TS__New(ReadonlySet, {RoomType.SECRET, RoomType.SUPER_SECRET, RoomType.ULTRA_SECRET})
26732
26733
  function ____exports.changeRoom(self, roomGridIndex)
26733
26734
  local level = game:GetLevel()
26734
26735
  local roomData = getRoomData(nil, roomGridIndex)
@@ -26915,6 +26916,9 @@ function ____exports.isAllRoomsClear(self, onlyCheckRoomTypes)
26915
26916
  function(____, roomDescriptor) return roomDescriptor.Clear end
26916
26917
  )
26917
26918
  end
26919
+ function ____exports.isSecretRoomType(self, roomType)
26920
+ return SECRET_ROOM_TYPES:has(roomType)
26921
+ end
26918
26922
  function ____exports.roomUpdateSafe(self)
26919
26923
  local room = game:GetRoom()
26920
26924
  local entities = getEntities(nil)
@@ -26938,12 +26942,12 @@ function ____exports.setRoomCleared(self)
26938
26942
  for ____, door in ipairs(getDoors(nil)) do
26939
26943
  do
26940
26944
  if isHiddenSecretRoomDoor(nil, door) then
26941
- goto __continue55
26945
+ goto __continue56
26942
26946
  end
26943
26947
  openDoorFast(nil, door)
26944
26948
  door.ExtraVisible = false
26945
26949
  end
26946
- ::__continue55::
26950
+ ::__continue56::
26947
26951
  end
26948
26952
  sfxManager:Stop(SoundEffect.DOOR_HEAVY_OPEN)
26949
26953
  game:ShakeScreen(0)
@@ -45862,6 +45866,7 @@ local getRoomShape = ____roomData.getRoomShape
45862
45866
  local ____rooms = require("src.functions.rooms")
45863
45867
  local getRooms = ____rooms.getRooms
45864
45868
  local getRoomsInsideGrid = ____rooms.getRoomsInsideGrid
45869
+ local isSecretRoomType = ____rooms.isSecretRoomType
45865
45870
  local ____roomShape = require("src.functions.roomShape")
45866
45871
  local getGridIndexDelta = ____roomShape.getGridIndexDelta
45867
45872
  local ____types = require("src.functions.types")
@@ -46091,7 +46096,7 @@ function ____exports.newRoom(self, seedOrRNG)
46091
46096
  local hasCompass = level:GetStateFlag(LevelStateFlag.COMPASS_EFFECT)
46092
46097
  local hasBlueMap = level:GetStateFlag(LevelStateFlag.BLUE_MAP_EFFECT)
46093
46098
  local roomType = roomData.Type
46094
- local isSecretRoom = roomType == RoomType.SECRET or roomType == RoomType.SUPER_SECRET
46099
+ local isSecretRoom = isSecretRoomType(nil, roomType)
46095
46100
  if hasFullMap then
46096
46101
  roomDescriptor.DisplayFlags = ALL_DISPLAY_FLAGS
46097
46102
  elseif not isSecretRoom and hasCompass then
@@ -51921,13 +51926,9 @@ function ____exports.setRoomDisplayFlags(self, roomGridIndex, displayFlags, upda
51921
51926
  else
51922
51927
  local minimapAPIRoomDescriptor = MinimapAPI:GetRoomByIdx(roomGridIndex)
51923
51928
  if minimapAPIRoomDescriptor == nil then
51924
- if displayFlags == DisplayFlagZero then
51925
- return
51926
- end
51927
51929
  error("Failed to get the MinimapAPI room descriptor for the room at grid index: " .. tostring(roomGridIndex))
51928
51930
  end
51929
51931
  minimapAPIRoomDescriptor:SetDisplayFlags(displayFlags)
51930
- minimapAPIRoomDescriptor.Hidden = displayFlags == DisplayFlagZero
51931
51932
  end
51932
51933
  end
51933
51934
  function ____exports.addRoomDisplayFlag(self, roomGridIndex, displayFlag, updateVisibility)
@@ -51953,6 +51954,16 @@ function ____exports.getFloorDisplayFlags(self)
51953
51954
  end
51954
51955
  return displayFlagsMap
51955
51956
  end
51957
+ function ____exports.hideRoomOnMinimap(self, roomGridIndex)
51958
+ ____exports.clearRoomDisplayFlags(nil, roomGridIndex)
51959
+ if MinimapAPI ~= nil then
51960
+ local minimapAPIRoomDescriptor = MinimapAPI:GetRoomByIdx(roomGridIndex)
51961
+ if minimapAPIRoomDescriptor == nil then
51962
+ error("Failed to get the MinimapAPI room descriptor for the room at grid index: " .. tostring(roomGridIndex))
51963
+ end
51964
+ minimapAPIRoomDescriptor.Hidden = true
51965
+ end
51966
+ end
51956
51967
  function ____exports.setFloorDisplayFlags(self, displayFlagsMap)
51957
51968
  for ____, ____value in __TS__Iterator(displayFlagsMap) do
51958
51969
  local roomGridIndex = ____value[1]
@@ -135,6 +135,9 @@ export declare function isRepentanceDoor(door: GridEntityDoor): boolean;
135
135
  * This refers to the hole in the wall that appears after bombing the entrance to a secret room.
136
136
  * Note that the door still exists before it has been bombed open. It has a sprite filename of
137
137
  * "gfx/grid/door_08_holeinwall.anm2".
138
+ *
139
+ * Note that since Ultra Secret Rooms do not use holes, this function will not detect an Ultra
140
+ * Secret Room door.
138
141
  */
139
142
  export declare function isSecretRoomDoor(door: GridEntityDoor): boolean;
140
143
  /**
@@ -1 +1 @@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,IAAI,EAAE,cAAc,GAAG,OAAO,CAU/D;AAED;;;GAGG;AACH,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,cAAc,GAAG,OAAO,CAUrE;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,cAAc,GAAG,OAAO,CAU3D;AAED;;;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;;;;;;;GAOG;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"}
@@ -104,6 +104,9 @@ end
104
104
  --- This refers to the hole in the wall that appears after bombing the entrance to a secret room.
105
105
  -- Note that the door still exists before it has been bombed open. It has a sprite filename of
106
106
  -- "gfx/grid/door_08_holeinwall.anm2".
107
+ --
108
+ -- Note that since Ultra Secret Rooms do not use holes, this function will not detect an Ultra
109
+ -- Secret Room door.
107
110
  function ____exports.isSecretRoomDoor(self, door)
108
111
  local sprite = door:GetSprite()
109
112
  local fileName = sprite:GetFilename()
@@ -1 +1 @@
1
- {"version":3,"file":"levelGrid.d.ts","sourceRoot":"","sources":["../../../src/functions/levelGrid.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAEL,QAAQ,EAKR,SAAS,EACT,QAAQ,EACT,MAAM,8BAA8B,CAAC;AA+BtC;;;;;GAKG;AACH,wBAAgB,kCAAkC,CAAC,aAAa,CAAC,EAAE,GAAG,GAAG,GAAG,EAAE,CAK7E;AAED;;;;;;GAMG;AACH,wBAAgB,qCAAqC,CACnD,aAAa,CAAC,EAAE,GAAG,GAClB,GAAG,EAAE,CAKP;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,0BAA0B,CAAC,aAAa,CAAC,EAAE,GAAG,GAAG,GAAG,EAAE,CAerE;AAED,0FAA0F;AAC1F,wBAAgB,qBAAqB,IAAI,GAAG,EAAE,CAG7C;AAED;;;;;;;;;GASG;AACH,wBAAgB,mBAAmB,CACjC,SAAS,GAAE,IAAI,GAAG,GAAqB,GAErC,CAAC,qBAAqB,EAAE,GAAG,EAAE,QAAQ,EAAE,QAAQ,EAAE,gBAAgB,EAAE,GAAG,CAAC,GACvE,SAAS,CAOZ;AAED;;;;;;;GAOG;AACH,wBAAgB,8BAA8B,CAC5C,aAAa,CAAC,EAAE,GAAG,GAClB,KAAK,CAAC,CAAC,QAAQ,EAAE,QAAQ,EAAE,aAAa,EAAE,GAAG,CAAC,CAAC,CA2CjD;AAED;;;;;;GAMG;AACH,wBAAgB,4BAA4B,IAAI,KAAK,CACnD;IAAC,qBAAqB,EAAE,GAAG;IAAE,QAAQ,EAAE,QAAQ;IAAE,gBAAgB,EAAE,GAAG;CAAC,CACxE,CA2BA;AAED;;;;;;;;;GASG;AACH,wBAAgB,0BAA0B,CACxC,aAAa,CAAC,EAAE,GAAG,GAClB,WAAW,CAAC,QAAQ,EAAE,GAAG,CAAC,CAgB5B;AAED;;;;;;;;GAQG;AACH,wBAAgB,y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,aAAa,CAAC,EAAE,GAAG,GAAG,OAAO,CAGzD;AAED;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,aAAa,CAAC,EAAE,GAAG,GAAG,OAAO,CAM7D;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,OAAO,CAAC,SAAS,CAAC,EAAE,IAAI,GAAG,GAAG,GAAG,GAAG,GAAG,SAAS,CAkD/D;AAED;;;GAGG;AACH,wBAAgB,UAAU,CAAC,aAAa,EAAE,GAAG,GAAG,OAAO,CAGtD;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,iBAAiB,CAAC,aAAa,EAAE,GAAG,GAAG,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,CAAC,CAKtE"}
@@ -45,6 +45,7 @@ local getRoomShape = ____roomData.getRoomShape
45
45
  local ____rooms = require("src.functions.rooms")
46
46
  local getRooms = ____rooms.getRooms
47
47
  local getRoomsInsideGrid = ____rooms.getRoomsInsideGrid
48
+ local isSecretRoomType = ____rooms.isSecretRoomType
48
49
  local ____roomShape = require("src.functions.roomShape")
49
50
  local getGridIndexDelta = ____roomShape.getGridIndexDelta
50
51
  local ____types = require("src.functions.types")
@@ -394,7 +395,7 @@ function ____exports.newRoom(self, seedOrRNG)
394
395
  local hasCompass = level:GetStateFlag(LevelStateFlag.COMPASS_EFFECT)
395
396
  local hasBlueMap = level:GetStateFlag(LevelStateFlag.BLUE_MAP_EFFECT)
396
397
  local roomType = roomData.Type
397
- local isSecretRoom = roomType == RoomType.SECRET or roomType == RoomType.SUPER_SECRET
398
+ local isSecretRoom = isSecretRoomType(nil, roomType)
398
399
  if hasFullMap then
399
400
  roomDescriptor.DisplayFlags = ALL_DISPLAY_FLAGS
400
401
  elseif not isSecretRoom and hasCompass then
@@ -27,6 +27,10 @@ export declare function clearFloorDisplayFlags(): void;
27
27
  *
28
28
  * This function automatically calls the `Level.UpdateVisibility` after setting the flags so that
29
29
  * the changes will be immediately visible.
30
+ *
31
+ * Note that if you clear the display flags of a room but then the player travels to the room (or an
32
+ * adjacent room), the room will appear on the minimap again. If you want to permanently hide the
33
+ * room even in this circumstance, use the `hideRoomOnMinimap` helper function instead.
30
34
  */
31
35
  export declare function clearRoomDisplayFlags(roomGridIndex: int): void;
32
36
  /**
@@ -45,6 +49,16 @@ export declare function getFloorDisplayFlags(): Map<int, BitFlags<DisplayFlag>>;
45
49
  * @param roomGridIndex Optional. Default is the current room index.
46
50
  */
47
51
  export declare function getRoomDisplayFlags(roomGridIndex?: int): BitFlags<DisplayFlag>;
52
+ /**
53
+ * Helper function to hide a specific room on the minimap.
54
+ *
55
+ * If you want the room to be permanently hidden, you must to call this function on every new room.
56
+ * This is because if the player enters into the room or walks into an adjacent room, the room will
57
+ * reappear on the minimap.
58
+ *
59
+ * This function automatically accounts for whether or not MinimapAPI is being used.
60
+ */
61
+ export declare function hideRoomOnMinimap(roomGridIndex: int): void;
48
62
  /**
49
63
  * Helper function to set the minimap `DisplayFlag` value for every room on the floor at once.
50
64
  *
@@ -1 +1 @@
1
- {"version":3,"file":"minimap.d.ts","sourceRoot":"","sources":["../../../src/functions/minimap.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAmB,MAAM,8BAA8B,CAAC;AAM5E;;;;;;;;;;GAUG;AACH,wBAAgB,kBAAkB,CAChC,aAAa,EAAE,GAAG,GAAG,SAAS,EAC9B,WAAW,EAAE,WAAW,EACxB,gBAAgB,UAAO,GACtB,IAAI,CAIN;AAED;;;;;;;GAOG;AACH,wBAAgB,sBAAsB,IAAI,IAAI,CAE7C;AAED;;;;;;;GAOG;AACH,wBAAgB,qBAAqB,CAAC,aAAa,EAAE,GAAG,GAAG,IAAI,CAE9D;AAED;;;;;GAKG;AACH,wBAAgB,oBAAoB,IAAI,GAAG,CAAC,GAAG,EAAE,QAAQ,CAAC,WAAW,CAAC,CAAC,CAUtE;AAED;;;;;;;GAOG;AACH,wBAAgB,mBAAmB,CACjC,aAAa,CAAC,EAAE,GAAG,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C,WAAW,CAAC,GAAG,IAAI,CAW5E;AAED;;;;;;;;;GASG;AACH,wBAAgB,oBAAoB,CAClC,eAAe,EAAE,GAAG,CAAC,GAAG,EAAE,QAAQ,CAAC,WAAW,CAAC,CAAC,GAC/C,IAAI,CAWN;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,mBAAmB,CACjC,aAAa,EAAE,GAAG,GAAG,SAAS,EAC9B,YAAY,EAAE,QAAQ,CAAC,WAAW,CAAC,EACnC,gBAAgB,UAAO,GACtB,IAAI,CAsBN"}
@@ -77,13 +77,9 @@ function ____exports.setRoomDisplayFlags(self, roomGridIndex, displayFlags, upda
77
77
  else
78
78
  local minimapAPIRoomDescriptor = MinimapAPI:GetRoomByIdx(roomGridIndex)
79
79
  if minimapAPIRoomDescriptor == nil then
80
- if displayFlags == DisplayFlagZero then
81
- return
82
- end
83
80
  error("Failed to get the MinimapAPI room descriptor for the room at grid index: " .. tostring(roomGridIndex))
84
81
  end
85
82
  minimapAPIRoomDescriptor:SetDisplayFlags(displayFlags)
86
- minimapAPIRoomDescriptor.Hidden = displayFlags == DisplayFlagZero
87
83
  end
88
84
  end
89
85
  --- Helper function to add a `DisplayFlag` to a particular room's minimap display flags (e.g. whether
@@ -118,6 +114,10 @@ end
118
114
  --
119
115
  -- This function automatically calls the `Level.UpdateVisibility` after setting the flags so that
120
116
  -- the changes will be immediately visible.
117
+ --
118
+ -- Note that if you clear the display flags of a room but then the player travels to the room (or an
119
+ -- adjacent room), the room will appear on the minimap again. If you want to permanently hide the
120
+ -- room even in this circumstance, use the `hideRoomOnMinimap` helper function instead.
121
121
  function ____exports.clearRoomDisplayFlags(self, roomGridIndex)
122
122
  ____exports.setRoomDisplayFlags(nil, roomGridIndex, DisplayFlagZero)
123
123
  end
@@ -134,6 +134,23 @@ function ____exports.getFloorDisplayFlags(self)
134
134
  end
135
135
  return displayFlagsMap
136
136
  end
137
+ --- Helper function to hide a specific room on the minimap.
138
+ --
139
+ -- If you want the room to be permanently hidden, you must to call this function on every new room.
140
+ -- This is because if the player enters into the room or walks into an adjacent room, the room will
141
+ -- reappear on the minimap.
142
+ --
143
+ -- This function automatically accounts for whether or not MinimapAPI is being used.
144
+ function ____exports.hideRoomOnMinimap(self, roomGridIndex)
145
+ ____exports.clearRoomDisplayFlags(nil, roomGridIndex)
146
+ if MinimapAPI ~= nil then
147
+ local minimapAPIRoomDescriptor = MinimapAPI:GetRoomByIdx(roomGridIndex)
148
+ if minimapAPIRoomDescriptor == nil then
149
+ error("Failed to get the MinimapAPI room descriptor for the room at grid index: " .. tostring(roomGridIndex))
150
+ end
151
+ minimapAPIRoomDescriptor.Hidden = true
152
+ end
153
+ end
137
154
  --- Helper function to set the minimap `DisplayFlag` value for multiple rooms at once.
138
155
  --
139
156
  -- This function automatically calls the `Level.UpdateVisibility` after setting the flags so that
@@ -190,6 +190,11 @@ export declare function inStartingRoom(): boolean;
190
190
  * checked. Undefined by default.
191
191
  */
192
192
  export declare function isAllRoomsClear(onlyCheckRoomTypes?: RoomType[]): boolean;
193
+ /**
194
+ * Helper function to detect if a room type is a Secret Room, a Super Secret Room, or an Ultra
195
+ * Secret Room.
196
+ */
197
+ export declare function isSecretRoomType(roomType: RoomType): boolean;
193
198
  /**
194
199
  * If the `Room.Update` method is called in a `POST_NEW_ROOM` callback, then some entities will
195
200
  * slide around (such as the player). Since those entity velocities are already at zero, setting
@@ -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,EAEZ,UAAU,EAGV,QAAQ,EAGT,MAAM,8BAA8B,CAAC;AAmCtC;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,aAAa,EAAE,GAAG,GAAG,IAAI,CAenD;AAED;;;GAGG;AACH,wBAAgB,WAAW,IAAI,GAAG,CAGjC;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,gBAAgB,I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AAgB,OAAO,IAAI,OAAO,CAUjC;AAED,gGAAgG;AAChG,wBAAgB,eAAe,IAAI,OAAO,CAIzC;AAED;;;GAGG;AACH,wBAAgB,WAAW,IAAI,OAAO,CASrC;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,UAAU,EAAE,UAAU,GAAG,OAAO,CAWhE;AAED;;;GAGG;AACH,wBAAgB,YAAY,IAAI,OAAO,CAWtC;AAED;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,GAAG,SAAS,EAAE,QAAQ,EAAE,GAAG,OAAO,CAI5D;AAED;;;GAGG;AACH,wBAAgB,YAAY,IAAI,OAAO,CAItC;AAED;;;;;;;GAOG;AACH,wBAAgB,YAAY,IAAI,OAAO,CAItC;AAED;;;;GAIG;AACH,wBAAgB,cAAc,IAAI,OAAO,CAMxC;AAED;;;;;;;;GAQG;AACH,wBAAgB,eAAe,CAAC,kBAAkB,CAAC,EAAE,QAAQ,EAAE,GAAG,OAAO,CAgBxE;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,QAAQ,GAAG,OAAO,CAE5D;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,IAAI,IAAI,CAWrC;AAED,iFAAiF;AACjF,wBAAgB,WAAW,CAAC,YAAY,EAAE,YAAY,GAAG,IAAI,CAG5D;AAED;;;;GAIG;AACH,wBAAgB,cAAc,IAAI,IAAI,CA8BrC;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,IAAI,IAAI,CAKvC"}
@@ -1,9 +1,9 @@
1
1
  local ____lualib = require("lualib_bundle")
2
+ local __TS__New = ____lualib.__TS__New
2
3
  local __TS__SparseArrayNew = ____lualib.__TS__SparseArrayNew
3
4
  local __TS__SparseArrayPush = ____lualib.__TS__SparseArrayPush
4
5
  local __TS__SparseArraySpread = ____lualib.__TS__SparseArraySpread
5
6
  local Map = ____lualib.Map
6
- local __TS__New = ____lualib.__TS__New
7
7
  local __TS__Spread = ____lualib.__TS__Spread
8
8
  local __TS__ArrayFilter = ____lualib.__TS__ArrayFilter
9
9
  local __TS__ArrayMap = ____lualib.__TS__ArrayMap
@@ -136,6 +136,7 @@ function ____exports.getRoomsOutsideGrid(self)
136
136
  function(____, readOnlyRoomDescriptor) return getRoomDescriptor(nil, readOnlyRoomDescriptor.SafeGridIndex) end
137
137
  )
138
138
  end
139
+ local SECRET_ROOM_TYPES = __TS__New(ReadonlySet, {RoomType.SECRET, RoomType.SUPER_SECRET, RoomType.ULTRA_SECRET})
139
140
  --- Helper function for quickly switching to a new room without playing a particular animation. Use
140
141
  -- this helper function over invoking the `Game.ChangeRoom` method directly to ensure that you do
141
142
  -- not forget to set the `LeaveDoor` field and to prevent crashing on invalid room grid indexes.
@@ -415,6 +416,11 @@ function ____exports.isAllRoomsClear(self, onlyCheckRoomTypes)
415
416
  function(____, roomDescriptor) return roomDescriptor.Clear end
416
417
  )
417
418
  end
419
+ --- Helper function to detect if a room type is a Secret Room, a Super Secret Room, or an Ultra
420
+ -- Secret Room.
421
+ function ____exports.isSecretRoomType(self, roomType)
422
+ return SECRET_ROOM_TYPES:has(roomType)
423
+ end
418
424
  --- If the `Room.Update` method is called in a `POST_NEW_ROOM` callback, then some entities will
419
425
  -- slide around (such as the player). Since those entity velocities are already at zero, setting
420
426
  -- them to zero will have no effect. Thus, a generic solution is to record all of the entity
@@ -446,12 +452,12 @@ function ____exports.setRoomCleared(self)
446
452
  for ____, door in ipairs(getDoors(nil)) do
447
453
  do
448
454
  if isHiddenSecretRoomDoor(nil, door) then
449
- goto __continue55
455
+ goto __continue56
450
456
  end
451
457
  openDoorFast(nil, door)
452
458
  door.ExtraVisible = false
453
459
  end
454
- ::__continue55::
460
+ ::__continue56::
455
461
  end
456
462
  sfxManager:Stop(SoundEffect.DOOR_HEAVY_OPEN)
457
463
  game:ShakeScreen(0)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "isaacscript-common",
3
- "version": "27.6.3",
3
+ "version": "27.8.0",
4
4
  "description": "Helper functions and features for IsaacScript mods.",
5
5
  "keywords": [
6
6
  "isaac",
@@ -430,6 +430,9 @@ export function isRepentanceDoor(door: GridEntityDoor): boolean {
430
430
  * This refers to the hole in the wall that appears after bombing the entrance to a secret room.
431
431
  * Note that the door still exists before it has been bombed open. It has a sprite filename of
432
432
  * "gfx/grid/door_08_holeinwall.anm2".
433
+ *
434
+ * Note that since Ultra Secret Rooms do not use holes, this function will not detect an Ultra
435
+ * Secret Room door.
433
436
  */
434
437
  export function isSecretRoomDoor(door: GridEntityDoor): boolean {
435
438
  const sprite = door.GetSprite();
@@ -36,7 +36,7 @@ import {
36
36
  getRoomGridIndex,
37
37
  getRoomShape,
38
38
  } from "./roomData";
39
- import { getRooms, getRoomsInsideGrid } from "./rooms";
39
+ import { getRooms, getRoomsInsideGrid, isSecretRoomType } from "./rooms";
40
40
  import { getGridIndexDelta } from "./roomShape";
41
41
  import { asNumber } from "./types";
42
42
 
@@ -512,8 +512,7 @@ export function newRoom(seedOrRNG?: Seed | RNG): int | undefined {
512
512
  const hasCompass = level.GetStateFlag(LevelStateFlag.COMPASS_EFFECT);
513
513
  const hasBlueMap = level.GetStateFlag(LevelStateFlag.BLUE_MAP_EFFECT);
514
514
  const roomType = roomData.Type;
515
- const isSecretRoom =
516
- roomType === RoomType.SECRET || roomType === RoomType.SUPER_SECRET;
515
+ const isSecretRoom = isSecretRoomType(roomType);
517
516
 
518
517
  if (hasFullMap) {
519
518
  roomDescriptor.DisplayFlags = ALL_DISPLAY_FLAGS;
@@ -44,6 +44,10 @@ export function clearFloorDisplayFlags(): void {
44
44
  *
45
45
  * This function automatically calls the `Level.UpdateVisibility` after setting the flags so that
46
46
  * the changes will be immediately visible.
47
+ *
48
+ * Note that if you clear the display flags of a room but then the player travels to the room (or an
49
+ * adjacent room), the room will appear on the minimap again. If you want to permanently hide the
50
+ * room even in this circumstance, use the `hideRoomOnMinimap` helper function instead.
47
51
  */
48
52
  export function clearRoomDisplayFlags(roomGridIndex: int): void {
49
53
  setRoomDisplayFlags(roomGridIndex, DisplayFlagZero);
@@ -96,6 +100,32 @@ export function getRoomDisplayFlags(
96
100
  return minimapAPIRoomDescriptor.GetDisplayFlags();
97
101
  }
98
102
 
103
+ /**
104
+ * Helper function to hide a specific room on the minimap.
105
+ *
106
+ * If you want the room to be permanently hidden, you must to call this function on every new room.
107
+ * This is because if the player enters into the room or walks into an adjacent room, the room will
108
+ * reappear on the minimap.
109
+ *
110
+ * This function automatically accounts for whether or not MinimapAPI is being used.
111
+ */
112
+ export function hideRoomOnMinimap(roomGridIndex: int): void {
113
+ clearRoomDisplayFlags(roomGridIndex);
114
+
115
+ // In vanilla, the map only updates at the beginning of every room. In MinimapAPI, it constant
116
+ // updates, so we must specifically tell MinimapAPI that the room should be hidden using the
117
+ // `Hidden` property.
118
+ if (MinimapAPI !== undefined) {
119
+ const minimapAPIRoomDescriptor = MinimapAPI.GetRoomByIdx(roomGridIndex);
120
+ if (minimapAPIRoomDescriptor === undefined) {
121
+ error(
122
+ `Failed to get the MinimapAPI room descriptor for the room at grid index: ${roomGridIndex}`,
123
+ );
124
+ }
125
+ minimapAPIRoomDescriptor.Hidden = true;
126
+ }
127
+ }
128
+
99
129
  /**
100
130
  * Helper function to set the minimap `DisplayFlag` value for every room on the floor at once.
101
131
  *
@@ -175,16 +205,10 @@ export function setRoomDisplayFlags(
175
205
  } else {
176
206
  const minimapAPIRoomDescriptor = MinimapAPI.GetRoomByIdx(roomGridIndex);
177
207
  if (minimapAPIRoomDescriptor === undefined) {
178
- // The room might have already been removed previously.
179
- if (displayFlags === DisplayFlagZero) {
180
- return;
181
- }
182
-
183
208
  error(
184
209
  `Failed to get the MinimapAPI room descriptor for the room at grid index: ${roomGridIndex}`,
185
210
  );
186
211
  }
187
212
  minimapAPIRoomDescriptor.SetDisplayFlags(displayFlags);
188
- minimapAPIRoomDescriptor.Hidden = displayFlags === DisplayFlagZero;
189
213
  }
190
214
  }
@@ -51,6 +51,12 @@ import { getGotoCommand } from "./stage";
51
51
  import { asNumber } from "./types";
52
52
  import { iRange } from "./utils";
53
53
 
54
+ const SECRET_ROOM_TYPES = new ReadonlySet([
55
+ RoomType.SECRET,
56
+ RoomType.SUPER_SECRET,
57
+ RoomType.ULTRA_SECRET,
58
+ ]);
59
+
54
60
  /**
55
61
  * Helper function for quickly switching to a new room without playing a particular animation. Use
56
62
  * this helper function over invoking the `Game.ChangeRoom` method directly to ensure that you do
@@ -547,6 +553,14 @@ export function isAllRoomsClear(onlyCheckRoomTypes?: RoomType[]): boolean {
547
553
  return matchingRooms.every((roomDescriptor) => roomDescriptor.Clear);
548
554
  }
549
555
 
556
+ /**
557
+ * Helper function to detect if a room type is a Secret Room, a Super Secret Room, or an Ultra
558
+ * Secret Room.
559
+ */
560
+ export function isSecretRoomType(roomType: RoomType): boolean {
561
+ return SECRET_ROOM_TYPES.has(roomType);
562
+ }
563
+
550
564
  /**
551
565
  * If the `Room.Update` method is called in a `POST_NEW_ROOM` callback, then some entities will
552
566
  * slide around (such as the player). Since those entity velocities are already at zero, setting