isaacscript-common
Version:
Helper functions and features for IsaacScript mods.
64 lines • 2.79 kB
TypeScript
import type { BossID, CollectibleType, PlayerType, TrinketType } from "isaac-typescript-definitions";
import { Challenge } from "isaac-typescript-definitions";
/**
* 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.
*/
export declare function clearChallenge(): void;
/**
* 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.)
*/
export declare function getChallengeBoss(challenge: Challenge): BossID;
/**
* Get the starting character of a challenge. This will only work for vanilla challenges.
*
* For modded challenges, `PlayerType.ISAAC` (0) will be returned.
*/
export declare function getChallengeCharacter(challenge: Challenge): PlayerType;
/**
* Get the extra starting collectibles for a challenge. This will only work for vanilla challenges.
*
* For modded challenges, an empty array will be returned.
*/
export declare function getChallengeCollectibleTypes(challenge: Challenge): readonly CollectibleType[];
/**
* Get the proper name for a `Challenge` enum. This will only work for vanilla challenges.
*
* For modded challenges, "Unknown" will be returned.
*/
export declare function getChallengeName(challenge: Challenge): string;
/**
* 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.
*/
export declare function getChallengeTrinketType(challenge: Challenge): TrinketType | undefined;
/** Helper function to see if the player is playing any challenge. */
export declare function onAnyChallenge(): 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.
*/
export declare function onChallenge(...challenges: readonly Challenge[]): boolean;
/**
* 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.
*/
export declare function setChallenge(challenge: Challenge): void;
//# sourceMappingURL=challenges.d.ts.map