Bosses
Functions
getAliveBosses
▸ getAliveBosses(entityType?
, variant?
, subType?
, ignoreFriendly?
): readonly EntityNPC
[]
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
Name | Type | Default value | Description |
---|---|---|---|
entityType | -1 | EntityType | -1 | Optional. If specified, will only get the bosses that match the type. Default is -1, which matches every type. |
variant | number | -1 | Optional. If specified, will only get the bosses that match the variant. Default is -1, which matches every variant. |
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 | boolean | false | Optional. Default is false. |
Returns
readonly EntityNPC
[]
Defined in
packages/isaacscript-common/src/functions/bosses.ts:54
getAllBosses
▸ getAllBosses(): readonly BossID
[]
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
readonly BossID
[]
Defined in
packages/isaacscript-common/src/functions/bosses.ts:81
getAllNonStoryBosses
▸ getAllNonStoryBosses(): readonly BossID
[]
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
readonly BossID
[]
Defined in
packages/isaacscript-common/src/functions/bosses.ts:90
getBossID
▸ getBossID(): BossID
| undefined
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
BossID
| undefined
Defined in
packages/isaacscript-common/src/functions/bosses.ts:101
getBossIDFromEntityTypeVariant
▸ getBossIDFromEntityTypeVariant(entityType
, variant
): BossID
| undefined
Parameters
Name | Type |
---|---|
entityType | EntityType |
variant | int |
Returns
BossID
| undefined
Defined in
packages/isaacscript-common/src/functions/bosses.ts:129
getBossIDsForStage
▸ getBossIDsForStage(stage
): ReadonlySet
<BossID
> | undefined
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
Name | Type |
---|---|
stage | LevelStage |
Returns
ReadonlySet
<BossID
> | undefined
Defined in
packages/isaacscript-common/src/functions/bosses.ts:144
getBossIDsForStageID
▸ getBossIDsForStageID(stageID
): readonly BossID
[] | undefined
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
Name | Type |
---|---|
stageID | StageID |
Returns
readonly BossID
[] | undefined
Defined in
packages/isaacscript-common/src/functions/bosses.ts:156
getBossName
▸ getBossName(bossID
): string
Helper function to get the proper English name for a boss. For example, the name for
BossID.WRETCHED
(36) is "The Wretched".
Parameters
Name | Type |
---|---|
bossID | BossID |
Returns
string
Defined in
packages/isaacscript-common/src/functions/bosses.ts:166
getBossStageIDs
▸ getBossStageIDs(bossID
): ReadonlySet
<StageID
>
Helper function to get the set of stage IDs that a particular boss naturally appears in.
Parameters
Name | Type |
---|---|
bossID | BossID |
Returns
ReadonlySet
<StageID
>
Defined in
packages/isaacscript-common/src/functions/bosses.ts:173
getBosses
▸ getBosses(entityType?
, variant?
, subType?
, ignoreFriendly?
): readonly EntityNPC
[]
Helper function to get all of the bosses in the room.
Parameters
Name | Type | Default value | Description |
---|---|---|---|
entityType? | EntityType | undefined | Optional. If specified, will only get the bosses that match the type. Default is -1, which matches every type. |
variant? | int | undefined | Optional. If specified, will only get the bosses that match the variant. Default is -1, which matches every variant. |
subType? | int | undefined | Optional. If specified, will only get the bosses that match the sub-type. Default is -1, which matches every sub-type. |
ignoreFriendly | boolean | false | Optional. Default is false. |
Returns
readonly EntityNPC
[]
Defined in
packages/isaacscript-common/src/functions/bosses.ts:188
getEntityTypeVariantFromBossID
▸ getEntityTypeVariantFromBossID(bossID
): readonly [EntityType
, int
]
Parameters
Name | Type |
---|---|
bossID | BossID |
Returns
readonly [EntityType
, int
]
Defined in
packages/isaacscript-common/src/functions/bosses.ts:198
isRepentanceBoss
▸ isRepentanceBoss(bossID
): boolean
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
Name | Type |
---|---|
bossID | BossID |
Returns
boolean
Defined in
packages/isaacscript-common/src/functions/bosses.ts:211
isSin
▸ isSin(npc
): boolean
Helper function to check if the provided NPC is a Sin miniboss, such as Sloth or Lust.
Parameters
Name | Type |
---|---|
npc | EntityNPC |
Returns
boolean
Defined in
packages/isaacscript-common/src/functions/bosses.ts:216
spawnBoss
▸ spawnBoss(entityType
, variant
, subType
, positionOrGridIndex
, velocity?
, spawner?
, seedOrRNG?
, numSegments?
): EntityNPC
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
Name | Type | Default value |
---|---|---|
entityType | EntityType | undefined |
variant | int | undefined |
subType | int | undefined |
positionOrGridIndex | int | Vector | undefined |
velocity | Vector | VectorZero |
spawner | undefined | Entity | undefined |
seedOrRNG | undefined | RNG | Seed | undefined |
numSegments? | int | undefined |
Returns
EntityNPC
Defined in
packages/isaacscript-common/src/functions/bosses.ts:263
spawnBossWithSeed
▸ spawnBossWithSeed(entityType
, variant
, subType
, positionOrGridIndex
, seedOrRNG
, velocity?
, spawner?
, numSegments?
): EntityNPC
Helper function to spawn a boss with a specific seed.
For more information, see the documentation for the spawnBoss
function.
Parameters
Name | Type | Default value |
---|---|---|
entityType | EntityType | undefined |
variant | int | undefined |
subType | int | undefined |
positionOrGridIndex | int | Vector | undefined |
seedOrRNG | RNG | Seed | undefined |
velocity | Vector | VectorZero |
spawner | undefined | Entity | undefined |
numSegments? | int | undefined |
Returns
EntityNPC