UNPKG

isaacscript-common

Version:

Helper functions and features for IsaacScript mods.

45 lines 2.11 kB
import type { PickupIndex } from "../../../types/PickupIndex"; import { Feature } from "../../private/Feature"; export declare class PickupIndexCreation extends Feature { private readonly roomHistory; private readonly saveDataManager; private readonly postPickupInit; private setPickupIndex; private getPickupIndexFromPreviousData; private readonly postEntityRemovePickup; private checkDespawningFromPlayerLeavingRoom; /** * This is a pickup that is despawning because the player is in the process of leaving the room. * Keep track of the metadata for later. */ private trackDespawningPickupMetadata; /** * If the despawning pickup was in a Treasure Room or Boss Room, then it is possible that the * pickup could re-appear during The Ascent. If this is the case, we store the metadata on a * separate map to reference later. */ private getPickupDataMapForCurrentRoom; private getPostAscentPickupIndex; /** * Mods often have to track variables relating to a pickups. Finding an index for these kinds of * data structures is difficult, since pickups are respawned every time a player re-enters a room, * so the `PtrHash` will change. * * Use this function to get a unique index for a pickup to use in these data structures. * * Specifically, `PickupIndex` is a number that represents the spawn order of the pickup on the * current run. For example, the first pickup spawned will have an index of 1, the second one will * have an index of 2, and so on. * * Tracking pickups requires stateful tracking, so using pickup indexes requires an upgraded mod. * * Note that the pickup index will not change: * - When a pickup is rolled with e.g. D6 or D20. * - When an item is "rotated" via e.g. Tainted Isaac's mechanic. * * In order to use this function, you must upgrade your mod with * `ISCFeature.PICKUP_INDEX_CREATION`. */ getPickupIndex(pickup: EntityPickup): PickupIndex; } //# sourceMappingURL=PickupIndexCreation.d.ts.map