Skip to main content

Pickups

Functions

getBatteryName

getBatteryName(batterySubType): string

Helper function to get the name of a battery, as listed in the "entities2.xml" file. Returns "Unknown" if the provided battery sub-type is not valid.

This function only works for vanilla battery types.

For example, getBatteryName(BatterySubType.MICRO) would return "Micro Battery".

Parameters

NameType
batterySubTypeBatterySubType

Returns

string

Defined in

packages/isaacscript-common/src/functions/pickups.ts:35


getBombName

getBombName(bombSubType): string

Helper function to get the name of a bomb, as listed in the "entities2.xml" file. Returns "Unknown" if the provided bomb sub-type is not valid.

This function only works for vanilla bomb types.

For example, getBombName(BombSubType.DOUBLE_PACK) would return "Double Bomb".

Parameters

NameType
bombSubTypeBombSubType

Returns

string

Defined in

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


getChestName

getChestName(pickupVariant): string

Helper function to get the name of a chest, as listed in the "entities2.xml" file. Returns "Unknown" if the pickup variant was not a chest.

This function only works for vanilla chest types.

For example, getChestName(PickupVariant.SPIKED_CHEST) would return "Spiked Chest".

Parameters

NameType
pickupVariantPickupVariant

Returns

string

Defined in

packages/isaacscript-common/src/functions/pickups.ts:63


getCoinName

getCoinName(coinSubType): string

Helper function to get the name of a coin, as listed in the "entities2.xml" file. Returns "Unknown" if the provided coin sub-type is not valid.

This function only works for vanilla chest types.

For example, getCoinName(CoinSubType.DOUBLE_PACK) would return "Double Penny".

Parameters

NameType
coinSubTypeCoinSubType

Returns

string

Defined in

packages/isaacscript-common/src/functions/pickups.ts:76


getCoinValue

getCoinValue(coinSubType): int

Helper function to get the corresponding coin amount from a CoinSubType. Returns 1 for modded sub-types.

Parameters

NameType
coinSubTypeCoinSubType

Returns

int

Defined in

packages/isaacscript-common/src/functions/pickups.ts:86


getHeartName

getHeartName(heartSubType): string

Helper function to get the name of a heart, as listed in the "entities2.xml" file. Returns "Unknown" if the provided heart sub-type is not valid.

This function only works for vanilla heart types.

For example, getHeartName(HeartSubType.ETERNAL) would return "Heart (eternal)".

Parameters

NameType
heartSubTypeHeartSubType

Returns

string

Defined in

packages/isaacscript-common/src/functions/pickups.ts:101


getKeyName

getKeyName(keySubType): string

Helper function to get the name of a key, as listed in the "entities2.xml" file. Returns "Unknown" if the provided key sub-type is not valid.

This function only works for vanilla key types.

For example, getKeyName(KeySubType.DOUBLE_PACK) would return "Key Ring".

Parameters

NameType
keySubTypeKeySubType

Returns

string

Defined in

packages/isaacscript-common/src/functions/pickups.ts:115


getRedHearts

getRedHearts(): readonly EntityPickupHeart[]

Helper function to get all of the red heart pickup entities in the room.

Returns

readonly EntityPickupHeart[]

Defined in

packages/isaacscript-common/src/functions/pickups.ts:122


getSackName

getSackName(sackSubType): string

Helper function to get the name of a sack, as listed in the "entities2.xml" file. Returns "Unknown" if the provided sack sub-type is not valid.

This function only works for vanilla sack types.

For example, getSackName(SackSubType.NORMAL) would return "Grab Bag".

Parameters

NameType
sackSubTypeSackSubType

Returns

string

Defined in

packages/isaacscript-common/src/functions/pickups.ts:135


isChest

isChest(pickup): boolean

Helper function to test if the provided pickup matches one of the various chest variants.

Parameters

NameType
pickupEntityPickup

Returns

boolean

Defined in

packages/isaacscript-common/src/functions/pickups.ts:142


isChestVariant

isChestVariant(pickupVariant): boolean

Helper function to test if the provided pickup variant matches one of the various chest variants.

Parameters

NameType
pickupVariantPickupVariant

Returns

boolean

Defined in

packages/isaacscript-common/src/functions/pickups.ts:149


isRedHeart

isRedHeart(pickup): boolean

Helper function to test if the provided pickup matches one of the various red heart sub-types.

Parameters

NameType
pickupEntityPickup

Returns

boolean

Defined in

packages/isaacscript-common/src/functions/pickups.ts:156


isRedHeartSubType

isRedHeartSubType(heartSubType): boolean

Helper function to test if the provided heart sub-type matches one of the various red heart sub-types.

Parameters

NameType
heartSubTypeHeartSubType

Returns

boolean

Defined in

packages/isaacscript-common/src/functions/pickups.ts:164


removeAllRedHearts

removeAllRedHearts(cap?): readonly EntityPickupHeart[]

Helper function to remove all of the red heart pickup entities in the room.

Parameters

NameTypeDescription
cap?intOptional. If specified, will only remove the given amount of hearts.

Returns

readonly EntityPickupHeart[]

The red hearts that were removed.

Defined in

packages/isaacscript-common/src/functions/pickups.ts:174