isaacscript-common 2.0.15 → 2.0.18

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 (182) hide show
  1. package/dist/callbacks/itemPickup.lua +3 -3
  2. package/dist/callbacks/postCustomDoorEnter.d.ts +5 -3
  3. package/dist/callbacks/postDoorRender.d.ts +1 -0
  4. package/dist/callbacks/postDoorRender.lua +24 -0
  5. package/dist/callbacks/postDoorUpdate.d.ts +1 -0
  6. package/dist/callbacks/postDoorUpdate.lua +24 -0
  7. package/dist/callbacks/postEffectStateChanged.lua +1 -1
  8. package/dist/callbacks/postFamiliarStateChanged.lua +1 -1
  9. package/dist/callbacks/postGridEntity.lua +5 -4
  10. package/dist/callbacks/postGridEntityRender.d.ts +1 -0
  11. package/dist/callbacks/postGridEntityRender.lua +24 -0
  12. package/dist/callbacks/postItemDischarged.lua +5 -5
  13. package/dist/callbacks/postNPCStateChanged.lua +1 -1
  14. package/dist/callbacks/postPickupStateChanged.lua +1 -1
  15. package/dist/callbacks/postPitRender.d.ts +1 -0
  16. package/dist/callbacks/postPitRender.lua +24 -0
  17. package/dist/callbacks/postPitUpdate.d.ts +1 -0
  18. package/dist/callbacks/postPitUpdate.lua +24 -0
  19. package/dist/callbacks/postPlayerChangeType.lua +1 -1
  20. package/dist/callbacks/postPoopRender.d.ts +1 -0
  21. package/dist/callbacks/postPoopRender.lua +24 -0
  22. package/dist/callbacks/postPoopUpdate.d.ts +1 -0
  23. package/dist/callbacks/postPoopUpdate.lua +24 -0
  24. package/dist/callbacks/postPressurePlateRender.d.ts +1 -0
  25. package/dist/callbacks/postPressurePlateRender.lua +24 -0
  26. package/dist/callbacks/postPressurePlateUpdate.d.ts +1 -0
  27. package/dist/callbacks/postPressurePlateUpdate.lua +24 -0
  28. package/dist/callbacks/postRockRender.d.ts +1 -0
  29. package/dist/callbacks/postRockRender.lua +24 -0
  30. package/dist/callbacks/postRockUpdate.d.ts +1 -0
  31. package/dist/callbacks/postRockUpdate.lua +24 -0
  32. package/dist/callbacks/postSlotRender.lua +1 -1
  33. package/dist/callbacks/postSpikesRender.d.ts +1 -0
  34. package/dist/callbacks/postSpikesRender.lua +24 -0
  35. package/dist/callbacks/postSpikesUpdate.d.ts +1 -0
  36. package/dist/callbacks/postSpikesUpdate.lua +24 -0
  37. package/dist/callbacks/postTNTRender.d.ts +1 -0
  38. package/dist/callbacks/postTNTRender.lua +24 -0
  39. package/dist/callbacks/postTNTUpdate.d.ts +1 -0
  40. package/dist/callbacks/postTNTUpdate.lua +24 -0
  41. package/dist/callbacks/subscriptions/postDoorRender.d.ts +5 -0
  42. package/dist/callbacks/subscriptions/postDoorRender.lua +24 -0
  43. package/dist/callbacks/subscriptions/postDoorUpdate.d.ts +5 -0
  44. package/dist/callbacks/subscriptions/postDoorUpdate.lua +24 -0
  45. package/dist/callbacks/subscriptions/postGridEntityBroken.d.ts +2 -1
  46. package/dist/callbacks/subscriptions/postGridEntityBroken.lua +8 -2
  47. package/dist/callbacks/subscriptions/postGridEntityCollision.d.ts +2 -1
  48. package/dist/callbacks/subscriptions/postGridEntityCollision.lua +5 -0
  49. package/dist/callbacks/subscriptions/postGridEntityInit.d.ts +2 -1
  50. package/dist/callbacks/subscriptions/postGridEntityInit.lua +8 -2
  51. package/dist/callbacks/subscriptions/postGridEntityRemove.d.ts +2 -1
  52. package/dist/callbacks/subscriptions/postGridEntityRemove.lua +5 -1
  53. package/dist/callbacks/subscriptions/postGridEntityRender.d.ts +6 -0
  54. package/dist/callbacks/subscriptions/postGridEntityRender.lua +29 -0
  55. package/dist/callbacks/subscriptions/postGridEntityStateChanged.d.ts +2 -1
  56. package/dist/callbacks/subscriptions/postGridEntityStateChanged.lua +8 -2
  57. package/dist/callbacks/subscriptions/postGridEntityUpdate.d.ts +2 -1
  58. package/dist/callbacks/subscriptions/postGridEntityUpdate.lua +8 -2
  59. package/dist/callbacks/subscriptions/postItemPickup.d.ts +9 -5
  60. package/dist/callbacks/subscriptions/postItemPickup.lua +2 -2
  61. package/dist/callbacks/subscriptions/postPitRender.d.ts +5 -0
  62. package/dist/callbacks/subscriptions/postPitRender.lua +24 -0
  63. package/dist/callbacks/subscriptions/postPitUpdate.d.ts +5 -0
  64. package/dist/callbacks/subscriptions/postPitUpdate.lua +24 -0
  65. package/dist/callbacks/subscriptions/postPlayerChangeHealth.d.ts +3 -2
  66. package/dist/callbacks/subscriptions/postPlayerChangeHealth.lua +5 -0
  67. package/dist/callbacks/subscriptions/postPlayerChangeType.d.ts +3 -2
  68. package/dist/callbacks/subscriptions/postPlayerChangeType.lua +8 -1
  69. package/dist/callbacks/subscriptions/postPlayerFatalDamage.d.ts +3 -2
  70. package/dist/callbacks/subscriptions/postPlayerFatalDamage.lua +5 -0
  71. package/dist/callbacks/subscriptions/postPlayerInitLate.d.ts +3 -2
  72. package/dist/callbacks/subscriptions/postPlayerInitLate.lua +5 -0
  73. package/dist/callbacks/subscriptions/postPlayerInitReordered.d.ts +3 -2
  74. package/dist/callbacks/subscriptions/postPlayerInitReordered.lua +5 -0
  75. package/dist/callbacks/subscriptions/postPlayerRenderReordered.d.ts +3 -2
  76. package/dist/callbacks/subscriptions/postPlayerRenderReordered.lua +5 -0
  77. package/dist/callbacks/subscriptions/postPlayerUpdateReordered.d.ts +3 -2
  78. package/dist/callbacks/subscriptions/postPlayerUpdateReordered.lua +5 -0
  79. package/dist/callbacks/subscriptions/postPoopRender.d.ts +5 -0
  80. package/dist/callbacks/subscriptions/postPoopRender.lua +24 -0
  81. package/dist/callbacks/subscriptions/postPoopUpdate.d.ts +5 -0
  82. package/dist/callbacks/subscriptions/postPoopUpdate.lua +24 -0
  83. package/dist/callbacks/subscriptions/postPressurePlateRender.d.ts +5 -0
  84. package/dist/callbacks/subscriptions/postPressurePlateRender.lua +24 -0
  85. package/dist/callbacks/subscriptions/postPressurePlateUpdate.d.ts +5 -0
  86. package/dist/callbacks/subscriptions/postPressurePlateUpdate.lua +24 -0
  87. package/dist/callbacks/subscriptions/postRockRender.d.ts +5 -0
  88. package/dist/callbacks/subscriptions/postRockRender.lua +24 -0
  89. package/dist/callbacks/subscriptions/postRockUpdate.d.ts +5 -0
  90. package/dist/callbacks/subscriptions/postRockUpdate.lua +24 -0
  91. package/dist/callbacks/subscriptions/postSacrifice.d.ts +4 -2
  92. package/dist/callbacks/subscriptions/postSacrifice.lua +13 -1
  93. package/dist/callbacks/subscriptions/postSlotAnimationChanged.d.ts +1 -1
  94. package/dist/callbacks/subscriptions/postSlotDestroyed.d.ts +1 -1
  95. package/dist/callbacks/subscriptions/postSlotInit.d.ts +1 -1
  96. package/dist/callbacks/subscriptions/postSlotRender.d.ts +1 -1
  97. package/dist/callbacks/subscriptions/postSlotUpdate.d.ts +1 -1
  98. package/dist/callbacks/subscriptions/postSpikesRender.d.ts +5 -0
  99. package/dist/callbacks/subscriptions/postSpikesRender.lua +24 -0
  100. package/dist/callbacks/subscriptions/postSpikesUpdate.d.ts +5 -0
  101. package/dist/callbacks/subscriptions/postSpikesUpdate.lua +24 -0
  102. package/dist/callbacks/subscriptions/postTNTRender.d.ts +5 -0
  103. package/dist/callbacks/subscriptions/postTNTRender.lua +24 -0
  104. package/dist/callbacks/subscriptions/postTNTUpdate.d.ts +5 -0
  105. package/dist/callbacks/subscriptions/postTNTUpdate.lua +24 -0
  106. package/dist/callbacks/subscriptions/preBerserkDeath.d.ts +3 -2
  107. package/dist/callbacks/subscriptions/preBerserkDeath.lua +5 -0
  108. package/dist/callbacks/subscriptions/preCustomRevive.d.ts +4 -2
  109. package/dist/callbacks/subscriptions/preCustomRevive.lua +15 -3
  110. package/dist/callbacks/subscriptions/preItemPickup.d.ts +9 -5
  111. package/dist/callbacks/subscriptions/preItemPickup.lua +2 -2
  112. package/dist/classes/DefaultMap.d.ts +8 -8
  113. package/dist/classes/DefaultMap.lua +3 -3
  114. package/dist/constants.d.ts +3 -2
  115. package/dist/constants.lua +2 -2
  116. package/dist/constantsMax.d.ts +15 -9
  117. package/dist/constantsMax.lua +7 -1
  118. package/dist/enums/ModCallbackCustom.d.ts +69 -54
  119. package/dist/enums/ModCallbackCustom.lua +84 -54
  120. package/dist/features/debugDisplay.d.ts +7 -0
  121. package/dist/features/debugDisplay.lua +117 -14
  122. package/dist/features/deployJSONRoom.lua +2 -2
  123. package/dist/features/extraConsoleCommands/commands.lua +32 -27
  124. package/dist/features/extraConsoleCommands/commandsDisplay.d.ts +63 -0
  125. package/dist/features/extraConsoleCommands/commandsDisplay.lua +49 -0
  126. package/dist/features/extraConsoleCommands/init.d.ts +2 -2
  127. package/dist/features/extraConsoleCommands/init.lua +12 -1
  128. package/dist/features/getCollectibleItemPoolType.lua +3 -2
  129. package/dist/features/playerInventory.lua +6 -6
  130. package/dist/features/preventCollectibleRotate.lua +7 -2
  131. package/dist/functions/array.lua +1 -1
  132. package/dist/functions/boss.d.ts +2 -3
  133. package/dist/functions/cards.lua +3 -1
  134. package/dist/functions/character.lua +2 -2
  135. package/dist/functions/charge.d.ts +6 -6
  136. package/dist/functions/collectibleCacheFlag.lua +3 -1
  137. package/dist/functions/collectibleSet.lua +3 -1
  138. package/dist/functions/collectibleTag.lua +3 -1
  139. package/dist/functions/collectibles.d.ts +1 -0
  140. package/dist/functions/collectibles.lua +32 -16
  141. package/dist/functions/entity.d.ts +1 -1
  142. package/dist/functions/entitySpecific.d.ts +4 -5
  143. package/dist/functions/entityTypes.d.ts +5 -0
  144. package/dist/functions/entityTypes.lua +10 -0
  145. package/dist/functions/familiars.d.ts +3 -3
  146. package/dist/functions/gridEntity.d.ts +0 -5
  147. package/dist/functions/gridEntity.lua +0 -14
  148. package/dist/functions/gridEntitySpecific.d.ts +18 -0
  149. package/dist/functions/gridEntitySpecific.lua +88 -0
  150. package/dist/functions/log.lua +2 -3
  151. package/dist/functions/npc.lua +3 -1
  152. package/dist/functions/npcTypes.d.ts +3 -0
  153. package/dist/functions/npcTypes.lua +7 -0
  154. package/dist/functions/pickupVariants.d.ts +13 -0
  155. package/dist/functions/pickupVariants.lua +22 -0
  156. package/dist/functions/pickups.lua +3 -1
  157. package/dist/functions/player.d.ts +7 -0
  158. package/dist/functions/player.lua +20 -9
  159. package/dist/functions/playerIndex.d.ts +2 -2
  160. package/dist/functions/rooms.d.ts +2 -3
  161. package/dist/functions/rooms.lua +5 -3
  162. package/dist/functions/run.lua +3 -1
  163. package/dist/functions/stage.d.ts +1 -1
  164. package/dist/functions/stage.lua +6 -5
  165. package/dist/functions/trinketCacheFlag.lua +3 -1
  166. package/dist/functions/trinketSet.lua +3 -1
  167. package/dist/functions/trinkets.lua +7 -3
  168. package/dist/index.d.ts +3 -0
  169. package/dist/index.lua +24 -0
  170. package/dist/initCustomCallbacks.lua +42 -0
  171. package/dist/initFeatures.lua +0 -3
  172. package/dist/maps/cardMap.lua +204 -202
  173. package/dist/maps/pillEffectMap.lua +82 -80
  174. package/dist/objects/callbackRegisterFunctions.lua +45 -0
  175. package/dist/objects/cardDescriptions.lua +1 -1
  176. package/dist/objects/cardNames.lua +1 -1
  177. package/dist/objects/cardTypes.lua +1 -1
  178. package/dist/types/AddCallbackParameterCustom.d.ts +30 -0
  179. package/dist/types/PickingUpItem.d.ts +2 -0
  180. package/dist/types/PickingUpItem.lua +10 -0
  181. package/dist/types/private/TSTLClassMetatable.d.ts +1 -1
  182. package/package.json +3 -3
@@ -1,13 +1,13 @@
1
1
  local ____lualib = require("lualib_bundle")
2
2
  local Map = ____lualib.Map
3
3
  local __TS__StringSplit = ____lualib.__TS__StringSplit
4
+ local __TS__ArrayFilter = ____lualib.__TS__ArrayFilter
4
5
  local __TS__StringSlice = ____lualib.__TS__StringSlice
5
6
  local __TS__ArrayIncludes = ____lualib.__TS__ArrayIncludes
6
7
  local ____exports = {}
7
8
  local ____isaac_2Dtypescript_2Ddefinitions = require("isaac-typescript-definitions")
8
9
  local ActiveSlot = ____isaac_2Dtypescript_2Ddefinitions.ActiveSlot
9
10
  local CacheFlag = ____isaac_2Dtypescript_2Ddefinitions.CacheFlag
10
- local Card = ____isaac_2Dtypescript_2Ddefinitions.Card
11
11
  local CollectibleType = ____isaac_2Dtypescript_2Ddefinitions.CollectibleType
12
12
  local Direction = ____isaac_2Dtypescript_2Ddefinitions.Direction
13
13
  local DisplayFlag = ____isaac_2Dtypescript_2Ddefinitions.DisplayFlag
@@ -19,24 +19,30 @@ local ____cachedClasses = require("cachedClasses")
19
19
  local game = ____cachedClasses.game
20
20
  local sfxManager = ____cachedClasses.sfxManager
21
21
  local ____constants = require("constants")
22
+ local FIRST_ROOM_TYPE = ____constants.FIRST_ROOM_TYPE
23
+ local FIRST_STAGE = ____constants.FIRST_STAGE
22
24
  local MAX_LEVEL_GRID_INDEX = ____constants.MAX_LEVEL_GRID_INDEX
23
25
  local MAX_ROOM_TYPE = ____constants.MAX_ROOM_TYPE
24
26
  local MAX_STAGE = ____constants.MAX_STAGE
25
- local MAX_VANILLA_CHARACTER = ____constants.MAX_VANILLA_CHARACTER
26
27
  local ____constantsMax = require("constantsMax")
28
+ local FIRST_CARD = ____constantsMax.FIRST_CARD
29
+ local FIRST_CHARACTER = ____constantsMax.FIRST_CHARACTER
30
+ local FIRST_PILL_EFFECT = ____constantsMax.FIRST_PILL_EFFECT
27
31
  local MAX_CARD = ____constantsMax.MAX_CARD
28
32
  local MAX_PILL_EFFECT = ____constantsMax.MAX_PILL_EFFECT
33
+ local MAX_VANILLA_CHARACTER = ____constantsMax.MAX_VANILLA_CHARACTER
29
34
  local ____HealthType = require("enums.HealthType")
30
35
  local HealthType = ____HealthType.HealthType
31
36
  local ____cards = require("functions.cards")
32
37
  local getCardName = ____cards.getCardName
33
38
  local ____character = require("functions.character")
34
39
  local getCharacterName = ____character.getCharacterName
40
+ local ____collectibles = require("functions.collectibles")
41
+ local isValidCollectibleType = ____collectibles.isValidCollectibleType
35
42
  local ____entitySpecific = require("functions.entitySpecific")
36
43
  local getNPCs = ____entitySpecific.getNPCs
37
44
  local ____enums = require("functions.enums")
38
45
  local getEnumValues = ____enums.getEnumValues
39
- local getLastEnumValue = ____enums.getLastEnumValue
40
46
  local ____flag = require("functions.flag")
41
47
  local addFlag = ____flag.addFlag
42
48
  local ____log = require("functions.log")
@@ -51,7 +57,6 @@ local spawnCard = ____pickups.spawnCard
51
57
  local spawnPill = ____pickups.spawnPill
52
58
  local spawnTrinket = ____pickups.spawnTrinket
53
59
  local ____pills = require("functions.pills")
54
- local getHorsePillColor = ____pills.getHorsePillColor
55
60
  local getPillEffectName = ____pills.getPillEffectName
56
61
  local ____player = require("functions.player")
57
62
  local getPlayerName = ____player.getPlayerName
@@ -277,7 +282,7 @@ function ____exports.card(self, params)
277
282
  end
278
283
  cardNum = match[2]
279
284
  else
280
- if num <= Card.NULL or num > MAX_CARD then
285
+ if num < FIRST_CARD or num > MAX_CARD then
281
286
  printConsole(
282
287
  nil,
283
288
  "Invalid card sub-type: " .. tostring(num)
@@ -332,7 +337,7 @@ function ____exports.characterCommand(self, params)
332
337
  end
333
338
  character = match[2]
334
339
  else
335
- if num < 0 or num > MAX_VANILLA_CHARACTER then
340
+ if num < FIRST_CHARACTER or num > MAX_VANILLA_CHARACTER then
336
341
  printConsole(
337
342
  nil,
338
343
  "Invalid player sub-type: " .. tostring(num)
@@ -554,7 +559,7 @@ function ____exports.pill(self, params)
554
559
  end
555
560
  pillEffect = match[2]
556
561
  else
557
- if num < 0 or num > MAX_PILL_EFFECT then
562
+ if num < FIRST_PILL_EFFECT or num > MAX_PILL_EFFECT then
558
563
  printConsole(
559
564
  nil,
560
565
  "Invalid pill effect ID: " .. tostring(num)
@@ -571,27 +576,24 @@ function ____exports.pill(self, params)
571
576
  )
572
577
  end
573
578
  function ____exports.pills(self)
574
- local maxPillColor = getLastEnumValue(nil, PillColor)
575
- local pillColor = 1
576
- local horse = false
579
+ local pillColors = __TS__ArrayFilter(
580
+ getEnumValues(nil, PillColor),
581
+ function(____, pillColor) return pillColor ~= PillColor.NULL end
582
+ )
583
+ local pillColorIndex = -1
577
584
  do
578
585
  local y = 0
579
586
  while y <= 6 do
580
587
  do
581
588
  local x = 0
582
589
  while x <= 12 do
583
- if pillColor == maxPillColor then
584
- if horse then
585
- return
586
- end
587
- horse = true
588
- pillColor = 1
590
+ pillColorIndex = pillColorIndex + 1
591
+ local pillColor = pillColors[pillColorIndex + 1]
592
+ if pillColor == nil then
593
+ return
589
594
  end
590
- local horsePillColor = getHorsePillColor(nil, pillColor)
591
- local pillColorToUse = horse and horsePillColor or pillColor
592
595
  local position = gridCoordinatesToWorldPosition(nil, x, y)
593
- spawnPill(nil, pillColorToUse, position)
594
- pillColor = pillColor + 1
596
+ spawnPill(nil, pillColor, position)
595
597
  x = x + 1
596
598
  end
597
599
  end
@@ -610,13 +612,17 @@ function ____exports.pocket(self, params)
610
612
  printConsole(nil, "You must supply a collectible type to put as the pocket item.")
611
613
  return
612
614
  end
613
- local num = tonumber(params)
614
- if num == nil then
615
+ local collectibleType = tonumber(params)
616
+ if collectibleType == nil then
617
+ printConsole(nil, "That is an invalid collectible type.")
618
+ return
619
+ end
620
+ if not isValidCollectibleType(nil, collectibleType) then
615
621
  printConsole(nil, "That is an invalid collectible type.")
616
622
  return
617
623
  end
618
624
  local player = Isaac.GetPlayer()
619
- player:SetPocketActiveItem(num, ActiveSlot.POCKET)
625
+ player:SetPocketActiveItem(collectibleType, ActiveSlot.POCKET)
620
626
  end
621
627
  function ____exports.poopMana(self, params)
622
628
  local charges = 1
@@ -672,11 +678,10 @@ function ____exports.s(self, params)
672
678
  )
673
679
  return
674
680
  end
675
- local minStage = 1
676
- if stage < minStage or stage > MAX_STAGE then
681
+ if stage < FIRST_STAGE or stage > MAX_STAGE then
677
682
  printConsole(
678
683
  nil,
679
- ((("Invalid stage number; must be between " .. tostring(minStage)) .. " and ") .. tostring(MAX_STAGE)) .. "."
684
+ ((("Invalid stage number; must be between " .. tostring(FIRST_STAGE)) .. " and ") .. tostring(MAX_STAGE)) .. "."
680
685
  )
681
686
  return
682
687
  end
@@ -877,7 +882,7 @@ function ____exports.warp(self, params)
877
882
  end
878
883
  roomType = match[2]
879
884
  else
880
- if num < 1 or num > MAX_ROOM_TYPE then
885
+ if num < FIRST_ROOM_TYPE or num > MAX_ROOM_TYPE then
881
886
  printConsole(
882
887
  nil,
883
888
  "Invalid room type: " .. tostring(num)
@@ -7,6 +7,15 @@
7
7
  export declare function bombDisplay(): void;
8
8
  /** Alias for the "bombdisplay" command. */
9
9
  export declare function bombsDisplay(): void;
10
+ /**
11
+ * Toggles custom text to appear next to every door. Useful for debugging.
12
+ *
13
+ * By default, the grid entity ID will be displayed. Use the `setDoorDisplay` helper function to
14
+ * assign the text that you want to appear.
15
+ */
16
+ export declare function doorDisplay(): void;
17
+ /** Alias for the "doordisplay" function. */
18
+ export declare function doorsDisplay(): void;
10
19
  /**
11
20
  * Toggles custom text to appear next to every effect. Useful for debugging.
12
21
  *
@@ -61,6 +70,15 @@ export declare function npcsDisplay(): void;
61
70
  export declare function pickupDisplay(): void;
62
71
  /** Alias for the "pickupdisplay" command. */
63
72
  export declare function pickupsDisplay(): void;
73
+ /**
74
+ * Toggles custom text to appear next to every pit. Useful for debugging.
75
+ *
76
+ * By default, the grid entity ID will be displayed. Use the `setPitDisplay` helper function to
77
+ * assign the text that you want to appear.
78
+ */
79
+ export declare function pitDisplay(): void;
80
+ /** Alias for the "pitdisplay" function. */
81
+ export declare function pitsDisplay(): void;
64
82
  /**
65
83
  * Toggles custom text to appear next to every player. Useful for debugging.
66
84
  *
@@ -70,6 +88,24 @@ export declare function pickupsDisplay(): void;
70
88
  export declare function playerDisplay(): void;
71
89
  /** Alias for the "playerdisplay" command. */
72
90
  export declare function playersDisplay(): void;
91
+ /**
92
+ * Toggles custom text to appear next to every poop. Useful for debugging.
93
+ *
94
+ * By default, the grid entity ID will be displayed. Use the `setPoopDisplay` helper function to
95
+ * assign the text that you want to appear.
96
+ */
97
+ export declare function poopDisplay(): void;
98
+ /** Alias for the "poopdisplay" function. */
99
+ export declare function poopsDisplay(): void;
100
+ /**
101
+ * Toggles custom text to appear next to every pressure plate. Useful for debugging.
102
+ *
103
+ * By default, the grid entity ID will be displayed. Use the `setPressurePlateDisplay` helper
104
+ * function to assign the text that you want to appear.
105
+ */
106
+ export declare function pressurePlateDisplay(): void;
107
+ /** Alias for the "pressureplatedisplay" function. */
108
+ export declare function pressurePlatesDisplay(): void;
73
109
  /**
74
110
  * Toggles custom text to appear next to every projectile. Useful for debugging.
75
111
  *
@@ -79,6 +115,15 @@ export declare function playersDisplay(): void;
79
115
  export declare function projectileDisplay(): void;
80
116
  /** Alias for the "projectiledisplay" command. */
81
117
  export declare function projectilesDisplay(): void;
118
+ /**
119
+ * Toggles custom text to appear next to every rock. Useful for debugging.
120
+ *
121
+ * By default, the grid entity ID will be displayed. Use the `setRockDisplay` helper function to
122
+ * assign the text that you want to appear.
123
+ */
124
+ export declare function rockDisplay(): void;
125
+ /** Alias for the "rockdisplay" function. */
126
+ export declare function rocksDisplay(): void;
82
127
  /**
83
128
  * Toggles custom text to appear next to every slot. Useful for debugging.
84
129
  *
@@ -88,6 +133,15 @@ export declare function projectilesDisplay(): void;
88
133
  export declare function slotDisplay(): void;
89
134
  /** Alias for the "slotdisplay" command. */
90
135
  export declare function slotsDisplay(): void;
136
+ /** Alias for the "spikesdisplay" function. */
137
+ export declare function spikeDisplay(): void;
138
+ /**
139
+ * Toggles custom text to appear next to every spikes. Useful for debugging.
140
+ *
141
+ * By default, the grid entity ID will be displayed. Use the `setSpikesDisplay` helper function to
142
+ * assign the text that you want to appear.
143
+ */
144
+ export declare function spikesDisplay(): void;
91
145
  /**
92
146
  * Toggles custom text to appear next to every tear. Useful for debugging.
93
147
  *
@@ -97,3 +151,12 @@ export declare function slotsDisplay(): void;
97
151
  export declare function tearDisplay(): void;
98
152
  /** Alias for the "teardisplay" command. */
99
153
  export declare function tearsDisplay(): void;
154
+ /**
155
+ * Toggles custom text to appear next to every TNT. Useful for debugging.
156
+ *
157
+ * By default, the grid entity ID will be displayed. Use the `setTNTDisplay` helper function to
158
+ * assign the text that you want to appear.
159
+ */
160
+ export declare function tntDisplay(): void;
161
+ /** Alias for the "tntdisplay" function. */
162
+ export declare function tntsDisplay(): void;
@@ -1,22 +1,38 @@
1
1
  local ____exports = {}
2
2
  local ____debugDisplay = require("features.debugDisplay")
3
3
  local toggleBombDisplay = ____debugDisplay.toggleBombDisplay
4
+ local toggleDoorDisplay = ____debugDisplay.toggleDoorDisplay
4
5
  local toggleEffectDisplay = ____debugDisplay.toggleEffectDisplay
5
6
  local toggleFamiliarDisplay = ____debugDisplay.toggleFamiliarDisplay
6
7
  local toggleKnifeDisplay = ____debugDisplay.toggleKnifeDisplay
7
8
  local toggleLaserDisplay = ____debugDisplay.toggleLaserDisplay
8
9
  local toggleNPCDisplay = ____debugDisplay.toggleNPCDisplay
9
10
  local togglePickupDisplay = ____debugDisplay.togglePickupDisplay
11
+ local togglePitDisplay = ____debugDisplay.togglePitDisplay
10
12
  local togglePlayerDisplay = ____debugDisplay.togglePlayerDisplay
13
+ local togglePoopDisplay = ____debugDisplay.togglePoopDisplay
14
+ local togglePressurePlateDisplay = ____debugDisplay.togglePressurePlateDisplay
11
15
  local toggleProjectileDisplay = ____debugDisplay.toggleProjectileDisplay
16
+ local toggleRockDisplay = ____debugDisplay.toggleRockDisplay
12
17
  local toggleSlotDisplay = ____debugDisplay.toggleSlotDisplay
18
+ local toggleSpikesDisplay = ____debugDisplay.toggleSpikesDisplay
13
19
  local toggleTearDisplay = ____debugDisplay.toggleTearDisplay
20
+ local toggleTNTDisplay = ____debugDisplay.toggleTNTDisplay
21
+ function ____exports.spikesDisplay(self)
22
+ toggleSpikesDisplay(nil)
23
+ end
14
24
  function ____exports.bombDisplay(self)
15
25
  toggleBombDisplay(nil)
16
26
  end
17
27
  function ____exports.bombsDisplay(self)
18
28
  ____exports.bombDisplay(nil)
19
29
  end
30
+ function ____exports.doorDisplay(self)
31
+ toggleDoorDisplay(nil)
32
+ end
33
+ function ____exports.doorsDisplay(self)
34
+ ____exports.doorDisplay(nil)
35
+ end
20
36
  function ____exports.effectDisplay(self)
21
37
  toggleEffectDisplay(nil)
22
38
  end
@@ -53,28 +69,61 @@ end
53
69
  function ____exports.pickupsDisplay(self)
54
70
  ____exports.pickupDisplay(nil)
55
71
  end
72
+ function ____exports.pitDisplay(self)
73
+ togglePitDisplay(nil)
74
+ end
75
+ function ____exports.pitsDisplay(self)
76
+ ____exports.pitDisplay(nil)
77
+ end
56
78
  function ____exports.playerDisplay(self)
57
79
  togglePlayerDisplay(nil)
58
80
  end
59
81
  function ____exports.playersDisplay(self)
60
82
  ____exports.playerDisplay(nil)
61
83
  end
84
+ function ____exports.poopDisplay(self)
85
+ togglePoopDisplay(nil)
86
+ end
87
+ function ____exports.poopsDisplay(self)
88
+ ____exports.poopDisplay(nil)
89
+ end
90
+ function ____exports.pressurePlateDisplay(self)
91
+ togglePressurePlateDisplay(nil)
92
+ end
93
+ function ____exports.pressurePlatesDisplay(self)
94
+ ____exports.pressurePlateDisplay(nil)
95
+ end
62
96
  function ____exports.projectileDisplay(self)
63
97
  toggleProjectileDisplay(nil)
64
98
  end
65
99
  function ____exports.projectilesDisplay(self)
66
100
  ____exports.projectileDisplay(nil)
67
101
  end
102
+ function ____exports.rockDisplay(self)
103
+ toggleRockDisplay(nil)
104
+ end
105
+ function ____exports.rocksDisplay(self)
106
+ ____exports.rockDisplay(nil)
107
+ end
68
108
  function ____exports.slotDisplay(self)
69
109
  toggleSlotDisplay(nil)
70
110
  end
71
111
  function ____exports.slotsDisplay(self)
72
112
  ____exports.slotDisplay(nil)
73
113
  end
114
+ function ____exports.spikeDisplay(self)
115
+ ____exports.spikesDisplay(nil)
116
+ end
74
117
  function ____exports.tearDisplay(self)
75
118
  toggleTearDisplay(nil)
76
119
  end
77
120
  function ____exports.tearsDisplay(self)
78
121
  ____exports.tearDisplay(nil)
79
122
  end
123
+ function ____exports.tntDisplay(self)
124
+ toggleTNTDisplay(nil)
125
+ end
126
+ function ____exports.tntsDisplay(self)
127
+ ____exports.tntDisplay(nil)
128
+ end
80
129
  return ____exports
@@ -1,9 +1,9 @@
1
- /// <reference types="isaac-typescript-definitions" />
1
+ import { ModUpgraded } from "../../classes/ModUpgraded";
2
2
  /**
3
3
  * Enables extra console commands which are useful for debugging. See the `isaacscript-common`
4
4
  * documentation for details on the commands that are added.
5
5
  */
6
- export declare function enableExtraConsoleCommands(mod: Mod): void;
6
+ export declare function enableExtraConsoleCommands(mod: ModUpgraded): void;
7
7
  /**
8
8
  * Helper function to add a custom console command.
9
9
  *
@@ -16,6 +16,8 @@ local ____map = require("functions.map")
16
16
  local getMapPartialMatch = ____map.getMapPartialMatch
17
17
  local ____utils = require("functions.utils")
18
18
  local printConsole = ____utils.printConsole
19
+ local ____debugDisplay = require("features.debugDisplay")
20
+ local debugDisplayInit = ____debugDisplay.debugDisplayInit
19
21
  local ____exports = require("features.saveDataManager.exports")
20
22
  local saveDataManager = ____exports.saveDataManager
21
23
  local commands = require("features.extraConsoleCommands.commands")
@@ -74,6 +76,7 @@ initialized = false
74
76
  function ____exports.enableExtraConsoleCommands(self, mod)
75
77
  initialized = true
76
78
  saveDataManager(nil, "extraConsoleCommands", v, featureEnabled)
79
+ debugDisplayInit(nil, mod)
77
80
  mod:AddCallback(ModCallback.POST_UPDATE, postUpdate)
78
81
  mod:AddCallback(ModCallback.EVALUATE_CACHE, evaluateCacheFireDelay, CacheFlag.FIRE_DELAY)
79
82
  mod:AddCallback(ModCallback.EVALUATE_CACHE, evaluateCacheSpeed, CacheFlag.SPEED)
@@ -135,6 +138,8 @@ commandFunctionsMap:set("dd", commands.dd)
135
138
  commandFunctionsMap:set("devil", commands.devil)
136
139
  commandFunctionsMap:set("dirtybedroom", commands.dirtyBedroom)
137
140
  commandFunctionsMap:set("disablecurses", commands.disableCurses)
141
+ commandFunctionsMap:set("doordisplay", commandsDisplay.doorDisplay)
142
+ commandFunctionsMap:set("doorsdisplay", commandsDisplay.doorsDisplay)
138
143
  commandFunctionsMap:set("down", commands.down)
139
144
  commandFunctionsMap:set("dungeon", commands.dungeon)
140
145
  commandFunctionsMap:set("effectdisplay", commandsDisplay.effectDisplay)
@@ -185,18 +190,22 @@ commandFunctionsMap:set("pickupdisplay", commandsDisplay.pickupDisplay)
185
190
  commandFunctionsMap:set("pickupsdisplay", commandsDisplay.pickupsDisplay)
186
191
  commandFunctionsMap:set("pill", commands.pill)
187
192
  commandFunctionsMap:set("pills", commands.pills)
193
+ commandFunctionsMap:set("pitdisplay", commandsDisplay.pitDisplay)
188
194
  commandFunctionsMap:set("planetarium", commands.planetarium)
189
195
  commandFunctionsMap:set("playerdisplay", commandsDisplay.playerDisplay)
190
196
  commandFunctionsMap:set("playersdisplay", commandsDisplay.playersDisplay)
191
197
  commandFunctionsMap:set("playsound", commands.playSound)
192
198
  commandFunctionsMap:set("pocket", commands.pocket)
193
- commandFunctionsMap:set("poopMana", commands.poopMana)
199
+ commandFunctionsMap:set("poopdisplay", commandsDisplay.poopDisplay)
200
+ commandFunctionsMap:set("poopmana", commands.poopMana)
194
201
  commandFunctionsMap:set("position", commands.positionCommand)
202
+ commandFunctionsMap:set("pressureplatedisplay", commandsDisplay.pressurePlateDisplay)
195
203
  commandFunctionsMap:set("projectiledisplay", commandsDisplay.projectileDisplay)
196
204
  commandFunctionsMap:set("projectilesdisplay", commandsDisplay.projectilesDisplay)
197
205
  commandFunctionsMap:set("redhearts", commands.redHearts)
198
206
  commandFunctionsMap:set("rh", commands.rh)
199
207
  commandFunctionsMap:set("right", commands.right)
208
+ commandFunctionsMap:set("rockdisplay", commandsDisplay.rockDisplay)
200
209
  commandFunctionsMap:set("room", commands.roomCommand)
201
210
  commandFunctionsMap:set("rottenhearts", commands.rottenHearts)
202
211
  commandFunctionsMap:set("s", commands.s)
@@ -218,11 +227,13 @@ commandFunctionsMap:set("sounds", commands.sounds)
218
227
  commandFunctionsMap:set("spam", commands.spam)
219
228
  commandFunctionsMap:set("spawngoldentrinket", commands.spawnGoldenTrinket)
220
229
  commandFunctionsMap:set("speed", commands.speed)
230
+ commandFunctionsMap:set("spikesdisplay", commandsDisplay.spikesDisplay)
221
231
  commandFunctionsMap:set("supersecret", commands.superSecret)
222
232
  commandFunctionsMap:set("startingroom", commands.startingRoom)
223
233
  commandFunctionsMap:set("teardisplay", commandsDisplay.tearDisplay)
224
234
  commandFunctionsMap:set("tears", commands.tears)
225
235
  commandFunctionsMap:set("tearsdisplay", commandsDisplay.tearsDisplay)
236
+ commandFunctionsMap:set("tntdisplay", commandsDisplay.tntDisplay)
226
237
  commandFunctionsMap:set("trapdoor", commands.trapdoorCommand)
227
238
  commandFunctionsMap:set("treasure", commands.treasure)
228
239
  commandFunctionsMap:set("ultrasecret", commands.ultraSecret)
@@ -4,7 +4,6 @@ local __TS__New = ____lualib.__TS__New
4
4
  local ____exports = {}
5
5
  local postPickupInitCollectible, v
6
6
  local ____isaac_2Dtypescript_2Ddefinitions = require("isaac-typescript-definitions")
7
- local EntityType = ____isaac_2Dtypescript_2Ddefinitions.EntityType
8
7
  local ModCallback = ____isaac_2Dtypescript_2Ddefinitions.ModCallback
9
8
  local PickupVariant = ____isaac_2Dtypescript_2Ddefinitions.PickupVariant
10
9
  local ____cachedClasses = require("cachedClasses")
@@ -13,6 +12,8 @@ local ____featuresInitialized = require("featuresInitialized")
13
12
  local errorIfFeaturesNotInitialized = ____featuresInitialized.errorIfFeaturesNotInitialized
14
13
  local ____entity = require("functions.entity")
15
14
  local getEntityID = ____entity.getEntityID
15
+ local ____pickupVariants = require("functions.pickupVariants")
16
+ local isCollectible = ____pickupVariants.isCollectible
16
17
  local ____rooms = require("functions.rooms")
17
18
  local getRoomItemPoolType = ____rooms.getRoomItemPoolType
18
19
  local ____exports = require("features.saveDataManager.exports")
@@ -31,7 +32,7 @@ function ____exports.getCollectibleItemPoolTypeInit(self, mod)
31
32
  end
32
33
  function ____exports.getCollectibleItemPoolType(self, collectible)
33
34
  errorIfFeaturesNotInitialized(nil, FEATURE_NAME)
34
- if collectible.Type ~= EntityType.PICKUP or collectible.Variant ~= PickupVariant.COLLECTIBLE then
35
+ if not isCollectible(nil, collectible) then
35
36
  local entityID = getEntityID(nil, collectible)
36
37
  error("The \"getCollectibleItemPoolType\" function was given a non-collectible: " .. entityID)
37
38
  end
@@ -1,13 +1,12 @@
1
1
  local ____lualib = require("lualib_bundle")
2
- local Set = ____lualib.Set
3
2
  local __TS__New = ____lualib.__TS__New
3
+ local Set = ____lualib.Set
4
4
  local __TS__Iterator = ____lualib.__TS__Iterator
5
5
  local __TS__ArrayFilter = ____lualib.__TS__ArrayFilter
6
6
  local ____exports = {}
7
- local newPlayerInventory, useItemD4, postGameStarted, postItemPickup, addCollectibleToInventory, COLLECTIBLE_ITEM_TYPES, v
7
+ local newPlayerInventory, useItemD4, postGameStarted, postItemPickup, addCollectibleToInventory, v
8
8
  local ____isaac_2Dtypescript_2Ddefinitions = require("isaac-typescript-definitions")
9
9
  local CollectibleType = ____isaac_2Dtypescript_2Ddefinitions.CollectibleType
10
- local ItemType = ____isaac_2Dtypescript_2Ddefinitions.ItemType
11
10
  local ModCallback = ____isaac_2Dtypescript_2Ddefinitions.ModCallback
12
11
  local ____DefaultMap = require("classes.DefaultMap")
13
12
  local DefaultMap = ____DefaultMap.DefaultMap
@@ -27,6 +26,8 @@ local getAllPlayers = ____playerIndex.getAllPlayers
27
26
  local getPlayerIndex = ____playerIndex.getPlayerIndex
28
27
  local ____utils = require("functions.utils")
29
28
  local ____repeat = ____utils["repeat"]
29
+ local ____PickingUpItem = require("types.PickingUpItem")
30
+ local pickingUpItemIsCollectible = ____PickingUpItem.pickingUpItemIsCollectible
30
31
  local ____exports = require("features.saveDataManager.exports")
31
32
  local saveDataManager = ____exports.saveDataManager
32
33
  function newPlayerInventory(self, player)
@@ -59,7 +60,7 @@ function postGameStarted(self)
59
60
  end
60
61
  end
61
62
  function postItemPickup(self, player, pickingUpItem)
62
- if not COLLECTIBLE_ITEM_TYPES:has(pickingUpItem.itemType) then
63
+ if not pickingUpItemIsCollectible(nil, pickingUpItem) then
63
64
  return
64
65
  end
65
66
  addCollectibleToInventory(nil, player, pickingUpItem.subType)
@@ -83,11 +84,10 @@ function addCollectibleToInventory(self, player, collectibleType)
83
84
  end
84
85
  end
85
86
  local FEATURE_NAME = "player inventory tracker"
86
- COLLECTIBLE_ITEM_TYPES = __TS__New(Set, {ItemType.PASSIVE, ItemType.ACTIVE, ItemType.FAMILIAR})
87
87
  v = {run = {
88
88
  playersInventory = __TS__New(
89
89
  DefaultMap,
90
- function(____, _key, player) return newPlayerInventory(nil, player) end
90
+ function(____, player) return newPlayerInventory(nil, player) end
91
91
  ),
92
92
  playersActiveCollectibleTypes = __TS__New(
93
93
  DefaultMap,
@@ -14,6 +14,10 @@ local ____featuresInitialized = require("featuresInitialized")
14
14
  local errorIfFeaturesNotInitialized = ____featuresInitialized.errorIfFeaturesNotInitialized
15
15
  local ____collectibles = require("functions.collectibles")
16
16
  local setCollectibleSubType = ____collectibles.setCollectibleSubType
17
+ local ____entity = require("functions.entity")
18
+ local getEntityID = ____entity.getEntityID
19
+ local ____pickupVariants = require("functions.pickupVariants")
20
+ local isCollectible = ____pickupVariants.isCollectible
17
21
  local ____exports = require("features.saveDataManager.exports")
18
22
  local saveDataManager = ____exports.saveDataManager
19
23
  function useCardSoulOfIsaac(self)
@@ -43,8 +47,9 @@ function ____exports.preventCollectibleRotateInit(self, mod)
43
47
  end
44
48
  function ____exports.preventCollectibleRotate(self, collectible, collectibleType)
45
49
  errorIfFeaturesNotInitialized(nil, FEATURE_NAME)
46
- if collectible.Variant ~= PickupVariant.COLLECTIBLE then
47
- error("You cannot prevent the rotation for pickups of variant: " .. tostring(collectible.Variant))
50
+ if not isCollectible(nil, collectible) then
51
+ local entityID = getEntityID(nil, collectible)
52
+ error("The \"preventCollectibleRotate\" function was given a non-collectible: " .. entityID)
48
53
  end
49
54
  local index = getMapIndex(nil, collectible)
50
55
  v.room.trackedCollectibles:set(index, collectibleType)
@@ -235,7 +235,7 @@ function ____exports.isArray(self, object)
235
235
  return true
236
236
  end
237
237
  function ____exports.isArrayContiguous(self, array)
238
- local lastValue = nil
238
+ local lastValue
239
239
  for ____, element in ipairs(array) do
240
240
  if lastValue == nil then
241
241
  lastValue = element - 1
@@ -1,5 +1,4 @@
1
1
  import { EntityType, StageType } from "isaac-typescript-definitions";
2
- import { EntityTypeNonNPC } from "../types/EntityTypeNonNPC";
3
2
  /**
4
3
  * Helper function to get all of the non-dead bosses in the room.
5
4
  *
@@ -48,10 +47,10 @@ export declare function isSin(npc: EntityNPC): boolean;
48
47
  * Gurglings/Turdlings with 2 copies, and other multi-segment bosses with 4 segments. You can
49
48
  * customize this via the "numSegments" argument.
50
49
  */
51
- export declare function spawnBoss<T extends number>(entityType: T extends EntityTypeNonNPC ? never : T, variant: int, subType: int, position: Vector, velocity?: Readonly<Vector>, spawner?: Entity | undefined, seed?: Seed | undefined, numSegments?: int): EntityNPC;
50
+ export declare function spawnBoss(entityType: EntityType, variant: int, subType: int, position: Vector, velocity?: Readonly<Vector>, spawner?: Entity | undefined, seed?: Seed | undefined, numSegments?: int): EntityNPC;
52
51
  /**
53
52
  * Helper function to spawn a boss with a specific seed.
54
53
  *
55
54
  * For more information, see the documentation for the `spawnBoss` function.
56
55
  */
57
- export declare function spawnBossWithSeed<T extends number>(entityType: T extends EntityTypeNonNPC ? never : T, variant: int, subType: int, position: Vector, seed: Seed, velocity?: Readonly<Vector>, spawner?: Entity | undefined, numSegments?: int): EntityNPC;
56
+ export declare function spawnBossWithSeed(entityType: EntityType, variant: int, subType: int, position: Vector, seed: Seed, velocity?: Readonly<Vector>, spawner?: Entity | undefined, numSegments?: int): EntityNPC;
@@ -11,6 +11,7 @@ local ItemConfigCardType = ____isaac_2Dtypescript_2Ddefinitions.ItemConfigCardTy
11
11
  local ____cachedClasses = require("cachedClasses")
12
12
  local itemConfig = ____cachedClasses.itemConfig
13
13
  local ____constantsMax = require("constantsMax")
14
+ local FIRST_CARD = ____constantsMax.FIRST_CARD
14
15
  local MAX_CARD = ____constantsMax.MAX_CARD
15
16
  local ____cardDescriptions = require("objects.cardDescriptions")
16
17
  local CARD_DESCRIPTIONS = ____cardDescriptions.CARD_DESCRIPTIONS
@@ -37,7 +38,8 @@ function initCardObjects(self)
37
38
  __TS__New(Set)
38
39
  )
39
40
  end
40
- for ____, card in ipairs(irange(nil, 1, MAX_CARD)) do
41
+ for ____, cardInt in ipairs(irange(nil, FIRST_CARD, MAX_CARD)) do
42
+ local card = cardInt
41
43
  local cardType = ____exports.getCardType(nil, card)
42
44
  local cardTypeSet = CARD_TYPE_TO_CARDS_MAP:get(cardType)
43
45
  if cardTypeSet == nil then
@@ -1,8 +1,8 @@
1
1
  local ____exports = {}
2
2
  local ____isaac_2Dtypescript_2Ddefinitions = require("isaac-typescript-definitions")
3
3
  local PlayerType = ____isaac_2Dtypescript_2Ddefinitions.PlayerType
4
- local ____constants = require("constants")
5
- local MAX_VANILLA_CHARACTER = ____constants.MAX_VANILLA_CHARACTER
4
+ local ____constantsMax = require("constantsMax")
5
+ local MAX_VANILLA_CHARACTER = ____constantsMax.MAX_VANILLA_CHARACTER
6
6
  local ____characterNames = require("objects.characterNames")
7
7
  local CHARACTER_NAMES = ____characterNames.CHARACTER_NAMES
8
8
  local DEFAULT_CHARACTER_NAME = ____characterNames.DEFAULT_CHARACTER_NAME
@@ -10,8 +10,8 @@ import { ActiveSlot } from "isaac-typescript-definitions";
10
10
  *
11
11
  * @param player The player to grant the charges to.
12
12
  * @param ignoreBigRoomDoubleCharge Optional. If set to true, it will treat the current room as a
13
- * 1x1 room for the purposes of calculating how much charge to
14
- * grant. Default is false.
13
+ * 1x1 room for the purposes of calculating how much charge to
14
+ * grant. Default is false.
15
15
  */
16
16
  export declare function addRoomClearCharge(player: EntityPlayer, ignoreBigRoomDoubleCharge?: boolean): void;
17
17
  /**
@@ -26,8 +26,8 @@ export declare function addRoomClearCharge(player: EntityPlayer, ignoreBigRoomDo
26
26
  * @param player The player to grant the charges to.
27
27
  * @param activeSlot The active item slot to grant the charges to.
28
28
  * @param ignoreBigRoomDoubleCharge Optional. If set to true, it will treat the current room as a
29
- * 1x1 room for the purposes of calculating how much charge to
30
- * grant. Default is false.
29
+ * 1x1 room for the purposes of calculating how much charge to
30
+ * grant. Default is false.
31
31
  */
32
32
  export declare function addRoomClearChargeToSlot(player: EntityPlayer, activeSlot: ActiveSlot, ignoreBigRoomDoubleCharge?: boolean): void;
33
33
  /**
@@ -40,8 +40,8 @@ export declare function addRoomClearChargeToSlot(player: EntityPlayer, activeSlo
40
40
  * - AAA Battery
41
41
  *
42
42
  * @param ignoreBigRoomDoubleCharge Optional. If set to true, it will treat the current room as a
43
- * 1x1 room for the purposes of calculating how much charge to
44
- * grant. Default is false.
43
+ * 1x1 room for the purposes of calculating how much charge to
44
+ * grant. Default is false.
45
45
  */
46
46
  export declare function addRoomClearCharges(ignoreBigRoomDoubleCharge?: boolean): void;
47
47
  /**
@@ -6,6 +6,7 @@ local ____exports = {}
6
6
  local ____isaac_2Dtypescript_2Ddefinitions = require("isaac-typescript-definitions")
7
7
  local CacheFlag = ____isaac_2Dtypescript_2Ddefinitions.CacheFlag
8
8
  local ____constantsMax = require("constantsMax")
9
+ local FIRST_COLLECTIBLE_TYPE = ____constantsMax.FIRST_COLLECTIBLE_TYPE
9
10
  local MAX_COLLECTIBLE_TYPE = ____constantsMax.MAX_COLLECTIBLE_TYPE
10
11
  local ____collectibles = require("functions.collectibles")
11
12
  local collectibleHasCacheFlag = ____collectibles.collectibleHasCacheFlag
@@ -21,7 +22,8 @@ local CACHE_FLAG_TO_COLLECTIBLES_MAP = __TS__New(Map)
21
22
  local function initCacheFlagMap(self)
22
23
  for ____, cacheFlag in ipairs(getEnumValues(nil, CacheFlag)) do
23
24
  local collectiblesSet = __TS__New(Set)
24
- for ____, collectibleType in ipairs(irange(nil, 1, MAX_COLLECTIBLE_TYPE)) do
25
+ for ____, collectibleTypeInt in ipairs(irange(nil, FIRST_COLLECTIBLE_TYPE, MAX_COLLECTIBLE_TYPE)) do
26
+ local collectibleType = collectibleTypeInt
25
27
  if collectibleHasCacheFlag(nil, collectibleType, cacheFlag) then
26
28
  collectiblesSet:add(collectibleType)
27
29
  end