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
@@ -15,11 +15,11 @@ local STAGE_TO_COMBINED_BOSS_SET_MAP = ____bossSets.STAGE_TO_COMBINED_BOSS_SET_M
15
15
  local STAGE_TO_STAGE_TYPE_TO_BOSS_SET_MAP = ____bossSets.STAGE_TO_STAGE_TYPE_TO_BOSS_SET_MAP
16
16
  local ____sinEntityTypesSet = require("sets.sinEntityTypesSet")
17
17
  local SIN_ENTITY_TYPES_SET = ____sinEntityTypesSet.SIN_ENTITY_TYPES_SET
18
- local ____entitySpecific = require("functions.entitySpecific")
19
- local getNPCs = ____entitySpecific.getNPCs
20
- local spawnNPC = ____entitySpecific.spawnNPC
21
- local ____npc = require("functions.npc")
22
- local getAliveNPCs = ____npc.getAliveNPCs
18
+ local ____entitiesSpecific = require("functions.entitiesSpecific")
19
+ local getNPCs = ____entitiesSpecific.getNPCs
20
+ local spawnNPC = ____entitiesSpecific.spawnNPC
21
+ local ____npcs = require("functions.npcs")
22
+ local getAliveNPCs = ____npcs.getAliveNPCs
23
23
  local ____rng = require("functions.rng")
24
24
  local isRNG = ____rng.isRNG
25
25
  local ____set = require("functions.set")
@@ -69,15 +69,32 @@ DEFAULT_BOSS_MULTI_SEGMENTS = 4
69
69
  --
70
70
  -- This function will not include bosses on an internal blacklist, such as Death's scythes or Big
71
71
  -- Horn holes.
72
- function ____exports.getAliveBosses(self, matchingEntityType, matchingVariant, matchingSubType, ignoreFriendly)
72
+ --
73
+ -- @param entityType Optional. If specified, will only get the bosses that match the type. Default
74
+ -- is -1, which matches every type.
75
+ -- @param variant Optional. If specified, will only get the bosses that match the variant. Default
76
+ -- is -1, which matches every variant.
77
+ -- @param subType Optional. If specified, will only get the bosses that match the sub-type. Default
78
+ -- is -1, which matches every sub-type.
79
+ -- @param ignoreFriendly Optional. Default is false.
80
+ function ____exports.getAliveBosses(self, entityType, variant, subType, ignoreFriendly)
81
+ if entityType == nil then
82
+ entityType = -1
83
+ end
84
+ if variant == nil then
85
+ variant = -1
86
+ end
87
+ if subType == nil then
88
+ subType = -1
89
+ end
73
90
  if ignoreFriendly == nil then
74
91
  ignoreFriendly = false
75
92
  end
76
93
  local aliveNPCs = getAliveNPCs(
77
94
  nil,
78
- matchingEntityType,
79
- matchingVariant,
80
- matchingSubType,
95
+ entityType,
96
+ variant,
97
+ subType,
81
98
  ignoreFriendly
82
99
  )
83
100
  return __TS__ArrayFilter(
@@ -111,15 +128,23 @@ function ____exports.getBossSet(self, stage, stageType)
111
128
  return copySet(nil, bossSet)
112
129
  end
113
130
  --- Helper function to get all of the bosses in the room.
114
- function ____exports.getBosses(self, matchingEntityType, matchingVariant, matchingSubType, ignoreFriendly)
131
+ --
132
+ -- @param entityType Optional. If specified, will only get the bosses that match the type. Default
133
+ -- is -1, which matches every type.
134
+ -- @param variant Optional. If specified, will only get the bosses that match the variant. Default
135
+ -- is -1, which matches every variant.
136
+ -- @param subType Optional. If specified, will only get the bosses that match the sub-type. Default
137
+ -- is -1, which matches every sub-type.
138
+ -- @param ignoreFriendly Optional. Default is false.
139
+ function ____exports.getBosses(self, entityType, variant, subType, ignoreFriendly)
115
140
  if ignoreFriendly == nil then
116
141
  ignoreFriendly = false
117
142
  end
118
143
  local npcs = getNPCs(
119
144
  nil,
120
- matchingEntityType,
121
- matchingVariant,
122
- matchingSubType,
145
+ entityType,
146
+ variant,
147
+ subType,
123
148
  ignoreFriendly
124
149
  )
125
150
  return __TS__ArrayFilter(
@@ -14,8 +14,8 @@ local ____enums = require("functions.enums")
14
14
  local getEnumValues = ____enums.getEnumValues
15
15
  local ____flag = require("functions.flag")
16
16
  local getFlagName = ____flag.getFlagName
17
- local ____player = require("functions.player")
18
- local getPlayerCollectibleCount = ____player.getPlayerCollectibleCount
17
+ local ____players = require("functions.players")
18
+ local getPlayerCollectibleCount = ____players.getPlayerCollectibleCount
19
19
  local ____set = require("functions.set")
20
20
  local copySet = ____set.copySet
21
21
  function ____exports.collectibleHasTag(self, collectibleType, tag)
@@ -27,15 +27,15 @@ local COLLECTIBLE_NAME_MAP = ____collectibleNameMap.COLLECTIBLE_NAME_MAP
27
27
  local DEFAULT_COLLECTIBLE_NAME = ____collectibleNameMap.DEFAULT_COLLECTIBLE_NAME
28
28
  local ____singleUseActiveCollectibleTypesSet = require("sets.singleUseActiveCollectibleTypesSet")
29
29
  local SINGLE_USE_ACTIVE_COLLECTIBLE_TYPES_SET = ____singleUseActiveCollectibleTypesSet.SINGLE_USE_ACTIVE_COLLECTIBLE_TYPES_SET
30
- local ____entity = require("functions.entity")
31
- local getEntityID = ____entity.getEntityID
30
+ local ____entities = require("functions.entities")
31
+ local getEntityID = ____entities.getEntityID
32
32
  local ____pickupVariants = require("functions.pickupVariants")
33
33
  local isCollectible = ____pickupVariants.isCollectible
34
34
  local ____roomData = require("functions.roomData")
35
35
  local getRoomListIndex = ____roomData.getRoomListIndex
36
- local ____sprite = require("functions.sprite")
37
- local clearSprite = ____sprite.clearSprite
38
- local spriteEquals = ____sprite.spriteEquals
36
+ local ____sprites = require("functions.sprites")
37
+ local clearSprite = ____sprites.clearSprite
38
+ local spriteEquals = ____sprites.spriteEquals
39
39
  local ____utils = require("functions.utils")
40
40
  local irange = ____utils.irange
41
41
  function initQuestionMarkSprite(self)
@@ -6,20 +6,20 @@ import { AnyEntity } from "../types/AnyEntity";
6
6
  * `Isaac.CountEntities` method to avoid having to specify a spawner and to handle ignoring charmed
7
7
  * enemies.
8
8
  *
9
- * @param entityType Default is -1. -1 matches every entity type.
10
- * @param variant Default is -1. -1 matches every variant.
11
- * @param subType Default is -1. -1 matches every sub-type.
12
- * @param ignoreFriendly Default is false.
9
+ * @param entityType Optional. Default is -1, which matches every entity type.
10
+ * @param variant Optional. Default is -1, which matches every variant.
11
+ * @param subType Optional. Default is -1, which matches every sub-type.
12
+ * @param ignoreFriendly Optional. Default is false.
13
13
  */
14
14
  export declare function countEntities(entityType?: EntityType, variant?: number, subType?: number, ignoreFriendly?: boolean): int;
15
15
  /**
16
16
  * Helper function to check if one or more of a specific kind of entity is present in the current
17
17
  * room. It uses the `countEntities` helper function to determine this.
18
18
  *
19
- * @param entityType Default is -1. -1 matches every entity type.
20
- * @param variant Default is -1. -1 matches every variant.
21
- * @param subType Default is -1. -1 matches every sub-type.
22
- * @param ignoreFriendly Default is false.
19
+ * @param entityType Optional. Default is -1, which matches every entity type.
20
+ * @param variant Optional. Default is -1, which matches every variant.
21
+ * @param subType Optional. Default is -1, which matches every sub-type.
22
+ * @param ignoreFriendly Optional. Default is false.
23
23
  */
24
24
  export declare function doesEntityExist(entityType?: EntityType, variant?: number, subType?: number, ignoreFriendly?: boolean): boolean;
25
25
  /**
@@ -46,20 +46,21 @@ export declare function getClosestEntityTo<T extends AnyEntity>(referenceEntity:
46
46
  * For example:
47
47
  *
48
48
  * ```ts
49
- * // Make all of the entities in the room invisible
49
+ * // Make all of the entities in the room invisible.
50
50
  * for (const entity of getEntities()) {
51
51
  * entity.Visible = false;
52
52
  * }
53
53
  * ```
54
54
  *
55
- * @param entityType Optional. If specified, will only return NPCs that match this entity type.
56
- * @param variant Optional. If specified, will only return NPCs that match this variant. Default is
57
- * -1. -1 matches every variant.
58
- * @param subType Optional. If specified, will only return NPCs that match this sub-type. Default is
59
- * -1. -1 matches every sub-type.
55
+ * @param entityType Optional. If specified, will only get the entities that match the type. Default
56
+ * is -1, which matches every type.
57
+ * @param variant Optional. If specified, will only get the entities that match the variant. Default
58
+ * is -1, which matches every variant.
59
+ * @param subType Optional. If specified, will only get the entities that match the sub-type.
60
+ * Default is -1, which matches every sub-type.
60
61
  * @param ignoreFriendly Optional. If set to true, it will exclude friendly NPCs from being
61
- * returned. Default is false. Will only be taken into account if
62
- * `matchingEntityType` is specified.
62
+ * returned. Default is false. Will only be taken into account if the
63
+ * `entityType` is specified.
63
64
  */
64
65
  export declare function getEntities(entityType?: EntityType, variant?: number, subType?: number, ignoreFriendly?: boolean): Entity[];
65
66
  /**
@@ -117,8 +118,9 @@ export declare function parseEntityTypeVariantString(entityTypeVariantString: st
117
118
  * Helper function to remove all of the matching entities in the room.
118
119
  *
119
120
  * @param entityType The entity type to match.
120
- * @param entityVariant Optional. The variant to match. Default is -1. -1 matches every variant.
121
- * @param entitySubType Optional. The sub-type to match. Default is -1. -1 matches every sub-type.
121
+ * @param entityVariant Optional. The variant to match. Default is -1, which matches every variant.
122
+ * @param entitySubType Optional. The sub-type to match. Default is -1, which matches every
123
+ * sub-type.
122
124
  * @param cap Optional. If specified, will only remove the given amount of collectibles.
123
125
  * @returns An array of the entities that were removed.
124
126
  */
@@ -153,4 +155,4 @@ export declare function spawn(entityType: EntityType, variant: int, subType: int
153
155
  * need to specify the velocity or spawner.
154
156
  */
155
157
  export declare function spawnWithSeed(entityType: EntityType, variant: int, subType: int, position: Vector, seedOrRNG: Seed | RNG, velocity?: Vector, spawner?: Entity | undefined): Entity;
156
- //# sourceMappingURL=entity.d.ts.map
158
+ //# sourceMappingURL=entities.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"entities.d.ts","sourceRoot":"","sources":["../../src/functions/entities.ts"],"names":[],"mappings":"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"}
@@ -47,7 +47,7 @@ function ____exports.removeEntities(self, entities, cap)
47
47
  entity:Remove()
48
48
  entitiesRemoved[#entitiesRemoved + 1] = entity
49
49
  if cap ~= nil and #entitiesRemoved >= cap then
50
- return entitiesRemoved
50
+ break
51
51
  end
52
52
  end
53
53
  return entitiesRemoved
@@ -56,10 +56,10 @@ end
56
56
  -- `Isaac.CountEntities` method to avoid having to specify a spawner and to handle ignoring charmed
57
57
  -- enemies.
58
58
  --
59
- -- @param entityType Default is -1. -1 matches every entity type.
60
- -- @param variant Default is -1. -1 matches every variant.
61
- -- @param subType Default is -1. -1 matches every sub-type.
62
- -- @param ignoreFriendly Default is false.
59
+ -- @param entityType Optional. Default is -1, which matches every entity type.
60
+ -- @param variant Optional. Default is -1, which matches every variant.
61
+ -- @param subType Optional. Default is -1, which matches every sub-type.
62
+ -- @param ignoreFriendly Optional. Default is false.
63
63
  function ____exports.countEntities(self, entityType, variant, subType, ignoreFriendly)
64
64
  if entityType == nil then
65
65
  entityType = -1
@@ -88,10 +88,10 @@ end
88
88
  --- Helper function to check if one or more of a specific kind of entity is present in the current
89
89
  -- room. It uses the `countEntities` helper function to determine this.
90
90
  --
91
- -- @param entityType Default is -1. -1 matches every entity type.
92
- -- @param variant Default is -1. -1 matches every variant.
93
- -- @param subType Default is -1. -1 matches every sub-type.
94
- -- @param ignoreFriendly Default is false.
91
+ -- @param entityType Optional. Default is -1, which matches every entity type.
92
+ -- @param variant Optional. Default is -1, which matches every variant.
93
+ -- @param subType Optional. Default is -1, which matches every sub-type.
94
+ -- @param ignoreFriendly Optional. Default is false.
95
95
  function ____exports.doesEntityExist(self, entityType, variant, subType, ignoreFriendly)
96
96
  if entityType == nil then
97
97
  entityType = -1
@@ -146,21 +146,25 @@ end
146
146
  -- For example:
147
147
  --
148
148
  -- ```ts
149
- -- // Make all of the entities in the room invisible
149
+ -- // Make all of the entities in the room invisible.
150
150
  -- for (const entity of getEntities()) {
151
151
  -- entity.Visible = false;
152
152
  -- }
153
153
  -- ```
154
154
  --
155
- -- @param entityType Optional. If specified, will only return NPCs that match this entity type.
156
- -- @param variant Optional. If specified, will only return NPCs that match this variant. Default is
157
- -- -1. -1 matches every variant.
158
- -- @param subType Optional. If specified, will only return NPCs that match this sub-type. Default is
159
- -- -1. -1 matches every sub-type.
155
+ -- @param entityType Optional. If specified, will only get the entities that match the type. Default
156
+ -- is -1, which matches every type.
157
+ -- @param variant Optional. If specified, will only get the entities that match the variant. Default
158
+ -- is -1, which matches every variant.
159
+ -- @param subType Optional. If specified, will only get the entities that match the sub-type.
160
+ -- Default is -1, which matches every sub-type.
160
161
  -- @param ignoreFriendly Optional. If set to true, it will exclude friendly NPCs from being
161
- -- returned. Default is false. Will only be taken into account if
162
- -- `matchingEntityType` is specified.
162
+ -- returned. Default is false. Will only be taken into account if the
163
+ -- `entityType` is specified.
163
164
  function ____exports.getEntities(self, entityType, variant, subType, ignoreFriendly)
165
+ if entityType == nil then
166
+ entityType = -1
167
+ end
164
168
  if variant == nil then
165
169
  variant = -1
166
170
  end
@@ -170,7 +174,7 @@ function ____exports.getEntities(self, entityType, variant, subType, ignoreFrien
170
174
  if ignoreFriendly == nil then
171
175
  ignoreFriendly = false
172
176
  end
173
- if entityType == nil then
177
+ if entityType == -1 then
174
178
  return Isaac.GetRoomEntities()
175
179
  end
176
180
  return Isaac.FindByType(entityType, variant, subType, ignoreFriendly)
@@ -290,8 +294,9 @@ end
290
294
  --- Helper function to remove all of the matching entities in the room.
291
295
  --
292
296
  -- @param entityType The entity type to match.
293
- -- @param entityVariant Optional. The variant to match. Default is -1. -1 matches every variant.
294
- -- @param entitySubType Optional. The sub-type to match. Default is -1. -1 matches every sub-type.
297
+ -- @param entityVariant Optional. The variant to match. Default is -1, which matches every variant.
298
+ -- @param entitySubType Optional. The sub-type to match. Default is -1, which matches every
299
+ -- sub-type.
295
300
  -- @param cap Optional. If specified, will only remove the given amount of collectibles.
296
301
  -- @returns An array of the entities that were removed.
297
302
  function ____exports.removeAllMatchingEntities(self, entityType, entityVariant, entitySubType, cap)