isaacscript-common
Version:
Helper functions and features for IsaacScript mods.
94 lines • 4.16 kB
TypeScript
import type { BatterySubType, BombSubType, CoinSubType, HeartSubType, KeySubType, PickupVariant, SackSubType } from "isaac-typescript-definitions";
/**
* 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".
*/
export declare function getBatteryName(batterySubType: BatterySubType): 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".
*/
export declare function getBombName(bombSubType: BombSubType): 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".
*/
export declare function getChestName(pickupVariant: PickupVariant): 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".
*/
export declare function getCoinName(coinSubType: CoinSubType): string;
/**
* Helper function to get the corresponding coin amount from a `CoinSubType`. Returns 1 for modded
* sub-types.
*/
export declare function getCoinValue(coinSubType: CoinSubType): int;
/**
* 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)".
*/
export declare function getHeartName(heartSubType: HeartSubType): 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".
*/
export declare function getKeyName(keySubType: KeySubType): string;
/** Helper function to get all of the red heart pickup entities in the room. */
export declare function getRedHearts(): readonly EntityPickupHeart[];
/**
* 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".
*/
export declare function getSackName(sackSubType: SackSubType): string;
/** Helper function to test if the provided pickup matches one of the various chest variants. */
export declare function isChest(pickup: EntityPickup): boolean;
/**
* Helper function to test if the provided pickup variant matches one of the various chest variants.
*/
export declare function isChestVariant(pickupVariant: PickupVariant): boolean;
/**
* Helper function to test if the provided pickup matches one of the various red heart sub-types.
*/
export declare function isRedHeart(pickup: EntityPickup): boolean;
/**
* Helper function to test if the provided heart sub-type matches one of the various red heart
* sub-types.
*/
export declare function isRedHeartSubType(heartSubType: HeartSubType): boolean;
/**
* Helper function to remove all of the red heart pickup entities in the room.
*
* @param cap Optional. If specified, will only remove the given amount of hearts.
* @returns The red hearts that were removed.
*/
export declare function removeAllRedHearts(cap?: int): readonly EntityPickupHeart[];
//# sourceMappingURL=pickups.d.ts.map