Challenges
Functions
clearChallenge
▸ clearChallenge(): void
Helper function to clear the current challenge, which will restart the run on a new random non-challenge seed with the current character.
If the player is not in a challenge already, this function will do nothing.
Under the hood, this function executes the challenge 0
console command.
Returns
void
Defined in
packages/isaacscript-common/src/functions/challenges.ts:32
getChallengeBoss
▸ getChallengeBoss(challenge
): BossID
Get the final boss of a challenge. This will only work for vanilla challenges.
For modded challenges, BossID.MOM
(6) will be returned.
Note that for Challenge.BACKASSWARDS
(31), this function will return BossID.MEGA_SATAN
(55),
but this is not actually the final boss. (There is no final boss for this challenge.)
Parameters
Name | Type |
---|---|
challenge | Challenge |
Returns
BossID
Defined in
packages/isaacscript-common/src/functions/challenges.ts:50
getChallengeCharacter
▸ getChallengeCharacter(challenge
): PlayerType
Get the starting character of a challenge. This will only work for vanilla challenges.
For modded challenges, PlayerType.ISAAC
(0) will be returned.
Parameters
Name | Type |
---|---|
challenge | Challenge |
Returns
PlayerType
Defined in
packages/isaacscript-common/src/functions/challenges.ts:62
getChallengeCollectibleTypes
▸ getChallengeCollectibleTypes(challenge
): readonly CollectibleType
[]
Get the extra starting collectibles for a challenge. This will only work for vanilla challenges.
For modded challenges, an empty array will be returned.
Parameters
Name | Type |
---|---|
challenge | Challenge |
Returns
readonly CollectibleType
[]
Defined in
packages/isaacscript-common/src/functions/challenges.ts:74
getChallengeName
▸ getChallengeName(challenge
): string
Get the proper name for a Challenge
enum. This will only work for vanilla challenges.
For modded challenges, "Unknown" will be returned.
Parameters
Name | Type |
---|---|
challenge | Challenge |
Returns
string
Defined in
packages/isaacscript-common/src/functions/challenges.ts:85
getChallengeTrinketType
▸ getChallengeTrinketType(challenge
): TrinketType
| undefined
Get the extra starting trinket for a challenge. This will only work for vanilla challenges.
If a challenge does not grant a starting trinket, undefined
will be returned.
For modded challenges, undefined
will be returned.
Parameters
Name | Type |
---|---|
challenge | Challenge |
Returns
TrinketType
| undefined
Defined in
packages/isaacscript-common/src/functions/challenges.ts:99
onAnyChallenge
▸ onAnyChallenge(): boolean
Helper function to see if the player is playing any challenge.
Returns
boolean
Defined in
packages/isaacscript-common/src/functions/challenges.ts:106
onChallenge
▸ onChallenge(...challenges
): boolean
Helper function to check to see if the player is playing a particular challenge.
This function is variadic, meaning that you can specify as many challenges as you want to check for.
Parameters
Name | Type |
---|---|
...challenges | readonly Challenge [] |
Returns
boolean
Defined in
packages/isaacscript-common/src/functions/challenges.ts:117
setChallenge
▸ setChallenge(challenge
): void
Helper function to restart the run on a particular challenge.
If the player is already in the particular challenge, this function will do nothing.
Under the hood, this function executes the challenge 0
console command.
Parameters
Name | Type |
---|---|
challenge | Challenge |
Returns
void