import { ActiveSlot } from 'isaac-typescript-definitions';
import type { BackdropType } from 'isaac-typescript-definitions';
import type { BatterySubType } from 'isaac-typescript-definitions';
import type { BombSubType } from 'isaac-typescript-definitions';
import type { BombVariant } from 'isaac-typescript-definitions';
import { BossID } from 'isaac-typescript-definitions';
import { ButtonAction } from 'isaac-typescript-definitions';
import { CacheFlag } from 'isaac-typescript-definitions';
import { CallbackPriority } from 'isaac-typescript-definitions';
import { CardType } from 'isaac-typescript-definitions';
import { Challenge } from 'isaac-typescript-definitions';
import type { CoinSubType } from 'isaac-typescript-definitions';
import type { CollectiblePedestalType } from 'isaac-typescript-definitions';
import { CollectibleType } from 'isaac-typescript-definitions';
import { Controller } from 'isaac-typescript-definitions';
import { ControllerIndex } from 'isaac-typescript-definitions';
import { CopyableIsaacAPIClassType } from 'isaac-typescript-definitions';
import { CrawlSpaceVariant } from 'isaac-typescript-definitions';
import { DamageFlag } from 'isaac-typescript-definitions';
import type { DiceFloorSubType } from 'isaac-typescript-definitions';
import { Dimension } from 'isaac-typescript-definitions';
import { Direction } from 'isaac-typescript-definitions';
import { DisplayFlag } from 'isaac-typescript-definitions';
import { DoorSlot } from 'isaac-typescript-definitions';
import type { DoorSlotFlag } from 'isaac-typescript-definitions';
import { DoorVariant } from 'isaac-typescript-definitions';
import type { EffectVariant } from 'isaac-typescript-definitions';
import { EntityFlag } from 'isaac-typescript-definitions';
import { EntityType } from 'isaac-typescript-definitions';
import type { FamiliarVariant } from 'isaac-typescript-definitions';
import { GridCollisionClass } from 'isaac-typescript-definitions';
import { GridEntityType } from 'isaac-typescript-definitions';
import type { GridEntityXMLType } from 'isaac-typescript-definitions';
import type { HeartSubType } from 'isaac-typescript-definitions';
import type { InputHook } from 'isaac-typescript-definitions';
import { ItemConfigCardType } from 'isaac-typescript-definitions';
import { ItemConfigChargeType } from 'isaac-typescript-definitions';
import type { ItemConfigPillEffectClass } from 'isaac-typescript-definitions';
import type { ItemConfigPillEffectType } from 'isaac-typescript-definitions';
import { ItemConfigTag } from 'isaac-typescript-definitions';
import { ItemPoolType } from 'isaac-typescript-definitions';
import { ItemType } from 'isaac-typescript-definitions';
import { Keyboard } from 'isaac-typescript-definitions';
import type { KeySubType } from 'isaac-typescript-definitions';
import type { KnifeVariant } from 'isaac-typescript-definitions';
import type { LaserVariant } from 'isaac-typescript-definitions';
import type { LevelCurse } from 'isaac-typescript-definitions';
import { LevelStage } from 'isaac-typescript-definitions';
import type { MinibossID } from 'isaac-typescript-definitions';
import { ModCallback } from 'isaac-typescript-definitions';
import type { Music } from 'isaac-typescript-definitions';
import type { NPCState } from 'isaac-typescript-definitions';
import type { NullItemID } from 'isaac-typescript-definitions';
import { PickupPrice } from 'isaac-typescript-definitions';
import { PickupVariant } from 'isaac-typescript-definitions';
import { PillColor } from 'isaac-typescript-definitions';
import { PillEffect } from 'isaac-typescript-definitions';
import { PitVariant } from 'isaac-typescript-definitions';
import { PlayerForm } from 'isaac-typescript-definitions';
import { PlayerType } from 'isaac-typescript-definitions';
import type { PlayerVariant } from 'isaac-typescript-definitions';
import type { PocketItemSlot } from 'isaac-typescript-definitions';
import { PoopGridEntityVariant } from 'isaac-typescript-definitions';
import { PressurePlateVariant } from 'isaac-typescript-definitions';
import { ProjectileFlag } from 'isaac-typescript-definitions';
import { ProjectilesMode } from 'isaac-typescript-definitions';
import type { ProjectileVariant } from 'isaac-typescript-definitions';
import { RockVariant } from 'isaac-typescript-definitions';
import { RoomShape } from 'isaac-typescript-definitions';
import { RoomTransitionAnim } from 'isaac-typescript-definitions';
import { RoomType } from 'isaac-typescript-definitions';
import type { SackSubType } from 'isaac-typescript-definitions';
import { SeedEffect } from 'isaac-typescript-definitions';
import { SlotVariant } from 'isaac-typescript-definitions';
import { StageID } from 'isaac-typescript-definitions';
import { StageType } from 'isaac-typescript-definitions';
import { TearFlag } from 'isaac-typescript-definitions';
import type { TearVariant } from 'isaac-typescript-definitions';
import type { TrapdoorVariant } from 'isaac-typescript-definitions';
import { TrinketType } from 'isaac-typescript-definitions';
import { UseFlag } from 'isaac-typescript-definitions';
/**
* Helper type to add two other types.
*
* From: https://gist.github.com/ryandabler/8b4ff4f36aed47bc09acc03174638468
*/
export declare type Add = Length<[
...BuildTuple,
...BuildTuple
]>;
declare interface AddCallbackParametersCustom {
[ModCallbackCustom.ENTITY_TAKE_DMG_FILTER]: [
callback: (entity: Entity, amount: float, damageFlags: BitFlags, source: EntityRef, countdownFrames: int) => boolean | undefined,
entityType?: EntityType,
variant?: number,
subType?: number
];
[ModCallbackCustom.ENTITY_TAKE_DMG_PLAYER]: [
callback: (player: EntityPlayer, amount: float, damageFlags: BitFlags, source: EntityRef, countdownFrames: int) => boolean | undefined,
playerVariant?: PlayerVariant,
character?: PlayerType
];
[ModCallbackCustom.INPUT_ACTION_FILTER]: [
callback: (entity: Entity | undefined, inputHook: InputHook, buttonAction: ButtonAction) => boolean | float | undefined,
inputHook?: InputHook,
buttonAction?: ButtonAction
];
[ModCallbackCustom.INPUT_ACTION_PLAYER]: [
callback: (player: EntityPlayer, inputHook: InputHook, buttonAction: ButtonAction) => boolean | float | undefined,
playerVariant?: PlayerVariant,
character?: PlayerType,
inputHook?: InputHook,
buttonAction?: ButtonAction
];
[ModCallbackCustom.POST_AMBUSH_FINISHED]: [
callback: (ambushType: AmbushType) => void,
ambushType?: AmbushType
];
[ModCallbackCustom.POST_AMBUSH_STARTED]: [
callback: (ambushType: AmbushType) => void,
ambushType?: AmbushType
];
[ModCallbackCustom.POST_BOMB_EXPLODED]: [
callback: (bomb: EntityBomb) => void,
bombVariant?: BombVariant,
subType?: int
];
[ModCallbackCustom.POST_BOMB_INIT_FILTER]: [
callback: (bomb: EntityBomb) => void,
bombVariant?: BombVariant,
subType?: int
];
[ModCallbackCustom.POST_BOMB_INIT_LATE]: [
callback: (bomb: EntityBomb) => void,
bombVariant?: BombVariant,
subType?: int
];
[ModCallbackCustom.POST_BOMB_RENDER_FILTER]: [
callback: (bomb: EntityBomb, renderOffset: Vector) => void,
bombVariant?: BombVariant,
subType?: int
];
[ModCallbackCustom.POST_BOMB_UPDATE_FILTER]: [
callback: (bomb: EntityBomb) => void,
bombVariant?: BombVariant,
subType?: int
];
[ModCallbackCustom.POST_BONE_SWING]: [callback: (knife: EntityKnife) => void];
[ModCallbackCustom.POST_COLLECTIBLE_EMPTY]: [
callback: (collectible: EntityPickupCollectible, oldCollectibleType: CollectibleType) => void,
collectibleType?: CollectibleType
];
[ModCallbackCustom.POST_CURSED_TELEPORT]: [
callback: (player: EntityPlayer) => void,
playerVariant?: PlayerVariant,
character?: PlayerType
];
[ModCallbackCustom.POST_CUSTOM_REVIVE]: [
callback: (player: EntityPlayer, revivalType: int) => void,
revivalType?: int
];
[ModCallbackCustom.POST_DICE_ROOM_ACTIVATED]: [
callback: (player: EntityPlayer, diceFloorSubType: DiceFloorSubType) => void,
diceFloorSubType?: DiceFloorSubType
];
[ModCallbackCustom.POST_DOOR_RENDER]: [
callback: (door: GridEntityDoor) => void,
doorVariant?: DoorVariant
];
[ModCallbackCustom.POST_DOOR_UPDATE]: [
callback: (door: GridEntityDoor) => void,
doorVariant?: DoorVariant
];
[ModCallbackCustom.POST_EFFECT_INIT_FILTER]: [
callback: (effect: EntityEffect) => void,
effectVariant?: EffectVariant,
subType?: int
];
[ModCallbackCustom.POST_EFFECT_INIT_LATE]: [
callback: (effect: EntityEffect) => void,
effectVariant?: EffectVariant,
subType?: int
];
[ModCallbackCustom.POST_EFFECT_RENDER_FILTER]: [
callback: (effect: EntityEffect, renderOffset: Vector) => void,
effectVariant?: EffectVariant,
subType?: int
];
[ModCallbackCustom.POST_EFFECT_STATE_CHANGED]: [
callback: (effect: EntityEffect, previousState: int, currentState: int) => void,
effectVariant?: EffectVariant,
subType?: int
];
[ModCallbackCustom.POST_EFFECT_UPDATE_FILTER]: [
callback: (effect: EntityEffect) => void,
effectVariant?: EffectVariant,
subType?: int
];
[ModCallbackCustom.POST_ENTITY_KILL_FILTER]: [
callback: (entity: Entity) => void,
entityType?: EntityType,
variant?: int,
subType?: int
];
[ModCallbackCustom.POST_ENTITY_REMOVE_FILTER]: [
callback: (entity: Entity) => void,
entityType?: EntityType,
variant?: int,
subType?: int
];
[ModCallbackCustom.POST_ESAU_JR]: [callback: (player: EntityPlayer) => void];
[ModCallbackCustom.POST_FAMILIAR_INIT_FILTER]: [
callback: (familiar: EntityFamiliar) => void,
familiarVariant?: FamiliarVariant,
subType?: int
];
[ModCallbackCustom.POST_FAMILIAR_INIT_LATE]: [
callback: (familiar: EntityFamiliar) => void,
familiarVariant?: FamiliarVariant,
subType?: int
];
[ModCallbackCustom.POST_FAMILIAR_RENDER_FILTER]: [
callback: (familiar: EntityFamiliar, renderOffset: Vector) => void,
familiarVariant?: FamiliarVariant,
subType?: int
];
[ModCallbackCustom.POST_FAMILIAR_STATE_CHANGED]: [
callback: (familiar: EntityFamiliar, previousState: int, currentState: int) => void,
familiarVariant?: FamiliarVariant,
subType?: int
];
[ModCallbackCustom.POST_FAMILIAR_UPDATE_FILTER]: [
callback: (familiar: EntityFamiliar) => void,
familiarVariant?: FamiliarVariant,
subType?: int
];
[ModCallbackCustom.POST_FIRST_ESAU_JR]: [
callback: (player: EntityPlayer) => void
];
[ModCallbackCustom.POST_FIRST_FLIP]: [
callback: (newLazarus: EntityPlayer, oldLazarus: EntityPlayer) => void
];
[ModCallbackCustom.POST_FLIP]: [
callback: (newLazarus: EntityPlayer, oldLazarus: EntityPlayer) => void
];
[ModCallbackCustom.POST_GAME_END_FILTER]: [
callback: (isGameOver: boolean) => void,
isGameOver?: boolean
];
[ModCallbackCustom.POST_GAME_STARTED_REORDERED]: [
callback: (isContinued: boolean) => void,
isContinued: boolean | undefined
];
[ModCallbackCustom.POST_GAME_STARTED_REORDERED_LAST]: [
callback: (isContinued: boolean) => void,
isContinued: boolean | undefined
];
[ModCallbackCustom.POST_GREED_MODE_WAVE]: [
callback: (oldWave: int, newWave: int) => void
];
[ModCallbackCustom.POST_GRID_ENTITY_BROKEN]: [
callback: (gridEntity: GridEntity) => void,
gridEntityType?: GridEntityType,
variant?: int
];
[ModCallbackCustom.POST_GRID_ENTITY_COLLISION]: [
callback: (gridEntity: GridEntity, entity: Entity) => void,
gridEntityType?: GridEntityType,
gridEntityVariant?: int,
entityType?: EntityType,
entityVariant?: int,
entitySubType?: int
];
[ModCallbackCustom.POST_GRID_ENTITY_CUSTOM_BROKEN]: [
callback: (gridEntity: GridEntity, gridEntityTypeCustom: GridEntityType) => void,
gridEntityTypeCustom?: GridEntityType
];
[ModCallbackCustom.POST_GRID_ENTITY_CUSTOM_COLLISION]: [
callback: (gridEntity: GridEntity, gridEntityTypeCustom: GridEntityType, entity: Entity) => void,
gridEntityTypeCustom?: GridEntityType,
entityType?: EntityType,
entityVariant?: int,
entitySubType?: int
];
[ModCallbackCustom.POST_GRID_ENTITY_CUSTOM_INIT]: [
callback: (gridEntity: GridEntity, gridEntityTypeCustom: GridEntityType) => void,
gridEntityTypeCustom?: GridEntityType
];
[ModCallbackCustom.POST_GRID_ENTITY_CUSTOM_REMOVE]: [
callback: (gridIndex: int, gridEntityTypeCustom: GridEntityType) => void,
gridEntityTypeCustom?: GridEntityType
];
[ModCallbackCustom.POST_GRID_ENTITY_CUSTOM_RENDER]: [
callback: (gridEntity: GridEntity, gridEntityTypeCustom: GridEntityType) => void,
gridEntityTypeCustom?: GridEntityType
];
[ModCallbackCustom.POST_GRID_ENTITY_CUSTOM_STATE_CHANGED]: [
callback: (gridEntity: GridEntity, gridEntityTypeCustom: GridEntityType, oldState: int, newState: int) => void,
gridEntityTypeCustom?: GridEntityType
];
[ModCallbackCustom.POST_GRID_ENTITY_CUSTOM_UPDATE]: [
callback: (gridEntity: GridEntity, gridEntityTypeCustom: GridEntityType) => void,
gridEntityTypeCustom?: GridEntityType
];
[ModCallbackCustom.POST_GRID_ENTITY_INIT]: [
callback: (gridEntity: GridEntity) => void,
gridEntityType?: GridEntityType,
variant?: int
];
[ModCallbackCustom.POST_GRID_ENTITY_REMOVE]: [
callback: (gridIndex: int, gridEntityType: GridEntityType, variant: int) => void,
gridEntityType?: GridEntityType,
variant?: int
];
[ModCallbackCustom.POST_GRID_ENTITY_RENDER]: [
callback: (gridEntity: GridEntity) => void,
gridEntityType?: GridEntityType,
variant?: int
];
[ModCallbackCustom.POST_GRID_ENTITY_STATE_CHANGED]: [
callback: (gridEntity: GridEntity, oldState: int, newState: int) => void,
gridEntityType?: GridEntityType,
variant?: int
];
[ModCallbackCustom.POST_GRID_ENTITY_UPDATE]: [
callback: (gridEntity: GridEntity) => void,
gridEntityType?: GridEntityType,
variant?: int
];
[ModCallbackCustom.POST_HOLY_MANTLE_REMOVED]: [
callback: (player: EntityPlayer, oldNumHolyMantles: int, newNumHolyMantles: int) => void,
playerVariant?: PlayerVariant,
character?: PlayerType
];
[ModCallbackCustom.POST_ITEM_DISCHARGE]: [
callback: (player: EntityPlayer, collectibleType: CollectibleType, activeSlot: ActiveSlot) => void,
collectibleType?: CollectibleType
];
[ModCallbackCustom.POST_ITEM_PICKUP]: [callback: (player: EntityPlayer, pickingUpItem: PickingUpItem) => void] | [
callback: (player: EntityPlayer, pickingUpItem: PickingUpItemCollectible) => void,
itemType: ItemType.PASSIVE | ItemType.ACTIVE | ItemType.FAMILIAR,
collectibleType?: CollectibleType
] | [
callback: (player: EntityPlayer, pickingUpItem: PickingUpItemTrinket) => void,
itemType: ItemType.TRINKET,
trinketType?: TrinketType
];
[ModCallbackCustom.POST_KEYBOARD_CHANGED]: [
callback: (keyboard: Keyboard, pressed: boolean) => void,
keyboard?: Keyboard,
pressed?: boolean
];
[ModCallbackCustom.POST_KNIFE_INIT_FILTER]: [
callback: (knife: EntityKnife) => void,
knifeVariant?: KnifeVariant,
subType?: int
];
[ModCallbackCustom.POST_KNIFE_INIT_LATE]: [
callback: (knife: EntityKnife) => void,
knifeVariant?: KnifeVariant,
subType?: int
];
[ModCallbackCustom.POST_KNIFE_RENDER_FILTER]: [
callback: (knife: EntityKnife, renderOffset: Vector) => void,
knifeVariant?: KnifeVariant,
subType?: int
];
[ModCallbackCustom.POST_KNIFE_UPDATE_FILTER]: [
callback: (knife: EntityKnife) => void,
knifeVariant?: KnifeVariant,
subType?: int
];
[ModCallbackCustom.POST_LASER_INIT_FILTER]: [
callback: (laser: EntityLaser) => void,
laserVariant?: LaserVariant,
subType?: int
];
[ModCallbackCustom.POST_LASER_INIT_LATE]: [
callback: (laser: EntityLaser) => void,
laserVariant?: LaserVariant,
subType?: int
];
[ModCallbackCustom.POST_LASER_RENDER_FILTER]: [
callback: (laser: EntityLaser, renderOffset: Vector) => void,
laserVariant?: LaserVariant,
subType?: int
];
[ModCallbackCustom.POST_LASER_UPDATE_FILTER]: [
callback: (laser: EntityLaser) => void,
laserVariant?: LaserVariant,
subType?: int
];
[ModCallbackCustom.POST_NEW_LEVEL_REORDERED]: [
callback: (stage: LevelStage, stageType: StageType) => void,
stage?: LevelStage,
stageType?: StageType
];
[ModCallbackCustom.POST_NEW_ROOM_EARLY]: [
callback: (roomType: RoomType) => void,
roomType?: RoomType
];
[ModCallbackCustom.POST_NEW_ROOM_REORDERED]: [
callback: (roomType: RoomType) => void,
roomType?: RoomType
];
[ModCallbackCustom.POST_NPC_DEATH_FILTER]: [
callback: (npc: EntityNPC) => void,
entityType?: EntityType,
variant?: int,
subType?: int
];
[ModCallbackCustom.POST_NPC_INIT_FILTER]: [
callback: (npc: EntityNPC) => void,
entityType?: EntityType,
variant?: int,
subType?: int
];
[ModCallbackCustom.POST_NPC_INIT_LATE]: [
callback: (npc: EntityNPC) => void,
entityType?: EntityType,
variant?: int,
subType?: int
];
[ModCallbackCustom.POST_NPC_RENDER_FILTER]: [
callback: (npc: EntityNPC, renderOffset: Vector) => void,
entityType?: EntityType,
variant?: int,
subType?: int
];
[ModCallbackCustom.POST_NPC_STATE_CHANGED]: [
callback: (npc: EntityNPC, previousState: int, currentState: int) => void,
entityType?: EntityType,
variant?: int,
subType?: int
];
[ModCallbackCustom.POST_NPC_UPDATE_FILTER]: [
callback: (npc: EntityNPC) => void,
entityType?: EntityType,
variant?: int,
subType?: int
];
[ModCallbackCustom.POST_PEFFECT_UPDATE_REORDERED]: [
callback: (player: EntityPlayer) => void,
playerVariant?: PlayerVariant,
character?: PlayerType
];
[ModCallbackCustom.POST_PICKUP_CHANGED]: [
callback: (pickup: EntityPickup, oldVariant: PickupVariant, oldSubType: int, newVariant: PickupVariant, newSubType: int) => void,
pickupVariant?: PickupVariant,
subType?: int
];
[ModCallbackCustom.POST_PICKUP_COLLECT]: [
callback: (pickup: EntityPickup, player: EntityPlayer) => void,
pickupVariant?: PickupVariant,
subType?: int
];
[ModCallbackCustom.POST_PICKUP_INIT_FILTER]: [
callback: (pickup: EntityPickup) => void,
pickupVariant?: PickupVariant,
subType?: int
];
[ModCallbackCustom.POST_PICKUP_INIT_FIRST]: [
callback: (pickup: EntityPickup) => void,
pickupVariant?: PickupVariant,
subType?: int
];
[ModCallbackCustom.POST_PICKUP_INIT_LATE]: [
callback: (pickup: EntityPickup) => void,
pickupVariant?: PickupVariant,
subType?: int
];
[ModCallbackCustom.POST_PICKUP_RENDER_FILTER]: [
callback: (pickup: EntityPickup, renderOffset: Vector) => void,
pickupVariant?: PickupVariant,
subType?: int
];
[ModCallbackCustom.POST_PICKUP_SELECTION_FILTER]: [
callback: (pickup: EntityPickup, variant: PickupVariant, subType: int) => [pickupVariant: PickupVariant, subType: int] | undefined,
pickupVariant?: PickupVariant,
subType?: int
];
[ModCallbackCustom.POST_PICKUP_STATE_CHANGED]: [
callback: (pickup: EntityPickup, previousState: int, currentState: int) => void,
pickupVariant?: PickupVariant,
subType?: int
];
[ModCallbackCustom.POST_PICKUP_UPDATE_FILTER]: [
callback: (pickup: EntityPickup) => void,
pickupVariant?: PickupVariant,
subType?: int
];
[ModCallbackCustom.POST_PIT_RENDER]: [
callback: (pit: GridEntityPit) => void,
pitVariant?: PitVariant
];
[ModCallbackCustom.POST_PIT_UPDATE]: [
callback: (pit: GridEntityPit) => void,
pitVariant?: PitVariant
];
[ModCallbackCustom.POST_PLAYER_CHANGE_HEALTH]: [
callback: (player: EntityPlayer, healthType: HealthType, difference: int, oldValue: int, newValue: int) => void,
playerVariant?: PlayerVariant,
character?: PlayerType
];
[ModCallbackCustom.POST_PLAYER_CHANGE_STAT]: [
callback: (player: EntityPlayer, playerStat: PlayerStat, difference: int, oldValue: PlayerStats[T], newValue: PlayerStats[T]) => void,
playerVariant?: PlayerVariant,
character?: PlayerType
];
[ModCallbackCustom.POST_PLAYER_CHANGE_TYPE]: [
callback: (player: EntityPlayer, oldCharacter: PlayerType, newCharacter: PlayerType) => void,
playerVariant?: PlayerVariant
];
[ModCallbackCustom.POST_PLAYER_COLLECTIBLE_ADDED]: [
callback: (player: EntityPlayer, collectibleType: CollectibleType) => void,
collectibleType?: CollectibleType
];
[ModCallbackCustom.POST_PLAYER_COLLECTIBLE_REMOVED]: [
callback: (player: EntityPlayer, collectibleType: CollectibleType) => void,
collectibleType?: CollectibleType
];
[ModCallbackCustom.POST_PLAYER_FATAL_DAMAGE]: [
callback: (player: EntityPlayer, amount: float, damageFlags: BitFlags, source: EntityRef, countdownFrames: int) => boolean | undefined,
playerVariant?: PlayerVariant,
character?: PlayerType
];
[ModCallbackCustom.POST_PLAYER_INIT_FIRST]: [
callback: (player: EntityPlayer) => void,
playerVariant?: PlayerVariant,
character?: PlayerType
];
[ModCallbackCustom.POST_PLAYER_INIT_LATE]: [
callback: (player: EntityPlayer) => void,
playerVariant?: PlayerVariant,
character?: PlayerType
];
[ModCallbackCustom.POST_PLAYER_RENDER_REORDERED]: [
callback: (player: EntityPlayer, renderOffset: Vector) => void,
playerVariant?: PlayerVariant,
character?: PlayerType
];
[ModCallbackCustom.POST_PLAYER_UPDATE_REORDERED]: [
callback: (player: EntityPlayer) => void,
playerVariant?: PlayerVariant,
character?: PlayerType
];
[ModCallbackCustom.POST_POOP_RENDER]: [
callback: (poop: GridEntityPoop) => void,
poopVariant?: PoopGridEntityVariant
];
[ModCallbackCustom.POST_POOP_UPDATE]: [
callback: (poop: GridEntityPoop) => void,
poopVariant?: PoopGridEntityVariant
];
[ModCallbackCustom.POST_PRESSURE_PLATE_RENDER]: [
callback: (pressurePlate: GridEntityPressurePlate) => void,
pressurePlateVariant?: PressurePlateVariant
];
[ModCallbackCustom.POST_PRESSURE_PLATE_UPDATE]: [
callback: (pressurePlate: GridEntityPressurePlate) => void,
pressurePlateVariant?: PressurePlateVariant
];
[ModCallbackCustom.POST_PROJECTILE_INIT_FILTER]: [
callback: (projectile: EntityProjectile) => void,
projectileVariant?: ProjectileVariant,
subType?: int
];
[ModCallbackCustom.POST_PROJECTILE_INIT_LATE]: [
callback: (projectile: EntityProjectile) => void,
projectileVariant?: ProjectileVariant,
subType?: int
];
[ModCallbackCustom.POST_PROJECTILE_KILL]: [
callback: (projectile: EntityProjectile) => void,
projectileVariant?: ProjectileVariant,
subType?: number
];
[ModCallbackCustom.POST_PROJECTILE_UPDATE_FILTER]: [
callback: (projectile: EntityProjectile) => void,
projectileVariant?: ProjectileVariant,
subType?: int
];
[ModCallbackCustom.POST_PROJECTILE_RENDER_FILTER]: [
callback: (projectile: EntityProjectile, renderOffset: Vector) => void,
projectileVariant?: ProjectileVariant,
subType?: int
];
[ModCallbackCustom.POST_PURCHASE]: [
callback: (player: EntityPlayer, pickup: EntityPickup) => void,
pickupVariant?: PickupVariant,
subType?: int
];
[ModCallbackCustom.POST_ROCK_RENDER]: [
callback: (rock: GridEntityRock) => void,
gridEntityType?: GridEntityType,
variant?: int
];
[ModCallbackCustom.POST_ROCK_UPDATE]: [
callback: (rock: GridEntityRock) => void,
gridEntityType?: GridEntityType,
variant?: int
];
[ModCallbackCustom.POST_ROOM_CLEAR_CHANGED]: [
callback: (roomClear: boolean) => void,
roomClear?: boolean
];
[ModCallbackCustom.POST_SACRIFICE]: [
callback: (player: EntityPlayer, numSacrifices: int) => void,
playerVariant?: PlayerVariant,
character?: PlayerType
];
[ModCallbackCustom.POST_SLOT_ANIMATION_CHANGED]: [
callback: (slot: EntitySlot, previousAnimation: string, currentAnimation: string) => void,
slotVariant?: SlotVariant,
subType?: int
];
[ModCallbackCustom.POST_SLOT_COLLISION]: [
callback: (slot: EntitySlot, player: EntityPlayer) => void,
slotVariant?: SlotVariant,
subType?: int
];
[ModCallbackCustom.POST_SLOT_DESTROYED]: [
callback: (slot: EntitySlot, slotDestructionType: SlotDestructionType) => void,
slotVariant?: SlotVariant,
subType?: int
];
[ModCallbackCustom.POST_SLOT_INIT]: [
callback: (slot: EntitySlot) => void,
slotVariant?: SlotVariant,
subType?: int
];
[ModCallbackCustom.POST_SLOT_RENDER]: [
callback: (slot: EntitySlot) => void,
slotVariant?: SlotVariant,
subType?: int
];
[ModCallbackCustom.POST_SLOT_UPDATE]: [
callback: (slot: EntitySlot) => void,
slotVariant?: SlotVariant,
subType?: int
];
[ModCallbackCustom.POST_SPIKES_RENDER]: [
callback: (spikes: GridEntitySpikes) => void,
variant?: int
];
[ModCallbackCustom.POST_SPIKES_UPDATE]: [
callback: (spikes: GridEntitySpikes) => void,
variant?: int
];
[ModCallbackCustom.POST_TEAR_INIT_FILTER]: [
callback: (tear: EntityTear) => void,
tearVariant?: TearVariant,
subType?: int
];
[ModCallbackCustom.POST_TEAR_INIT_LATE]: [
callback: (tear: EntityTear) => void,
tearVariant?: TearVariant,
subType?: int
];
[ModCallbackCustom.POST_TEAR_INIT_VERY_LATE]: [
callback: (tear: EntityTear) => void,
tearVariant?: TearVariant,
subType?: int
];
[ModCallbackCustom.POST_TEAR_KILL]: [
callback: (tear: EntityTear) => void,
tearVariant?: TearVariant,
subType?: int
];
[ModCallbackCustom.POST_TEAR_RENDER_FILTER]: [
callback: (tear: EntityTear, renderOffset: Vector) => void,
tearVariant?: TearVariant,
subType?: int
];
[ModCallbackCustom.POST_TEAR_UPDATE_FILTER]: [
callback: (tear: EntityTear) => void,
tearVariant?: TearVariant,
subType?: int
];
[ModCallbackCustom.POST_TNT_RENDER]: [
callback: (tnt: GridEntityTNT) => void,
variant?: int
];
[ModCallbackCustom.POST_TNT_UPDATE]: [
callback: (tnt: GridEntityTNT) => void,
variant?: int
];
[ModCallbackCustom.POST_TRANSFORMATION]: [
callback: (player: EntityPlayer, playerForm: PlayerForm, hasForm: boolean) => void,
playerForm?: PlayerForm
];
[ModCallbackCustom.POST_TRINKET_BREAK]: [
callback: (player: EntityPlayer, trinketType: TrinketType) => void,
trinketType?: TrinketType
];
[ModCallbackCustom.POST_USE_PILL_FILTER]: [
callback: (pillEffect: PillEffect, pillColor: PillColor, player: EntityPlayer, useFlags: BitFlags) => void,
pillEffect?: PillEffect,
pillColor?: PillColor
];
[ModCallbackCustom.PRE_BERSERK_DEATH]: [
callback: (player: EntityPlayer) => void,
playerVariant?: PlayerVariant,
character?: PlayerType
];
[ModCallbackCustom.PRE_BOMB_COLLISION_FILTER]: [
callback: (bomb: EntityBomb, collider: Entity, low: boolean) => boolean | undefined,
bombVariant?: BombVariant,
subtype?: int
];
[ModCallbackCustom.PRE_CUSTOM_REVIVE]: [
callback: (player: EntityPlayer) => int | undefined,
playerVariant?: PlayerVariant,
character?: PlayerType
];
[ModCallbackCustom.PRE_ENTITY_SPAWN_FILTER]: [
callback: (entityType: EntityType, variant: int, subType: int, position: Vector, velocity: Vector, spawner: Entity | undefined, initSeed: Seed) => [entityType: EntityType, variant: int, subType: int, initSeed: Seed] | undefined,
entityType?: EntityType,
variant?: int,
subtype?: int
];
[ModCallbackCustom.PRE_FAMILIAR_COLLISION_FILTER]: [
callback: (familiar: EntityFamiliar, collider: Entity, low: boolean) => boolean | undefined,
familiarVariant?: FamiliarVariant,
subtype?: int
];
[ModCallbackCustom.PRE_GET_PEDESTAL]: [
callback: (player: EntityPlayer, collectible: EntityPickupCollectible) => boolean | undefined,
playerVariant?: PlayerVariant,
character?: PlayerType
];
[ModCallbackCustom.PRE_ITEM_PICKUP]: [
callback: (player: EntityPlayer, pickingUpItem: PickingUpItem) => boolean | undefined
] | [
callback: (player: EntityPlayer, pickingUpItem: PickingUpItemCollectible) => boolean | undefined,
itemType: ItemType.PASSIVE | ItemType.ACTIVE | ItemType.FAMILIAR,
collectibleType?: CollectibleType
] | [
callback: (player: EntityPlayer, pickingUpItem: PickingUpItemTrinket) => boolean | undefined,
itemType: ItemType.TRINKET,
trinketType?: TrinketType
];
[ModCallbackCustom.PRE_KNIFE_COLLISION_FILTER]: [
callback: (knife: EntityKnife, collider: Entity, low: boolean) => boolean | undefined,
knifeVariant?: KnifeVariant,
subtype?: int
];
[ModCallbackCustom.PRE_NEW_LEVEL]: [callback: (player: EntityPlayer) => void];
[ModCallbackCustom.PRE_NPC_COLLISION_FILTER]: [
callback: (npc: EntityNPC, collider: Entity, low: boolean) => undefined | boolean,
entityType?: EntityType,
variant?: int,
subType?: int
];
[ModCallbackCustom.PRE_NPC_UPDATE_FILTER]: [
callback: (npc: EntityNPC) => undefined | boolean,
entityType?: EntityType,
variant?: int,
subType?: int
];
[ModCallbackCustom.PRE_PROJECTILE_COLLISION_FILTER]: [
callback: (projectile: EntityProjectile, collider: Entity, low: boolean) => boolean | undefined,
projectileVariant?: ProjectileVariant,
subtype?: int
];
[ModCallbackCustom.PRE_ROOM_ENTITY_SPAWN_FILTER]: [
callback: (entityTypeOrGridEntityXMLType: EntityType | GridEntityXMLType, variant: int, subType: int, gridIndex: int, initSeed: Seed) => [type: EntityType | GridEntityXMLType, variant: int, subType: int] | undefined,
entityTypeOrGridEntityXMLType?: EntityType | GridEntityXMLType,
variant?: int,
subType?: int
];
[ModCallbackCustom.PRE_TEAR_COLLISION_FILTER]: [
callback: (tear: EntityTear, collider: Entity, low: boolean) => boolean | undefined,
tearVariant?: TearVariant,
subtype?: int
];
}
/**
* Helper function to add a charge to the player's active item. Will flash the HUD and play the
* appropriate sound effect, depending on whether the charge is partially full or completely full.
*
* If the player's active item is already fully charged, then this function will return 0 and not
* flash the HUD or play a sound effect.
*
* This function will take the following things into account:
* - The Battery
* - AAA Battery
*
* @param player The player to grant the charges to.
* @param activeSlot Optional. The slot to grant the charges to. Default is `ActiveSlot.PRIMARY`.
* @param numCharges Optional. The amount of charges to grant. Default is 1.
* @param playSoundEffect Optional. Whether to play a charge-related sound effect. Default is true.
* @returns The amount of charges that were actually granted. For example, if the active item was
* only one away from a full charge, but the `numCharges` provided to this function was 2,
* then this function would return 1.
*/
export declare function addCharge(player: EntityPlayer, activeSlot?: ActiveSlot, numCharges?: number, playSoundEffect?: boolean): int;
/**
* Helper function to add one or more collectibles to a player.
*
* This function is variadic, meaning that you can supply as many collectible types as you want to
* add.
*/
export declare function addCollectible(player: EntityPlayer, ...collectibleTypes: readonly CollectibleType[]): void;
export declare function addCollectibleCostume(player: EntityPlayer, collectibleType: CollectibleType): void;
/**
* Helper function to add a bit flag to an existing set of bit flags.
*
* This is a variadic function, so pass as many flags as you want to add.
*
* Example 1:
*
* ```ts
* // Give the player spectral tears
* const player = Isaac.GetPlayer();
* player.TearFlags = addFlag(player.TearFlags, TearFlags.TEAR_SPECTRAL);
* ```
*
* Example 2:
*
* ```ts
* // Give the player spectral and homing tears
* const player = Isaac.GetPlayer();
* player.TearFlags = addFlag(player.TearFlags, TearFlags.TEAR_SPECTRAL, TearFlags.TEAR_HOMING);
* ```
*
* @param flags The existing set of bit flags.
* @param flagsToAdd One or more bit flags to add, each as a separate argument.
* @returns The combined bit flags.
*/
export declare function addFlag(flags: T | BitFlags, ...flagsToAdd: readonly T[]): BitFlags;
export declare function addPlayerHealthType(player: EntityPlayer, healthType: HealthType, numHearts: int): void;
/**
* Helper function to add a stat to a player based on the `CacheFlag` provided. Call this function
* from the `EVALUATE_CACHE` callback.
*
* Note that for `CacheFlag.FIRE_DELAY`, the "amount" argument will be interpreted as the tear stat
* to add (and not the amount to mutate `EntityPlayer.MaxFireDelay` by).
*
* This function supports the following cache flags:
* - CacheFlag.DAMAGE (1 << 0)
* - CacheFlag.FIRE_DELAY (1 << 1)
* - CacheFlag.SHOT_SPEED (1 << 2)
* - CacheFlag.RANGE (1 << 3)
* - CacheFlag.SPEED (1 << 4)
* - CacheFlag.LUCK (1 << 10)
*/
export declare function addPlayerStat(player: EntityPlayer, cacheFlag: CacheFlag, amount: number): void;
/**
* Helper function to add a charge to a player's active item(s), emulating what happens when a room
* is cleared.
*
* This function will take the following things into account:
* - 2x2 rooms and L rooms granting a double charge
* - The Battery
* - AAA Battery
* - Not charging active items with `chargetype="special"`
*
* @param player The player to grant the charges to.
* @param bigRoomDoubleCharge Optional. If set to false, it will treat the current room as a 1x1
* room for the purposes of calculating how much charge to grant. Default
* is true.
* @param playSoundEffect Optional. Whether to play a charge-related sound effect. Default is true.
*/
export declare function addRoomClearCharge(player: EntityPlayer, bigRoomDoubleCharge?: boolean, playSoundEffect?: boolean): void;
/**
* Helper function to add a charge to every player's active item, emulating what happens when a room
* is cleared.
*
* This function will take the following things into account:
* - L rooms and 2x2 rooms granting a double charge
* - The Battery
* - AAA Battery
*
* @param bigRoomDoubleCharge Optional. If set to false, it will treat the current room as a 1x1
* room for the purposes of calculating how much charge to grant. Default
* is true.
*/
export declare function addRoomClearCharges(bigRoomDoubleCharge?: boolean): void;
/**
* Helper function to add a charge to one of a player's active items, emulating what happens when a
* room is cleared.
*
* This function will take the following things into account:
* - L rooms and 2x2 rooms granting a double charge
* - The Battery
* - AAA Battery
* - Not charging active items with `chargetype="special"`
*
* @param player The player to grant the charges to.
* @param activeSlot Optional. The active item slot to grant the charges to. Default is
* `ActiveSlot.PRIMARY`.
* @param bigRoomDoubleCharge Optional. If set to false, it will treat the current room as a 1x1
* room for the purposes of calculating how much charge to grant. Default
* is true.
* @param playSoundEffect Optional. Whether to play a charge-related sound effect. Default is true.
*/
export declare function addRoomClearChargeToSlot(player: EntityPlayer, activeSlot?: ActiveSlot, bigRoomDoubleCharge?: boolean, playSoundEffect?: boolean): void;
/**
* Helper function to add a `DisplayFlag` to a particular room's minimap display flags (e.g. whether
* it is visible and so on).
*
* This function automatically accounts for if MinimapAPI is being used.
*
* @param roomGridIndex Set to undefined to use the current room index.
* @param displayFlag The `DisplayFlag` to set. (See the `DisplayFlag` enum.)
* @param updateVisibility Optional. Whether to call the `Level.UpdateVisibility` method in order to
* make the changes immediately visible. Default is true.
*/
export declare function addRoomDisplayFlag(roomGridIndex: int | undefined, displayFlag: DisplayFlag, updateVisibility?: boolean): void;
/**
* Helper function to add all of the values in one set to another set. The first set passed will be
* modified in place.
*
* This function is variadic, meaning that you can specify N sets to add to the first set.
*/
export declare function addSetsToSet(mainSet: Set, ...setsToAdd: ReadonlyArray>): void;
/**
* - Converts the specified amount of tears stat into the format of `EntityPlayer.MaxFireDelay` and
* adds it to the player.
* - This function should only be used inside the `EVALUATE_CACHE` callback.
* - In this context, the "tears stat" represents what is shown on the in-game stat UI.
*
* For example:
*
* ```ts
* function evaluateCacheTears(player: EntityPlayer) {
* const numFoo = player.GetNumCollectible(CollectibleTypeCustom.FOO);
* const tearsStat = numFoo * FOO_TEARS_STAT;
* addTearsStat(player, tearsStat);
* }
* ```
*/
export declare function addTearsStat(player: EntityPlayer, tearsStat: float): void;
export declare function addTrinketCostume(player: EntityPlayer, trinketType: TrinketType): void;
/**
* The combination of the following flags:
* - `DisplayFlag.VISIBLE` (1 << 0)
* - `DisplayFlag.SHADOW` (1 << 1)
* - `DisplayFlag.SHOW_ICON` (1 << 2)
*/
export declare const ALL_DISPLAY_FLAGS: BitFlags;
/** Helper type to create a new tuple containing all but the first element of another tuple. */
export declare type AllButFirst = T extends [
unknown,
...infer Tail
] ? Tail : unknown[];
/** Helper type to create a new tuple containing all but the last element of another tuple. */
export declare type AllButLast = T extends [...infer Head, unknown] ? Head : unknown[];
/** This is used by the `POST_AMBUSH_STARTED` and `POST_AMBUSH_FINISHED` custom callbacks. */
export declare enum AmbushType {
CHALLENGE_ROOM = 0,
BOSS_RUSH = 1
}
/**
* Helper function to convert the degrees of an angle to the `Direction` enum.
*
* Note that this function considers 0 degrees to be pointing to the right, which is unusual because
* 0 normally corresponds to up. (This corresponds to how the `Vector.GetAngleDegrees` method
* works.)
*/
export declare function angleToDirection(angleDegrees: int): Direction;
/** Helper type to represent any class. (This is the same type as any class constructor.) */
export declare type AnyClass = new () => object;
/** Alias for the `anySeedEffectEnabled` function. */
export declare function anyEasterEggEnabled(exceptions?: readonly SeedEffect[]): boolean;
/**
* A type union that matches `Entity`, `EntityBomb`, `EntityEffect`, and so on.
*
* This is useful for building generic functions that should accept any kind of entity.
*/
export declare type AnyEntity = Entity | EntityBomb | EntityEffect | EntityFamiliar | EntityKnife | EntityLaser | EntityNPC | EntityPickup | EntityPlayer | EntityProjectile | EntityTear;
export declare function anyEntityCloserThan(entities: readonly Entity[], position: Vector, distance: int): boolean;
/**
* Helper type to represent any function. This is safer than using the built-in `Function` type, as
* it does not completely turn off all type safety.
*/
export declare type AnyFunction = (...args: readonly unknown[]) => unknown;
/**
* A type union that matches `GridEntity`, `GridEntityDoor`, `GridEntityPit`, and so on.
*
* This is useful for building generic functions that should accept any kind of grid entity.
*/
export declare type AnyGridEntity = GridEntity | GridEntityDoor | GridEntityPit | GridEntityPoop | GridEntityPressurePlate | GridEntityRock | GridEntitySpikes | GridEntityTNT;
/**
* Iterates over all players and checks if any player is close enough to the specified position.
*
* Note that this function does not consider players with a non-undefined parent, since they are not
* real players (e.g. the Strawman Keeper).
*/
export declare function anyPlayerCloserThan(position: Vector, distance: float): boolean;
/**
* Helper function to check to see if any player has a particular collectible.
*
* @param collectibleType The collectible type to check for.
* @param ignoreModifiers If set to true, only counts collectibles the player actually owns and
* ignores effects granted by items like Zodiac, 3 Dollar Bill and Lemegeton.
* Default is false.
*/
export declare function anyPlayerHasCollectible(collectibleType: CollectibleType, ignoreModifiers?: boolean): boolean;
/** Helper function to check to see if any player has a temporary collectible effect. */
export declare function anyPlayerHasCollectibleEffect(collectibleType: CollectibleType): boolean;
/** Helper function to check to see if any player has a temporary null effect. */
export declare function anyPlayerHasNullEffect(nullItemID: NullItemID): boolean;
/**
* Helper function to check to see if any player has a particular trinket.
*
* @param trinketType The trinket type to check for.
* @param ignoreModifiers If set to true, only counts trinkets the player actually holds and ignores
* effects granted by other items. Default is false.
*/
export declare function anyPlayerHasTrinket(trinketType: TrinketType, ignoreModifiers?: boolean): boolean;
/** Helper function to check to see if any player has a temporary trinket effect. */
export declare function anyPlayerHasTrinketEffect(trinketType: TrinketType): boolean;
/**
* Helper function to check to see if any player is holding up an item (from e.g. an active item
* activation, a poop from IBS, etc.).
*/
export declare function anyPlayerHoldingItem(): boolean;
/**
* Helper function to determine if the given character is present.
*
* This function is variadic, meaning that you can supply as many characters as you want to check
* for. Returns true if any of the characters supplied are present.
*/
export declare function anyPlayerIs(...matchingCharacters: readonly PlayerType[]): boolean;
/**
* Helper function to see if any seed effects (i.e. Easter Eggs) are enabled for the current run.
*
* @param exceptions Optional. An array of seed effects to ignore.
*/
export declare function anySeedEffectEnabled(exceptions?: readonly SeedEffect[]): boolean;
declare type Arr = T["length"] extends N ? T : Arr;
declare type Arr_2 = T["length"] extends N ? T : Arr_2;
/**
* Helper function for determining if two arrays contain the exact same elements. Note that this
* only performs a shallow comparison.
*/
export declare function arrayEquals(array1: readonly T[], array2: readonly T[]): boolean;
/**
* Builds a new array based on the original array without the specified element(s). Returns the new
* array. If the specified element(s) are not found in the array, it will simply return a shallow
* copy of the array.
*
* If there is more than one matching element in the array, this function will remove all of them.
*
* This function is variadic, meaning that you can specify N arguments to remove N elements.
*/
export declare function arrayRemove(originalArray: readonly T[], ...elementsToRemove: readonly T[]): T[];
/**
* Removes all of the specified element(s) from the array. If the specified element(s) are not found
* in the array, this function will do nothing.
*
* This function is variadic, meaning that you can specify N arguments to remove N elements.
*
* If there is more than one matching element in the array, this function will remove every matching
* element. If you want to only remove the first matching element, use the `arrayRemoveInPlace`
* function instead.
*
* @returns True if one or more elements were removed, false otherwise.
*/
export declare function arrayRemoveAllInPlace(array: T[], ...elementsToRemove: readonly T[]): boolean;
/**
* Shallow copies and removes the elements at the specified indexes from the array. Returns the
* copied array. If the specified indexes are not found in the array, it will simply return a
* shallow copy of the array.
*
* This function is variadic, meaning that you can specify N arguments to remove N elements.
*/
export declare function arrayRemoveIndex(originalArray: readonly T[], ...indexesToRemove: readonly int[]): T[];
/**
* Removes the elements at the specified indexes from the array. If the specified indexes are not
* found in the array, this function will do nothing.
*
* This function is variadic, meaning that you can specify N arguments to remove N elements.
*
* @returns The removed elements. This will be an empty array if no elements were removed.
*/
export declare function arrayRemoveIndexInPlace(array: T[], ...indexesToRemove: readonly int[]): T[];
/**
* Removes the specified element(s) from the array. If the specified element(s) are not found in the
* array, this function will do nothing.
*
* This function is variadic, meaning that you can specify N arguments to remove N elements.
*
* If there is more than one matching element in the array, this function will only remove the first
* matching element. If you want to remove all of the elements, use the `arrayRemoveAllInPlace`
* function instead.
*
* @returns The removed elements. This will be an empty array if no elements were removed.
*/
export declare function arrayRemoveInPlace(array: T[], ...elementsToRemove: readonly T[]): T[];
/** Helper function to convert a set of flags to a single `BitFlags` object. */
export declare function arrayToBitFlags(array: readonly T[]): BitFlags;
export declare function arrayToString(array: readonly unknown[]): string;
/**
* Helper function to safely cast an `int` to a `CardType`. (This is better than using the `as`
* TypeScript keyword to do a type assertion, since that can obfuscate compiler errors. )
*
* This is useful to satisfy the "complete/strict-enums" ESLint rule.
*/
export declare function asCardType(num: int): CardType;
/**
* Helper function to safely cast an `int` to a `CollectibleType`. (This is better than using the
* `as` TypeScript keyword to do a type assertion, since that can obfuscate compiler errors. )
*
* This is useful to satisfy the "complete/strict-enums" ESLint rule.
*/
export declare function asCollectibleType(num: int): CollectibleType;
/**
* Helper function to safely cast an enum to an `int`. (This is better than using the `as`
* TypeScript keyword to do a type assertion, since that can obfuscate compiler errors. )
*
* This is useful to satisfy the "complete/strict-enums" ESLint rule.
*/
export declare function asFloat(num: number): float;
/**
* Helper function to safely cast an enum to an `int`. (This is better than using the `as`
* TypeScript keyword to do a type assertion, since that can obfuscate compiler errors. )
*
* This is useful to satisfy the "complete/strict-enums" ESLint rule.
*/
export declare function asInt(num: number): int;
/**
* Helper function to safely cast an `int` to a `LevelStage`. (This is better than using the `as`
* TypeScript keyword to do a type assertion, since that can obfuscate compiler errors. )
*
* This is useful to satisfy the "complete/strict-enums" ESLint rule.
*/
export declare function asLevelStage(num: int): LevelStage;
/**
* Helper function to safely cast an `int` to a `NPCState`. (This is better than using the `as`
* TypeScript keyword to do a type assertion, since that can obfuscate compiler errors. )
*
* This is useful to satisfy the "complete/strict-enums" ESLint rule.
*/
export declare function asNPCState(num: int): NPCState;
/**
* Helper function to safely cast an enum to a `number`. (This is better than using the `as`
* TypeScript keyword to do a type assertion, since that can obfuscate compiler errors. )
*
* This is useful to satisfy the "complete/strict-enums" ESLint rule.
*/
export declare function asNumber(num: number): number;
/**
* Helper function to safely cast an `int` to a `PillColor`. (This is better than using the `as`
* TypeScript keyword to do a type assertion, since that can obfuscate compiler errors. )
*
* This is useful to satisfy the "complete/strict-enums" ESLint rule.
*/
export declare function asPillColor(num: int): PillColor;
/**
* Helper function to safely cast an `int` to a `PillEffect`. (This is better than using the `as`
* TypeScript keyword to do a type assertion, since that can obfuscate compiler errors. )
*
* This is useful to satisfy the "complete/strict-enums" ESLint rule.
*/
export declare function asPillEffect(num: int): PillEffect;
/**
* Helper function to safely cast an `int` to a `PlayerType`. (This is better than using the `as`
* TypeScript keyword to do a type assertion, since that can obfuscate compiler errors. )
*
* This is useful to satisfy the "complete/strict-enums" ESLint rule.
*/
export declare function asPlayerType(num: int): PlayerType;
/**
* Helper function to safely cast an `int` to a `RoomType`. (This is better than using the `as`
* TypeScript keyword to do a type assertion, since that can obfuscate compiler errors. )
*
* This is useful to satisfy the "complete/strict-enums" ESLint rule.
*/
export declare function asRoomType(num: int): RoomType;
/**
* Helper function to throw an error (using the `error` Lua function) if the provided value is equal
* to `undefined`.
*
* This is useful to have TypeScript narrow a `T | undefined` value to `T` in a concise way.
*/
export declare function assertDefined(value: T, ...[msg]: [undefined] extends [T] ? [string] : [
"The assertion is useless because the provided value does not contain undefined."
]): asserts value is Exclude;
/**
* Helper function to throw an error (using the `error` Lua function) if the provided value is equal
* to `null`.
*
* This is useful to have TypeScript narrow a `T | null` value to `T` in a concise way.
*/
export declare function assertNotNull(value: T, ...[msg]: [null] extends [T] ? [string] : [
"The assertion is useless because the provided value does not contain null."
]): asserts value is Exclude;
/**
* Helper function to safely cast an enum to a `string`. (This is better than using the `as`
* TypeScript keyword to do a type assertion, since that can obfuscate compiler errors. )
*
* This is useful to satisfy the "complete/strict-enums" ESLint rule.
*/
export declare function asString(str: string): string;
/**
* Helper function to safely cast an `int` to a `TrinketType`. (This is better than using the `as`
* TypeScript keyword to do a type assertion, since that can obfuscate compiler errors. )
*
* This is useful to satisfy the "complete/strict-enums" ESLint rule.
*/
export declare function asTrinketType(num: int): TrinketType;
/**
* The distance of the laser when Azazel does not have any range up items yet. For more info, see
* the documentation for the `getAzazelBrimstoneDistance` function.
*/
export declare const AZAZEL_DEFAULT_BRIMSTONE_DISTANCE = 75.125;
/**
* Helper function to benchmark the performance of a function.
*
* This function is variadic, which means that you can supply as many functions as you want to
* benchmark.
*
* This function uses the `Isaac.GetTime` method to record how long the function took to execute.
* This method only reports time in milliseconds. For this reason, if you are benchmarking smaller
* functions, then you should provide a very high value for the number of trials.
*
* @returns An array containing the average time in milliseconds for each function. (This will also
* be printed to the log.)
*/
export declare function benchmark(numTrials: int, ...functions: ReadonlyArray<() => void>): readonly int[];
/**
* Helper function for casting a flag enum value to a `BitFlags` object.
*
* This is useful because the compiler will prevent you from assigning a specific flag to a
* `BitFlags` field. (It does this to ensure type safety, since `BitFlags` can represent a zero
* value or a composition of N flags.)
*
* For example:
*
* ```ts
* player.TearFlags = bitFlags(TearFlag.SPECTRAL);
* ```
*/
export declare function bitFlags(flag: T): BitFlags;
/**
* The path to the png file for collectible items during Curse of the Blind, making them appear with
* a red question mark.
*/
export declare const BLIND_ITEM_PNG_PATH = "gfx/items/collectibles/questionmark.png";
/** Bombs explode when their frame count is equal to this value. */
export declare const BOMB_EXPLODE_FRAME = 45;
declare type BuildTuple = T extends {
length: L;
} ? T : BuildTuple;
/**
* Helper function that calculates what the stage type should be for the provided stage. This
* emulates what the game's internal code does.
*/
export declare function calculateStageType(stage: LevelStage): StageType;
/**
* Helper function that calculates what the Repentance stage type should be for the provided stage.
* This emulates what the game's internal code does.
*/
export declare function calculateStageTypeRepentance(stage: LevelStage): StageType;
/**
* A decorator function that signifies that the decorated class method should be automatically
* registered with `Mod.AddCallback`.
*
* @allowEmptyVariadic
* @ignore
*/
export declare function Callback(modCallback: T, ...optionalArgs: AllButFirst): (target: ModFeature, propertyKey: string, _descriptor: TypedPropertyDescriptor) => void;
/**
* A decorator function that signifies that the decorated class method should be automatically
* registered with `ModUpgraded.AddCallbackCustom`.
*
* @allowEmptyVariadic
* @ignore
*/
export declare function CallbackCustom(modCallbackCustom: T, ...optionalArgs: AllButFirst): (target: ModFeature, propertyKey: string, _descriptor: TypedPropertyDescriptor) => void;
/**
* Helper function to determine if the given character can have red heart containers. Returns true
* for characters like Isaac, Magdalene, or Cain. Returns true for Keeper and Tainted Keeper, even
* though coin containers are not technically the same as red heart containers. Returns false for
* characters like Blue Baby. Returns false for The Lost and Tainted Lost.
*/
export declare function canCharacterHaveRedHearts(character: PlayerType): boolean;
/**
* Helper function to determine if the given character can have soul hearts. Returns true for
* characters like Isaac, Magdalene, or Cain. Returns false for characters like Bethany. Returns
* false for The Lost and Tainted Lost.
*/
export declare function canCharacterHaveSoulHearts(character: PlayerType): boolean;
/**
* Helper function for determining whether the given character can take free Devil Deals. (e.g. The
* Lost, Tainted Lost, etc.)
*/
export declare function canCharacterTakeFreeDevilDeals(character: PlayerType): boolean;
/**
* Helper function to see if the provided player can pick up an eternal heart. (If a player already
* has an eternal heart and full heart containers, they are not able to pick up any additional
* eternal hearts.)
*
* This function's name matches the existing `EntityPlayer` methods.
*/
export declare function canPickEternalHearts(player: EntityPlayer): boolean;
/**
* Helper function to determine if a player will destroy a rock/pot/skull if they walk over it.
*
* The following situations allow for this to be true:
* - the player has Leo (collectible 302)
* - the player has Thunder Thighs (collectible 314)
* - the player is under the effects of Mega Mush (collectible 625)
* - the player has Stompy (transformation 13)
*/
export declare function canPlayerCrushRocks(player: EntityPlayer): boolean;
export declare function capitalizeFirstLetter(string: string): string;
/** Maps card names to the values of the `CardType` enum. */
export declare const CARD_NAME_TO_TYPE_MAP: ReadonlyMap;
/**
* Helper function for quickly switching to a new room without playing a particular animation. Use
* this helper function over invoking the `Game.ChangeRoom` method directly to ensure that you do
* not forget to set the `LeaveDoor` field and to prevent crashing on invalid room grid indexes.
*/
export declare function changeRoom(roomGridIndex: int): void;
/** Maps character names to the values of the `PlayerType` enum. */
export declare const CHARACTER_NAME_TO_TYPE_MAP: ReadonlyMap;
declare class CharacterHealthConversion extends Feature {
private readonly characterHealthReplacementMap;
private readonly prePickupCollisionHeart;
private readonly postPEffectUpdateReordered;
/**
* Helper function to make a character that has the same health mechanic as Blue Baby (red heart
* containers --> soul hearts) or Dark Judas (red heart containers --> black hearts).
*
* Call this function once at the beginning of your mod to declare the health conversion type.
*
* In order to use this function, you must upgrade your mod with
* `ISCFeature.CHARACTER_HEALTH_CONVERSION`.
*
* @public
*/
registerCharacterHealthConversion(playerType: PlayerType, conversionHeartSubType: ConversionHeartSubType): void;
}
/** Easily create custom characters that have base stats different from that of Isaac. */
declare class CharacterStats extends Feature {
private readonly charactersStatMap;
private readonly evaluateCache;
/**
* Helper function to manage the stats for a vanilla or custom character. Call this function once
* at the beginning of your mod to declare the starting stats.
*
* You must provide this function with a map of CacheFlag to the default stat amount. For example,
* the default amount of damage is 3.5. To make a custom character start with 4.5 damage:
*
* ```ts
* const fooDefaultStats = new Map([
* [CacheFlag.DAMAGE, 4.5],
* ])
* registerCharacterStats(PlayerTypeCustom.FOO, fooDefaultStats);
* ```
*
* Note that the format for the `CacheFlag.FIRE_DELAY` value should be in the tears stat format,
* not the `MaxFireDelay` format.
*
* In order to use this function, you must upgrade your mod with `ISCFeature.CHARACTER_STATS`.
*
* @public
*/
registerCharacterStats(playerType: PlayerType, statMap: ReadonlyMap): void;
}
/**
* A collection of the four sprites necessary in order to render a charge bar.
*
* This is used in the `newChargeBarSprites` and related helper functions.
*/
export declare interface ChargeBarSprites {
back: Sprite;
meter: Sprite;
meterBattery: Sprite;
lines: Sprite;
maxCharges: int;
}
/**
* Helper function to add and remove familiars based on a target amount that you specify.
*
* This is a convenience wrapper around the `EntityPlayer.CheckFamiliar` method. Use this helper
* function instead so that you do not have to retrieve the `ItemConfigItem` and so that you do not
* specify an incorrect RNG object. (The vanilla method is bugged in that it does not increment the
* RNG object; see the documentation of the method for more details.)
*
* This function is meant to be called in the `EVALUATE_CACHE` callback (when the cache flag is
* equal to `CacheFlag.FAMILIARS`).
*
* Note that this function is only meant to be used in special circumstances where the familiar
* count is completely custom and does not correspond to the amount of collectibles. For the general
* case, use the `checkFamiliarFromCollectibles` helper function instead.
*
* Note that this will spawn familiars with a completely random `InitSeed`. When calculating random
* events for this familiar, you should use a data structure that maps familiar `InitSeed` to RNG
* objects that are initialized based on the seed from
* `EntityPlayer.GetCollectibleRNG(collectibleType)`.
*
* @param player The player that owns the familiars.
* @param collectibleType The collectible type of the collectible associated with this familiar.
* @param targetCount The number of familiars that should exist. This function will add or remove
* familiars until it matches the target count.
* @param familiarVariant The variant of the familiar to spawn or remove.
* @param familiarSubType Optional. The sub-type of the familiar to spawn or remove. If not
* specified, it will search for existing familiars of all sub-types, and
* spawn new familiars with a sub-type of 0.
*/
export declare function checkFamiliar(player: EntityPlayer, collectibleType: CollectibleType, targetCount: int, familiarVariant: FamiliarVariant, familiarSubType?: int): void;
/**
* Helper function to add and remove familiars based on the amount of associated collectibles that a
* player has.
*
* Use this helper function instead of invoking the `EntityPlayer.CheckFamiliar` method directly so
* that the target count is handled automatically.
*
* This function is meant to be called in the `EVALUATE_CACHE` callback (when the cache flag is
* equal to `CacheFlag.FAMILIARS`).
*
* Use this function when the amount of familiars should be equal to the amount of associated
* collectibles that the player has (plus any extras from having used Box of Friends or Monster
* Manual). If you instead need to have a custom amount of familiars, use the `checkFamiliars`
* function instead.
*
* Note that this will spawn familiars with a completely random `InitSeed`. When calculating random
* events for this familiar, you should use a data structure that maps familiar `InitSeed` to RNG
* objects that are initialized based on the seed from
* `EntityPlayer.GetCollectibleRNG(collectibleType)`.
*
* @param player The player that owns the familiars and collectibles.
* @param collectibleType The collectible type of the collectible associated with this familiar.
* @param familiarVariant The variant of the familiar to spawn or remove.
* @param familiarSubType Optional. The sub-type of the familiar to spawn or remove. If not
* specified, it will search for existing familiars of all sub-types, and
* spawn new familiars with a sub-type of 0.
*/
export declare function checkFamiliarFromCollectibles(player: EntityPlayer, collectibleType: CollectibleType, familiarVariant: FamiliarVariant, familiarSubType?: int): void;
export declare const CHEST_PICKUP_VARIANTS: readonly [PickupVariant.CHEST, PickupVariant.BOMB_CHEST, PickupVariant.SPIKED_CHEST, PickupVariant.ETERNAL_CHEST, PickupVariant.MIMIC_CHEST, PickupVariant.OLD_CHEST, PickupVariant.WOODEN_CHEST, PickupVariant.MEGA_CHEST, PickupVariant.HAUNTED_CHEST, PickupVariant.LOCKED_CHEST, PickupVariant.RED_CHEST, PickupVariant.MOMS_CHEST];
export declare const CHEST_PICKUP_VARIANTS_SET: ReadonlySet;
/**
* Helper function to normalize a number, ensuring that it is within a certain range.
*
* - If `num` is less than `min`, then it will be clamped to `min`.
* - If `num` is greater than `max`, then it will be clamped to `max`.
*/
export declare function clamp(num: number, min: number, max: number): number;
/**
* Helper function to clear the current challenge, which will restart the run on a new random
* non-challenge seed with the current character.
*
* If the player is not in a challenge already, this function will do nothing.
*
* Under the hood, this function executes the `challenge 0` console command.
*/
export declare function clearChallenge(): void;
export declare function clearCollectibleSprite(collectible: EntityPickup): void;
/**
* Helper function to set the value of `DisplayFlag` for every room on the floor to 0.
*
* This function automatically accounts for if MinimapAPI is being used.
*
* This function automatically calls the `Level.UpdateVisibility` after setting the flags so that
* the changes will be immediately visible.
*/
export declare function clearFloorDisplayFlags(): void;
/**
* Helper function to set the value of `DisplayFlag` for a room 0.
*
* This function automatically accounts for if MinimapAPI is being used.
*
* This function automatically calls the `Level.UpdateVisibility` after setting the flags so that
* the changes will be immediately visible.
*
* Note that if you clear the display flags of a room but then the player travels to the room (or an
* adjacent room), the room will appear on the minimap again. If you want to permanently hide the
* room even in this circumstance, use the `hideRoomOnMinimap` helper function instead.
*/
export declare function clearRoomDisplayFlags(roomGridIndex: int): void;
/**
* Helper function to clear all layers or specific layers from a sprite without unloading the
* attached anm2 file.
*
* This function is variadic, which means you can pass as many layer IDs as you want to clear. If no
* specific layers are passed, the function will clear every layer.
*
* If you want to clear all of the layers of a sprite and don't care about unloading the attached
* anm2 file, then use the `Sprite.Reset` method instead.
*
* Since there is no official API method to clear specific layers from a sprite, we work around it
* by setting the spritesheet to a transparent PNG file corresponding to the `EMPTY_PNG_PATH`
* constant.
*
* This function will still work identically if PNG file does not exist, but it will cause a
* spurious error to appear in the "log.txt" file. If silencing these errors is desired, you can
* create a transparent 1 pixel PNG file in your mod's resources folder at `EMPTY_PNG_PATH`.
*
* @allowEmptyVariadic
*/
export declare function clearSprite(sprite: Sprite, ...layerIDs: readonly int[]): void;
/**
* In a `Map`, you can use the `clear` method to delete every element. However, in a `LuaMap`, the
* `clear` method does not exist. Use this helper function as a drop-in replacement for this.
*/
export declare function clearTable(luaMap: LuaMap): void;
export declare function closeAllDoors(): void;
/**
* Use this instead of the `GridEntityDoor.Close` method if you want the door to immediately close
* without an animation.
*/
export declare function closeDoorFast(door: GridEntityDoor): void;
/** This is the initial value of the `EntityPickup.Wait` field after a collectible is spawned. */
export declare const COLLECTIBLE_INITIAL_WAIT = 20;
/**
* Maps collectible names to the values of the `CollectibleType` enum.
*
* For a mapping of `CollectibleType` to name, see the `COLLECTIBLE_NAMES` constant.
*/
export declare const COLLECTIBLE_NAME_TO_TYPE_MAP: ReadonlyMap;
/** Helper function to check in the item config if a given collectible has a given cache flag. */
export declare function collectibleHasCacheFlag(collectibleOrCollectibleType: EntityPickup | CollectibleType, cacheFlag: CacheFlag): boolean;
export declare function collectibleHasTag(collectibleOrCollectibleType: EntityPickupCollectible | CollectibleType, tag: ItemConfigTag): boolean;
declare class CollectibleItemPoolType extends Feature {
private readonly pickupIndexCreation;
private readonly postPickupInitCollectible;
/**
* Helper function to get the item pool type that a given collectible came from. Since there is no
* native method in the API to get this, we listen in the `POST_PICKUP_INIT` callback for
* collectibles, use the `ItemPool.GetLastPool` method, and then assume that the collectible
* matches.
*
* In order to use this function, you must upgrade your mod with
* `ISCFeature.COLLECTIBLE_ITEM_POOL_TYPE`.
*
* @public
*/
getCollectibleItemPoolType(collectible: EntityPickup): ItemPoolType;
}
/** Helper function to check if two collectible sprites have the same sprite sheet loaded. */
export declare function collectibleSpriteEquals(sprite1: Sprite, sprite2: Sprite): boolean;
/**
* Equal to `Color(1, 1, 1)`.
*
* This is a safe version of the `Color.Default` constant. (Other mods can mutate `Color.Default`,
* so it is not safe to use.)
*
* If you need to mutate this, make a copy first with the `copyColor` helper function.
*/
export declare const ColorDefault: Readonly;
export declare function colorEquals(color1: Color, color2: Color): boolean;
/**
* A collection of common colors that can be reused.
*
* Note that if you want to further modify these colors, you should copy them first with the
* `copyColor` function.
*
* The non-standard colors come from:
* https://htmlcolorcodes.com/color-names/
*/
export declare const COLORS: {
readonly Black: Readonly;
readonly Red: Readonly;
readonly Green: Readonly;
readonly Blue: Readonly;
readonly Yellow: Readonly;
readonly Cyan: Readonly;
readonly Magenta: Readonly;
readonly White: Readonly;
readonly Brown: Readonly;
readonly Gray: Readonly;
readonly Orange: Readonly;
readonly Purple: Readonly;
};
/**
* Helper function to combine two or more arrays. Returns a new array that is the composition of all
* of the specified arrays.
*
* This function is variadic, meaning that you can specify N arguments to combine N arrays. Note
* that this will only perform a shallow copy of the array elements.
*/
export declare function combineArrays(...arrays: ReadonlyArray): T[];
/**
* Helper function to create a new set that is the composition of two or more sets.
*
* This function is variadic, meaning that you can specify N sets.
*/
export declare function combineSets(...sets: ReadonlyArray>): ReadonlySet;
/**
* Helper type to validate that a union of interfaces with a field of `type` that is based on an
* enum is complete.
*
* For example:
*
* ```ts
* enum ObjectiveType {
* FOO,
* BAR,
* BAZ,
* }
*
* interface FooObjective {
* type: ObjectiveType.FOO;
* fooThing: number;
* }
*
* interface BarObjective {
* type: ObjectiveType.BAR;
* barThing: string;
* }
*
* type Objective = FooObjective | BarObjective;
* type _Test = CompositionTypeSatisfiesEnum;
* ```
*
* In this example, `Test` would be flagged by TypeScript because `Objective` does not contain an
* entry for `BazObjective`.
*/
export declare type CompositionTypeSatisfiesEnum = unknown;
/**
* Helper function to get the enum name for the specified `Controller` value. Note that this will
* trim off the "BUTTON_" prefix.
*
* Returns undefined if the submitted controller value was not valid.
*/
export declare function controllerToString(controller: Controller): string | undefined;
/**
* This is the type that is fed to `registerCharacterHealthConversion` helper function to signify
* the kind of health conversion that is desired.
*/
export declare type ConversionHeartSubType = HeartSubType.SOUL | HeartSubType.BLACK;
/** Helper function to convert an array of bits to the resulting decimal number. */
export declare function convertBinaryToDecimal(bits: readonly int[]): number;
/**
* Helper function to convert a number to an array of bits.
*
* @param num The number to convert.
* @param minLength Optional. Equal to the minimum amount of bits that should be returned. If the
* converted number of bits is below this number, 0's will be padded to the left
* side until the minimum length is met. Default is undefined (which will not cause
* any padding).
*/
export declare function convertDecimalToBinary(num: number, minLength?: int): readonly int[];
/**
* Helper function to convert the grid entity type found in a room XML file to the corresponding
* grid entity type and variant normally used by the game. For example, `GridEntityXMLType.ROCK` is
* 1000 (in a room XML file), but `GridEntityType.ROCK` is equal to 2 (in-game).
*/
export declare function convertXMLGridEntityType(gridEntityXMLType: GridEntityXMLType, gridEntityXMLVariant: int): [GridEntityType, int] | undefined;
/** A type representing an Isaac API class that can be safely copied or serialized. */
declare type CopyableIsaacAPIClass = BitSet128 | Color | KColor | RNG | Vector;
/**
* Helper function to perform a shallow copy.
*
* @param oldArray The array to copy.
* @param numElements Optional. If specified, will only copy the first N elements. By default, the
* entire array will be copied.
*/
export declare function copyArray(oldArray: readonly T[], numElements?: int): T[];
/** Helper function to copy a `BitSet128` Isaac API class. */
export declare function copyBitSet128(bitSet128: BitSet128): BitSet128;
/** Helper function to copy a `Color` Isaac API class. */
export declare function copyColor(color: Color): Color;
/**
* Helper function to generically copy an Isaac API class without knowing what specific type of
* class it is. (This is used by the save data manager.)
*
* For the list of supported classes, see the `CopyableIsaacAPIClassType` enum.
*/
export declare function copyIsaacAPIClass(isaacAPIClass: T): T;
/** Helper function to copy a `KColor` Isaac API class. */
export declare function copyKColor(kColor: KColor): KColor;
/** Helper function to copy a map. (You can also use a Map constructor to accomplish this task.) */
export declare function copyMap(oldMap: ReadonlyMap): Map;
/** Helper function to copy an `RNG` Isaac API class. */
export declare function copyRNG(rng: RNG): RNG;
/** Helper function to copy a set. (You can also use a Set constructor to accomplish this task.) */
export declare function copySet(oldSet: ReadonlySet): Set;
/** Helper function to copy specific values from a userdata object (e.g. `Vector`) to a table. */
export declare function copyUserdataValuesToTable(object: unknown, keys: readonly string[], luaMap: LuaMap): void;
/** Helper function to copy a `Vector` Isaac API class. */
export declare function copyVector(vector: Vector): Vector;
/**
* An interface representing a corner in the room.
*
* This is used by the `getRoomShapeCorners` helper function.
*/
export declare interface Corner {
readonly type: CornerType;
/** The grid index of the corresponding wall tile. */
readonly gridIndex: int;
/**
* The position is not the same as the center of the corresponding grid index. Rather, it is the
* exact position of the corner, which will be offset from the grid index position by half of a
* grid tile.
*/
readonly position: Readonly;
}
/** This is used by the `getRoomShapeCorners` helper function. */
export declare enum CornerType {
TOP_LEFT = 0,
TOP_RIGHT = 1,
BOTTOM_LEFT = 2,
BOTTOM_RIGHT = 3
}
/**
* Helper function to count the number of entities in room. Use this over the vanilla
* `Isaac.CountEntities` method to avoid having to specify a spawner and to handle ignoring charmed
* enemies.
*
* @param entityType Optional. Default is -1, which matches every entity type.
* @param variant Optional. Default is -1, which matches every variant.
* @param subType Optional. Default is -1, which matches every sub-type.
* @param ignoreFriendly Optional. Default is false. Will throw a runtime error if set to true and
* the `entityType` is equal to -1.
*/
export declare function countEntities(entityType?: EntityType | -1, variant?: number, subType?: number, ignoreFriendly?: boolean): int;
/**
* Helper function to count the number of bits that are set to 1 in a binary representation of a
* number.
*/
export declare function countSetBits(num: int): int;
/** From: https://github.com/lancelijade/qqwry.lua/blob/master/crc32.lua */
export declare function crc32(str: string): number;
/**
* The base class for a custom callback. Individual custom callbacks (and validation callbacks) will
* extend from this class.
*/
declare abstract class CustomCallback extends Feature {
private subscriptions;
addSubscriber(priority: CallbackPriority | int, callbackFunc: AddCallbackParametersCustom[T][0], ...optionalArgs: AllButFirst): void;
/**
* If the submitted function does not match any of the existing subscriptions, this method will do
* nothing.
*/
removeSubscriber(callback: AddCallbackParametersCustom[T][0]): void;
fire: (...fireArgs: FireArgs) => ReturnType;
/**
* This method needs to be overwritten for any callback that has optional filtration arguments.
* See "shouldFire.ts" for methods tailored to specific kinds of callbacks.
*/
protected shouldFire: (fireArgs: FireArgs, optionalArgs: OptionalArgs) => boolean;
}
declare class CustomGridEntities extends Feature {
private readonly runInNFrames;
private readonly preUseItemWeNeedToGoDeeper;
private readonly postNewRoomReordered;
/**
* Helper function to spawn a custom grid entity. Custom grid entities are persistent in that they
* will reappear if the player leaves and re-enters the room. (It will be manually respawned in
* the `POST_NEW_ROOM` callback.)
*
* In order to use this function, you must upgrade your mod with
* `ISCFeature.CUSTOM_GRID_ENTITIES`.
*
* Custom grid entities are built on top of real grid entities. You can use any existing grid
* entity type as a base. For example, if you want to create a custom rock that would be breakable
* like a normal rock, then you should specify `GridEntityType.ROCK` as the base grid entity type.
*
* Once a custom grid entity is spawned, you can take advantage of the custom grid callbacks such
* as `POST_GRID_ENTITY_CUSTOM_UPDATE`. Note that the "normal" grid entities callbacks will not
* fire for custom entities. For example, if you had a custom grid entity based on
* `GridEntityType.ROCK`, and you also had a subscription to the `POST_GRID_ENTITY_UPDATE`
* callback, the callback would only fire for normal rocks and not the custom entity.
*
* Custom grid entities are an IsaacScript feature because the vanilla game does not support any
* custom grid entities.
*
* For example, this would be code to create a custom rock called a "Silver Rock" that produces a
* dime when destroyed:
*
* ```ts
* // This is local to the mod and can safely overlap with the values of `GridEntityType` (or
* // values chosen by other mods).
* const GridEntityTypeCustom = {
* SILVER_ROCK: 0 as GridEntityType,
* } as const;
*
* // This is copied from "gfx/grid/grid_rock.anm2" with some tweaks to make it look special.
* const SILVER_ROCK_ANM2_PATH = "gfx/grid/grid_rock_silver.anm2";
*
* export function silverRockInit(mod: ModUpgraded): void {
* mod.AddCallbackCustom(
* ModCallbackCustom.POST_GRID_ENTITY_CUSTOM_BROKEN,
* postGridEntityCustomBrokenSilverRock,
* GridEntityTypeCustom.SILVER_ROCK,
* );
* }
*
* function postGridEntityCustomBrokenSilverRock(gridEntity: GridEntity) {
* spawnCoin(CoinSubType.DIME, gridEntity.Position);
* }
*
* export function spawnSilverRock(mod: ModUpgraded, gridIndex: int): GridEntity {
* return mod.spawnCustomGridEntity(
* GridEntityTypeCustom.SILVER_ROCK,
* gridIndex,
* undefined,
* SILVER_ROCK_ANM2_PATH,
* undefined,
* GridEntityType.ROCK,
* );
* }
* ```
*
* @param gridEntityTypeCustom An integer that identifies what kind of grid entity you are
* creating. It should correspond to a local enum value created in
* your mod. The integer can be any unique value and will not
* correspond to the actual grid entity type used. (This integer is
* used in the various custom grid entity callbacks.)
* @param gridIndexOrPosition The grid index or position in the room that you want to spawn the
* grid entity at. If a position is specified, the closest grid index
* will be used.
* @param gridCollisionClass Optional. The collision class that you want the custom grid entity to
* have. If not specified, the grid collision class from the base grid
* entity will be used.
* @param anm2Path Optional. The path to the ANM2 file to use for the sprite. If not specified,
* the normal sprite from the base grid entity will be used.
* @param defaultAnimation Optional. The name of the animation to play after the sprite is
* initialized and after the player re-enters a room with this grid entity
* in it. If not specified, the default animation in the anm2 will be
* used.
* @param baseGridEntityType Optional. The type of the grid entity to use as a "base" for this
* custom grid entity. Default is `GridEntityType.DECORATION`.
* @param baseGridEntityVariant Optional. The variant of the grid entity to use as a "base" for
* this custom grid entity. Default is 0.
* @public
*/
spawnCustomGridEntity(gridEntityTypeCustom: GridEntityType, gridIndexOrPosition: int | Vector, gridCollisionClass?: GridCollisionClass, anm2Path?: string, defaultAnimation?: string, baseGridEntityType?: GridEntityType, baseGridEntityVariant?: number): GridEntity;
/**
* Helper function to remove a custom grid entity created by the `spawnCustomGrid` function.
*
* In order to use this function, you must upgrade your mod with
* `ISCFeature.CUSTOM_GRID_ENTITIES`.
*
* @param gridIndexOrPositionOrGridEntity You can specify the custom grid entity to remove by
* providing the grid index, the room position, or the grid entity
* itself.
* @param updateRoom Optional. Whether to update the room after the grid entity is removed.
* Default is true. This is generally a good idea because if the room is not
* updated, you will be unable to spawn another grid entity on the same tile
* until a frame has passed. However, doing this is expensive, since it involves
* a call to `Isaac.GetRoomEntities`, so set it to false if you need to run this
* function multiple times.
* @returns The grid entity that was removed. Returns undefined if no grid entity was found at the
* given location or if the given grid entity was not a custom grid entity.
* @public
*/
removeCustomGridEntity(gridIndexOrPositionOrGridEntity: int | Vector | GridEntity, updateRoom?: boolean): GridEntity | undefined;
/**
* Helper function to get the custom grid entities in the current room. Returns an array of tuples
* containing the raw decoration grid entity and the associated entity data.
*
* In order to use this function, you must upgrade your mod with
* `ISCFeature.CUSTOM_GRID_ENTITIES`.
*
* @public
*/
getCustomGridEntities(): ReadonlyArray<{
gridEntity: GridEntity;
data: GridEntityCustomData;
}>;
/**
* Helper function to get the custom `GridEntityType` from a `GridEntity` or grid index. Returns
* undefined if the provided `GridEntity` is not a custom grid entity, or if there was not a grid
* entity on the provided grid index.
*
* In order to use this function, you must upgrade your mod with
* `ISCFeature.CUSTOM_GRID_ENTITIES`.
*
* @public
*/
getCustomGridEntityType(gridEntityOrGridIndex: GridEntity | int): GridEntityType | undefined;
/**
* Helper function to check if a `GridEntity` is a custom grid entity or if a grid index has a
* custom grid entity.
*
* In order to use this function, you must upgrade your mod with
* `ISCFeature.CUSTOM_GRID_ENTITIES`.
*
* @public
*/
isCustomGridEntity(gridEntityOrGridIndex: GridEntity | int): boolean;
}
declare class CustomHotkeys extends Feature {
/**
* The keys are the keyboard keys that trigger the hotkey. The values are the functions that
* contain the arbitrary code to run.
*/
private readonly staticHotkeyFunctionMap;
/**
* The keys are the functions that determine what the hotkey key is. The values are the functions
* that contain the arbitrary code to run.
*/
private readonly dynamicHotkeyFunctionMap;
private readonly keyPressedMap;
private readonly postRender;
private checkIfTriggered;
/**
* Helper function to run arbitrary code when you press and release a specific keyboard key.
*
* This can be used to easily set up custom hotkeys to facilitate custom game features or to
* assist in debugging.
*
* Inputs are checked for in the `POST_RENDER` callback.
*
* This is different from the `setHotkey` function in that the keyboard activation key is not
* hardcoded and is instead the return value of a provided function. This is useful for situations
* where the key can change (like if end-users can specify a custom hotkey using Mod Config Menu).
*
* In order to use this function, you must upgrade your mod with `ISCFeature.CUSTOM_HOTKEYS`.
*
* @param getKeyFunc The function that returns the key that will trigger the hotkey.
* @param triggerFunc A function containing the arbitrary code that you want to execute when the
* hotkey is triggered.
* @public
*/
setConditionalHotkey(getKeyFunc: () => Keyboard | undefined, triggerFunc: () => void): void;
/**
* Helper function to run arbitrary code when you press and release a specific keyboard key.
*
* This can be used to easily set up custom hotkeys to facilitate custom game features or to
* assist in debugging.
*
* Inputs are checked for in the `POST_RENDER` callback.
*
* In order to use this function, you must upgrade your mod with `ISCFeature.CUSTOM_HOTKEYS`.
*
* @param keyboard The key that you want to trigger the hotkey.
* @param triggerFunc A function containing the arbitrary code that you want to execute when the
* hotkey is triggered.
* @public
*/
setHotkey(keyboard: Keyboard, triggerFunc: () => void): void;
/**
* Helper function to remove a hotkey created with the `setConditionalHotkey` function.
*
* In order to use this function, you must upgrade your mod with `ISCFeature.CUSTOM_HOTKEYS`.
*
* @param getKeyFunc Equal to the `getKeyFunc` that you passed when initially registering the
* hotkey.
* @public
*/
unsetConditionalHotkey(getKeyFunc: () => Keyboard | undefined): void;
/**
* Helper function to remove a hotkey created with the `setHotkey` function.
*
* In order to use this function, you must upgrade your mod with `ISCFeature.CUSTOM_HOTKEYS`.
*
* @param keyboard Equal to the keyboard value that you passed when initially registering the
* hotkey.
* @public
*/
unsetHotkey(keyboard: Keyboard): void;
}
declare class CustomItemPools extends Feature {
private readonly postGameStartedReorderedFalse;
/**
* Helper function to register a custom item pool. Use this function once when your mod first
* loads to declare the items that you want to be in the item pools. Then, in the middle of a run,
* you can use `getCustomItemPoolCollectible`.
*
* For example:
*
* ```ts
* const ItemPoolTypeCustom = {
* FOO = 0 as ItemPoolType,
* } as const;
*
* const FOO_ITEM_POOL = [
* [CollectibleType.SAD_ONION, 1],
* [CollectibleType.INNER_EYE, 0.5],
* ];
*
* registerCustomItemPool(ItemPoolTypeCustom.FOO, FOO_ITEM_POOL);
* ```
*
* Note that custom item pools do not currently support partial weight decrementation on sight.
*
* In order to use this function, you must upgrade your mod with `ISCFeature.CUSTOM_ITEM_POOLS`.
*
* @param itemPoolTypeCustom An integer that identifies what kind of item pool you are creating.
* It should correspond to a local `ItemPoolTypeCustom` enum in your
* mod. The integer can be any unique value and can safely overlap with
* the vanilla item pool type values (or values chosen by other mods).
* @param collectibles An array of weighted collectible tuples that represent the item pool that
* you are creating. The first element in he tuple is the `CollectibleType`,
* and the second element in the tuple is the float that represents the weight
* of the collectible.
* @public
*/
registerCustomItemPool(itemPoolTypeCustom: ItemPoolType, collectibles: Readonly>): void;
/**
* Helper function to get a new collectible from a custom item pool created with the
* `registerCustomItemPool` function. This function has the same format as the
* `ItemPool.GetCollectible` method.
*
* By default, a collectible will not be removed from the pool once it is selected, unless the
* `decrease` argument is set to true (similar to how a vanilla item pool works).
*
* If you want to get an unseeded collectible type, you must explicitly pass `undefined` to the
* `seedOrRNG` parameter.
*
* In order to use this function, you must upgrade your mod with `ISCFeature.CUSTOM_ITEM_POOLS`.
*
* @param itemPoolTypeCustom An integer representing the custom item pool to use.
* @param seedOrRNG The `Seed` or `RNG` object to use. If an `RNG` object is provided, the
* `RNG.Next` method will be called. If `undefined` is provided, it will default
* to a random seed.
* @param decrease Optional. Whether to remove the selected collectible from the item pool.
* Default is true.
* @param defaultItem Optional. The collectible to return if the item pool is depleted. Default is
* `CollectibleType.NULL`.
* @public
*/
getCustomItemPoolCollectible(itemPoolTypeCustom: ItemPoolType, seedOrRNG: Seed | RNG | undefined, decrease?: boolean, defaultItem?: CollectibleType): CollectibleType;
}
declare class CustomPickups extends Feature {
/** Indexed by entity ID. */
private readonly customPickupFunctionsMap;
private readonly prePickupCollision;
private readonly postEffectRenderPickupEffect;
/**
* Helper function to register a custom pickup with the IsaacScript standard library. Use this
* feature for custom pickups that are intended to be picked up by the player, like bombs and
* keys.
*
* When IsaacScript detects that a player should be collecting the custom pickup, then the pickup
* will be immediately removed, and an effect showing the pickup's respective `Collect` animation
* will be spawned. (This emulates how a normal vanilla pickup would work.) After that, the
* provided `collectFunc` will be fired. In this function, you will probably want to play a sound
* corresponding to what kind of pickup it is (e.g. `SoundEffect.KEY_PICKUP_GAUNTLET`), as well as
* do things like adding something to the player's inventory.
*
* Note that when you specify your custom pickup in the "entities2.xml" file, it should have a
* type of "5" and be associated with an anm2 file that has a "Collect" animation.
*
* In order to use this function, you must upgrade your mod with `ISCFeature.CUSTOM_PICKUPS`.
*
* @param pickupVariantCustom The variant for the corresponding custom pickup.
* @param subType The sub-type for the corresponding custom pickup.
* @param collectFunc The function to run when the player collects this pickup.
* @param collisionFunc Optional. The function to run when a player collides with the pickup.
* Default is a function that always returns undefined, meaning that the
* player will always immediately collect the pickup when they collide with
* it. Specify this function if your pickup should only be able to be
* collected under certain conditions. Return value acts similar to
* `ModCallback.PRE_PICKUP_COLLISION`.
* @public
*/
registerCustomPickup(pickupVariantCustom: PickupVariant, subType: int, collectFunc: (this: void, pickup: EntityPickup, player: EntityPlayer) => void, collisionFunc?: (this: void, pickup: EntityPickup, player: EntityPlayer) => boolean | undefined): void;
}
declare class CustomRevive extends Feature {
v: {
run: {
state: CustomReviveState;
revivalType: int | null;
dyingPlayerIndex: PlayerIndex | null;
};
};
private readonly preCustomRevive;
private readonly postCustomRevive;
private readonly runInNFrames;
constructor(preCustomRevive: PreCustomRevive, postCustomRevive: PostCustomRevive, runInNFrames: RunInNFrames);
private readonly postRender;
private readonly postFamiliarInitOneUp;
private readonly postNewRoomReordered;
private readonly postPEffectUpdateReordered;
private checkWaitingForItemAnimation;
private readonly postPlayerFatalDamage;
private readonly preBerserkDeath;
/**
* The player is about to die, which will immediately delete the save data for the run. To prevent
* this from happening, we grant the 1-Up item.
*/
private playerIsAboutToDie;
private logStateChanged;
}
declare enum CustomReviveState {
DISABLED = 0,
/**
* We can't immediately jump to waiting for an item animation because it is possible for a player
* to be holding an item above their head as they are dying (e.g. with Razor Blade).
*/
WAITING_FOR_ROOM_TRANSITION = 1,
WAITING_FOR_ITEM_ANIMATION = 2
}
/**
* An object that represents a possible boss for a custom stage. This can be for a vanilla boss or a
* custom boss.
*/
export declare interface CustomStageBossPoolEntry {
/**
* The name of the boss. This should correspond to the entry for the boss in the "entities2.xml"
* file.
*/
name: string;
/**
* The arbitrary sub-type chosen for this boss, ranging between 1 and 999. You must set the boss
* rooms for this boss to this sub-type in Basement Renovator by right-clicking on the room on the
* right-hand-side.
*
* It does not matter if the arbitrary sub-type overlaps with any of the vanilla `BossID` values
* (e.g. vanilla Boss Room sub-types in "00.special_rooms.stb"). It also does not matter if this
* value overlaps with the values from other mods.
*
* If you are creating an entry for a vanilla boss, it is recommended that you match the sub-type
* with the corresponding vanilla `BossID` value. This will make things a bit easier to understand
* for people working on your mod, but is not a hard requirement.
*
* @minimum 1
* @maximum 999
*/
subType: number;
/**
* The weight of the boss. This is used when randomly selecting which boss to use for the floor.
* For example, use a value of 1 if you want this boss to be equally likely as any other boss, 0.5
* if you want it to be half as likely, 2 if you want it to be twice as likely, and so on.
*/
weight: number;
/** Optional. A collection of sprites used for the boss on the "versus" screen. */
versusScreen?: {
/**
* Mandatory. The full path to the spritesheet that contains the graphics of the name of the
* boss that will be displayed on the top of the boss "versus" screen.
*
* If not specified, a sprite showing "???" will be used.
*/
namePNGPath: string;
/**
* Mandatory. The full path to the spritesheet that contains the portrait of the boss that will
* be displayed on the right side of the boss "versus" screen.
*
* If not specified, a sprite showing "???" will be used.
*/
portraitPNGPath: string;
};
}
/**
* An object that represents a custom stage. The "customStageMetadata.lua" file contains an array of
* these objects. Besides the room metadata, the data is the same as what is specified inside the
* "tsconfig.json" file.
*
* The `CustomStage` interface extends this, adding more data.
*/
export declare type CustomStageLua = Immutable;
/** An intermediate type that is never actually used. See `CustomStageLua`. */
declare interface CustomStageLuaUnsafe extends CustomStageTSConfig {
/**
* This contains metadata about each room in a custom stage, which is used at run-time.
* (Internally, the IsaacScript standard library uses this as a basis for determining which rooms
* should randomly appear on the floor.)
*/
roomsMetadata: CustomStageRoomMetadata[];
}
/**
* Metadata about a custom stage room. Each custom stage object contains an array with metadata for
* each room.
*/
export declare interface CustomStageRoomMetadata {
type: number;
variant: number;
subType: number;
shape: number;
doorSlotFlags: number;
weight: number;
}
declare class CustomStages extends Feature {
/** Indexed by custom stage name. */
private readonly customStagesMap;
/** Indexed by room variant. */
private readonly customStageCachedRoomData;
private usingRedKey;
private readonly customGridEntities;
private readonly customTrapdoors;
private readonly disableAllSound;
private readonly gameReorderedCallbacks;
private readonly pause;
private readonly runInNFrames;
private initCustomStageMetadata;
private initRoomTypeMap;
private initCustomTrapdoorDestination;
private readonly goToCustomStage;
private readonly postRender;
/**
* Fix the bug where Red Key will not work on custom floors (due to the stage being a bugged
* value).
*/
private readonly postUseItemRedKey;
private readonly postCurseEval;
private readonly getShaderParams;
/**
* Fix the bug where Red Key will not work on custom floors (due to the stage being a bugged
* value).
*/
private readonly preUseItemRedKey;
private readonly postGridEntityBrokenRockAlt;
private readonly postGridEntityInit;
private readonly postNewRoomReordered;
/** Pick a custom room for each vanilla room. */
private setStageRoomsData;
/**
* Helper function to warp to a custom stage/level.
*
* Custom stages/levels must first be defined in the "tsconfig.json" file. See the documentation
* for more details: https://isaacscript.github.io/main/custom-stages/
*
* In order to use this function, you must upgrade your mod with `ISCFeature.CUSTOM_STAGES`.
*
* @param name The name of the custom stage, corresponding to what is in the "tsconfig.json" file.
* @param firstFloor Optional. Whether to go to the first floor or the second floor. For example,
* if you have a custom stage emulating Caves, then the first floor would be
* Caves 1, and the second floor would be Caves 2. Default is true.
* @param streakText Optional. Whether to show the streak text at the top of the screen that
* announces the name of the level. Default is true.
* @param verbose Optional. Whether to log additional information about the rooms that are chosen.
* Default is false.
* @public
*/
setCustomStage(name: string, firstFloor?: boolean, streakText?: boolean, verbose?: boolean): void;
/**
* Helper function to disable the custom stage. This is typically called before taking the player
* to a vanilla floor.
*
* In order to use this function, you must upgrade your mod with `ISCFeature.CUSTOM_STAGES`.
*
* @public
*/
disableCustomStage(): void;
}
/**
* A description of a custom stage shadow. (In this context, "shadows" are the outlines from things
* on the roof. For example, in Basement, a shadow of a sideways V is used, among others.)
*/
export declare interface CustomStageShadow {
/**
* The full path to the shadow overlay PNG file.
*
* For an example of a vanilla shadow overlay, see:
* `resources/gfx/overlays/basement/1x1_overlay_1.png`
*/
pngPath: string;
/**
* Optional. An object representing the color used for the shadow.
*
* If not specified, an object of `{ r: 0, g: 0, b: 0, a: 0.25 }` will be used (which corresponds
* to 75% faded black).
*/
color?: {
/**
* @minimum 0
* @maximum 1
*/
r: number;
/**
* @minimum 0
* @maximum 1
*/
g: number;
/**
* @minimum 0
* @maximum 1
*/
b: number;
/**
* @minimum 0
* @maximum 1
*/
a: number;
};
}
/**
* This is the format of a custom stage in the "isaacscript" section of the "tsconfig.json" file.
*
* The contents of this interface are used to create a "tsconfig-isaacscript-section-schema.json"
* schema with the "ts-json-schema-generator" library.
*
* The contents of this interface are validated at run-time against the schema.
*
* The `CustomStageLua` interface extends this, adding room metadata.
*/
export declare interface CustomStageTSConfig {
/** Mandatory. The name of the custom stage. */
name: string;
/**
* Mandatory. The path to the XML file that contains the rooms for the custom stage (created with
* Basement Renovator).
*/
xmlPath: string;
/**
* Mandatory. An arbitrarily chosen prefix in the range of 101-999 that will be unique to this
* stage.
*
* Use a value of 100 when testing locally. When publishing to the workshop or otherwise
* distributing your mod, make sure that you have chosen a prefix that does not conflict with any
* other mods. You can find a list of registered room variant prefixes on the IsaacScript website:
* https://isaacscript.github.io/main/custom-stages
*
* @minimum 100
* @maximum 999
*/
roomVariantPrefix: number;
/**
* Optional. An integer between 2 and 13, corresponding to the `LevelStage` enum. This is the
* number of the stage that will be warped to and used as a basis for the stage by the level
* generation algorithm.
*
* For example, if you wanted to have a custom stage with a small amount of rooms per floor, then
* you should choose 2 as a base. (This would copy the number of rooms that would appear in
* Basement 2.) And if you wanted to have a custom stage with the maximum amount of rooms, then
* you should choose 13 as a base. (This would copy the number of rooms that would appear on The
* Void.)
*
* It is not possible to use Basement 1 as a base stage due to conflicts with the `Game.SetStage`
* method.
*
* If not specified, `LevelStage.BASEMENT_2` (2) will be used.
*
* @minimum 2
* @maximum 13
*/
baseStage?: number;
/**
* Optional. An integer between 0 and 5, corresponding to the `StageType` enum. This is the number
* of the stage type that will be warped to and used as a basis for the stage by the level
* generation algorithm.
*
* If not specified, `StageType.ORIGINAL` (0) will be used.
*
* @minimum 0
* @maximum 5
*/
baseStageType?: number;
/**
* Optional. A string that represents the name of the music track from the "content/music.xml"
* file that corresponds to this custom stage. It will be manually played upon entering the stage.
*
* If not specified, the same music track as the base stage will be used.
*/
music?: string;
/**
* Optional. An object containing the paths to the backdrop graphics for the stage. (A backdrop is
* the graphics for the walls and floor.) If not specified, the graphics for Basement will be
* used.
*/
backdropPNGPaths?: {
/**
* An array that contains the full paths to the graphic files that are used for the floor in
* narrow rooms. (The "n" stands for "narrow").
*
* You must have at least one path in this array, but you can specify more than one to randomly
* add extra variety (like the vanilla stages do).
*
* For an example of this, see the vanilla file "resources/gfx/backdrop/01_basement_nfloor.png".
*/
nFloors: string[];
/**
* An array that contains the full paths to the graphic files that are used for the floor in L
* rooms.
*
* You must have at least one path in this array, but you can specify more than one to randomly
* add extra variety (like the vanilla stages do).
*
* For an example of this, see the vanilla file "resources/gfx/backdrop/01_lbasementfloor.png".
*/
lFloors: string[];
/**
* An array that contains the full paths to the graphic files that are used for the walls of the
* floor.
*
* You must have at least one path in this array, but you can specify more than one to randomly
* add extra variety (like the vanilla stages do).
*
* For an example of this, see the vanilla file "resources/gfx/backdrop/01_basement.png". (In
* the vanilla file, they concatenate all four variations together into one PNG file. However,
* for the custom stages feature, you must separate each wall variation into a separate file.)
*/
walls: string[];
/**
* An array that contains the full paths to the graphic files for the stage's corners.
*
* You must have at least one path in this array, but you can specify more than one to randomly
* add extra variety (like the vanilla stages do).
*
* For an example of this, see the vanilla file "resources/gfx/backdrop/01_basement.png". (In
* the vanilla file, they concatenate both variations together into one PNG file and put it in
* the top right hand corner. The corners are shown in the top right hand corner of the file,
* with two different variations concatenated together. However, for the custom stages feature,
* you must separate each corner variation into a separate file (and put it in a different file
* from the walls).
*/
corners: string[];
};
/**
* Optional. The full path to the spritesheet that contains the graphics of the decorations for
* the floor.
*
* If not specified, the vanilla Basement decorations spritesheet will be used. For reference,
* this is located at: `resources/gfx/grid/props_01_basement.png`
*
* If you want to have custom animations for your decorations, then do not use this field and use
* `decorationsANM2Path` instead.
*/
decorationsPNGPath?: string;
/**
* Optional. The full path to the anm2 file that contains the custom animations for the
* decorations of the floor.
*
* If not specified, the vanilla Basement decorations spritesheet will be used. For reference,
* this is located at: `resources/gfx/grid/props_01_basement.png`
*
* If you do not want to have custom animations for your decorations, then do not use this field
* and use `decorationsPNGPath` instead.
*/
decorationsANM2Path?: string;
/**
* Optional. The full path to the spritesheet that contains the graphics of the rocks/blocks/urns
* for the floor.
*
* If specified, it is assumed that you have your own custom rock alt type, and all vanilla
* rewards/enemies that spawn from urns will be automatically removed. Use the
* `POST_GRID_ENTITY_BROKEN` callback to make your own custom rewards. Or, if you want to emulate
* a vanilla urn/mushroom/skull/polyp/bucket, use the `spawnRockAltReward` helper function.
*
* If not specified, the vanilla Basement rocks spritesheet will be used. For reference, this is
* located at: `resources-dlc3/gfx/grid/rocks_basement.png`
*
* If you want to have custom animations for your rocks, then do not use this field and use
* `rocksANM2Path` instead.
*/
rocksPNGPath?: string;
/**
* Optional. The full path to the anm2 file that contains the custom animations for the
* rocks/blocks/urns of the floor.
*
* If specified, it is assumed that you have your own custom rock alt type, and all vanilla
* rewards/enemies that spawn from urns will be automatically removed. Use the
* `POST_GRID_ENTITY_BROKEN` callback to make your own custom rewards. Or, if you want to emulate
* a vanilla urn/mushroom/skull/polyp/bucket, use the `spawnRockAltReward` helper function.
*
* If not specified, the vanilla Basement rocks spritesheet will be used. For reference, this is
* located at: `resources-dlc3/gfx/grid/rocks_basement.png`
*
* If you do not want to have custom animations for your rocks, then do not use this field and use
* `rocksPNGPath` instead.
*/
rocksANM2Path?: string;
/**
* Optional. The full path to the spritesheet that contains the graphics of the pits for the
* floor.
*
* If not specified, the vanilla Basement pits spritesheet will be used. For reference, this is
* located at: `resources/gfx/grid/grid_pit.png`
*
* If you do not want to have custom animations for your pits, then do not use this field and use
* `pitsANM2Path` instead.
*/
pitsPNGPath?: string;
/**
* Optional. The full path to the anm2 file that contains the custom animations for the pits of
* the floor.
*
* If not specified, the vanilla Basement pits spritesheet will be used. For reference, this is
* located at: `resources/gfx/grid/grid_pit.png`
*
* If you do not want to have custom animations for your pits, then do not use this field and use
* `pitsPNGPath` instead.
*/
pitsANM2Path?: string;
/**
* Optional. A collection of paths that contain graphics for the doors of the floor. If not
* specified, the doors for Basement will be used.
*/
doorPNGPaths?: {
/**
* Optional. The full path to the spritesheet that contains the graphics of the normal doors for
* the floor.
*
* If not specified, the vanilla Basement door spritesheet will be used. For reference, this is
* located at: `resources/gfx/grid/door_01_normaldoor.png`
*/
normal?: string;
/**
* Optional. The full path to the spritesheet that contains the graphics of the Treasure Room
* doors for the floor.
*
* If not specified, the vanilla Basement door spritesheet will be used. For reference, this is
* located at: `resources/gfx/grid/door_02_treasureroomdoor.png`
*/
treasureRoom?: string;
/**
* Optional. The full path to the spritesheet that contains the graphics of the Boss Room doors
* for the floor.
*
* If not specified, the vanilla Basement door spritesheet will be used. For reference, this is
* located at: `resources/gfx/grid/door_10_bossroomdoor.png`
*/
bossRoom?: string;
/**
* Optional. The full path to the spritesheet that contains the graphics of the Secret Room and
* Super Secret Room doors for the floor.
*
* If not specified, the vanilla Basement door spritesheet will be used. For reference, this is
* located at: `resources/gfx/grid/door_08_holeinwall.png`
*/
secretRoom?: string;
/**
* Optional. The full path to the spritesheet that contains the graphics of the arcade doors for
* the floor.
*
* If not specified, the vanilla Basement door spritesheet will be used. For reference, this is
* located at: `resources/gfx/grid/door_05_arcaderoomdoor.png`
*/
arcade?: string;
/**
* Optional. The full path to the spritesheet that contains the graphics of the Curse Room doors
* for the floor.
*
* If not specified, the vanilla Basement door spritesheet will be used. For reference, this is
* located at: `resources/gfx/grid/door_04_selfsacrificeroomdoor.png`
*/
curseRoom?: string;
/**
* Optional. The full path to the spritesheet that contains the graphics of the normal Challenge
* Room doors for the floor.
*
* If not specified, the vanilla Basement door spritesheet will be used. For reference, this is
* located at: `resources/gfx/grid/door_03_ambushroomdoor.png`
*/
normalChallengeRoom?: string;
/**
* Optional. The full path to the spritesheet that contains the graphics of the Boss Challenge
* Room doors for the floor.
*
* If not specified, the vanilla Basement door spritesheet will be used. For reference, this is
* located at: `resources/gfx/grid/door_09_bossambushroomdoor.png`
*/
bossChallengeRoom?: string;
/**
* Optional. The full path to the spritesheet that contains the graphics of the Devil Room doors
* for the floor.
*
* If not specified, the vanilla Basement door spritesheet will be used. For reference, this is
* located at: `resources/gfx/grid/door_07_devilroomdoor.png`
*/
devilRoom?: string;
/**
* Optional. The full path to the spritesheet that contains the graphics of the Angel Room doors
* for the floor.
*
* If not specified, the vanilla Basement door spritesheet will be used. For reference, this is
* located at: `resources/gfx/grid/door_07_holyroomdoor.png`
*/
angelRoom?: string;
/**
* Optional. The full path to the spritesheet that contains the graphics of the Boss Rush doors
* for the floor.
*
* If not specified, the vanilla Basement door spritesheet will be used. For reference, this is
* located at: `resources/gfx/grid/door_15_bossrushdoor.png`
*/
bossRush?: string;
/**
* Optional. The full path to the spritesheet that contains the graphics of the Chest Room doors
* for the floor.
*
* If not specified, the vanilla Basement door spritesheet will be used. For reference, this is
* located at: `resources/gfx/grid/door_02b_chestroomdoor.png`
*/
chestRoom?: string;
};
/**
* Optional. An array of shadow objects that describe the graphics for the custom shadows of the
* floor. (In this context, "shadows" are the outlines from things on the roof. For example, in
* Basement, a shadow of a sideways V is used, among others.) If not specified, no extra shadows
* will be drawn.
*/
shadows?: {
/**
* Optional. An array containing the shadows that will be used in rooms of shape
* `RoomShape.SHAPE_1x1` (1), `RoomShape.IH` (2), and `RoomShape.IV` (3).
*
* If more than one shadow is specified, one will be randomly chosen for each room.
*
* If not specified, no extra shadows will be drawn in these room shapes.
*/
"1x1"?: CustomStageShadow[];
/**
* Optional. An array containing the shadows that will be used in rooms of shape
* `RoomShape.SHAPE_1x2` (4) and `RoomShape.IIV` (5).
*
* If more than one shadow is specified, one will be randomly chosen for each room.
*
* If not specified, no extra shadows will be drawn in these room shapes.
*/
"1x2"?: CustomStageShadow[];
/**
* Optional. An array containing the shadows that will be used in rooms of shape
* `RoomShape.SHAPE_2x1` (6) and `RoomShape.IIH` (7).
*
* If more than one shadow is specified, one will be randomly chosen for each room.
*
* If not specified, no extra shadows will be drawn in these room shapes.
*/
"2x1"?: CustomStageShadow[];
/**
* Optional. An array containing the shadows that will be used in rooms of shape
* `RoomShape.SHAPE_2x2` (8), `RoomShape.LTL` (9), `RoomShape.LTR` (10), `RoomShape.LBL` (11),
* and `RoomShape.LBR` (12).
*
* If more than one shadow is specified, one will be randomly chosen for each room.
*
* If not specified, no extra shadows will be drawn in these room shapes.
*/
"2x2"?: CustomStageShadow[];
};
/**
* Optional. An array containing the bosses that should be used for the stage. This can include
* both vanilla bosses and modded bosses.
*/
bossPool?: CustomStageBossPoolEntry[];
/**
* Optional. A collection of colors used for in the boss "versus" screen for all of the bosses.
*
* Note that these graphics will only be applied if one or more bosses are specified in the
* `bossPool` field.
*/
versusScreen?: {
/**
* Optional. An object representing the color to use for the background of the boss "versus"
* screen. If not specified, the color for Basement 1 will be used.
*
* For a list of the colors that correspond to the vanilla stages, see
* `versusScreenBackgroundColors.ts`.
*/
backgroundColor?: {
/**
* @minimum 0
* @maximum 1
*/
r: number;
/**
* @minimum 0
* @maximum 1
*/
g: number;
/**
* @minimum 0
* @maximum 1
*/
b: number;
/**
* @minimum 0
* @maximum 1
*/
a: number;
};
/**
* Optional. An object representing the color to use for the dirt spots in the boss "versus"
* screen. (There are two dirt spots; one for the player and one for the boss.) If not
* specified, the color for Basement 1 will be used.
*
* For a list of the colors that correspond to the vanilla stages, see
* `versusScreenDirtSpotColors.ts`.
*/
dirtSpotColor?: {
/**
* @minimum 0
* @maximum 1
*/
r: number;
/**
* @minimum 0
* @maximum 1
*/
g: number;
/**
* @minimum 0
* @maximum 1
*/
b: number;
/**
* @minimum 0
* @maximum 1
*/
a: number;
};
};
}
declare class CustomTrapdoors extends Feature {
/** Indexed by custom trapdoor ID. */
private readonly destinationFuncMap;
/**
* In order to represent a black sprite, we just use the first frame of the boss versus screen
* animation. However, we must lazy load the sprite in order to prevent issues with mods that
* replace the vanilla files. (For some reason, loading the sprites will cause the overwrite to no
* longer apply on the second and subsequent runs.)
*/
private readonly blackSprite;
private readonly customGridEntities;
private readonly disableInputs;
private readonly ponyDetection;
private readonly roomClearFrame;
private readonly runInNFrames;
private readonly runNextRoom;
private readonly stageHistory;
private readonly postRender;
private checkAllPlayersJumpComplete;
private checkPixelationToBlackComplete;
private goToCustomTrapdoorDestination;
private getDestinationFunc;
private checkSecondPixelationHalfWay;
private checkAllPlayersLayingDownComplete;
private drawBlackSprite;
private readonly postGridEntityCustomUpdateTrapdoor;
private checkCustomTrapdoorOpenClose;
private shouldTrapdoorOpen;
private isPlayerCloseAfterBoss;
private checkCustomTrapdoorPlayerTouched;
private playerTouchedCustomTrapdoor;
private startDelayedJump;
private adjustPlayerPositionToTrapdoor;
private readonly postPEffectUpdateReordered;
private checkJumpComplete;
private shouldTrapdoorSpawnOpen;
private logStateChanged;
/**
* Helper function to specify where your custom trapdoor should take the player. Call this once at
* the beginning of your mod for each kind of custom trapdoor that you want to have. The provided
* `destinationFunc` will be executed when the player jumps into the trapdoor and the pixelation
* effect fades to black.
*
* Registration is needed so that custom trapdoors can be serializable when the player saves and
* quits.
*
* In order to use this function, you must upgrade your mod with `ISCFeature.CUSTOM_TRAPDOORS`.
*
* @param destinationName The name that identifies the type of custom trapdoor. It should
* correspond to a local `CustomTrapdoorType` enum in your mod. It can be
* any unique value and can safely overlap with values chosen by other
* mods.
* @param destinationFunc A function that takes the player to the destination that you want.
* Inside this function, use the `setStage` or `setCustomStage` helper
* functions, or do something completely custom.
*/
registerCustomTrapdoorDestination(destinationName: string, destinationFunc: (destinationName: string | undefined, destinationStage: LevelStage, destinationStageType: StageType) => void): void;
/**
* Helper function to spawn a trapdoor grid entity that will take a player to a vanilla stage or
* custom location.
*
* - If you want to create a custom trapdoor that goes to a vanilla stage, pass `undefined` for
* the `destinationName` parameter.
* - If you want to create a custom trapdoor that takes the player to a custom location, you must
* have registered the corresponding `destinationName` at the beginning of your mod with the
* `registerCustomTrapdoorDestination` function. (This is necessary so that custom trapdoors can
* be serializable when the player saves and quits.)
*
* Under the hood, the custom trapdoor is represented by a decoration grid entity and is manually
* respawned every time the player re-enters the room.
*
* In order to use this function, you must upgrade your mod with `ISCFeature.CUSTOM_TRAPDOORS`.
*
* @param gridIndexOrPosition The location in the room to spawn the trapdoor.
* @param destinationName Optional. A string representing the name of the of destination that the
* custom trapdoor will take the player to. Default is undefined, which
* will take the player to a vanilla stage.
* @param destinationStage Optional. The first argument that will be passed to the
* `destinationFunc` corresponding to this custom trapdoor. This is
* essentially metadata for the custom trapdoor. Leave this undefined if
* your corresponding custom trapdoor function does not care what the
* destination stage should be. Default is the "normal" next vanilla
* stage.
* @param destinationStageType Optional. The second argument that will be passed to the
* `destinationFunc` corresponding to this custom trapdoor. This is
* essentially metadata for the custom trapdoor. Leave this undefined
* if your corresponding custom trapdoor function does not care what
* the destination stage type should be. Default is the "normal" next
* vanilla stage type.
* @param anm2Path Optional. The path to the anm2 file to use. By default, the vanilla trapdoor
* anm2 of "gfx/grid/door_11_trapdoor.anm2" will be used. The specified anm2 file
* must have animations called "Opened", "Closed", and "Open Animation".
* @param spawnOpen Optional. Whether to spawn the trapdoor in an open state. By default, behavior
* will be used that emulates a vanilla trapdoor.
*/
spawnCustomTrapdoor(gridIndexOrPosition: int | Vector, destinationName?: string, destinationStage?: LevelStage, destinationStageType?: StageType, anm2Path?: string, spawnOpen?: boolean): GridEntity;
}
declare class DebugDisplay extends Feature {
private readonly mod;
private readonly player;
private readonly tear;
private readonly familiar;
private readonly bomb;
private readonly pickup;
private readonly slot;
private readonly laser;
private readonly knife;
private readonly projectile;
private readonly effect;
private readonly npc;
private readonly rock;
private readonly pit;
private readonly spikes;
private readonly tnt;
private readonly poop;
private readonly door;
private readonly pressurePlate;
/**
* If the "togglePlayerDisplay" function is called, text will be drawn on the screen next to each
* player. Use this function to specify a callback function that returns the string that should be
* drawn.
*
* Once the function is set, the library will call it automatically on every frame. For this
* reason, you typically only need to set the function once at the beginning of your mod.
*
* For example, this would draw the number of the player's collectibles next to their head:
*
* ```ts
* setPlayerDisplay((player) => {
* return `collectible count: ${player.GetCollectibleCount()}`;
* });
* ```
*
* In order to use this function, you must upgrade your mod with `ISCFeature.DEBUG_DISPLAY`.
*
* @public
*/
setPlayerDisplay(textCallback: (player: EntityPlayer) => string): void;
/**
* If the "toggleTearDisplay" function is called, text will be drawn on the screen next to each
* tear. Use this function to specify a callback function that returns the string that should be
* drawn.
*
* Once the function is set, the library will call it automatically on every frame. For this
* reason, you typically only need to set the function once at the beginning of your mod.
*
* In order to use this function, you must upgrade your mod with `ISCFeature.DEBUG_DISPLAY`.
*
* @public
*/
setTearDisplay(textCallback: (tear: EntityTear) => string): void;
/**
* If the "toggleFamiliarDisplay" function is called, text will be drawn on the screen next to
* each familiar. Use this function to specify a callback function that returns the string that
* should be drawn.
*
* Once the function is set, the library will call it automatically on every frame. For this
* reason, you typically only need to set the function once at the beginning of your mod.
*
* In order to use this function, you must upgrade your mod with `ISCFeature.DEBUG_DISPLAY`.
*
* @public
*/
setFamiliarDisplay(textCallback: (familiar: EntityFamiliar) => string): void;
/**
* If the "toggleBombDisplay" function is called, text will be drawn on the screen next to each
* bomb. Use this function to specify a callback function that returns the string that should be
* drawn.
*
* Once the function is set, the library will call it automatically on every frame. For this
* reason, you typically only need to set the function once at the beginning of your mod.
*
* In order to use this function, you must upgrade your mod with `ISCFeature.DEBUG_DISPLAY`.
*
* @public
*/
setBombDisplay(textCallback: (bomb: EntityBomb) => string): void;
/**
* If the "togglePickupDisplay" function is called, text will be drawn on the screen next to each
* pickup. Use this function to specify a callback function that returns the string that should be
* drawn.
*
* Once the function is set, the library will call it automatically on every frame. For this
* reason, you typically only need to set the function once at the beginning of your mod.
*
* In order to use this function, you must upgrade your mod with `ISCFeature.DEBUG_DISPLAY`.
*
* @public
*/
setPickupDisplay(textCallback: (pickup: EntityPickup) => string): void;
/**
* If the "toggleSlotDisplay" function is called, text will be drawn on the screen next to each
* slot. Use this function to specify a callback function that returns the string that should be
* drawn.
*
* Once the function is set, the library will call it automatically on every frame. For this
* reason, you typically only need to set the function once at the beginning of your mod.
*
* In order to use this function, you must upgrade your mod with `ISCFeature.DEBUG_DISPLAY`.
*
* @public
*/
setSlotDisplay(textCallback: (slot: Entity) => string): void;
/**
* If the "toggleLaserDisplay" function is called, text will be drawn on the screen next to each
* laser. Use this function to specify a callback function that returns the string that should be
* drawn.
*
* Once the function is set, the library will call it automatically on every frame. For this
* reason, you typically only need to set the function once at the beginning of your mod.
*
* In order to use this function, you must upgrade your mod with `ISCFeature.DEBUG_DISPLAY`.
*
* @public
*/
setLaserDisplay(textCallback: (laser: EntityLaser) => string): void;
/**
* If the "toggleKnifeDisplay" function is called, text will be drawn on the screen next to each
* knife. Use this function to specify a callback function that returns the string that should be
* drawn.
*
* Once the function is set, the library will call it automatically on every frame. For this
* reason, you typically only need to set the function once at the beginning of your mod.
*
* In order to use this function, you must upgrade your mod with `ISCFeature.DEBUG_DISPLAY`.
*
* @public
*/
setKnifeDisplay(textCallback: (knife: EntityKnife) => string): void;
/**
* If the "toggleProjectileDisplay" function is called, text will be drawn on the screen next to
* each projectile. Use this function to specify a callback function that returns the string that
* should be drawn.
*
* Once the function is set, the library will call it automatically on every frame. For this
* reason, you typically only need to set the function once at the beginning of your mod.
*
* In order to use this function, you must upgrade your mod with `ISCFeature.DEBUG_DISPLAY`.
*
* @public
*/
setProjectileDisplay(textCallback: (projectile: EntityProjectile) => string): void;
/**
* If the "extra console commands" feature is specified, the "effectDisplay" console command will
* draw text on the screen next to each effect. Use this function to specify a callback function
* that returns the string that should be drawn.
*
* Once the function is set, the library will call it automatically on every frame. For this
* reason, you typically only need to set the function once at the beginning of your mod.
*
* In order to use this function, you must upgrade your mod with `ISCFeature.DEBUG_DISPLAY`.
*
* @public
*/
setEffectDisplay(textCallback: (effect: EntityEffect) => string): void;
/**
* If the "toggleNPCDisplay" function is called, text will be drawn on the screen next to each
* NPC. Use this function to specify a callback function that returns the string that should be
* drawn.
*
* Once the function is set, the library will call it automatically on every frame. For this
* reason, you typically only need to set the function once at the beginning of your mod.
*
* In order to use this function, you must upgrade your mod with `ISCFeature.DEBUG_DISPLAY`.
*
* @public
*/
setNPCDisplay(textCallback: (npc: EntityNPC) => string): void;
/**
* If the "toggleRockDisplay" function is called, text will be drawn on the screen next to each
* rock. Use this function to specify a callback function that returns the string that should be
* drawn.
*
* Once the function is set, the library will call it automatically on every frame. For this
* reason, you typically only need to set the function once at the beginning of your mod.
*
* In order to use this function, you must upgrade your mod with `ISCFeature.DEBUG_DISPLAY`.
*
* @public
*/
setRockDisplay(textCallback: (rock: GridEntityRock) => string): void;
/**
* If the "togglePitDisplay" function is called, text will be drawn on the screen next to each
* pit. Use this function to specify a callback function that returns the string that should be
* drawn.
*
* Once the function is set, the library will call it automatically on every frame. For this
* reason, you typically only need to set the function once at the beginning of your mod.
*
* In order to use this function, you must upgrade your mod with `ISCFeature.DEBUG_DISPLAY`.
*
* @public
*/
setPitDisplay(textCallback: (pit: GridEntityPit) => string): void;
/**
* If the "toggleSpikesDisplay" function is called, text will be drawn on the screen next to each
* spikes. Use this function to specify a callback function that returns the string that should be
* drawn.
*
* Once the function is set, the library will call it automatically on every frame. For this
* reason, you typically only need to set the function once at the beginning of your mod.
*
* In order to use this function, you must upgrade your mod with `ISCFeature.DEBUG_DISPLAY`.
*
* @public
*/
setSpikesDisplay(textCallback: (spikes: GridEntitySpikes) => string): void;
/**
* If the "toggleTNTDisplay" function is called, text will be drawn on the screen next to each
* TNT. Use this function to specify a callback function that returns the string that should be
* drawn.
*
* Once the function is set, the library will call it automatically on every frame. For this
* reason, you typically only need to set the function once at the beginning of your mod.
*
* In order to use this function, you must upgrade your mod with `ISCFeature.DEBUG_DISPLAY`.
*
* @public
*/
setTNTDisplay(textCallback: (tnt: GridEntityTNT) => string): void;
/**
* If the "togglePoopDisplay" function is called, text will be drawn on the screen next to each
* poop. Use this function to specify a callback function that returns the string that should be
* drawn.
*
* Once the function is set, the library will call it automatically on every frame. For this
* reason, you typically only need to set the function once at the beginning of your mod.
*
* In order to use this function, you must upgrade your mod with `ISCFeature.DEBUG_DISPLAY`.
*
* @public
*/
setPoopDisplay(textCallback: (poop: GridEntityPoop) => string): void;
/**
* If the "toggleDoorDisplay" function is called, text will be drawn on the screen next to each
* door. Use this function to specify a callback function that returns the string that should be
* drawn.
*
* Once the function is set, the library will call it automatically on every frame. For this
* reason, you typically only need to set the function once at the beginning of your mod.
*
* In order to use this function, you must upgrade your mod with `ISCFeature.DEBUG_DISPLAY`.
*
* @public
*/
setDoorDisplay(textCallback: (door: GridEntityDoor) => string): void;
/**
* If the "togglePressurePlateDisplay" function is called, text will be drawn on the screen next
* to each pressure plate. Use this function to specify a callback function that returns the
* string that should be drawn.
*
* Once the function is set, the library will call it automatically on every frame. For this
* reason, you typically only need to set the function once at the beginning of your mod.
*
* In order to use this function, you must upgrade your mod with `ISCFeature.DEBUG_DISPLAY`.
*
* @public
*/
setPressurePlateDisplay(textCallback: (pressurePlate: GridEntityPressurePlate) => string): void;
private toggleFeature;
/**
* Toggles the debug display for players, which will draw text on the screen next to each player.
*
* In order to use this function, you must upgrade your mod with `ISCFeature.DEBUG_DISPLAY`.
*
* @param force Optional. A boolean that represents the value to force the display to. For
* example, you can specify true to always make the display turn on, regardless of
* whether it is already on.
* @public
*/
togglePlayerDisplay(force?: boolean): void;
/**
* Toggles the debug display for tears, which will draw text on the screen next to each tear.
*
* In order to use this function, you must upgrade your mod with `ISCFeature.DEBUG_DISPLAY`. *
*
* @param force Optional. A boolean that represents the value to force the display to. For
* example, you can specify true to always make the display turn on, regardless of
* whether it is already on.
* @public
*/
toggleTearDisplay(force?: boolean): void;
/**
* Toggles the debug display for familiars, which will draw text on the screen next to each
* familiar.
*
* In order to use this function, you must upgrade your mod with `ISCFeature.DEBUG_DISPLAY`.
*
* @param force Optional. A boolean that represents the value to force the display to. For
* example, you can specify true to always make the display turn on, regardless of
* whether it is already on.
* @public
*/
toggleFamiliarDisplay(force?: boolean): void;
/**
* Toggles the debug display for bombs, which will draw text on the screen next to each bomb.
*
* In order to use this function, you must upgrade your mod with `ISCFeature.DEBUG_DISPLAY`.
*
* @param force Optional. A boolean that represents the value to force the display to. For
* example, you can specify true to always make the display turn on, regardless of
* whether it is already on.
* @public
*/
toggleBombDisplay(force?: boolean): void;
/**
* Toggles the debug display for pickups, which will draw text on the screen next to each pickup.
*
* In order to use this function, you must upgrade your mod with `ISCFeature.DEBUG_DISPLAY`.
*
* @param force Optional. A boolean that represents the value to force the display to. For
* example, you can specify true to always make the display turn on, regardless of
* whether it is already on.
* @public
*/
togglePickupDisplay(force?: boolean): void;
/**
* Toggles the debug display for slots, which will draw text on the screen next to each slot.
*
* In order to use this function, you must upgrade your mod with `ISCFeature.DEBUG_DISPLAY`.
*
* @param force Optional. A boolean that represents the value to force the display to. For
* example, you can specify true to always make the display turn on, regardless of
* whether it is already on.
* @public
*/
toggleSlotDisplay(force?: boolean): void;
/**
* Toggles the debug display for lasers, which will draw text on the screen next to each laser.
*
* In order to use this function, you must upgrade your mod with `ISCFeature.DEBUG_DISPLAY`.
*
* @param force Optional. A boolean that represents the value to force the display to. For
* example, you can specify true to always make the display turn on, regardless of
* whether it is already on.
* @public
*/
toggleLaserDisplay(force?: boolean): void;
/**
* Toggles the debug display for knives, which will draw text on the screen next to each knife.
*
* In order to use this function, you must upgrade your mod with `ISCFeature.DEBUG_DISPLAY`.
*
* @param force Optional. A boolean that represents the value to force the display to. For
* example, you can specify true to always make the display turn on, regardless of
* whether it is already on.
* @public
*/
toggleKnifeDisplay(force?: boolean): void;
/**
* Toggles the debug display for projectiles, which will draw text on the screen next to each
* projectile.
*
* In order to use this function, you must upgrade your mod with `ISCFeature.DEBUG_DISPLAY`.
*
* @param force Optional. A boolean that represents the value to force the display to. For
* example, you can specify true to always make the display turn on, regardless of
* whether it is already on.
* @public
*/
toggleProjectileDisplay(force?: boolean): void;
/**
* Toggles the debug display for effects, which will draw text on the screen next to each effect.
*
* In order to use this function, you must upgrade your mod with `ISCFeature.DEBUG_DISPLAY`.
*
* @param force Optional. A boolean that represents the value to force the display to. For
* example, you can specify true to always make the display turn on, regardless of
* whether it is already on.
* @public
*/
toggleEffectDisplay(force?: boolean): void;
/**
* Toggles the debug display for NPCs, which will draw text on the screen next to each NPC.
*
* In order to use this function, you must upgrade your mod with `ISCFeature.DEBUG_DISPLAY`.
*
* @param force Optional. A boolean that represents the value to force the display to. For
* example, you can specify true to always make the display turn on, regardless of
* whether it is already on.
* @public
*/
toggleNPCDisplay(force?: boolean): void;
/**
* Toggles the debug display for rocks, which will draw text on the screen next to each rock.
*
* In order to use this function, you must upgrade your mod with `ISCFeature.DEBUG_DISPLAY`.
*
* @param force Optional. A boolean that represents the value to force the display to. For
* example, you can specify true to always make the display turn on, regardless of
* whether it is already on.
* @public
*/
toggleRockDisplay(force?: boolean): void;
/**
* Toggles the debug display for pits, which will draw text on the screen next to each pit.
*
* In order to use this function, you must upgrade your mod with `ISCFeature.DEBUG_DISPLAY`.
*
* @param force Optional. A boolean that represents the value to force the display to. For
* example, you can specify true to always make the display turn on, regardless of
* whether it is already on.
* @public
*/
togglePitDisplay(force?: boolean): void;
/**
* Toggles the debug display for spikes, which will draw text on the screen next to each spike.
*
* In order to use this function, you must upgrade your mod with `ISCFeature.DEBUG_DISPLAY`.
*
* @param force Optional. A boolean that represents the value to force the display to. For
* example, you can specify true to always make the display turn on, regardless of
* whether it is already on.
* @public
*/
toggleSpikesDisplay(force?: boolean): void;
/**
* Toggles the debug display for TNT, which will draw text on the screen next to each TNT.
*
* In order to use this function, you must upgrade your mod with `ISCFeature.DEBUG_DISPLAY`.
*
* @param force Optional. A boolean that represents the value to force the display to. For
* example, you can specify true to always make the display turn on, regardless of
* whether it is already on.
* @public
*/
toggleTNTDisplay(force?: boolean): void;
/**
* Toggles the debug display for poops, which will draw text on the screen next to each poop.
*
* In order to use this function, you must upgrade your mod with `ISCFeature.DEBUG_DISPLAY`.
*
* @param force Optional. A boolean that represents the value to force the display to. For
* example, you can specify true to always make the display turn on, regardless of
* whether it is already on.
* @public
*/
togglePoopDisplay(force?: boolean): void;
/**
* Toggles the debug display for doors, which will draw text on the screen next to each door.
*
* In order to use this function, you must upgrade your mod with `ISCFeature.DEBUG_DISPLAY`.
*
* @param force Optional. A boolean that represents the value to force the display to. For
* example, you can specify true to always make the display turn on, regardless of
* whether it is already on.
* @public
*/
toggleDoorDisplay(force?: boolean): void;
/**
* Toggles the debug display for pressure plates, which will draw text on the screen next to each
* pressure plate.
*
* In order to use this function, you must upgrade your mod with `ISCFeature.DEBUG_DISPLAY`.
*
* @param force Optional. A boolean that represents the value to force the display to. For
* example, you can specify true to always make the display turn on, regardless of
* whether it is already on.
* @public
*/
togglePressurePlateDisplay(force?: boolean): void;
}
/**
* Helper type to subtract one from a number type.
*
* From: https://stackoverflow.com/questions/54243431/typescript-increment-number-type
*/
export declare type Decrement = Arr extends [unknown, ...infer U] ? U["length"] : never;
/**
* `deepCopy` is a semi-generic deep cloner. It will recursively copy all of the values so that none
* of the nested references remain.
*
* `deepCopy` is used by the IsaacScript save data manager to make a backup of your variables, so
* that it can restore them to the default values at the beginning of a new room, floor, or run.
*
* `deepCopy` supports the following object types:
*
* - Primitives (i.e. strings, numbers, and booleans)
* - Basic TSTL objects (which are the same thing as Lua tables)
* - TSTL `Map`
* - TSTL `Set`
* - TSTL classes
* - `DefaultMap`
* - Isaac `BitSet128` objects
* - Isaac `Color` objects
* - Isaac `KColor` objects
* - Isaac `RNG` objects
* - Isaac `Vector` objects
*
* It does not support:
* - objects with values of `null` (since that transpiles to `nil`)
* - other Isaac API objects such as `EntityPtr` (that have a type of "userdata")
*
* @param value The primitive or object to copy.
* @param serializationType Optional. Has 3 possible values. Can copy objects as-is, or can
* serialize objects to Lua tables, or can deserialize Lua tables to
* objects. Default is `SerializationType.NONE`.
* @param traversalDescription Optional. Used to track the current key that we are operating on for
* debugging purposes. Default is an empty string.
* @param classConstructors Optional. A Lua table that maps the name of a user-defined TSTL class to
* its corresponding constructor. If the `deepCopy` function finds any
* user-defined TSTL classes when recursively iterating through the given
* object, it will use this map to instantiate a new class. Default is an
* empty Lua table.
* @param insideMap Optional. Tracks whether the deep copy function is in the process of recursively
* copying a TSTL Map. Default is false.
*/
export declare function deepCopy(value: T, serializationType?: SerializationType.NONE, traversalDescription?: string, classConstructors?: LuaMap, insideMap?: boolean): T;
export declare function deepCopy(value: unknown, serializationType: SerializationType, traversalDescription?: string, classConstructors?: LuaMap, insideMap?: boolean): unknown;
export declare const DEFAULT_ITEM_POOL_TYPE = ItemPoolType.TREASURE;
/**
* `DefaultMap` is a data structure that makes working with default values easier. It extends a
* `Map` and adds additional methods.
*
* It is a common pattern to look up a value in a `Map`, and then, if the value does not exist, set
* a default value for the key, and then return the default value. `DefaultMap` abstracts this
* operation away by providing the `getAndSetDefault` method.
*
* Using a `DefaultMap` is nice because it makes code more declarative, since you specify what the
* default value is alongside the types of the keys/values.
*
* When instantiating a new `DefaultMap`, you must specify default value as the first argument. (The
* default value is the initial value that will be assigned to every new entry in the
* `getAndSetDefault` method.) For example:
*
* ```ts
* // Initializes a new empty DefaultMap with a default value of "foo".
* const defaultMapWithString = new DefaultMap("foo");
*
* const value = defaultMapWithString.getAndSetDefault("bar");
* // value is now "foo" and an entry for "bar" is now set.
* ```
*
* Sometimes, instead of having a static initial value for every entry in the map, you will want a
* dynamic initial value that is contingent upon the key or some other variable. In these cases, you
* can instead specify that the `DefaultMap` should run a function that will return the initial
* value. (This is referred to as a "factory function".) For example:
*
* ```ts
* // Initializes a new empty DefaultMap with a default value based on "someGlobalVariable".
* const factoryFunction = () => someGlobalVariable ? 0 : 1;
* const defaultMapWithFactoryFunction = new DefaultMap(factoryFunction);
* ```
*
* Note that in TypeScript and Lua, booleans, numbers, and strings are "passed by value". This means
* that when the `DefaultMap` creates a new entry, if the default value is one of these 3 types, the
* values will be copied. On the other hand, arrays and maps and other complex data structures are
* "passed by reference". This means that when the `DefaultMap` creates a new entry, if the default
* value is an array, then it would not be copied. Instead, the same shared array would be assigned
* to every entry. Thus, to solve this problem, any variable that is passed by reference must be
* created using a factory function to ensure that each copy is unique. For example:
*
* ```ts
* // Initializes a new empty DefaultMap with a default value of a new empty array.
* const factoryFunction = () => [];
* const defaultMapWithArray = new DefaultMap(factoryFunction);
* ```
*
* In the previous two examples, the factory functions did not have any arguments. But you can also
* specify a factory function that takes one or more arguments:
*
* ```ts
* const factoryFunction = (arg: boolean) => arg ? 0 : 1;
* const defaultMapWithArg = new DefaultMap(factoryFunction);
* ```
*
* Similar to a normal `Map`, you can also include an initializer list in the constructor as the
* second argument:
*
* ```ts
* // Initializes a DefaultMap with a default value of "foo" and some initial values.
* const defaultMapWithInitialValues = new DefaultMap("foo", [
* ["a1", "a2"],
* ["b1", "b2"],
* ], );
* ```
*
* Finally, note that `DefaultMap` has the following additional utility methods:
*
* - `getAndSetDefault` - The method that is called inside the overridden `get` method. In most
* cases, you can use the overridden `get` method instead of calling this function directly.
* However, if a factory function was provided during instantiation, and the factory function has
* one or more arguments, then you must call this method instead (and provide the corresponding
* arguments).
* - `getDefaultValue` - Returns the default value to be used for a new key. (If a factory function
* was provided during instantiation, this will execute the factory function.)
* - `getConstructorArg` - Helper method for cloning the map. Returns either the default value or
* the reference to the factory function.
*/
export declare class DefaultMap extends Map {
private readonly defaultValue;
private readonly defaultValueFactory;
/**
* See the main `DefaultMap` documentation:
* https://isaacscript.github.io/isaacscript-common/other/classes/DefaultMap
*/
constructor(defaultValueOrFactoryFunction: Value | FactoryFunction, initializerArray?: Iterable<[Key, Value]>);
/**
* If the key exists, this will return the same thing as the normal `Map.get` method. Otherwise,
* it will set a default value for the provided key, and then return the default value.
*
* @allowEmptyVariadic
*/
getAndSetDefault(key: Key, ...args: Args): Value;
/**
* Returns the default value to be used for a new key. (If a factory function was provided during
* instantiation, this will execute the factory function.)
*/
getDefaultValue(...args: Args): Value;
/**
* Helper method for cloning the map. Returns either the default value or a reference to the
* factory function.
*/
getConstructorArg(): Value | FactoryFunction;
}
/**
* Helper function to get the value from a `DefaultMap` that corresponds to an entity, assuming that
* the map uses `PtrHash` as an index.
*/
export declare function defaultMapGetHash(map: DefaultMap, entity: Entity, ...extraArgs: A): V;
/**
* Helper function to make using default maps with an index of `PtrHash` easier. Use this instead of
* the `DefaultMap.getAndSetDefault` method if you have a default map of this type.
*
* For example:
*
* ```ts
* const v = {
* run: {
* npcsSpeedBoost: new DefaultMap(0),
* },
* };
*
* function npcUpdate(npc: EntityNPC) {
* const speedBoost = defaultMapGetNPC(v.run.npcsSpeedBoost, npc);
* // Do something with the speed boost.
* }
* ```
*
* Note that not all NPCs should be stored in a map with a `PtrHash` as an index, so only use this
* in the situations where that would be okay. (For example, Dark Esau should never be stored in a
* map like this, because the scope of `PtrHash` is per room and Dark Esau is persistent between
* rooms.)
*/
export declare function defaultMapGetNPC(map: DefaultMap, npc: EntityNPC, ...extraArgs: Args): V;
/**
* Helper function to make using default maps with an index of `PlayerIndex` easier. Use this
* instead of the `DefaultMap.getAndSetDefault` method if you have a default map of this type.
*
* For example:
*
* ```ts
* const v = {
* run: {
* playersSpeedBoost: new DefaultMap(0),
* },
* };
*
* function evaluateCacheSpeed(player: EntityPlayer) {
* player.MoveSpeed = defaultMapGetPlayer(v.run.playersSpeedBoost, player);
* }
* ```
*
* @allowEmptyVariadic
*/
export declare function defaultMapGetPlayer(map: DefaultMap, player: EntityPlayer, ...extraArgs: Args): V;
/**
* Helper function to set a value for a `DefaultMap` that corresponds to an entity, assuming that
* the map uses `PtrHash` as an index.
*
* Since `Map` and `DefaultMap` set values in the same way, this function is simply an alias for the
* `mapSetHash` helper function.
*/
export declare function defaultMapSetHash(map: Map, entity: Entity, value: V): void;
/**
* Helper function to make using maps with an index of `PtrHash` easier. Use this instead of the
* `Map.set` method if you have a map of this type.
*
* Since `Map` and `DefaultMap` set values in the same way, this function is simply an alias for the
* `mapSetNPC` helper function.
*/
export declare function defaultMapSetNPC(map: Map, npc: EntityNPC, value: V): void;
/**
* Helper function to make using maps with an index of `PlayerIndex` easier. Use this instead of the
* `Map.set` method if you have a map of this type.
*
* Since `Map` and `DefaultMap` set values in the same way, this function is simply an alias for the
* `mapSetPlayer` helper function.
*/
export declare function defaultMapSetPlayer(map: Map, player: EntityPlayer, value: V): void;
/**
* Helper function to delete all of the values in one set from another set. The first set passed
* will be modified in place.
*
* This function is variadic, meaning that you can specify N sets to remove from the first set.
*/
export declare function deleteSetsFromSet(mainSet: Set, ...setsToRemove: ReadonlyArray>): void;
declare class DeployJSONRoom extends Feature {
private readonly preventGridEntityRespawn;
private spawnAllEntities;
private spawnNormalEntityForJSONRoom;
/**
* Helper function to deconstruct a vanilla room and set up a custom room in its place.
* Specifically, this will clear the current room of all entities and grid entities, and then
* spawn all of the entries and grid entities in the provided JSON room. For this reason, you must
* be in the actual room in order to use this function.
*
* A JSON room is simply an XML file converted to JSON. You can create JSON rooms by using the
* Basement Renovator room editor to create an XML file, and then convert it to JSON using the
* `convert-xml-to-json` tool (e.g. `npx convert-xml-to-json my-rooms.xml`).
*
* This function is meant to be used in the `POST_NEW_ROOM` callback.
*
* For example:
*
* ```ts
*
* import customRooms from "./customRooms.json";
*
* export function postNewRoom(): void {
* const firstJSONRoom = customRooms.rooms.room[0];
* deployJSONRoom(firstJSONRoom);
* }
* ```
*
* If you want to deploy an unseeded room, you must explicitly pass `undefined` to the `seedOrRNG`
* parameter.
*
* In order to use this function, you must upgrade your mod with `ISCFeature.DEPLOY_JSON_ROOM`.
*
* @param jsonRoom The JSON room to deploy.
* @param seedOrRNG The `Seed` or `RNG` object to use. If an `RNG` object is provided, the
* `RNG.Next` method will be called. If `undefined` is provided, it will default
* to a random seed.
* @param verbose Optional. If specified, will write entries to the "log.txt" file that describe
* what the function is doing. Default is false.
* @public
*/
deployJSONRoom(jsonRoom: Readonly, seedOrRNG: Seed | RNG | undefined, verbose?: boolean): void;
}
/**
* Helper function to remove a collectible or trinket that is currently queued to go into a player's
* inventory (i.e. the item is being held over their head).
*
* If the player does not have an item currently queued, then this function will be a no-op.
*
* Returns whether an item was actually dequeued.
*
* Under the hood, this clones the `QueuedItemData`, since directly setting the `Item` field to
* `undefined` does not work for some reason.
*
* This method was discovered by im_tem.
*/
export declare function dequeueItem(player: EntityPlayer): boolean;
/**
* Helper function to convert a `SerializedBitSet128` object to a normal `BitSet128` object. (This
* is used by the save data manager when reading data from the "save#.dat" file.)
*/
export declare function deserializeBitSet128(bitSet128: SerializedBitSet128): BitSet128;
/**
* Helper function to convert a `SerializedColor` object to a normal `Color` object. (This is used
* by the save data manager when reading data from the "save#.dat" file.)
*/
export declare function deserializeColor(color: SerializedColor): Color;
/**
* Helper function to generically deserialize an Isaac API class without knowing what specific type
* of class it is. (This is used by the save data manager when reading data from the "save#.dat"
* file.)
*
* For the list of supported classes, see the `CopyableIsaacAPIClassType` enum.
*/
export declare function deserializeIsaacAPIClass(serializedIsaacAPIClass: SerializedT): IsaacAPIClassTypeToType[SerializedT["__kind"]];
/**
* Helper function to convert a `SerializedKColor` object to a normal `KColor` object. (This is used
* by the save data manager when reading data from the "save#.dat" file.)
*/
export declare function deserializeKColor(kColor: SerializedKColor): KColor;
/**
* Helper function to convert a `SerializedRNG` object to a normal `RNG` object. (This is used by
* the save data manager when reading data from the "save#.dat" file.)
*/
export declare function deserializeRNG(rng: SerializedRNG): RNG;
/**
* Helper function to convert a `SerializedVector` object to a normal `RNG` object. (This is used by
* the save data manager when reading data from the "save#.dat" file.)
*/
export declare function deserializeVector(vector: SerializedVector): Vector;
/** For `EntityType.EFFECT` (1000), `EffectVariant.DICE_FLOOR` (76). */
export declare const DICE_FLOOR_TRIGGER_SQUARE_SIZE = 75;
/**
* An array containing every valid `Dimension`, not including `Dimension.CURRENT`. (This is derived
* from the `NUM_DIMENSIONS` constant.)
*
* We cannot use the values of the `Dimension` enum because it includes -1.
*/
export declare const DIMENSIONS: readonly Dimension[];
/**
* Helper function to convert a direction to degrees. For example, `Direction.LEFT` (0) would return
* 180 and `Direction.RIGHT` (2) would return 0. (This corresponds to how the
* `Vector.GetAngleDegrees` method works.)
*/
export declare function directionToDegrees(direction: Direction): int;
/**
* Helper function to convert a direction to a shoot `ButtonAction`. For example, `Direction.LEFT`
* (0) would return `ButtonAction.LEFT` (0).
*/
export declare function directionToMoveAction(direction: Direction): ButtonAction | undefined;
/**
* Helper function to convert a direction to a shoot `ButtonAction`. For example, `Direction.LEFT`
* (0) would return `ButtonAction.SHOOT_LEFT` (4).
*/
export declare function directionToShootAction(direction: Direction): ButtonAction | undefined;
/**
* Helper function to convert a direction to a `Vector`. For example, `Direction.LEFT` (0) would
* convert to `Vector(-1, 0).
*/
export declare function directionToVector(direction: Direction): Readonly;
declare class DisableAllSound extends Feature {
private musicWasEnabled;
private readonly postRender;
/**
* Helper function to stop muting all sound effects and music.
*
* Use this function to set things back to normal after having used `disableAllSounds`.
*
* In order to use this function, you must upgrade your mod with `ISCFeature.DISABLE_ALL_SOUND`.
*
* @param key The name of the mod feature that is requesting the enable/disable. For example, if
* this was part of the code for a custom enemy called "Super Gaper", then you could
* use a key of "SuperGaper". The name is necessary so that multiple mod features can
* work in tandem.
*/
enableAllSound(key: string): void;
/**
* Helper function to disable all sound effects and music (by constantly musting them).
*
* Use the `enableAllSounds` helper function to set things back to normal.
*
* In order to use this function, you must upgrade your mod with `ISCFeature.DISABLE_ALL_SOUND`.
*
* @param key The name of the mod feature that is requesting the enable/disable. For example, if
* this was part of the code for a custom enemy called "Super Gaper", then you could
* use a key of "SuperGaper". The name is necessary so that multiple mod features can
* work in tandem.
*/
disableAllSound(key: string): void;
}
declare class DisableInputs extends Feature {
private readonly isActionPressed;
private readonly isActionTriggered;
private readonly getActionValue;
private getReturnValue;
/**
* Helper function to check if the `ISCFeature.DISABLE_INPUTS` feature is turned on in some
* capacity.
*
* In order to use this function, you must upgrade your mod with `ISCFeature.DISABLE_INPUTS`.
*
* @public
*/
areInputsEnabled(): boolean;
/**
* Helper function to enable all inputs. Use this function to set things back to normal after
* having used one of the other helper functions to disable inputs.
*
* In order to use this function, you must upgrade your mod with `ISCFeature.DISABLE_INPUTS`.
*
* @param key The name of the mod feature that is requesting the enable/disable. For example, if
* this was part of the code for a custom enemy called "Super Gaper", then you could
* use a key of "SuperGaper". The name is necessary so that multiple mod features can
* work in tandem.
* @public
*/
enableAllInputs(key: string): void;
/**
* Helper function to disable specific inputs, like opening the console.
*
* This function is variadic, meaning that you can specify as many inputs as you want to disable.
* (To disable all inputs, see the `disableAllInputs` function.
*
* Use the `enableAllInputs` helper function to set things back to normal.
*
* In order to use this function, you must upgrade your mod with `ISCFeature.DISABLE_INPUTS`.
*
* @param key The name of the mod feature that is requesting the enable/disable. For example, if
* this was part of the code for a custom enemy called "Super Gaper", then you could
* use a key of "SuperGaper". The name is necessary so that multiple mod features can
* work in tandem.
* @param buttonActions An array of the actions to action.
* @public
*/
disableInputs(key: string, ...buttonActions: readonly ButtonAction[]): void;
/**
* Helper function to disable all inputs. This is useful because `EntityPlayer.ControlsEnabled`
* can be changed by the game under certain conditions.
*
* Use the `enableAllInputs` helper function to set things back to normal.
*
* In order to use this function, you must upgrade your mod with `ISCFeature.DISABLE_INPUTS`.
*
* @param key The name of the mod feature that is requesting the enable/disable. For example, if
* this was part of the code for a custom enemy called "Super Gaper", then you could
* use a key of "SuperGaper". The name is necessary so that multiple mod features can
* work in tandem.
* @public
*/
disableAllInputs(key: string): void;
/**
* Helper function to enable all inputs besides the ones provided. This is useful because
* `EntityPlayer.ControlsEnabled` can be changed by the game under certain conditions.
*
* Use the `enableAllInputs` helper function to set things back to normal.
*
* In order to use this function, you must upgrade your mod with `ISCFeature.DISABLE_INPUTS`.
*
* @param key The name of the mod feature that is requesting the enable/disable. For example, if
* this was part of the code for a custom enemy called "Super Gaper", then you could
* use a key of "SuperGaper". The name is necessary so that multiple mod features can
* work in tandem.
* @param blacklist A set of ButtonActions to disallow.
* @public
*/
enableAllInputsExceptFor(key: string, blacklist: ReadonlySet): void;
/**
* Helper function to disable all inputs besides the ones provided. This is useful because
* `EntityPlayer.ControlsEnabled` can be changed by the game under certain conditions.
*
* Use the `enableAllInputs` helper function to set things back to normal.
*
* In order to use this function, you must upgrade your mod with `ISCFeature.DISABLE_INPUTS`.
*
* @param key The name of the mod feature that is requesting the enable/disable. For example, if
* this was part of the code for a custom enemy called "Super Gaper", then you could
* use a key of "SuperGaper". The name is necessary so that multiple mod features can
* work in tandem.
* @param whitelist A set of ButtonActions to allow.
* @public
*/
disableAllInputsExceptFor(key: string, whitelist: ReadonlySet): void;
/**
* Helper function to disable only the inputs used for moving the character (or moving the cursor
* in the UI). This is useful because `EntityPlayer.ControlsEnabled` can be changed by the game
* under certain conditions.
*
* Use the `enableAllInputs` helper function to set things back to normal.
*
* In order to use this function, you must upgrade your mod with `ISCFeature.DISABLE_INPUTS`.
*
* @param key The name of the mod feature that is requesting the enable/disable. For example, if
* this was part of the code for a custom enemy called "Super Gaper", then you could
* use a key of "SuperGaper". The name is necessary so that multiple mod features can
* work in tandem.
* @public
*/
disableMovementInputs(key: string): void;
/**
* Helper function to disable only the inputs used for shooting tears. This is useful because
* `EntityPlayer.ControlsEnabled` can be changed by the game under certain conditions.
*
* Use the `enableAllInputs` helper function to set things back to normal.
*
* In order to use this function, you must upgrade your mod with `ISCFeature.DISABLE_INPUTS`.
*
* @param key The name of the mod feature that is requesting the enable/disable. For example, if
* this was part of the code for a custom enemy called "Super Gaper", then you could
* use a key of "SuperGaper". The name is necessary so that multiple mod features can
* work in tandem.
* @public
*/
disableShootingInputs(key: string): void;
}
/** This is also the distance that a player spawns from the door that they enter a room from. */
export declare const DISTANCE_OF_GRID_TILE = 40;
/**
* Helper function to check if one or more matching entities exist in the current room. It uses the
* `doesEntityExist` helper function to determine this.
*
* @param entityTypes An array or set of the entity types that you want to check for. Will return
* true if any of the provided entity types exist.
* @param ignoreFriendly Optional. Default is false.
*/
export declare function doesAnyEntityExist(entityTypes: readonly EntityType[] | ReadonlySet, ignoreFriendly?: boolean): boolean;
/**
* Normally, characters get a red heart container upon reaching a new floor with an eternal heart,
* but some characters grant a black heart instead. Returns true for Dark Judas and Tainted Judas.
* Otherwise, returns false.
*/
export declare function doesCharacterGetBlackHeartFromEternalHeart(character: PlayerType): boolean;
/**
* Helper function to determine if the specified character starts with an active item.
*
* For the purposes of this function, the save file is considered to be fully unlocked (e.g. Isaac
* is considered to starts with the D6, but this is not the case on a brand new save file).
*/
export declare function doesCharacterStartWithActiveItem(character: PlayerType): boolean;
/**
* Helper function to check if one or more of a specific kind of entity is present in the current
* room. It uses the `countEntities` helper function to determine this.
*
* @param entityType Optional. Default is -1, which matches every entity type.
* @param variant Optional. Default is -1, which matches every variant.
* @param subType Optional. Default is -1, which matches every sub-type.
* @param ignoreFriendly Optional. Default is false.
*/
export declare function doesEntityExist(entityType?: EntityType | -1, variant?: number, subType?: number, ignoreFriendly?: boolean): boolean;
/**
* Helper function to check if one or more of a specific kind of grid entity is present in the
* current room.
*
* @param gridEntityType The grid entity type to match.
* @param variant Optional. Default is -1, which matches every variant.
*/
export declare function doesGridEntityExist(gridEntityType: GridEntityType, variant?: number): boolean;
/**
* Returns whether all of the player's soul-heart-type hearts are black hearts.
*
* Note that this function does not consider red heart containers.
*
* For example:
*
* - If the player has one black heart, this function would return true.
* - If the player has one soul heart and two black hearts, this function would return false.
* - If the player has no black hearts, this function will return false.
* - If the player has one red heart container and three black hearts, this function would return
* true.
*/
export declare function doesPlayerHaveAllBlackHearts(player: EntityPlayer): boolean;
/**
* Returns whether all of the player's soul-heart-type hearts are soul hearts.
*
* Note that this function does not consider red heart containers.
*
* For example:
*
* - If the player has two soul hearts and one black heart, this function would return false.
* - If the player has no soul hearts, this function will return false.
* - If the player has one red heart container and three soul hearts, this function would return
* true.
*/
export declare function doesPlayerHaveAllSoulHearts(player: EntityPlayer): boolean;
/**
* Helper function to measure a vector to see if it has a non-zero length using a threshold to
* ignore extremely small values.
*
* Use this function instead of explicitly checking if the length is 0 because vectors in the game
* are unlikely to ever be exactly set to 0. Instead, they will always have some miniscule length.
*
* @param vector The vector to measure.
* @param threshold Optional. The threshold from 0 to consider to be a non-zero vector. Default is
* 0.01.
*/
export declare function doesVectorHaveLength(vector: Vector, threshold?: number): boolean;
export declare const DOGMA_ROOM_GRID_INDEX = 109;
export declare const DOOR_HITBOX_RADIUS = 11;
export declare function doorSlotFlagsToDoorSlots(doorSlotFlags: BitFlags): readonly DoorSlot[];
export declare function doorSlotFlagToDoorSlot(doorSlotFlag: DoorSlotFlag): DoorSlot;
/**
* Helper function to convert an array of door slots or a set of door slots to the resulting bit
* flag number.
*/
export declare function doorSlotsToDoorSlotFlags(doorSlots: readonly DoorSlot[] | ReadonlySet): BitFlags;
export declare function doorSlotToDirection(doorSlot: DoorSlot): Direction;
export declare function doorSlotToDoorSlotFlag(doorSlot: DoorSlot): DoorSlotFlag;
/**
* From: https://easings.net/#easeInBack
*
* @param time A value between 0 and 1 that represents how far along you are in the transition.
*/
export declare function easeInBack(time: number): number;
/**
* From: https://easings.net/#easeInBounce
*
* @param time A value between 0 and 1 that represents how far along you are in the transition.
*/
export declare function easeInBounce(time: number): number;
/**
* From: https://easings.net/#easeInCirc
*
* @param time A value between 0 and 1 that represents how far along you are in the transition.
*/
export declare function easeInCirc(time: number): number;
/**
* From: https://easings.net/#easeInCubic
*
* @param time A value between 0 and 1 that represents how far along you are in the transition.
*/
export declare function easeInCubic(time: number): number;
/**
* From: https://easings.net/#easeInElastic
*
* @param time A value between 0 and 1 that represents how far along you are in the transition.
*/
export declare function easeInElastic(time: number): number;
/**
* From: https://easings.net/#easeInExpo
*
* @param time A value between 0 and 1 that represents how far along you are in the transition.
*/
export declare function easeInExpo(time: number): number;
/**
* From: https://easings.net/#easeInOutBack
*
* @param time A value between 0 and 1 that represents how far along you are in the transition.
*/
export declare function easeInOutBack(time: number): number;
/**
* From: https://easings.net/#easeInOutBounce
*
* @param time A value between 0 and 1 that represents how far along you are in the transition.
*/
export declare function easeInOutBounce(time: number): number;
/**
* From: https://easings.net/#easeInOutCirc
*
* @param time A value between 0 and 1 that represents how far along you are in the transition.
*/
export declare function easeInOutCirc(time: number): number;
/**
* From: https://easings.net/#easeInOutCubic
*
* @param time A value between 0 and 1 that represents how far along you are in the transition.
*/
export declare function easeInOutCubic(time: number): number;
/**
* From: https://easings.net/#easeInOutElastic
*
* @param time A value between 0 and 1 that represents how far along you are in the transition.
*/
export declare function easeInOutElastic(time: number): number;
/**
* From: https://easings.net/#easeInOutExpo
*
* @param time A value between 0 and 1 that represents how far along you are in the transition.
*/
export declare function easeInOutExpo(time: number): number;
/**
* From: https://easings.net/#easeInOutQuad
*
* @param time A value between 0 and 1 that represents how far along you are in the transition.
*/
export declare function easeInOutQuad(time: number): number;
/**
* From: https://easings.net/#easeInOutQuart
*
* @param time A value between 0 and 1 that represents how far along you are in the transition.
*/
export declare function easeInOutQuart(time: number): number;
/**
* From: https://easings.net/#easeInOutQuint
*
* @param time A value between 0 and 1 that represents how far along you are in the transition.
*/
export declare function easeInOutQuint(time: number): number;
/**
* From: https://easings.net/#easeInOutSine
*
* @param time A value between 0 and 1 that represents how far along you are in the transition.
*/
export declare function easeInOutSine(time: number): number;
/**
* From: https://easings.net/#easeInQuad
*
* @param time A value between 0 and 1 that represents how far along you are in the transition.
*/
export declare function easeInQuad(time: number): number;
/**
* From: https://easings.net/#easeInQuart
*
* @param time A value between 0 and 1 that represents how far along you are in the transition.
*/
export declare function easeInQuart(time: number): number;
/**
* From: https://easings.net/#easeInQuint
*
* @param time A value between 0 and 1 that represents how far along you are in the transition.
*/
export declare function easeInQuint(time: number): number;
/**
* From: https://easings.net/#easeInSine
*
* @param time A value between 0 and 1 that represents how far along you are in the transition.
*/
export declare function easeInSine(time: number): number;
/**
* From: https://easings.net/#easeOutBack
*
* @param time A value between 0 and 1 that represents how far along you are in the transition.
*/
export declare function easeOutBack(time: number): number;
/**
* From: https://easings.net/#easeInOutSine
*
* @param time A value between 0 and 1 that represents how far along you are in the transition.
*/
export declare function easeOutBounce(time: number): number;
/**
* From: https://easings.net/#easeOutCirc
*
* @param time A value between 0 and 1 that represents how far along you are in the transition.
*/
export declare function easeOutCirc(time: number): number;
/**
* From: https://easings.net/#easeOutCubic
*
* @param time A value between 0 and 1 that represents how far along you are in the transition.
*/
export declare function easeOutCubic(time: number): number;
/**
* From: https://easings.net/#easeOutElastic
*
* @param time A value between 0 and 1 that represents how far along you are in the transition.
*/
export declare function easeOutElastic(time: number): number;
/**
* From: https://easings.net/#easeOutExpo
*
* @param time A value between 0 and 1 that represents how far along you are in the transition.
*/
export declare function easeOutExpo(time: number): number;
/**
* From: https://easings.net/#easeOutQuad
*
* @param time A value between 0 and 1 that represents how far along you are in the transition.
*/
export declare function easeOutQuad(time: number): number;
/**
* From: https://easings.net/#easeOutQuart
*
* @param time A value between 0 and 1 that represents how far along you are in the transition.
*/
export declare function easeOutQuart(time: number): number;
/**
* From: https://easings.net/#easeOutQuint
*
* @param time A value between 0 and 1 that represents how far along you are in the transition.
*/
export declare function easeOutQuint(time: number): number;
/**
* From: https://easings.net/#easeOutSine
*
* @param time A value between 0 and 1 that represents how far along you are in the transition.
*/
export declare function easeOutSine(time: number): number;
declare class EdenStartingStatsHealth extends Feature {
/**
* We must use the `POST_PLAYER_INIT` callback since the two random collectibles have not been
* granted yet.
*/
private readonly postPlayerInit;
private getEdenStats;
private getEdenHealth;
/**
* We must use the `POST_PLAYER_COLLECTIBLE_ADDED` callback since the collectibles are not yet
* granted in the `POST_PLAYER_INIT` callback.
*/
private readonly postPlayerCollectibleAdded;
/**
* Helper function to get the active collectible that Eden started with at the beginning of the
* run.
*
* Returns undefined if passed a player that is not Eden or if the starting collectibles are not
* yet added. (Eden's starting collectibles are added after the `POST_PLAYER_INIT` callback has
* fired.)
*
* @public
*/
getEdenStartingActiveCollectible(player: EntityPlayer): CollectibleType | undefined;
/**
* Helper function to get an array containing the active collectible and the passive collectible
* that Eden started with at the beginning of the run. The active collectible will be the first
* element and the passive collectible will be the second element.
*
* Returns an empty array if passed a player that is not Eden or if the starting collectibles are
* not yet added. (Eden's starting collectibles are added after the `POST_PLAYER_INIT` callback
* has fired.)
*
* @public
*/
getEdenStartingCollectibles(player: EntityPlayer): readonly CollectibleType[];
/**
* Helper function to get the health that Eden started with at the beginning of the run before any
* of the random collectibles were added.
*
* Returns undefined if passed a player that is not Eden.
*
* In order to use this function, you must upgrade your mod with `ISCFeature.EDEN_STARTING_STATS`.
*
* @public
*/
getEdenStartingHealth(player: EntityPlayer): Readonly | undefined;
/**
* Helper function to get the passive collectible that Eden started with at the beginning of the
* run.
*
* Returns undefined if passed a player that is not Eden or if the starting collectibles are not
* yet added. (Eden's starting collectibles are added after the `POST_PLAYER_INIT` callback has
* fired.)
*
* @public
*/
getEdenStartingPassiveCollectible(player: EntityPlayer): CollectibleType | undefined;
/**
* Helper function to get the value of the randomized starting stat for Eden that was assigned at
* the beginning of the run before any of the random collectibles were added.
*
* Returns undefined if passed a player that is not Eden.
*
* In order to use this function, you must upgrade your mod with `ISCFeature.EDEN_STARTING_STATS`.
*
* @public
*/
getEdenStartingStat(player: EntityPlayer, playerStat: T): PlayerStats[T] | undefined;
/**
* Helper function to get all of the stat values that Eden started with at the beginning of the
* run before any of the random collectibles were added.
*
* Returns undefined if passed a player that is not Eden.
*
* In order to use this function, you must upgrade your mod with `ISCFeature.EDEN_STARTING_STATS`.
*
* @public
*/
getEdenStartingStats(player: EntityPlayer): Readonly | undefined;
}
/**
* When Eggies take fatal damage, they go into NPCState.STATE_SUICIDE and spawn 14 Swarm Spiders
* while their StateFrame ticks upwards. The 14th spider appears when the StateFrame is at this
* value.
*/
export declare const EGGY_STATE_FRAME_OF_FINAL_SPIDER = 45;
/**
* A non-existent or completely transparent PNG file for use in clearing sprites. For more
* information, see the documentation for the `clearSprite` helper function.
*/
export declare const EMPTY_PNG_PATH = "gfx/none.png";
/** Helper function to remove all of the elements in an array in-place. */
export declare function emptyArray(array: unknown[]): void;
/**
* Helper function to remove all naturally spawning entities and grid entities from a room. Notably,
* this will not remove players (1), tears (2), familiars (3), lasers (7), knives (8), projectiles
* (9), blacklisted NPCs such as Dark Esau, charmed NPCs, friendly NPCs, persistent NPCs, most
* effects (1000), doors, and walls.
*/
export declare function emptyRoom(): void;
/** Helper function to remove all grid entities from a room except for doors and walls. */
export declare function emptyRoomGridEntities(): void;
/**
* A string that represents an entity. This is the entity type, variant, and sub-type, all separated
* by periods.
*
* This type is branded for extra type safety.
*/
export declare type EntityID = string & {
readonly __entityIDBrand: symbol;
};
/**
* Helper type to get a range of integers. It is inclusive on the lower end and exclusive on the
* high end. (The "E" in the type name stands for exclusive.)
*
* For example, `ERange<3, 5>` will return `3 | 4`.
*
* From:
* https://stackoverflow.com/questions/39494689/is-it-possible-to-restrict-number-to-a-certain-range
*/
export declare type ERange = Exclude, NaturalNumbersLessThan>;
/**
* Helper function to return an array of integers with the specified range, inclusive on the lower
* end and exclusive on the high end. (The "e" in the function name stands for exclusive.) Thus,
* this function works in a similar way as the built-in `range` function from Python.
*
* If the end is lower than the start, an empty array will be returned.
*
* For example:
*
* - `eRange(2)` returns `[0, 1]`.
* - `eRange(3)` returns `[0, 1, 2]`.
* - `eRange(-3)` returns `[0, -1, -2]`.
* - `eRange(1, 3)` returns `[1, 2]`.
* - `eRange(2, 5)` returns `[2, 3, 4]`.
* - `eRange(5, 2)` returns `[]`.
* - `eRange(3, 3)` returns `[]`.
*
* @param start The integer to start at.
* @param end Optional. The integer to end at. If not specified, then the start will be 0 and the
* first argument will be the end.
* @param increment Optional. The increment to use. Default is 1.
*/
export declare function eRange(start: int, end?: int, increment?: number): readonly int[];
declare type ErrorIsaacAPIClassIsNotSerializable = "Error: Isaac API classes (such as e.g. `Entity` or `RoomConfig`) are not serializable. For more information, see: https://isaacscript.github.io/main/gotchas#isaac-api-classes-are-not-serializable";
declare class EsauJrDetection extends Feature {
v: {
run: {
usedEsauJrFrame: int | null;
usedEsauJrControllerIndex: ControllerIndex | null;
usedEsauJrAtLeastOnce: boolean;
};
};
private readonly postEsauJr;
private readonly postFirstEsauJr;
constructor(postEsauJr: PostEsauJr, postFirstEsauJr: PostFirstEsauJr);
private readonly postUpdate;
private readonly postUseItemEsauJr;
}
/**
* These are a collection of functions for non-TypeScript users so that they can access some of
* useful methods offered on the `Array` class in the JavaScript standard library.
*
* If you are a TypeScript user, you should never use these functions, and instead use the more
* idiomatic object-oriented approach.
*
* @module
*/
/**
* Helper function for non-TypeScript users to check if every element in the array is equal to a
* condition.
*
* Internally, this just calls `Array.every`.
*/
export declare function every(array: readonly T[], func: (value: T, index: number, array: readonly T[]) => boolean): boolean;
/**
* When you enable this feature, many custom commands will be added to the in-game console. See the
* [dedicated command list](/isaacscript-common/features/ExtraConsoleCommandsList) for more
* information about them.
*
* Note that in order to avoid conflicts, if two or more mods enable this feature, then the first
* loaded one will control all of the command logic. When this occurs, a global variable of
* `__ISAACSCRIPT_COMMON_EXTRA_CONSOLE_COMMANDS_FEATURE` will be created and will automatically be
* used by the non-main instances. For this reason, if you use multiple mods with
* `isaacscript-common` and a custom command from the standard library is not working properly, then
* you might need to get another mod author to update their version of `isaacscript-common`.
*/
declare class ExtraConsoleCommands extends Feature {
private readonly isMainFeature;
private readonly commandFunctionMap;
private readonly postUpdate;
private readonly evaluateCacheDamage;
private readonly evaluateCacheFireDelay;
private readonly evaluateCacheSpeed;
private readonly evaluateCacheFlying;
private readonly postCurseEval;
private readonly executeCmd;
private readonly postFireTear;
private readonly entityTakeDmgPlayer;
/**
* Helper function to add a custom console command.
*
* The standard library comes with [many existing console
* commands](/isaacscript-common/features/ExtraConsoleCommandsList) that are useful for debugging,
* but you can also add your own commands that are useful for your particular mod. It's easier to
* add commands to the existing command system than to add your own logic manually to the
* `EXECUTE_CMD` callback.
*
* This function is intended to be called when your mod is first loading.
*
* In order to use this function, you must upgrade your mod with
* `ISCFeature.EXTRA_CONSOLE_COMMANDS`.
*
* @public
*/
addConsoleCommand(commandName: string, commandFunction: (params: string) => void): void;
/**
* Helper function to remove a custom console command.
*
* The standard library comes with [many existing console
* commands](/isaacscript-common/features/ExtraConsoleCommandsList) that are useful for debugging.
* If you want to disable one of them, use this function.
*
* This function is intended to be called when your mod is first loading.
*
* In order to use this function, you must upgrade your mod with
* `ISCFeature.EXTRA_CONSOLE_COMMANDS`.
*
* @public
*/
removeConsoleCommand(commandName: string): void;
/**
* Helper function to remove all custom console commands.
*
* The standard library comes with [many existing console
* commands](/isaacscript-common/features/ExtraConsoleCommandsList) that are useful for debugging.
* If you want to disable all of them after this feature has already been initialized, use this
* function.
*
* In order to use this function, you must upgrade your mod with
* `ISCFeature.EXTRA_CONSOLE_COMMANDS`.
*
* @public
*/
removeAllConsoleCommands(): void;
}
/**
* A function that creates the default value for your `DefaultMap`. For example, if it was a
* `DefaultMap` containing maps, the factory function would be:
*
* ```ts
* () => new Map()
* ```
*/
export declare type FactoryFunction = (...args: Args) => V;
declare class FadeInRemover extends Feature {
private enabled;
private readonly postGameStartedReordered;
/**
* Removes the fade-in that occurs at the beginning of a run. If this behavior is desired, call
* this function once at the beginning of your mod.
*
* This is useful for debugging, when you are resetting the game often.
*
* You can restore the vanilla behavior with the `restoreFadeIn` function.
*
* In order to use this function, you must upgrade your mod with `ISCFeature.FADE_IN_REMOVER`.
*
* @public
*/
removeFadeIn(): void;
/**
* Disables the fade-in remover. Only useful if you have previously called the `removeFadeIn`
* function.
*
* In order to use this function, you must upgrade your mod with `ISCFeature.FADE_IN_REMOVER`.
*
* @public
*/
restoreFadeIn(): void;
}
declare class FastReset extends Feature {
private enabled;
private readonly postRender;
/**
* Enables the fast-reset feature, which allows you to restart the game instantaneously. If this
* behavior is desired, call this function once at the beginning of your mod.
*
* This is useful for debugging, when you are resetting the game often.
*
* You can disable the fast-reset feature with the `disableFastReset` function.
*
* In order to use this function, you must upgrade your mod with `ISCFeature.FAST_RESET`.
*
* @public
*/
enableFastReset(): void;
/**
* Disables the fast-reset feature. Only useful if you have previously called the
* `enableFastReset` function.
*
* In order to use this function, you must upgrade your mod with `ISCFeature.FAST_RESET`.
*
* @public
*/
disableFastReset(): void;
}
/**
* The IsaacScript standard library contains many optional features, such as the ability to create
* custom pickups. All features are optional and are only initialized when needed. This class
* contains elements to facilitate that.
*
* Additionally, all custom callbacks extend from this class.
*/
declare abstract class Feature {
/**
* All features should only be instantiated once and are passed around to other features using
* dependency injection. We provide a run-time check in order to prevent the bug of any feature
* accidentally being instantiated twice.
*/
private static readonly constructedClassNames;
constructor();
}
/** Helper function to fill every possible level grid square with a red room. */
export declare function fillLevelWithRedRooms(): void;
/**
* Helper function for non-TypeScript users to filter the elements in an array. Returns the filtered
* array.
*
* Internally, this just calls `Array.filter`.
*/
export declare function filter(array: readonly T[], func: (value: T, index: number, array: readonly T[]) => boolean): readonly T[];
/**
* Helper function to perform a filter and a map at the same time. Similar to `Array.map`, provide a
* function that transforms a value, but return `undefined` if the value should be skipped. (Thus,
* this function cannot be used in situations where `undefined` can be a valid array element.)
*
* This function is useful because the `Array.map` method will always produce an array with the same
* amount of elements as the original array.
*
* This is named `filterMap` after the Rust function:
* https://doc.rust-lang.org/std/iter/struct.FilterMap.html
*/
export declare function filterMap(array: readonly OldT[], func: (element: OldT) => NewT | undefined): readonly NewT[];
/**
* Helper function for non-TypeScript users to find an element in an array.
*
* Internally, this just calls `Array.find`.
*/
export declare function find(array: readonly T[], func: (value: T, index: number, array: readonly T[]) => boolean): T | undefined;
/**
* Helper function to get a room position that is not overlapping with a grid entity, a heaven door,
* or a player. The `Room.FindFreePickupSpawnPosition` method will return locations that overlap
* with heaven doors and partially overlap with players, if the thing being spawned is bigger than a
* tile (like a Blood Donation Machine). Use this function instead if you want to account for those
* specific situations.
*
* @param startingPosition The position to start searching from. If this position is not overlapping
* with anything, then it will be returned.
* @param avoidActiveEntities Optional. Default is false.
* @param minimumDistance Optional. If specified, will ensure that the randomly generated position
* is equal to or greater than the distance provided.
*/
export declare function findFreePosition(startingPosition: Vector, avoidActiveEntities?: boolean, minimumDistance?: float): Readonly;
declare type FireArgs = Parameters;
/**
* Helper function to make an NPC fire one or more projectiles. Returns the fired projectile(s).
*
* Use this function instead of the `EntityNPC.FireProjectiles` method if you need to modify or
* access the `EntityProjectile` objects after they are fired, since this function returns the
* objects in an array.
*
* @param npc The NPC to fire the projectile(s) from. You can also pass undefined if you do not want
* the projectile(s) to come from anything in particular.
* @param position The staring position of the projectile(s).
* @param velocity The starting velocity of the projectile(s).
* @param projectilesMode Optional. The mode of the projectile(s). Default is
* `ProjectilesMode.ONE_PROJECTILE`.
* @param projectileParams Optional. The parameters of the projectile(s). Default is
* `ProjectileParams()`.
* @returns The fired projectile(s).
*/
export declare function fireProjectiles(npc: EntityNPC | undefined, position: Vector, velocity: Vector, projectilesMode?: ProjectilesMode, projectileParams?: ProjectileParams): readonly EntityProjectile[];
/**
* Helper function to spawn projectiles in a circle around a position. Under the hood, this
* leverages `ProjectileMode.N_PROJECTILES_IN_CIRCLE`.
*
* @param npc The NPC to fire the projectile(s) from. You can also pass undefined if you do not want
* the projectile(s) to come from anything in particular.
* @param position The staring position of the projectile(s).
* @param speed The speed of the projectile(s).
* @param numProjectiles The amount of projectiles to spawn.
* @returns The fired projectile(s).
*/
export declare function fireProjectilesInCircle(npc: EntityNPC | undefined, position: Vector, speed: float, numProjectiles: int): readonly EntityProjectile[];
/** Equal to `Card.FOOL` (1). */
export declare const FIRST_CARD_TYPE = CardType.FOOL;
/** Equal to `PlayerType.ISAAC` (0). */
export declare const FIRST_CHARACTER = PlayerType.ISAAC;
/** Equal to `CollectibleType.SAD_ONION` (1). */
export declare const FIRST_COLLECTIBLE_TYPE = CollectibleType.SAD_ONION;
/**
* The random items that appear when the player has TMTRAINER are generated on the fly as they are
* encountered by the player. The first TMTRAINER item takes the final possible 32 bit number. The
* second TMTRAINER item subtracts one from that, and so on.
*
* This is equal to 4294967295.
*/
export declare const FIRST_GLITCHED_COLLECTIBLE_TYPE: CollectibleType;
/** Equal to `PillColor.HORSE_BLUE_BLUE` (2049). */
export declare const FIRST_HORSE_PILL_COLOR = PillColor.HORSE_BLUE_BLUE;
/** Equal to `PillColor.BLUE_BLUE` (1). */
export declare const FIRST_PILL_COLOR = PillColor.BLUE_BLUE;
/** Equal to `PillEffect.BAD_GAS` (0). */
export declare const FIRST_PILL_EFFECT = PillEffect.BAD_GAS;
/** Equal to `TrinketType.SWALLOWED_PENNY` (1). */
export declare const FIRST_TRINKET_TYPE = TrinketType.SWALLOWED_PENNY;
declare class FlipDetection extends Feature {
v: {
run: {
/** We don't consider the case of a multiplayer game with more than one Tainted Lazarus. */
usedFlipAtLeastOnce: boolean;
};
};
private readonly postFlip;
private readonly postFirstFlip;
constructor(postFlip: PostFlip, postFirstFlip: PostFirstFlip);
private readonly postUseItemFlip;
}
/**
* An array containing every flying character. This includes non-main characters such as The Soul.
*/
export declare const FLYING_CHARACTERS: readonly [PlayerType.AZAZEL, PlayerType.LOST, PlayerType.SOUL, PlayerType.LOST_B, PlayerType.JACOB_2_B, PlayerType.SOUL_B];
declare class FlyingDetection extends Feature {
private readonly moddedElementSets;
/**
* Helper function to see if the player currently has flying from a temporary effect such as
* Hanged Man, Bat Wing, and so on.
*
* In order to use this function, you must upgrade your mod with `ISCFeature.FLYING_DETECTION`.
*
* @public
*/
hasFlyingTemporaryEffect(player: EntityPlayer): boolean;
}
/**
* An object containing all 7 vanilla fonts that are pre-loaded and ready to use.
*
* For more information on the vanilla fonts and to see what they look like, see:
* https://wofsauge.github.io/IsaacDocs/rep/tutorials/Tutorial-Rendertext.html
*/
export declare const fonts: {
readonly droid: Font;
readonly pfTempestaSevenCondensed: Font;
readonly teamMeatFont10: Font;
readonly teamMeatFont12: Font;
readonly teamMeatFont16Bold: Font;
readonly terminus: Font;
readonly upheaval: Font;
};
/**
* Helper function for non-TypeScript users to iterate over an array.
*
* Internally, this just calls `Array.forEach`.
*/
export declare function forEach(array: readonly T[], func: (value: T, index: number, array: readonly T[]) => void): void;
declare class ForgottenSwitch extends Feature {
private readonly pressInput;
/**
* When used on The Forgotten, switches to The Soul. When used on The Soul, switches to The
* Forgotten. This takes 1 game frame to take effect.
*
* In order to use this function, you must upgrade your mod with `ISCFeature.FORGOTTEN_SWITCH`.
*
* @public
*/
forgottenSwitch(player: EntityPlayer): void;
}
declare type FunctionIsNotSerializable = "Error: Functions are not serializable. For more information, see: https://isaacscript.github.io/main/gotchas#functions-are-not-serializable";
/** Helper type to represent a tuple containing the name of a function and the function itself. */
export declare type FunctionTuple = [name: string, func: AnyFunction];
/**
* A cached version of the class returned from the `Game()` constructor.
*
* Use this instead of invoking the constructor again for a miniscule performance increase.
*
* Caching the results of this constructor is safe, but caching other classes (like `Level` or
* `Room`) is not safe and can lead to the game crashing in certain situations.
*/
export declare const game: Game;
/** Game frames are what is returned by the `Game.GetFrameCount` method. */
export declare const GAME_FRAMES_PER_MINUTE: number;
/** Game frames are what is returned by the `Game.GetFrameCount` method. */
export declare const GAME_FRAMES_PER_SECOND = 30;
/**
* By default, callbacks fire in the following order:
* - `POST_NEW_ROOM` --> `POST_NEW_LEVEL` --> `POST_GAME_STARTED`
*
* It is easier to write mod code if the callbacks run in a more logical order:
* - `POST_GAME_STARTED` --> `POST_NEW_LEVEL` --> `POST_NEW_ROOM`
*
* `isaacscript-common` provides three new callbacks that change the order to this:
* - `POST_GAME_STARTED_REORDERED`
* - `POST_NEW_LEVEL_REORDERED`
* - `POST_NEW_ROOM_REORDERED`
*
* Additionally, there are some helper functions listed below that can deal with some edge cases
* that you may run into with these callbacks.
*/
declare class GameReorderedCallbacks extends Feature {
/** Used to detect a player resuming a saved run. */
private renderFrameRunStarted;
private currentStage;
private currentStageType;
private usedGlowingHourGlass;
private forceNewLevel;
private forceNewRoom;
private readonly postGameStartedReordered;
private readonly postNewLevelReordered;
private readonly postNewRoomReordered;
private readonly postGameStartedReorderedLast;
private readonly postUseItemGlowingHourGlass;
private readonly postPlayerInit;
private readonly postGameStarted;
private readonly preGameExit;
private readonly postNewLevel;
private readonly postNewRoom;
private recordCurrentStage;
/**
* Helper function to tell the `POST_NEW_LEVEL_REORDERED` callback that it should always fire on
* the next `POST_NEW_LEVEL`.
*
* If some specific cases, mods can change the current level during run initialization on the 0th
* frame. (For example, if you had a mod that made the player start the run in Caves instead of
* Basement.) However, due to how the callback reordering works, the `POST_NEW_LEVEL_REORDERED`
* callback will never fire on the 0th frame. To get around this, call this function before
* changing levels to temporarily force the callback to fire.
*
* In order to use this function, you must upgrade your mod with
* `ISCFeature.GAME_REORDERED_CALLBACKS`.
*
* @public
*/
forceNewLevelCallback(): void;
/**
* Helper function to tell the `POST_NEW_ROOM_REORDERED` callback that it should always fire on
* the next `POST_NEW_ROOM`.
*
* If some specific cases, mods can change the current room during run initialization on the 0th
* frame. (For example, if you had a mod that made the player start the Treasure Room of Basement
* 1 instead of the normal starting room.) However, due to how the callback reordering works, the
* `POST_NEW_ROOM_REORDERED` callback will never fire on the 0th frame. To get around this, call
* this function before changing rooms to temporarily force the callback to fire.
*
* In order to use this function, you must upgrade your mod with
* `ISCFeature.GAME_REORDERED_CALLBACKS`.
*
* @public
*/
forceNewRoomCallback(): void;
/**
* Helper function to manually set the variables that the reordered callback logic uses to track
* the current stage and stage type.
*
* This is useful because if the stage is changed with the `Game.SetStage` method (or the
* `setStage` helper function), the reordered callbacks will stop working.
*
* In order to use this function, you must upgrade your mod with
* `ISCFeature.GAME_REORDERED_CALLBACKS`.
*
* @public
*/
reorderedCallbacksSetStage(stage: LevelStage, stageType: StageType): void;
}
/**
* Helper function to find the active slots that the player has the corresponding collectible type
* in. Returns an empty array if the player does not have the collectible in any active slot.
*/
export declare function getActiveItemSlots(player: EntityPlayer, collectibleType: CollectibleType): readonly ActiveSlot[];
/**
* 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 function to get only the adjacent room grid indexes that exist (i.e. have room data).
*
* This is just a filtering of the results of the `getAdjacentExistingRoomGridIndexes` function. See
* that function for more information.
*
* @param roomGridIndex Optional. Default is the current room index.
*/
export declare function getAdjacentExistingRoomGridIndexes(roomGridIndex?: int): readonly int[];
/**
* Helper function to get only the adjacent room grid indexes that do not exist (i.e. do not have
* room data).
*
* This is just a filtering of the results of the `getAdjacentExistingRoomGridIndexes` function. See
* that function for more information.
*/
export declare function getAdjacentNonExistingRoomGridIndexes(roomGridIndex?: int): readonly int[];
/**
* Helper function to get all of the room grid indexes that are adjacent to a given room grid index
* (even if those room grid indexes do not have any rooms in them).
*
* Adjacent room grid indexes that are outside of the grid will not be included in the returned
* array.
*
* If a room grid index is provided that is outside of the grid, then an empty array will be
* returned.
*
* Note that this function does not take the shape of the room into account; it only looks at a
* single room grid index.
*
* @param roomGridIndex Optional. Default is the current room index.
*/
export declare function getAdjacentRoomGridIndexes(roomGridIndex?: int): readonly int[];
/**
* Helper function to get the adjusted price for a pickup, depending on how many Steam Sales all
* players currently have. (For example, if Jacob has one Steam Sale and Esau has one Steam Sale,
* the prices for items in the shop would be the same as if Isaac had two Steam Sales.)
*/
export declare function getAdjustedPrice(basePrice: int): int;
/**
* Helper function to get all of the non-dead bosses in the room.
*
* This function will not include bosses on an internal blacklist, such as Death's scythes or Big
* Horn holes.
*
* @param entityType Optional. If specified, will only get the bosses that match the type. Default
* is -1, which matches every type.
* @param variant Optional. If specified, will only get the bosses that match the variant. Default
* is -1, which matches every variant.
* @param subType Optional. If specified, will only get the bosses that match the sub-type. Default
* is -1, which matches every sub-type.
* @param ignoreFriendly Optional. Default is false.
*/
export declare function getAliveBosses(entityType?: EntityType | -1, variant?: number, subType?: number, ignoreFriendly?: boolean): readonly EntityNPC[];
/**
* Helper function to get all of the non-dead NPCs in the room.
*
* This function will not include NPCs on an internal blacklist, such as Death's scythes or Big Horn
* holes.
*
* @param entityType Optional. If specified, will only get the NPCs that match the type. Default is
* -1, which matches every type.
* @param variant Optional. If specified, will only get the NPCs that match the variant. Default is
* -1, which matches every variant.
* @param subType Optional. If specified, will only get the NPCs that match the sub-type. Default is
* -1, which matches every sub-type.
* @param ignoreFriendly Optional. Default is false.
*/
export declare function getAliveNPCs(entityType?: EntityType | -1, variant?: number, subType?: number, ignoreFriendly?: boolean): readonly EntityNPC[];
/**
* Helper function to get an array with every boss in the game. This is derived from the `BossID`
* enum.
*
* This includes:
* - Ultra Greed
* - Ultra Greedier
*
* This does not include:
* - mini-bosses (e.g. Ultra Pride, Krampus)
* - bosses that do not appear in Boss Rooms (e.g. Uriel, Gabriel)
* - the second phase of multi-phase bosses (e.g. Mega Satan 2)
* - sub-bosses of The Beast fight (e.g. Ultra Famine, Ultra Pestilence, Ultra War, Ultra Death)
* - bosses that do not have any Boss Rooms defined due to being unfinished (e.g. Raglich)
*
* Also see the `getAllNonStoryBosses` function.
*/
export declare function getAllBosses(): readonly BossID[];
/**
* Helper function to get every legal grid index for the current room.
*
* Under the hood, this uses the `Room.GetGridSize` method.
*/
export declare function getAllGridIndexes(): readonly int[];
/**
* Helper function to get an array with every boss in the game. This is derived from the `BossID`
* enum. This is the same thing as the `getAllBosses` helper function, but with story bosses
* filtered out.
*/
export declare function getAllNonStoryBosses(): readonly BossID[];
/**
* Helper function to get an array with every non-null pill color. This includes all gold colors and
* all horse colors.
*/
export declare function getAllPillColors(): readonly PillColor[];
/**
* Helper function to get every player with no restrictions, by using `Game.GetNumPlayers` and
* `Isaac.GetPlayer`.
*
* This function is almost never what you want to use. For most purposes, use the `getPlayers`
* helper function instead to get a filtered list of players.
*/
export declare function getAllPlayers(): readonly EntityPlayer[];
/**
* Helper function to get the room safe grid index for every room on the entire floor. This includes
* off-grid rooms, such as the Devil Room.
*
* Rooms without any data are assumed to be non-existent and are not included.
*/
export declare function getAllRoomGridIndexes(): readonly int[];
/**
* Helper function to get the corresponding ambush type for the current room. Returns undefined if
* the current room does not correspond to any particular ambush type.
*/
export declare function getAmbushType(): AmbushType | undefined;
export declare function getAngelRoomDoor(): GridEntityDoor | undefined;
export declare function getAngleDifference(angle1: float, angle2: float): float;
/**
* Helper function to get all possible combinations of the given array. This includes the
* combination of an empty array.
*
* For example, if this function is provided an array containing 1, 2, and 3, then it will return an
* array containing the following arrays:
*
* - [] (if `includeEmptyArray` is set to true)
* - [1]
* - [2]
* - [3]
* - [1, 2]
* - [1, 3]
* - [2, 3]
* - [1, 2, 3]
*
* From: https://github.com/firstandthird/combinations/blob/master/index.js
*
* @param array The array to get the combinations of.
* @param includeEmptyArray Whether to include an empty array in the combinations.
* @param min Optional. The minimum number of elements to include in each combination. Default is 1.
* @param max Optional. The maximum number of elements to include in each combination. Default is
* the length of the array.
*/
export declare function getArrayCombinations(array: readonly T[], includeEmptyArray: boolean, min?: int, max?: int): ReadonlyArray;
/**
* Helper function to get the duplicate elements in an array. Only one element for each value will
* be returned. The elements will be sorted before they are returned.
*/
export declare function getArrayDuplicateElements(array: readonly T[]): readonly T[];
/**
* Helper function to get an array containing the indexes of an array.
*
* For example, an array of `["Apple", "Banana"]` would return an array of `[0, 1]`.
*
* Note that normally, you would use the `Object.keys` method to get the indexes of an array, but
* due to implementation details of TypeScriptToLua, this results in an array of 1 through N
* (instead of an array of 0 through N -1).
*/
export declare function getArrayIndexes(array: readonly unknown[]): readonly int[];
/**
* Helper function to get how long Azazel's Brimstone laser should be. You can pass either an
* `EntityPlayer` object or a tear height stat.
*
* The formula for calculating it is: 32 - 2.5 * tearHeight
*/
export declare function getAzazelBrimstoneDistance(playerOrTearHeight: EntityPlayer | float): float;
/**
* Helper function to get all of the battery entities in the room.
*
* @param batterySubType Optional. If specified, will only get the batteries that match the
* sub-type. Default is -1, which matches every sub-type.
*/
export declare function getBatteries(batterySubType?: BatterySubType | -1): readonly EntityPickupBattery[];
/**
* 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 door that leads to the off-grid room that contains the hole to the
* Blue Womb. (In vanilla, the door will only appear in the It Lives Boss Room.)
*
* Returns undefined if the room has no Blue Womb doors.
*/
export declare function getBlueWombDoor(): GridEntityDoor | undefined;
/**
* 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 all of the bomb entities in the room. (Specifically, this refers to bomb
* pickups, not the `EntityBomb` class.)
*
* @param bombSubType Optional. If specified, will only get the bombs that match the sub-type.
* Default is -1, which matches every sub-type.
*/
export declare function getBombPickups(bombSubType?: BombSubType | -1): readonly EntityPickupBomb[];
/** Helper function to find out how large a bomb explosion is based on the damage inflicted. */
export declare function getBombRadiusFromDamage(damage: float): float;
/**
* Helper function to get all of the bombs in the room. (Specifically, this refers to the
* `EntityBomb` class, not bomb pickups.)
*
* For example:
*
* ```ts
* // Make all of the bombs in the room invisible.
* for (const bomb of getBombs()) {
* bomb.Visible = false;
* }
* ```
*
* @param bombVariant Optional. If specified, will only get the bombs that match the variant.
* Default is -1, which matches every variant.
* @param subType Optional. If specified, will only get the bombs that match the sub-type. Default
* is -1, which matches every sub-type.
*/
export declare function getBombs(bombVariant?: BombVariant | -1, subType?: number): readonly EntityBomb[];
/**
* Helper function to safely get boolean values from a Lua table. Will throw an error if the
* specific value does not exist on the table.
*
* This function is variadic, meaning that you can specify N arguments to get N values.
*/
export declare function getBooleansFromTable(luaMap: LuaMap, objectName: string, ...keys: readonly string[]): readonly boolean[];
/**
* Helper function to get all of the bosses in the room.
*
* @param entityType Optional. If specified, will only get the bosses that match the type. Default
* is -1, which matches every type.
* @param variant Optional. If specified, will only get the bosses that match the variant. Default
* is -1, which matches every variant.
* @param subType Optional. If specified, will only get the bosses that match the sub-type. Default
* is -1, which matches every sub-type.
* @param ignoreFriendly Optional. Default is false.
*/
export declare function getBosses(entityType?: EntityType, variant?: int, subType?: int, ignoreFriendly?: boolean): readonly EntityNPC[];
/**
* Helper function to get the boss ID corresponding to the current room. Returns undefined if the
* current room is not a Boss Room.
*
* Use this instead of the vanilla `Room.GetBossID` method since it has a saner return type and it
* correctly handles Dogma, The Beast, and Ultra Greedier.
*/
export declare function getBossID(): BossID | undefined;
export declare function getBossIDFromEntityTypeVariant(entityType: EntityType, variant: int): BossID | undefined;
/**
* Helper function to get the set of vanilla bosses for a particular stage across all of the stage
* types. For example, specifying `LevelStage.BASEMENT_2` will return a set with all of the bosses
* for Basement, Cellar, Burning Basement, Downpour, and Dross.
*
* Also see the `getAllBossesSet` and `getBossIDsForStageID` functions.
*/
export declare function getBossIDsForStage(stage: LevelStage): ReadonlySet | undefined;
/**
* Helper function to get the set of vanilla bosses that can randomly appear on a particular stage
* ID.
*
* Also see the `getAllBossesSet` and `getBossIDsForStage` functions.
*/
export declare function getBossIDsForStageID(stageID: StageID): readonly BossID[] | undefined;
/**
* Helper function to get the proper English name for a boss. For example, the name for
* `BossID.WRETCHED` (36) is "The Wretched".
*/
export declare function getBossName(bossID: BossID): string;
/**
* Helper function to get the path to the name file that corresponds to the graphic shown on the
* versus screen for the particular boss.
*
* For example, the file path for `BossID.MONSTRO` is "gfx/ui/boss/bossname_20.0_monstro.png".
*/
export declare function getBossNamePNGFilePath(bossID: BossID): string;
/**
* Helper function to get the path to the portrait file that corresponds to the graphic shown on the
* versus screen for the particular boss.
*
* For example, the file path for `BossID.MONSTRO` is "gfx/ui/boss/portrait_20.0_monstro.png".
*/
export declare function getBossPortraitPNGFilePath(bossID: BossID): string;
/**
* Helper function to get the door that leads to the Boss Rush. (In vanilla, the door will only
* appear in the Boss Room of the sixth floor.)
*
* Returns undefined if the room has no Boss Rush doors.
*/
export declare function getBossRushDoor(): GridEntityDoor | undefined;
/** Helper function to get the set of stage IDs that a particular boss naturally appears in. */
export declare function getBossStageIDs(bossID: BossID): ReadonlySet;
/**
* Helper function to get a card description from a `CardType` value. Returns "Unknown" if the
* provided card type is not valid.
*
* This function works for both vanilla and modded trinkets.
*
* For example, `getCardDescription(CardType.FOOL)` would return "Where journey begins".
*/
export declare function getCardDescription(cardType: CardType): string;
/**
* Helper function to get the name of a card. Returns "Unknown" if the provided card type is not
* valid.
*
* This function works for both vanilla and modded trinkets.
*
* For example, `getCardName(Card.FOOL)` would return "0 - The Fool".
*/
export declare function getCardName(cardType: CardType): string;
/**
* Helper function to get all of the card entities in the room.
*
* @param cardType Optional. If specified, will only get the cards that match the sub-type. Default
* is -1, which matches every sub-type.
*/
export declare function getCards(cardType?: CardType | -1): readonly EntityPickupCard[];
/**
* Get the final boss of a challenge. This will only work for vanilla challenges.
*
* For modded challenges, `BossID.MOM` (6) will be returned.
*
* Note that for `Challenge.BACKASSWARDS` (31), this function will return `BossID.MEGA_SATAN` (55),
* but this is not actually the final boss. (There is no final boss for this challenge.)
*/
export declare function getChallengeBoss(challenge: Challenge): BossID;
/**
* Get the starting character of a challenge. This will only work for vanilla challenges.
*
* For modded challenges, `PlayerType.ISAAC` (0) will be returned.
*/
export declare function getChallengeCharacter(challenge: Challenge): PlayerType;
/**
* Get the extra starting collectibles for a challenge. This will only work for vanilla challenges.
*
* For modded challenges, an empty array will be returned.
*/
export declare function getChallengeCollectibleTypes(challenge: Challenge): readonly CollectibleType[];
/**
* Get the proper name for a `Challenge` enum. This will only work for vanilla challenges.
*
* For modded challenges, "Unknown" will be returned.
*/
export declare function getChallengeName(challenge: Challenge): string;
/**
* Get the extra starting trinket for a challenge. This will only work for vanilla challenges.
*
* If a challenge does not grant a starting trinket, `undefined` will be returned.
*
* For modded challenges, `undefined` will be returned.
*/
export declare function getChallengeTrinketType(challenge: Challenge): TrinketType | undefined;
/**
* Helper function to get the numerical damage multiplier for a character.
*
* @param character The character to get.
* @param hasWhoreOfBabylon Optional. Whether the character has the Whore of Babylon effect
* currently active. Defaults to false. This is necessary because Eve's
* damage multiplier changes from 0.75 to 1 when she has Whore of Babylon
* active.
*/
export declare function getCharacterDamageMultiplier(character: PlayerType, hasWhoreOfBabylon?: boolean): float;
/**
* - Most characters have a 56 frame death animation (i.e. the "Death" animation).
* - The Lost and Tainted Lost have a 38 frame death animation (i.e. the "LostDeath" animation).
* - Tainted Forgotten have a 20 frame death animation (i.e. the "ForgottenDeath" animation).
*/
export declare function getCharacterDeathAnimationName(character: PlayerType): string;
/**
* Returns the maximum heart containers that the provided character can have. Normally, this is 12,
* but with Keeper it is 3, and with Tainted Keeper it is 2. This does not account for Birthright or
* Mother's Kiss; use the `getPlayerMaxHeartContainers` helper function for that.
*/
export declare function getCharacterMaxHeartContainers(character: PlayerType): int;
/** Helper function to get the name of a character. Returns "Unknown" for modded characters. */
export declare function getCharacterName(character: PlayerType): string;
/**
* Helper function to get the path to the name file that corresponds to the graphic shown on the
* versus screen for the particular character.
*
* For example, the file path for `PlayerType.ISAAC` is "gfx/ui/boss/playername_01_isaac.png".
*/
export declare function getCharacterNamePNGFilePath(character: PlayerType): string;
/**
* Helper function to get the path to the portrait file that corresponds to the graphic shown on the
* versus screen for the particular character.
*
* For example, the file path for `PlayerType.ISAAC` is "gfx/ui/boss/playerportrait_isaac.png".
*/
export declare function getCharacterPortraitPNGFilePath(character: PlayerType): string;
/** Helper function to get an array containing the characters of all of the current players. */
export declare function getCharacters(): readonly PlayerType[];
/**
* Helper function to get the path to the sprite for a particular character.
*
* For example, the file path for `PlayerType.ISAAC` is
* "characters/costumes/character_001_isaac.png".
*/
export declare function getCharacterSpritePNGFilePath(character: PlayerType): string;
/**
* Helper function to get the collectibles that are granted to a particular character at the
* beginning of a run.
*
* Note that this will return an empty array for Eden and Tainted Eden.
*/
export declare function getCharacterStartingCollectibleTypes(character: PlayerType): readonly CollectibleType[];
/**
* Helper function to get the trinket that is granted to a particular character at the beginning of
* a run. Returns undefined if the character does not start with a trinket.
*
* Note that this will return undefined for Eden and Tainted Eden.
*/
export declare function getCharacterStartingTrinketType(character: PlayerType): TrinketType | undefined;
/**
* Helper function to get the amount of charges away from the maximum charge that a particular
* player is.
*
* This function accounts for The Battery. For example, if the player has 2/6 charges on a D6, this
* function will return 10 (because there are 4 charges remaining on the base charge and 6 charges
* remaining on The Battery charge).
*
* @param player The player to get the charges from.
* @param activeSlot Optional. The slot to get the charges from. Default is `ActiveSlot.PRIMARY`.
*/
export declare function getChargesAwayFromMax(player: EntityPlayer, activeSlot?: ActiveSlot): int;
/**
* 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 all of the chest entities in the room. Specifically, this is all of the
* pickups with a variant in the `CHEST_PICKUP_VARIANTS` constant.
*
* @param subType Optional. If specified, will only get the chests that match the sub-type. Default
* is -1, which matches every sub-type.
*/
export declare function getChests(subType?: number): readonly EntityPickup[];
/**
* Helper function to get an array of equidistant points on the circumference around a circle.
* Useful for equally distributing things in a circle pattern.
*
* @param centerPos A position that represents the center of the center to get the points from.
* @param radius The length of the radius of the circle.
* @param numPoints The number of points on the circumference of the circle to get.
* @param xMultiplier An optional multiplier to get the points around an oval. Default is 1.
* @param yMultiplier An optional multiplier to get the points around an oval. Default is 1.
* @param initialDirection By default, the first point on the circle will be on the top center, but
* this can be optionally changed by specifying this argument.
*/
export declare function getCircleDiscretizedPoints(centerPos: Vector, radius: float, numPoints: int, xMultiplier?: number, yMultiplier?: number, initialDirection?: Direction): ReadonlyArray>;
/**
* Given an array of entities, this helper function returns the closest one to a provided reference
* entity.
*
* For example:
*
* ```ts
* const player = Isaac.GetPlayer();
* const gapers = getEntities(EntityType.GAPER);
* const closestGaper = getClosestEntityTo(player, gapers);
* ```
*
* @param referenceEntity The entity that is close by.
* @param entities The array of entities to look through.
* @param filterFunc Optional. A function to filter for a specific type of entity, like e.g. an
* enemy with a certain amount of HP left.
*/
export declare function getClosestEntityTo(referenceEntity: Entity, entities: readonly T[], filterFunc?: (entity: T) => boolean): T | undefined;
/**
* Helper function to get the closest player to a certain position. Note that this will never
* include players with a non-undefined parent, since they are not real players (e.g. the Strawman
* Keeper).
*/
export declare function getClosestPlayer(position: Vector): EntityPlayer;
/**
* Given an array of vectors, this helper function returns the closest one to a provided reference
* vector.
*
* @param referenceVector The vector to compare against.
* @param vectors The array of vectors to look through.
*/
export declare function getClosestVectorTo(referenceVector: Vector, vectors: readonly Vector[]): Vector | undefined;
/**
* 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 all of the coin pickup entities in the room.
*
* @param coinSubType Optional. If specified, will only get the coins that match the sub-type.
* Default is -1, which matches every sub-type.
*/
export declare function getCoins(coinSubType?: CoinSubType | -1): readonly EntityPickupCoin[];
/**
* 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 charge type that a collectible has. Returns
* `ItemConfigChargeType.NORMAL` if the provided collectible type was not valid.
*/
export declare function getCollectibleChargeType(collectibleOrCollectibleType: EntityPickup | CollectibleType): ItemConfigChargeType;
/**
* Helper function to get the in-game description for a collectible. Returns "Unknown" if the
* provided collectible type was not valid.
*
* This function works for both vanilla and modded collectibles.
*/
export declare function getCollectibleDescription(collectibleOrCollectibleType: EntityPickup | CollectibleType): string;
/**
* Helper function to get the coin cost that a collectible item would be if it were being offered in
* a Devil Room deal. Returns 0 if passed `CollectibleType.NULL`.
*/
export declare function getCollectibleDevilCoinPrice(collectibleOrCollectibleType: EntityPickup | CollectibleType): int;
/**
* Helper function to get the heart cost that a collectible item would be if it were being offered
* in a Devil Room deal. Returns 0 if passed `CollectibleType.NULL`.
*/
export declare function getCollectibleDevilHeartPrice(collectibleOrCollectibleType: EntityPickup | CollectibleType, player: EntityPlayer): PickupPrice;
/**
* Helper function to get the path to a collectible PNG file. Returns the path to the question mark
* sprite (i.e. from Curse of the Blind) if the provided collectible type was not valid.
*
* If you intentionally want the path to the question mark sprite, pass -1 as the collectible type.
*
* Note that this does not return the file name, but the full path to the collectible's PNG file.
* The function is named "GfxFilename" to correspond to the associated `ItemConfigItem.GfxFileName`
* field.
*/
export declare function getCollectibleGfxFilename(collectibleOrCollectibleType: EntityPickup | CollectibleType | -1): string;
/**
* Helper function to get the initial amount of charges that a collectible has. In most cases, when
* picking up an active collectible for the first time, it will be fully charged, which corresponds
* to an `InitCharge` value of -1. However, in some cases, this may be different. For example,
* Eden's Soul starts without any charges, so it has an `InitCharge` value of 0.
*
* This function returns 0 if the provided collectible type was not valid. This function returns -1
* if the provided collectible type was not an active collectible.
*/
export declare function getCollectibleInitCharge(collectibleOrCollectibleType: EntityPickup | CollectibleType): int;
/**
* Helper function to get the `ItemType` of a collectible. Returns `ItemType.ITEM_NULL` if the
* provided collectible type was not valid.
*/
export declare function getCollectibleItemType(collectibleOrCollectibleType: EntityPickup | CollectibleType): ItemType;
/**
* Helper function to get the maximum amount of charges that a collectible has. Returns 0 if the
* provided collectible type was not valid.
*/
export declare function getCollectibleMaxCharges(collectibleOrCollectibleType: EntityPickup | CollectibleType): int;
/**
* Helper function to get the name of a collectible. Returns "Unknown" if the provided collectible
* type is not valid.
*
* This function works for both vanilla and modded collectibles.
*
* For example, `getCollectibleName(CollectibleType.SAD_ONION)` would return "Sad Onion".
*/
export declare function getCollectibleName(collectibleOrCollectibleType: EntityPickup | CollectibleType): string;
/**
* Helper function to get the "pedestal type" of a collectible. For example, it might be sitting on
* top of a broken Blood Donation Machine, or it might be sitting on top of an opened Spiked Chest.
*/
export declare function getCollectiblePedestalType(collectible: EntityPickup): CollectiblePedestalType;
/**
* Helper function to get a collectible's quality, which ranges from 0 to 4 (inclusive). For
* example, Mom's Knife has a quality of 4. Returns 0 if the provided collectible type was not
* valid.
*/
export declare function getCollectibleQuality(collectibleOrCollectibleType: EntityPickup | CollectibleType): Quality;
/**
* Helper function to get all of the collectible entities in the room.
*
* @param collectibleType Optional. If specified, will only get the collectibles that match the
* sub-type. Default is -1, which matches every sub-type.
*/
export declare function getCollectibles(collectibleType?: CollectibleType | -1): readonly EntityPickupCollectible[];
/**
* Helper function to get the tags of a collectible (which is the composition of zero or more
* `ItemConfigTag`). Returns 0 if the provided collectible type is not valid.
*
* For example:
*
* ```ts
* const collectibleType = CollectibleType.SAD_ONION;
* const itemConfigTags = getCollectibleTags(collectibleType); // itemConfigTags is "18350080"
* ```
*/
export declare function getCollectibleTags(collectibleOrCollectibleType: EntityPickup | CollectibleType): BitFlags;
/**
* Gets the entities that have a hitbox that overlaps with any part of the square that the grid
* entity is on.
*
* This function is useful because the vanilla collision callbacks do not work with grid entities.
* This is used by `POST_GRID_ENTITY_COLLISION` custom callback.
*
* Note that this function will not work properly in the `POST_NEW_ROOM` callback since entities do
* not have collision yet in that callback.
*/
export declare function getCollidingEntitiesWithGridEntity(gridEntity: GridEntity): readonly Entity[];
/** Helper function to get the entity type, variant, and sub-type from an `EntityID`. */
export declare function getConstituentsFromEntityID(entityID: EntityID): [entityType: EntityType, variant: int, subType: int];
/** Helper function to get the grid entity type and variant from a `GridEntityID`. */
export declare function getConstituentsFromGridEntityID(gridEntityID: GridEntityID): [gridEntityType: GridEntityType, variant: int];
/**
* Helper function to get all of the grid entities of type `GridEntityType.CRAWL_SPACE` (18) in the
* room.
*
* @param crawlSpaceVariant Optional. If specified, will only get the crawl spaces that match the
* variant. Default is -1, which matches every variant.
*/
export declare function getCrawlSpaces(crawlSpaceVariant?: CrawlSpaceVariant | -1): readonly GridEntity[];
/**
* Helper function to get the actual bit flag for modded curses.
*
* Will throw a run-time error if the provided curse does not exist.
*
* Use this over the `Isaac.GetCurseIdByName` method because that will return an integer instead of
* a bit flag.
*/
export declare function getCurseIDByName(name: string): LevelCurse;
/**
* Helper function to get the collectibles that are in a particular item pool at the beginning of a
* vanilla run.
*/
export declare function getDefaultCollectibleTypesInItemPool(itemPoolType: ItemPoolType): ReadonlySet;
/**
* Helper function to get a set containing all of the global variable names that are contained
* within the Isaac environment by default.
*
* Returns a slightly different set depending on whether the "--luadebug" flag is enabled.
*/
export declare function getDefaultGlobals(): ReadonlySet;
/**
* Helper function to get the item pools that a particular collectible starts in at the beginning of
* a vanilla run.
*
* This function will automatically account for Greed Mode. In other words, it will not return the
* "normal" item pools when playing in Greed Mode.
*/
export declare function getDefaultItemPoolsForCollectibleType(collectibleType: CollectibleType): readonly ItemPoolType[];
/**
* Returns the starting stat that Isaac (the default character) starts with. For example, if you
* pass this function `CacheFlag.DAMAGE`, it will return 3.5.
*
* Note that the default fire delay is represented in the tear stat, not the `MaxFireDelay` value.
*/
export declare function getDefaultPlayerStat(cacheFlag: CacheFlag): number | undefined;
export declare function getDevilRoomDoor(): GridEntityDoor | undefined;
/**
* If there is both a Devil Room and an Angel Room door, this function will return door with the
* lowest slot number.
*/
export declare function getDevilRoomOrAngelRoomDoor(): GridEntityDoor | undefined;
/**
* Helper function to get the current dimension. Most of the time, this will be `Dimension.MAIN`,
* but it can change if e.g. the player is in the mirror world of Downpour/Dross.
*/
export declare function getDimension(): Dimension;
/**
* Helper function to get the lowercase name of a direction. For example, `Direction.LEFT` (0) would
* return "left".
*/
export declare function getDirectionName(direction: Direction): string | undefined;
/**
* Helper function to get the position that a player will enter a room at corresponding to a door.
*
* When players enter a room, they do not appear exactly on the location of the door, because then
* they would immediately collide with the loading zone. Instead, they appear on the grid tile next
* to the door.
*/
export declare function getDoorEnterPosition(door: GridEntityDoor): Readonly;
/**
* Helper function to get all of the doors in the room. By default, it will return every door.
*
* You can optionally specify one or more room types to return only the doors that match the
* specified room types.
*
* @allowEmptyVariadic
*/
export declare function getDoors(...roomTypes: readonly RoomType[]): readonly GridEntityDoor[];
/**
* Helper function to get the position that a player will enter a room at corresponding to a door
* slot.
*
* When players enter a room, they do not appear exactly on the location of the door, because then
* they would immediately collide with the loading zone. Instead, they appear on the grid tile next
* to the door.
*/
export declare function getDoorSlotEnterPosition(doorSlot: DoorSlot): Readonly;
/**
* Helper function to get the offset from a door position that a player will enter a room at.
*
* When players enter a room, they do not appear exactly on the location of the door, because then
* they would immediately collide with the loading zone. Instead, they appear on the grid tile next
* to the door.
*/
export declare function getDoorSlotEnterPositionOffset(doorSlot: DoorSlot): Readonly;
/** Helper function to get the possible door slots that can exist for a given room shape. */
export declare function getDoorSlotsForRoomShape(roomShape: RoomShape): ReadonlySet;
/**
* Helper function to get all of the doors in the room that lead to the provided room index.
*
* This function is variadic, meaning that you can specify N arguments to return all of the doors
* that match any of the N room grid indexes.
*/
export declare function getDoorsToRoomIndex(...roomGridIndex: readonly int[]): readonly GridEntityDoor[];
/**
* Helper function to account for Repentance floors being offset by 1. For example, Downpour 2 is
* the third level of the run, but the game considers it to have a stage of 2. This function will
* consider Downpour 2 to have a stage of 3.
*/
export declare function getEffectiveStage(): LevelStage;
/**
* Helper function to get all of the effects in the room.
*
* For example:
*
* ```ts
* // Make all of the effects in the room invisible.
* for (const effect of getEffects()) {
* effect.Visible = false;
* }
* ```
*
* @param effectVariant Optional. If specified, will only get the effects that match the variant.
* Default is -1, which matches every variant.
* @param subType Optional. If specified, will only get the effects that match the sub-type. Default
* is -1, which matches every sub-type.
*/
export declare function getEffects(effectVariant?: EffectVariant | -1, subType?: number): readonly EntityEffect[];
/**
* Helper function to get an array of temporary effects for a player. This is helpful so that you
* don't have to manually create an array from an `EffectsList` object.
*/
export declare function getEffectsList(player: EntityPlayer): readonly TemporaryEffect[];
export declare function getElapsedGameFramesSince(gameFrameCount: int): int;
export declare function getElapsedRenderFramesSince(renderFrameCount: int): int;
export declare function getElapsedRoomFramesSince(roomFrameCount: int): int;
/**
* Helper function to get the amount of elapsed time for benchmarking / profiling purposes.
*
* For more information, see the documentation for the `getTime` helper function.
*
* @param time The milliseconds (int) or fractional seconds (float).
* @param useSocketIfAvailable Optional. Whether to use the `socket.gettime` method, if available.
* Default is true. If set to false, the `Isaac.GetTime()` method will
* always be used.
*/
export declare function getElapsedTimeSince(time: int | float, useSocketIfAvailable?: boolean): int;
/**
* Helper function to get all of the entities in the room or all of the entities that match a
* specific entity type / variant / sub-type.
*
* Due to bugs with `Isaac.FindInRadius`, this function uses `Isaac.GetRoomEntities`, which is more
* expensive but also more robust. (If a matching entity type is provided, then `Isaac.FindByType`
* will be used instead.)
*
* For example:
*
* ```ts
* // Make all of the entities in the room invisible.
* for (const entity of getEntities()) {
* entity.Visible = false;
* }
* ```
*
* @param entityType Optional. If specified, will only get the entities that match the type. Default
* is -1, which matches every type.
* @param variant Optional. If specified, will only get the entities that match the variant. Default
* is -1, which matches every variant.
* @param subType Optional. If specified, will only get the entities that match the sub-type.
* Default is -1, which matches every sub-type.
* @param ignoreFriendly Optional. If set to true, it will exclude friendly NPCs from being
* returned. Default is false. Will only be taken into account if the
* `entityType` is specified.
*/
export declare function getEntities(entityType?: EntityType | -1, variant?: number, subType?: number, ignoreFriendly?: boolean): readonly Entity[];
/**
* Helper function to get all the fields on an entity. For example, this is useful for comparing it
* to another entity later. (One option is to use the `logTableDifferences` function for this.)
*
* This function will only get fields that are equal to booleans, numbers, or strings, or Vectors,
* as comparing other types is non-trivial.
*/
export declare function getEntityFields(entity: Entity): LuaMap;
/**
* Helper function to get an entity from a `PtrHash`. Note that doing this is very expensive, so you
* should only use this function when debugging. (Normally, if you need to work backwards from a
* reference, you would use an `EntityPtr` instead of a `PtrHash`.
*/
export declare function getEntityFromPtrHash(ptrHash: PtrHash): Entity | undefined;
/** Helper function to get a string containing the entity's type, variant, and sub-type. */
export declare function getEntityID(entity: Entity): EntityID;
/**
* Helper function to get a formatted string in the format returned by the `getEntityID` function.
*/
export declare function getEntityIDFromConstituents(entityType: EntityType, variant: int, subType: int): EntityID;
/**
* Helper function to get a map containing the positions of every entity in the current room.
*
* This is useful for rewinding entity positions at a later time. Also see `setEntityPositions`.
*
* @param entities Optional. If provided, will only get the positions of the provided entities. Use
* this with cached entities to avoid invoking the `Isaac.GetRoomEntities` method
* multiple times.
*/
export declare function getEntityPositions(entities?: readonly Entity[]): ReadonlyMap;
export declare function getEntityTypeVariantFromBossID(bossID: BossID): readonly [EntityType, int];
/**
* Helper function to get a map containing the velocities of every entity in the current room.
*
* This is useful for rewinding entity velocities at a later time. Also see `setEntityVelocities`.
*
* @param entities Optional. If provided, will only get the velocities of the provided entities. Use
* this with cached entities to avoid invoking the `Isaac.GetRoomEntities` method
* multiple times.
*/
export declare function getEntityVelocities(entities?: readonly Entity[]): ReadonlyMap;
/**
* TypeScriptToLua will transpile TypeScript number enums to Lua tables that have a double mapping.
* Thus, when you iterate over them, you will get both the names of the enums and the values of the
* enums, in a random order. Use this helper function to get the entries of the enum with the
* reverse mappings filtered out.
*
* This function will return the enum values in a sorted order, which may not necessarily be the
* same order as which they were declared in. (It is impossible to get the declaration order at
* run-time.)
*
* This function will work properly for both number enums and string enums. (Reverse mappings are
* not created for string enums.)
*
* Also see the `getEnumKeys` and `getEnumValues` helper functions.
*
* For a more in depth explanation, see:
* https://isaacscript.github.io/main/gotchas#iterating-over-enums
*/
export declare function getEnumEntries(transpiledEnum: T): ReadonlyArray<[key: string, value: T[keyof T]]>;
/**
* TypeScriptToLua will transpile TypeScript number enums to Lua tables that have a double mapping.
* Thus, when you iterate over them, you will get both the names of the enums and the values of the
* enums, in a random order. If all you need are the keys of an enum, use this helper function.
*
* This function will return the enum keys in a sorted order, which may not necessarily be the same
* order as which they were declared in. (It is impossible to get the declaration order at
* run-time.)
*
* This function will work properly for both number enums and string enums. (Reverse mappings are
* not created for string enums.)
*
* Also see the `getEnumEntries` and `getEnumValues` helper functions.
*
* For a more in depth explanation, see:
* https://isaacscript.github.io/main/gotchas#iterating-over-enums
*/
export declare function getEnumKeys(transpiledEnum: TranspiledEnum): readonly string[];
/** Helper function to get the amount of entries inside of an enum. */
export declare function getEnumLength(transpiledEnum: TranspiledEnum): int;
/**
* TypeScriptToLua will transpile TypeScript number enums to Lua tables that have a double mapping.
* Thus, when you iterate over them, you will get both the names of the enums and the values of the
* enums, in a random order. If all you need are the names of an enum from the reverse mapping, use
* this helper function.
*
* This function will return the enum names in a sorted order, which may not necessarily be the same
* order as which they were declared in. (It is impossible to get the declaration order at
* run-time.)
*
* This function will work properly for both number enums and string enums. (Reverse mappings are
* not created for string enums, so their names would be equivalent to what would be returned by the
* `getEnumKeys` function.)
*
* For a more in depth explanation, see:
* https://isaacscript.github.io/main/gotchas#iterating-over-enums
*/
export declare function getEnumNames(transpiledEnum: TranspiledEnum): readonly string[];
/**
* TypeScriptToLua will transpile TypeScript number enums to Lua tables that have a double mapping.
* Thus, when you iterate over them, you will get both the names of the enums and the values of the
* enums, in a random order. If all you need are the values of an enum, use this helper function.
*
* This function will return the enum values in a sorted order, which may not necessarily be the
* same order as which they were declared in. (It is impossible to get the declaration order at
* run-time.)
*
* This function will work properly for both number enums and string enums. (Reverse mappings are
* not created for string enums.)
*
* Also see the `getEnumEntries` and `getEnumKeys` helper functions.
*
* For a more in depth explanation, see:
* https://isaacscript.github.io/main/gotchas#iterating-over-enums
*/
export declare function getEnumValues(transpiledEnum: T): ReadonlyArray;
/**
* Helper function to get the associated pill effect after False PHD is acquired. If a pill effect
* is not altered by False PHD, then the same pill effect will be returned.
*/
export declare function getFalsePHDPillEffect(pillEffect: PillEffect): PillEffect;
/**
* Helper function to get all of the familiars in the room.
*
* For example:
*
* ```ts
* // Make all of the familiars in the room invisible.
* for (const familiar of getFamiliars()) {
* familiar.Visible = false;
* }
* ```
*
* @param familiarVariant Optional. If specified, will only get the familiars that match the
* variant. Default is -1, which matches every variant.
* @param subType Optional. If specified, will only get the familiars that match the sub-type.
* Default is -1, which matches every sub-type.
*/
export declare function getFamiliars(familiarVariant?: FamiliarVariant | -1, subType?: number): readonly EntityFamiliar[];
/**
* Helper function to compare two different arrays of entities. Returns the entities that are in the
* second array but not in the first array.
*/
export declare function getFilteredNewEntities(oldEntities: readonly T[], newEntities: readonly T[]): readonly T[];
/**
* Helper function to return the player with the highest ID, according to the `Isaac.GetPlayer`
* method.
*/
export declare function getFinalPlayer(): EntityPlayer;
/**
* - The `EntityPlayer` object stores a player's tear rate in the `MaxFireDelay` field. This is
* equivalent to how many tears the player can shoot per frame.
* - If you already have a "tears" stat and you want to convert it back to MaxFireDelay, then use
* this function.
* - In this context, the "tears stat" represents what is shown on the in-game stat UI.
*/
export declare function getFireDelay(tearsStat: float): float;
/** 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;
/**
* Helper function to get the key associated with a particular flag.
*
* (Since bit flags are represented by custom objects instead of normal TypeScript enums, you cannot
* use the reverse mapping to find the associated key of a given enum value. Use this helper
* function instead of indexing the enum directly.)
*/
export declare function getFlagName(flag: BitFlag, flagEnum: ReadonlyRecord): string | undefined;
/**
* Helper function to get the minimap `DisplayFlag` value for every room on the floor. Returns a map
* that is indexed by the room's safe grid index.
*
* This function automatically accounts for if MinimapAPI is being used.
*
* @param minimapAPI Optional. If MinimapAPI should be used, if present. Default is true.
*/
export declare function getFloorDisplayFlags(minimapAPI?: boolean): ReadonlyMap>;
/**
* Helper function to get the corresponding golden trinket type from a normal trinket type.
*
* If the provided trinket type is already a golden trinket type, then the trinket type will be
* returned unmodified.
*
* For example, passing `TrinketType.SWALLOWED_PENNY` would result in 32769, which is the value that
* corresponds to the golden trinket sub-type for Swallowed Penny.
*/
export declare function getGoldenTrinketType(trinketType: TrinketType): TrinketType;
/**
* Helper function to get the corresponding "goto" console command that would correspond to the
* provided room type and room variant.
*
* @param roomType The `RoomType` of the destination room.
* @param roomVariant The variant of the destination room.
* @param useSpecialRoomsForRoomTypeDefault Optional. Whether to use `s.default` as the prefix for
* the `goto` command (instead of `d`) if the room type is
* `RoomType.DEFAULT` (1). False by default.
*/
export declare function getGotoCommand(roomType: RoomType, roomVariant: int, useSpecialRoomsForRoomTypeDefault?: boolean): string;
/**
* Helper function to get every grid entity in the current room.
*
* Use this function with no arguments to get every grid entity, or specify a variadic amount of
* arguments to match specific grid entity types.
*
* For example:
*
* ```ts
* for (const gridEntity of getGridEntities()) {
* print(gridEntity.GetType())
* }
* ```
*
* For example:
*
* ```ts
* const rocks = getGridEntities(
* GridEntityType.ROCK,
* GridEntityType.BLOCK,
* GridEntityType.ROCK_TINTED,
* );
* ```
*
* @allowEmptyVariadic
*/
export declare function getGridEntities(...gridEntityTypes: readonly GridEntityType[]): readonly GridEntity[];
/**
* Helper function to get every grid entity in the current room except for certain specific types.
*
* This function is variadic, meaning that you can specify as many grid entity types as you want to
* exclude.
*/
export declare function getGridEntitiesExcept(...gridEntityTypes: readonly GridEntityType[]): readonly GridEntity[];
/** Helper function to get all grid entities in a given radius around a given point. */
export declare function getGridEntitiesInRadius(targetPosition: Vector, radius: number): readonly GridEntity[];
/**
* Helper function to get a map of every grid entity in the current room. The indexes of the map are
* equal to the grid index. The values of the map are equal to the grid entities.
*
* Use this function with no arguments to get every grid entity, or specify a variadic amount of
* arguments to match specific grid entity types.
*
* @allowEmptyVariadic
*/
export declare function getGridEntitiesMap(...gridEntityTypes: readonly GridEntityType[]): ReadonlyMap;
/** Helper function to get the ANM2 path for a grid entity type. */
export declare function getGridEntityANM2Path(gridEntityType: GridEntityType): string | undefined;
/** Helper function to get the top left and bottom right corners of a given grid entity. */
export declare function getGridEntityCollisionPoints(gridEntity: GridEntity): {
topLeft: Vector;
bottomRight: Vector;
};
/** Helper function to get a string containing the grid entity's type and variant. */
export declare function getGridEntityID(gridEntity: GridEntity): GridEntityID;
/**
* Helper function to get a formatted string in the format returned by the `getGridEntityID`
* function.
*/
export declare function getGridEntityIDFromConstituents(gridEntityType: GridEntityType, variant: int): GridEntityID;
/**
* Helper function to get the grid index delta that a door out of the given room shape would lead
* to. For example, if you went through the bottom door in a room of `RoomShape.SHAPE_1x2`, you
* would end up in a room with a grid index that is +26 units from the `SafeGridIndex` of where you
* started.
*/
export declare function getGridIndexDelta(roomShape: RoomShape, doorSlot: DoorSlot): int | undefined;
/**
* Helper function to get all of the grid indexes between two grid indexes on either a horizontal or
* vertical line, inclusive on both ends.
*
* If the first grid index is greater than the second grid index, the two will be swapped.
*
* This function will throw a run-time error if the two provided grid indexes are not on the same
* horizontal or vertical line.
*/
export declare function getGridIndexesBetween(gridIndex1: int, gridIndex2: int, roomShape: RoomShape): readonly 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;
/**
* Returns how many hearts are in the heart UI row. If the player has more than 6 hearts, this
* function will return 6.
*/
export declare function getHeartRowLength(player: EntityPlayer): int;
/**
* Helper function to get all of the heart pickup entities in the room.
*
* @param heartSubType Optional. If specified, will only get the hearts that match the sub-type.
* Default is -1, which matches every sub-type.
*/
export declare function getHearts(heartSubType?: HeartSubType | -1): readonly EntityPickupHeart[];
/**
* Helper function to get the width of the first player's hearts on the UI. This is useful for
* drawing UI elements to the right of where the player's hearts are. Make sure to use this in
* combination with the `getHUDOffsetVector` helper function.
*/
export declare function getHeartsUIWidth(): int;
/**
* Helper function to get the highest value in an array. Returns undefined if there were no elements
* in the array.
*/
export declare function getHighestArrayElement(array: readonly number[]): number | undefined;
/**
* Helper function to get the enum value with the highest value.
*
* Note that this is not necessarily the enum value that is declared last in the code, since there
* is no way to infer that at run-time.
*
* Throws an error if the provided enum is empty.
*/
export declare function getHighestEnumValue(transpiledEnum: T): T[keyof T];
/**
* Helper function to get the corresponding horse pill color from a normal pill color.
*
* For example, passing `PillColor.BLUE_BLUE` would result in 2049, which is the value that
* corresponds to the horse pill color for blue/blue.
*
* If passed a horse pill color, this function will return the unmodified pill color.
*/
export declare function getHorsePillColor(pillColor: PillColor): PillColor;
/** Helper function to get an array with every non-gold horse pill color. */
export declare function getHorsePillColors(): readonly PillColor[];
/**
* In the options menu, players have the ability to set a HUD offset (which gets written to the
* `HudOffset` attribute in the "options.ini" file). This function uses the current HUD offset to
* generate a vector that should be added to the corresponding position that you want to draw a UI
* element at.
*
* For example:
* - If the user does not have a HUD offset configured, this function will return `Vector(0, 0)`.
* - If the user has a HUD offset of 1.0 configured, this function will return `Vector(20, 12)`.
*/
export declare function getHUDOffsetVector(): Readonly;
/**
* Helper function to get the name of a class from the Isaac API. This is contained within the
* "__type" metatable key.
*
* For example, a `Vector` class is has a name of "Vector".
*
* Returns undefined if the object is not of type `userdata` or if the "__type" metatable key does
* not exist.
*
* In some cases, Isaac classes can be a read-only. If this is the case, the "__type" field will be
* prepended with "const ". This function will always strip this prefix, if it exists. For example,
* the class name returned for "const Vector" will be "Vector".
*/
export declare function getIsaacAPIClassName(object: unknown): string | undefined;
/**
* Helper function to get the item config card type of a particular card, rune, or object. For
* example, the item config card type of `CardType.FOOL` is equal to `ItemConfigCardType.TAROT`.
*
* Returns undefined if the provided card type was not valid.
*/
export declare function getItemConfigCardType(cardType: CardType): ItemConfigCardType | undefined;
/**
* Helper function to get the name for an item pool type as it appears in the "itempools.xml" file.
*/
export declare function getItemPoolName(itemPoolType: ItemPoolType): string;
/**
* Helper function to calculate what the resulting `BitFlags` value would be for a
* given JSON room.
*
* (A JSON room is an XML file converted to JSON so that it can be directly imported into your mod.)
*/
export declare function getJSONRoomDoorSlotFlags(jsonRoom: JSONRoom): BitFlags;
/**
* Helper function to find a specific room from an array of JSON rooms.
*
* (A JSON room is an XML file converted to JSON so that it can be directly imported into your mod.)
*
* @param jsonRooms The array of rooms to search through.
* @param variant The room variant to select. (The room variant can be thought of as the ID of the
* room.)
*/
export declare function getJSONRoomOfVariant(jsonRooms: readonly JSONRoom[], variant: int): JSONRoom | undefined;
/**
* Helper function to find all of the JSON rooms that match the sub-type provided.
*
* (A JSON room is an XML file converted to JSON so that it can be directly imported into your mod.)
*
* @param jsonRooms The array of rooms to search through.
* @param subType The sub-type to match.
*/
export declare function getJSONRoomsOfSubType(jsonRooms: readonly JSONRoom[], subType: int): readonly JSONRoom[];
/** Helper function to get the value of a specific but in a binary representation of a number. */
export declare function getKBitOfN(k: int, n: int): int;
/**
* 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 key pickup entities in the room.
*
* @param keySubType Optional. If specified, will only get the keys that match the sub-type. Default
* is -1, which matches every sub-type.
*/
export declare function getKeys(keySubType?: KeySubType | -1): readonly EntityPickupKey[];
/**
* Helper function to get all of the knives in the room.
*
* For example:
*
* ```ts
* // Make all of the knives in the room invisible.
* for (const knife of getKnives()) {
* knife.Visible = false;
* }
* ```
*
* @param knifeVariant Optional. If specified, will only get the knives that match the variant.
* Default is -1, which matches every variant.
* @param subType Optional. If specified, will only get the knives that match the sub-type. Default
* is -1, which matches every sub-type.
*/
export declare function getKnives(knifeVariant?: KnifeVariant | -1, subType?: number): readonly EntityKnife[];
/**
* Helper function to convert the language abbreviation from `Options.Language` to the "full"
* language name.
*
* For example, if the current language is set to Korean, `Options.Language` will be set to "kr",
* and this function will return "Korean".
*/
export declare function getLanguageName(): string;
/**
* Helper function to get all of the lasers in the room.
*
* For example:
*
* ```ts
* // Make all of the lasers in the room invisible.
* for (const laser of getLasers()) {
* laser.Visible = false;
* }
* ```
*
* @param laserVariant Optional. If specified, will only get the lasers that match the variant.
* Default is -1, which matches every variant.
* @param subType Optional. If specified, will only get the lasers that match the sub-type. Default
* is -1, which matches every sub-type.
*/
export declare function getLasers(laserVariant?: LaserVariant | -1, subType?: number): readonly EntityLaser[];
/**
* Helper function that returns the number of the final frame in a particular animation for a
* sprite. By default, it will use the currently playing animation, but you can also specify a
* specific animation to check.
*
* Note that this function is bugged with the Stop Watch or the Broken Watch, since using the
* `Sprite.SetFrame` method will reset the internal accumulator used to slow down the playback speed
* of the animation. (The `PlaybackSpeed` field of the sprite is not used.) Thus, it is only safe to
* use this function on animations that are not slowed down by Stop Watch or Broken Watch, such as
* player animations.
*/
export declare function getLastFrameOfAnimation(sprite: Sprite, animation?: string): int;
/**
* Helper function to get the boss IDs of all of the Boss Rooms on this floor. (This is equivalent
* to the sub-type of the room data.)
*
* Note that this will only look at Boss Rooms inside of the grid, so e.g. Reverse Emperor card
* rooms will not count.
*/
export declare function getLevelBossIDs(): readonly BossID[];
/**
* Helper function to get the English name of the level. For example, "Caves 1".
*
* This is useful because the `Level.GetName` method returns a localized version of the level name,
* which will not display correctly on some fonts.
*
* Note that this returns "Blue Womb" instead of "???" for stage 9.
*
* @param stage Optional. If not specified, the current stage will be used.
* @param stageType Optional. If not specified, the current stage type will be used.
*/
export declare function getLevelName(stage?: LevelStage, stageType?: StageType): string;
/**
* Helper function to get the lowest value in an array. Returns undefined if there were no elements
* in the array.
*/
export declare function getLowestArrayElement(array: readonly number[]): number | undefined;
/**
* Helper function to get the enum value with the lowest value.
*
* Note that this is not necessarily the enum value that is declared first in the code, since there
* is no way to infer that at run-time.
*
* Throws an error if the provided enum is empty.
*/
export declare function getLowestEnumValue(transpiledEnum: T): T[keyof T];
/**
* Helper function to get the "main" version of the character. In other words, this is the character
* that selectable from the main menu (and has achievements related to completing the various bosses
* and so on).
*
* For example, the main character for `PlayerType.MAGDALENE` (1) is also `PlayerType.MAGDALENE`
* (1), but the main character for `PlayerType.LAZARUS_2` (11) would be `PlayerType.LAZARUS` (8).
*
* For `PlayerType.POSSESSOR` (-1) and modded characters, the same character will be returned.
*/
export declare function getMainCharacter(character: PlayerType): PlayerType;
/**
* Helper function to get the closest key from a map based on partial search text. (It only searches
* through the keys, not the values.)
*
* Note that:
* - Spaces are automatically removed from the search text.
* - Both the search text and the strings to search through are converted to lowercase before
* attempting to find a match.
*
* For example:
*
* ```ts
* const map = new Map([
* ["foo", 123],
* ["bar", 456],
* ]);
* const searchText = "f";
* const match = getMapPartialMatch(map, searchText); // match is now equal to ["foo", 123]
* ```
*
* @returns If a match was found, returns a tuple of the map key and value. If a match was not
* found, returns undefined.
*/
export declare function getMapPartialMatch(searchText: string, map: ReadonlyMap): [string, T] | undefined;
/**
* Helper function to get all of the grid entities in the room that specifically match the type and
* variant provided.
*
* If you want to match every variant, use the `getGridEntities` function instead.
*/
export declare function getMatchingGridEntities(gridEntityType: GridEntityType, variant: int): readonly GridEntity[];
/**
* Helper function to get the door that leads to the Mega Satan Boss Room. (In vanilla, the door
* will only appear in the starting room of The Chest / Dark Room.)
*
* Returns undefined if the room has no Mega Satan doors.
*/
export declare function getMegaSatanDoor(): GridEntityDoor | undefined;
/**
* Helper function to get the movement actions that the specified `ControllerIndex` is currently
* pressing down. This returns an array because a player can be holding down more than one movement
* key at a time.
*/
export declare function getMoveButtonActions(controllerIndex: ControllerIndex): readonly ButtonAction[];
/**
* Helper function to get the corresponding music value for a stage and stage type combination.
*
* @param stage Optional. The stage to get the music for. If not specified, the current stage will
* be used.
* @param stageType Optional. The stage type to get the music for. If not specified, the current
* stage type will be used.
*/
export declare function getMusicForStage(stage?: LevelStage, stageType?: StageType): Music;
/**
* Helper function to get the current effect that the Mysterious Paper trinket is providing to the
* player. Returns undefined if the player does not have the Mysterious Paper trinket.
*
* The Mysterious Paper trinket has four different effects:
*
* - The Polaroid (collectible)
* - The Negative (collectible)
* - A Missing Page (trinket)
* - Missing Poster (trinket)
*
* It rotates between these four effects on every frame. Note that Mysterious Paper will cause the
* `EntityPlayer.HasCollectible` and `EntityPlayer.HasTrinket` methods to return true for the
* respective items on the particular frame, with the exception of the Missing Poster. (The player
* will never "have" the Missing Poster, even on the correct corresponding frame.)
*
* @param player The player to look at.
* @param frameCount Optional. The frame count that corresponds to time the effect will be active.
* Default is the current frame.
*/
export declare function getMysteriousPaperEffectForFrame(player: EntityPlayer, frameCount?: int): MysteriousPaperEffect | undefined;
/**
* Helper function to get the first player with the lowest frame count. Useful to find a freshly
* spawned player after using items like Esau Jr. Don't use this function if two or more players
* will be spawned on the same frame.
*/
export declare function getNewestPlayer(): EntityPlayer;
/**
* Helper function to get an array of any added global variables in the Isaac Lua environment.
* Returns a sorted array of key/value tuples.
*/
export declare function getNewGlobals(): ReadonlyArray<[AnyNotNil, unknown]>;
/**
* Helper function to pick a random valid spot on the floor to insert a brand new room. Note that
* some floors will not have any valid spots. If this is the case, this function will return
* undefined.
*
* If you want to get an unseeded room, you must explicitly pass `undefined` to the `seedOrRNG`
* parameter.
*
* @param seedOrRNG The `Seed` or `RNG` object to use. If an `RNG` object is provided, the
* `RNG.Next` method will be called. If `undefined` is provided, it will default to
* a random seed.
* @param ensureDeadEnd Optional. Whether to pick a valid dead end attached to a normal room. If
* false, the function will randomly pick from any valid location that would
* have a red door.
* @returns Either a tuple of adjacent room grid index, `DoorSlot`, and new room grid index, or
* undefined.
*/
export declare function getNewRoomCandidate(seedOrRNG: Seed | RNG | undefined, ensureDeadEnd?: boolean): {
readonly adjacentRoomGridIndex: int;
readonly doorSlot: DoorSlot;
readonly newRoomGridIndex: int;
} | undefined;
/**
* Helper function to iterate through the possible doors for a room and see if any of them would be
* a valid spot to insert a brand new room on the floor.
*
* @param roomGridIndex Optional. Default is the current room index.
* @param ensureDeadEnd Optional. Whether to only include doors that lead to a valid dead end
* attached to a normal room. If false, the function will include all doors
* that would have a red door.
* @returns A array of tuples of `DoorSlot` and room grid index.
*/
export declare function getNewRoomCandidatesBesideRoom(roomGridIndex?: int, ensureDeadEnd?: boolean): ReadonlyArray<{
readonly doorSlot: DoorSlot;
readonly roomGridIndex: int;
}>;
/**
* Helper function to get all of the spots on the floor to insert a brand new room.
*
* @param ensureDeadEnd Optional. Whether to only include spots that are a valid dead end attached
* to a normal room. If false, the function will include all valid spots that
* have a red door.
* @returns A array of tuples containing the adjacent room grid index, the `DoorSlot`, and the new
* room grid index.
*/
export declare function getNewRoomCandidatesForLevel(ensureDeadEnd?: boolean): ReadonlyArray<{
readonly adjacentRoomGridIndex: int;
readonly doorSlot: DoorSlot;
readonly newRoomGridIndex: int;
}>;
/**
* Helper function to get the stage that a trapdoor or heaven door would take the player to, based
* on the current stage, room, and game state flags.
*
* If you want to account for the player having visited Repentance floors in The Ascent, use the
* `getNextStageUsingHistory` helper function instead (from the stage history feature). Handling
* this requires stateful tracking as the player progresses through the run.
*/
export declare function getNextStage(): LevelStage;
/**
* Helper function to get the stage type that a trapdoor or heaven door would take the player to,
* based on the current stage, room, and game state flags.
*
* If you want to account for previous floors visited on The Ascent, use the
* `getNextStageTypeUsingHistory` helper function instead (from the stage history feature). Handling
* this requires stateful tracking as the player progresses through the run.
*
* @param upwards Whether the player should go up to Cathedral in the case of being on Womb 2.
* Default is false.
*/
export declare function getNextStageType(upwards?: boolean): StageType;
/**
* Helper function to get the corresponding normal pill color from a horse pill color.
*
* For example, passing 2049 would result in `PillColor.BLUE_BLUE`.
*
* If called with a non-horse pill color, this function will return back the same color.
*/
export declare function getNormalPillColorFromHorse(pillColor: PillColor): PillColor;
/** Helper function to get an array with every non-gold and non-horse pill color. */
export declare function getNormalPillColors(): readonly PillColor[];
/**
* Helper function to get the corresponding normal trinket type from a golden trinket type.
*
* If the provided trinket type is already a normal trinket type, then the trinket type will be
* returned unmodified.
*/
export declare function getNormalTrinketType(trinketType: TrinketType): TrinketType;
/**
* Helper function to get all of the NPCs in the room.
*
* @param entityType Optional. If specified, will only get the NPCs that match the type. Default is
* -1, which matches every entity type.
* @param variant Optional. If specified, will only get the NPCs that match the variant. Default is
* -1, which matches every entity type.
* @param subType Optional. If specified, will only get the bombs that match the sub-type. Default
* is -1, which matches every sub-type.
* @param ignoreFriendly Optional. If set to true, it will exclude friendly NPCs from being
* returned. Default is false. Will only be taken into account if the
* `entityType` is specified.
*/
export declare function getNPCs(entityType?: EntityType | -1, variant?: number, subType?: number, ignoreFriendly?: boolean): readonly EntityNPC[];
/**
* Helper function to safely get number values from specific keys on a Lua table. If the values are
* strings, they will be converted to numbers. Will throw an error if the specific value does not
* exist on the table or if it cannot be converted to a number.
*
* This function is variadic, meaning that you can specify N arguments to get N values.
*/
export declare function getNumbersFromTable(luaMap: LuaMap, objectName: string, ...keys: readonly string[]): readonly number[];
/** Helper function to get the number of bits in a binary representation of a number. */
export declare function getNumBitsOfN(n: int): int;
/**
* Helper function to get the number of rooms that are currently on the floor layout. This does not
* include off-grid rooms, like the Devil Room.
*/
export declare function getNumRooms(): int;
/**
* Helper function to get the closest key from an object based on partial search text. (It only
* searches through the keys, not the values.)
*
* Note that:
* - Spaces are automatically removed from the search text.
* - Both the search text and the strings to search through are converted to lowercase before
* attempting to find a match.
*
* For example:
*
* ```ts
* const object = {
* foo: 123,
* bar: 456,
* };
* const searchText = "f";
* const match = getObjectPartialMatch(object, searchText); // match is now equal to ["foo", 123]
* ```
*
* @returns If a match was found, returns a tuple of the map key and value. If a match was not
* found, returns undefined.
*/
export declare function getObjectPartialMatch(searchText: string, object: ReadonlyRecord): [string, T] | undefined;
/**
* Returns the slot number corresponding to where a trinket can be safely inserted.
*
* For example:
*
* ```ts
* const player = Isaac.GetPlayer();
* const trinketSlot = getOpenTrinketSlotNum(player);
* if (trinketSlot !== undefined) {
* // They have one or more open trinket slots
* player.AddTrinket(TrinketType.SWALLOWED_PENNY);
* }
* ```
*/
export declare function getOpenTrinketSlot(player: EntityPlayer): int | undefined;
export declare function getOppositeDoorSlot(doorSlot: DoorSlot): DoorSlot | undefined;
/**
* Helper function to get all of the other players in the room besides the one provided. (This
* includes "child" players.)
*/
export declare function getOtherPlayers(player: EntityPlayer): readonly EntityPlayer[];
/**
* Helper function to get the name and the line number of the current calling function.
*
* For this function to work properly, the "--luadebug" flag must be enabled. Otherwise, it will
* always return undefined.
*
* @param levels Optional. The amount of levels to look backwards in the call stack. Default is 3
* (because the first level is this function, the second level is the calling
* function, and the third level is the parent of the calling function).
*/
export declare function getParentFunctionDescription(this: void, levels?: number): string | undefined;
/**
* Helper function to get the closest value from an array of strings based on partial search text.
*
* Note that:
* - Spaces are automatically removed from the search text.
* - Both the search text and the strings to search through are converted to lowercase before
* attempting to find a match.
*
* For example:
*
* ```ts
* const array = ["foo", "bar"];
* const searchText = "f";
* const match = getPartialMatch(array, searchText); // match is now equal to "foo"
* ```
*
* @returns If a match was found, returns the array element. If a match was not found, returns
* undefined.
*/
export declare function getPartialMatch(searchText: string, array: readonly string[]): string | undefined;
/**
* Helper function to get the associated pill effect after PHD is acquired. If a pill effect is not
* altered by PHD, then the same pill effect will be returned.
*/
export declare function getPHDPillEffect(pillEffect: PillEffect): PillEffect;
/**
* Helper function to get all of the pickups in the room.
*
* For example:
*
* ```ts
* // Make all of the pickups in the room invisible.
* for (const pickup of getPickups()) {
* pickup.Visible = false;
* }
* ```
*
* @param pickupVariant Optional. If specified, will only get the pickups that match the variant.
* Default is -1, which matches every entity type.
* @param subType Optional. If specified, will only get the pickups that match the sub-type. Default
* is -1, which matches every sub-type.
*/
export declare function getPickups(pickupVariant?: PickupVariant | -1, subType?: number): readonly EntityPickup[];
/**
* Helper function to get the corresponding pill color from an effect by repeatedly using the
* `ItemPool.GetPillEffect` method.
*
* Note that this will return the corresponding effect even if the passed pill color is not yet
* identified by the player.
*
* Returns `PillColor.NULL` if there is the corresponding pill color cannot be found.
*
* This function is especially useful in the `POST_USE_PILL` callback, since at that point, the used
* pill is already consumed, and the callback only passes the effect. In this specific circumstance,
* consider using the `POST_USE_PILL_FILTER` callback instead of the `POST_USE_PILL` callback, since
* it correctly passes the color and handles the case of horse pills.
*/
export declare function getPillColorFromEffect(pillEffect: PillEffect): PillColor;
/**
* Helper function to get a pill effect class from a PillEffect enum value. In this context, the
* class is equal to the numerical prefix in the "class" tag in the "pocketitems.xml" file. Use the
* `getPillEffectType` helper function to determine whether the pill effect is positive, negative,
* or neutral.
*
* Due to limitations in the API, this function will not work properly for modded pill effects, and
* will always return `DEFAULT_PILL_EFFECT_CLASS` in those cases.
*/
export declare function getPillEffectClass(pillEffect: PillEffect): ItemConfigPillEffectClass;
/**
* Helper function to get a pill effect name from a `PillEffect`. Returns "Unknown" if the provided
* pill effect is not valid.
*
* This function works for both vanilla and modded pill effects.
*
* For example, `getPillEffectName(PillEffect.BAD_GAS)` would return "Bad Gas".
*/
export declare function getPillEffectName(pillEffect: PillEffect): string;
/**
* Helper function to get a pill effect type from a `PillEffect` enum value. In this context, the
* type is equal to positive, negative, or neutral. This is derived from the suffix of the "class"
* tag in the "pocketitems.xml" file. Use the `getPillEffectClass` helper function to determine the
* "power" of the pill.
*
* Due to limitations in the API, this function will not work properly for modded pill effects, and
* will always return `DEFAULT_PILL_EFFECT_TYPE` in those cases.
*/
export declare function getPillEffectType(pillEffect: PillEffect): ItemConfigPillEffectType;
/**
* Helper function to get all of the pill entities in the room.
*
* @param pillColor Optional. If specified, will only get the pills that match the sub-type. Default
* is -1, which matches every sub-type.
*/
export declare function getPills(pillColor?: PillColor | -1): readonly EntityPickupPill[];
/**
* Helper function to get all of the `GridEntityPit` in the room.
*
* @param pitVariant Optional. If specified, will only get the pits that match the variant. Default
* is -1, which matches every variant.
*/
export declare function getPits(pitVariant?: PitVariant | -1): readonly GridEntityPit[];
/**
* Returns the number of slots that the player has remaining for new heart containers, accounting
* for broken hearts. For example, if the player is Judas and has 1 red heart containers and 2 full
* soul hearts and 3 broken hearts, then this function would return 6 (i.e. 12 - 1 - 2 - 3).
*/
export declare function getPlayerAvailableHeartSlots(player: EntityPlayer): int;
/**
* Returns the number of black hearts that the player has, excluding any soul hearts. For example,
* if the player has one full black heart, one full soul heart, and one half black heart, this
* function returns 3.
*
* This is different from the `EntityPlayer.GetBlackHearts` method, since that returns a bitmask.
*/
export declare function getPlayerBlackHearts(player: EntityPlayer): int;
/**
* Iterates over all players and checks if any are close enough to the specified position.
*
* @returns The first player found when iterating upwards from index 0.
*/
export declare function getPlayerCloserThan(position: Vector, distance: float): EntityPlayer | undefined;
/**
* Helper function to return the total amount of collectibles that a player has that match the
* collectible type(s) provided.
*
* This function is variadic, meaning that you can specify N collectible types.
*
* Note that this will filter out non-real collectibles like Lilith's Incubus.
*/
export declare function getPlayerCollectibleCount(player: EntityPlayer, ...collectibleTypes: readonly CollectibleType[]): int;
/** Helper function to get only the familiars that belong to a specific player. */
export declare function getPlayerFamiliars(player: EntityPlayer): readonly EntityFamiliar[];
/**
* Helper function to get the player from a tear, laser, bomb, etc. Returns undefined if the entity
* does not correspond to any particular player.
*
* This function works by looking at the `Parent` and the `SpawnerEntity` fields (in that order). As
* a last resort, it will attempt to use the `Entity.ToPlayer` method on the entity itself.
*/
export declare function getPlayerFromEntity(entity: Entity): EntityPlayer | undefined;
/**
* Helper function to get the corresponding `EntityPlayer` object that corresponds to a
* `PlayerIndex`.
*/
export declare function getPlayerFromIndex(playerIndex: PlayerIndex): EntityPlayer | undefined;
/**
* Helper function to get an `EntityPlayer` object from an `EntityPtr`. Returns undefined if the
* entity has gone out of scope or if the associated entity is not a player.
*/
export declare function getPlayerFromPtr(entityPtr: EntityPtr): EntityPlayer | undefined;
/**
* Helper function to get an object representing the player's health. You can use this in
* combination with the `setPlayerHealth` function to restore the player's health back to a certain
* configuration at a later time.
*
* This is based on the `REVEL.StoreHealth` function in the Revelations mod.
*/
export declare function getPlayerHealth(player: EntityPlayer): Readonly;
export declare function getPlayerHealthType(player: EntityPlayer, healthType: HealthType): int;
/**
* Returns the number of red hearts that the player has, excluding any rotten hearts. For example,
* if the player has one full black heart, one full soul heart, and one half black heart, this
* function returns 3.
*
* This is different from the `EntityPlayer.GetHearts` method, since that returns a value that
* includes rotten hearts.
*/
export declare function getPlayerHearts(player: EntityPlayer): int;
/**
* Mods often have to track variables relating to the player. In naive mods, information will only
* be stored about the first player. However, in order to be robust, mods must handle up to 4
* players playing at the same time. This means that information must be stored on a map data
* structure. Finding a good index for these types of map data structures is difficult:
*
* - We cannot use the index from `Isaac.GetPlayer(i)` since this fails in the case where there are
* two players and the first player leaves the run.
* - We cannot use `EntityPlayer.ControllerIndex` as an index because it fails in the case of Jacob
* & Esau or Tainted Forgotten. It also fails in the case of a player changing their controls
* mid-run.
* - We cannot use `EntityPlayer.GetData().index` because it does not persist across saving and
* continuing.
* - We cannot use `GetPtrHash()` as an index because it does not persist across exiting and
* relaunching the game.
* - We cannot use `EntityPlayer.InitSeed` because it is not consistent with additional players
* beyond the first.
*
* Instead, we use the `EntityPlayer.GetCollectibleRNG` method with an arbitrary value of Sad Onion
* (1). This works even if the player does not have any Sad Onions.
*
* Note that by default, this returns the same index for both The Forgotten and The Soul. (Even
* though they are technically different characters, they share the same inventory and `InitSeed`.)
* If this is not desired, pass true for the `differentiateForgottenAndSoul` argument, and the RNG
* of Spoon Bender (3) will be used for The Soul.
*
* Also note that this index does not work in the `POST_PLAYER_INIT` function for players 2 through
* 4. With that said, in almost all cases, you should be lazy-initializing your data structures in
* other callbacks, so this should not be an issue.
*/
export declare function getPlayerIndex(player: EntityPlayer, differentiateForgottenAndSoul?: boolean): PlayerIndex;
/**
* Helper function to return the index of this player with respect to the output of the
* `Isaac.GetPlayer` method.
*
* Note that if you storing information about a player in a data structure, you never want to use
* this index; use the `getPlayerIndex` function instead.
*/
export declare function getPlayerIndexVanilla(playerToFind: EntityPlayer): int | undefined;
/**
* Helper function that returns the type of the rightmost heart. This does not including golden
* hearts or broken hearts, since they cannot be damaged directly.
*/
export declare function getPlayerLastHeart(player: EntityPlayer): HealthType;
/**
* Returns the maximum heart containers that the provided player can have. Normally, this is 12, but
* it can change depending on the character (e.g. Keeper) and other things (e.g. Mother's Kiss).
* This function does not account for Broken Hearts; use the `getPlayerAvailableHeartSlots` helper
* function for that.
*/
export declare function getPlayerMaxHeartContainers(player: EntityPlayer): int;
/**
* Helper function to get the proper name of the player. Use this instead of the
* `EntityPlayer.GetName` method because it accounts for Blue Baby, Lazarus II, and Tainted
* characters.
*/
export declare function getPlayerName(player: EntityPlayer): string;
/**
* Returns the combined value of all of the player's red hearts, soul/black hearts, and bone hearts,
* minus the value of the player's rotten hearts.
*
* This is equivalent to the number of hits that the player can currently take, but does not take
* into account double damage from champion enemies and/or being on later floors. (For example, on
* Womb 1, players who have 1 soul heart remaining would die in 1 hit to anything, even though this
* function would report that they have 2 hits remaining.)
*/
export declare function getPlayerNumHitsRemaining(player: EntityPlayer): int;
/**
* This function always excludes players with a non-undefined parent, since they are not real
* players (e.g. the Strawman Keeper).
*
* If this is not desired, use the `getAllPlayers` helper function instead.
*
* @param performCharacterExclusions Whether to exclude characters that are not directly controlled
* by the player (i.e. Esau & Tainted Soul). Default is false.
*/
export declare function getPlayers(performCharacterExclusions?: boolean): readonly EntityPlayer[];
/**
* Helper function to get all of the players that are a certain character.
*
* This function is variadic, meaning that you can supply as many characters as you want to check
* for. Returns true if any of the characters supplied are present.
*/
export declare function getPlayersOfType(...characters: readonly PlayerType[]): readonly EntityPlayer[];
/**
* Helper function to get all of the players that are using keyboard (i.e.
* `ControllerIndex.KEYBOARD`). This function returns an array of players because it is possible
* that there is more than one player with the same controller index (e.g. Jacob & Esau).
*
* Note that this function includes players with a non-undefined parent like e.g. the Strawman
* Keeper.
*/
export declare function getPlayersOnKeyboard(): readonly EntityPlayer[];
/**
* Returns the number of soul hearts that the player has, excluding any black hearts. For example,
* if the player has one full black heart, one full soul heart, and one half black heart, this
* function returns 2.
*
* This is different from the `EntityPlayer.GetSoulHearts` method, since that returns the combined
* number of soul hearts and black hearts.
*/
export declare function getPlayerSoulHearts(player: EntityPlayer): int;
/** Helper function to get the stat for a player corresponding to the `StatType`. */
export declare function getPlayerStat(player: EntityPlayer, playerStat: T): PlayerStats[T];
/** Helper function to get all of the stat for a player. */
export declare function getPlayerStats(player: EntityPlayer): PlayerStats;
/**
* Helper function to get only the players that have a certain collectible.
*
* This function is variadic, meaning that you can supply as many collectible types as you want to
* check for. It only returns the players that have all of the collectibles.
*/
export declare function getPlayersWithCollectible(...collectibleTypes: readonly CollectibleType[]): readonly EntityPlayer[];
/**
* Helper function to get all of the players that match the provided controller index. This function
* returns an array of players because it is possible that there is more than one player with the
* same controller index (e.g. Jacob & Esau).
*
* Note that this function includes players with a non-undefined parent like e.g. the Strawman
* Keeper.
*/
export declare function getPlayersWithControllerIndex(controllerIndex: ControllerIndex): readonly EntityPlayer[];
/**
* Helper function to get only the players that have a certain trinket.
*
* This function is variadic, meaning that you can supply as many trinket types as you want to check
* for. It only returns the players that have all of the trinkets.
*/
export declare function getPlayersWithTrinket(...trinketTypes: readonly TrinketType[]): readonly EntityPlayer[];
/** Returns a set of the player's current transformations. */
export declare function getPlayerTransformations(player: EntityPlayer): ReadonlySet;
/**
* Helper function to get all of the trinkets that the player is currently holding. This will not
* include any smelted trinkets.
*/
export declare function getPlayerTrinkets(player: EntityPlayer): readonly TrinketType[];
/**
* 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[];
/**
* Helper function to get all of the `GridEntityPoop` in the room.
*
* @param poopVariant Optional. If specified, will only get the poops that match the variant.
* Default is -1, which matches every variant.
*/
export declare function getPoops(poopVariant?: PoopGridEntityVariant | -1): readonly GridEntityPoop[];
/**
* Helper function to get all of the `GridEntityPressurePlate` in the room.
*
* @param pressurePlateVariant Optional. If specified, will only get the pressure plates that match
* the variant. Default is -1, which matches every variant.
*/
export declare function getPressurePlates(pressurePlateVariant?: PressurePlateVariant | -1): readonly GridEntityPressurePlate[];
/**
* Helper function to get all of the projectiles in the room.
*
* For example:
*
* ```ts
* // Make all of the projectiles in the room invisible.
* for (const projectile of getProjectiles()) {
* projectile.Visible = false;
* }
* ```
*
* @param projectileVariant Optional. If specified, will only get the projectiles that match the
* variant. Default is -1, which matches every entity type.
* @param subType Optional. If specified, will only get the projectiles that match the sub-type.
* Default is -1, which matches every sub-type.
*/
export declare function getProjectiles(projectileVariant?: ProjectileVariant | -1, subType?: number): readonly EntityProjectile[];
/**
* Returns a random float between 0 and 1. It is inclusive on the low end, but exclusive on the high
* end. (This is because the `RNG.RandomFloat` method will never return a value of exactly 1.)
*
* If you want to generate an unseeded number, you must explicitly pass `undefined` to the
* `seedOrRNG` parameter.
*
* @param seedOrRNG The `Seed` or `RNG` object to use. If an `RNG` object is provided, the
* `RNG.Next` method will be called. If `undefined` is provided, it will default to
* a random seed.
*/
export declare function getRandom(seedOrRNG: Seed | RNG | undefined): float;
/**
* Helper function to get a random element from the provided array.
*
* If you want to get an unseeded element, you must explicitly pass `undefined` to the `seedOrRNG`
* parameter.
*
* @param array The array to get an element from.
* @param seedOrRNG The `Seed` or `RNG` object to use. If an `RNG` object is provided, the
* `RNG.Next` method will be called. If `undefined` is provided, it will default to
* a random seed.
* @param exceptions Optional. An array of elements to skip over if selected.
*/
export declare function getRandomArrayElement(array: readonly T[], seedOrRNG: Seed | RNG | undefined, exceptions?: readonly T[]): T;
/**
* Helper function to get a random element from the provided array. Once the random element is
* decided, it is then removed from the array (in-place).
*
* If you want to get an unseeded element, you must explicitly pass `undefined` to the `seedOrRNG`
* parameter.
*
* @param array The array to get an element from.
* @param seedOrRNG The `Seed` or `RNG` object to use. If an `RNG` object is provided, the
* `RNG.Next` method will be called. If `undefined` is provided, it will default to
* a random seed.
* @param exceptions Optional. An array of elements to skip over if selected.
*/
export declare function getRandomArrayElementAndRemove(array: T[], seedOrRNG: Seed | RNG | undefined, exceptions?: readonly T[]): T;
/**
* Helper function to get a random index from the provided array.
*
* If you want to get an unseeded index, you must explicitly pass `undefined` to the `seedOrRNG`
* parameter.
*
* @param array The array to get the index from.
* @param seedOrRNG The `Seed` or `RNG` object to use. If an `RNG` object is provided, the
* `RNG.Next` method will be called. If `undefined` is provided, it will default to
* a random seed.
* @param exceptions Optional. An array of indexes that will be skipped over when getting the random
* index. Default is an empty array.
*/
export declare function getRandomArrayIndex(array: readonly unknown[], seedOrRNG: Seed | RNG | undefined, exceptions?: readonly int[]): int;
/**
* Helper function to get a random `Color` object.
*
* If you want to generate an unseeded object, you must explicitly pass `undefined` to the
* `seedOrRNG` parameter.
*
* @param seedOrRNG The `Seed` or `RNG` object to use. If an `RNG` object is provided, the
* `RNG.Next` method will be called. If `undefined` is provided, it will default to
* a random seed.
* @param alpha Optional. The alpha value to use. Default is 1.
*/
export declare function getRandomColor(seedOrRNG: Seed | RNG | undefined, alpha?: number): Readonly;
/**
* Helper function to get a random value from the provided enum.
*
* If you want an unseeded value, you must explicitly pass `undefined` to the `seedOrRNG` parameter.
*
* @param transpiledEnum The enum to get the value from.
* @param seedOrRNG The `Seed` or `RNG` object to use. If an `RNG` object is provided, the
* `RNG.Next` method will be called. If `undefined` is provided, it will default to
* a random seed.
* @param exceptions Optional. An array of elements to skip over if selected.
*/
export declare function getRandomEnumValue(transpiledEnum: T, seedOrRNG: Seed | RNG | undefined, exceptions?: ReadonlyArray): T[keyof T];
/**
* Returns a random float between min and max.
*
* For example:
*
* ```ts
* const realNumberBetweenOneAndThree = getRandomFloat(1, 3, undefined);
* ```
*
* If you want to generate an unseeded number, you must explicitly pass `undefined` to the
* `seedOrRNG` parameter.
*
* @param min The lower bound for the random number (inclusive).
* @param max The upper bound for the random number (exclusive).
* @param seedOrRNG The `Seed` or `RNG` object to use. If an `RNG` object is provided, the
* `RNG.Next` method will be called. If `undefined` is provided, it will default to
* a random seed.
*/
export declare function getRandomFloat(min: int, max: int, seedOrRNG: Seed | RNG | undefined): float;
/**
* Get a random value from a `WeightedArray`. (A `WeightedArray` is an array of tuples, where the
* first element in the tuple is a value, and the second element in the tuple is a float
* corresponding to the value's weight.)
*
* If you want to get an unseeded element, you must explicitly pass `undefined` to the `seedOrRNG`
* parameter.
*
* @param weightedArray The array to pick from.
* @param seedOrRNG The `Seed` or `RNG` object to use. If an `RNG` object is provided, the
* `RNG.Next` method will be called. If `undefined` is provided, it will default to
* a random seed.
*/
export declare function getRandomFromWeightedArray(weightedArray: Readonly>, seedOrRNG: Seed | RNG | undefined): T;
/**
* Get a random index from a `WeightedArray`. (A `WeightedArray` is an array of tuples, where the
* first element in the tuple is a value, and the second element in the tuple is a float
* corresponding to the value's weight.)
*
* If you want to get an unseeded index, you must explicitly pass `undefined` to the `seedOrRNG`
* parameter.
*
* @param weightedArray The array to pick from.
* @param seedOrRNG The `Seed` or `RNG` object to use. If an `RNG` object is provided, the
* `RNG.Next` method will be called. If `undefined` is provided, it will default to
* a random seed.
*/
export declare function getRandomIndexFromWeightedArray(weightedArray: Readonly>, seedOrRNG: Seed | RNG | undefined): int;
/**
* Returns a random integer between min and max. It is inclusive on both ends.
*
* For example:
*
* ```ts
* const oneTwoOrThree = getRandomInt(1, 3);
* ```
*
* If you want to generate an unseeded number, you must explicitly pass `undefined` to the
* `seedOrRNG` parameter.
*
* @param min The lower bound for the random number (inclusive).
* @param max The upper bound for the random number (inclusive).
* @param seedOrRNG The `Seed` or `RNG` object to use. If an `RNG` object is provided, the
* `RNG.Next` method will be called. If `undefined` is provided, it will default to
* a random seed.
* @param exceptions Optional. An array of elements that will be skipped over when getting the
* random integer. For example, a min of 1, a max of 4, and an exceptions array of
* `[2]` would cause the function to return either 1, 3, or 4. Default is an empty
* array.
*/
export declare function getRandomInt(min: int, max: int, seedOrRNG: Seed | RNG | undefined, exceptions?: readonly int[]): int;
/**
* Helper function to get a random item pool. This is not as simple as getting a random value from
* the `ItemPoolType` enum, since `ItemPoolType.SHELL_GAME` (7) is not a real item pool and the
* Greed Mode item pools should be excluded if not playing in Greed Mode.
*
* If you want to get an unseeded item pool, you must explicitly pass `undefined` to the `seedOrRNG`
* parameter.
*
* @param seedOrRNG The `Seed` or `RNG` object to use. If an `RNG` object is provided, the
* `RNG.Next` method will be called. If `undefined` is provided, it will default to
* a random seed.
*/
export declare function getRandomItemPool(seedOrRNG: Seed | RNG | undefined): ItemPoolType;
/**
* Helper function to get a random JSON entity from an array of JSON entities.
*
* (A JSON entity is an entity inside of a JSON room. A JSON room is an XML file converted to JSON
* so that it can be directly imported into your mod.)
*
* Note that this function does not simply choose a random element in the provided array; it will
* properly account for each room weight using the algorithm from:
* https://stackoverflow.com/questions/1761626/weighted-random-numbers
*
* If you want an unseeded entity, you must explicitly pass `undefined` to the `seedOrRNG`
* parameter.
*
* @param jsonEntities The array of entities to randomly choose between.
* @param seedOrRNG The `Seed` or `RNG` object to use. If an `RNG` object is provided, the
* `RNG.Next` method will be called. If `undefined` is provided, it will default to
* a random seed.
* @param verbose Optional. If specified, will write entries to the "log.txt" file that describe
* what the function is doing. Default is false.
*/
export declare function getRandomJSONEntity(jsonEntities: readonly JSONEntity[], seedOrRNG: Seed | RNG | undefined, verbose?: boolean): JSONEntity;
/**
* Helper function to get a random JSON room from an array of JSON rooms.
*
* (A JSON room is an XML file converted to JSON so that it can be directly imported into your mod.)
*
* Note that this function does not simply choose a random element in the provided array; it will
* properly account for each room weight using the algorithm from:
* https://stackoverflow.com/questions/1761626/weighted-random-numbers
*
* If you want an unseeded room, you must explicitly pass `undefined` to the `seedOrRNG` parameter.
*
* @param jsonRooms The array of rooms to randomly choose between.
* @param seedOrRNG The `Seed` or `RNG` object to use. If an `RNG` object is provided, the
* `RNG.Next` method will be called. If `undefined` is provided, it will default to
* a random seed.
* @param verbose Optional. If specified, will write entries to the "log.txt" file that describe
* what the function is doing. Default is false.
*/
export declare function getRandomJSONRoom(jsonRooms: readonly JSONRoom[], seedOrRNG: Seed | RNG | undefined, verbose?: boolean): JSONRoom;
/**
* Helper function to get a random `KColor` object (for use in fonts).
*
* If you want to generate an unseeded object, you must explicitly pass `undefined` to the
* `seedOrRNG` parameter.
*
* @param seedOrRNG The `Seed` or `RNG` object to use. If an `RNG` object is provided, the
* `RNG.Next` method will be called. If `undefined` is provided, it will default to
* a random seed.
* @param alpha Optional. The alpha value to use. Default is 1.
*/
export declare function getRandomKColor(seedOrRNG: Seed | RNG | undefined, alpha?: number): Readonly;
/**
* Helper function to get a random `Seed` value to be used in spawning entities and so on. Use this
* instead of calling the `Random` function directly since that can return a value of 0 and crash
* the game.
*/
export declare function getRandomSeed(): Seed;
/**
* Helper function to get a random element from the provided set.
*
* If you want to get an unseeded element, you must explicitly pass `undefined` to the `seedOrRNG`
* parameter.
*
* @param set The set to get an element from.
* @param seedOrRNG The `Seed` or `RNG` object to use. If an `RNG` object is provided, the
* `RNG.Next` method will be called. If `undefined` is provided, it will default to
* a random seed.
* @param exceptions Optional. An array of elements to skip over if selected.
*/
export declare function getRandomSetElement(set: ReadonlySet, seedOrRNG: Seed | RNG | undefined, exceptions?: readonly T[]): T;
/**
* Helper function to get a random vector between (-1, -1) and (1, 1).
*
* To get random vectors with a bigger length, multiply this with a number.
*
* Use this over the `RandomVector` function when you need the vector to be seeded.
*
* If you want to generate an unseeded vector, you must explicitly pass `undefined` to the
* `seedOrRNG` parameter.
*
* @param seedOrRNG The `Seed` or `RNG` object to use. If an `RNG` object is provided, the
* `RNG.Next` method will be called. If `undefined` is provided, it will default to
* a random seed.
*/
export declare function getRandomVector(seedOrRNG: Seed | RNG | undefined): Readonly;
/**
* Helper function to get a read-only copy of the room descriptor for every room on the level. This
* includes off-grid rooms, such as the Devil Room, and extra-dimensional rooms, if they are
* generated and exist.
*
* Room descriptors without any data are assumed to be non-existent and are not included.
*
* Under the hood, this is performed by iterating over the `RoomList` from the `Level.GetRooms`
* method. This is the best way to see if off-grid rooms have been initialized, since it is possible
* for mods to insert room data at non-official negative room grid indexes.
*/
export declare function getReadOnlyRooms(): ReadonlyArray>;
/** 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 door that leads to the "secret exit" off-grid room that takes you to
* the Repentance floor or to the version of Depths 2 that has Dad's Key.
*
* Returns undefined if the room has no Repentance doors.
*/
export declare function getRepentanceDoor(): GridEntityDoor | undefined;
/**
* Helper function to get a copy of a map with the keys and the values reversed.
*
* For example:
*
* ```ts
* new Map([
* ["foo", 1],
* ["bar", 2],
* ]);
* ```
*
* Would be reversed to:
*
* ```ts
* new Map([
* [1, "foo"],
* [2, "bar"],
* ]);
* ```
*/
export declare function getReversedMap(map: ReadonlyMap): ReadonlyMap;
/**
* Helper function to get the alternate rock type (i.e. urn, mushroom, etc.) that the current room
* will have.
*
* The rock type is based on the backdrop of the room.
*
* For example, if you change the backdrop of the starting room of the run to `BackdropType.CAVES`,
* and then spawn `GridEntityType.ROCK_ALT`, it will be a mushroom instead of an urn. Additionally,
* if it is destroyed, it will generate mushroom-appropriate rewards.
*
* On the other hand, if an urn is spawned first before the backdrop is changed to
* `BackdropType.CAVES`, the graphic of the urn will not switch to a mushroom. However, when
* destroyed, the urn will still generate mushroom-appropriate rewards.
*/
export declare function getRockAltType(): RockAltType;
/**
* Helper function to get the PNG path for a rock. This depends on the current room's backdrop. The
* values are taken from the "backdrops.xml" file.
*
* All of the rock PNGs are in the "gfx/grid" directory.
*/
export declare function getRockPNGPath(): string;
/**
* Helper function to get all of the `GridEntityRock` in the room.
*
* @param variant Optional. If specified, will only get the rocks that match the variant. Default is
* -1, which matches every variant. Note that this is not the same thing as the
* `RockVariant` enum, since that only applies to `GridEntityType.ROCK`, and other
* types of grid entities can be the `GridEntityRock` class.
*/
export declare function getRocks(variant?: number): readonly GridEntityRock[];
/**
* Helper function to get the grid indexes of all the rooms connected to the given room index,
* taking the shape of the room into account. (This will only include rooms with valid data.)
*
* Returns an empty map if the provided room grid index is out of bounds or has no associated room
* data.
*
* @param roomGridIndex Optional. Default is the current room index.
* @returns A map of `DoorSlot` to the corresponding room grid index.
*/
export declare function getRoomAdjacentGridIndexes(roomGridIndex?: int): ReadonlyMap;
/**
* Helper function to get the set of allowed door slots for the room at the supplied grid index.
* This corresponds to the doors that are enabled in the STB/XML file for the room.
*/
export declare function getRoomAllowedDoors(roomGridIndex?: int): ReadonlySet;
/**
* Helper function to get the room data for the current room.
*
* You can optionally provide a room grid index as an argument to get the data for that room
* instead.
*
* (The version of the function without any arguments will not return undefined since the current
* room is guaranteed to have data.)
*/
export declare function getRoomData(): RoomConfig;
/**
* Helper function to get the room data for the current or provided room.
*
* @param roomGridIndex Optional. Default is the current room index.
* @returns The room data for the room or undefined if the provided room does not have any data.
*/
export declare function getRoomData(roomGridIndex?: int): RoomConfig | undefined;
/**
* Helper function to get the room data for a specific room type and variant combination. This is
* accomplished by using the "goto" console command to load the specified room into the
* `GridRoom.DEBUG` slot.
*
* Returns undefined if the provided room type and variant combination were not found. (A warning
* message will also appear on the console, since the "goto" command will fail.)
*
* Note that the side effect of using the "goto" console command is that it will trigger a room
* transition after a short delay. By default, this function cancels the incoming room transition by
* using the `Game.StartRoomTransition` method to travel to the same room.
*
* @param roomType The type of room to retrieve.
* @param roomVariant The room variant to retrieve. (The room variant is the "ID" of the room in
* Basement Renovator.)
* @param cancelRoomTransition Optional. Whether to cancel the room transition by using the
* `Game.StartRoomTransition` method to travel to the same room. Default
* is true. Set this to false if you are getting the data for many rooms
* at the same time, and then use the `teleport` helper function when
* you are finished.
* @param useSpecialRoomsForRoomTypeDefault Optional. Whether to use `s.default` as the prefix for
* the `goto` command (instead of `d`) if the room type is
* `RoomType.DEFAULT` (1). False by default.
*/
export declare function getRoomDataForTypeVariant(roomType: RoomType, roomVariant: int, cancelRoomTransition?: boolean, useSpecialRoomsForRoomTypeDefault?: boolean): Readonly | undefined;
/**
* Helper function to get the descriptor for a room.
*
* @param roomGridIndex Optional. Default is the current room index.
*/
export declare function getRoomDescriptor(roomGridIndex?: int): RoomDescriptor;
/**
* Alias for the `Level.GetCurrentRoomDesc` method. Use this to make it more clear what type of
* `RoomDescriptor` object that you are retrieving.
*/
export declare function getRoomDescriptorReadOnly(): Readonly;
/**
* Helper function to get an array of all of the room descriptors for rooms that match the specified
* room type.
*
* This function only searches through rooms in the current dimension and rooms inside the grid.
*
* This function is variadic, meaning that you can specify N arguments to get the combined room
* descriptors for N room types.
*/
export declare function getRoomDescriptorsForType(...roomTypes: readonly RoomType[]): readonly RoomDescriptor[];
/**
* Helper function to get a particular room's minimap display flags (e.g. whether it is visible and
* so on).
*
* This function automatically accounts for if MinimapAPI is being used.
*
* @param roomGridIndex Optional. Default is the current room index.
* @param minimapAPI Optional. If MinimapAPI should be used, if present. Default is true.
*/
export declare function getRoomDisplayFlags(roomGridIndex?: int, minimapAPI?: boolean): BitFlags;
/**
* Helper function to get the grid index of the current room.
*
* - If the current room is inside of the grid, this function will return the `SafeGridIndex` from
* the room descriptor. (The safe grid index is defined as the top-left 1x1 section that the room
* overlaps with, or the top-right 1x1 section of a `RoomType.SHAPE_LTL` room.)
* - If the current room is outside of the grid, it will return the index from the
* `Level.GetCurrentRoomIndex` method, since `SafeGridIndex` is bugged for these cases, as
* demonstrated by entering a Genesis room and entering `l
* print(Game():GetLevel():GetCurrentRoomDesc().SafeGridIndex)` into the console. (It prints -1
* instead of -12.)
*
* Use this function instead of the `Level.GetCurrentRoomIndex` method directly because the latter
* will return the specific 1x1 quadrant that the player entered the room at. For most situations,
* using the safe grid index is more reliable than this.
*
* Data structures that store data per room should use the room's `ListIndex` instead of
* `SafeGridIndex`, since the former is unique across different dimensions.
*/
export declare function getRoomGridIndex(): int;
/**
* Helper function to get an array of all of the safe grid indexes for rooms that match the
* specified room type.
*
* This function only searches through rooms in the current dimension.
*
* This function is variadic, meaning that you can specify N arguments to get the combined grid
* indexes for N room types.
*/
export declare function getRoomGridIndexesForType(...roomTypes: readonly RoomType[]): readonly int[];
/**
* Helper function to get the item pool type for the current room. For example, this returns
* `ItemPoolType.ItemPoolType.POOL_ANGEL` if you are in an Angel Room.
*
* This function is a wrapper around the `ItemPool.GetPoolForRoom` method.
*
* Note that `ItemPool.GetPoolForRoom` will return -1 in `RoomType.DEFAULT` (1) rooms, but this
* function will convert -1 to `ItemPoolType.TREASURE` (0) for convenience purposes (since the game
* is "supposed" to use the Treasure Room pool for collectibles spawned in normal rooms). If you
* need to distinguish between real Treasure Rooms and default rooms, then use the
* `ItemPool.GetPoolForRoom` method directly.
*/
export declare function getRoomItemPoolType(): ItemPoolType;
/**
* Helper function to get the list grid index of the provided room, which is equal to the index in
* the `RoomList.Get` method. In other words, this is equal to the order that the room was created
* by the floor generation algorithm.
*
* Use this as an index for data structures that store data per room, since it is unique across
* different dimensions.
*
* @param roomGridIndex Optional. Default is the current room index.
*/
export declare function getRoomListIndex(roomGridIndex?: int): int;
/**
* Helper function to get the name of the current room as it appears in the STB/XML data.
*
* You can optionally provide a room grid index as an argument to get the name for that room
* instead.
*
* (The version of the function without any arguments will not return undefined since the current
* room is guaranteed to have data.)
*
* If you want to get the room name for a specific room type, use the `getRoomTypeName` function.
*/
export declare function getRoomName(): string;
/**
* Helper function to get the name of the room as it appears in the STB/XML data.
*
* If you want to get the room name for a specific room type, use the `getRoomTypeName` function.
*
* @param roomGridIndex Optional. Default is the current room index.
* @returns The room name. Returns undefined if the room data was not found.
*/
export declare function getRoomName(roomGridIndex?: int): string | undefined;
/**
* Helper function to get the room descriptor for every room on the level. This includes off-grid
* rooms, such as the Devil Room.
*
* Room without any data are assumed to be non-existent and are not included.
*
* - If you want just the rooms inside of the grid, use the `getRoomsInsideGrid` helper function.
* - If you want just the rooms outside of the grid, use the `getRoomsOutsideGrid` helper function.
*
* @param includeExtraDimensionalRooms Optional. On some floors (e.g. Downpour 2, Mines 2),
* extra-dimensional rooms are automatically generated. Default is
* false.
*/
export declare function getRooms(includeExtraDimensionalRooms?: boolean): readonly RoomDescriptor[];
/**
* Helper function to get the shape of the current room as it appears in the STB/XML data.
*
* You can optionally provide a room grid index as an argument to get the shape for that room
* instead.
*
* (The version of the function without any arguments will not return undefined since the current
* room is guaranteed to have data.)
*/
export declare function getRoomShape(): RoomShape;
/**
* Helper function to get the shape of the room as it appears in the STB/XML data.
*
* @param roomGridIndex Optional. Default is the current room index.
* @returns The room shape. Returns undefined if the room data was not found.
*/
export declare function getRoomShape(roomGridIndex?: int): RoomShape | undefined;
/**
* Helper function to get only the adjacent room grid indexes for a room shape that exist (i.e. have
* room data).
*
* This is just a filtering of the results of the `getRoomShapeAdjacentGridIndexes` function. See
* that function for more information.
*/
export declare function getRoomShapeAdjacentExistingGridIndexes(safeRoomGridIndex: int, roomShape: RoomShape): ReadonlyMap;
/**
* Helper function to get the room grid index delta that each hypothetical door in a given room
* shape would go to.
*
* This is used by the `getRoomShapeAdjacentGridIndexes` function.
*
* @returns A map of `DoorSlot` to the corresponding room grid index delta.
*/
export declare function getRoomShapeAdjacentGridIndexDeltas(roomShape: RoomShape): ReadonlyMap;
/**
* Helper function to get the room grid index that each hypothetical door in a given room shape
* would go to. (This will not include room grid indexes that are outside of the grid.)
*
* @param safeRoomGridIndex This must be the room safe grid index (i.e. the top-left room grid index
* for the respective room).
* @param roomShape The shape of the hypothetical room.
* @returns A map of `DoorSlot` to the corresponding room grid index.
*/
export declare function getRoomShapeAdjacentGridIndexes(safeRoomGridIndex: int, roomShape: RoomShape): ReadonlyMap;
/**
* Helper function to get only the adjacent room grid indexes for a room shape that do not exist
* (i.e. do not have room data).
*
* This is just a filtering of the results of the `getRoomShapeAdjacentGridIndexes` function. See
* that function for more information.
*/
export declare function getRoomShapeAdjacentNonExistingGridIndexes(safeRoomGridIndex: int, roomShape: RoomShape): ReadonlyMap;
/**
* Helper function to see if a given room shape will grant a single charge or a double charge to the
* player's active item(s).
*
* For example, `RoomShape.SHAPE_2x2` will return 2.
*/
export declare function getRoomShapeBottomRightPosition(roomShape: RoomShape): Readonly;
/**
* Helper function to get the grid position of the bottom-right tile of a given room shape.
*
* "Vector(0, 0)" corresponds to the top left tile of a room, not including the walls. (The top-left
* wall would be at "Vector(-1, -1)".)
*/
export declare function getRoomShapeBounds(roomShape: RoomShape): readonly [width: int, height: int];
/**
* Helper function to get the number of charges that a given room shape will grant to a player upon
* clearing it.
*
* For example, `RoomShape.SHAPE_2x2` will return 2.
*/
export declare function getRoomShapeCharges(roomShape: RoomShape): int;
/**
* Helper function to get the corners that exist in the given room shape.
*
* Note that these corner locations are not accurate for the Mother Boss Room and the Home closet
* rooms. (Those rooms have custom shapes.)
*/
export declare function getRoomShapeCorners(roomShape: RoomShape): readonly Corner[];
/**
* Helper function to get the corresponding door slot for a given room shape and grid coordinates.
*/
export declare function getRoomShapeDoorSlot(roomShape: RoomShape, x: int, y: int): DoorSlot | undefined;
/**
* Helper function to get the room grid coordinates for a specific room shape and door slot
* combination.
*/
export declare function getRoomShapeDoorSlotCoordinates(roomShape: RoomShape, doorSlot: DoorSlot): readonly [x: int, y: int] | undefined;
/**
* Helper function to get the dimensions of a room shape's layout. This is NOT the size of the
* room's actual contents! For that, use the `getRoomShapeBounds` function.
*
* For example, a horizontal narrow room has a layout size of equal to that of a 1x1 room.
*/
export declare function getRoomShapeLayoutSize(roomShape: RoomShape): readonly [width: int, height: int];
/**
* Helper function to get the grid position of the top-left tile of a given room shape.
*
* "Vector(0, 0)" corresponds to the top left tile of a room, not including the walls. (The top-left
* wall would be at "Vector(-1, -1)".)
*/
export declare function getRoomShapeTopLeftPosition(roomShape: RoomShape): Readonly;
/**
* Helper function to get the volume of a room shape, which is the amount of tiles that are inside
* the room.
*
* (This cannot be directly calculated from the bounds since L rooms are a special case.)
*/
export declare function getRoomShapeVolume(roomShape: RoomShape): int;
export declare function getRoomShapeWidth(roomShape: RoomShape): int;
/**
* Helper function to get the room descriptor for every room on the level that is on the grid. (For
* example, Devil Rooms are excluded.)
*
* Room descriptors without any data are assumed to be non-existent and are not included.
*
* @param includeExtraDimensionalRooms Optional. On some floors (e.g. Downpour 2, Mines 2),
* extra-dimensional rooms will be generated. Default is false.
*/
export declare function getRoomsInsideGrid(includeExtraDimensionalRooms?: boolean): readonly RoomDescriptor[];
/**
* Helper function to get the room descriptor for every room on the level in a specific dimension.
* This will not include any off-grid rooms, such as the Devil Room.
*
* Room descriptors without any data are assumed to be non-existent and are not included.
*/
export declare function getRoomsOfDimension(dimension: Dimension): readonly RoomDescriptor[];
/**
* Helper function to get the room descriptor for every room on the level that is outside of the
* grid (like a Devil Room).
*
* Room descriptors without any data are assumed to be non-existent and are not included.
*/
export declare function getRoomsOutsideGrid(): readonly RoomDescriptor[];
/**
* Helper function to get the stage ID for the current room as it appears in the STB/XML data.
*
* The room stage ID will correspond to the first number in the filename of the XML/STB file. For
* example, a Depths room would have a stage ID of `StageID.DEPTHS` (7).
*
* You can optionally provide a room grid index as an argument to get the stage ID for that room
* instead.
*
* (The version of the function without any arguments will not return undefined since the current
* room is guaranteed to have data.)
*/
export declare function getRoomStageID(): StageID;
/**
* Helper function to get the stage ID for a room as it appears in the STB/XML data.
*
* The room stage ID will correspond to the first number in the filename of the XML/STB file. For
* example, a Depths room would have a stage ID of `StageID.DEPTHS` (7).
*
* @param roomGridIndex Optional. Default is the current room index.
* @returns The room stage ID. Returns undefined if the room data was not found.
*/
export declare function getRoomStageID(roomGridIndex?: int): StageID | undefined;
/**
* Helper function to get the sub-type for the current room as it appears in the STB/XML data.
*
* The room sub-type will correspond to different things depending on what XML/STB file it draws
* from. For example, in the "00.special rooms.stb" file, an Angel Room with a sub-type of 0 will
* correspond to a normal Angel Room and a sub-type of 1 will correspond to an Angel Room shop from
* The Stairway.
*
* You can optionally provide a room grid index as an argument to get the sub-type for that room
* instead.
*
* (The version of the function without any arguments will not return undefined since the current
* room is guaranteed to have data.)
*/
export declare function getRoomSubType(): int;
/**
* Helper function to get the sub-type for a room as it appears in the STB/XML data.
*
* The room sub-type will correspond to different things depending on what XML/STB file it draws
* from. For example, in the "00.special rooms.stb" file, an Angel Room with a sub-type of 0 will
* correspond to a normal Angel Room and a sub-type of 1 will correspond to an Angel Room shop from
* The Stairway.
*
* @param roomGridIndex Optional. Default is the current room index.
* @returns The room sub-type. Returns undefined if the room data was not found.
*/
export declare function getRoomSubType(roomGridIndex?: int): int | undefined;
/**
* Helper function to get the type for the current room as it appears in the STB/XML data.
*
* You can optionally provide a room grid index as an argument to get the type for that room
* instead.
*
* (The version of the function without any arguments will not return undefined since the current
* room is guaranteed to have data.)
*/
export declare function getRoomType(): RoomType;
/**
* Helper function to get the type for a room as it appears in the STB/XML data.
*
* @param roomGridIndex Optional. Default is the current room index.
* @returns The room type. Returns undefined if the room data was not found.
*/
export declare function getRoomType(roomGridIndex?: int): RoomType | undefined;
/**
* Helper function to get the proper name of a room type.
*
* For example, `RoomType.TREASURE` will return "Treasure Room".
*/
export declare function getRoomTypeName(roomType: RoomType): string;
/**
* Helper function to get the variant for the current room as it appears in the STB/XML data.
*
* You can think of a room variant as its identifier. For example, to go to Basement room #123, you
* would use a console command of `goto d.123` while on the Basement.
*
* You can optionally provide a room grid index as an argument to get the variant for that room
* instead.
*
* (The version of the function without any arguments will not return undefined since the current
* room is guaranteed to have data.)
*/
export declare function getRoomVariant(): int;
/**
* Helper function to get the variant for a room as it appears in the STB/XML data.
*
* You can think of a room variant as its identifier. For example, to go to Basement room #123, you
* would use a console command of `goto d.123` while on the Basement.
*
* @param roomGridIndex Optional. Default is the current room index.
* @returns The room variant. Returns undefined if the room data was not found.
*/
export declare function getRoomVariant(roomGridIndex?: int): int | undefined;
/**
* Note that the room visited count will be inaccurate during the period before the `POST_NEW_ROOM`
* callback has fired (i.e. when entities are initializing and performing their first update). This
* is because the variable is only incremented immediately before the `POST_NEW_ROOM` callback
* fires.
*
* @param roomGridIndex Optional. Default is the current room index.
*/
export declare function getRoomVisitedCount(roomGridIndex?: int): int;
/**
* 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 get all of the sack (i.e. grab bag) entities in the room.
*
* @param sackSubType Optional. If specified, will only get the sacks that match the sub-type.
* Default is -1, which matches every sub-type.
*/
export declare function getSacks(sackSubType?: SackSubType | -1): readonly EntityPickupSack[];
export declare function getScreenBottomCenterPos(): Readonly;
export declare function getScreenBottomLeftPos(): Readonly;
export declare function getScreenBottomRightPos(): Readonly;
export declare function getScreenBottomY(): float;
export declare function getScreenCenterPos(): Readonly;
export declare function getScreenRightX(): float;
export declare function getScreenTopCenterPos(): Readonly;
export declare function getScreenTopLeftPos(): Readonly;
export declare function getScreenTopRightPos(): Readonly;
/**
* Helper function to get the seed effects (i.e. Easter Eggs) that are enabled for the current run.
*/
export declare function getSeedEffects(): readonly SeedEffect[];
/**
* Helper function to get all possible combinations of the given set. This includes the combination
* of an empty set.
*
* For example, if this function is provided a set containing 1, 2, and 3, then it will return an
* array containing the following sets:
*
* - [] (if `includeEmptyArray` is set to true)
* - [1]
* - [2]
* - [3]
* - [1, 2]
* - [1, 3]
* - [2, 3]
* - [1, 2, 3]
*
* @param set The set to get the combinations of.
* @param includeEmptyArray Whether to include an empty array in the combinations.
*/
export declare function getSetCombinations(set: ReadonlySet, includeEmptyArray: boolean): ReadonlyArray>;
/**
* Helper function to get the shooting actions that the specified `ControllerIndex` is currently
* pressing down. This returns an array because a player can be holding down more than one shooting
* key at a time.
*/
export declare function getShootButtonActions(controllerIndex: ControllerIndex): readonly ButtonAction[];
/**
* Helper function to get the corresponding "Siren Helper" entity for a stolen familiar.
*
* When The Siren boss "steals" your familiars, a hidden "Siren Helper" entity is spawned to control
* each familiar stolen. (Checking for the presence of this entity seems to be the only way to
* detect when the Siren steals a familiar.)
*
* @param familiar The familiar to be checked.
* @returns Returns the hidden "Siren Helper" entity corresponding to the given familiar, if it
* exists. Returns undefined otherwise.
*/
export declare function getSirenHelper(familiar: EntityFamiliar): Entity | undefined;
/**
* Helper function to get the name of a slot, as listed in the "entities2.xml" file. Returns
* "Unknown" if the provided slot variant is not valid.
*
* This function only works for vanilla slot variants.
*
* For example, `getSlotName(SlotVariant.BLOOD_DONATION_MACHINE)` would return "Blood Donation
* Machine".
*/
export declare function getSlotName(slotVariant: SlotVariant): string;
/**
* Helper function to get all of the slots in the room.
*
* For example:
*
* ```ts
* // Make all of the slots in the room invisible.
* for (const slot of getSlots()) {
* slot.Visible = false;
* }
* ```
*
* @param slotVariant Optional. If specified, will only get the slots that match the variant.
* Default is -1, which matches every entity type.
* @param subType Optional. If specified, will only get the slots that match the sub-type. Default
* is -1, which matches every sub-type.
*/
export declare function getSlots(slotVariant?: SlotVariant | -1, subType?: number): readonly EntitySlot[];
/**
* Helper function to get a sorted array based on the contents of a set.
*
* Normally, set values are returned in insertion order, so use this function when the ordering of
* the contents is important.
*/
export declare function getSortedSetValues(set: ReadonlySet): T[];
/** Helper function to get all of the `GridEntitySpikes` in the room. */
export declare function getSpikes(variant?: number): readonly GridEntitySpikes[];
/** Alias for the `Level.GetStage` method. */
export declare function getStage(): LevelStage;
/**
* Helper function to get the stage ID that corresponds to a particular stage and stage type.
*
* This is useful because `getRoomStageID` will not correctly return the `StageID` if the player is
* in a special room.
*
* This correctly handles the case of Greed Mode. In Greed Mode, if an undefined stage and stage
* type combination are passed, `StageID.SPECIAL_ROOMS` (0) will be returned.
*
* @param stage Optional. If not specified, the stage corresponding to the current floor will be
* used.
* @param stageType Optional. If not specified, the stage type corresponding to the current floor
* will be used.
*/
export declare function getStageID(stage?: LevelStage, stageType?: StageType): StageID;
/**
* Helper function to get the English name corresponding to a stage ID. For example, "Caves".
*
* This is derived from the data in the "stages.xml" file.
*
* Note that unlike "stages.xml", Blue Womb is specified with a name of "Blue Womb" instead of
* "???".
*/
export declare function getStageIDName(stageID: StageID): string;
/** Alias for the `Level.GetStageType` method. */
export declare function getStageType(): StageType;
/**
* Helper function to convert a numerical `StageType` into the letter suffix supplied to the "stage"
* console command. For example, `StageType.REPENTANCE` is the stage type for Downpour, and the
* console command to go to Downpour is "stage 1c", so this function converts `StageType.REPENTANCE`
* to "c".
*/
export declare function getStageTypeSuffix(stageType: StageType): string;
/** Alias for the `Seeds.GetStartSeedString` method. */
export declare function getStartSeedString(): string;
/**
* Helper function to safely get string values from a Lua table. Will throw an error if the specific
* value does not exist on the table.
*
* This function is variadic, meaning that you can specify N arguments to get N values.
*/
export declare function getStringsFromTable(luaMap: LuaMap, objectName: string, ...keys: readonly string[]): readonly string[];
/**
* Helper function to get a parent `EntityPlayer` object for a given `EntitySubPlayer` object. This
* is useful because calling the `EntityPlayer.GetSubPlayer` method on a sub-player object will
* return undefined.
*/
export declare function getSubPlayerParent(subPlayer: EntitySubPlayer): EntityPlayer | undefined;
/**
* Helper function to get the grid entities on the surrounding tiles from the provided grid entity.
*
* For example, if a rock was surrounded by rocks on all sides, this would return an array of 8
* rocks (e.g. top-left + top + top-right + left + right + bottom-left + bottom + right).
*/
export declare function getSurroundingGridEntities(gridEntity: GridEntity): readonly GridEntity[];
/**
* Helper function to get the grid indexes on the surrounding tiles from the provided grid index.
*
* There are always 8 grid indexes returned (e.g. top-left + top + top-right + left + right +
* bottom-left + bottom + right), even if the computed values would be negative or otherwise
* invalid.
*/
export declare function getSurroundingGridIndexes(gridIndex: int): [
topLeft: int,
top: int,
topRight: int,
left: int,
right: int,
bottomLeft: int,
bottom: int,
bottomRight: int
];
/**
* Helper function to determine how many heart containers that Tainted Magdalene has that will not
* be automatically depleted over time. By default, this is 2, but this function will return 4 so
* that it is consistent with the `player.GetHearts` and `player.GetMaxHearts` methods.
*
* If Tainted Magdalene has Birthright, she will gained an additional non-temporary heart container.
*
* This function does not validate whether the provided player is Tainted Magdalene; that should be
* accomplished before invoking this function.
*/
export declare function getTaintedMagdaleneNonTemporaryMaxHearts(player: EntityPlayer): int;
/**
* Helper function to get all of the tears in the room.
*
* For example:
*
* ```ts
* // Make all of the tears in the room invisible.
* for (const tear of getTears()) {
* tear.Visible = false;
* }
* ```
*
* @param tearVariant Optional. If specified, will only get the tears that match the variant.
* Default is -1, which matches every entity type.
* @param subType Optional. If specified, will only get the tears that match the sub-type. Default
* is -1, which matches every sub-type.
*/
export declare function getTears(tearVariant?: TearVariant | -1, subType?: number): readonly EntityTear[];
/**
* - The `EntityPlayer` object stores a player's tear rate in the `MaxFireDelay` field. This is
* equivalent to how many tears the player can shoot per frame.
* - If you want to convert this to the "tears" stat that is shown on the in-game stat UI, then use
* this function.
*/
export declare function getTearsStat(fireDelay: float): float;
/**
* Helper function to get all of the grid entities of type `GridEntityType.TELEPORTER` (23) in the
* room.
*
* @param variant Optional. If specified, will only get the teleporters that match the variant.
* Default is -1, which matches every variant.
*/
export declare function getTeleporters(variant?: number): readonly GridEntity[];
/**
* Helper function to get the current time for benchmarking / profiling purposes.
*
* The return value will either be in seconds or milliseconds, depending on if the "--luadebug" flag
* is turned on.
*
* If the "--luadebug" flag is present, then this function will use the `socket.gettime` method,
* which returns the epoch timestamp in seconds (e.g. "1640320492.5779"). This is preferable over
* the more conventional `Isaac.GetTime` method, since it has one extra decimal point of precision.
*
* If the "--luadebug" flag is not present, then this function will use the `Isaac.GetTime` method,
* which returns the number of milliseconds since the computer's operating system was started (e.g.
* "739454963").
*
* @param useSocketIfAvailable Optional. Whether to use the `socket.gettime` method, if available.
* Default is true. If set to false, the `Isaac.GetTime()` method will
* always be used.
*/
export declare function getTime(useSocketIfAvailable?: boolean): int | float;
/** Helper function to get all of the `GridEntityTNT` in the room. */
export declare function getTNT(variant?: number): readonly GridEntityTNT[];
/**
* Helper function to get the top left wall in the current room.
*
* This function can be useful in certain situations to determine if the room is currently loaded.
*/
export declare function getTopLeftWall(): GridEntity | undefined;
/**
* Helper function to get the grid index of the top left wall. (This will depend on what the current
* room shape is.)
*
* This function can be useful in certain situations to determine if the room is currently loaded.
*/
export declare function getTopLeftWallGridIndex(): int;
/**
* Helper function to get the combined normal charge and the battery charge for the player's active
* item. This is useful because you have to add these two values together when setting the active
* charge.
*
* @param player The player to get the charges from.
* @param activeSlot Optional. The slot to get the charges from. Default is `ActiveSlot.PRIMARY`.
*/
export declare function getTotalCharge(player: EntityPlayer, activeSlot?: ActiveSlot): int;
/**
* Returns the total number of collectibles amongst all players. For example, if player 1 has 1 Sad
* Onion and player 2 has 2 Sad Onions, then this function would return 3.
*
* Note that this will filter out non-real collectibles like Lilith's Incubus.
*/
export declare function getTotalPlayerCollectibles(collectibleType: CollectibleType): int;
/**
* Helper function to get a stack trace.
*
* This will only work if the `--luadebug` launch option is enabled. If it isn't, then a error
* string will be returned.
*/
export declare function getTraceback(this: void): string;
/**
* Helper function to get a transformation name from a PlayerForm enum.
*
* For example:
*
* ```ts
* const transformationName = getTransformationName(PlayerForm.LORD_OF_THE_FLIES);
* // transformationName is "Beelzebub"
* ```
*/
export declare function getTransformationName(playerForm: PlayerForm): string;
/**
* Returns a set containing all of the transformations that the given collectible types contribute
* towards.
*/
export declare function getTransformationsForCollectibleType(collectibleType: CollectibleType): ReadonlySet;
/**
* Helper function to get all of the grid entities of type `GridEntityType.TRAPDOOR` (17) in the
* room. Specify a specific trapdoor variant to select only trapdoors of that variant.
*
* @param trapdoorVariant Optional. If specified, will only get the trapdoors that match the
* variant. Default is -1, which matches every variant.
*/
export declare function getTrapdoors(trapdoorVariant?: TrapdoorVariant | -1): readonly GridEntity[];
/**
* Helper function to log what is happening in functions that recursively move through nested data
* structures.
*/
export declare function getTraversalDescription(key: unknown, traversalDescription: string): string;
/**
* Helper function to get the in-game description for a trinket. Returns "Unknown" if the provided
* trinket type was not valid.
*
* This function works for both vanilla and modded trinkets.
*/
export declare function getTrinketDescription(trinketType: TrinketType): string;
/**
* Helper function to get the path to a trinket PNG file. Returns the path to the question mark
* sprite (i.e. from Curse of the Blind) if the provided trinket type was not valid.
*
* Note that this does not return the file name, but the full path to the trinket's PNG file. The
* function is named "GfxFilename" to correspond to the associated `ItemConfigItem.GfxFileName`
* field.
*/
export declare function getTrinketGfxFilename(trinketType: TrinketType): string;
/**
* Helper function to get the name of a trinket. Returns "Unknown" if the provided trinket type is
* not valid.
*
* This function works for both vanilla and modded trinkets.
*
* For example, `getTrinketName(TrinketType.SWALLOWED_PENNY)` would return "Swallowed Penny".
*/
export declare function getTrinketName(trinketType: TrinketType): string;
/**
* Helper function to get all of the trinket entities in the room.
*
* @param trinketType Optional. If specified, will only get the trinkets that match the sub-type.
* Default is -1, which matches every sub-type.
*/
export declare function getTrinkets(trinketType?: TrinketType | -1): readonly EntityPickupTrinket[];
/**
* Helper function to get the constructor from an instantiated TypeScriptToLua class, which is
* located on the metatable.
*
* Returns undefined if passed a non-table or if the provided table does not have a metatable.
*/
export declare function getTSTLClassConstructor(object: unknown): TSTLClassMetatable["constructor"] | undefined;
/**
* Helper function to get the name of a TypeScriptToLua class from the instantiated class object.
*
* TSTL classes are Lua tables created with the `__TS__Class` Lua function from the TSTL lualib.
* Their name is contained within "constructor.name" metatable key.
*
* For example, a `Map` class is has a name of "Map".
*
* Returns undefined if passed a non-table or if the provided table does not have a metatable.
*/
export declare function getTSTLClassName(object: unknown): string | undefined;
/**
* Helper function to find unused door slots in the current room that can be used to make custom
* doors.
*/
export declare function getUnusedDoorSlots(): readonly DoorSlot[];
/**
* Helper function to find the active slots that the player has the corresponding collectible type
* in and have enough charge to be used. Returns an empty array if the player does not have the
* collectible in any active slot or does not have enough charges.
*/
export declare function getUsableActiveItemSlots(player: EntityPlayer, collectibleType: CollectibleType): readonly ActiveSlot[];
/**
* Returns an array containing every vanilla collectible type with the given quality.
*
* Note that this function will only return vanilla collectible types. To handle modded collectible
* types, use the `getCollectibleTypesOfQuality` helper function instead.
*/
export declare function getVanillaCollectibleTypesOfQuality(quality: Quality): readonly CollectibleType[];
export declare function getVanillaPillEffectsOfType(pillEffectType: ItemConfigPillEffectType): readonly PillEffect[];
/**
* Helper function to get the set of grid indexes that represent where the walls are supposed to be
* in a given room shape.
*
* This function only works reliably in vanilla rooms because in a modded room, it is possible to
* place walls in a non-standard location.
*/
export declare function getVanillaWallGridIndexSetForRoomShape(roomShape: RoomShape): ReadonlySet;
/**
* Get how many hearts are currently being shown on the hearts UI.
*
* This function is originally from piber20 Helper.
*/
export declare function getVisibleHearts(player: EntityPlayer): int;
/**
* Helper function to get the door that leads to the off-grid room that contains the portal to The
* Void. (In vanilla, the door will only appear in the Hush Boss Room.)
*
* Returns undefined if the room has no Void doors.
*/
export declare function getVoidDoor(): GridEntityDoor | undefined;
/**
* Helper function to restore the player's trinkets back to the way they were before the
* `temporarilyRemoveTrinket` function was used. It will re-smelt any smelted trinkets that were
* removed.
*/
export declare function giveTrinketsBack(player: EntityPlayer, trinketSituation: TrinketSituation | undefined): void;
export declare const GRID_INDEX_CENTER_OF_1X1_ROOM = 67;
/**
* Helper function to convert grid coordinates to a world position `Vector`.
*
* For example, the coordinates of (0, 0) are equal to `Vector(80, 160)`.
*/
export declare function gridCoordinatesToWorldPosition(x: int, y: int): Readonly;
declare class GridEntityCollisionDetection extends Feature {
v: {
room: {
/** Indexed by grid entity pointer hash. */
collidingEntitiesMap: DefaultMap, []>;
};
};
private readonly postGridEntityCollision;
private readonly postGridEntityCustomCollision;
private readonly customGridEntities;
constructor(postGridEntityCollision: PostGridEntityCollision, postGridEntityCustomCollision: PostGridEntityCustomCollision, customGridEntities: CustomGridEntities);
private readonly postUpdate;
}
/**
* This is meta-data that describes a custom grid entity.
*
* (One of the extra features that the standard library offers is the ability to spawn custom grid
* entities with the `spawnCustomGridEntity` helper function.)
*/
export declare interface GridEntityCustomData {
/**
* This is not a real `GridEntityType`; rather it is an arbitrary integer selected by end-user
* mods.
*/
gridEntityTypeCustom: GridEntityType;
roomListIndex: int;
gridIndex: int;
gridCollisionClass?: GridCollisionClass;
anm2Path?: string;
defaultAnimation?: string;
}
/**
* A string that represents a grid entity. This is the entity type and variant separated by a
* period.
*
* This type is branded for extra type safety.
*/
export declare type GridEntityID = string & {
readonly __gridEntityIDBrand: symbol;
};
declare class GridEntityRenderDetection extends Feature {
private readonly postGridEntityRender;
private readonly postGridEntityCustomRender;
private readonly customGridEntities;
constructor(postGridEntityRender: PostGridEntityRender, postGridEntityCustomRender: PostGridEntityCustomRender, customGridEntities: CustomGridEntities);
private readonly postRender;
}
declare type GridEntityTuple = [
gridEntityType: GridEntityType,
variant: int,
state: int
];
declare class GridEntityUpdateDetection extends Feature {
v: {
room: {
/** Indexed by grid index. */
initializedGridEntities: Map;
};
};
private readonly postGridEntityInit;
private readonly postGridEntityCustomInit;
private readonly postGridEntityUpdate;
private readonly postGridEntityCustomUpdate;
private readonly postGridEntityRemove;
private readonly postGridEntityCustomRemove;
private readonly postGridEntityStateChanged;
private readonly postGridEntityCustomStateChanged;
private readonly postGridEntityBroken;
private readonly postGridEntityCustomBroken;
private readonly customGridEntities;
constructor(postGridEntityInit: PostGridEntityInit, postGridEntityCustomInit: PostGridEntityCustomInit, postGridEntityUpdate: PostGridEntityUpdate, postGridEntityCustomUpdate: PostGridEntityCustomUpdate, postGridEntityRemove: PostGridEntityRemove, postGridEntityCustomRemove: PostGridEntityCustomRemove, postGridEntityStateChanged: PostGridEntityStateChanged, postGridEntityCustomStateChanged: PostGridEntityCustomStateChanged, postGridEntityBroken: PostGridEntityBroken, postGridEntityCustomBroken: PostGridEntityCustomBroken, customGridEntities: CustomGridEntities);
private readonly postUpdate;
private checkGridEntitiesRemoved;
private checkGridEntityStateChanged;
private checkNewGridEntity;
private updateTupleInMap;
private readonly postNewRoomReordered;
}
/**
* Helper function to convert a grid index to a grid position.
*
* For example, in a 1x1 room, grid index 0 is equal to "Vector(-1, -1) and grid index 16 is equal
* to "Vector(0, 0)".
*/
export declare function gridIndexToGridPosition(gridIndex: int, roomShape: RoomShape): Readonly;
/**
* Helper function to convert a grid position `Vector` to a world position `Vector`.
*
* For example, the coordinates of (0, 0) are equal to `Vector(80, 160)`.
*/
export declare function gridPositionToWorldPosition(gridPosition: Vector): Readonly;
/** Helper function to check to see if the player is holding one or more trinkets. */
export declare function hasAnyTrinket(player: EntityPlayer): boolean;
/**
* Helper function to see if a particular entity has armor. In this context, armor refers to the
* damage scaling mechanic. For example, Ultra Greed has armor, but a Gaper does not.
*
* For more on armor, see the wiki: https://bindingofisaacrebirth.fandom.com/wiki/Damage_Scaling
*/
export declare function hasArmor(entity: Entity): boolean;
/**
* Helper function to check if a player is holding a specific card in one of their pocket item
* slots.
*
* This function is variadic, meaning that you can pass as many cards as you want to check for. The
* function will return true if the player has any of the cards.
*/
export declare function hasCard(player: EntityPlayer, ...cardTypes: readonly CardType[]): boolean;
/**
* Helper function to check to see if a player has one or more collectibles.
*
* This function is variadic, meaning that you can supply as many collectible types as you want to
* check for. Returns true if the player has any of the supplied collectible types.
*
* This function always passes `false` to the `ignoreModifiers` argument.
*/
export declare function hasCollectible(player: EntityPlayer, ...collectibleTypes: readonly CollectibleType[]): boolean;
/**
* Helper function to check to see if a player has a specific collectible in one or more active
* slots.
*
* This function is variadic, meaning that you can specify as many active slots as you want to check
* for. This function will return true if the collectible type is located in any of the active slots
* provided.
*/
export declare function hasCollectibleInActiveSlot(player: EntityPlayer, collectibleType: CollectibleType, ...activeSlots: readonly ActiveSlot[]): boolean;
/**
* Helper function to check if the current floor has a particular curse.
*
* This function is variadic, meaning that you can specify as many curses as you want. The function
* will return true if the level has one or more of the curses.
*
* Under the hood, this function uses the `Level.GetCurses` method.
*/
export declare function hasCurse(...curses: readonly LevelCurse[]): boolean;
/**
* Helper function to check if the current room has one or more doors that lead to the given room
* type.
*
* This function is variadic, meaning that you can supply as many door types as you want to check
* for. This function will return true if one or more room types match.
*/
export declare function hasDoorType(...roomTypes: readonly RoomType[]): boolean;
/**
* Helper function to determine if a particular bit flag is set to true.
*
* This is a variadic function, so pass as many flags as you want to check for. If passed multiple
* flags, it will only return true if all of the flags are set.
*
* For example:
*
* ```ts
* const player = Isaac.GetPlayer();
* if (hasFlag(player.TearFlags, TearFlags.TEAR_SPECTRAL) {
* // The player currently has spectral tears
* }
* ```
*
* @param flags The existing set of bit flags.
* @param flagsToCheck One or more bit flags to check for, each as a separate argument.
*/
export declare function hasFlag(flags: T | BitFlags, ...flagsToCheck: readonly T[]): boolean;
export declare function hasFlyingTransformation(player: EntityPlayer): boolean;
/**
* Helper function to check to see if a player has one or more transformations.
*
* This function is variadic, meaning that you can supply as many transformations as you want to
* check for. Returns true if the player has any of the supplied transformations.
*/
export declare function hasForm(player: EntityPlayer, ...playerForms: readonly PlayerForm[]): boolean;
/** Helper type to check if an object or class has one or more functions/methods. */
export declare type HasFunction = Record extends {
[K in keyof T as T[K] extends Function ? K : never]-?: 1;
} ? never : T;
/**
* Helper function to check if a player has homing tears.
*
* Under the hood, this checks the `EntityPlayer.TearFlags` variable for `TearFlag.HOMING` (1 << 2).
*/
export declare function hasHoming(player: EntityPlayer): boolean;
/** After touching a white fire, a player will turn into The Lost until they clear a room. */
export declare function hasLostCurse(player: EntityPlayer): boolean;
/**
* Returns whether the player can hold an additional active item, beyond what they are currently
* carrying. This takes the Schoolbag into account.
*
* 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 hasOpenActiveItemSlot(player: EntityPlayer): boolean;
/**
* 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;
/**
* Returns whether the player can hold an additional trinket, beyond what they are currently
* carrying. This takes into account items that modify the max number of trinkets, like Mom's Purse.
*
* 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 hasOpenTrinketSlot(player: EntityPlayer): boolean;
/**
* Helper function to check if a player has piercing tears.
*
* Under the hood, this checks the `EntityPlayer.TearFlags` variable for `TearFlag.PIERCING` (1 <<
* 1).
*/
export declare function hasPiercing(player: EntityPlayer): boolean;
/**
* Helper function to check if a player has spectral tears.
*
* Under the hood, this checks the `EntityPlayer.TearFlags` variable for `TearFlag.SPECTRAL` (1 <<
* 0).
*/
export declare function hasSpectral(player: EntityPlayer): boolean;
/**
* Helper function to check to see if a player has one or more trinkets.
*
* This function is variadic, meaning that you can supply as many trinket types as you want to check
* for. Returns true if the player has any of the supplied trinket types.
*
* This function always passes `false` to the `ignoreModifiers` argument.
*/
export declare function hasTrinket(player: EntityPlayer, ...trinketTypes: readonly TrinketType[]): boolean;
/**
* Helper function to check if the current room has one or more open door slots that can be used to
* make custom doors.
*/
export declare function hasUnusedDoorSlot(): boolean;
/**
* This represents the type of health that is either given or taken away from a player. Note that we
* cannot use the `HeartSubType` enum for this purpose this since it has no value for broken hearts
* or max hearts.
*/
export declare enum HealthType {
RED = 0,// 5.10.1
SOUL = 1,// 5.10.3
ETERNAL = 2,// 5.10.4
BLACK = 3,// 5.10.6
GOLDEN = 4,// 5.10.7
BONE = 5,// 5.10.11
ROTTEN = 6,// 5.10.12
BROKEN = 7,
MAX_HEARTS = 8
}
/**
* Converts a hex string like "#33aa33" to a KColor object.
*
* @param hexString A hex string like "#ffffff" or "ffffff". (The "#" character is optional.)
* @param alpha Optional. Range is from 0 to 1. Default is 1. (The same as the `Color` constructor.)
*/
export declare function hexToColor(hexString: string, alpha?: number): Readonly;
/**
* Converts a hex string like "#33aa33" to a Color object.
*
* @param hexString A hex string like "#ffffff" or "ffffff". (The "#" character is optional.)
* @param alpha Range is from 0 to 1. Default is 1.
*/
export declare function hexToKColor(hexString: string, alpha?: number): Readonly;
/**
* Helper function to hide a specific room on the minimap.
*
* If you want the room to be permanently hidden, you must to call this function on every new room.
* This is because if the player enters into the room or walks into an adjacent room, the room will
* reappear on the minimap.
*
* This function automatically accounts for if MinimapAPI is being used.
*/
export declare function hideRoomOnMinimap(roomGridIndex: int): void;
/**
* Helper type to make the given array/map/set/object recursively read-only.
*
* You can use this type to easily build safe data structures.
*
* From: https://stackoverflow.com/questions/41879327/deepreadonly-object-typescript
*/
export declare type Immutable = T extends ImmutablePrimitive ? T : T extends Array ? ImmutableArray : T extends Map ? ImmutableMap : T extends Set ? ImmutableSet : ImmutableObject;
declare type ImmutableArray = ReadonlyArray>;
declare type ImmutableMap = ReadonlyMap, Immutable>;
declare type ImmutableObject = {
readonly [K in keyof T]: Immutable