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
| Name | Type |
|---|---|
cardType | CardType |
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
| Name | Type |
|---|---|
cardType | CardType |
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
| Name | Type |
|---|---|
cardType | CardType |
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
| Name | Type |
|---|---|
player | EntityPlayer |
...cardTypes | readonly 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
| Name | Type |
|---|---|
cardType | CardType |
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
| Name | Type |
|---|---|
cardType | CardType |
itemConfigCardType | ItemConfigCardType |
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
| Name | Type |
|---|---|
cardType | CardType |
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
| Name | Type |
|---|---|
cardType | CardType |
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
| Name | Type |
|---|---|
cardType | CardType |
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
| Name | Type |
|---|---|
cardType | CardType |
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
| Name | Type |
|---|---|
cardType | CardType |
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
| Name | Type |
|---|---|
cardType | CardType |
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
| Name | Type |
|---|---|
cardType | CardType |
Returns
boolean
Defined in
packages/isaacscript-common/src/functions/cards.ts:158
isValidCardType
▸ isValidCardType(cardType): cardType is CardType
Parameters
| Name | Type |
|---|---|
cardType | int |
Returns
cardType is CardType
Defined in
packages/isaacscript-common/src/functions/cards.ts:162
isVanillaCardType
▸ isVanillaCardType(cardType): boolean
Parameters
| Name | Type |
|---|---|
cardType | CardType |
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
| Name | Type |
|---|---|
player | EntityPlayer |
cardType | CardType |
Returns
void