Skip to content

Pickups

getBatteryName(batterySubType): string

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

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

BatterySubType

string


getBombName(bombSubType): string

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

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

BombSubType

string


getChestName(pickupVariant): string

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

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

PickupVariant

string


getCoinName(coinSubType): string

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

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

CoinSubType

string


getCoinValue(coinSubType): int

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

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

CoinSubType

int


getHeartName(heartSubType): string

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

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

HeartSubType

string


getKeyName(keySubType): string

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

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

KeySubType

string


getRedHearts(): readonly EntityPickupHeart[]

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

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

readonly EntityPickupHeart[]


getSackName(sackSubType): string

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

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

SackSubType

string


isChest(pickup): boolean

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

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

EntityPickup

boolean


isChestVariant(pickupVariant): boolean

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

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

PickupVariant

boolean


isRedHeart(pickup): boolean

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

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

EntityPickup

boolean


isRedHeartSubType(heartSubType): boolean

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

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

HeartSubType

boolean


removeAllRedHearts(cap?): readonly EntityPickupHeart[]

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

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

int

Optional. If specified, will only remove the given amount of hearts.

readonly EntityPickupHeart[]

The red hearts that were removed.