Cards
Functions
Section titled “Functions”getCardDescription()
Section titled “getCardDescription()”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”.
Parameters
Section titled “Parameters”cardType
Section titled “cardType”CardType
Returns
Section titled “Returns”string
getCardName()
Section titled “getCardName()”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”.
Parameters
Section titled “Parameters”cardType
Section titled “cardType”CardType
Returns
Section titled “Returns”string
getItemConfigCardType()
Section titled “getItemConfigCardType()”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.
Parameters
Section titled “Parameters”cardType
Section titled “cardType”CardType
Returns
Section titled “Returns”ItemConfigCardType | undefined
hasCard()
Section titled “hasCard()”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.
Parameters
Section titled “Parameters”player
Section titled “player”EntityPlayer
cardTypes
Section titled “cardTypes”…readonly CardType[]
Returns
Section titled “Returns”boolean
isCard()
Section titled “isCard()”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)
Parameters
Section titled “Parameters”cardType
Section titled “cardType”CardType
Returns
Section titled “Returns”boolean
isCardType()
Section titled “isCardType()”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.
Parameters
Section titled “Parameters”cardType
Section titled “cardType”CardType
itemConfigCardType
Section titled “itemConfigCardType”ItemConfigCardType
Returns
Section titled “Returns”boolean
isModdedCardType()
Section titled “isModdedCardType()”isModdedCardType(
cardType):boolean
Defined in: packages/isaacscript-common/src/functions/cards.ts:128
Returns true for any card type added by a mod.
Parameters
Section titled “Parameters”cardType
Section titled “cardType”CardType
Returns
Section titled “Returns”boolean
isPocketItemObject()
Section titled “isPocketItemObject()”isPocketItemObject(
cardType):boolean
Defined in: packages/isaacscript-common/src/functions/cards.ts:133
Returns true for card types that have ItemConfigCardType.SPECIAL_OBJECT.
Parameters
Section titled “Parameters”cardType
Section titled “cardType”CardType
Returns
Section titled “Returns”boolean
isReverseTarotCard()
Section titled “isReverseTarotCard()”isReverseTarotCard(
cardType):boolean
Defined in: packages/isaacscript-common/src/functions/cards.ts:138
Returns true for card types that have ItemConfigCardType.TAROT_REVERSE.
Parameters
Section titled “Parameters”cardType
Section titled “cardType”CardType
Returns
Section titled “Returns”boolean
isRune()
Section titled “isRune()”isRune(
cardType):boolean
Defined in: packages/isaacscript-common/src/functions/cards.ts:143
Returns true for card types that have ItemConfigCardType.RUNE.
Parameters
Section titled “Parameters”cardType
Section titled “cardType”CardType
Returns
Section titled “Returns”boolean
isSpecialCard()
Section titled “isSpecialCard()”isSpecialCard(
cardType):boolean
Defined in: packages/isaacscript-common/src/functions/cards.ts:148
Returns true for card types that have ItemConfigCardType.SPECIAL.
Parameters
Section titled “Parameters”cardType
Section titled “cardType”CardType
Returns
Section titled “Returns”boolean
isSuitCard()
Section titled “isSuitCard()”isSuitCard(
cardType):boolean
Defined in: packages/isaacscript-common/src/functions/cards.ts:153
Returns true for card types that have ItemConfigCardType.SUIT.
Parameters
Section titled “Parameters”cardType
Section titled “cardType”CardType
Returns
Section titled “Returns”boolean
isTarotCard()
Section titled “isTarotCard()”isTarotCard(
cardType):boolean
Defined in: packages/isaacscript-common/src/functions/cards.ts:158
Returns true for card types that have ItemConfigCardType.TAROT.
Parameters
Section titled “Parameters”cardType
Section titled “cardType”CardType
Returns
Section titled “Returns”boolean
isValidCardType()
Section titled “isValidCardType()”isValidCardType(
cardType):cardType is CardType
Defined in: packages/isaacscript-common/src/functions/cards.ts:162
Parameters
Section titled “Parameters”cardType
Section titled “cardType”int
Returns
Section titled “Returns”cardType is CardType
isVanillaCardType()
Section titled “isVanillaCardType()”isVanillaCardType(
cardType):boolean
Defined in: packages/isaacscript-common/src/functions/cards.ts:168
Parameters
Section titled “Parameters”cardType
Section titled “cardType”CardType
Returns
Section titled “Returns”boolean
useCardTemp()
Section titled “useCardTemp()”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.
Parameters
Section titled “Parameters”player
Section titled “player”EntityPlayer
cardType
Section titled “cardType”CardType
Returns
Section titled “Returns”void
