Skip to content

Cards

getCardDescription(cardType): string

Defined in: packages/isaacscript-common/src/functions/cards.ts:23

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”.

CardType

string


getCardName(cardType): string

Defined in: packages/isaacscript-common/src/functions/cards.ts:49

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”.

CardType

string


getItemConfigCardType(cardType): ItemConfigCardType | undefined

Defined in: packages/isaacscript-common/src/functions/cards.ts:73

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.

CardType

ItemConfigCardType | undefined


hasCard(player, …cardTypes): boolean

Defined in: packages/isaacscript-common/src/functions/cards.ts:91

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.

EntityPlayer

…readonly CardType[]

boolean


isCard(cardType): boolean

Defined in: packages/isaacscript-common/src/functions/cards.ts:110

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)

CardType

boolean


isCardType(cardType, itemConfigCardType): boolean

Defined in: packages/isaacscript-common/src/functions/cards.ts:120

Returns whether the given card type matches the specified item config card type.

CardType

ItemConfigCardType

boolean


isModdedCardType(cardType): boolean

Defined in: packages/isaacscript-common/src/functions/cards.ts:128

Returns true for any card type added by a mod.

CardType

boolean


isPocketItemObject(cardType): boolean

Defined in: packages/isaacscript-common/src/functions/cards.ts:133

Returns true for card types that have ItemConfigCardType.SPECIAL_OBJECT.

CardType

boolean


isReverseTarotCard(cardType): boolean

Defined in: packages/isaacscript-common/src/functions/cards.ts:138

Returns true for card types that have ItemConfigCardType.TAROT_REVERSE.

CardType

boolean


isRune(cardType): boolean

Defined in: packages/isaacscript-common/src/functions/cards.ts:143

Returns true for card types that have ItemConfigCardType.RUNE.

CardType

boolean


isSpecialCard(cardType): boolean

Defined in: packages/isaacscript-common/src/functions/cards.ts:148

Returns true for card types that have ItemConfigCardType.SPECIAL.

CardType

boolean


isSuitCard(cardType): boolean

Defined in: packages/isaacscript-common/src/functions/cards.ts:153

Returns true for card types that have ItemConfigCardType.SUIT.

CardType

boolean


isTarotCard(cardType): boolean

Defined in: packages/isaacscript-common/src/functions/cards.ts:158

Returns true for card types that have ItemConfigCardType.TAROT.

CardType

boolean


isValidCardType(cardType): cardType is CardType

Defined in: packages/isaacscript-common/src/functions/cards.ts:162

int

cardType is CardType


isVanillaCardType(cardType): boolean

Defined in: packages/isaacscript-common/src/functions/cards.ts:168

CardType

boolean


useCardTemp(player, cardType): void

Defined in: packages/isaacscript-common/src/functions/cards.ts:176

Helper function to use a card without showing an animation and without the announcer voice playing.

EntityPlayer

CardType

void