isaacscript-common 1.2.87 → 1.2.88

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.
@@ -19,16 +19,16 @@ export declare function fireProjectiles(npc: EntityNPC, position: Vector, veloci
19
19
  * This function will not include bosses on an internal blacklist, such as Death's scythes or Big
20
20
  * Horn holes.
21
21
  */
22
- export declare function getAliveBosses(): EntityNPC[];
22
+ export declare function getAliveBosses(matchingEntityType?: EntityType | int, matchingVariant?: int, matchingSubType?: int, ignoreFriendly?: boolean): EntityNPC[];
23
23
  /**
24
24
  * Helper function to get all of the non-dead NPCs in the room.
25
25
  *
26
26
  * This function will not include NPCs on an internal blacklist, such as Death's scythes or Big Horn
27
27
  * holes.
28
28
  */
29
- export declare function getAliveNPCs(): EntityNPC[];
29
+ export declare function getAliveNPCs(matchingEntityType?: EntityType | int, matchingVariant?: int, matchingSubType?: int, ignoreFriendly?: boolean): EntityNPC[];
30
30
  /** Helper function to get all of the bosses in the room. */
31
- export declare function getBosses(): EntityNPC[];
31
+ export declare function getBosses(matchingEntityType?: EntityType | int, matchingVariant?: int, matchingSubType?: int, ignoreFriendly?: boolean): EntityNPC[];
32
32
  /** The same thing as the `getEntities()` function, but returns only NPCs. */
33
33
  export declare function getNPCs(matchingEntityType?: EntityType | int, matchingVariant?: int, matchingSubType?: int, ignoreFriendly?: boolean): EntityNPC[];
34
34
  /**
@@ -14,8 +14,17 @@ local getFilteredNewEntities = ____entity.getFilteredNewEntities
14
14
  local removeEntities = ____entity.removeEntities
15
15
  local ____entitySpecific = require("functions.entitySpecific")
16
16
  local getProjectiles = ____entitySpecific.getProjectiles
17
- function ____exports.getAliveNPCs(self)
18
- local npcs = ____exports.getNPCs(nil)
17
+ function ____exports.getAliveNPCs(self, matchingEntityType, matchingVariant, matchingSubType, ignoreFriendly)
18
+ if ignoreFriendly == nil then
19
+ ignoreFriendly = false
20
+ end
21
+ local npcs = ____exports.getNPCs(
22
+ nil,
23
+ matchingEntityType,
24
+ matchingVariant,
25
+ matchingSubType,
26
+ ignoreFriendly
27
+ )
19
28
  return __TS__ArrayFilter(
20
29
  npcs,
21
30
  function(____, npc) return not npc:IsDead() and not ____exports.isAliveExceptionNPC(nil, npc) end
@@ -99,15 +108,33 @@ function ____exports.fireProjectiles(self, npc, position, velocity, projectilesM
99
108
  local newProjectiles = getProjectiles(nil, projectileParams.Variant)
100
109
  return getFilteredNewEntities(nil, oldProjectiles, newProjectiles)
101
110
  end
102
- function ____exports.getAliveBosses(self)
103
- local aliveNPCs = ____exports.getAliveNPCs(nil)
111
+ function ____exports.getAliveBosses(self, matchingEntityType, matchingVariant, matchingSubType, ignoreFriendly)
112
+ if ignoreFriendly == nil then
113
+ ignoreFriendly = false
114
+ end
115
+ local aliveNPCs = ____exports.getAliveNPCs(
116
+ nil,
117
+ matchingEntityType,
118
+ matchingVariant,
119
+ matchingSubType,
120
+ ignoreFriendly
121
+ )
104
122
  return __TS__ArrayFilter(
105
123
  aliveNPCs,
106
124
  function(____, aliveNPC) return aliveNPC:IsBoss() end
107
125
  )
108
126
  end
109
- function ____exports.getBosses(self)
110
- local npcs = ____exports.getNPCs(nil)
127
+ function ____exports.getBosses(self, matchingEntityType, matchingVariant, matchingSubType, ignoreFriendly)
128
+ if ignoreFriendly == nil then
129
+ ignoreFriendly = false
130
+ end
131
+ local npcs = ____exports.getNPCs(
132
+ nil,
133
+ matchingEntityType,
134
+ matchingVariant,
135
+ matchingSubType,
136
+ ignoreFriendly
137
+ )
111
138
  return __TS__ArrayFilter(
112
139
  npcs,
113
140
  function(____, npc) return npc:IsBoss() end
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "isaacscript-common",
3
- "version": "1.2.87",
3
+ "version": "1.2.88",
4
4
  "description": "Helper functions for IsaacScript mods",
5
5
  "keywords": [
6
6
  "isaac",