Bosses
Functions
Section titled “Functions”getAliveBosses()
Section titled “getAliveBosses()”getAliveBosses(
entityType?,variant?,subType?,ignoreFriendly?): readonlyEntityNPC[]
Defined in: packages/isaacscript-common/src/functions/bosses.ts:54
Helper function to get all of the non-dead bosses in the room.
This function will not include bosses on an internal blacklist, such as Death’s scythes or Big Horn holes.
Parameters
Section titled “Parameters”entityType?
Section titled “entityType?”-1 | EntityType
Optional. If specified, will only get the bosses that match the type. Default is -1, which matches every type.
variant?
Section titled “variant?”number = -1
Optional. If specified, will only get the bosses that match the variant. Default is -1, which matches every variant.
subType?
Section titled “subType?”number = -1
Optional. If specified, will only get the bosses that match the sub-type. Default is -1, which matches every sub-type.
ignoreFriendly?
Section titled “ignoreFriendly?”boolean = false
Optional. Default is false.
Returns
Section titled “Returns”readonly EntityNPC[]
getAllBosses()
Section titled “getAllBosses()”getAllBosses(): readonly
BossID[]
Defined in: packages/isaacscript-common/src/functions/bosses.ts:81
Helper function to get an array with every boss in the game. This is derived from the BossID
enum.
This includes:
- Ultra Greed
- Ultra Greedier
This does not include:
- mini-bosses (e.g. Ultra Pride, Krampus)
- bosses that do not appear in Boss Rooms (e.g. Uriel, Gabriel)
- the second phase of multi-phase bosses (e.g. Mega Satan 2)
- sub-bosses of The Beast fight (e.g. Ultra Famine, Ultra Pestilence, Ultra War, Ultra Death)
- bosses that do not have any Boss Rooms defined due to being unfinished (e.g. Raglich)
Also see the getAllNonStoryBosses function.
Returns
Section titled “Returns”readonly BossID[]
getAllNonStoryBosses()
Section titled “getAllNonStoryBosses()”getAllNonStoryBosses(): readonly
BossID[]
Defined in: packages/isaacscript-common/src/functions/bosses.ts:90
Helper function to get an array with every boss in the game. This is derived from the BossID
enum. This is the same thing as the getAllBosses helper function, but with story bosses
filtered out.
Returns
Section titled “Returns”readonly BossID[]
getBosses()
Section titled “getBosses()”getBosses(
entityType?,variant?,subType?,ignoreFriendly?): readonlyEntityNPC[]
Defined in: packages/isaacscript-common/src/functions/bosses.ts:105
Helper function to get all of the bosses in the room.
Parameters
Section titled “Parameters”entityType?
Section titled “entityType?”EntityType
Optional. If specified, will only get the bosses that match the type. Default is -1, which matches every type.
variant?
Section titled “variant?”int
Optional. If specified, will only get the bosses that match the variant. Default is -1, which matches every variant.
subType?
Section titled “subType?”int
Optional. If specified, will only get the bosses that match the sub-type. Default is -1, which matches every sub-type.
ignoreFriendly?
Section titled “ignoreFriendly?”boolean = false
Optional. Default is false.
Returns
Section titled “Returns”readonly EntityNPC[]
getBossID()
Section titled “getBossID()”getBossID():
BossID|undefined
Defined in: packages/isaacscript-common/src/functions/bosses.ts:122
Helper function to get the boss ID corresponding to the current room. Returns undefined if the current room is not a Boss Room.
Use this instead of the vanilla Room.GetBossID method since it has a saner return type and it
correctly handles Dogma, The Beast, and Ultra Greedier.
Returns
Section titled “Returns”BossID | undefined
getBossIDFromEntityTypeVariant()
Section titled “getBossIDFromEntityTypeVariant()”getBossIDFromEntityTypeVariant(
entityType,variant):BossID|undefined
Defined in: packages/isaacscript-common/src/functions/bosses.ts:150
Parameters
Section titled “Parameters”entityType
Section titled “entityType”EntityType
variant
Section titled “variant”int
Returns
Section titled “Returns”BossID | undefined
getBossIDsForStage()
Section titled “getBossIDsForStage()”getBossIDsForStage(
stage):ReadonlySet<BossID> |undefined
Defined in: packages/isaacscript-common/src/functions/bosses.ts:170
Helper function to get the set of vanilla bosses for a particular stage across all of the stage
types. For example, specifying LevelStage.BASEMENT_2 will return a set with all of the bosses
for Basement, Cellar, Burning Basement, Downpour, and Dross.
Also see the getAllBossesSet and getBossIDsForStageID functions.
Parameters
Section titled “Parameters”LevelStage
Returns
Section titled “Returns”ReadonlySet<BossID> | undefined
getBossIDsForStageID()
Section titled “getBossIDsForStageID()”getBossIDsForStageID(
stageID): readonlyBossID[] |undefined
Defined in: packages/isaacscript-common/src/functions/bosses.ts:182
Helper function to get the set of vanilla bosses that can randomly appear on a particular stage ID.
Also see the getAllBossesSet and getBossIDsForStage functions.
Parameters
Section titled “Parameters”stageID
Section titled “stageID”StageID
Returns
Section titled “Returns”readonly BossID[] | undefined
getBossName()
Section titled “getBossName()”getBossName(
bossID):string
Defined in: packages/isaacscript-common/src/functions/bosses.ts:192
Helper function to get the proper English name for a boss. For example, the name for
BossID.WRETCHED (36) is “The Wretched”.
Parameters
Section titled “Parameters”bossID
Section titled “bossID”BossID
Returns
Section titled “Returns”string
getBossStageIDs()
Section titled “getBossStageIDs()”getBossStageIDs(
bossID):ReadonlySet<StageID>
Defined in: packages/isaacscript-common/src/functions/bosses.ts:199
Helper function to get the set of stage IDs that a particular boss naturally appears in.
Parameters
Section titled “Parameters”bossID
Section titled “bossID”BossID
Returns
Section titled “Returns”ReadonlySet<StageID>
getEntityTypeVariantFromBossID()
Section titled “getEntityTypeVariantFromBossID()”getEntityTypeVariantFromBossID(
bossID): readonly [EntityType,int]
Defined in: packages/isaacscript-common/src/functions/bosses.ts:203
Parameters
Section titled “Parameters”bossID
Section titled “bossID”BossID
Returns
Section titled “Returns”readonly [EntityType, int]
isRepentanceBoss()
Section titled “isRepentanceBoss()”isRepentanceBoss(
bossID):boolean
Defined in: packages/isaacscript-common/src/functions/bosses.ts:216
Helper function to check if a boss is only found on a Repentance floor such as Dross, Mines, and so on.
For example, The Pile is a boss that was added in Repentance, but since it can appear in Necropolis, it is not considered a Repentance boss for the purposes of this function.
Parameters
Section titled “Parameters”bossID
Section titled “bossID”BossID
Returns
Section titled “Returns”boolean
isSin()
Section titled “isSin()”isSin(
npc):boolean
Defined in: packages/isaacscript-common/src/functions/bosses.ts:221
Helper function to check if the provided NPC is a Sin miniboss, such as Sloth or Lust.
Parameters
Section titled “Parameters”EntityNPC
Returns
Section titled “Returns”boolean
spawnBoss()
Section titled “spawnBoss()”spawnBoss(
entityType,variant,subType,positionOrGridIndex,velocity?,spawner?,seedOrRNG?,numSegments?):EntityNPC
Defined in: packages/isaacscript-common/src/functions/bosses.ts:235
Helper function to spawn a boss.
Use this function instead of spawnNPC since it handles automatically spawning multiple segments
for multi-segment bosses.
By default, this will spawn Chub (and his variants) with 3 segments, Lokii with 2 copies, Gurglings/Turdlings with 2 copies, and other multi-segment bosses with 4 segments. You can customize this via the “numSegments” argument.
Parameters
Section titled “Parameters”entityType
Section titled “entityType”EntityType
variant
Section titled “variant”int
subType
Section titled “subType”int
positionOrGridIndex
Section titled “positionOrGridIndex”int | Vector
velocity?
Section titled “velocity?”Vector = VectorZero
spawner?
Section titled “spawner?”Entity
seedOrRNG?
Section titled “seedOrRNG?”RNG | Seed
numSegments?
Section titled “numSegments?”int
Returns
Section titled “Returns”EntityNPC
spawnBossWithSeed()
Section titled “spawnBossWithSeed()”spawnBossWithSeed(
entityType,variant,subType,positionOrGridIndex,seedOrRNG,velocity?,spawner?,numSegments?):EntityNPC
Defined in: packages/isaacscript-common/src/functions/bosses.ts:284
Helper function to spawn a boss with a specific seed.
For more information, see the documentation for the spawnBoss function.
Parameters
Section titled “Parameters”entityType
Section titled “entityType”EntityType
variant
Section titled “variant”int
subType
Section titled “subType”int
positionOrGridIndex
Section titled “positionOrGridIndex”int | Vector
seedOrRNG
Section titled “seedOrRNG”RNG | Seed
velocity?
Section titled “velocity?”Vector = VectorZero
spawner?
Section titled “spawner?”Entity
numSegments?
Section titled “numSegments?”int
Returns
Section titled “Returns”EntityNPC
