isaacscript-common 2.0.17 → 2.0.20

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.
Files changed (172) hide show
  1. package/dist/callbacks/postCustomDoorEnter.d.ts +5 -3
  2. package/dist/callbacks/postDoorRender.d.ts +1 -0
  3. package/dist/callbacks/postDoorRender.lua +24 -0
  4. package/dist/callbacks/postDoorUpdate.d.ts +1 -0
  5. package/dist/callbacks/postDoorUpdate.lua +24 -0
  6. package/dist/callbacks/postEffectStateChanged.lua +1 -1
  7. package/dist/callbacks/postFamiliarStateChanged.lua +1 -1
  8. package/dist/callbacks/postGridEntity.lua +5 -4
  9. package/dist/callbacks/postGridEntityRender.d.ts +1 -0
  10. package/dist/callbacks/postGridEntityRender.lua +24 -0
  11. package/dist/callbacks/postItemDischarged.lua +5 -5
  12. package/dist/callbacks/postNPCStateChanged.lua +1 -1
  13. package/dist/callbacks/postPickupStateChanged.lua +1 -1
  14. package/dist/callbacks/postPitRender.d.ts +1 -0
  15. package/dist/callbacks/postPitRender.lua +24 -0
  16. package/dist/callbacks/postPitUpdate.d.ts +1 -0
  17. package/dist/callbacks/postPitUpdate.lua +24 -0
  18. package/dist/callbacks/postPlayerChangeType.lua +1 -1
  19. package/dist/callbacks/postPoopRender.d.ts +1 -0
  20. package/dist/callbacks/postPoopRender.lua +24 -0
  21. package/dist/callbacks/postPoopUpdate.d.ts +1 -0
  22. package/dist/callbacks/postPoopUpdate.lua +24 -0
  23. package/dist/callbacks/postPressurePlateRender.d.ts +1 -0
  24. package/dist/callbacks/postPressurePlateRender.lua +24 -0
  25. package/dist/callbacks/postPressurePlateUpdate.d.ts +1 -0
  26. package/dist/callbacks/postPressurePlateUpdate.lua +24 -0
  27. package/dist/callbacks/postRockRender.d.ts +1 -0
  28. package/dist/callbacks/postRockRender.lua +24 -0
  29. package/dist/callbacks/postRockUpdate.d.ts +1 -0
  30. package/dist/callbacks/postRockUpdate.lua +24 -0
  31. package/dist/callbacks/postSlotRender.lua +1 -1
  32. package/dist/callbacks/postSpikesRender.d.ts +1 -0
  33. package/dist/callbacks/postSpikesRender.lua +24 -0
  34. package/dist/callbacks/postSpikesUpdate.d.ts +1 -0
  35. package/dist/callbacks/postSpikesUpdate.lua +24 -0
  36. package/dist/callbacks/postTNTRender.d.ts +1 -0
  37. package/dist/callbacks/postTNTRender.lua +24 -0
  38. package/dist/callbacks/postTNTUpdate.d.ts +1 -0
  39. package/dist/callbacks/postTNTUpdate.lua +24 -0
  40. package/dist/callbacks/subscriptions/postDoorRender.d.ts +5 -0
  41. package/dist/callbacks/subscriptions/postDoorRender.lua +24 -0
  42. package/dist/callbacks/subscriptions/postDoorUpdate.d.ts +5 -0
  43. package/dist/callbacks/subscriptions/postDoorUpdate.lua +24 -0
  44. package/dist/callbacks/subscriptions/postGridEntityBroken.d.ts +2 -1
  45. package/dist/callbacks/subscriptions/postGridEntityBroken.lua +8 -2
  46. package/dist/callbacks/subscriptions/postGridEntityCollision.d.ts +2 -1
  47. package/dist/callbacks/subscriptions/postGridEntityCollision.lua +5 -0
  48. package/dist/callbacks/subscriptions/postGridEntityInit.d.ts +2 -1
  49. package/dist/callbacks/subscriptions/postGridEntityInit.lua +8 -2
  50. package/dist/callbacks/subscriptions/postGridEntityRemove.d.ts +2 -1
  51. package/dist/callbacks/subscriptions/postGridEntityRemove.lua +5 -1
  52. package/dist/callbacks/subscriptions/postGridEntityRender.d.ts +6 -0
  53. package/dist/callbacks/subscriptions/postGridEntityRender.lua +29 -0
  54. package/dist/callbacks/subscriptions/postGridEntityStateChanged.d.ts +2 -1
  55. package/dist/callbacks/subscriptions/postGridEntityStateChanged.lua +8 -2
  56. package/dist/callbacks/subscriptions/postGridEntityUpdate.d.ts +2 -1
  57. package/dist/callbacks/subscriptions/postGridEntityUpdate.lua +8 -2
  58. package/dist/callbacks/subscriptions/postPitRender.d.ts +5 -0
  59. package/dist/callbacks/subscriptions/postPitRender.lua +24 -0
  60. package/dist/callbacks/subscriptions/postPitUpdate.d.ts +5 -0
  61. package/dist/callbacks/subscriptions/postPitUpdate.lua +24 -0
  62. package/dist/callbacks/subscriptions/postPlayerChangeHealth.d.ts +3 -2
  63. package/dist/callbacks/subscriptions/postPlayerChangeHealth.lua +5 -0
  64. package/dist/callbacks/subscriptions/postPlayerChangeType.d.ts +3 -2
  65. package/dist/callbacks/subscriptions/postPlayerChangeType.lua +8 -1
  66. package/dist/callbacks/subscriptions/postPlayerFatalDamage.d.ts +3 -2
  67. package/dist/callbacks/subscriptions/postPlayerFatalDamage.lua +5 -0
  68. package/dist/callbacks/subscriptions/postPlayerInitLate.d.ts +3 -2
  69. package/dist/callbacks/subscriptions/postPlayerInitLate.lua +5 -0
  70. package/dist/callbacks/subscriptions/postPlayerInitReordered.d.ts +3 -2
  71. package/dist/callbacks/subscriptions/postPlayerInitReordered.lua +5 -0
  72. package/dist/callbacks/subscriptions/postPlayerRenderReordered.d.ts +3 -2
  73. package/dist/callbacks/subscriptions/postPlayerRenderReordered.lua +5 -0
  74. package/dist/callbacks/subscriptions/postPlayerUpdateReordered.d.ts +3 -2
  75. package/dist/callbacks/subscriptions/postPlayerUpdateReordered.lua +5 -0
  76. package/dist/callbacks/subscriptions/postPoopRender.d.ts +5 -0
  77. package/dist/callbacks/subscriptions/postPoopRender.lua +24 -0
  78. package/dist/callbacks/subscriptions/postPoopUpdate.d.ts +5 -0
  79. package/dist/callbacks/subscriptions/postPoopUpdate.lua +24 -0
  80. package/dist/callbacks/subscriptions/postPressurePlateRender.d.ts +5 -0
  81. package/dist/callbacks/subscriptions/postPressurePlateRender.lua +24 -0
  82. package/dist/callbacks/subscriptions/postPressurePlateUpdate.d.ts +5 -0
  83. package/dist/callbacks/subscriptions/postPressurePlateUpdate.lua +24 -0
  84. package/dist/callbacks/subscriptions/postRockRender.d.ts +5 -0
  85. package/dist/callbacks/subscriptions/postRockRender.lua +24 -0
  86. package/dist/callbacks/subscriptions/postRockUpdate.d.ts +5 -0
  87. package/dist/callbacks/subscriptions/postRockUpdate.lua +24 -0
  88. package/dist/callbacks/subscriptions/postSacrifice.d.ts +4 -2
  89. package/dist/callbacks/subscriptions/postSacrifice.lua +13 -1
  90. package/dist/callbacks/subscriptions/postSlotAnimationChanged.d.ts +1 -1
  91. package/dist/callbacks/subscriptions/postSlotDestroyed.d.ts +1 -1
  92. package/dist/callbacks/subscriptions/postSlotInit.d.ts +1 -1
  93. package/dist/callbacks/subscriptions/postSlotRender.d.ts +1 -1
  94. package/dist/callbacks/subscriptions/postSlotUpdate.d.ts +1 -1
  95. package/dist/callbacks/subscriptions/postSpikesRender.d.ts +5 -0
  96. package/dist/callbacks/subscriptions/postSpikesRender.lua +24 -0
  97. package/dist/callbacks/subscriptions/postSpikesUpdate.d.ts +5 -0
  98. package/dist/callbacks/subscriptions/postSpikesUpdate.lua +24 -0
  99. package/dist/callbacks/subscriptions/postTNTRender.d.ts +5 -0
  100. package/dist/callbacks/subscriptions/postTNTRender.lua +24 -0
  101. package/dist/callbacks/subscriptions/postTNTUpdate.d.ts +5 -0
  102. package/dist/callbacks/subscriptions/postTNTUpdate.lua +24 -0
  103. package/dist/callbacks/subscriptions/preBerserkDeath.d.ts +3 -2
  104. package/dist/callbacks/subscriptions/preBerserkDeath.lua +5 -0
  105. package/dist/callbacks/subscriptions/preCustomRevive.d.ts +4 -2
  106. package/dist/callbacks/subscriptions/preCustomRevive.lua +15 -3
  107. package/dist/classes/DefaultMap.d.ts +8 -8
  108. package/dist/classes/DefaultMap.lua +3 -3
  109. package/dist/constants.d.ts +3 -2
  110. package/dist/constants.lua +2 -2
  111. package/dist/constantsMax.d.ts +15 -9
  112. package/dist/constantsMax.lua +7 -1
  113. package/dist/enums/ModCallbackCustom.d.ts +69 -54
  114. package/dist/enums/ModCallbackCustom.lua +84 -54
  115. package/dist/features/debugDisplay.d.ts +7 -0
  116. package/dist/features/debugDisplay.lua +117 -14
  117. package/dist/features/deployJSONRoom.lua +2 -2
  118. package/dist/features/extraConsoleCommands/commands.lua +32 -27
  119. package/dist/features/extraConsoleCommands/commandsDisplay.d.ts +63 -0
  120. package/dist/features/extraConsoleCommands/commandsDisplay.lua +49 -0
  121. package/dist/features/extraConsoleCommands/init.d.ts +2 -2
  122. package/dist/features/extraConsoleCommands/init.lua +18 -1
  123. package/dist/features/getCollectibleItemPoolType.lua +3 -2
  124. package/dist/features/playerInventory.lua +1 -1
  125. package/dist/features/preventCollectibleRotate.lua +7 -2
  126. package/dist/functions/array.lua +1 -1
  127. package/dist/functions/boss.d.ts +2 -3
  128. package/dist/functions/cards.lua +3 -1
  129. package/dist/functions/character.lua +2 -2
  130. package/dist/functions/charge.d.ts +6 -6
  131. package/dist/functions/collectibleCacheFlag.lua +3 -1
  132. package/dist/functions/collectibleSet.lua +3 -1
  133. package/dist/functions/collectibleTag.lua +3 -1
  134. package/dist/functions/collectibles.d.ts +1 -0
  135. package/dist/functions/collectibles.lua +32 -16
  136. package/dist/functions/entity.d.ts +1 -1
  137. package/dist/functions/entitySpecific.d.ts +4 -5
  138. package/dist/functions/entityTypes.d.ts +3 -0
  139. package/dist/functions/entityTypes.lua +7 -0
  140. package/dist/functions/familiars.d.ts +3 -3
  141. package/dist/functions/gridEntity.d.ts +0 -5
  142. package/dist/functions/gridEntity.lua +0 -14
  143. package/dist/functions/gridEntitySpecific.d.ts +18 -0
  144. package/dist/functions/gridEntitySpecific.lua +88 -0
  145. package/dist/functions/log.lua +2 -3
  146. package/dist/functions/npcTypes.d.ts +3 -0
  147. package/dist/functions/npcTypes.lua +7 -0
  148. package/dist/functions/pickupVariants.d.ts +13 -0
  149. package/dist/functions/pickupVariants.lua +22 -0
  150. package/dist/functions/pickups.lua +3 -1
  151. package/dist/functions/playerIndex.d.ts +2 -2
  152. package/dist/functions/rooms.d.ts +2 -3
  153. package/dist/functions/rooms.lua +5 -3
  154. package/dist/functions/run.lua +3 -1
  155. package/dist/functions/stage.d.ts +1 -1
  156. package/dist/functions/stage.lua +6 -5
  157. package/dist/functions/trinketCacheFlag.lua +3 -1
  158. package/dist/functions/trinketSet.lua +3 -1
  159. package/dist/functions/trinkets.lua +7 -3
  160. package/dist/index.d.ts +3 -0
  161. package/dist/index.lua +24 -0
  162. package/dist/initCustomCallbacks.lua +45 -0
  163. package/dist/initFeatures.lua +0 -3
  164. package/dist/maps/cardMap.lua +204 -202
  165. package/dist/maps/pillEffectMap.lua +82 -80
  166. package/dist/objects/callbackRegisterFunctions.lua +45 -0
  167. package/dist/objects/cardDescriptions.lua +1 -1
  168. package/dist/objects/cardNames.lua +1 -1
  169. package/dist/objects/cardTypes.lua +1 -1
  170. package/dist/types/AddCallbackParameterCustom.d.ts +30 -0
  171. package/dist/types/private/TSTLClassMetatable.d.ts +1 -1
  172. package/package.json +3 -3
@@ -123,6 +123,7 @@ export declare function isPassiveCollectible(collectibleType: CollectibleType):
123
123
  * dynamically know if a modded item will disappear.
124
124
  */
125
125
  export declare function isSingleUseCollectible(collectibleType: CollectibleType): boolean;
126
+ export declare function isValidCollectibleType(collectibleType: CollectibleType): boolean;
126
127
  /**
127
128
  * Helper function to put a message in the log.txt file to let the Rebirth Item Tracker know that it
128
129
  * should remove an item.
@@ -21,8 +21,12 @@ local COLLECTIBLE_NAME_MAP = ____collectibleNameMap.COLLECTIBLE_NAME_MAP
21
21
  local DEFAULT_COLLECTIBLE_NAME = ____collectibleNameMap.DEFAULT_COLLECTIBLE_NAME
22
22
  local ____singleUseActiveCollectibleTypesSet = require("sets.singleUseActiveCollectibleTypesSet")
23
23
  local SINGLE_USE_ACTIVE_COLLECTIBLE_TYPES_SET = ____singleUseActiveCollectibleTypesSet.SINGLE_USE_ACTIVE_COLLECTIBLE_TYPES_SET
24
+ local ____entity = require("functions.entity")
25
+ local getEntityID = ____entity.getEntityID
24
26
  local ____flag = require("functions.flag")
25
27
  local hasFlag = ____flag.hasFlag
28
+ local ____pickupVariants = require("functions.pickupVariants")
29
+ local isCollectible = ____pickupVariants.isCollectible
26
30
  local ____roomData = require("functions.roomData")
27
31
  local getRoomListIndex = ____roomData.getRoomListIndex
28
32
  local ____sprite = require("functions.sprite")
@@ -36,8 +40,9 @@ function initQuestionMarkSprite(self)
36
40
  return sprite
37
41
  end
38
42
  function ____exports.setCollectibleSprite(self, collectible, pngPath)
39
- if collectible.Variant ~= PickupVariant.COLLECTIBLE then
40
- error("You cannot set a collectible sprite for pickups of variant: " .. tostring(collectible.Variant))
43
+ if not isCollectible(nil, collectible) then
44
+ local entityID = getEntityID(nil, collectible)
45
+ error("The \"setCollectibleSprite\" function was given a non-collectible: " .. entityID)
41
46
  end
42
47
  local sprite = collectible:GetSprite()
43
48
  if pngPath == nil then
@@ -116,8 +121,9 @@ function ____exports.getCollectibleGfxFilename(self, collectibleType)
116
121
  return itemConfigItem.GfxFileName
117
122
  end
118
123
  function ____exports.getCollectibleIndex(self, collectible)
119
- if collectible.Variant ~= PickupVariant.COLLECTIBLE then
120
- error("You cannot get a collectible index for pickups of variant: " .. tostring(collectible.Variant))
124
+ if not isCollectible(nil, collectible) then
125
+ local entityID = getEntityID(nil, collectible)
126
+ error("The \"getCollectibleIndex\" function was given a non-collectible: " .. entityID)
121
127
  end
122
128
  local level = game:GetLevel()
123
129
  local stage = level:GetStage()
@@ -164,8 +170,9 @@ function ____exports.getCollectibleName(self, collectibleType)
164
170
  return DEFAULT_COLLECTIBLE_NAME
165
171
  end
166
172
  function ____exports.getCollectiblePedestalType(self, collectible)
167
- if collectible.Variant ~= PickupVariant.COLLECTIBLE then
168
- error("You cannot get the pedestal type for pickups of variant: " .. tostring(collectible.Variant))
173
+ if not isCollectible(nil, collectible) then
174
+ local entityID = getEntityID(nil, collectible)
175
+ error("The \"getCollectiblePedestalType\" function was given a non-collectible: " .. entityID)
169
176
  end
170
177
  local sprite = collectible:GetSprite()
171
178
  return sprite:GetOverlayFrame()
@@ -186,8 +193,9 @@ function ____exports.isActiveCollectible(self, collectibleType)
186
193
  return itemType == ItemType.ACTIVE
187
194
  end
188
195
  function ____exports.isBlindCollectible(self, collectible)
189
- if collectible.Variant ~= PickupVariant.COLLECTIBLE then
190
- error("You cannot get check for question mark sprites for pickups of variant: " .. tostring(collectible.Variant))
196
+ if not isCollectible(nil, collectible) then
197
+ local entityID = getEntityID(nil, collectible)
198
+ error("The \"isBlindCollectible\" function was given a non-collectible: " .. entityID)
191
199
  end
192
200
  local sprite = collectible:GetSprite()
193
201
  local animation = sprite:GetAnimation()
@@ -205,32 +213,40 @@ end
205
213
  function ____exports.isSingleUseCollectible(self, collectibleType)
206
214
  return SINGLE_USE_ACTIVE_COLLECTIBLE_TYPES_SET:has(collectibleType)
207
215
  end
216
+ function ____exports.isValidCollectibleType(self, collectibleType)
217
+ local itemConfigItem = itemConfig:GetCollectible(collectibleType)
218
+ return itemConfigItem ~= nil
219
+ end
208
220
  function ____exports.removeCollectibleFromItemTracker(self, collectibleType)
209
221
  local collectibleName = ____exports.getCollectibleName(nil, collectibleType)
210
222
  Isaac.DebugString(((("Removing collectible " .. tostring(collectibleType)) .. " (") .. collectibleName) .. ") on player 0 (Player)")
211
223
  end
212
224
  function ____exports.removeCollectiblePickupDelay(self, collectible)
213
- if collectible.Variant ~= PickupVariant.COLLECTIBLE then
214
- error("You cannot remove pickup delay for pickups of variant: " .. tostring(collectible.Variant))
225
+ if not isCollectible(nil, collectible) then
226
+ local entityID = getEntityID(nil, collectible)
227
+ error("The \"removeCollectiblePickupDelay\" function was given a non-collectible: " .. entityID)
215
228
  end
216
229
  collectible.Wait = 0
217
230
  end
218
231
  function ____exports.setCollectibleBlind(self, collectible)
219
- if collectible.Variant ~= PickupVariant.COLLECTIBLE then
220
- error("You cannot set a collectible to be blind for pickups of variant: " .. tostring(collectible.Variant))
232
+ if not isCollectible(nil, collectible) then
233
+ local entityID = getEntityID(nil, collectible)
234
+ error("The \"setCollectibleBlind\" function was given a non-collectible: " .. entityID)
221
235
  end
222
236
  ____exports.setCollectibleSprite(nil, collectible, BLIND_ITEM_PNG_PATH)
223
237
  end
224
238
  function ____exports.setCollectibleEmpty(self, collectible)
225
- if collectible.Variant ~= PickupVariant.COLLECTIBLE then
226
- error("You cannot set a collectible to be empty for pickups of variant: " .. tostring(collectible.Variant))
239
+ if not isCollectible(nil, collectible) then
240
+ local entityID = getEntityID(nil, collectible)
241
+ error("The \"setCollectibleEmpty\" function was given a non-collectible: " .. entityID)
227
242
  end
228
243
  collectible.SubType = CollectibleType.NULL
229
244
  ____exports.clearCollectibleSprite(nil, collectible)
230
245
  end
231
246
  function ____exports.setCollectibleSubType(self, collectible, newCollectibleType)
232
- if collectible.Variant ~= PickupVariant.COLLECTIBLE then
233
- error("You cannot set a collectible sub-type for pickups of variant: " .. tostring(collectible.Variant))
247
+ if not isCollectible(nil, collectible) then
248
+ local entityID = getEntityID(nil, collectible)
249
+ error("The \"setCollectibleSubType\" function was given a non-collectible: " .. entityID)
234
250
  end
235
251
  if newCollectibleType == CollectibleType.NULL then
236
252
  ____exports.setCollectibleEmpty(nil, collectible)
@@ -98,7 +98,7 @@ export declare function parseEntityTypeVariantString(entityTypeVariantString: st
98
98
  * @param cap Optional. If specified, will only remove the given amount of collectibles.
99
99
  * @returns True if one or more entities were removed, false otherwise.
100
100
  */
101
- export declare function removeAllMatchingEntities(entityType: int, entityVariant?: number, entitySubType?: number, cap?: int | undefined): boolean;
101
+ export declare function removeAllMatchingEntities(entityType: EntityType, entityVariant?: number, entitySubType?: number, cap?: int | undefined): boolean;
102
102
  /**
103
103
  * Helper function to remove all of the entities in the supplied array.
104
104
  *
@@ -1,5 +1,4 @@
1
1
  import { BombVariant, EffectVariant, EntityType, FamiliarVariant, KnifeVariant, LaserVariant, PickupVariant, ProjectileVariant, SlotVariant, TearVariant } from "isaac-typescript-definitions";
2
- import { EntityTypeNonNPC } from "../types/EntityTypeNonNPC";
3
2
  /**
4
3
  * Helper function to get all of the `EntityType.BOMB` in the room.
5
4
  *
@@ -105,7 +104,7 @@ export declare function getProjectiles(projectileVariant?: ProjectileVariant, su
105
104
  * }
106
105
  * ```
107
106
  */
108
- export declare function getSlots(slotVariant?: SlotVariant, subType?: number): Entity[];
107
+ export declare function getSlots(slotVariant?: SlotVariant, subType?: number): EntitySlot[];
109
108
  /**
110
109
  * Helper function to get all of the `EntityType.TEAR` in the room.
111
110
  *
@@ -230,9 +229,9 @@ export declare function spawnLaser(laserVariant: LaserVariant, subType: int, pos
230
229
  /** Helper function to spawn a `EntityType.LASER` (7) with a specific seed. */
231
230
  export declare function spawnLaserWithSeed(laserVariant: LaserVariant, subType: int, position: Vector, seed: Seed, velocity?: Readonly<Vector>, spawner?: Entity | undefined): EntityLaser;
232
231
  /** Helper function to spawn an NPC. */
233
- export declare function spawnNPC<T extends EntityType>(entityType: T extends EntityTypeNonNPC ? never : T, variant: int, subType: int, position: Vector, velocity?: Readonly<Vector>, spawner?: Entity | undefined, seed?: Seed | undefined): EntityNPC;
232
+ export declare function spawnNPC(entityType: EntityType, variant: int, subType: int, position: Vector, velocity?: Readonly<Vector>, spawner?: Entity | undefined, seed?: Seed | undefined): EntityNPC;
234
233
  /** Helper function to spawn an NPC with a specific seed. */
235
- export declare function spawnNPCWithSeed<T extends EntityType>(entityType: T extends EntityTypeNonNPC ? never : T, variant: int, subType: int, position: Vector, seed: Seed, velocity?: Readonly<Vector>, spawner?: Entity | undefined): EntityNPC;
234
+ export declare function spawnNPCWithSeed(entityType: EntityType, variant: int, subType: int, position: Vector, seed: Seed, velocity?: Readonly<Vector>, spawner?: Entity | undefined): EntityNPC;
236
235
  /** Helper function to spawn a `EntityType.PICKUP` (5). */
237
236
  export declare function spawnPickup(pickupVariant: PickupVariant, subType: int, position: Vector, velocity?: Readonly<Vector>, spawner?: Entity | undefined, seed?: Seed | undefined): EntityPickup;
238
237
  /** Helper function to spawn a `EntityType.PICKUP` (5) with a specific seed. */
@@ -244,7 +243,7 @@ export declare function spawnProjectileWithSeed(projectileVariant: ProjectileVar
244
243
  /** Helper function to spawn a `EntityType.SLOT` (6). */
245
244
  export declare function spawnSlot(slotVariant: SlotVariant, subType: int, position: Vector, velocity?: Readonly<Vector>, spawner?: Entity | undefined, seed?: Seed | undefined): Entity;
246
245
  /** Helper function to spawn a `EntityType.SLOT` (6) with a specific seed. */
247
- export declare function spawnSlotWithSeed(slotVariant: int | SlotVariant, subType: int, position: Vector, seed: Seed, velocity?: Readonly<Vector>, spawner?: Entity | undefined): Entity;
246
+ export declare function spawnSlotWithSeed(slotVariant: SlotVariant, subType: int, position: Vector, seed: Seed, velocity?: Readonly<Vector>, spawner?: Entity | undefined): Entity;
248
247
  /** Helper function to spawn a `EntityType.TEAR` (2). */
249
248
  export declare function spawnTear(tearVariant: TearVariant, subType: int, position: Vector, velocity?: Readonly<Vector>, spawner?: Entity | undefined, seed?: Seed | undefined): EntityTear;
250
249
  /** Helper function to spawn a `EntityType.EntityType` (2) with a specific seed. */
@@ -0,0 +1,3 @@
1
+ /// <reference types="isaac-typescript-definitions" />
2
+ /** For EntityType.SLOT (6) */
3
+ export declare function isSlot(entity: Entity): entity is EntitySlot;
@@ -0,0 +1,7 @@
1
+ local ____exports = {}
2
+ local ____isaac_2Dtypescript_2Ddefinitions = require("isaac-typescript-definitions")
3
+ local EntityType = ____isaac_2Dtypescript_2Ddefinitions.EntityType
4
+ function ____exports.isSlot(self, entity)
5
+ return entity.Type == EntityType.SLOT
6
+ end
7
+ return ____exports
@@ -1,4 +1,4 @@
1
- /// <reference types="isaac-typescript-definitions" />
1
+ import { CollectibleType, FamiliarVariant } from "isaac-typescript-definitions";
2
2
  /**
3
3
  * Helper function to add and remove familiars based on a target amount that you specify.
4
4
  *
@@ -28,7 +28,7 @@
28
28
  * specified, it will search for existing familiars of all sub-types, and
29
29
  * spawn new familiars with a sub-type of 0.
30
30
  */
31
- export declare function checkFamiliar(player: EntityPlayer, collectibleType: int, targetCount: int, familiarVariant: int, familiarSubType?: int): void;
31
+ export declare function checkFamiliar(player: EntityPlayer, collectibleType: CollectibleType, targetCount: int, familiarVariant: FamiliarVariant, familiarSubType?: int): void;
32
32
  /**
33
33
  * Helper function to add and remove familiars based on the amount of associated collectibles that a
34
34
  * player has.
@@ -56,5 +56,5 @@ export declare function checkFamiliar(player: EntityPlayer, collectibleType: int
56
56
  * specified, it will search for existing familiars of all sub-types, and
57
57
  * spawn new familiars with a sub-type of 0.
58
58
  */
59
- export declare function checkFamiliarFromCollectibles(player: EntityPlayer, collectibleType: int, familiarVariant: int, familiarSubType?: int): void;
59
+ export declare function checkFamiliarFromCollectibles(player: EntityPlayer, collectibleType: CollectibleType, familiarVariant: FamiliarVariant, familiarSubType?: int): void;
60
60
  export declare function isFamiliarThatShootsPlayerTears(familiar: EntityFamiliar): boolean;
@@ -55,11 +55,6 @@ export declare function getTopLeftWall(): GridEntity | undefined;
55
55
  * room shape is.)
56
56
  */
57
57
  export declare function getTopLeftWallGridIndex(): int;
58
- /**
59
- * Helper function to determine if all of the pressure plates in the current room are pushed.
60
- * Returns true if there are no pressure plates in the room.
61
- */
62
- export declare function isAllPressurePlatesPushed(): boolean;
63
58
  export declare function isGridEntityBreakableByExplosion(gridEntity: GridEntity): boolean;
64
59
  /**
65
60
  * Helper function to see if the provided gridEntity is in its respective broken state. See the
@@ -3,14 +3,12 @@ local Set = ____lualib.Set
3
3
  local __TS__New = ____lualib.__TS__New
4
4
  local __TS__ArrayFilter = ____lualib.__TS__ArrayFilter
5
5
  local Map = ____lualib.Map
6
- local __TS__ArrayEvery = ____lualib.__TS__ArrayEvery
7
6
  local ____exports = {}
8
7
  local getAllGridEntities
9
8
  local ____isaac_2Dtypescript_2Ddefinitions = require("isaac-typescript-definitions")
10
9
  local GridCollisionClass = ____isaac_2Dtypescript_2Ddefinitions.GridCollisionClass
11
10
  local GridEntityType = ____isaac_2Dtypescript_2Ddefinitions.GridEntityType
12
11
  local PoopGridEntityVariant = ____isaac_2Dtypescript_2Ddefinitions.PoopGridEntityVariant
13
- local PressurePlateState = ____isaac_2Dtypescript_2Ddefinitions.PressurePlateState
14
12
  local StatueVariant = ____isaac_2Dtypescript_2Ddefinitions.StatueVariant
15
13
  local TrapdoorVariant = ____isaac_2Dtypescript_2Ddefinitions.TrapdoorVariant
16
14
  local ____cachedClasses = require("cachedClasses")
@@ -191,18 +189,6 @@ function ____exports.getTopLeftWall(self)
191
189
  local topLeftWallGridIndex = ____exports.getTopLeftWallGridIndex(nil)
192
190
  return room:GetGridEntity(topLeftWallGridIndex)
193
191
  end
194
- function ____exports.isAllPressurePlatesPushed(self)
195
- local room = game:GetRoom()
196
- local hasPressurePlates = room:HasTriggerPressurePlates()
197
- if not hasPressurePlates then
198
- return true
199
- end
200
- local pressurePlates = ____exports.getGridEntities(nil, GridEntityType.PRESSURE_PLATE)
201
- return __TS__ArrayEvery(
202
- pressurePlates,
203
- function(____, pressurePlate) return pressurePlate.State == PressurePlateState.PRESSURE_PLATE_PRESSED end
204
- )
205
- end
206
192
  function ____exports.isGridEntityBreakableByExplosion(self, gridEntity)
207
193
  local gridEntityType = gridEntity:GetType()
208
194
  local gridEntityVariant = gridEntity:GetVariant()
@@ -0,0 +1,18 @@
1
+ /// <reference types="isaac-typescript-definitions" />
2
+ /** Helper function to get all of the `GridEntityPit` in the room. */
3
+ export declare function getPits(): GridEntityPit[];
4
+ /** Helper function to get all of the `GridEntityPoop` in the room. */
5
+ export declare function getPoops(): GridEntityPoop[];
6
+ /** Helper function to get all of the `GridEntityPressurePlate` in the room. */
7
+ export declare function getPressurePlates(): GridEntityPressurePlate[];
8
+ /** Helper function to get all of the `GridEntityRock` in the room. */
9
+ export declare function getRocks(): GridEntityRock[];
10
+ /** Helper function to get all of the `GridEntitySpikes` in the room. */
11
+ export declare function getSpikes(): GridEntitySpikes[];
12
+ /** Helper function to get all of the `GridEntityTNT` in the room. */
13
+ export declare function getTNT(): GridEntityTNT[];
14
+ /**
15
+ * Helper function to determine if all of the pressure plates in the current room are pushed.
16
+ * Returns true if there are no pressure plates in the room.
17
+ */
18
+ export declare function isAllPressurePlatesPushed(): boolean;
@@ -0,0 +1,88 @@
1
+ local ____lualib = require("lualib_bundle")
2
+ local __TS__ArrayEvery = ____lualib.__TS__ArrayEvery
3
+ local ____exports = {}
4
+ local ____isaac_2Dtypescript_2Ddefinitions = require("isaac-typescript-definitions")
5
+ local PressurePlateState = ____isaac_2Dtypescript_2Ddefinitions.PressurePlateState
6
+ local ____cachedClasses = require("cachedClasses")
7
+ local game = ____cachedClasses.game
8
+ local ____gridEntity = require("functions.gridEntity")
9
+ local getGridEntities = ____gridEntity.getGridEntities
10
+ function ____exports.getPits(self)
11
+ local gridEntities = getGridEntities(nil)
12
+ local pits = {}
13
+ for ____, gridEntity in ipairs(gridEntities) do
14
+ local pit = gridEntity:ToPit()
15
+ if pit ~= nil then
16
+ pits[#pits + 1] = pit
17
+ end
18
+ end
19
+ return pits
20
+ end
21
+ function ____exports.getPoops(self)
22
+ local gridEntities = getGridEntities(nil)
23
+ local poops = {}
24
+ for ____, gridEntity in ipairs(gridEntities) do
25
+ local poop = gridEntity:ToPoop()
26
+ if poop ~= nil then
27
+ poops[#poops + 1] = poop
28
+ end
29
+ end
30
+ return poops
31
+ end
32
+ function ____exports.getPressurePlates(self)
33
+ local gridEntities = getGridEntities(nil)
34
+ local pressurePlates = {}
35
+ for ____, gridEntity in ipairs(gridEntities) do
36
+ local pressurePlate = gridEntity:ToPressurePlate()
37
+ if pressurePlate ~= nil then
38
+ pressurePlates[#pressurePlates + 1] = pressurePlate
39
+ end
40
+ end
41
+ return pressurePlates
42
+ end
43
+ function ____exports.getRocks(self)
44
+ local gridEntities = getGridEntities(nil)
45
+ local rocks = {}
46
+ for ____, gridEntity in ipairs(gridEntities) do
47
+ local rock = gridEntity:ToRock()
48
+ if rock ~= nil then
49
+ rocks[#rocks + 1] = rock
50
+ end
51
+ end
52
+ return rocks
53
+ end
54
+ function ____exports.getSpikes(self)
55
+ local gridEntities = getGridEntities(nil)
56
+ local spikes = {}
57
+ for ____, gridEntity in ipairs(gridEntities) do
58
+ local spike = gridEntity:ToSpikes()
59
+ if spike ~= nil then
60
+ spikes[#spikes + 1] = spike
61
+ end
62
+ end
63
+ return spikes
64
+ end
65
+ function ____exports.getTNT(self)
66
+ local gridEntities = getGridEntities(nil)
67
+ local tntArray = {}
68
+ for ____, gridEntity in ipairs(gridEntities) do
69
+ local tnt = gridEntity:ToTNT()
70
+ if tnt ~= nil then
71
+ tntArray[#tntArray + 1] = tnt
72
+ end
73
+ end
74
+ return tntArray
75
+ end
76
+ function ____exports.isAllPressurePlatesPushed(self)
77
+ local room = game:GetRoom()
78
+ local hasPressurePlates = room:HasTriggerPressurePlates()
79
+ if not hasPressurePlates then
80
+ return true
81
+ end
82
+ local pressurePlates = ____exports.getPressurePlates(nil)
83
+ return __TS__ArrayEvery(
84
+ pressurePlates,
85
+ function(____, pressurePlate) return pressurePlate.State == PressurePlateState.PRESSURE_PLATE_PRESSED end
86
+ )
87
+ end
88
+ return ____exports
@@ -10,7 +10,6 @@ local ____isaac_2Dtypescript_2Ddefinitions = require("isaac-typescript-definitio
10
10
  local DamageFlag = ____isaac_2Dtypescript_2Ddefinitions.DamageFlag
11
11
  local EffectVariant = ____isaac_2Dtypescript_2Ddefinitions.EffectVariant
12
12
  local EntityFlag = ____isaac_2Dtypescript_2Ddefinitions.EntityFlag
13
- local EntityType = ____isaac_2Dtypescript_2Ddefinitions.EntityType
14
13
  local GameStateFlag = ____isaac_2Dtypescript_2Ddefinitions.GameStateFlag
15
14
  local GridEntityType = ____isaac_2Dtypescript_2Ddefinitions.GridEntityType
16
15
  local LevelStateFlag = ____isaac_2Dtypescript_2Ddefinitions.LevelStateFlag
@@ -157,7 +156,8 @@ function ____exports.logEntities(includeBackgroundEffects, entityTypeFilter)
157
156
  if entityTypeFilter ~= nil and entity.Type ~= entityTypeFilter then
158
157
  return
159
158
  end
160
- if not includeBackgroundEffects and entity.Type == EntityType.EFFECT and IGNORE_EFFECT_VARIANTS:has(entity.Variant) then
159
+ local effect = entity:ToEffect()
160
+ if not includeBackgroundEffects and effect ~= nil and IGNORE_EFFECT_VARIANTS:has(effect.Variant) then
161
161
  return
162
162
  end
163
163
  local entityID = getEntityID(nil, entity)
@@ -166,7 +166,6 @@ function ____exports.logEntities(includeBackgroundEffects, entityTypeFilter)
166
166
  if bomb ~= nil then
167
167
  msg = msg .. " (bomb)"
168
168
  end
169
- local effect = entity:ToEffect()
170
169
  if effect ~= nil then
171
170
  msg = msg .. (" (effect) (State: " .. tostring(effect.State)) .. ")"
172
171
  end
@@ -0,0 +1,3 @@
1
+ /// <reference types="isaac-typescript-definitions" />
2
+ /** For EntityType.RAGLING (246) */
3
+ export declare function isRagling(npc: EntityNPC): npc is EntityNPCRagling;
@@ -0,0 +1,7 @@
1
+ local ____exports = {}
2
+ local ____isaac_2Dtypescript_2Ddefinitions = require("isaac-typescript-definitions")
3
+ local EntityType = ____isaac_2Dtypescript_2Ddefinitions.EntityType
4
+ function ____exports.isRagling(self, npc)
5
+ return npc.Type == EntityType.RAGLING
6
+ end
7
+ return ____exports
@@ -0,0 +1,13 @@
1
+ /// <reference types="isaac-typescript-definitions" />
2
+ /** For PickupVariant.HEART (10) */
3
+ export declare function isHeart(pickup: EntityPickup): pickup is EntityPickupHeart;
4
+ /** For PickupVariant.COIN (20) */
5
+ export declare function isCoin(pickup: EntityPickup): pickup is EntityPickupCoin;
6
+ /** For PickupVariant.KEY (30) */
7
+ export declare function isKey(pickup: EntityPickup): pickup is EntityPickupKey;
8
+ /** For PickupVariant.BOMB (40) */
9
+ export declare function isBomb(pickup: EntityPickup): pickup is EntityPickupBomb;
10
+ /** For PickupVariant.COLLECTIBLE (100) */
11
+ export declare function isCollectible(pickup: EntityPickup): pickup is EntityPickupCollectible;
12
+ /** For PickupVariant.TRINKET (350) */
13
+ export declare function isTrinket(pickup: EntityPickup): pickup is EntityPickupTrinket;
@@ -0,0 +1,22 @@
1
+ local ____exports = {}
2
+ local ____isaac_2Dtypescript_2Ddefinitions = require("isaac-typescript-definitions")
3
+ local PickupVariant = ____isaac_2Dtypescript_2Ddefinitions.PickupVariant
4
+ function ____exports.isHeart(self, pickup)
5
+ return pickup.Variant == PickupVariant.HEART
6
+ end
7
+ function ____exports.isCoin(self, pickup)
8
+ return pickup.Variant == PickupVariant.COIN
9
+ end
10
+ function ____exports.isKey(self, pickup)
11
+ return pickup.Variant == PickupVariant.KEY
12
+ end
13
+ function ____exports.isBomb(self, pickup)
14
+ return pickup.Variant == PickupVariant.BOMB
15
+ end
16
+ function ____exports.isCollectible(self, pickup)
17
+ return pickup.Variant == PickupVariant.COLLECTIBLE
18
+ end
19
+ function ____exports.isTrinket(self, pickup)
20
+ return pickup.Variant == PickupVariant.TRINKET
21
+ end
22
+ return ____exports
@@ -16,6 +16,8 @@ local ____entitySpecific = require("functions.entitySpecific")
16
16
  local getPickups = ____entitySpecific.getPickups
17
17
  local removeAllPickups = ____entitySpecific.removeAllPickups
18
18
  local spawnPickup = ____entitySpecific.spawnPickup
19
+ local ____pickupVariants = require("functions.pickupVariants")
20
+ local isHeart = ____pickupVariants.isHeart
19
21
  function ____exports.getBatteries(self, matchingSubType)
20
22
  if matchingSubType == nil then
21
23
  matchingSubType = -1
@@ -85,7 +87,7 @@ function ____exports.isChest(self, pickup)
85
87
  return CHEST_PICKUP_VARIANTS:has(pickup.Variant)
86
88
  end
87
89
  function ____exports.isRedHeart(self, pickup)
88
- return pickup.Variant == PickupVariant.HEART and RED_HEART_SUB_TYPES_SET:has(pickup.SubType)
90
+ return isHeart(nil, pickup) and RED_HEART_SUB_TYPES_SET:has(pickup.SubType)
89
91
  end
90
92
  function ____exports.removeAllBatteries(self, batterySubType, cap)
91
93
  return removeAllPickups(nil, PickupVariant.LIL_BATTERY, batterySubType, cap)
@@ -51,8 +51,8 @@ export declare function getPlayerIndexVanilla(playerToFind: EntityPlayer): int |
51
51
  * If this is not desired, use the `getAllPlayers` helper function instead.
52
52
  *
53
53
  * @param performCharacterExclusions Whether or not to exclude characters that are not directly
54
- * controlled by the player (i.e. Esau & Tainted Soul). Default is
55
- * false.
54
+ * controlled by the player (i.e. Esau & Tainted Soul). Default is
55
+ * false.
56
56
  */
57
57
  export declare function getPlayers(performCharacterExclusions?: boolean): EntityPlayer[];
58
58
  /**
@@ -53,9 +53,8 @@ export declare function getRoomTypeName(roomType: RoomType): string;
53
53
  * the list.
54
54
  *
55
55
  * @param includeExtraDimensionalRooms Optional. On some floors (e.g. Downpour 2, Mines 2),
56
- * extra-dimensional rooms are automatically be generated and
57
- * can be seen when you iterate over the `RoomList`. Default is
58
- * false.
56
+ * extra-dimensional rooms are automatically be generated and can be
57
+ * seen when you iterate over the `RoomList`. Default is false.
59
58
  */
60
59
  export declare function getRooms(includeExtraDimensionalRooms?: boolean): RoomDescriptor[];
61
60
  /**
@@ -12,6 +12,7 @@ local ____isaac_2Dtypescript_2Ddefinitions = require("isaac-typescript-definitio
12
12
  local AngelRoomSubType = ____isaac_2Dtypescript_2Ddefinitions.AngelRoomSubType
13
13
  local Dimension = ____isaac_2Dtypescript_2Ddefinitions.Dimension
14
14
  local Direction = ____isaac_2Dtypescript_2Ddefinitions.Direction
15
+ local DoorSlot = ____isaac_2Dtypescript_2Ddefinitions.DoorSlot
15
16
  local DungeonSubType = ____isaac_2Dtypescript_2Ddefinitions.DungeonSubType
16
17
  local GridRoom = ____isaac_2Dtypescript_2Ddefinitions.GridRoom
17
18
  local HomeRoomSubType = ____isaac_2Dtypescript_2Ddefinitions.HomeRoomSubType
@@ -110,7 +111,7 @@ function ____exports.changeRoom(self, roomGridIndex)
110
111
  if roomData == nil then
111
112
  error(("Failed to change the room to grid index " .. tostring(roomGridIndex)) .. " because that room does not exist.")
112
113
  end
113
- level.LeaveDoor = -1
114
+ level.LeaveDoor = DoorSlot.NO_DOOR_SLOT
114
115
  game:ChangeRoom(roomGridIndex)
115
116
  end
116
117
  function ____exports.getAllRoomGridIndexes(self)
@@ -128,7 +129,8 @@ function ____exports.getCurrentDimension(self)
128
129
  local startingRoomGridIndex = level:GetStartingRoomIndex()
129
130
  local startingRoomDescription = level:GetRoomByIdx(startingRoomGridIndex, Dimension.CURRENT)
130
131
  local startingRoomHash = GetPtrHash(startingRoomDescription)
131
- for ____, dimension in ipairs(erange(nil, NUM_DIMENSIONS)) do
132
+ for ____, dimensionInt in ipairs(erange(nil, NUM_DIMENSIONS)) do
133
+ local dimension = dimensionInt
132
134
  local dimensionRoomDescription = level:GetRoomByIdx(startingRoomGridIndex, dimension)
133
135
  local dimensionRoomHash = GetPtrHash(dimensionRoomDescription)
134
136
  if dimensionRoomHash == startingRoomHash then
@@ -372,7 +374,7 @@ function ____exports.teleport(self, roomGridIndex, direction, roomTransitionAnim
372
374
  if roomData == nil then
373
375
  error(("Failed to change the room to grid index " .. tostring(roomGridIndex)) .. " because that room does not exist.")
374
376
  end
375
- level.LeaveDoor = -1
377
+ level.LeaveDoor = DoorSlot.NO_DOOR_SLOT
376
378
  game:StartRoomTransition(roomGridIndex, direction, roomTransitionAnim)
377
379
  end
378
380
  return ____exports
@@ -3,6 +3,8 @@ local ____isaac_2Dtypescript_2Ddefinitions = require("isaac-typescript-definitio
3
3
  local Challenge = ____isaac_2Dtypescript_2Ddefinitions.Challenge
4
4
  local ____cachedClasses = require("cachedClasses")
5
5
  local game = ____cachedClasses.game
6
+ local ____constantsMax = require("constantsMax")
7
+ local FIRST_CHARACTER = ____constantsMax.FIRST_CHARACTER
6
8
  local ____log = require("functions.log")
7
9
  local log = ____log.log
8
10
  function ____exports.onSetSeed(self)
@@ -17,7 +19,7 @@ function ____exports.restart(self, character)
17
19
  Isaac.ExecuteCommand("restart")
18
20
  return
19
21
  end
20
- if character < 0 then
22
+ if character < FIRST_CHARACTER then
21
23
  error(("Restarting as a character of " .. tostring(character)) .. " would crash the game.")
22
24
  end
23
25
  log("Restarting as character: " .. tostring(character))
@@ -11,7 +11,7 @@ export declare function getStage(): LevelStage;
11
11
  export declare function getStageType(): StageType;
12
12
  /** Helper function to directly warp to a specific stage using the "stage" console command. */
13
13
  export declare function goToStage(stage: LevelStage, stageType: StageType): void;
14
- export declare function isRepentanceStage(stageType: int): boolean;
14
+ export declare function isRepentanceStage(stageType: StageType): boolean;
15
15
  export declare function onCathedral(): boolean;
16
16
  export declare function onChest(): boolean;
17
17
  export declare function onDarkRoom(): boolean;
@@ -1,5 +1,6 @@
1
1
  local ____exports = {}
2
2
  local ____isaac_2Dtypescript_2Ddefinitions = require("isaac-typescript-definitions")
3
+ local LevelStage = ____isaac_2Dtypescript_2Ddefinitions.LevelStage
3
4
  local StageType = ____isaac_2Dtypescript_2Ddefinitions.StageType
4
5
  local ____cachedClasses = require("cachedClasses")
5
6
  local game = ____cachedClasses.game
@@ -41,29 +42,29 @@ function ____exports.onCathedral(self)
41
42
  local level = game:GetLevel()
42
43
  local stage = level:GetStage()
43
44
  local stageType = level:GetStageType()
44
- return stage == 10 and stageType == 1
45
+ return stage == LevelStage.SHEOL_CATHEDRAL and stageType == StageType.WRATH_OF_THE_LAMB
45
46
  end
46
47
  function ____exports.onChest(self)
47
48
  local level = game:GetLevel()
48
49
  local stage = level:GetStage()
49
50
  local stageType = level:GetStageType()
50
- return stage == 11 and stageType == 1
51
+ return stage == LevelStage.DARK_ROOM_CHEST and stageType == StageType.WRATH_OF_THE_LAMB
51
52
  end
52
53
  function ____exports.onDarkRoom(self)
53
54
  local level = game:GetLevel()
54
55
  local stage = level:GetStage()
55
56
  local stageType = level:GetStageType()
56
- return stage == 11 and stageType == 0
57
+ return stage == LevelStage.DARK_ROOM_CHEST and stageType == StageType.ORIGINAL
57
58
  end
58
59
  function ____exports.onFinalFloor(self)
59
60
  local level = game:GetLevel()
60
61
  local stage = level:GetStage()
61
- return stage == 11 or stage == 12 or stage == 13 or stage == 8 and ____exports.onRepentanceStage(nil)
62
+ return stage == LevelStage.DARK_ROOM_CHEST or stage == LevelStage.THE_VOID or stage == LevelStage.HOME or stage == LevelStage.WOMB_2 and ____exports.onRepentanceStage(nil)
62
63
  end
63
64
  function ____exports.onSheol(self)
64
65
  local level = game:GetLevel()
65
66
  local stage = level:GetStage()
66
67
  local stageType = level:GetStageType()
67
- return stage == 10 and stageType == 0
68
+ return stage == LevelStage.SHEOL_CATHEDRAL and stageType == StageType.ORIGINAL
68
69
  end
69
70
  return ____exports
@@ -8,6 +8,7 @@ local initCacheFlagMap, CACHE_FLAG_TO_TRINKETS_MAP
8
8
  local ____isaac_2Dtypescript_2Ddefinitions = require("isaac-typescript-definitions")
9
9
  local CacheFlag = ____isaac_2Dtypescript_2Ddefinitions.CacheFlag
10
10
  local ____constantsMax = require("constantsMax")
11
+ local FIRST_TRINKET_TYPE = ____constantsMax.FIRST_TRINKET_TYPE
11
12
  local MAX_TRINKET_TYPE = ____constantsMax.MAX_TRINKET_TYPE
12
13
  local ____enums = require("functions.enums")
13
14
  local getEnumValues = ____enums.getEnumValues
@@ -20,7 +21,8 @@ local irange = ____utils.irange
20
21
  function initCacheFlagMap(self)
21
22
  for ____, cacheFlag in ipairs(getEnumValues(nil, CacheFlag)) do
22
23
  local trinketsSet = __TS__New(Set)
23
- for ____, trinketType in ipairs(irange(nil, 1, MAX_TRINKET_TYPE)) do
24
+ for ____, trinketTypeInt in ipairs(irange(nil, FIRST_TRINKET_TYPE, MAX_TRINKET_TYPE)) do
25
+ local trinketType = trinketTypeInt
24
26
  if trinketHasCacheFlag(nil, trinketType, cacheFlag) then
25
27
  trinketsSet:add(trinketType)
26
28
  end
@@ -5,6 +5,7 @@ local ____exports = {}
5
5
  local ____cachedClasses = require("cachedClasses")
6
6
  local itemConfig = ____cachedClasses.itemConfig
7
7
  local ____constantsMax = require("constantsMax")
8
+ local FIRST_TRINKET_TYPE = ____constantsMax.FIRST_TRINKET_TYPE
8
9
  local MAX_TRINKET_TYPE = ____constantsMax.MAX_TRINKET_TYPE
9
10
  local ____set = require("functions.set")
10
11
  local copySet = ____set.copySet
@@ -12,7 +13,8 @@ local ____utils = require("functions.utils")
12
13
  local irange = ____utils.irange
13
14
  local TRINKET_SET = __TS__New(Set)
14
15
  local function initTrinketSet(self)
15
- for ____, trinketType in ipairs(irange(nil, 1, MAX_TRINKET_TYPE)) do
16
+ for ____, trinketTypeInt in ipairs(irange(nil, FIRST_TRINKET_TYPE, MAX_TRINKET_TYPE)) do
17
+ local trinketType = trinketTypeInt
16
18
  local itemConfigTrinket = itemConfig:GetTrinket(trinketType)
17
19
  if itemConfigTrinket ~= nil then
18
20
  TRINKET_SET:add(trinketType)