isaacscript-common 6.6.3 → 6.7.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.
Files changed (262) hide show
  1. package/dist/callbacks/customRevive.lua +4 -4
  2. package/dist/callbacks/postCursedTeleport.lua +2 -2
  3. package/dist/callbacks/postCustomDoorEnter.d.ts +1 -1
  4. package/dist/callbacks/postCustomDoorEnter.lua +6 -6
  5. package/dist/callbacks/postDiceRoomActivated.lua +2 -2
  6. package/dist/callbacks/postFlip.lua +3 -3
  7. package/dist/callbacks/postGridEntity.lua +3 -3
  8. package/dist/callbacks/postGridEntityCollision.lua +3 -3
  9. package/dist/callbacks/postGridEntityRender.lua +2 -2
  10. package/dist/callbacks/postNewRoomEarly.lua +5 -5
  11. package/dist/callbacks/postPickupCollect.lua +2 -2
  12. package/dist/callbacks/postPitRender.lua +2 -2
  13. package/dist/callbacks/postPitUpdate.lua +2 -2
  14. package/dist/callbacks/postPlayerCollectible.lua +2 -2
  15. package/dist/callbacks/postPoopRender.lua +2 -2
  16. package/dist/callbacks/postPoopUpdate.lua +2 -2
  17. package/dist/callbacks/postPressurePlateRender.lua +2 -2
  18. package/dist/callbacks/postPressurePlateUpdate.lua +2 -2
  19. package/dist/callbacks/postPurchase.lua +2 -2
  20. package/dist/callbacks/postRockRender.lua +2 -2
  21. package/dist/callbacks/postRockUpdate.lua +2 -2
  22. package/dist/callbacks/postSlotInitUpdate.lua +2 -2
  23. package/dist/callbacks/postSlotRender.lua +2 -2
  24. package/dist/callbacks/postSpikesRender.lua +2 -2
  25. package/dist/callbacks/postSpikesUpdate.lua +2 -2
  26. package/dist/callbacks/postTNTRender.lua +2 -2
  27. package/dist/callbacks/postTNTUpdate.lua +2 -2
  28. package/dist/callbacks/preBerserkDeath.lua +2 -2
  29. package/dist/callbacks/preNewLevel.lua +2 -2
  30. package/dist/callbacks/subscriptions/postDoorRender.d.ts +2 -3
  31. package/dist/callbacks/subscriptions/postDoorRender.d.ts.map +1 -1
  32. package/dist/callbacks/subscriptions/postDoorRender.lua +3 -3
  33. package/dist/callbacks/subscriptions/postDoorUpdate.d.ts +2 -3
  34. package/dist/callbacks/subscriptions/postDoorUpdate.d.ts.map +1 -1
  35. package/dist/callbacks/subscriptions/postDoorUpdate.lua +3 -3
  36. package/dist/callbacks/subscriptions/postPitRender.d.ts +2 -3
  37. package/dist/callbacks/subscriptions/postPitRender.d.ts.map +1 -1
  38. package/dist/callbacks/subscriptions/postPitRender.lua +3 -3
  39. package/dist/callbacks/subscriptions/postPitUpdate.d.ts +2 -3
  40. package/dist/callbacks/subscriptions/postPitUpdate.d.ts.map +1 -1
  41. package/dist/callbacks/subscriptions/postPitUpdate.lua +3 -3
  42. package/dist/callbacks/subscriptions/postPoopRender.d.ts +2 -3
  43. package/dist/callbacks/subscriptions/postPoopRender.d.ts.map +1 -1
  44. package/dist/callbacks/subscriptions/postPoopRender.lua +3 -3
  45. package/dist/callbacks/subscriptions/postPoopUpdate.d.ts +2 -3
  46. package/dist/callbacks/subscriptions/postPoopUpdate.d.ts.map +1 -1
  47. package/dist/callbacks/subscriptions/postPoopUpdate.lua +3 -3
  48. package/dist/callbacks/subscriptions/postPressurePlateRender.d.ts +2 -3
  49. package/dist/callbacks/subscriptions/postPressurePlateRender.d.ts.map +1 -1
  50. package/dist/callbacks/subscriptions/postPressurePlateRender.lua +3 -3
  51. package/dist/callbacks/subscriptions/postPressurePlateUpdate.d.ts +2 -3
  52. package/dist/callbacks/subscriptions/postPressurePlateUpdate.d.ts.map +1 -1
  53. package/dist/callbacks/subscriptions/postPressurePlateUpdate.lua +3 -3
  54. package/dist/enums/private/SerializationBrand.d.ts +0 -4
  55. package/dist/enums/private/SerializationBrand.d.ts.map +1 -1
  56. package/dist/features/characterStats.lua +2 -2
  57. package/dist/features/collectibleItemPoolType.lua +2 -2
  58. package/dist/features/customGridEntity.d.ts.map +1 -1
  59. package/dist/features/customGridEntity.lua +5 -5
  60. package/dist/features/customStage/backdrop.lua +2 -2
  61. package/dist/features/customStage/{gridEntities.d.ts → customStageGridEntities.d.ts} +1 -1
  62. package/dist/features/customStage/customStageGridEntities.d.ts.map +1 -0
  63. package/dist/features/customStage/{gridEntities.lua → customStageGridEntities.lua} +8 -8
  64. package/dist/features/customStage/{util.d.ts → customStageUtils.d.ts} +1 -1
  65. package/dist/features/customStage/customStageUtils.d.ts.map +1 -0
  66. package/dist/features/customStage/{util.lua → customStageUtils.lua} +0 -0
  67. package/dist/features/customStage/exports.lua +4 -4
  68. package/dist/features/customStage/init.lua +6 -6
  69. package/dist/features/customStage/shadows.lua +2 -2
  70. package/dist/features/customStage/versusScreen.lua +4 -4
  71. package/dist/features/debugDisplay/v.lua +4 -4
  72. package/dist/features/deployJSONRoom.lua +20 -20
  73. package/dist/features/extraConsoleCommands/commandsSubroutines.lua +3 -3
  74. package/dist/features/extraConsoleCommands/listCommands.d.ts.map +1 -1
  75. package/dist/features/extraConsoleCommands/listCommands.lua +14 -14
  76. package/dist/features/pause.lua +2 -2
  77. package/dist/features/persistentEntities.lua +2 -2
  78. package/dist/features/preventCollectibleRotation.lua +2 -2
  79. package/dist/features/saveDataManager/exports.d.ts.map +1 -1
  80. package/dist/features/saveDataManager/merge.lua +4 -3
  81. package/dist/features/sirenHelpers.lua +2 -2
  82. package/dist/functions/ambush.lua +5 -5
  83. package/dist/functions/array.d.ts.map +1 -1
  84. package/dist/functions/array.lua +1 -1
  85. package/dist/functions/{boss.d.ts → bosses.d.ts} +22 -4
  86. package/dist/functions/bosses.d.ts.map +1 -0
  87. package/dist/functions/{boss.lua → bosses.lua} +38 -13
  88. package/dist/functions/collectibleTag.lua +2 -2
  89. package/dist/functions/collectibles.lua +5 -5
  90. package/dist/functions/deepCopy.d.ts +8 -5
  91. package/dist/functions/deepCopy.d.ts.map +1 -1
  92. package/dist/functions/deepCopy.lua +142 -38
  93. package/dist/functions/deepCopyTests.d.ts +6 -1
  94. package/dist/functions/deepCopyTests.d.ts.map +1 -1
  95. package/dist/functions/deepCopyTests.lua +19 -16
  96. package/dist/functions/{entity.d.ts → entities.d.ts} +21 -19
  97. package/dist/functions/entities.d.ts.map +1 -0
  98. package/dist/functions/{entity.lua → entities.lua} +25 -20
  99. package/dist/functions/{entitySpecific.d.ts → entitiesSpecific.d.ts} +145 -68
  100. package/dist/functions/entitiesSpecific.d.ts.map +1 -0
  101. package/dist/functions/{entitySpecific.lua → entitiesSpecific.lua} +203 -65
  102. package/dist/functions/familiars.lua +2 -2
  103. package/dist/functions/{gridEntity.d.ts → gridEntities.d.ts} +48 -17
  104. package/dist/functions/gridEntities.d.ts.map +1 -0
  105. package/dist/functions/{gridEntity.lua → gridEntities.lua} +140 -90
  106. package/dist/functions/gridEntitiesSpecific.d.ts +141 -0
  107. package/dist/functions/gridEntitiesSpecific.d.ts.map +1 -0
  108. package/dist/functions/gridEntitiesSpecific.lua +366 -0
  109. package/dist/functions/log.d.ts +1 -1
  110. package/dist/functions/log.d.ts.map +1 -1
  111. package/dist/functions/log.lua +16 -12
  112. package/dist/functions/mergeTests.d.ts +7 -1
  113. package/dist/functions/mergeTests.d.ts.map +1 -1
  114. package/dist/functions/mergeTests.lua +86 -7
  115. package/dist/functions/{npc.d.ts → npcs.d.ts} +24 -2
  116. package/dist/functions/npcs.d.ts.map +1 -0
  117. package/dist/functions/{npc.lua → npcs.lua} +44 -9
  118. package/dist/functions/pickups.d.ts +4 -119
  119. package/dist/functions/pickups.d.ts.map +1 -1
  120. package/dist/functions/pickups.lua +10 -439
  121. package/dist/functions/pickupsSpecific.d.ts +229 -0
  122. package/dist/functions/pickupsSpecific.d.ts.map +1 -0
  123. package/dist/functions/pickupsSpecific.lua +560 -0
  124. package/dist/functions/playerHealth.lua +6 -6
  125. package/dist/functions/{player.d.ts → players.d.ts} +1 -1
  126. package/dist/functions/players.d.ts.map +1 -0
  127. package/dist/functions/{player.lua → players.lua} +0 -0
  128. package/dist/functions/pocketItems.lua +2 -2
  129. package/dist/functions/positionVelocity.lua +6 -6
  130. package/dist/functions/pressurePlate.d.ts +10 -0
  131. package/dist/functions/pressurePlate.d.ts.map +1 -0
  132. package/dist/functions/pressurePlate.lua +29 -0
  133. package/dist/functions/revive.lua +7 -7
  134. package/dist/functions/rooms.lua +2 -2
  135. package/dist/functions/saveFile.lua +3 -3
  136. package/dist/functions/spawnCollectible.lua +4 -4
  137. package/dist/functions/{sprite.d.ts → sprites.d.ts} +1 -1
  138. package/dist/functions/sprites.d.ts.map +1 -0
  139. package/dist/functions/{sprite.lua → sprites.lua} +0 -0
  140. package/dist/functions/table.d.ts +1 -1
  141. package/dist/functions/table.lua +1 -1
  142. package/dist/functions/transformations.lua +2 -2
  143. package/dist/functions/trinketGive.lua +2 -2
  144. package/dist/functions/trinkets.lua +6 -6
  145. package/dist/functions/utils.d.ts +7 -0
  146. package/dist/functions/utils.d.ts.map +1 -1
  147. package/dist/functions/utils.lua +35 -22
  148. package/dist/index.d.ts +10 -8
  149. package/dist/index.d.ts.map +1 -1
  150. package/dist/index.lua +26 -10
  151. package/dist/types/AnyGridEntity.d.ts +10 -0
  152. package/dist/types/AnyGridEntity.d.ts.map +1 -0
  153. package/dist/types/AnyGridEntity.lua +2 -0
  154. package/package.json +2 -2
  155. package/src/callbacks/customRevive.ts +2 -2
  156. package/src/callbacks/postCursedTeleport.ts +2 -2
  157. package/src/callbacks/postCustomDoorEnter.ts +3 -3
  158. package/src/callbacks/postDiceRoomActivated.ts +1 -1
  159. package/src/callbacks/postFlip.ts +1 -1
  160. package/src/callbacks/postGridEntity.ts +1 -1
  161. package/src/callbacks/postGridEntityCollision.ts +1 -1
  162. package/src/callbacks/postGridEntityRender.ts +1 -1
  163. package/src/callbacks/postNewRoomEarly.ts +9 -3
  164. package/src/callbacks/postPickupCollect.ts +1 -1
  165. package/src/callbacks/postPitRender.ts +1 -1
  166. package/src/callbacks/postPitUpdate.ts +1 -1
  167. package/src/callbacks/postPlayerCollectible.ts +2 -2
  168. package/src/callbacks/postPoopRender.ts +1 -1
  169. package/src/callbacks/postPoopUpdate.ts +1 -1
  170. package/src/callbacks/postPressurePlateRender.ts +1 -1
  171. package/src/callbacks/postPressurePlateUpdate.ts +1 -1
  172. package/src/callbacks/postPurchase.ts +1 -1
  173. package/src/callbacks/postRockRender.ts +1 -1
  174. package/src/callbacks/postRockUpdate.ts +1 -1
  175. package/src/callbacks/postSacrifice.ts +1 -1
  176. package/src/callbacks/postSlotInitUpdate.ts +1 -1
  177. package/src/callbacks/postSlotRender.ts +1 -1
  178. package/src/callbacks/postSpikesRender.ts +1 -1
  179. package/src/callbacks/postSpikesUpdate.ts +1 -1
  180. package/src/callbacks/postTNTRender.ts +1 -1
  181. package/src/callbacks/postTNTUpdate.ts +1 -1
  182. package/src/callbacks/preBerserkDeath.ts +1 -1
  183. package/src/callbacks/preNewLevel.ts +1 -1
  184. package/src/callbacks/subscriptions/postDoorRender.ts +7 -5
  185. package/src/callbacks/subscriptions/postDoorUpdate.ts +7 -5
  186. package/src/callbacks/subscriptions/postPitRender.ts +6 -7
  187. package/src/callbacks/subscriptions/postPitUpdate.ts +6 -7
  188. package/src/callbacks/subscriptions/postPoopRender.ts +7 -5
  189. package/src/callbacks/subscriptions/postPoopUpdate.ts +7 -5
  190. package/src/callbacks/subscriptions/postPressurePlateRender.ts +7 -5
  191. package/src/callbacks/subscriptions/postPressurePlateUpdate.ts +7 -5
  192. package/src/enums/private/SerializationBrand.ts +0 -4
  193. package/src/features/characterStats.ts +1 -1
  194. package/src/features/collectibleItemPoolType.ts +1 -1
  195. package/src/features/customGridEntity.ts +6 -3
  196. package/src/features/customStage/backdrop.ts +1 -1
  197. package/src/features/customStage/{gridEntities.ts → customStageGridEntities.ts} +3 -3
  198. package/src/features/customStage/{util.ts → customStageUtils.ts} +0 -0
  199. package/src/features/customStage/exports.ts +2 -2
  200. package/src/features/customStage/init.ts +1 -1
  201. package/src/features/customStage/shadows.ts +1 -1
  202. package/src/features/customStage/versusScreen.ts +2 -2
  203. package/src/features/debugDisplay/v.ts +2 -2
  204. package/src/features/deployJSONRoom.ts +11 -7
  205. package/src/features/extraConsoleCommands/commandsSubroutines.ts +2 -2
  206. package/src/features/extraConsoleCommands/listCommands.ts +13 -9
  207. package/src/features/pause.ts +1 -1
  208. package/src/features/persistentEntities.ts +2 -2
  209. package/src/features/preventCollectibleRotation.ts +1 -1
  210. package/src/features/saveDataManager/exports.ts +7 -4
  211. package/src/features/saveDataManager/merge.ts +3 -3
  212. package/src/features/sirenHelpers.ts +1 -1
  213. package/src/functions/ambush.ts +2 -2
  214. package/src/functions/array.ts +5 -2
  215. package/src/functions/bitwise.ts +2 -2
  216. package/src/functions/{boss.ts → bosses.ts} +29 -21
  217. package/src/functions/collectibleTag.ts +1 -1
  218. package/src/functions/collectibles.ts +2 -2
  219. package/src/functions/deepCopy.ts +98 -19
  220. package/src/functions/deepCopyTests.ts +75 -19
  221. package/src/functions/{entity.ts → entities.ts} +23 -21
  222. package/src/functions/{entitySpecific.ts → entitiesSpecific.ts} +170 -99
  223. package/src/functions/familiars.ts +1 -1
  224. package/src/functions/{gridEntity.ts → gridEntities.ts} +110 -34
  225. package/src/functions/gridEntitiesSpecific.ts +490 -0
  226. package/src/functions/log.ts +19 -10
  227. package/src/functions/mergeTests.ts +152 -4
  228. package/src/functions/{npc.ts → npcs.ts} +42 -11
  229. package/src/functions/pickups.ts +8 -475
  230. package/src/functions/pickupsSpecific.ts +613 -0
  231. package/src/functions/playerHealth.ts +1 -1
  232. package/src/functions/{player.ts → players.ts} +0 -0
  233. package/src/functions/pocketItems.ts +1 -1
  234. package/src/functions/positionVelocity.ts +3 -3
  235. package/src/functions/pressurePlate.ts +29 -0
  236. package/src/functions/revive.ts +2 -2
  237. package/src/functions/rooms.ts +1 -1
  238. package/src/functions/saveFile.ts +1 -1
  239. package/src/functions/spawnCollectible.ts +2 -2
  240. package/src/functions/{sprite.ts → sprites.ts} +0 -0
  241. package/src/functions/table.ts +1 -1
  242. package/src/functions/transformations.ts +1 -1
  243. package/src/functions/trinketGive.ts +4 -4
  244. package/src/functions/trinkets.ts +3 -3
  245. package/src/functions/tstlClass.ts +1 -1
  246. package/src/functions/ui.ts +3 -3
  247. package/src/functions/utils.ts +32 -13
  248. package/src/index.ts +10 -8
  249. package/src/types/AnyGridEntity.ts +9 -0
  250. package/dist/features/customStage/gridEntities.d.ts.map +0 -1
  251. package/dist/features/customStage/util.d.ts.map +0 -1
  252. package/dist/functions/boss.d.ts.map +0 -1
  253. package/dist/functions/entity.d.ts.map +0 -1
  254. package/dist/functions/entitySpecific.d.ts.map +0 -1
  255. package/dist/functions/gridEntity.d.ts.map +0 -1
  256. package/dist/functions/gridEntitySpecific.d.ts +0 -29
  257. package/dist/functions/gridEntitySpecific.d.ts.map +0 -1
  258. package/dist/functions/gridEntitySpecific.lua +0 -114
  259. package/dist/functions/npc.d.ts.map +0 -1
  260. package/dist/functions/player.d.ts.map +0 -1
  261. package/dist/functions/sprite.d.ts.map +0 -1
  262. package/src/functions/gridEntitySpecific.ts +0 -143
@@ -3,21 +3,26 @@ local ____isaac_2Dtypescript_2Ddefinitions = require("isaac-typescript-definitio
3
3
  local EntityType = ____isaac_2Dtypescript_2Ddefinitions.EntityType
4
4
  local ____constants = require("constants")
5
5
  local VectorZero = ____constants.VectorZero
6
- local ____entity = require("functions.entity")
7
- local getEntities = ____entity.getEntities
8
- local getFilteredNewEntities = ____entity.getFilteredNewEntities
9
- local removeEntities = ____entity.removeEntities
10
- local spawn = ____entity.spawn
11
- --- Helper function to get all of the `EntityType.BOMB` in the room.
6
+ local ____entities = require("functions.entities")
7
+ local getEntities = ____entities.getEntities
8
+ local removeEntities = ____entities.removeEntities
9
+ local spawn = ____entities.spawn
10
+ --- Helper function to get all of the bombs in the room. (Specifically, this refers to the
11
+ -- `EntityBomb` class, not bomb pickups.)
12
12
  --
13
13
  -- For example:
14
14
  --
15
15
  -- ```ts
16
- -- // Make all of the bombs in the room invisible
16
+ -- // Make all of the bombs in the room invisible.
17
17
  -- for (const bomb of getBombs()) {
18
18
  -- bomb.Visible = false;
19
19
  -- }
20
20
  -- ```
21
+ --
22
+ -- @param bombVariant Optional. If specified, will only get the bombs that match the variant.
23
+ -- Default is -1, which matches every variant.
24
+ -- @param subType Optional. If specified, will only get the bombs that match the sub-type. Default
25
+ -- is -1, which matches every sub-type.
21
26
  function ____exports.getBombs(self, bombVariant, subType)
22
27
  if bombVariant == nil then
23
28
  bombVariant = -1
@@ -35,16 +40,21 @@ function ____exports.getBombs(self, bombVariant, subType)
35
40
  end
36
41
  return bombs
37
42
  end
38
- --- Helper function to get all of the `EntityType.EFFECT` in the room.
43
+ --- Helper function to get all of the effects in the room.
39
44
  --
40
45
  -- For example:
41
46
  --
42
47
  -- ```ts
43
- -- // Make all of the effects in the room invisible
48
+ -- // Make all of the effects in the room invisible.
44
49
  -- for (const effect of getEffects()) {
45
50
  -- effect.Visible = false;
46
51
  -- }
47
52
  -- ```
53
+ --
54
+ -- @param effectVariant Optional. If specified, will only get the effects that match the variant.
55
+ -- Default is -1, which matches every variant.
56
+ -- @param subType Optional. If specified, will only get the effects that match the sub-type. Default
57
+ -- is -1, which matches every sub-type.
48
58
  function ____exports.getEffects(self, effectVariant, subType)
49
59
  if effectVariant == nil then
50
60
  effectVariant = -1
@@ -67,11 +77,16 @@ end
67
77
  -- For example:
68
78
  --
69
79
  -- ```ts
70
- -- // Make all of the familiars in the room invisible
80
+ -- // Make all of the familiars in the room invisible.
71
81
  -- for (const familiar of getFamiliars()) {
72
82
  -- familiar.Visible = false;
73
83
  -- }
74
84
  -- ```
85
+ --
86
+ -- @param familiarVariant Optional. If specified, will only get the familiars that match the
87
+ -- variant. Default is -1, which matches every variant.
88
+ -- @param subType Optional. If specified, will only get the familiars that match the sub-type.
89
+ -- Default is -1, which matches every sub-type.
75
90
  function ____exports.getFamiliars(self, familiarVariant, subType)
76
91
  if familiarVariant == nil then
77
92
  familiarVariant = -1
@@ -89,16 +104,21 @@ function ____exports.getFamiliars(self, familiarVariant, subType)
89
104
  end
90
105
  return familiars
91
106
  end
92
- --- Helper function to get all of the `EntityType.KNIFE` in the room.
107
+ --- Helper function to get all of the knives in the room.
93
108
  --
94
109
  -- For example:
95
110
  --
96
111
  -- ```ts
97
- -- // Make all of the knives in the room invisible
112
+ -- // Make all of the knives in the room invisible.
98
113
  -- for (const knife of getKnives()) {
99
114
  -- knife.Visible = false;
100
115
  -- }
101
116
  -- ```
117
+ --
118
+ -- @param knifeVariant Optional. If specified, will only get the knives that match the variant.
119
+ -- Default is -1, which matches every variant.
120
+ -- @param subType Optional. If specified, will only get the knives that match the sub-type. Default
121
+ -- is -1, which matches every sub-type.
102
122
  function ____exports.getKnives(self, knifeVariant, subType)
103
123
  if knifeVariant == nil then
104
124
  knifeVariant = -1
@@ -116,16 +136,21 @@ function ____exports.getKnives(self, knifeVariant, subType)
116
136
  end
117
137
  return knives
118
138
  end
119
- --- Helper function to get all of the `EntityType.LASER` in the room.
139
+ --- Helper function to get all of the lasers in the room.
120
140
  --
121
141
  -- For example:
122
142
  --
123
143
  -- ```ts
124
- -- // Make all of the lasers in the room invisible
144
+ -- // Make all of the lasers in the room invisible.
125
145
  -- for (const laser of getLasers()) {
126
146
  -- laser.Visible = false;
127
147
  -- }
128
148
  -- ```
149
+ --
150
+ -- @param laserVariant Optional. If specified, will only get the lasers that match the variant.
151
+ -- Default is -1, which matches every variant.
152
+ -- @param subType Optional. If specified, will only get the lasers that match the sub-type. Default
153
+ -- is -1, which matches every sub-type.
129
154
  function ____exports.getLasers(self, laserVariant, subType)
130
155
  if laserVariant == nil then
131
156
  laserVariant = -1
@@ -143,8 +168,27 @@ function ____exports.getLasers(self, laserVariant, subType)
143
168
  end
144
169
  return lasers
145
170
  end
146
- --- The same thing as the `getEntities` function, but returns only NPCs.
171
+ --- Helper function to get all of the NPCs in the room.
172
+ --
173
+ -- @param entityType Optional. If specified, will only get the NPCs that match the type. Default is
174
+ -- -1, which matches every entity type.
175
+ -- @param variant Optional. If specified, will only get the NPCs that match the variant. Default is
176
+ -- -1, which matches every entity type.
177
+ -- @param subType Optional. If specified, will only get the bombs that match the sub-type. Default
178
+ -- is -1, which matches every sub-type.
179
+ -- @param ignoreFriendly Optional. If set to true, it will exclude friendly NPCs from being
180
+ -- returned. Default is false. Will only be taken into account if the
181
+ -- `entityType` is specified.
147
182
  function ____exports.getNPCs(self, entityType, variant, subType, ignoreFriendly)
183
+ if entityType == nil then
184
+ entityType = -1
185
+ end
186
+ if variant == nil then
187
+ variant = -1
188
+ end
189
+ if subType == nil then
190
+ subType = -1
191
+ end
148
192
  if ignoreFriendly == nil then
149
193
  ignoreFriendly = false
150
194
  end
@@ -169,11 +213,16 @@ end
169
213
  -- For example:
170
214
  --
171
215
  -- ```ts
172
- -- // Make all of the pickups in the room invisible
216
+ -- // Make all of the pickups in the room invisible.
173
217
  -- for (const pickup of getPickups()) {
174
218
  -- pickup.Visible = false;
175
219
  -- }
176
220
  -- ```
221
+ --
222
+ -- @param pickupVariant Optional. If specified, will only get the pickups that match the variant.
223
+ -- Default is -1, which matches every entity type.
224
+ -- @param subType Optional. If specified, will only get the pickups that match the sub-type. Default
225
+ -- is -1, which matches every sub-type.
177
226
  function ____exports.getPickups(self, pickupVariant, subType)
178
227
  if pickupVariant == nil then
179
228
  pickupVariant = -1
@@ -191,16 +240,21 @@ function ____exports.getPickups(self, pickupVariant, subType)
191
240
  end
192
241
  return pickups
193
242
  end
194
- --- Helper function to get all of the `EntityType.PROJECTILE` in the room.
243
+ --- Helper function to get all of the projectiles in the room.
195
244
  --
196
245
  -- For example:
197
246
  --
198
247
  -- ```ts
199
- -- // Make all of the projectiles in the room invisible
248
+ -- // Make all of the projectiles in the room invisible.
200
249
  -- for (const projectile of getProjectiles()) {
201
250
  -- projectile.Visible = false;
202
251
  -- }
203
252
  -- ```
253
+ --
254
+ -- @param projectileVariant Optional. If specified, will only get the projectiles that match the
255
+ -- variant. Default is -1, which matches every entity type.
256
+ -- @param subType Optional. If specified, will only get the projectiles that match the sub-type.
257
+ -- Default is -1, which matches every sub-type.
204
258
  function ____exports.getProjectiles(self, projectileVariant, subType)
205
259
  if projectileVariant == nil then
206
260
  projectileVariant = -1
@@ -218,16 +272,21 @@ function ____exports.getProjectiles(self, projectileVariant, subType)
218
272
  end
219
273
  return projectiles
220
274
  end
221
- --- Helper function to get all of the `EntityType.SLOT` in the room.
275
+ --- Helper function to get all of the slots in the room.
222
276
  --
223
277
  -- For example:
224
278
  --
225
279
  -- ```ts
226
- -- // Make all of the slots in the room invisible
280
+ -- // Make all of the slots in the room invisible.
227
281
  -- for (const slot of getSlots()) {
228
282
  -- slot.Visible = false;
229
283
  -- }
230
284
  -- ```
285
+ --
286
+ -- @param slotVariant Optional. If specified, will only get the slots that match the variant.
287
+ -- Default is -1, which matches every entity type.
288
+ -- @param subType Optional. If specified, will only get the slots that match the sub-type. Default
289
+ -- is -1, which matches every sub-type.
231
290
  function ____exports.getSlots(self, slotVariant, subType)
232
291
  if slotVariant == nil then
233
292
  slotVariant = -1
@@ -238,16 +297,21 @@ function ____exports.getSlots(self, slotVariant, subType)
238
297
  local slots = getEntities(nil, EntityType.SLOT, slotVariant, subType)
239
298
  return slots
240
299
  end
241
- --- Helper function to get all of the `EntityType.TEAR` in the room.
300
+ --- Helper function to get all of the tears in the room.
242
301
  --
243
302
  -- For example:
244
303
  --
245
304
  -- ```ts
246
- -- // Make all of the tears in the room invisible
305
+ -- // Make all of the tears in the room invisible.
247
306
  -- for (const tear of getTears()) {
248
307
  -- tear.Visible = false;
249
308
  -- }
250
309
  -- ```
310
+ --
311
+ -- @param tearVariant Optional. If specified, will only get the tears that match the variant.
312
+ -- Default is -1, which matches every entity type.
313
+ -- @param subType Optional. If specified, will only get the tears that match the sub-type. Default
314
+ -- is -1, which matches every sub-type.
251
315
  function ____exports.getTears(self, tearVariant, subType)
252
316
  if tearVariant == nil then
253
317
  tearVariant = -1
@@ -265,121 +329,189 @@ function ____exports.getTears(self, tearVariant, subType)
265
329
  end
266
330
  return tears
267
331
  end
268
- --- The base game `EntityNPC.FireProjectiles` method does not return anything, which is a problem in
269
- -- situations where you need to work with the fired projectiles. This function invokes that method,
270
- -- and then returns the projectiles that were spawned.
271
- --
272
- -- @param npc The EntityNPC firing projectiles.
273
- -- @param position The starting position of the projectiles.
274
- -- @param velocity The starting velocity of the projectiles.
275
- -- @param projectilesMode A ProjectilesMode enum value defining how to fire the projectiles.
276
- -- @param projectileParams A ProjectileParams object containing various parameters for the
277
- -- projectiles.
278
- -- @returns An array of EntityProjectiles containing all fired projectiles.
279
- function ____exports.npcFireProjectiles(self, npc, position, velocity, projectilesMode, projectileParams)
280
- local oldEntities = ____exports.getProjectiles(nil)
281
- npc:FireProjectiles(position, velocity, projectilesMode, projectileParams)
282
- local newEntities = ____exports.getProjectiles(nil)
283
- local filteredNewEntities = getFilteredNewEntities(nil, oldEntities, newEntities)
284
- return filteredNewEntities
285
- end
286
- --- Helper function to remove all of the `EntityType.BOMB` in the room.
287
- --
288
- -- @param bombVariant Optional. If specified, will only remove bombs that match this variant.
289
- -- @param subType Optional. If specified, will only remove bombs that match this sub-type.
332
+ --- Helper function to remove all of the bombs in the room. (Specifically, this refers to the
333
+ -- `EntityBomb` class, not bomb pickups.)
334
+ --
335
+ -- @param bombVariant Optional. If specified, will only remove the bombs that match the variant.
336
+ -- Default is -1, which matches every variant.
337
+ -- @param subType Optional. If specified, will only remove the bombs that match the sub-type.
338
+ -- Default is -1, which matches every sub-type.
290
339
  -- @param cap Optional. If specified, will only remove the given amount of bombs.
291
340
  -- @returns An array of the bombs that were removed.
292
341
  function ____exports.removeAllBombs(self, bombVariant, subType, cap)
342
+ if bombVariant == nil then
343
+ bombVariant = -1
344
+ end
345
+ if subType == nil then
346
+ subType = -1
347
+ end
293
348
  local bombs = ____exports.getBombs(nil, bombVariant, subType)
294
349
  return removeEntities(nil, bombs, cap)
295
350
  end
296
351
  --- Helper function to remove all of the effects in the room.
297
352
  --
298
- -- @param effectVariant Optional. If specified, will only remove effects that match this variant.
299
- -- @param subType Optional. If specified, will only remove effects that match this sub-type.
353
+ -- @param effectVariant Optional. If specified, will only remove the effects that match the variant.
354
+ -- Default is -1, which matches every variant.
355
+ -- @param subType Optional. If specified, will only remove the effects that match the sub-type.
356
+ -- Default is -1, which matches every sub-type.
300
357
  -- @param cap Optional. If specified, will only remove the given amount of effects.
301
358
  -- @returns An array of the effects that were removed.
302
359
  function ____exports.removeAllEffects(self, effectVariant, subType, cap)
360
+ if effectVariant == nil then
361
+ effectVariant = -1
362
+ end
363
+ if subType == nil then
364
+ subType = -1
365
+ end
303
366
  local effects = ____exports.getEffects(nil, effectVariant, subType)
304
367
  return removeEntities(nil, effects, cap)
305
368
  end
306
369
  --- Helper function to remove all of the familiars in the room.
307
370
  --
308
- -- @param familiarVariant Optional. If specified, will only remove familiars that match this
309
- -- variant.
310
- -- @param subType Optional. If specified, will only remove familiars that match this sub-type.
371
+ -- @param familiarVariant Optional. If specified, will only remove the familiars that match the
372
+ -- variant. Default is -1, which matches every variant.
373
+ -- @param subType Optional. If specified, will only remove the familiars that match the sub-type.
374
+ -- Default is -1, which matches every sub-type.
311
375
  -- @param cap Optional. If specified, will only remove the given amount of familiars.
312
376
  -- @returns An array of the familiars that were removed.
313
377
  function ____exports.removeAllFamiliars(self, familiarVariant, subType, cap)
378
+ if familiarVariant == nil then
379
+ familiarVariant = -1
380
+ end
381
+ if subType == nil then
382
+ subType = -1
383
+ end
314
384
  local familiars = ____exports.getFamiliars(nil, familiarVariant, subType)
315
385
  return removeEntities(nil, familiars, cap)
316
386
  end
317
- --- Helper function to remove all of the `EntityType.KNIFE` in the room.
387
+ --- Helper function to remove all of the knives in the room.
318
388
  --
319
- -- @param knifeVariant Optional. If specified, will only remove knives that match this variant.
320
- -- @param subType Optional. If specified, will only remove knives that match this sub-type.
389
+ -- @param knifeVariant Optional. If specified, will only remove the knives that match the variant.
390
+ -- Default is -1, which matches every variant.
391
+ -- @param subType Optional. If specified, will only remove the knives that match the sub-type.
392
+ -- Default is -1, which matches every sub-type.
321
393
  -- @param cap Optional. If specified, will only remove the given amount of knives.
322
394
  -- @returns An array of the knives that were removed.
323
395
  function ____exports.removeAllKnives(self, knifeVariant, subType, cap)
396
+ if knifeVariant == nil then
397
+ knifeVariant = -1
398
+ end
399
+ if subType == nil then
400
+ subType = -1
401
+ end
324
402
  local knives = ____exports.getKnives(nil, knifeVariant, subType)
325
403
  return removeEntities(nil, knives, cap)
326
404
  end
327
- --- Helper function to remove all of the `EntityType.LASER` in the room.
405
+ --- Helper function to remove all of the lasers in the room.
328
406
  --
329
- -- @param laserVariant Optional. If specified, will only remove lasers that match this variant.
330
- -- @param subType Optional. If specified, will only remove lasers that match this sub-type.
407
+ -- @param laserVariant Optional. If specified, will only remove the lasers that match the variant.
408
+ -- Default is -1, which matches every variant.
409
+ -- @param subType Optional. If specified, will only remove the lasers that match the sub-type.
410
+ -- Default is -1, which matches every sub-type.
331
411
  -- @param cap Optional. If specified, will only remove the given amount of lasers.
332
412
  -- @returns An array of the lasers that were removed.
333
413
  function ____exports.removeAllLasers(self, laserVariant, subType, cap)
414
+ if laserVariant == nil then
415
+ laserVariant = -1
416
+ end
417
+ if subType == nil then
418
+ subType = -1
419
+ end
334
420
  local lasers = ____exports.getLasers(nil, laserVariant, subType)
335
421
  return removeEntities(nil, lasers, cap)
336
422
  end
337
- --- Helper function to remove all NPCs in the room.
423
+ --- Helper function to remove all of the NPCs in the room.
338
424
  --
425
+ -- @param entityType Optional. If specified, will only remove the NPCs that match the type. Default
426
+ -- is -1, which matches every type.
427
+ -- @param variant Optional. If specified, will only remove the NPCs that match the variant. Default
428
+ -- is -1, which matches every variant.
429
+ -- @param subType Optional. If specified, will only remove the NPCs that match the sub-type. Default
430
+ -- is -1, which matches every sub-type.
339
431
  -- @param cap Optional. If specified, will only remove the given amount of NPCs.
340
432
  -- @returns An array of the NPCs that were removed.
341
- function ____exports.removeAllNPCs(self, cap)
342
- local npcs = ____exports.getNPCs(nil)
433
+ function ____exports.removeAllNPCs(self, entityType, variant, subType, cap)
434
+ if entityType == nil then
435
+ entityType = -1
436
+ end
437
+ if variant == nil then
438
+ variant = -1
439
+ end
440
+ if subType == nil then
441
+ subType = -1
442
+ end
443
+ local npcs = ____exports.getNPCs(nil, entityType, variant, subType)
343
444
  return removeEntities(nil, npcs, cap)
344
445
  end
345
446
  --- Helper function to remove all of the pickups in the room.
346
447
  --
347
448
  -- @param pickupVariant Optional. If specified, will only remove pickups that match this variant.
348
- -- @param subType Optional. If specified, will only remove pickups that match this sub-type.
449
+ -- Default is -1, which matches every variant.
450
+ -- @param subType Optional. If specified, will only remove pickups that match this sub-type. Default
451
+ -- is -1, which matches every sub-type.
349
452
  -- @param cap Optional. If specified, will only remove the given amount of pickups.
350
453
  -- @returns An array of the pickups that were removed.
351
454
  function ____exports.removeAllPickups(self, pickupVariant, subType, cap)
455
+ if pickupVariant == nil then
456
+ pickupVariant = -1
457
+ end
458
+ if subType == nil then
459
+ subType = -1
460
+ end
352
461
  local pickups = ____exports.getPickups(nil, pickupVariant, subType)
353
462
  return removeEntities(nil, pickups, cap)
354
463
  end
355
- --- Helper function to remove all of the `EntityType.PROJECTILE` in the room.
464
+ --- Helper function to remove all of the projectiles in the room.
356
465
  --
357
466
  -- @param projectileVariant Optional. If specified, will only remove projectiles that match this
358
- -- variant.
467
+ -- variant. Default is -1, which matches every variant.
359
468
  -- @param subType Optional. If specified, will only remove projectiles that match this sub-type.
469
+ -- Default is -1, which matches every sub-type.
360
470
  -- @param cap Optional. If specified, will only remove the given amount of projectiles.
361
471
  -- @returns An array of the projectiles that were removed.
362
472
  function ____exports.removeAllProjectiles(self, projectileVariant, subType, cap)
473
+ if projectileVariant == nil then
474
+ projectileVariant = -1
475
+ end
476
+ if subType == nil then
477
+ subType = -1
478
+ end
363
479
  local projectiles = ____exports.getProjectiles(nil, projectileVariant, subType)
364
480
  return removeEntities(nil, projectiles, cap)
365
481
  end
366
- --- Helper function to remove all of the `EntityType.SLOT` in the room.
482
+ --- Helper function to remove all of the slots in the room.
367
483
  --
368
484
  -- @param slotVariant Optional. If specified, will only remove slots that match this variant.
369
- -- @param subType Optional. If specified, will only remove slots that match this sub-type.
485
+ -- Default is -1, which matches every variant.
486
+ -- @param subType Optional. If specified, will only remove slots that match this sub-type. Default
487
+ -- is -1, which matches every sub-type.
370
488
  -- @param cap Optional. If specified, will only remove the given amount of slots.
371
489
  -- @returns An array of the slots that were removed.
372
490
  function ____exports.removeAllSlots(self, slotVariant, subType, cap)
491
+ if slotVariant == nil then
492
+ slotVariant = -1
493
+ end
494
+ if subType == nil then
495
+ subType = -1
496
+ end
373
497
  local slots = ____exports.getSlots(nil, slotVariant, subType)
374
498
  return removeEntities(nil, slots, cap)
375
499
  end
376
- --- Helper function to remove all of the `EntityType.TEAR` in the room.
500
+ --- Helper function to remove all of the tears in the room.
377
501
  --
378
502
  -- @param tearVariant Optional. If specified, will only remove tears that match this variant.
379
- -- @param subType Optional. If specified, will only remove tears that match this sub-type.
503
+ -- Default is -1, which matches every variant.
504
+ -- @param subType Optional. If specified, will only remove tears that match this sub-type. Default
505
+ -- is -1, which matches every sub-type.
380
506
  -- @param cap Optional. If specified, will only remove the given amount of tears.
381
507
  -- @returns An array of the tears that were removed.
382
508
  function ____exports.removeAllTears(self, tearVariant, subType, cap)
509
+ if tearVariant == nil then
510
+ tearVariant = -1
511
+ end
512
+ if subType == nil then
513
+ subType = -1
514
+ end
383
515
  local tears = ____exports.getTears(nil, tearVariant, subType)
384
516
  return removeEntities(nil, tears, cap)
385
517
  end
@@ -609,6 +741,9 @@ function ____exports.spawnLaserWithSeed(self, laserVariant, subType, position, s
609
741
  )
610
742
  end
611
743
  --- Helper function to spawn an NPC.
744
+ --
745
+ -- Note that if you pass a non-NPC `EntityType` to this function, it will cause a run-time error,
746
+ -- since the `Entity.ToNPC` method will return undefined.
612
747
  function ____exports.spawnNPC(self, entityType, variant, subType, position, velocity, spawner, seedOrRNG)
613
748
  if velocity == nil then
614
749
  velocity = VectorZero
@@ -636,6 +771,9 @@ function ____exports.spawnNPC(self, entityType, variant, subType, position, velo
636
771
  return npc
637
772
  end
638
773
  --- Helper function to spawn an NPC with a specific seed.
774
+ --
775
+ -- Note that if you pass a non-NPC `EntityType` to this function, it will cause a run-time error,
776
+ -- since the `Entity.ToNPC` method will return undefined.
639
777
  function ____exports.spawnNPCWithSeed(self, entityType, variant, subType, position, seedOrRNG, velocity, spawner)
640
778
  if velocity == nil then
641
779
  velocity = VectorZero
@@ -5,8 +5,8 @@ local ____cachedClasses = require("cachedClasses")
5
5
  local itemConfig = ____cachedClasses.itemConfig
6
6
  local ____familiarsThatShootPlayerTearsSet = require("sets.familiarsThatShootPlayerTearsSet")
7
7
  local FAMILIARS_THAT_SHOOT_PLAYER_TEARS_SET = ____familiarsThatShootPlayerTearsSet.FAMILIARS_THAT_SHOOT_PLAYER_TEARS_SET
8
- local ____entitySpecific = require("functions.entitySpecific")
9
- local getFamiliars = ____entitySpecific.getFamiliars
8
+ local ____entitiesSpecific = require("functions.entitiesSpecific")
9
+ local getFamiliars = ____entitiesSpecific.getFamiliars
10
10
  --- Helper function to add and remove familiars based on a target amount that you specify.
11
11
  --
12
12
  -- This is a convenience wrapper around the `EntityPlayer.CheckFamiliar` method. Use this helper
@@ -1,5 +1,6 @@
1
- import { GridEntityType, GridEntityXMLType } from "isaac-typescript-definitions";
1
+ import { CrawlSpaceVariant, GridEntityType, GridEntityXMLType, TrapdoorVariant } from "isaac-typescript-definitions";
2
2
  import { RockAltType } from "../enums/RockAltType";
3
+ import { AnyGridEntity } from "../types/AnyGridEntity";
3
4
  /**
4
5
  * Helper function to convert the grid entity type found in a room XML file to the corresponding
5
6
  * grid entity type and variant normally used by the game. For example, a rock is represented as
@@ -20,6 +21,13 @@ export declare function getAllGridIndexes(): int[];
20
21
  * have collision yet in that callback.
21
22
  */
22
23
  export declare function getCollidingEntitiesWithGridEntity(gridEntity: GridEntity): Entity[];
24
+ /**
25
+ * Helper function to get all of the crawl spaces in the room.
26
+ *
27
+ * @param crawlSpaceVariant Optional. If specified, will only get the crawl spaces that match the
28
+ * variant. Default is -1, which matches every variant.
29
+ */
30
+ export declare function getCrawlSpaces(crawlSpaceVariant?: CrawlSpaceVariant): GridEntity[];
23
31
  /**
24
32
  * Helper function to get every grid entity in the current room.
25
33
  *
@@ -70,6 +78,8 @@ export declare function getGridEntityIDFromConstituents(gridEntityType: GridEnti
70
78
  /**
71
79
  * Helper function to get all of the grid entities in the room that specifically match the type and
72
80
  * variant provided.
81
+ *
82
+ * If you want to match every variant, use the `getGridEntities` function instead.
73
83
  */
74
84
  export declare function getMatchingGridEntities(gridEntityType: GridEntityType, variant: int): GridEntity[];
75
85
  /**
@@ -94,7 +104,11 @@ export declare function getTopLeftWall(): GridEntity | undefined;
94
104
  * room shape is.)
95
105
  */
96
106
  export declare function getTopLeftWallGridIndex(): int;
97
- export declare function isGridEntityBreakableByExplosion(gridEntity: GridEntity): boolean;
107
+ /**
108
+ * Helper function to get all of the grid entities of type `GridEntityType.TRAPDOOR` in the room.
109
+ * Specify a specific trapdoor variant to select only trapdoors of that variant.
110
+ */
111
+ export declare function getTrapdoors(trapdoorVariant?: TrapdoorVariant): GridEntity[];
98
112
  /**
99
113
  * Helper function to see if the provided gridEntity is in its respective broken state. See the
100
114
  * `GRID_ENTITY_TYPE_TO_BROKEN_STATE_MAP` constant for more details.
@@ -102,12 +116,17 @@ export declare function isGridEntityBreakableByExplosion(gridEntity: GridEntity)
102
116
  * Note that in the case of `GridEntityType.LOCK` (11), the state will turn to being broken before
103
117
  * the actual collision for the entity is removed.
104
118
  */
105
- export declare function isGridEntityBroken(gridEntity: GridEntity): boolean;
119
+ export declare function isGridEntityBreakableByExplosion(gridEntity: GridEntity): boolean;
106
120
  /**
107
121
  * Helper function to detect whether a given Void Portal is one that randomly spawns after a boss is
108
122
  * defeated or is one that naturally spawns in the room after Hush. (This is determined by looking
109
123
  * at the VarData of the entity.)
110
124
  */
125
+ export declare function isGridEntityBroken(gridEntity: GridEntity): boolean;
126
+ /**
127
+ * Helper function to determine if all of the pressure plates in the current room are pushed.
128
+ * Returns true if there are no pressure plates in the room.
129
+ */
111
130
  export declare function isPostBossVoidPortal(gridEntity: GridEntity): boolean;
112
131
  /**
113
132
  * Helper function to all grid entities in the room except for ones matching the grid entity types
@@ -125,7 +144,7 @@ export declare function isPostBossVoidPortal(gridEntity: GridEntity): boolean;
125
144
  * );
126
145
  * ```
127
146
  *
128
- * @returns True if one or more grid entities were removed, false otherwise.
147
+ * @returns The grid entities that were removed.
129
148
  */
130
149
  export declare function removeAllGridExcept(...gridEntityTypes: GridEntityType[]): GridEntity[];
131
150
  /**
@@ -149,18 +168,30 @@ export declare function removeAllGridExcept(...gridEntityTypes: GridEntityType[]
149
168
  */
150
169
  export declare function removeAllMatchingGridEntities(...gridEntityType: GridEntityType[]): GridEntity[];
151
170
  /**
152
- * Helper function to remove a grid entity simply by providing the grid entity object. By default,
153
- * this will also update the room.
171
+ * Helper function to remove all of the grid entities in the supplied array.
172
+ *
173
+ * @param gridEntities The array of grid entities to remove.
174
+ * @param updateRoom Whether or not to update the room after the grid entities are removed. This is
175
+ * generally a good idea because if the room is not updated, you will be unable to
176
+ * spawn another grid entity on the same tile until a frame has passed. However,
177
+ * doing this is expensive, since it involves a call to `Isaac.GetRoomEntities`,
178
+ * so set this to false if you need to invoke this function multiple times.
179
+ * @param cap Optional. If specified, will only remove the given amount of entities.
180
+ * @returns An array of the entities that were removed.
181
+ */
182
+ export declare function removeGridEntities<T extends AnyGridEntity>(gridEntities: T[], updateRoom: boolean, cap?: int): T[];
183
+ /**
184
+ * Helper function to remove a grid entity by providing the grid entity object or the grid index
185
+ * inside of the room.
154
186
  *
155
187
  * @param gridEntityOrGridIndex The grid entity or grid index to remove.
156
- * @param updateRoom Optional. Whether or not to update the room after the grid entity is removed.
157
- * Default is true. This is generally a good idea because if the room is not
158
- * updated, you will be unable to spawn another grid entity on the same tile until
159
- * a frame has passed. However, doing this is expensive, since it involves a call
160
- * to `Isaac.GetRoomEntities`, so set it to false if you need to invoke this
161
- * function multiple times.
188
+ * @param updateRoom Whether or not to update the room after the grid entity is removed. This is
189
+ * generally a good idea because if the room is not updated, you will be unable to
190
+ * spawn another grid entity on the same tile until a frame has passed. However,
191
+ * doing this is expensive, since it involves a call to `Isaac.GetRoomEntities`,
192
+ * so set this to false if you need to invoke this function multiple times.
162
193
  */
163
- export declare function removeGrid(gridEntityOrGridIndex: GridEntity, updateRoom?: boolean): void;
194
+ export declare function removeGridEntity(gridEntityOrGridIndex: GridEntity | int, updateRoom: boolean): void;
164
195
  /**
165
196
  * Helper function to make a grid entity invisible. This is accomplished by setting its sprite to an
166
197
  * empty/missing PNG file.
@@ -177,14 +208,14 @@ export declare function spawnGiantPoop(topLeftGridIndex: int): void;
177
208
  * Helper function to spawn a grid entity.
178
209
  *
179
210
  * This function assumes you want to give the grid entity a variant of 0. If you want to specify a
180
- * variant, use the `spawnGridWithVariant` helper function instead.
211
+ * variant, use the `spawnGridEntityWithVariant` helper function instead.
181
212
  *
182
213
  * Use this instead of the `Isaac.GridSpawn` method since it:
183
214
  * - handles giving pits collision
184
215
  * - removes existing grid entities on the same tile, if any
185
216
  * - allows you to specify either the grid index or the position
186
217
  */
187
- export declare function spawnGrid(gridEntityType: GridEntityType, gridIndexOrPosition: int | Vector): GridEntity | undefined;
218
+ export declare function spawnGridEntity(gridEntityType: GridEntityType, gridIndexOrPosition: int | Vector): GridEntity | undefined;
188
219
  /**
189
220
  * Helper function to spawn a grid entity with a specific variant.
190
221
  *
@@ -193,7 +224,7 @@ export declare function spawnGrid(gridEntityType: GridEntityType, gridIndexOrPos
193
224
  * - removes existing grid entities on the same tile, if any
194
225
  * - allows you to specify the grid index or the position
195
226
  */
196
- export declare function spawnGridWithVariant(gridEntityType: GridEntityType, variant: int, gridIndexOrPosition: int | Vector): GridEntity | undefined;
227
+ export declare function spawnGridEntityWithVariant(gridEntityType: GridEntityType, variant: int, gridIndexOrPosition: int | Vector): GridEntity | undefined;
197
228
  /**
198
229
  * Helper function for emulating what happens when a vanilla `GridEntityType.ROCK_ALT` grid entity
199
230
  * breaks.
@@ -217,4 +248,4 @@ export declare function spawnRockAltReward(rockAltType: RockAltType, _seedOrRNG?
217
248
  * with the appropriate variant, as the game does not give it the correct sprite automatically.
218
249
  */
219
250
  export declare function spawnVoidPortal(gridIndex: int): GridEntity | undefined;
220
- //# sourceMappingURL=gridEntity.d.ts.map
251
+ //# sourceMappingURL=gridEntities.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"gridEntities.d.ts","sourceRoot":"","sources":["../../src/functions/gridEntities.ts"],"names":[],"mappings":"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"}