UNPKG

isaacscript-common

Version:

Helper functions and features for IsaacScript mods.

50 lines 2.63 kB
import type { ItemPoolType } from "isaac-typescript-definitions"; import { CollectibleType } from "isaac-typescript-definitions"; import { Feature } from "../../private/Feature"; export declare class ItemPoolDetection extends Feature { private readonly moddedElementSets; /** * Helper function to get the remaining collectibles in a given item pool. This function is * expensive, so only use it in situations where the lag is acceptable. * * In order to use this function, you must upgrade your mod with `ISCFeature.ITEM_POOL_DETECTION`. * * @public */ getCollectiblesInItemPool(itemPoolType: ItemPoolType): readonly CollectibleType[]; /** * Helper function to see if the given collectible is still present in the given item pool. * * If the collectible is non-offensive, any Tainted Losts will be temporarily changed to Isaac and * then changed back. (This is because Tainted Lost is not able to retrieve non-offensive * collectibles from item pools). * * Under the hood, this function works by using the `ItemPool.AddRoomBlacklist` method to * blacklist every collectible except for the one provided. * * In order to use this function, you must upgrade your mod with `ISCFeature.ITEM_POOL_DETECTION`. * * @public */ isCollectibleInItemPool(collectibleType: CollectibleType, itemPoolType: ItemPoolType): boolean; /** * Helper function to see if the given collectible is unlocked on the current save file. This * requires providing the corresponding item pool that the collectible is normally located in. * * - If any player currently has the collectible, then it is assumed to be unlocked. (This is * because in almost all cases, when a collectible is added to a player's inventory, it is * subsequently removed from all pools.) * - If the collectible is located in more than one item pool, then any item pool can be provided. * - If the collectible is not located in any item pools, then this function will always return * false. * - If the collectible is non-offensive, any Tainted Losts will be temporarily changed to Isaac * and then changed back. (This is because Tainted Lost is not able to retrieve non-offensive * collectibles from item pools). * * In order to use this function, you must upgrade your mod with `ISCFeature.ITEM_POOL_DETECTION`. * * @public */ isCollectibleUnlocked(collectibleType: CollectibleType, itemPoolType: ItemPoolType): boolean; } //# sourceMappingURL=ItemPoolDetection.d.ts.map