Challenges
Functions
Section titled “Functions”clearChallenge()
Section titled “clearChallenge()”clearChallenge():
void
Defined in: packages/isaacscript-common/src/functions/challenges.ts:32
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
Section titled “Returns”void
getChallengeBoss()
Section titled “getChallengeBoss()”getChallengeBoss(
challenge):BossID
Defined in: packages/isaacscript-common/src/functions/challenges.ts:52
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
Section titled “Parameters”challenge
Section titled “challenge”Challenge
Returns
Section titled “Returns”BossID
getChallengeCharacter()
Section titled “getChallengeCharacter()”getChallengeCharacter(
challenge):PlayerType
Defined in: packages/isaacscript-common/src/functions/challenges.ts:64
Get the starting character of a challenge. This will only work for vanilla challenges.
For modded challenges, PlayerType.ISAAC (0) will be returned.
Parameters
Section titled “Parameters”challenge
Section titled “challenge”Challenge
Returns
Section titled “Returns”PlayerType
getChallengeCollectibleTypes()
Section titled “getChallengeCollectibleTypes()”getChallengeCollectibleTypes(
challenge): readonlyCollectibleType[]
Defined in: packages/isaacscript-common/src/functions/challenges.ts:76
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
Section titled “Parameters”challenge
Section titled “challenge”Challenge
Returns
Section titled “Returns”readonly CollectibleType[]
getChallengeName()
Section titled “getChallengeName()”getChallengeName(
challenge):string
Defined in: packages/isaacscript-common/src/functions/challenges.ts:87
Get the proper name for a Challenge enum. This will only work for vanilla challenges.
For modded challenges, “Unknown” will be returned.
Parameters
Section titled “Parameters”challenge
Section titled “challenge”Challenge
Returns
Section titled “Returns”string
getChallengeTrinketType()
Section titled “getChallengeTrinketType()”getChallengeTrinketType(
challenge):TrinketType|undefined
Defined in: packages/isaacscript-common/src/functions/challenges.ts:101
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
Section titled “Parameters”challenge
Section titled “challenge”Challenge
Returns
Section titled “Returns”TrinketType | undefined
onAnyChallenge()
Section titled “onAnyChallenge()”onAnyChallenge():
boolean
Defined in: packages/isaacscript-common/src/functions/challenges.ts:108
Helper function to see if the player is playing any challenge.
Returns
Section titled “Returns”boolean
onChallenge()
Section titled “onChallenge()”onChallenge(…
challenges):boolean
Defined in: packages/isaacscript-common/src/functions/challenges.ts:119
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
Section titled “Parameters”challenges
Section titled “challenges”…readonly Challenge[]
Returns
Section titled “Returns”boolean
setChallenge()
Section titled “setChallenge()”setChallenge(
challenge):void
Defined in: packages/isaacscript-common/src/functions/challenges.ts:131
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
Section titled “Parameters”challenge
Section titled “challenge”Challenge
Returns
Section titled “Returns”void
