isaacscript-common 6.6.5 → 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 (232) hide show
  1. package/dist/callbacks/customRevive.lua +4 -4
  2. package/dist/callbacks/postCursedTeleport.lua +2 -2
  3. package/dist/callbacks/postCustomDoorEnter.lua +5 -5
  4. package/dist/callbacks/postDiceRoomActivated.lua +2 -2
  5. package/dist/callbacks/postFlip.lua +3 -3
  6. package/dist/callbacks/postGridEntity.lua +3 -3
  7. package/dist/callbacks/postGridEntityCollision.lua +3 -3
  8. package/dist/callbacks/postGridEntityRender.lua +2 -2
  9. package/dist/callbacks/postNewRoomEarly.lua +5 -5
  10. package/dist/callbacks/postPickupCollect.lua +2 -2
  11. package/dist/callbacks/postPitRender.lua +2 -2
  12. package/dist/callbacks/postPitUpdate.lua +2 -2
  13. package/dist/callbacks/postPlayerCollectible.lua +2 -2
  14. package/dist/callbacks/postPoopRender.lua +2 -2
  15. package/dist/callbacks/postPoopUpdate.lua +2 -2
  16. package/dist/callbacks/postPressurePlateRender.lua +2 -2
  17. package/dist/callbacks/postPressurePlateUpdate.lua +2 -2
  18. package/dist/callbacks/postPurchase.lua +2 -2
  19. package/dist/callbacks/postRockRender.lua +2 -2
  20. package/dist/callbacks/postRockUpdate.lua +2 -2
  21. package/dist/callbacks/postSlotInitUpdate.lua +2 -2
  22. package/dist/callbacks/postSlotRender.lua +2 -2
  23. package/dist/callbacks/postSpikesRender.lua +2 -2
  24. package/dist/callbacks/postSpikesUpdate.lua +2 -2
  25. package/dist/callbacks/postTNTRender.lua +2 -2
  26. package/dist/callbacks/postTNTUpdate.lua +2 -2
  27. package/dist/callbacks/preBerserkDeath.lua +2 -2
  28. package/dist/callbacks/preNewLevel.lua +2 -2
  29. package/dist/callbacks/subscriptions/postDoorRender.d.ts +2 -3
  30. package/dist/callbacks/subscriptions/postDoorRender.d.ts.map +1 -1
  31. package/dist/callbacks/subscriptions/postDoorRender.lua +3 -3
  32. package/dist/callbacks/subscriptions/postDoorUpdate.d.ts +2 -3
  33. package/dist/callbacks/subscriptions/postDoorUpdate.d.ts.map +1 -1
  34. package/dist/callbacks/subscriptions/postDoorUpdate.lua +3 -3
  35. package/dist/callbacks/subscriptions/postPitRender.d.ts +2 -3
  36. package/dist/callbacks/subscriptions/postPitRender.d.ts.map +1 -1
  37. package/dist/callbacks/subscriptions/postPitRender.lua +3 -3
  38. package/dist/callbacks/subscriptions/postPitUpdate.d.ts +2 -3
  39. package/dist/callbacks/subscriptions/postPitUpdate.d.ts.map +1 -1
  40. package/dist/callbacks/subscriptions/postPitUpdate.lua +3 -3
  41. package/dist/callbacks/subscriptions/postPoopRender.d.ts +2 -3
  42. package/dist/callbacks/subscriptions/postPoopRender.d.ts.map +1 -1
  43. package/dist/callbacks/subscriptions/postPoopRender.lua +3 -3
  44. package/dist/callbacks/subscriptions/postPoopUpdate.d.ts +2 -3
  45. package/dist/callbacks/subscriptions/postPoopUpdate.d.ts.map +1 -1
  46. package/dist/callbacks/subscriptions/postPoopUpdate.lua +3 -3
  47. package/dist/callbacks/subscriptions/postPressurePlateRender.d.ts +2 -3
  48. package/dist/callbacks/subscriptions/postPressurePlateRender.d.ts.map +1 -1
  49. package/dist/callbacks/subscriptions/postPressurePlateRender.lua +3 -3
  50. package/dist/callbacks/subscriptions/postPressurePlateUpdate.d.ts +2 -3
  51. package/dist/callbacks/subscriptions/postPressurePlateUpdate.d.ts.map +1 -1
  52. package/dist/callbacks/subscriptions/postPressurePlateUpdate.lua +3 -3
  53. package/dist/features/characterStats.lua +2 -2
  54. package/dist/features/collectibleItemPoolType.lua +2 -2
  55. package/dist/features/customGridEntity.d.ts.map +1 -1
  56. package/dist/features/customGridEntity.lua +5 -5
  57. package/dist/features/customStage/backdrop.lua +2 -2
  58. package/dist/features/customStage/{gridEntities.d.ts → customStageGridEntities.d.ts} +1 -1
  59. package/dist/features/customStage/customStageGridEntities.d.ts.map +1 -0
  60. package/dist/features/customStage/{gridEntities.lua → customStageGridEntities.lua} +8 -8
  61. package/dist/features/customStage/{util.d.ts → customStageUtils.d.ts} +1 -1
  62. package/dist/features/customStage/customStageUtils.d.ts.map +1 -0
  63. package/dist/features/customStage/{util.lua → customStageUtils.lua} +0 -0
  64. package/dist/features/customStage/exports.lua +4 -4
  65. package/dist/features/customStage/init.lua +6 -6
  66. package/dist/features/customStage/shadows.lua +2 -2
  67. package/dist/features/customStage/versusScreen.lua +4 -4
  68. package/dist/features/debugDisplay/v.lua +4 -4
  69. package/dist/features/deployJSONRoom.lua +20 -20
  70. package/dist/features/extraConsoleCommands/commandsSubroutines.lua +3 -3
  71. package/dist/features/extraConsoleCommands/listCommands.d.ts.map +1 -1
  72. package/dist/features/extraConsoleCommands/listCommands.lua +14 -14
  73. package/dist/features/pause.lua +2 -2
  74. package/dist/features/persistentEntities.lua +2 -2
  75. package/dist/features/preventCollectibleRotation.lua +2 -2
  76. package/dist/features/saveDataManager/exports.d.ts.map +1 -1
  77. package/dist/features/sirenHelpers.lua +2 -2
  78. package/dist/functions/ambush.lua +5 -5
  79. package/dist/functions/{boss.d.ts → bosses.d.ts} +22 -4
  80. package/dist/functions/bosses.d.ts.map +1 -0
  81. package/dist/functions/{boss.lua → bosses.lua} +38 -13
  82. package/dist/functions/collectibleTag.lua +2 -2
  83. package/dist/functions/collectibles.lua +5 -5
  84. package/dist/functions/{entity.d.ts → entities.d.ts} +21 -19
  85. package/dist/functions/entities.d.ts.map +1 -0
  86. package/dist/functions/{entity.lua → entities.lua} +25 -20
  87. package/dist/functions/{entitySpecific.d.ts → entitiesSpecific.d.ts} +145 -68
  88. package/dist/functions/entitiesSpecific.d.ts.map +1 -0
  89. package/dist/functions/{entitySpecific.lua → entitiesSpecific.lua} +203 -65
  90. package/dist/functions/familiars.lua +2 -2
  91. package/dist/functions/{gridEntity.d.ts → gridEntities.d.ts} +48 -17
  92. package/dist/functions/gridEntities.d.ts.map +1 -0
  93. package/dist/functions/{gridEntity.lua → gridEntities.lua} +140 -90
  94. package/dist/functions/gridEntitiesSpecific.d.ts +141 -0
  95. package/dist/functions/gridEntitiesSpecific.d.ts.map +1 -0
  96. package/dist/functions/gridEntitiesSpecific.lua +366 -0
  97. package/dist/functions/log.lua +8 -8
  98. package/dist/functions/{npc.d.ts → npcs.d.ts} +24 -2
  99. package/dist/functions/npcs.d.ts.map +1 -0
  100. package/dist/functions/{npc.lua → npcs.lua} +44 -9
  101. package/dist/functions/pickups.d.ts +4 -119
  102. package/dist/functions/pickups.d.ts.map +1 -1
  103. package/dist/functions/pickups.lua +10 -439
  104. package/dist/functions/pickupsSpecific.d.ts +229 -0
  105. package/dist/functions/pickupsSpecific.d.ts.map +1 -0
  106. package/dist/functions/pickupsSpecific.lua +560 -0
  107. package/dist/functions/playerHealth.lua +6 -6
  108. package/dist/functions/{player.d.ts → players.d.ts} +1 -1
  109. package/dist/functions/players.d.ts.map +1 -0
  110. package/dist/functions/{player.lua → players.lua} +0 -0
  111. package/dist/functions/pocketItems.lua +2 -2
  112. package/dist/functions/positionVelocity.lua +6 -6
  113. package/dist/functions/pressurePlate.d.ts +10 -0
  114. package/dist/functions/pressurePlate.d.ts.map +1 -0
  115. package/dist/functions/pressurePlate.lua +29 -0
  116. package/dist/functions/revive.lua +7 -7
  117. package/dist/functions/rooms.lua +2 -2
  118. package/dist/functions/saveFile.lua +3 -3
  119. package/dist/functions/spawnCollectible.lua +4 -4
  120. package/dist/functions/{sprite.d.ts → sprites.d.ts} +1 -1
  121. package/dist/functions/sprites.d.ts.map +1 -0
  122. package/dist/functions/{sprite.lua → sprites.lua} +0 -0
  123. package/dist/functions/transformations.lua +2 -2
  124. package/dist/functions/trinketGive.lua +2 -2
  125. package/dist/functions/trinkets.lua +6 -6
  126. package/dist/functions/utils.d.ts +7 -0
  127. package/dist/functions/utils.d.ts.map +1 -1
  128. package/dist/functions/utils.lua +35 -22
  129. package/dist/index.d.ts +10 -8
  130. package/dist/index.d.ts.map +1 -1
  131. package/dist/index.lua +26 -10
  132. package/dist/types/AnyGridEntity.d.ts +10 -0
  133. package/dist/types/AnyGridEntity.d.ts.map +1 -0
  134. package/dist/types/AnyGridEntity.lua +2 -0
  135. package/package.json +2 -2
  136. package/src/callbacks/customRevive.ts +2 -2
  137. package/src/callbacks/postCursedTeleport.ts +1 -1
  138. package/src/callbacks/postCustomDoorEnter.ts +2 -2
  139. package/src/callbacks/postDiceRoomActivated.ts +1 -1
  140. package/src/callbacks/postFlip.ts +1 -1
  141. package/src/callbacks/postGridEntity.ts +1 -1
  142. package/src/callbacks/postGridEntityCollision.ts +1 -1
  143. package/src/callbacks/postGridEntityRender.ts +1 -1
  144. package/src/callbacks/postNewRoomEarly.ts +9 -3
  145. package/src/callbacks/postPickupCollect.ts +1 -1
  146. package/src/callbacks/postPitRender.ts +1 -1
  147. package/src/callbacks/postPitUpdate.ts +1 -1
  148. package/src/callbacks/postPlayerCollectible.ts +1 -1
  149. package/src/callbacks/postPoopRender.ts +1 -1
  150. package/src/callbacks/postPoopUpdate.ts +1 -1
  151. package/src/callbacks/postPressurePlateRender.ts +1 -1
  152. package/src/callbacks/postPressurePlateUpdate.ts +1 -1
  153. package/src/callbacks/postPurchase.ts +1 -1
  154. package/src/callbacks/postRockRender.ts +1 -1
  155. package/src/callbacks/postRockUpdate.ts +1 -1
  156. package/src/callbacks/postSlotInitUpdate.ts +1 -1
  157. package/src/callbacks/postSlotRender.ts +1 -1
  158. package/src/callbacks/postSpikesRender.ts +1 -1
  159. package/src/callbacks/postSpikesUpdate.ts +1 -1
  160. package/src/callbacks/postTNTRender.ts +1 -1
  161. package/src/callbacks/postTNTUpdate.ts +1 -1
  162. package/src/callbacks/preBerserkDeath.ts +1 -1
  163. package/src/callbacks/preNewLevel.ts +1 -1
  164. package/src/callbacks/subscriptions/postDoorRender.ts +7 -5
  165. package/src/callbacks/subscriptions/postDoorUpdate.ts +7 -5
  166. package/src/callbacks/subscriptions/postPitRender.ts +6 -7
  167. package/src/callbacks/subscriptions/postPitUpdate.ts +6 -7
  168. package/src/callbacks/subscriptions/postPoopRender.ts +7 -5
  169. package/src/callbacks/subscriptions/postPoopUpdate.ts +7 -5
  170. package/src/callbacks/subscriptions/postPressurePlateRender.ts +7 -5
  171. package/src/callbacks/subscriptions/postPressurePlateUpdate.ts +7 -5
  172. package/src/features/characterStats.ts +1 -1
  173. package/src/features/collectibleItemPoolType.ts +1 -1
  174. package/src/features/customGridEntity.ts +6 -3
  175. package/src/features/customStage/backdrop.ts +1 -1
  176. package/src/features/customStage/{gridEntities.ts → customStageGridEntities.ts} +3 -3
  177. package/src/features/customStage/{util.ts → customStageUtils.ts} +0 -0
  178. package/src/features/customStage/exports.ts +2 -2
  179. package/src/features/customStage/init.ts +1 -1
  180. package/src/features/customStage/shadows.ts +1 -1
  181. package/src/features/customStage/versusScreen.ts +2 -2
  182. package/src/features/debugDisplay/v.ts +2 -2
  183. package/src/features/deployJSONRoom.ts +11 -7
  184. package/src/features/extraConsoleCommands/commandsSubroutines.ts +2 -2
  185. package/src/features/extraConsoleCommands/listCommands.ts +10 -6
  186. package/src/features/pause.ts +1 -1
  187. package/src/features/persistentEntities.ts +1 -1
  188. package/src/features/preventCollectibleRotation.ts +1 -1
  189. package/src/features/saveDataManager/exports.ts +7 -4
  190. package/src/features/sirenHelpers.ts +1 -1
  191. package/src/functions/ambush.ts +2 -2
  192. package/src/functions/{boss.ts → bosses.ts} +29 -21
  193. package/src/functions/collectibleTag.ts +1 -1
  194. package/src/functions/collectibles.ts +2 -2
  195. package/src/functions/{entity.ts → entities.ts} +23 -21
  196. package/src/functions/{entitySpecific.ts → entitiesSpecific.ts} +170 -99
  197. package/src/functions/familiars.ts +1 -1
  198. package/src/functions/{gridEntity.ts → gridEntities.ts} +110 -34
  199. package/src/functions/gridEntitiesSpecific.ts +490 -0
  200. package/src/functions/log.ts +3 -3
  201. package/src/functions/{npc.ts → npcs.ts} +42 -11
  202. package/src/functions/pickups.ts +8 -475
  203. package/src/functions/pickupsSpecific.ts +613 -0
  204. package/src/functions/playerHealth.ts +1 -1
  205. package/src/functions/{player.ts → players.ts} +0 -0
  206. package/src/functions/pocketItems.ts +1 -1
  207. package/src/functions/positionVelocity.ts +3 -3
  208. package/src/functions/pressurePlate.ts +29 -0
  209. package/src/functions/revive.ts +2 -2
  210. package/src/functions/rooms.ts +1 -1
  211. package/src/functions/saveFile.ts +1 -1
  212. package/src/functions/spawnCollectible.ts +2 -2
  213. package/src/functions/{sprite.ts → sprites.ts} +0 -0
  214. package/src/functions/transformations.ts +1 -1
  215. package/src/functions/trinketGive.ts +1 -1
  216. package/src/functions/trinkets.ts +3 -3
  217. package/src/functions/utils.ts +32 -13
  218. package/src/index.ts +10 -8
  219. package/src/types/AnyGridEntity.ts +9 -0
  220. package/dist/features/customStage/gridEntities.d.ts.map +0 -1
  221. package/dist/features/customStage/util.d.ts.map +0 -1
  222. package/dist/functions/boss.d.ts.map +0 -1
  223. package/dist/functions/entity.d.ts.map +0 -1
  224. package/dist/functions/entitySpecific.d.ts.map +0 -1
  225. package/dist/functions/gridEntity.d.ts.map +0 -1
  226. package/dist/functions/gridEntitySpecific.d.ts +0 -29
  227. package/dist/functions/gridEntitySpecific.d.ts.map +0 -1
  228. package/dist/functions/gridEntitySpecific.lua +0 -114
  229. package/dist/functions/npc.d.ts.map +0 -1
  230. package/dist/functions/player.d.ts.map +0 -1
  231. package/dist/functions/sprite.d.ts.map +0 -1
  232. package/src/functions/gridEntitySpecific.ts +0 -143
@@ -0,0 +1,366 @@
1
+ local ____exports = {}
2
+ local ____isaac_2Dtypescript_2Ddefinitions = require("isaac-typescript-definitions")
3
+ local DoorVariant = ____isaac_2Dtypescript_2Ddefinitions.DoorVariant
4
+ local GridEntityType = ____isaac_2Dtypescript_2Ddefinitions.GridEntityType
5
+ local PitVariant = ____isaac_2Dtypescript_2Ddefinitions.PitVariant
6
+ local PoopGridEntityVariant = ____isaac_2Dtypescript_2Ddefinitions.PoopGridEntityVariant
7
+ local PressurePlateVariant = ____isaac_2Dtypescript_2Ddefinitions.PressurePlateVariant
8
+ local RockVariant = ____isaac_2Dtypescript_2Ddefinitions.RockVariant
9
+ local ____gridEntities = require("functions.gridEntities")
10
+ local getGridEntities = ____gridEntities.getGridEntities
11
+ local removeGridEntities = ____gridEntities.removeGridEntities
12
+ local spawnGridEntityWithVariant = ____gridEntities.spawnGridEntityWithVariant
13
+ --- Helper function to spawn a `GridEntityType.DOOR` (16) with a specific variant.
14
+ function ____exports.spawnDoorWithVariant(self, doorVariant, gridIndexOrPosition)
15
+ local gridEntity = spawnGridEntityWithVariant(nil, GridEntityType.DOOR, doorVariant, gridIndexOrPosition)
16
+ if gridEntity == nil then
17
+ return gridEntity
18
+ end
19
+ local door = gridEntity:ToDoor()
20
+ if door == nil then
21
+ error("Failed to spawn a door.")
22
+ end
23
+ return door
24
+ end
25
+ --- Helper function to spawn a `GridEntityType.PIT` (7) with a specific variant.
26
+ function ____exports.spawnPitWithVariant(self, pitVariant, gridIndexOrPosition)
27
+ local gridEntity = spawnGridEntityWithVariant(nil, GridEntityType.PIT, pitVariant, gridIndexOrPosition)
28
+ if gridEntity == nil then
29
+ return gridEntity
30
+ end
31
+ local pit = gridEntity:ToPit()
32
+ if pit == nil then
33
+ error("Failed to spawn a pit.")
34
+ end
35
+ return pit
36
+ end
37
+ --- Helper function to spawn a `GridEntityType.POOP` (14) with a specific variant.
38
+ function ____exports.spawnPoopWithVariant(self, poopVariant, gridIndexOrPosition)
39
+ local gridEntity = spawnGridEntityWithVariant(nil, GridEntityType.POOP, poopVariant, gridIndexOrPosition)
40
+ if gridEntity == nil then
41
+ return gridEntity
42
+ end
43
+ local poop = gridEntity:ToPoop()
44
+ if poop == nil then
45
+ error("Failed to spawn a poop.")
46
+ end
47
+ return poop
48
+ end
49
+ --- Helper function to spawn a `GridEntityType.PRESSURE_PLATE` (20) with a specific variant.
50
+ function ____exports.spawnPressurePlateWithVariant(self, pressurePlateVariant, gridIndexOrPosition)
51
+ local gridEntity = spawnGridEntityWithVariant(nil, GridEntityType.PRESSURE_PLATE, pressurePlateVariant, gridIndexOrPosition)
52
+ if gridEntity == nil then
53
+ return gridEntity
54
+ end
55
+ local pressurePlate = gridEntity:ToPressurePlate()
56
+ if pressurePlate == nil then
57
+ error("Failed to spawn a pressure plate.")
58
+ end
59
+ return pressurePlate
60
+ end
61
+ --- Helper function to spawn a `GridEntityType.ROCK` (2) with a specific variant.
62
+ function ____exports.spawnRockWithVariant(self, rockVariant, gridIndexOrPosition)
63
+ local gridEntity = spawnGridEntityWithVariant(nil, GridEntityType.ROCK, rockVariant, gridIndexOrPosition)
64
+ if gridEntity == nil then
65
+ return gridEntity
66
+ end
67
+ local rock = gridEntity:ToRock()
68
+ if rock == nil then
69
+ error("Failed to spawn a rock.")
70
+ end
71
+ return rock
72
+ end
73
+ --- Helper function to spawn a `GridEntityType.SPIKES` (8) with a specific variant.
74
+ function ____exports.spawnSpikesWithVariant(self, variant, gridIndexOrPosition)
75
+ local gridEntity = spawnGridEntityWithVariant(nil, GridEntityType.SPIKES, variant, gridIndexOrPosition)
76
+ if gridEntity == nil then
77
+ return gridEntity
78
+ end
79
+ local spikes = gridEntity:ToSpikes()
80
+ if spikes == nil then
81
+ error("Failed to spawn spikes.")
82
+ end
83
+ return spikes
84
+ end
85
+ --- Helper function to spawn a `GridEntityType.TNT` (12) with a specific variant.
86
+ function ____exports.spawnTNTWithVariant(self, variant, gridIndexOrPosition)
87
+ local gridEntity = spawnGridEntityWithVariant(nil, GridEntityType.TNT, variant, gridIndexOrPosition)
88
+ if gridEntity == nil then
89
+ return gridEntity
90
+ end
91
+ local tnt = gridEntity:ToTNT()
92
+ if tnt == nil then
93
+ error("Failed to spawn TNT.")
94
+ end
95
+ return tnt
96
+ end
97
+ --- Helper function to get all of the `GridEntityPit` in the room.
98
+ --
99
+ -- @param pitVariant Optional. If specified, will only get the pits that match the variant. Default
100
+ -- is -1, which matches every variant.
101
+ function ____exports.getPits(self, pitVariant)
102
+ if pitVariant == nil then
103
+ pitVariant = -1
104
+ end
105
+ local gridEntities = getGridEntities(nil)
106
+ local pits = {}
107
+ for ____, gridEntity in ipairs(gridEntities) do
108
+ local pit = gridEntity:ToPit()
109
+ if pit ~= nil then
110
+ local gridEntityVariant = pit:GetVariant()
111
+ if pitVariant == -1 or pitVariant == gridEntityVariant then
112
+ pits[#pits + 1] = pit
113
+ end
114
+ end
115
+ end
116
+ return pits
117
+ end
118
+ --- Helper function to get all of the `GridEntityPoop` in the room.
119
+ --
120
+ -- @param poopVariant Optional. If specified, will only get the poops that match the variant.
121
+ -- Default is -1, which matches every variant.
122
+ function ____exports.getPoops(self, poopVariant)
123
+ if poopVariant == nil then
124
+ poopVariant = -1
125
+ end
126
+ local gridEntities = getGridEntities(nil)
127
+ local poops = {}
128
+ for ____, gridEntity in ipairs(gridEntities) do
129
+ local poop = gridEntity:ToPoop()
130
+ if poop ~= nil then
131
+ local gridEntityVariant = poop:GetVariant()
132
+ if poopVariant == -1 or poopVariant == gridEntityVariant then
133
+ poops[#poops + 1] = poop
134
+ end
135
+ end
136
+ end
137
+ return poops
138
+ end
139
+ --- Helper function to get all of the `GridEntityPressurePlate` in the room.
140
+ --
141
+ -- @param pressurePlateVariant Optional. If specified, will only get the pressure plates that match
142
+ -- the variant. Default is -1, which matches every variant.
143
+ function ____exports.getPressurePlates(self, pressurePlateVariant)
144
+ if pressurePlateVariant == nil then
145
+ pressurePlateVariant = -1
146
+ end
147
+ local gridEntities = getGridEntities(nil)
148
+ local pressurePlates = {}
149
+ for ____, gridEntity in ipairs(gridEntities) do
150
+ local pressurePlate = gridEntity:ToPressurePlate()
151
+ if pressurePlate ~= nil then
152
+ local gridEntityVariant = pressurePlate:GetVariant()
153
+ if pressurePlateVariant == -1 or pressurePlateVariant == gridEntityVariant then
154
+ pressurePlates[#pressurePlates + 1] = pressurePlate
155
+ end
156
+ end
157
+ end
158
+ return pressurePlates
159
+ end
160
+ --- Helper function to get all of the `GridEntityRock` in the room.
161
+ --
162
+ -- @param variant Optional. If specified, will only get the rocks that match the variant. Default is
163
+ -- -1, which matches every variant. Note that this is not the same thing as the
164
+ -- `RockVariant` enum, since that only applies to `GridEntityType.ROCK`, and other
165
+ -- types of grid entities can be the `GridEntityRock` class.
166
+ function ____exports.getRocks(self, variant)
167
+ if variant == nil then
168
+ variant = -1
169
+ end
170
+ local gridEntities = getGridEntities(nil)
171
+ local rocks = {}
172
+ for ____, gridEntity in ipairs(gridEntities) do
173
+ local rock = gridEntity:ToRock()
174
+ if rock ~= nil then
175
+ local gridEntityVariant = rock:GetVariant()
176
+ if variant == -1 or variant == gridEntityVariant then
177
+ rocks[#rocks + 1] = rock
178
+ end
179
+ end
180
+ end
181
+ return rocks
182
+ end
183
+ --- Helper function to get all of the `GridEntitySpikes` in the room.
184
+ function ____exports.getSpikes(self, variant)
185
+ if variant == nil then
186
+ variant = -1
187
+ end
188
+ local gridEntities = getGridEntities(nil)
189
+ local spikes = {}
190
+ for ____, gridEntity in ipairs(gridEntities) do
191
+ local spike = gridEntity:ToSpikes()
192
+ if spike ~= nil then
193
+ local gridEntityVariant = spike:GetVariant()
194
+ if variant == -1 or variant == gridEntityVariant then
195
+ spikes[#spikes + 1] = spike
196
+ end
197
+ end
198
+ end
199
+ return spikes
200
+ end
201
+ --- Helper function to get all of the `GridEntityTNT` in the room.
202
+ function ____exports.getTNT(self, variant)
203
+ if variant == nil then
204
+ variant = -1
205
+ end
206
+ local gridEntities = getGridEntities(nil)
207
+ local tntArray = {}
208
+ for ____, gridEntity in ipairs(gridEntities) do
209
+ local tnt = gridEntity:ToTNT()
210
+ if tnt ~= nil then
211
+ local gridEntityVariant = tnt:GetVariant()
212
+ if variant == -1 or variant == gridEntityVariant then
213
+ tntArray[#tntArray + 1] = tnt
214
+ end
215
+ end
216
+ end
217
+ return tntArray
218
+ end
219
+ --- Helper function to remove all of the `GridEntityPit` in the room.
220
+ --
221
+ -- @param pitVariant Optional. If specified, will only remove the pits that match this variant.
222
+ -- Default is -1, which matches every variant.
223
+ -- @param updateRoom Optional. Whether or not to update the room after the pits are removed. Default
224
+ -- is false. For more information, see the description of the `removeGridEntities`
225
+ -- helper function.
226
+ -- @param cap Optional. If specified, will only remove the given amount of pits.
227
+ -- @returns The pits that were removed.
228
+ function ____exports.removeAllPits(self, pitVariant, updateRoom, cap)
229
+ if pitVariant == nil then
230
+ pitVariant = -1
231
+ end
232
+ if updateRoom == nil then
233
+ updateRoom = false
234
+ end
235
+ local pits = ____exports.getPits(nil, pitVariant)
236
+ return removeGridEntities(nil, pits, updateRoom, cap)
237
+ end
238
+ --- Helper function to remove all of the `GridEntityPoop` in the room.
239
+ --
240
+ -- Note that poops can either be an entity or a grid entity, depending on the situation. This
241
+ -- function will only remove the grid entity poops.
242
+ --
243
+ -- @param poopVariant Optional. If specified, will only remove the poops that match this variant.
244
+ -- Default is -1, which matches every variant.
245
+ -- @param updateRoom Optional. Whether or not to update the room after the poops are removed.
246
+ -- Default is false. For more information, see the description of the
247
+ -- `removeGridEntities` helper function.
248
+ -- @param cap Optional. If specified, will only remove the given amount of poops.
249
+ -- @returns The poops that were removed.
250
+ function ____exports.removeAllPoops(self, poopVariant, updateRoom, cap)
251
+ if poopVariant == nil then
252
+ poopVariant = -1
253
+ end
254
+ if updateRoom == nil then
255
+ updateRoom = false
256
+ end
257
+ local poops = ____exports.getPoops(nil, poopVariant)
258
+ return removeGridEntities(nil, poops, updateRoom, cap)
259
+ end
260
+ --- Helper function to remove all of the `GridEntityPressurePlate` in the room.
261
+ --
262
+ -- @param pressurePlateVariant Optional. If specified, will only remove the pressure plates that
263
+ -- match this variant. Default is -1, which matches every variant.
264
+ -- @param updateRoom Optional. Whether or not to update the room after the pressure plates are
265
+ -- removed. Default is false. For more information, see the description of the
266
+ -- `removeGridEntities` helper function.
267
+ -- @param cap Optional. If specified, will only remove the given amount of pressure plates.
268
+ -- @returns The pressure plates that were removed.
269
+ function ____exports.removeAllPressurePlates(self, pressurePlateVariant, updateRoom, cap)
270
+ if pressurePlateVariant == nil then
271
+ pressurePlateVariant = -1
272
+ end
273
+ if updateRoom == nil then
274
+ updateRoom = false
275
+ end
276
+ local pressurePlates = ____exports.getPressurePlates(nil, pressurePlateVariant)
277
+ return removeGridEntities(nil, pressurePlates, updateRoom, cap)
278
+ end
279
+ --- Helper function to remove all of the `GridEntityRock` in the room.
280
+ --
281
+ -- @param variant Optional. If specified, will only remove the rocks that match this variant.
282
+ -- Default is -1, which matches every variant. Note that this is not the same thing
283
+ -- as the `RockVariant` enum, since that only applies to `GridEntityType.ROCK`, and
284
+ -- other types of grid entities can be the `GridEntityRock` class.
285
+ -- @param updateRoom Optional. Whether or not to update the room after the rocks are removed.
286
+ -- Default is false. For more information, see the description of the
287
+ -- `removeGridEntities` helper function.
288
+ -- @param cap Optional. If specified, will only remove the given amount of rocks.
289
+ -- @returns The rocks that were removed.
290
+ function ____exports.removeAllRocks(self, variant, updateRoom, cap)
291
+ if variant == nil then
292
+ variant = -1
293
+ end
294
+ if updateRoom == nil then
295
+ updateRoom = false
296
+ end
297
+ local rocks = ____exports.getRocks(nil, variant)
298
+ return removeGridEntities(nil, rocks, updateRoom, cap)
299
+ end
300
+ --- Helper function to remove all of the `GridEntitySpikes` in the room.
301
+ --
302
+ -- @param variant Optional. If specified, will only remove the spikes that match this variant.
303
+ -- Default is -1, which matches every variant.
304
+ -- @param updateRoom Optional. Whether or not to update the room after the spikes are removed.
305
+ -- Default is false. For more information, see the description of the
306
+ -- `removeGridEntities` helper function.
307
+ -- @param cap Optional. If specified, will only remove the given amount of spikes.
308
+ -- @returns The spikes that were removed.
309
+ function ____exports.removeAllSpikes(self, variant, updateRoom, cap)
310
+ if variant == nil then
311
+ variant = -1
312
+ end
313
+ if updateRoom == nil then
314
+ updateRoom = false
315
+ end
316
+ local spikes = ____exports.getSpikes(nil, variant)
317
+ return removeGridEntities(nil, spikes, updateRoom, cap)
318
+ end
319
+ --- Helper function to remove all of the `GridEntityTNT` in the room.
320
+ --
321
+ -- @param variant Optional. If specified, will only remove the TNTs that match this variant. Default
322
+ -- is -1, which matches every variant.
323
+ -- @param updateRoom Optional. Whether or not to update the room after the TNTs are removed. Default
324
+ -- is false. For more information, see the description of the `removeGridEntities`
325
+ -- helper function.
326
+ -- @param cap Optional. If specified, will only remove the given amount of TNTs.
327
+ -- @returns The TNTs that were removed.
328
+ function ____exports.removeAllTNT(self, variant, updateRoom, cap)
329
+ if variant == nil then
330
+ variant = -1
331
+ end
332
+ if updateRoom == nil then
333
+ updateRoom = false
334
+ end
335
+ local tnt = ____exports.getTNT(nil, variant)
336
+ return removeGridEntities(nil, tnt, updateRoom, cap)
337
+ end
338
+ --- Helper function to spawn a `GridEntityType.DOOR` (16).
339
+ function ____exports.spawnDoor(self, gridIndexOrPosition)
340
+ return ____exports.spawnDoorWithVariant(nil, DoorVariant.UNSPECIFIED, gridIndexOrPosition)
341
+ end
342
+ --- Helper function to spawn a `GridEntityType.PIT` (7).
343
+ function ____exports.spawnPit(self, gridIndexOrPosition)
344
+ return ____exports.spawnPitWithVariant(nil, PitVariant.NORMAL, gridIndexOrPosition)
345
+ end
346
+ --- Helper function to spawn a `GridEntityType.POOP` (14).
347
+ function ____exports.spawnPoop(self, gridIndexOrPosition)
348
+ return ____exports.spawnPoopWithVariant(nil, PoopGridEntityVariant.NORMAL, gridIndexOrPosition)
349
+ end
350
+ --- Helper function to spawn a `GridEntityType.PRESSURE_PLATE` (20).
351
+ function ____exports.spawnPressurePlate(self, gridIndexOrPosition)
352
+ return ____exports.spawnPressurePlateWithVariant(nil, PressurePlateVariant.PRESSURE_PLATE, gridIndexOrPosition)
353
+ end
354
+ --- Helper function to spawn a `GridEntityType.ROCK` (2).
355
+ function ____exports.spawnRock(self, gridIndexOrPosition)
356
+ return ____exports.spawnRockWithVariant(nil, RockVariant.NORMAL, gridIndexOrPosition)
357
+ end
358
+ --- Helper function to spawn a `GridEntityType.SPIKES` (8).
359
+ function ____exports.spawnSpikes(self, gridIndexOrPosition)
360
+ return ____exports.spawnSpikesWithVariant(nil, 0, gridIndexOrPosition)
361
+ end
362
+ --- Helper function to spawn a `GridEntityType.TNT` (12).
363
+ function ____exports.spawnTNT(self, gridIndexOrPosition)
364
+ return ____exports.spawnTNTWithVariant(nil, 0, gridIndexOrPosition)
365
+ end
366
+ return ____exports
@@ -28,22 +28,22 @@ local ____array = require("functions.array")
28
28
  local arrayToString = ____array.arrayToString
29
29
  local ____collectibles = require("functions.collectibles")
30
30
  local getCollectibleName = ____collectibles.getCollectibleName
31
- local ____entity = require("functions.entity")
32
- local getEntities = ____entity.getEntities
33
- local getEntityID = ____entity.getEntityID
31
+ local ____entities = require("functions.entities")
32
+ local getEntities = ____entities.getEntities
33
+ local getEntityID = ____entities.getEntityID
34
34
  local ____enums = require("functions.enums")
35
35
  local getEnumEntries = ____enums.getEnumEntries
36
36
  local ____flag = require("functions.flag")
37
37
  local hasFlag = ____flag.hasFlag
38
- local ____gridEntity = require("functions.gridEntity")
39
- local getGridEntities = ____gridEntity.getGridEntities
38
+ local ____gridEntities = require("functions.gridEntities")
39
+ local getGridEntities = ____gridEntities.getGridEntities
40
40
  local ____isaacAPIClass = require("functions.isaacAPIClass")
41
41
  local getIsaacAPIClassName = ____isaacAPIClass.getIsaacAPIClassName
42
- local ____player = require("functions.player")
43
- local getEffectsList = ____player.getEffectsList
44
- local getPlayerName = ____player.getPlayerName
45
42
  local ____playerHealth = require("functions.playerHealth")
46
43
  local getPlayerHealth = ____playerHealth.getPlayerHealth
44
+ local ____players = require("functions.players")
45
+ local getEffectsList = ____players.getEffectsList
46
+ local getPlayerName = ____players.getPlayerName
47
47
  local ____roomData = require("functions.roomData")
48
48
  local getRoomData = ____roomData.getRoomData
49
49
  local getRoomGridIndex = ____roomData.getRoomGridIndex
@@ -18,8 +18,16 @@ export declare function fireProjectiles(npc: EntityNPC, position: Vector, veloci
18
18
  *
19
19
  * This function will not include NPCs on an internal blacklist, such as Death's scythes or Big Horn
20
20
  * holes.
21
+ *
22
+ * @param entityType Optional. If specified, will only get the NPCs that match the type. Default is
23
+ * -1, which matches every type.
24
+ * @param variant Optional. If specified, will only get the NPCs that match the variant. Default is
25
+ * -1, which matches every variant.
26
+ * @param subType Optional. If specified, will only get the NPCs that match the sub-type. Default is
27
+ * -1, which matches every sub-type.
28
+ * @param ignoreFriendly Optional. Default is false.
21
29
  */
22
- export declare function getAliveNPCs(matchingEntityType?: EntityType, matchingVariant?: int, matchingSubType?: int, ignoreFriendly?: boolean): EntityNPC[];
30
+ export declare function getAliveNPCs(entityType?: EntityType, variant?: number, subType?: number, ignoreFriendly?: boolean): EntityNPC[];
23
31
  /**
24
32
  * Checks for specific NPCs that have "CanShutDoors" set to true naturally by the game, but should
25
33
  * not actually keep the doors closed (like Death's scythes).
@@ -38,4 +46,18 @@ export declare function isDyingEggyWithNoSpidersLeft(npc: EntityNPC): boolean;
38
46
  * enemies.
39
47
  */
40
48
  export declare function isRaglingDeathPatch(npc: EntityNPC): boolean;
41
- //# sourceMappingURL=npc.d.ts.map
49
+ /**
50
+ * The base game `EntityNPC.FireProjectiles` method does not return anything, which is a problem in
51
+ * situations where you need to work with the fired projectiles. This function invokes that method,
52
+ * and then returns the projectiles that were spawned.
53
+ *
54
+ * @param npc The EntityNPC firing projectiles.
55
+ * @param position The starting position of the projectiles.
56
+ * @param velocity The starting velocity of the projectiles.
57
+ * @param projectilesMode A ProjectilesMode enum value defining how to fire the projectiles.
58
+ * @param projectileParams A ProjectileParams object containing various parameters for the
59
+ * projectiles.
60
+ * @returns An array of EntityProjectiles containing all fired projectiles.
61
+ */
62
+ export declare function npcFireProjectiles(npc: EntityNPC, position: Vector, velocity: Vector, projectilesMode: ProjectilesMode, projectileParams: ProjectileParams): EntityProjectile[];
63
+ //# sourceMappingURL=npcs.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"npcs.d.ts","sourceRoot":"","sources":["../../src/functions/npcs.ts"],"names":[],"mappings":"AAAA,OAAO,EAOL,UAAU,EAMV,eAAe,EAGhB,MAAM,8BAA8B,CAAC;AAgCtC;;;;;;;;;;;;GAYG;AACH,wBAAgB,eAAe,CAC7B,GAAG,EAAE,SAAS,EACd,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,MAAM,EAChB,eAAe,GAAE,eAAgD,EACjE,gBAAgB,GAAE,gBAAqC,GACtD,gBAAgB,EAAE,CAMpB;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,YAAY,CAC1B,UAAU,GAAE,UAAe,EAC3B,OAAO,SAAK,EACZ,OAAO,SAAK,EACZ,cAAc,UAAQ,GACrB,SAAS,EAAE,CAGb;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,SAAS,GAAG,OAAO,CAoB3D;AAED;;;;GAIG;AACH,wBAAgB,4BAA4B,CAAC,GAAG,EAAE,SAAS,GAAG,OAAO,CAKpE;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,SAAS,GAAG,OAAO,CAO3D;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,kBAAkB,CAChC,GAAG,EAAE,SAAS,EACd,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,MAAM,EAChB,eAAe,EAAE,eAAe,EAChC,gBAAgB,EAAE,gBAAgB,GACjC,gBAAgB,EAAE,CAOpB"}
@@ -22,11 +22,11 @@ local RaglingVariant = ____isaac_2Dtypescript_2Ddefinitions.RaglingVariant
22
22
  local VisVariant = ____isaac_2Dtypescript_2Ddefinitions.VisVariant
23
23
  local ____constants = require("constants")
24
24
  local EGGY_STATE_FRAME_OF_FINAL_SPIDER = ____constants.EGGY_STATE_FRAME_OF_FINAL_SPIDER
25
- local ____entity = require("functions.entity")
26
- local getFilteredNewEntities = ____entity.getFilteredNewEntities
27
- local ____entitySpecific = require("functions.entitySpecific")
28
- local getNPCs = ____entitySpecific.getNPCs
29
- local getProjectiles = ____entitySpecific.getProjectiles
25
+ local ____entities = require("functions.entities")
26
+ local getFilteredNewEntities = ____entities.getFilteredNewEntities
27
+ local ____entitiesSpecific = require("functions.entitiesSpecific")
28
+ local getNPCs = ____entitiesSpecific.getNPCs
29
+ local getProjectiles = ____entitiesSpecific.getProjectiles
30
30
  --- Checks for specific NPCs that have "CanShutDoors" set to true naturally by the game, but should
31
31
  -- not actually keep the doors closed (like Death's scythes).
32
32
  function ____exports.isAliveExceptionNPC(self, npc)
@@ -109,15 +109,32 @@ end
109
109
  --
110
110
  -- This function will not include NPCs on an internal blacklist, such as Death's scythes or Big Horn
111
111
  -- holes.
112
- function ____exports.getAliveNPCs(self, matchingEntityType, matchingVariant, matchingSubType, ignoreFriendly)
112
+ --
113
+ -- @param entityType Optional. If specified, will only get the NPCs that match the type. Default is
114
+ -- -1, which matches every type.
115
+ -- @param variant Optional. If specified, will only get the NPCs that match the variant. Default is
116
+ -- -1, which matches every variant.
117
+ -- @param subType Optional. If specified, will only get the NPCs that match the sub-type. Default is
118
+ -- -1, which matches every sub-type.
119
+ -- @param ignoreFriendly Optional. Default is false.
120
+ function ____exports.getAliveNPCs(self, entityType, variant, subType, ignoreFriendly)
121
+ if entityType == nil then
122
+ entityType = -1
123
+ end
124
+ if variant == nil then
125
+ variant = -1
126
+ end
127
+ if subType == nil then
128
+ subType = -1
129
+ end
113
130
  if ignoreFriendly == nil then
114
131
  ignoreFriendly = false
115
132
  end
116
133
  local npcs = getNPCs(
117
134
  nil,
118
- matchingEntityType,
119
- matchingVariant,
120
- matchingSubType,
135
+ entityType,
136
+ variant,
137
+ subType,
121
138
  ignoreFriendly
122
139
  )
123
140
  return __TS__ArrayFilter(
@@ -125,4 +142,22 @@ function ____exports.getAliveNPCs(self, matchingEntityType, matchingVariant, mat
125
142
  function(____, npc) return not npc:IsDead() and not ____exports.isAliveExceptionNPC(nil, npc) end
126
143
  )
127
144
  end
145
+ --- The base game `EntityNPC.FireProjectiles` method does not return anything, which is a problem in
146
+ -- situations where you need to work with the fired projectiles. This function invokes that method,
147
+ -- and then returns the projectiles that were spawned.
148
+ --
149
+ -- @param npc The EntityNPC firing projectiles.
150
+ -- @param position The starting position of the projectiles.
151
+ -- @param velocity The starting velocity of the projectiles.
152
+ -- @param projectilesMode A ProjectilesMode enum value defining how to fire the projectiles.
153
+ -- @param projectileParams A ProjectileParams object containing various parameters for the
154
+ -- projectiles.
155
+ -- @returns An array of EntityProjectiles containing all fired projectiles.
156
+ function ____exports.npcFireProjectiles(self, npc, position, velocity, projectilesMode, projectileParams)
157
+ local oldEntities = getProjectiles(nil)
158
+ npc:FireProjectiles(position, velocity, projectilesMode, projectileParams)
159
+ local newEntities = getProjectiles(nil)
160
+ local filteredNewEntities = getFilteredNewEntities(nil, oldEntities, newEntities)
161
+ return filteredNewEntities
162
+ end
128
163
  return ____exports
@@ -1,133 +1,18 @@
1
- import { BatterySubType, Card, CoinSubType, CollectibleType, HeartSubType, KeySubType, PillColor, SackSubType, TrinketType } from "isaac-typescript-definitions";
2
- /** Helper function to get all of the battery entities in the room. */
3
- export declare function getBatteries(matchingSubType?: BatterySubType | -1): EntityPickupBattery[];
4
- /** Helper function to get all of the card entities in the room. */
5
- export declare function getCards(matchingSubType?: Card | -1): EntityPickupCard[];
1
+ import { CoinSubType } from "isaac-typescript-definitions";
6
2
  /**
7
3
  * Helper function to get the corresponding coin amount from a `CoinSubType`. Returns 1 for modded
8
4
  * sub-types.
9
5
  */
10
6
  export declare function getCoinValue(coinSubType: CoinSubType): int;
11
- /** Helper function to get all of the coin pickup entities in the room. */
12
- export declare function getCoins(matchingSubType?: CoinSubType | -1): EntityPickupCoin[];
13
- /** Helper function to get all of the collectible entities in the room. */
14
- export declare function getCollectibles(matchingSubType?: CollectibleType | -1): EntityPickupCollectible[];
15
- /** Helper function to get all of the heart pickup entities in the room. */
16
- export declare function getHearts(matchingSubType?: HeartSubType | -1): EntityPickupHeart[];
17
- /** Helper function to get all of the key pickup entities in the room. */
18
- export declare function getKeys(matchingSubType?: KeySubType | -1): EntityPickupKey[];
19
- /** Helper function to get all of the pill entities in the room. */
20
- export declare function getPills(matchingSubType?: PillColor | -1): EntityPickupPill[];
21
7
  /** Helper function to get all of the red heart pickup entities in the room. */
22
8
  export declare function getRedHearts(): EntityPickupHeart[];
23
- /** Helper function to get all of the sack (i.e. grab bag) entities in the room. */
24
- export declare function getSacks(matchingSubType?: SackSubType | -1): EntityPickupSack[];
25
- /** Helper function to get all of the trinket entities in the room. */
26
- export declare function getTrinkets(matchingSubType?: TrinketType | -1): EntityPickupTrinket[];
27
9
  export declare function isChest(pickup: EntityPickup): boolean;
28
10
  export declare function isRedHeart(pickup: EntityPickup): boolean;
29
11
  /**
30
- * Helper function to remove all of the batteries in the room.
12
+ * Helper function to remove all of the red heart pickup entities in the room.
31
13
  *
32
- * @param batterySubType Optional. If specified, will only remove cards that match this sub-type.
33
- * @param cap Optional. If specified, will only remove the given amount of cards.
34
- * @returns True if one or more cards were removed, false otherwise.
35
- */
36
- export declare function removeAllBatteries(batterySubType?: BatterySubType, cap?: int): EntityPickupBattery[];
37
- /**
38
- * Helper function to remove all of the cards in the room.
39
- *
40
- * @param card Optional. If specified, will only remove cards that match this sub-type.
41
- * @param cap Optional. If specified, will only remove the given amount of cards.
42
- * @returns True if one or more cards were removed, false otherwise.
43
- */
44
- export declare function removeAllCards(card?: Card, cap?: int): EntityPickupCard[];
45
- /**
46
- * Helper function to remove all of the coins in the room.
47
- *
48
- * @param coinSubType Optional. If specified, will only remove coins that match this sub-type.
49
- * @param cap Optional. If specified, will only remove the given amount of coins.
50
- * @returns True if one or more coins were removed, false otherwise.
51
- */
52
- export declare function removeAllCoins(coinSubType?: CoinSubType, cap?: int): EntityPickupCoin[];
53
- /**
54
- * Helper function to remove all of the collectibles in the room.
55
- *
56
- * @param collectibleType Optional. If specified, will only remove collectibles that match this
57
- * collectible type.
58
- * @param cap Optional. If specified, will only remove the given amount of collectibles.
59
- * @returns True if one or more collectibles were removed, false otherwise.
60
- */
61
- export declare function removeAllCollectibles(collectibleType?: CollectibleType, cap?: int): EntityPickupCollectible[];
62
- /**
63
- * Helper function to remove all of the hearts in the room.
64
- *
65
- * @param heartSubType Optional. If specified, will only remove hearts that match this sub-type.
66
14
  * @param cap Optional. If specified, will only remove the given amount of hearts.
67
- * @returns True if one or more hearts were removed, false otherwise.
68
- */
69
- export declare function removeAllHearts(heartSubType?: HeartSubType, cap?: int): EntityPickupHeart[];
70
- /**
71
- * Helper function to remove all of the keys in the room.
72
- *
73
- * @param keySubType Optional. If specified, will only remove keys that match this sub-type.
74
- * @param cap Optional. If specified, will only remove the given amount of keys.
75
- * @returns True if one or more keys were removed, false otherwise.
76
- */
77
- export declare function removeAllKeys(keySubType?: KeySubType, cap?: int): EntityPickupKey[];
78
- /**
79
- * Helper function to remove all of the pills in the room.
80
- *
81
- * @param pillColor Optional. If specified, will only remove pills that match this color.
82
- * @param cap Optional. If specified, will only remove the given amount of pills.
83
- * @returns True if one or more pills were removed, false otherwise.
84
- */
85
- export declare function removeAllPills(pillColor?: PillColor, cap?: int): EntityPickupPill[];
86
- /**
87
- * Helper function to remove all of the sacks (i.e. grab bags) in the room.
88
- *
89
- * @param sackSubType Optional. If specified, will only remove sacks that match this sub-type.
90
- * @param cap Optional. If specified, will only remove the given amount of trinkets.
91
- * @returns True if one or more trinkets were removed, false otherwise.
92
- */
93
- export declare function removeAllSacks(sackSubType?: SackSubType, cap?: int): EntityPickupSack[];
94
- /**
95
- * Helper function to remove all of the trinkets in the room.
96
- *
97
- * @param trinketType Optional. If specified, will only remove trinkets that match this trinket
98
- * type.
99
- * @param cap Optional. If specified, will only remove the given amount of trinkets.
100
- * @returns True if one or more trinkets were removed, false otherwise.
101
- */
102
- export declare function removeAllTrinkets(trinketType?: TrinketType, cap?: int): EntityPickupTrinket[];
103
- /**
104
- * Helper function to spawn a `EntityType.PICKUP` (5) with variant `PickupVariant.LIL_BATTERY` (90).
105
- */
106
- export declare function spawnBattery(subType: BatterySubType, position: Vector, velocity?: Vector, spawner?: Entity | undefined, seedOrRNG?: Seed | RNG | undefined): EntityPickupBattery;
107
- export declare function spawnBatteryWithSeed(subType: BatterySubType, position: Vector, seedOrRNG: Seed | RNG, velocity?: Vector, spawner?: Entity | undefined): EntityPickupBattery;
108
- /**
109
- * Helper function to spawn a `EntityType.PICKUP` (5) with variant `PickupVariant.TAROT_CARD` (300).
110
- */
111
- export declare function spawnCard(subType: Card, position: Vector, velocity?: Vector, spawner?: Entity | undefined, seedOrRNG?: Seed | RNG | undefined): EntityPickupCard;
112
- export declare function spawnCardWithSeed(subType: Card, position: Vector, seedOrRNG: Seed | RNG, velocity?: Vector, spawner?: Entity | undefined): EntityPickupCard;
113
- /** Helper function to spawn a `EntityType.PICKUP` (5) with variant `PickupVariant.COIN` (20). */
114
- export declare function spawnCoin(subType: CoinSubType, position: Vector, velocity?: Vector, spawner?: Entity | undefined, seedOrRNG?: Seed | RNG | undefined): EntityPickupCoin;
115
- export declare function spawnCoinWithSeed(subType: CoinSubType, position: Vector, seedOrRNG: Seed | RNG, velocity?: Vector, spawner?: Entity | undefined): EntityPickupCoin;
116
- /** Helper function to spawn a `EntityType.PICKUP` (5) with variant `PickupVariant.HEART` (10). */
117
- export declare function spawnHeart(subType: HeartSubType, position: Vector, velocity?: Vector, spawner?: Entity | undefined, seedOrRNG?: Seed | RNG | undefined): EntityPickupHeart;
118
- export declare function spawnHeartWithSeed(subType: HeartSubType, position: Vector, seedOrRNG: Seed | RNG, velocity?: Vector, spawner?: Entity | undefined): EntityPickupHeart;
119
- /** Helper function to spawn a `EntityType.PICKUP` (5) with variant `PickupVariant.KEY` (30). */
120
- export declare function spawnKey(subType: KeySubType, position: Vector, velocity?: Vector, spawner?: Entity | undefined, seedOrRNG?: Seed | RNG | undefined): EntityPickupKey;
121
- export declare function spawnKeyWithSeed(subType: KeySubType, position: Vector, seedOrRNG: Seed | RNG, velocity?: Vector, spawner?: Entity | undefined): EntityPickupKey;
122
- /** Helper function to spawn a `EntityType.PICKUP` (5) with variant `PickupVariant.PILL` (70). */
123
- export declare function spawnPill(pillColor: PillColor, position: Vector, velocity?: Vector, spawner?: Entity | undefined, seedOrRNG?: Seed | RNG | undefined): EntityPickupPill;
124
- export declare function spawnPillWithSeed(subType: PillColor, position: Vector, seedOrRNG: Seed | RNG, velocity?: Vector, spawner?: Entity | undefined): EntityPickupPill;
125
- /** Helper function to spawn a `EntityType.PICKUP` (5) with variant `PickupVariant.SACK` (69). */
126
- export declare function spawnSack(subType: SackSubType, position: Vector, velocity?: Vector, spawner?: Entity | undefined, seedOrRNG?: Seed | RNG | undefined): EntityPickupSack;
127
- export declare function spawnSackWithSeed(subType: SackSubType, position: Vector, seedOrRNG: Seed | RNG, velocity?: Vector, spawner?: Entity | undefined): EntityPickupSack;
128
- /**
129
- * Helper function to spawn a `EntityType.PICKUP` (5) with variant `PickupVariant.TRINKET` (350).
15
+ * @returns The red hearts that were removed.
130
16
  */
131
- export declare function spawnTrinket(subType: TrinketType, position: Vector, velocity?: Vector, spawner?: Entity | undefined, seedOrRNG?: Seed | RNG | undefined): EntityPickupTrinket;
132
- export declare function spawnTrinketWithSeed(subType: TrinketType, position: Vector, seedOrRNG: Seed | RNG, velocity?: Vector, spawner?: Entity | undefined): EntityPickupTrinket;
17
+ export declare function removeAllRedHearts(cap?: int): EntityPickupHeart[];
133
18
  //# sourceMappingURL=pickups.d.ts.map