isaacscript-common
Version:
Helper functions and features for IsaacScript mods.
43 lines • 2.6 kB
TypeScript
import type { PocketItemSlot } from "isaac-typescript-definitions";
import type { PocketItemDescription } from "../interfaces/PocketItemDescription";
/**
* Helper function to get the `PocketItemSlot` that the player's pocket active collectible item is
* in, if any. Returns undefined if the player does not have a pocket active item.
*/
export declare function getActivePocketItemSlot(player: EntityPlayer): PocketItemSlot | undefined;
/** Helper item to get the first card that a player is holding in their pocket item slots. */
export declare function getFirstCard(player: EntityPlayer): PocketItemDescription | undefined;
/**
* Helper item to get the first card or pill that a player is holding in their pocket item slots.
*/
export declare function getFirstCardOrPill(player: EntityPlayer): PocketItemDescription | undefined;
/** Helper item to get the first pill that a player is holding in their pocket item slots. */
export declare function getFirstPill(player: EntityPlayer): PocketItemDescription | undefined;
/**
* Use this helper function as a workaround for the `EntityPlayer.GetPocketItem` method not working
* correctly.
*
* Note that due to API limitations, there is no way to determine the location of a Dice Bag trinket
* dice. Furthermore, when the player has a Dice Bag trinket dice and a pocket active at the same
* time, there is no way to determine the location of the pocket active item. If this function
* cannot determine the identity of a particular slot, it will mark the type of the slot as
* `PocketItemType.UNDETERMINABLE`.
*/
export declare function getPocketItems(player: EntityPlayer): readonly PocketItemDescription[];
/**
* Returns whether the player can hold an additional pocket item, beyond what they are currently
* carrying. This takes into account items that modify the max number of pocket items, like Starter
* Deck.
*
* If the player is the Tainted Soul, this always returns false, since that character cannot pick up
* items. (Only Tainted Forgotten can pick up items.)
*/
export declare function hasOpenPocketItemSlot(player: EntityPlayer): boolean;
/**
* Helper function to determine whether the player's "active" pocket item slot is set to their
* pocket active item.
*/
export declare function isFirstSlotPocketActiveItem(player: EntityPlayer): boolean;
/** Helper function to see if two sets of pocket item descriptions are identical. */
export declare function pocketItemsEquals(pocketItems1: readonly PocketItemDescription[], pocketItems2: readonly PocketItemDescription[]): boolean;
//# sourceMappingURL=pocketItems.d.ts.map