isaacscript-common
Version:
Helper functions and features for IsaacScript mods.
68 lines • 3.42 kB
TypeScript
import type { CardType } from "isaac-typescript-definitions";
import { ItemConfigCardType } from "isaac-typescript-definitions";
/**
* Helper function to get a card description from a `CardType` value. Returns "Unknown" if the
* provided card type is not valid.
*
* This function works for both vanilla and modded trinkets.
*
* For example, `getCardDescription(CardType.FOOL)` would return "Where journey begins".
*/
export declare function getCardDescription(cardType: CardType): string;
/**
* Helper function to get the name of a card. Returns "Unknown" if the provided card type is not
* valid.
*
* This function works for both vanilla and modded trinkets.
*
* For example, `getCardName(Card.FOOL)` would return "0 - The Fool".
*/
export declare function getCardName(cardType: CardType): string;
/**
* Helper function to get the item config card type of a particular card, rune, or object. For
* example, the item config card type of `CardType.FOOL` is equal to `ItemConfigCardType.TAROT`.
*
* Returns undefined if the provided card type was not valid.
*/
export declare function getItemConfigCardType(cardType: CardType): ItemConfigCardType | undefined;
/**
* Helper function to check if a player is holding a specific card in one of their pocket item
* slots.
*
* This function is variadic, meaning that you can pass as many cards as you want to check for. The
* function will return true if the player has any of the cards.
*/
export declare function hasCard(player: EntityPlayer, ...cardTypes: readonly CardType[]): boolean;
/**
* Returns true for card types that have the following item config card type:
*
* - `ItemConfigCardType.TAROT` (0)
* - `ItemConfigCardType.SUIT` (1)
* - `ItemConfigCardType.SPECIAL` (3)
* - `ItemConfigCardType.TAROT_REVERSE` (5)
*/
export declare function isCard(cardType: CardType): boolean;
/** Returns whether the given card type matches the specified item config card type. */
export declare function isCardType(cardType: CardType, itemConfigCardType: ItemConfigCardType): boolean;
/** Returns true for any card type added by a mod. */
export declare function isModdedCardType(cardType: CardType): boolean;
/** Returns true for card types that have `ItemConfigCardType.SPECIAL_OBJECT`. */
export declare function isPocketItemObject(cardType: CardType): boolean;
/** Returns true for card types that have `ItemConfigCardType.TAROT_REVERSE`. */
export declare function isReverseTarotCard(cardType: CardType): boolean;
/** Returns true for card types that have `ItemConfigCardType.RUNE`. */
export declare function isRune(cardType: CardType): boolean;
/** Returns true for card types that have `ItemConfigCardType.SPECIAL`. */
export declare function isSpecialCard(cardType: CardType): boolean;
/** Returns true for card types that have `ItemConfigCardType.SUIT`. */
export declare function isSuitCard(cardType: CardType): boolean;
/** Returns true for card types that have `ItemConfigCardType.TAROT`. */
export declare function isTarotCard(cardType: CardType): boolean;
export declare function isValidCardType(cardType: int): cardType is CardType;
export declare function isVanillaCardType(cardType: CardType): boolean;
/**
* Helper function to use a card without showing an animation and without the announcer voice
* playing.
*/
export declare function useCardTemp(player: EntityPlayer, cardType: CardType): void;
//# sourceMappingURL=cards.d.ts.map