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
Name | Type |
---|---|
batterySubType | BatterySubType |
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
Name | Type |
---|---|
bombSubType | BombSubType |
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
Name | Type |
---|---|
pickupVariant | PickupVariant |
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
Name | Type |
---|---|
coinSubType | CoinSubType |
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
Name | Type |
---|---|
coinSubType | CoinSubType |
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
Name | Type |
---|---|
heartSubType | HeartSubType |
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
Name | Type |
---|---|
keySubType | KeySubType |
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
Name | Type |
---|---|
sackSubType | SackSubType |
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
Name | Type |
---|---|
pickup | EntityPickup |
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
Name | Type |
---|---|
pickupVariant | PickupVariant |
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
Name | Type |
---|---|
pickup | EntityPickup |
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
Name | Type |
---|---|
heartSubType | HeartSubType |
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
Name | Type | Description |
---|---|---|
cap? | int | Optional. If specified, will only remove the given amount of hearts. |
Returns
readonly EntityPickupHeart
[]
The red hearts that were removed.