Skip to main content

Cards

Functions

getCardDescription

getCardDescription(cardType): string

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

Parameters

NameType
cardTypeCardType

Returns

string

Defined in

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


getCardName

getCardName(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".

Parameters

NameType
cardTypeCardType

Returns

string

Defined in

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


getItemConfigCardType

getItemConfigCardType(cardType): ItemConfigCardType | undefined

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.

Parameters

NameType
cardTypeCardType

Returns

ItemConfigCardType | undefined

Defined in

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


hasCard

hasCard(player, ...cardTypes): boolean

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.

Parameters

NameType
playerEntityPlayer
...cardTypesreadonly CardType[]

Returns

boolean

Defined in

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


isCard

isCard(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)

Parameters

NameType
cardTypeCardType

Returns

boolean

Defined in

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


isCardType

isCardType(cardType, itemConfigCardType): boolean

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

Parameters

NameType
cardTypeCardType
itemConfigCardTypeItemConfigCardType

Returns

boolean

Defined in

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


isModdedCardType

isModdedCardType(cardType): boolean

Returns true for any card type added by a mod.

Parameters

NameType
cardTypeCardType

Returns

boolean

Defined in

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


isPocketItemObject

isPocketItemObject(cardType): boolean

Returns true for card types that have ItemConfigCardType.SPECIAL_OBJECT.

Parameters

NameType
cardTypeCardType

Returns

boolean

Defined in

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


isReverseTarotCard

isReverseTarotCard(cardType): boolean

Returns true for card types that have ItemConfigCardType.TAROT_REVERSE.

Parameters

NameType
cardTypeCardType

Returns

boolean

Defined in

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


isRune

isRune(cardType): boolean

Returns true for card types that have ItemConfigCardType.RUNE.

Parameters

NameType
cardTypeCardType

Returns

boolean

Defined in

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


isSpecialCard

isSpecialCard(cardType): boolean

Returns true for card types that have ItemConfigCardType.SPECIAL.

Parameters

NameType
cardTypeCardType

Returns

boolean

Defined in

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


isSuitCard

isSuitCard(cardType): boolean

Returns true for card types that have ItemConfigCardType.SUIT.

Parameters

NameType
cardTypeCardType

Returns

boolean

Defined in

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


isTarotCard

isTarotCard(cardType): boolean

Returns true for card types that have ItemConfigCardType.TAROT.

Parameters

NameType
cardTypeCardType

Returns

boolean

Defined in

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


isValidCardType

isValidCardType(cardType): cardType is CardType

Parameters

NameType
cardTypeint

Returns

cardType is CardType

Defined in

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


isVanillaCardType

isVanillaCardType(cardType): boolean

Parameters

NameType
cardTypeCardType

Returns

boolean

Defined in

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


useCardTemp

useCardTemp(player, cardType): void

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

Parameters

NameType
playerEntityPlayer
cardTypeCardType

Returns

void

Defined in

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