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; }; declare type ImmutablePrimitive = undefined | null | boolean | string | number | Function; declare type ImmutableSet = ReadonlySet>; /** * Helper function to determine if the current room shape is equal to `RoomShape.1x2` or * `RoomShape.2x1`. */ export declare function in2x1Room(): boolean; /** * Helper function to check to see if the current room is an angel shop. * * Under the hood, this checks the room type being equal to `RoomType.ANGEL` (15) and the sub-type * being equal to `AngelRoomSubType.SHOP` (1). */ export declare function inAngelShop(): boolean; /** * Helper function to check to see if the current room is the Boss Room for The Beast. * * This function is useful because the `Room.GetBossID` method returns 0 for The Beast room. * * Under the hood, this checks the room type being equal to `RoomType.DUNGEON` (16) and the sub-type * being equal to `DungeonSubType.BEAST_ROOM` (4). */ export declare function inBeastRoom(): boolean; /** * Helper function to detect if the current room is big. Specifically, this is all 1x2 rooms, 2x2 * rooms, and L rooms. */ export declare function inBigRoom(): boolean; /** * Helper function to check if the current room is the Boss Room for a particular boss. This will * only work for bosses that have dedicated boss rooms in the "00.special rooms.stb" file. */ export declare function inBossRoomOf(bossID: BossID): boolean; /** * Similar to the `Array.includes` method, but works on a widened version of the array. * * This is useful when the normal `Array.includes` produces a type error from an array that uses an * `as const` assertion. */ export declare function includes>(array: readonly TupleElement[], searchElement: WidenLiteral): searchElement is TupleElement; /** * Helper function for determining whether the current room is a crawl space. Use this function over * comparing to `RoomType.DUNGEON` or `GridRoom.DUNGEON_IDX` since there is a special case of the * player being in a boss fight that takes place in a dungeon. */ export declare function inCrawlSpace(): boolean; /** * Helper function for checking whether the current room is a crawl space with a door corresponding * to `DoorSlotFlag.RIGHT_0` (1 << 2). */ export declare function inCrawlSpaceWithBlackMarketEntrance(): boolean; /** * Helper type to add one to a number type. * * From: https://stackoverflow.com/questions/54243431/typescript-increment-number-type */ export declare type Increment = [...Arr_2, unknown]["length"] & number; /** * Helper function to detect if the current room is one of the rooms in the Death Certificate area. */ export declare function inDeathCertificateArea(): boolean; /** * Helper function to detect if the current room is a Treasure Room created when entering with a * Devil's Crown trinket. * * Under the hood, this checks for `RoomDescriptorFlag.DEVIL_TREASURE`. */ export declare function inDevilsCrownTreasureRoom(): boolean; export declare function inDimension(dimension: Dimension): boolean; /** * Helper function to check to see if the current room is the Boss Room for Dogma. * * This function is useful because the `Room.GetBossID` method returns 0 for the Dogma room. * * Note that the "living room" on the Home floor with the TV at the top of the room is not the Dogma * Boss Room, as the player is teleported to a different room after watching the TV cutscene. * * Under the hood, this checks the stage ID being equal to `StageID.HOME` (35) and the room type * being equal to `RoomType.DEFAULT` (1) and the variant being equal to 1000 (which is the only * Dogma Boss Room that exists in vanilla) and the sub-type being equal to * `HomeRoomSubType.LIVING_ROOM` (3). */ export declare function inDogmaRoom(): boolean; /** * Helper function to detect if the current room is a Double Trouble Boss Room. * * This is performed by checking for the string "Double Trouble" inside of the room name. The * vanilla game uses this convention for every Double Trouble Boss Room. Note that this method might * fail for mods that add extra Double Trouble rooms but do not follow the convention. * * Internally, the game is coded to detect Double Trouble Boss Rooms by checking for the variant * range of 3700 through 3850. We intentionally do not use this method since it may not work as well * with modded rooms. */ export declare function inDoubleTrouble(): boolean; /** Helper function to determine if the current room index is equal to `GridRoom.GENESIS`. */ export declare function inGenesisRoom(): boolean; /** * Helper function to determine if the current room grid index is inside of the normal 13x13 level * grid. * * For example, Devil Rooms and the Mega Satan room are not considered to be inside the grid. */ export declare function inGrid(): boolean; /** * Helper function to check if the current room is either the left Home closet (behind the red door) * or the right Home closet (with one random pickup). * * Home closets have a unique shape that is different from any other room in the game. */ export declare function inHomeCloset(): boolean; /** * Helper function to instantiate an array of mod features all at once. Use this function if your * mod uses the pattern of expressing mod features as `ModFeature` classes. * * If your feature classes have `v` variables, then this function will successfully register them * with the save data manager. * * For example: * * ```ts * const MOD_FEATURES = [ * MyFeature1, * MyFeature2, * MyFeature3, * ] as const; * initModFeatures(mod, MOD_FEATURES); * ``` * * @param mod The upgraded mod to use. * @param modFeatures An array of the feature classes that you have in your mod. * @param init Optional. Whether to automatically add the callbacks on the feature. Defaults to * true. * @returns An array of the instantiated features in the same order that the constructors were * passed in. (In most cases, you probably won't need the returned array.) */ export declare function initModFeatures>(mod: ModUpgraded, modFeatures: T, init?: boolean): { [K in keyof T]: InstanceType; }; /** Helper function to determine if the current room shape is one of the four L room shapes. */ export declare function inLRoom(): boolean; /** Helper function to determine if the current room index is equal to `GridRoom.MEGA_SATAN`. */ export declare function inMegaSatanRoom(): boolean; /** * Helper function to determine if the current room is part of the Repentance "escape sequence" in * the Mines/Ashpit. */ export declare function inMineShaft(): boolean; /** * Helper function to check if the current room is a miniboss room for a particular miniboss. This * will only work for mini-bosses that have dedicated boss rooms in the "00.special rooms.stb" file. */ export declare function inMinibossRoomOf(minibossID: MinibossID): boolean; /** * Helper function to check if the current room is a "mirror room" in Downpour or Dross. (These * rooms are marked with a specific sub-type.) */ export declare function inMirrorRoom(): boolean; /** * Helper function to check if a variable is within a certain range, inclusive on both ends. * * - For example, `inRange(1, 1, 3)` will return `true`. * - For example, `inRange(0, 1, 3)` will return `false`. * * @param num The number to check. * @param start The start of the range to check. * @param end The end of the range to check. */ export declare function inRange(num: int, start: int, end: int): boolean; /** * Helper function to check if a given position is within a given rectangle. * * This is an inclusive check, meaning that it will return true if the position is on the border of * the rectangle. */ export declare function inRectangle(position: Vector, topLeft: Vector, bottomRight: Vector): boolean; /** * Helper function to detect if the current room was created by the Red Key item. * * Under the hood, this checks for the `RoomDescriptorFlag.FLAG_RED_ROOM` flag. */ export declare function inRedKeyRoom(): boolean; /** * Helper function to check if the current room shape matches one of the given room shapes. * * This function is variadic, which means you can pass as many room shapes as you want to match for. */ export declare function inRoomShape(...roomShapes: readonly RoomShape[]): boolean; /** * Helper function to check if the current room matches one of the given room types. * * This function is variadic, which means you can pass as many room types as you want to match for. */ export declare function inRoomType(...roomTypes: readonly RoomType[]): boolean; /** * Helper function for checking if the current room is a secret exit that leads to a Repentance * floor. */ export declare function inSecretExit(): boolean; /** * Helper function for checking if the current room is a secret shop (from the Member Card * collectible). * * Secret shops are simply copies of normal shops, but with the backdrop of a secret room. In other * words, they will have the same room type, room variant, and room sub-type of a normal shop. Thus, * the only way to detect them is by using the grid index. */ export declare function inSecretShop(): boolean; /** * Helper function to determine whether the current room is the starting room of a floor. It only * returns true for the starting room of the primary dimension (meaning that being in the starting * room of the mirror world does not count). */ export declare function inStartingRoom(): boolean; /** * Helper function to validate that an interface contains all of the keys of an enum. You must * specify both generic parameters in order for this to work properly (i.e. the interface and then * the enum). * * For example: * * ```ts * enum MyEnum { * Value1, * Value2, * Value3, * } * * interface MyEnumToType { * [MyEnum.Value1]: boolean; * [MyEnum.Value2]: number; * [MyEnum.Value3]: string; * } * * interfaceSatisfiesEnum(); * ``` * * This function is only meant to be used with interfaces (i.e. types that will not exist at * run-time). If you are generating an object that will contain all of the keys of an enum, use the * `satisfies` operator with the `Record` type instead. */ export declare function interfaceSatisfiesEnum, Enum extends string | number>(): void; /** * Helper type to get a range of integers. It is inclusive on both ends. (The "I" in the type name * stands for inclusive.) * * For example, `IRange<3, 5>` will return `3 | 4 | 5`. * * From: * https://stackoverflow.com/questions/39494689/is-it-possible-to-restrict-number-to-a-certain-range */ export declare type IRange = Exclude, NaturalNumbersLessThan>; /** * Helper function to return an array of integers with the specified range, inclusive on both ends. * (The "i" in the function name stands for inclusive.) * * If the end is lower than the start, an empty array will be returned. * * For example: * * - `iRange(2)` returns `[0, 1, 2]`. * - `iRange(3)` returns `[0, 1, 2, 3]`. * - `iRange(-3)` returns `[0, -1, -2, -3]`. * - `iRange(1, 3)` returns `[1, 2, 3]`. * - `iRange(2, 5)` returns `[2, 3, 4, 5]`. * - `iRange(5, 2)` returns `[]`. * - `iRange(3, 3)` returns `[3]`. * * @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 iRange(start: int, end?: int, increment?: number): readonly int[]; /** * Helper function to determine if the provided room is equal to `RoomShape.1x2` or `RoomShape.2x1`. */ export declare function is2x1Room(roomData: RoomConfig): boolean; /** * Helper function to determine if the provided room is equal to `RoomShape.1x2` (4) or * `RoomShape.2x1` (6). */ export declare function is2x1RoomShape(roomShape: RoomShape): boolean; /** * Helper function to check if an instantiated Isaac API class is equal to another one of the same * type. You must provide the list of keys to check for. */ export declare function isaacAPIClassEquals(object1: unknown, object2: unknown, keys: readonly string[]): boolean; declare interface IsaacAPIClassTypeToSerializedType { [CopyableIsaacAPIClassType.BIT_SET_128]: SerializedBitSet128; [CopyableIsaacAPIClassType.COLOR]: SerializedColor; [CopyableIsaacAPIClassType.K_COLOR]: SerializedKColor; [CopyableIsaacAPIClassType.RNG]: SerializedRNG; [CopyableIsaacAPIClassType.VECTOR]: SerializedVector; } declare interface IsaacAPIClassTypeToType { [CopyableIsaacAPIClassType.BIT_SET_128]: BitSet128; [CopyableIsaacAPIClassType.COLOR]: Color; [CopyableIsaacAPIClassType.K_COLOR]: KColor; [CopyableIsaacAPIClassType.RNG]: RNG; [CopyableIsaacAPIClassType.VECTOR]: Vector; } /** * Helper function to check if a player is pressing a specific button (i.e. holding it down). * * This is a variadic version of `Input.IsActionPressed`, meaning that you can pass as many buttons * as you want to check for. This function will return true if any of the buttons are pressed. */ export declare function isActionPressed(controllerIndex: ControllerIndex, ...buttonActions: readonly ButtonAction[]): boolean; /** * Helper function to iterate over all inputs to determine if a specific button is pressed (i.e. * being held down). * * This function is variadic, meaning you can pass as many buttons as you want to check for. This * function will return true if any of the buttons are pressed. */ export declare function isActionPressedOnAnyInput(...buttonActions: readonly ButtonAction[]): boolean; /** * Helper function to check if a player is triggering a specific button (i.e. pressing and releasing * it). * * This is a variadic version of `Input.IsActionTriggered`, meaning that you can pass as many * buttons as you want to check for. This function will return true if any of the buttons are * triggered. */ export declare function isActionTriggered(controllerIndex: ControllerIndex, ...buttonActions: readonly ButtonAction[]): boolean; /** * Iterates over all inputs to determine if a specific button is triggered (i.e. held down and then * released). * * This function is variadic, meaning you can pass as many buttons as you want to check for. This * function will return true if any of the buttons are pressed. */ export declare function isActionTriggeredOnAnyInput(...buttonActions: readonly ButtonAction[]): boolean; /** Returns true if the item type in the item config is equal to `ItemType.ACTIVE`. */ export declare function isActiveCollectible(collectibleType: CollectibleType): boolean; /** * Helper function to detect if a particular entity is an active enemy. Use this over the * `Entity.IsActiveEnemy` method since it is bugged with friendly enemies, Grimaces, Ultra Greed, * and Mother. */ export declare function isActiveEnemy(entity: Entity): boolean; /** * Helper function to check if a player's active item is "double charged", meaning that it has both * a full normal charge and a full charge from The Battery. * * @param player The player to check. * @param activeSlot Optional. The slot to check. Default is `ActiveSlot.PRIMARY`. */ export declare function isActiveSlotDoubleCharged(player: EntityPlayer, activeSlot?: ActiveSlot): boolean; /** * Helper function to check if the active slot of a particular player is empty. * * @param player The player to check. * @param activeSlot Optional. The active slot to check. Default is `ActiveSlot.PRIMARY`. */ export declare function isActiveSlotEmpty(player: EntityPlayer, activeSlot?: ActiveSlot): boolean; /** * Helper function to check if the current game frame count is higher than a specific game frame * count. */ export declare function isAfterGameFrame(gameFrameCount: int): boolean; /** * Helper function to check if the current render frame count is higher than a specific render frame * count. */ export declare function isAfterRenderFrame(renderFrameCount: int): boolean; /** * Helper function to check if the current room frame count is higher than a specific room frame * count. */ export declare function isAfterRoomFrame(roomFrameCount: int): boolean; /** * Checks for specific NPCs that have "CanShutDoors" set to true naturally by the game, but should * not actually keep the doors closed (like Death's scythes). */ export declare function isAliveExceptionNPC(npc: EntityNPC): boolean; /** * Helper function to check if all of the pressure plates in the room are pushed. * * In this context, "pressure plates" refers to the grid entities that you have to press down in * order for the room to be cleared. This function ignores other types of pressure plates, such as * the ones that you press to get a reward, the ones that you press to start a Greed Mode wave, and * so on. * * Returns true if there are no pressure plates in the room. */ export declare function isAllPressurePlatesPushed(): boolean; /** * Helper function to loop through every room on the floor and see if it has been cleared. * * This function will only check rooms inside the grid and inside the current dimension. * * @param onlyCheckRoomTypes Optional. A whitelist of room types. If specified, room types not in * the array will be ignored. If not specified, then all rooms will be * checked. Undefined by default. * @param includeSecretRoom Optional. Whether to include the Secret Room. Default is false. * @param includeSuperSecretRoom Optional. Whether to include the Super Secret Room. Default is * false. * @param includeUltraSecretRoom Optional. Whether to include the Ultra Secret Room. Default is * false. * @allowEmptyVariadic */ export declare function isAllRoomsClear(onlyCheckRoomTypes?: readonly RoomType[], includeSecretRoom?: boolean, includeSuperSecretRoom?: boolean, includeUltraSecretRoom?: boolean): boolean; export declare function isAngelRoomDoor(door: GridEntityDoor): boolean; /** * Helper function to check to see if the current room is an angel shop. * * Under the hood, this checks the room type being equal to `RoomType.ANGEL` (15) and the sub-type * being equal to `AngelRoomSubType.SHOP` (1). */ export declare function isAngelShop(roomData: RoomConfig): boolean; /** * Since Lua uses tables for every non-primitive data structure, it is non-trivial to determine if a * particular table is being used as an array. `isArray` returns true if: * * - the table contains all numerical indexes that are contiguous, starting at 1 * - the table has no keys (i.e. an "empty" table) * * @param object The object to analyze. * @param ensureContiguousValues Optional. Whether the Lua table has to have all contiguous keys in * order to be considered an array. Default is true. */ export declare function isArray(object: unknown, ensureContiguousValues?: boolean): object is unknown[]; /** * Helper function to see if every element in the array is N + 1. * * For example, `[2, 3, 4]` would return true, and `[2, 3, 5]` would return false. */ export declare function isArrayContiguous(array: readonly int[]): boolean; /** * Helper function to check if all the elements of an array are unique within that array. * * Under the hood, this is performed by converting the array to a set. */ export declare function isArrayElementsUnique(array: readonly unknown[]): boolean; /** Checks if an array is in the provided 2-dimensional array. */ export declare function isArrayInArray(arrayToMatch: readonly T[], parentArray: ReadonlyArray): boolean; /** For `PickupVariant.LIL_BATTERY` (90). */ export declare function isBattery(pickup: EntityPickup): pickup is EntityPickupBattery; /** * Helper function to check to see if the provided room is the Boss Room for The Beast. * * This function is useful because the `Room.GetBossID` method returns 0 for The Beast room. * * Under the hood, this checks the room type being equal to `RoomType.DUNGEON` (16) and the sub-type * being equal to `DungeonSubType.BEAST_ROOM` (4). */ export declare function isBeastRoom(roomData: RoomConfig): boolean; /** * Helper function to check if the current game frame count is lower than a specific game frame * count. */ export declare function isBeforeGameFrame(gameFrameCount: int): boolean; /** * Helper function to check if the current render frame count is lower than a specific render frame * count. */ export declare function isBeforeRenderFrame(renderFrameCount: int): boolean; /** * Helper function to check if the current room frame count is lower than a specific room frame * count. */ export declare function isBeforeRoomFrame(roomFrameCount: int): boolean; /** * Helper function for detecting when a player is Bethany or Tainted Bethany. This is useful if you * need to adjust UI elements to account for Bethany's soul charges or Tainted Bethany's blood * charges. */ export declare function isBethany(player: EntityPlayer): boolean; /** * Helper function to detect if the provided room is big. Specifically, this is all 1x2 rooms, 2x2 * rooms, and L rooms. */ export declare function isBigRoom(roomData: RoomConfig): boolean; /** * Helper function to detect if the provided room shape is big. Specifically, this is all 1x2 rooms, * 2x2 rooms, and L rooms. */ export declare function isBigRoomShape(roomShape: RoomShape): boolean; /** Helper function to check if something is an instantiated `BitSet128` object. */ export declare function isBitSet128(object: unknown): object is BitSet128; /** * Returns true if the collectible has a red question mark sprite. * * Note that this function will not work properly in a render callback with the `RenderMode` set to * `RenderMode.WATER_REFLECT`. If this is detected, this function will throw a run-time error. */ export declare function isBlindCollectible(collectible: EntityPickup): boolean; /** * Helper function to check if the provided door is the one 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.) */ export declare function isBlueWombDoor(door: GridEntityDoor): boolean; /** Helper function to detect if a variable is of type `EntityBomb`. */ export declare function isBomb(variable: unknown): variable is EntityBomb; /** For `PickupVariant.BOMB` (40). */ export declare function isBombPickup(pickup: EntityPickup): pickup is EntityPickupBomb; export declare function isBoolean(variable: unknown): variable is boolean; /** * Helper function to check if the provided room is the Boss Room for a particular boss. This will * only work for bosses that have dedicated boss rooms in the "00.special rooms.stb" file. */ export declare function isBossRoomOf(roomData: RoomConfig, bossID: BossID): boolean; /** * Helper function to check if the provided door is the one that leads to the Boss Rush room. (In * vanilla, the door will only appear in the Boss Room of the sixth floor.) */ export declare function isBossRushDoor(door: GridEntityDoor): boolean; /** * Returns true for card types that have the following item config card type: * * - `ItemConfigCardType.TAROT` (0) * - `ItemConfigCardType.SUIT` (1) * - `ItemConfigCardType.SPECIAL` (3) * - `ItemConfigCardType.TAROT_REVERSE` (5) */ export declare function isCard(cardType: CardType): boolean; /** For `PickupVariant.CARD` (300). */ export declare function isCardPickup(pickup: EntityPickup): pickup is EntityPickupCard; /** Returns whether the given card type matches the specified item config card type. */ export declare function isCardType(cardType: CardType, itemConfigCardType: ItemConfigCardType): boolean; export declare enum ISCFeature { CUSTOM_REVIVE = 0, ESAU_JR_DETECTION = 1, FLIP_DETECTION = 2, GRID_ENTITY_COLLISION_DETECTION = 3, GRID_ENTITY_RENDER_DETECTION = 4, GRID_ENTITY_UPDATE_DETECTION = 5, GAME_REORDERED_CALLBACKS = 6, ITEM_PICKUP_DETECTION = 7, PICKUP_CHANGE_DETECTION = 8, PLAYER_COLLECTIBLE_DETECTION = 9, PLAYER_REORDERED_CALLBACKS = 10, SLOT_DESTROYED_DETECTION = 11, SLOT_RENDER_DETECTION = 12, SLOT_UPDATE_DETECTION = 13, CHARACTER_HEALTH_CONVERSION = 14, CHARACTER_STATS = 15, COLLECTIBLE_ITEM_POOL_TYPE = 16, CUSTOM_GRID_ENTITIES = 17, CUSTOM_ITEM_POOLS = 18, CUSTOM_HOTKEYS = 19, CUSTOM_PICKUPS = 20, CUSTOM_STAGES = 21, CUSTOM_TRAPDOORS = 22, DEBUG_DISPLAY = 23, DEPLOY_JSON_ROOM = 24, DISABLE_ALL_SOUND = 25, DISABLE_INPUTS = 26, EDEN_STARTING_STATS_HEALTH = 27, FADE_IN_REMOVER = 28, FAST_RESET = 29, FLYING_DETECTION = 30, FORGOTTEN_SWITCH = 31, EXTRA_CONSOLE_COMMANDS = 32, ITEM_POOL_DETECTION = 33, MODDED_ELEMENT_DETECTION = 34, MODDED_ELEMENT_SETS = 35, NO_SIREN_STEAL = 36, PAUSE = 37, PERSISTENT_ENTITIES = 38, PICKUP_INDEX_CREATION = 39, PLAYER_COLLECTIBLE_TRACKING = 40, PONY_DETECTION = 41, PRESS_INPUT = 42, PREVENT_CHILD_ENTITIES = 43, PREVENT_GRID_ENTITY_RESPAWN = 44, RERUN_DETECTION = 45, ROOM_CLEAR_FRAME = 46, ROOM_HISTORY = 47, RUN_IN_N_FRAMES = 48, RUN_NEXT_ROOM = 49, RUN_NEXT_RUN = 50, SAVE_DATA_MANAGER = 51, SPAWN_ALT_ROCK_REWARDS = 52, STAGE_HISTORY = 53, START_AMBUSH = 54, TAINTED_LAZARUS_PLAYERS = 55, UNLOCK_ACHIEVEMENTS_DETECTION = 56 } /** * We want to only extract the class public methods, so we omit the keys of the `Feature` base * class. */ declare type ISCFeaturesToKeys = Omit>>, keyof Feature>; declare interface ISCFeatureToClass { [ISCFeature.CUSTOM_REVIVE]: CustomRevive; [ISCFeature.ESAU_JR_DETECTION]: EsauJrDetection; [ISCFeature.FLIP_DETECTION]: FlipDetection; [ISCFeature.GRID_ENTITY_COLLISION_DETECTION]: GridEntityCollisionDetection; [ISCFeature.GRID_ENTITY_RENDER_DETECTION]: GridEntityRenderDetection; [ISCFeature.GRID_ENTITY_UPDATE_DETECTION]: GridEntityUpdateDetection; [ISCFeature.GAME_REORDERED_CALLBACKS]: GameReorderedCallbacks; [ISCFeature.ITEM_PICKUP_DETECTION]: ItemPickupDetection; [ISCFeature.PICKUP_CHANGE_DETECTION]: PickupChangeDetection; [ISCFeature.PLAYER_COLLECTIBLE_DETECTION]: PlayerCollectibleDetection; [ISCFeature.PLAYER_REORDERED_CALLBACKS]: PlayerReorderedCallbacks; [ISCFeature.SLOT_DESTROYED_DETECTION]: SlotDestroyedDetection; [ISCFeature.SLOT_RENDER_DETECTION]: SlotRenderDetection; [ISCFeature.SLOT_UPDATE_DETECTION]: SlotUpdateDetection; [ISCFeature.CHARACTER_HEALTH_CONVERSION]: CharacterHealthConversion; [ISCFeature.CHARACTER_STATS]: CharacterStats; [ISCFeature.COLLECTIBLE_ITEM_POOL_TYPE]: CollectibleItemPoolType; [ISCFeature.CUSTOM_GRID_ENTITIES]: CustomGridEntities; [ISCFeature.CUSTOM_ITEM_POOLS]: CustomItemPools; [ISCFeature.CUSTOM_HOTKEYS]: CustomHotkeys; [ISCFeature.CUSTOM_PICKUPS]: CustomPickups; [ISCFeature.CUSTOM_STAGES]: CustomStages; [ISCFeature.CUSTOM_TRAPDOORS]: CustomTrapdoors; [ISCFeature.DEBUG_DISPLAY]: DebugDisplay; [ISCFeature.DEPLOY_JSON_ROOM]: DeployJSONRoom; [ISCFeature.DISABLE_ALL_SOUND]: DisableAllSound; [ISCFeature.DISABLE_INPUTS]: DisableInputs; [ISCFeature.EDEN_STARTING_STATS_HEALTH]: EdenStartingStatsHealth; [ISCFeature.FADE_IN_REMOVER]: FadeInRemover; [ISCFeature.FAST_RESET]: FastReset; [ISCFeature.FLYING_DETECTION]: FlyingDetection; [ISCFeature.FORGOTTEN_SWITCH]: ForgottenSwitch; [ISCFeature.EXTRA_CONSOLE_COMMANDS]: ExtraConsoleCommands; [ISCFeature.ITEM_POOL_DETECTION]: ItemPoolDetection; [ISCFeature.MODDED_ELEMENT_DETECTION]: ModdedElementDetection; [ISCFeature.MODDED_ELEMENT_SETS]: ModdedElementSets; [ISCFeature.NO_SIREN_STEAL]: NoSirenSteal; [ISCFeature.PAUSE]: Pause; [ISCFeature.PERSISTENT_ENTITIES]: PersistentEntities; [ISCFeature.PICKUP_INDEX_CREATION]: PickupIndexCreation; [ISCFeature.PLAYER_COLLECTIBLE_TRACKING]: PlayerCollectibleTracking; [ISCFeature.PONY_DETECTION]: PonyDetection; [ISCFeature.PRESS_INPUT]: PressInput; [ISCFeature.PREVENT_CHILD_ENTITIES]: PreventChildEntities; [ISCFeature.PREVENT_GRID_ENTITY_RESPAWN]: PreventGridEntityRespawn; [ISCFeature.RERUN_DETECTION]: RerunDetection; [ISCFeature.ROOM_CLEAR_FRAME]: RoomClearFrame; [ISCFeature.ROOM_HISTORY]: RoomHistory; [ISCFeature.RUN_IN_N_FRAMES]: RunInNFrames; [ISCFeature.RUN_NEXT_ROOM]: RunNextRoom; [ISCFeature.RUN_NEXT_RUN]: RunNextRun; [ISCFeature.SAVE_DATA_MANAGER]: SaveDataManager; [ISCFeature.SPAWN_ALT_ROCK_REWARDS]: SpawnRockAltRewards; [ISCFeature.STAGE_HISTORY]: StageHistory; [ISCFeature.START_AMBUSH]: StartAmbush; [ISCFeature.TAINTED_LAZARUS_PLAYERS]: TaintedLazarusPlayers; [ISCFeature.UNLOCK_ACHIEVEMENTS_DETECTION]: UnlockAchievementsDetection; } declare type ISCFeatureTuple = ISCFeature extends T["length"] ? 'The list of features must be a tuple. Use the "as const" assertion when declaring the array.' : T; /** * We need to use the `PublicInterface` helper type because an intersection of two classes with the * same private fields will cause a `never` type. */ declare type ISCFeatureTupleToClassTuple = { [K in keyof T]: PublicInterface; }; /** * Helper function to check if a player is a specific character (i.e. `PlayerType`). * * This function is variadic, meaning that you can supply as many characters as you want to check * for. Returns true if the player is any of the supplied characters. */ export declare function isCharacter(player: EntityPlayer, ...characters: readonly PlayerType[]): boolean; /** Helper function to test if the provided pickup matches one of the various chest variants. */ export declare function isChest(pickup: EntityPickup): boolean; /** * Helper function to test if the provided pickup variant matches one of the various chest variants. */ export declare function isChestVariant(pickupVariant: PickupVariant): boolean; /** * Helper function to detect if a particular player is a "child" player, meaning that they have a * non-undefined `EntityPlayer.Parent` field. (For example, the Strawman Keeper.) */ export declare function isChildPlayer(player: EntityPlayer): boolean; /** * From: https://www.geeksforgeeks.org/check-if-any-point-overlaps-the-given-circle-and-rectangle/ */ export declare function isCircleIntersectingRectangle(circleCenter: Vector, circleRadius: float, rectangleTopLeft: Vector, rectangleBottomRight: Vector): boolean; /** Helper function to see if a player is close enough to activate a Dice Room floor. */ export declare function isCloseEnoughToTriggerDiceFloor(player: EntityPlayer, diceFloor: EntityEffect): boolean; /** For `PickupVariant.COIN` (20). */ export declare function isCoin(pickup: EntityPickup): pickup is EntityPickupCoin; /** For `PickupVariant.COLLECTIBLE` (100). */ export declare function isCollectible(pickup: EntityPickup): pickup is EntityPickupCollectible; /** * Helper function to check if a particular collectibles is in a particular item pool at the * beginning of a vanilla run. */ export declare function isCollectibleTypeInDefaultItemPool(collectibleType: CollectibleType, itemPoolType: ItemPoolType): boolean; /** Helper function to check if something is an instantiated `Color` object. */ export declare function isColor(object: unknown): object is Color; /** * Helper function to generically check if a given object is a copyable Isaac API class. (This is * used by the save data manager when determining what is safe to copy.) * * For the list of supported classes, see the `CopyableIsaacAPIClassType` enum. */ export declare function isCopyableIsaacAPIClass(object: unknown): object is CopyableIsaacAPIClass; /** * Helper function for determining whether the provided room is a crawl space. Use this function * over comparing to `RoomType.DUNGEON` or `GridRoom.DUNGEON_IDX` since there is a special case of * the player being in a boss fight that takes place in a dungeon. */ export declare function isCrawlSpace(roomData: RoomConfig): boolean; /** * Helper function for checking whether the provided room is a crawl space with a door corresponding * to `DoorSlotFlag.RIGHT_0` (1 << 2). */ export declare function isCrawlSpaceWithBlackMarketEntrance(roomData: RoomConfig): boolean; /** * Helper function to distinguish between a normal Daddy Long Legs / Triachnid and the child entity * that is spawned when the boss does the multi-stomp attack. * * When this attack occurs, four extra copies of Daddy Long Legs will be spawned with the same * entity type, variant, and sub-type. The `Entity.Parent` field will be undefined in this case, so * the way to tell them apart is to check for a non-undefined `Entity.SpawnerEntity` field. */ export declare function isDaddyLongLegsChildStompEntity(npc: EntityNPC): boolean; /** * Helper function to see if a damage source is from a player. Use this instead of comparing to the * entity directly because it takes familiars into account. */ export declare function isDamageFromPlayer(damageSource: Entity): boolean; /** * Uses the player's current health and other miscellaneous things to determine if incoming damage * will be fatal. */ export declare function isDamageToPlayerFatal(player: EntityPlayer, amount: int, source: EntityRef, lastDamageGameFrame: int | undefined): boolean; /** * Helper function to check if the given room grid index is a dead end. Specifically, this is * defined as having only one adjacent room that exists. * * Note that this function does not take the shape of the room into account; it only looks at a * single room grid index. * * This function does not care if the given room grid index actually exists, so you can use it to * check if a hypothetical room would be a dead end. * * @param roomGridIndex Optional. Default is the current room index. */ export declare function isDeadEnd(roomGridIndex?: int): boolean; /** * Helper function to detect if the provided room is one of the rooms in the Death Certificate area. */ export declare function isDeathCertificateArea(roomData: RoomConfig): boolean; /** * Helper function to determine if a given object is a `DefaultMap` from `isaacscript-common`. * * It is not reliable to use the `instanceof` operator to determine this because each Lua module has * their own copies of the entire lualib and thus their own instantiated version of a `DefaultMap`. */ export declare function isDefaultMap(object: unknown): object is DefaultMap; export declare function isDevilRoomDoor(door: GridEntityDoor): boolean; /** * Helper function to detect if the provided room is a Treasure Room created when entering with a * Devil's Crown trinket. * * Under the hood, this checks for `RoomDescriptorFlag.DEVIL_TREASURE`. */ export declare function isDevilsCrownTreasureRoom(roomDescriptor: RoomDescriptor): boolean; /** * Helper function to check to see if the provided room is the Boss Room for Dogma. * * This function is useful because the `Room.GetBossID` method returns 0 for the Dogma room. * * Note that the "living room" on the Home floor with the TV at the top of the room is not the Dogma * Boss Room, as the player is teleported to a different room after watching the TV cutscene. * * Under the hood, this checks the stage ID being equal to `StageID.HOME` (35) and the room type * being equal to `RoomType.DEFAULT` (1) and the variant being equal to 1000 (which is the only * Dogma Boss Room that exists in vanilla) and the sub-type being equal to * `HomeRoomSubType.LIVING_ROOM` (3). */ export declare function isDogmaRoom(roomData: RoomConfig): boolean; /** Helper function to detect if a variable is of type `GridEntityDoor`. */ export declare function isDoor(variable: unknown): variable is GridEntityDoor; /** Helper function to see if a door slot could exist for a given room shape. */ export declare function isDoorSlotInRoomShape(doorSlot: DoorSlot, roomShape: RoomShape): boolean; export declare function isDoorSlotValidAtGridIndex(doorSlot: DoorSlot, roomGridIndex: int): boolean; export declare function isDoorSlotValidAtGridIndexForRedRoom(doorSlot: DoorSlot, roomGridIndex: int): boolean; /** * This refers to the Repentance door that spawns in a boss room after defeating the boss. You have * to spend one key to open it. It has a sprite filename of "gfx/grid/door_downpour.anm2". */ export declare function isDoorToDownpour(door: GridEntityDoor): boolean; /** * This refers to the Repentance door that spawns in a boss room after defeating the boss. You have * to spend two hearts to open it. It has a sprite filename of "gfx/grid/door_mausoleum.anm2". */ export declare function isDoorToMausoleum(door: GridEntityDoor): boolean; /** * This refers to the "strange door" located on the first room of Depths 2. You open it with either * a Polaroid or a Negative. It has a sprite filename of "gfx/grid/door_mausoleum_alt.anm2". */ export declare function isDoorToMausoleumAscent(door: GridEntityDoor): boolean; /** * This refers to the Repentance door that spawns in a boss room after defeating the boss. You have * to spend two bombs to open it. It has a sprite filename of "gfx/grid/door_mines.anm2". */ export declare function isDoorToMines(door: GridEntityDoor): boolean; /** * This refers to the Repentance door that spawns after defeating Mom. You open it with the * completed knife. It has a sprite filename of "gfx/grid/door_momsheart.anm2". */ export declare function isDoorToMomsHeart(door: GridEntityDoor): boolean; /** * Helper function to detect if the provided room is a Double Trouble Boss Room. * * This is performed by checking for the string "Double Trouble" inside of the room name. The * vanilla game uses this convention for every Double Trouble Boss Room. Note that this method might * fail for mods that add extra Double Trouble rooms but do not follow the convention. * * Internally, the game is coded to detect Double Trouble Boss Rooms by checking for the variant * range of 3700 through 3850. We intentionally do not use this method since it may not work as well * with modded rooms. */ export declare function isDoubleTrouble(roomData: RoomConfig): boolean; /** * Helper function to detect the custom death state of a Dump. When Dumps die, they go to * `NPCState.SPECIAL`, spit out their head, and then slowly fade away while shooting a burst of * tears. */ export declare function isDyingDump(npc: EntityNPC): boolean; /** * Helper function to detect the custom death state of an Eggy. Eggies are never actually marked * dead by the game. Instead, when Eggies take fatal damage, they go into NPCState.STATE_SUICIDE and * spawn 14 Swarm Spiders while their StateFrame ticks upwards. */ export declare function isDyingEggyWithNoSpidersLeft(npc: EntityNPC): boolean; /** * Helper function for detecting when a player is Eden or Tainted Eden. Useful for situations where * you want to know if the starting stats were randomized, for example. */ export declare function isEden(player: EntityPlayer): boolean; /** Helper function to detect if a variable is of type `EntityEffect`. */ export declare function isEffect(variable: unknown): variable is EntityEffect; /** * Helper function to check if every bit in the flag is turned off. * * (This is equivalent to checking if the flag is equal to 0, but this is not possible without * casting the flag to a number.) */ export declare function isEmptyFlag(flag: BitFlag | BitFlag128): boolean; /** * Helper function to detect if a variable is of type `Entity`. This will return false for child * classes such as `EntityPlayer` or `EntityTear`. */ export declare function isEntity(variable: unknown): variable is Entity; /** * Helper function to measure an entity's velocity to see if it is moving. * * Use this helper function over checking if the velocity length is equal to 0 because entities can * look like they are completely immobile but yet still have a non zero velocity. Thus, using a * threshold is needed. * * @param entity The entity whose velocity to measure. * @param threshold Optional. The threshold from 0 to consider to be moving. Default is 0.01. */ export declare function isEntityMoving(entity: Entity, threshold?: number): boolean; /** Helper function to validate that a particular value exists inside of an enum. */ export declare function isEnumValue(value: number | string | BitFlag | BitFlag128, transpiledEnum: T): value is T[keyof T]; export declare function isEven(num: int): boolean; /** Helper function to detect if a variable is of type `EntityFamiliar`. */ export declare function isFamiliar(variable: unknown): variable is EntityFamiliar; /** Returns true if the item type in the item config is equal to `ItemType.FAMILIAR`. */ export declare function isFamiliarCollectible(collectibleType: CollectibleType): boolean; /** * Helper function to detect if the given familiar is "stolen" by The Siren boss. * * This function is useful because some familiars may need to behave differently when under The * Siren's control (e.g. if they auto-target enemies). */ export declare function isFamiliarStolenBySiren(familiar: EntityFamiliar): boolean; /** * Helper function to check if a familiar is the type that shoots tears that mimic the players * tears, like Incubus, Fate's Reward, Sprinkler, and so on. */ export declare function isFamiliarThatShootsPlayerTears(familiar: EntityFamiliar): boolean; /** * Returns whether the provided stage and stage type represent a "final floor". This is defined as a * floor that prevents the player from entering the I AM ERROR room on. * * For example, when using Undefined on The Chest, it has a 50% chance of teleporting the player to * the Secret Room and a 50% chance of teleporting the player to the Super Secret Room, because the * I AM ERROR room is never entered into the list of possibilities. */ export declare function isFinalFloor(stage: LevelStage, stageType: StageType): boolean; export declare function isFirstPlayer(player: EntityPlayer): boolean; /** * Helper function to determine whether the player's "active" pocket item slot is set to their * pocket active item. */ export declare function isFirstSlotPocketActiveItem(player: EntityPlayer): boolean; export declare function isFlyingCharacter(character: PlayerType): boolean; /** * Helper function to detect if a particular player is the Found Soul player provided by the * trinket. */ export declare function isFoundSoul(player: EntityPlayer): boolean; export declare function isFunction(variable: unknown): variable is Function; /** * Helper function to determine if the index of the provided room is equal to `GridRoom.GENESIS`. */ export declare function isGenesisRoom(roomGridIndex: int): boolean; /** * Returns whether the given collectible is a "glitched" item. All items are replaced by glitched * items once a player has TMTRAINER. However, glitched items can also "naturally" appear in secret * rooms and I AM ERROR rooms if the "Corrupted Data" achievement is unlocked. * * Under the hood, this checks if the sub-type of the collectible is greater than 4,000,000,000. */ export declare function isGlitchedCollectible(collectible: EntityPickup): boolean; export declare function isGoldenTrinketType(trinketType: TrinketType): boolean; /** Helper function to see if the given pill color is either a gold pill or a horse gold pill. */ export declare function isGoldPill(pillColor: PillColor): boolean; /** Helper function to detect if a variable is of type `GridEntity`. */ export declare function isGridEntity(variable: unknown): variable is GridEntity; /** * Helper function to detect if a particular grid entity would "break" if it was touched by an * explosion. * * For example, rocks and pots are breakable by explosions, but blocks are not. */ export declare function isGridEntityBreakableByExplosion(gridEntity: GridEntity): boolean; /** * Helper function to see if the provided grid entity is in its respective broken state. See the * `GRID_ENTITY_TYPE_TO_BROKEN_STATE_MAP` constant for more details. * * Note that in the case of `GridEntityType.LOCK` (11), the state will turn to being broken before * the actual collision for the entity is removed. */ export declare function isGridEntityBroken(gridEntity: GridEntity): boolean; /** * Helper function to see if an arbitrary number is a valid `GridEntityXMLType`. This is useful in * the `PRE_ROOM_ENTITY_SPAWN` callback for narrowing the type of the first argument. */ export declare function isGridEntityXMLType(num: number): num is GridEntityXMLType; /** * Helper function to check if the provided grid index has a door on it or if the surrounding 8 grid * indexes have a door on it. */ export declare function isGridIndexAdjacentToDoor(gridIndex: int): boolean; /** For `PickupVariant.HEART` (10). */ export declare function isHeart(pickup: EntityPickup): pickup is EntityPickupHeart; /** * Returns true if the collectible has the "Hidden" attribute in the item config. * * Hidden collectibles will not show up in any pools and Eden will not start with them. */ export declare function isHiddenCollectible(collectibleOrCollectibleType: EntityPickup | CollectibleType): boolean; export declare function isHiddenSecretRoomDoor(door: GridEntityDoor): boolean; /** * Helper function to check if the provided room is either the left Home closet (behind the red * door) or the right Home closet (with one random pickup). * * Home closets have a unique shape that is different from any other room in the game. */ export declare function isHomeCloset(roomData: RoomConfig): boolean; /** * Helper function to see if the given pill color is a horse pill. * * Under the hood, this checks for `pillColor > 2048`. */ export declare function isHorsePill(pillColor: PillColor): boolean; export declare function isInteger(variable: unknown): variable is int; /** * Helper function to check if something is an instantiated class from the Isaac API. (All classes * from the Isaac API have a type of "userdata" in Lua with a metatable key of "__type" equal to the * name of the class.) */ export declare function isIsaacAPIClass(object: unknown): object is IsaacAPIClass; export declare function isIsaacAPIClassOfType(object: unknown, classType: string): boolean; /** * Helper function for detecting when a player is Jacob or Esau. This will only match the * non-tainted versions of these characters. */ export declare function isJacobOrEsau(player: EntityPlayer): boolean; /** Helper function to check if something is an instantiated `KColor` object. */ export declare function isKColor(object: unknown): object is KColor; /** * Helper function for detecting when a player is Keeper or Tainted Keeper. Useful for situations * where you want to know if the health is coin hearts, for example. */ export declare function isKeeper(player: EntityPlayer): boolean; /** For `PickupVariant.KEY` (30). */ export declare function isKey(pickup: EntityPickup): pickup is EntityPickupKey; /** * Helper function to see if a specific keyboard key is being held down by the player. * * This function is variadic, meaning you can pass as many keyboard values as you want to check for. * This function will return true if any of the values are pressed. */ export declare function isKeyboardPressed(...keys: readonly Keyboard[]): boolean; /** Helper function to detect if a variable is of type `EntityKnife`. */ export declare function isKnife(variable: unknown): variable is EntityKnife; /** Helper function to detect if a variable is of type `EntityLaser`. */ export declare function isLaser(variable: unknown): variable is EntityLaser; /** Helper function for detecting when a player is The Lost or Tainted Lost. */ export declare function isLost(player: EntityPlayer): boolean; /** Helper function to determine if the provided room is one of the four L room shapes. */ export declare function isLRoom(roomData: RoomConfig): boolean; /** * Helper function to determine if the provided room is equal to `RoomShape.LTL` (9), * `RoomShape.LTR` (10), `RoomShape.LBL` (11), or `RoomShape.LBR` (12). */ export declare function isLRoomShape(roomShape: RoomShape): boolean; /** * Players can boot the game with an launch option called "--luadebug", which will enable additional * functionality that is considered to be unsafe. For more information about this flag, see the * wiki: https://bindingofisaacrebirth.fandom.com/wiki/Launch_Options * * When this flag is enabled, the global environment will be slightly different. The differences are * documented here: https://wofsauge.github.io/IsaacDocs/rep/Globals.html * * This function uses the `package` global variable as a proxy to determine if the "--luadebug" flag * is enabled. * * Note that this function will return false if the Racing+ sandbox is enabled, even if the * "--luadebug" flag is really turned on. If checking for this case is needed, check for the * presence of the `sandboxGetTraceback` function. */ export declare function isLuaDebugEnabled(): boolean; /** * Helper function to check if the provided character is one of the characters that are selectable * from the main menu (and have achievements related to completing the various bosses and so on). */ export declare function isMainCharacter(character: PlayerType): character is MainCharacter; /** * Helper function to check if the provided door is the one that leads to the Mega Satan Boss Room. * (In vanilla, the door will only appear in the starting room of The Chest / Dark Room.) */ export declare function isMegaSatanDoor(door: GridEntityDoor): boolean; /** * Helper function to determine if the index of the provided room is equal to `GridRoom.MEGA_SATAN`. */ export declare function isMegaSatanRoom(roomGridIndex: int): boolean; /** * Helper function to determine if the provided room is part of the Repentance "escape sequence" in * the Mines/Ashpit. */ export declare function isMineShaft(roomData: RoomConfig): boolean; /** * Helper function to check if the provided room is a miniboss room for a particular miniboss. This * will only work for mini-bosses that have dedicated boss rooms in the "00.special rooms.stb" file. */ export declare function isMinibossRoomOf(roomData: RoomConfig, minibossID: MinibossID): boolean; /** * Helper function to check if the provided room is a "mirror room" in Downpour or Dross. (These * rooms are marked with a specific sub-type.) */ export declare function isMirrorRoom(roomData: RoomConfig): boolean; /** * Helper function to check if a tear hit an enemy. A tear is considered to be missed if it hit the * ground, a wall, or a grid entity. * * Note that tears are still considered to be missed if they hit a poop or fire, so you may want to * handle those separately using the `POST_GRID_ENTITY_COLLISION` and `POST_ENTITY_COLLISION` * callbacks, respectively. * * Under the hood, this function uses the `Entity.IsDead` method. (Tears will not die if they hit an * enemy, but they will die if they hit a wall or object.) */ export declare function isMissedTear(tear: EntityTear): boolean; /** Returns true for any card type added by a mod. */ export declare function isModdedCardType(cardType: CardType): boolean; export declare function isModdedCharacter(character: PlayerType): boolean; export declare function isModdedCollectibleType(collectibleType: CollectibleType): boolean; export declare function isModdedPillEffect(pillEffect: PillEffect): boolean; export declare function isModdedPlayer(player: EntityPlayer): boolean; export declare function isModdedTrinketType(trinketType: TrinketType): boolean; /** * Helper function to check if one or more modifier keys are being pressed down on the keyboard. * * A modifier key is defined as shift, control, alt, or Windows. */ export declare function isModifierKeyPressed(): boolean; export declare function isMoveAction(buttonAction: ButtonAction): boolean; export declare function isMoveActionPressed(controllerIndex: ControllerIndex): boolean; export declare function isMoveActionPressedOnAnyInput(): boolean; export declare function isMoveActionTriggered(controllerIndex: ControllerIndex): boolean; export declare function isMoveActionTriggeredOnAnyInput(): boolean; /** * Helper function to detect if there is two or more players currently playing. * * Specifically, this function looks for unique `ControllerIndex` values across all players. * * This function is not safe to use in the `POST_PLAYER_INIT` callback, because the * `ControllerIndex` will not be set properly. As a workaround, you can use it in the * `POST_PLAYER_INIT_FIRST` callback (or some other callback like `POST_UPDATE`). */ export declare function isMultiplayer(): boolean; /** * Helper function to determine if the provided room is equal to `RoomShape.IH` (2), `RoomShape.IV` * (3), `RoomShape.IIV` (5), or `RoomShape.IIH` (7). */ export declare function isNarrowRoom(roomShape: RoomShape): boolean; /** * Helper function to see if the given pill color is not a gold pill and not a horse pill and not * the null value. * * Under the hood, this checks using the `FIRST_PILL_COLOR` and `LAST_NORMAL_PILL_COLOR` constants. */ export declare function isNormalPillColor(pillColor: PillColor): boolean; /** Helper function to detect if a variable is of type `EntityNPC`. */ export declare function isNPC(variable: unknown): variable is EntityNPC; export declare function isNumber(variable: unknown): variable is number; export declare function isOdd(num: int): boolean; /** * Returns true if the item type in the item config is equal to `ItemType.ITEM_PASSIVE` or * `ItemType.ITEM_FAMILIAR`. */ export declare function isPassiveOrFamiliarCollectible(collectibleOrCollectibleType: EntityPickup | CollectibleType): boolean; /** * Helper function to narrow the type of `PickingUpItem` to one of the following: * * - `ItemType.PASSIVE` (1) * - `ItemType.ACTIVE` (3) * - `ItemType.FAMILIAR` (4) */ export declare function isPickingUpItemCollectible(pickingUpItem: PickingUpItem): pickingUpItem is PickingUpItemCollectible; /** Helper function to narrow the type of `PickingUpItem` to `ItemType.NULL` (0). */ export declare function isPickingUpItemNull(pickingUpItem: PickingUpItem): pickingUpItem is PickingUpItemTrinket; /** Helper function to narrow the type of `PickingUpItem` to `ItemType.TRINKET` (2). */ export declare function isPickingUpItemTrinket(pickingUpItem: PickingUpItem): pickingUpItem is PickingUpItemTrinket; /** Helper function to detect if a variable is of type `EntityPickup`. */ export declare function isPickup(variable: unknown): variable is EntityPickup; /** For `PickupVariant.PILL` (70). */ export declare function isPill(pickup: EntityPickup): pickup is EntityPickupPill; /** Helper function to detect if a variable is of type `GridEntityPit`. */ export declare function isPit(variable: unknown): variable is GridEntityPit; /** Helper function to detect if a variable is of type `EntityPlayer`. */ export declare function isPlayer(variable: unknown): variable is EntityPlayer; /** * Helper function for determining if a player is able to turn their head by pressing the shooting * buttons. * * Under the hood, this function uses the `EntityPlayer.IsExtraAnimationFinished` method. */ export declare function isPlayerAbleToAim(player: EntityPlayer): boolean; /** Returns true for card types that have `ItemConfigCardType.SPECIAL_OBJECT`. */ export declare function isPocketItemObject(cardType: CardType): boolean; /** Helper function to detect if a variable is of type `GridEntityPoop`. */ export declare function isPoop(variable: unknown): variable is GridEntityPoop; /** Helper function to see if a `GridEntityXMLType` is some kind of poop. */ export declare function isPoopGridEntityXMLType(gridEntityXMLType: GridEntityXMLType): boolean; /** For `PickupVariant.POOP` (42). */ export declare function isPoopPickup(pickup: EntityPickup): pickup is EntityPickupPoop; /** * Helper function to detect whether a given Void Portal is one that randomly spawns after a boss is * defeated or is one that naturally spawns in the room after Hush. * * Under the hood, this is determined by looking at the `VarData` of the entity: * - The `VarData` of Void Portals that are spawned after bosses will be equal to 1. * - The `VarData` of the Void Portal in the room after Hush is equal to 0. */ export declare function isPostBossVoidPortal(gridEntity: GridEntity): boolean; /** Helper function to detect if a variable is of type `GridEntityPressurePlate`. */ export declare function isPressurePlate(variable: unknown): variable is GridEntityPressurePlate; /** Helper function to detect if a variable is a boolean, number, or string. */ export declare function isPrimitive(variable: unknown): variable is boolean | number | string; /** Helper function to detect if a variable is of type `EntityProjectile`. */ export declare function isProjectile(variable: unknown): variable is EntityProjectile; /** Helper function to check if a collectible type is a particular quality. */ export declare function isQuality(collectibleOrCollectibleType: EntityPickup | CollectibleType, quality: int): boolean; export declare function isQuestCollectible(collectibleOrCollectibleType: EntityPickupCollectible | CollectibleType): boolean; /** * Helper function to detect the custom death state of a Rag Man Ragling. When Rag Man Raglings die, * they turn into a patch on the ground and can be revived by Rag Man at a later time. This causes * them to show up as an "alive" enemy, so they should usually be filtered out of lists of alive * enemies. */ export declare function isRaglingDeathPatch(npc: EntityNPC): boolean; /** * Helper function to test if the provided pickup matches one of the various red heart sub-types. */ export declare function isRedHeart(pickup: EntityPickup): boolean; /** * Helper function to test if the provided heart sub-type matches one of the various red heart * sub-types. */ export declare function isRedHeartSubType(heartSubType: HeartSubType): boolean; /** * Helper function to detect if the provided room was created by the Red Key item. * * Under the hood, this checks for the `RoomDescriptorFlag.FLAG_RED_ROOM` flag. * * @param roomGridIndex Optional. Default is the current room index. */ export declare function isRedKeyRoom(roomGridIndex: int): boolean; /** * Helper function to see if the current render callback is rendering a water reflection. * * When the player is in a room with water, things will be rendered twice: once for the normal * rendering, and once for the reflecting rendering. Thus, any mod code in a render callback will * run twice per frame in these situations, which may be unexpected or cause bugs. * * This function is typically used to early return from a render function if it returns true. */ export declare function isReflectionRender(): boolean; /** * Helper function to check if the player has the Repentance DLC installed. * * This function should always be used over the `REPENTANCE` constant, since the latter is not safe. * * Specifically, this function checks for the `Sprite.GetAnimation` method: * https://bindingofisaacrebirth.fandom.com/wiki/V1.06.J818#Lua_Changes */ export declare function isRepentance(): boolean; /** * Helper function to check if a boss is only found on a Repentance floor such as Dross, Mines, and * so on. * * For example, The Pile is a boss that was added in Repentance, but since it can appear in * Necropolis, it is not considered a Repentance boss for the purposes of this function. */ export declare function isRepentanceBoss(bossID: BossID): boolean; /** * Helper function to check if the provided door leads to the "secret exit" off-grid room that takes * you to the Repentance floor. */ export declare function isRepentanceDoor(door: GridEntityDoor): boolean; /** * Helper function to check if the player has the Repentance+ DLC installed. * * This function should always be used over the `REPENTANCE_PLUS` constant, since the latter is not * safe. * * Specifically, this function checks for `Room:DamageGridWithSource` method: * https://bindingofisaacrebirth.wiki.gg/wiki/The_Binding_of_Isaac:_Repentance%2B#Modding_Changes */ export declare function isRepentancePlus(): boolean; /** * Helper function to check if the provided stage type is equal to `StageType.REPENTANCE` or * `StageType.REPENTANCE_B`. */ export declare function isRepentanceStage(stageType: StageType): boolean; /** * Helper function to check if the player is using REPENTOGON, an exe-hack which expands the modding * API. * * Although REPENTOGON has a `REPENTOGON` global to check if it's present, it is not safe to use as * it can be overwritten by other mods. * * Specifically, this function checks for the `Sprite.Continue` method: * https://repentogon.com/Sprite.html#continue */ export declare function isRepentogon(): boolean; /** Returns true for card types that have `ItemConfigCardType.TAROT_REVERSE`. */ export declare function isReverseTarotCard(cardType: CardType): boolean; /** Helper function to check if something is an instantiated `RNG` object. */ export declare function isRNG(object: unknown): object is RNG; /** Helper function to detect if a variable is of type `GridEntityRock`. */ export declare function isRock(variable: unknown): variable is GridEntityRock; /** * Helper function to determine if a given room grid index is inside of the normal 13x13 level grid. * * For example, Devil Rooms and the Mega Satan room are not considered to be inside the grid. * * @param roomGridIndex Optional. Default is the current room index. */ export declare function isRoomInsideGrid(roomGridIndex?: int): boolean; /** * Helper function to check if the provided room matches one of the given room shapes. * * This function is variadic, which means you can pass as many room shapes as you want to match for. */ export declare function isRoomShape(roomData: RoomConfig, ...roomShapes: readonly RoomShape[]): boolean; /** * 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 true. */ export declare function isRoomShapeDoubleCharge(roomShape: RoomShape): boolean; /** * Helper function to check if the provided room matches one of the given room types. * * This function is variadic, which means you can pass as many room types as you want to match for. */ export declare function isRoomType(roomData: RoomConfig, ...roomTypes: readonly RoomType[]): boolean; /** * Helper function to check if a given room is visible on the minimap. * * @param roomGridIndexOrRoomDescriptor The room to check. * @param minimapAPI Optional. Whether MinimapAPI should be used, if present. Default is true. */ export declare function isRoomVisible(roomGridIndexOrRoomDescriptor: int | RoomDescriptor, minimapAPI?: boolean): boolean; /** Returns true for card types that have `ItemConfigCardType.RUNE`. */ export declare function isRune(cardType: CardType): boolean; /** For `PickupVariant.SACK` (69). */ export declare function isSack(pickup: EntityPickup): pickup is EntityPickupSack; /** * Helper function for checking if the provided room is a secret exit that leads to a Repentance * floor. */ export declare function isSecretExit(roomGridIndex: int): boolean; /** * This refers to the hole in the wall that appears after bombing the entrance to a secret room. * Note that the door still exists before it has been bombed open. It has a sprite filename of * "gfx/grid/door_08_holeinwall.anm2". * * Note that since Ultra Secret Rooms do not use holes, this function will not detect an Ultra * Secret Room door. */ export declare function isSecretRoomDoor(door: GridEntityDoor): boolean; /** * Helper function to detect if a room type is a Secret Room, a Super Secret Room, or an Ultra * Secret Room. */ export declare function isSecretRoomType(roomType: RoomType): boolean; /** * Helper function for checking if the provided room is a secret shop (from the Member Card * collectible). * * Secret shops are simply copies of normal shops, but with the backdrop of a secret room. In other * words, they will have the same room type, room variant, and room sub-type of a normal shop. Thus, * the only way to detect them is by using the grid index. */ export declare function isSecretShop(roomGridIndex: int): boolean; /** * Helper function to determine whether damage to a player in the `ENTITY_TAKE_DMG` callback was * self-inflicted. For example, damage from a Curse Room door, a Razor, or a Blood Donation Machine * would count as self-inflicted damage. */ export declare function isSelfDamage(damageFlags: DamageFlag | BitFlags): boolean; /** * Used to determine is the given table is a serialized `BitSet128` object created by the `deepCopy` * function. */ export declare function isSerializedBitSet128(object: unknown): object is SerializedBitSet128; /** * Used to determine is the given table is a serialized `Color` object created by the `deepCopy` * function. */ export declare function isSerializedColor(object: unknown): object is SerializedColor; /** * Helper function to generically check if a given Lua table is a serialized Isaac API class. (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 isSerializedIsaacAPIClass(object: unknown): object is SerializedIsaacAPIClass; /** * Used to determine is the given table is a serialized `KColor` object created by the `deepCopy` * function. */ export declare function isSerializedKColor(object: unknown): object is SerializedKColor; /** * Used to determine is the given table is a serialized `RNG` object created by the `deepCopy` * function. */ export declare function isSerializedRNG(object: unknown): object is SerializedRNG; /** * Used to determine is the given table is a serialized `Vector` object created by the `deepCopy` * function. */ export declare function isSerializedVector(object: unknown): object is SerializedVector; export declare function isShootAction(buttonAction: ButtonAction): boolean; export declare function isShootActionPressed(controllerIndex: ControllerIndex): boolean; export declare function isShootActionPressedOnAnyInput(): boolean; export declare function isShootActionTriggered(controllerIndex: ControllerIndex): boolean; export declare function isShootActionTriggeredOnAnyInput(): boolean; /** Helper function to check if the provided NPC is a Sin miniboss, such as Sloth or Lust. */ export declare function isSin(npc: EntityNPC): boolean; /** * Helper function to determine if a particular collectible will disappear from the player's * inventory upon use. Note that this will not work will modded collectibles, as there is no way to * dynamically know if a modded collectible will disappear. */ export declare function isSingleUseCollectible(collectibleType: CollectibleType): boolean; /** For `EntityType.SLOT` (6). */ export declare function isSlot(entity: Entity): entity is EntitySlot; /** Returns true for the specific variants of `EntityType.SLOT` that are machines. */ export declare function isSlotMachine(entity: Entity): boolean; /** Returns true for card types that have `ItemConfigCardType.SPECIAL`. */ export declare function isSpecialCard(cardType: CardType): boolean; /** Helper function to detect if a variable is of type `GridEntitySpikes`. */ export declare function isSpikes(variable: unknown): variable is GridEntitySpikes; /** * Helper function to check if the provided effective stage is one that has the possibility to grant * a natural Devil Room or Angel Room after killing the boss. * * Note that in order for this function to work properly, you must provide it with the effective * stage (e.g. from the `getEffectiveStage` helper function) and not the absolute stage (e.g. from * the `Level.GetStage` method). */ export declare function isStageWithNaturalDevilRoom(effectiveStage: LevelStage): boolean; /** * Helper function to check if the provided stage is one that will have a random collectible drop * upon defeating the boss of the floor. * * This happens on most stages but will not happen on Depths 2, Womb 2, Sheol, Cathedral, Dark Room, * The Chest, and Home (due to the presence of a story boss). * * Note that even though Delirium does not drop a random boss collectible, The Void is still * considered to be a stage that has a random boss collectible since all of the non-Delirium Boss * Rooms will drop random boss collectibles. */ export declare function isStageWithRandomBossCollectible(stage: LevelStage): boolean; /** * Helper function to check if the provided stage will spawn a locked door to Downpour/Dross after * defeating the boss. */ export declare function isStageWithSecretExitToDownpour(stage: LevelStage): boolean; /** * Helper function to check if the provided stage and stage type will spawn a spiked door to * Mausoleum/Gehenna after defeating the boss. */ export declare function isStageWithSecretExitToMausoleum(stage: LevelStage, stageType: StageType): boolean; /** * Helper function to check if the provided stage and stage type will spawn a wooden door to * Mines/Ashpit after defeating the boss. */ export declare function isStageWithSecretExitToMines(stage: LevelStage, stageType: StageType): boolean; /** * Helper function to check if the current stage is one that would create a trapdoor if We Need to * Go Deeper was used. */ export declare function isStageWithShovelTrapdoors(stage: LevelStage, stageType: StageType): boolean; /** * Helper function to check if the provided stage is one with a story boss. Specifically, this is * Depths 2 (Mom), Womb 2 (Mom's Heart / It Lives), Blue Womb (Hush), Sheol (Satan), Cathedral * (Isaac), Dark Room (Lamb), The Chest (Blue Baby), The Void (Delirium), and Home (Dogma / The * Beast). */ export declare function isStageWithStoryBoss(stage: LevelStage): boolean; /** * Helper function to determine if the specified entity type is an end-game story boss, like Isaac, * Blue Baby, Mega Satan, The Beast, and so on. This is useful because certain effects should only * apply to non-story bosses, like Vanishing Twin. */ export declare function isStoryBoss(entityType: EntityType): boolean; /** * Helper function to determine if the specified boss ID is an end-game story boss, like Isaac, Blue * Baby, Mega Satan, The Beast, and so on. This is useful because certain effects should only apply * to non-story bosses, like Vanishing Twin. */ export declare function isStoryBossID(bossID: BossID): bossID is StoryBossID; export declare function isString(variable: unknown): variable is string; /** Returns true for card types that have `ItemConfigCardType.SUIT`. */ export declare function isSuitCard(cardType: CardType): boolean; export declare function isTable(variable: unknown): variable is LuaMap; /** Helper function to check if a Lua table has 0 keys. */ export declare function isTableEmpty(luaMap: LuaMap): boolean; /** Helper function for detecting if a player is one of the Tainted characters. */ export declare function isTainted(player: EntityPlayer): boolean; /** Helper function for detecting when a player is Tainted Lazarus or Dead Tainted Lazarus. */ export declare function isTaintedLazarus(player: EntityPlayer): boolean; /** Returns true for card types that have `ItemConfigCardType.TAROT`. */ export declare function isTarotCard(cardType: CardType): boolean; /** Helper function to detect if a variable is of type `EntityTear`. */ export declare function isTear(variable: unknown): variable is EntityTear; /** * Helper function to check if a given tear is from a familiar (as opposed to e.g. a player). This * is determined by looking at the parent. * * For the special case of Incubus and Blood Babies, the parent of the tear is always the player, * but the spawner entity of the tear changes. On frame 0, the spawner entity is equal to the * player, and on frame 1, the spawner entity is equal to the familiar. For this reason, you can * only use this function in the `POST_TEAR_INIT_VERY_LATE` callback or on frame 1+. * * If this function is called on frame 0, it will throw a run-time error. * * Note that this function does not work properly when the tear is from a Lead Pencil barrage. In * this case, it will always appear as if the tear is coming from a player. * * @param tear The tear to inspect. * @param familiarVariant Optional. Specify this to check if the tear came from a specific familiar * variant. Default is undefined, which checks for any familiar. * @param subType Optional. Specify this to check if the tear came from a specific familiar * sub-type. Default is undefined, which checks for any familiar. */ export declare function isTearFromFamiliar(tear: EntityTear, familiarVariant?: FamiliarVariant, subType?: int): boolean; /** * Helper function to check if a given tear is from a player (as opposed to e.g. a familiar). This * is determined by looking at the `SpawnerEntity`. * * For the special case of Incubus and Blood Babies, the `SpawnerEntity` of the tear is always the * player, but the spawner entity of the tear changes. On frame 0, the spawner entity is equal to * the player, and on frame 1, the spawner entity is equal to the familiar. For this reason, you can * only use this function in the `POST_TEAR_INIT_VERY_LATE` callback or on frame 1+. * * If this function is called on frame 0, it will throw a run-time error. * * Note that this function does not work properly when the tear is from a Lead Pencil barrage. In * this case, it will always appear as if the tear is coming from a player. */ export declare function isTearFromPlayer(tear: EntityTear): boolean; /** Helper function to detect if a variable is of type `GridEntityTNT`. */ export declare function isTNT(variable: unknown): variable is GridEntityTNT; export declare function isTransformationFlying(playerForm: PlayerForm): boolean; /** For `PickupVariant.TRINKET` (350). */ export declare function isTrinket(pickup: EntityPickup): pickup is EntityPickupTrinket; /** Helper function to check if a given table is a class table created by TypeScriptToLua. */ export declare function isTSTLClass(object: unknown): object is TSTLClass; /** * Helper function to determine if a given object is a TypeScriptToLua `Map`. * * It is not reliable to use the `instanceof` operator to determine this because each Lua module * might have their own copy of the entire lualib and thus their own instantiated version of a * `Map`. */ export declare function isTSTLMap(object: unknown): object is Map; /** * Helper function to determine if a given object is a TypeScriptToLua `Set`. * * It is not reliable to use the `instanceof` operator to determine this because each Lua module * might have their own copy of the entire lualib and thus their own instantiated version of a * `Set`. */ export declare function isTSTLSet(object: unknown): object is Set; export declare function isUserdata(variable: unknown): variable is LuaUserdata; export declare function isValidCardType(cardType: int): cardType is CardType; export declare function isValidCollectibleType(collectibleType: int): collectibleType is CollectibleType; /** * Test if a grid position is actually in the given `RoomShape`. * * In this context, the grid position of the top-left wall is "Vector(-1, -1)". */ export declare function isValidGridPosition(gridPosition: Vector, roomShape: RoomShape): boolean; export declare function isValidPillEffect(pillEffect: int): pillEffect is PillEffect; export declare function isValidTrinketType(trinketType: int): trinketType is TrinketType; export declare function isVanillaCardType(cardType: CardType): boolean; export declare function isVanillaCharacter(character: PlayerType): boolean; export declare function isVanillaCollectibleType(collectibleType: CollectibleType): boolean; /** * Helper function to see if a particular command is a vanilla console command. This is useful * because the `EXECUTE_CMD` callback will not fire for any vanilla commands. */ export declare function isVanillaConsoleCommand(commandName: string): boolean; export declare function isVanillaPillEffect(pillEffect: PillEffect): boolean; export declare function isVanillaPlayer(player: EntityPlayer): boolean; export declare function isVanillaTrinketType(trinketType: TrinketType): boolean; /** * Helper function to determine if a given grid index should have a wall generated by the vanilla * game. This is useful as a mechanism to distinguish between real walls and custom walls spawned by * mods. * * This function properly handles the special cases of the Mother boss room and the Home closet * rooms, which are both non-standard room shapes. */ export declare function isVanillaWallGridIndex(gridIndex: int): boolean; /** Helper function to check if something is an instantiated `Vector` object. */ export declare function isVector(object: unknown): object is Vector; /** * Helper function to check if the provided door is the one 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.) */ export declare function isVoidDoor(door: GridEntityDoor): boolean; /** * A cached version of the class returned from the `Isaac.GetItemConfig()` 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 itemConfig: ItemConfig; declare class ItemPickupDetection extends Feature { v: { run: { playersPickingUpItemMap: DefaultMap; }; }; private readonly postItemPickup; private readonly preItemPickup; constructor(postItemPickup: PostItemPickup, preItemPickup: PreItemPickup); private readonly postPEffectUpdateReordered; private queueEmpty; private queueNotEmpty; } declare class ItemPoolDetection extends Feature { private readonly moddedElementSets; /** * Helper function to get the remaining collectibles in a given item pool. This function is * expensive, so only use it in situations where the lag is acceptable. * * In order to use this function, you must upgrade your mod with `ISCFeature.ITEM_POOL_DETECTION`. * * @public */ getCollectiblesInItemPool(itemPoolType: ItemPoolType): readonly CollectibleType[]; /** * Helper function to see if the given collectible is still present in the given item pool. * * If the collectible is non-offensive, any Tainted Losts will be temporarily changed to Isaac and * then changed back. (This is because Tainted Lost is not able to retrieve non-offensive * collectibles from item pools). * * Under the hood, this function works by using the `ItemPool.AddRoomBlacklist` method to * blacklist every collectible except for the one provided. * * In order to use this function, you must upgrade your mod with `ISCFeature.ITEM_POOL_DETECTION`. * * @public */ isCollectibleInItemPool(collectibleType: CollectibleType, itemPoolType: ItemPoolType): boolean; /** * Helper function to see if the given collectible is unlocked on the current save file. This * requires providing the corresponding item pool that the collectible is normally located in. * * - If any player currently has the collectible, then it is assumed to be unlocked. (This is * because in almost all cases, when a collectible is added to a player's inventory, it is * subsequently removed from all pools.) * - If the collectible is located in more than one item pool, then any item pool can be provided. * - If the collectible is not located in any item pools, then this function will always return * false. * - If the collectible is non-offensive, any Tainted Losts will be temporarily changed to Isaac * and then changed back. (This is because Tainted Lost is not able to retrieve non-offensive * collectibles from item pools). * * In order to use this function, you must upgrade your mod with `ISCFeature.ITEM_POOL_DETECTION`. * * @public */ isCollectibleUnlocked(collectibleType: CollectibleType, itemPoolType: ItemPoolType): boolean; } /** * Helper function to iterate over a table deterministically. This is useful because by default, the * `pairs` function will return the keys of a Lua table in a random order. * * This function will sort the table entries based on the value of the key. * * This function will only work on tables that have number keys or string keys. It will throw a * run-time error if it encounters a key of another type. * * @param luaMap The table to iterate over. * @param func The function to run for each iteration. * @param inOrder Optional. Whether to iterate in order. True by default. You can dynamically set to * false in situations where iterating randomly would not matter and you need the * extra performance. */ export declare function iterateTableInOrder(luaMap: LuaMap, func: (key: K, value: V) => void, inOrder?: boolean): void; /** * Helper function for non-TypeScript users to convert an array to a string with the specified * separator. * * Internally, this just calls `Array.join`. */ export declare function join(array: readonly unknown[], separator: string): string; /** * Converts a JSON string to a Lua table. * * In most cases, this function will be used for reading data from a "save#.dat" file. If decoding * fails, it will return undefined instead of throwing an error. (This allows execution to continue * in cases where users have no current save data or have manually removed their existing save * data.) * * Under the hood, this uses a custom JSON parser that was measured to be 11.8 times faster than the * vanilla JSON parser. */ export declare function jsonDecode(jsonString: string): LuaMap | undefined; /** Part of `JSONRoomsFile`. */ export declare interface JSONDoor { $: { /** Equal to "True" or "False". Needs to be converted to an `boolean`. */ exists: string; /** Needs to be converted to an `int`. */ x: string; /** Needs to be converted to an `int`. */ y: string; }; } /** * Converts a Lua table to a JSON string. * * In most cases, this function will be used for writing data to a "save#.dat" file. If encoding * fails, it will throw an error to prevent writing a blank string or corrupted data to a user's * "save#.dat" file. * * Under the hood, this uses a custom JSON parser that was measured to be 11.8 times faster than the * vanilla JSON parser. */ export declare function jsonEncode(luaTable: unknown): string; /** Part of `JSONRoomsFile`. */ export declare interface JSONEntity { $: { /** Needs to be converted to an `int`. */ type: string; /** Needs to be converted to an `int`. */ variant: string; /** Needs to be converted to an `int`. */ subtype: string; /** Needs to be converted to a `float`. */ weight: string; }; } /** Part of `JSONRoomsFile`. */ export declare interface JSONRoom { $: { /** Needs to be converted to an `int`. */ difficulty: string; /** Needs to be converted to an `int`. */ height: string; name: string; /** Needs to be converted to an `int`. */ shape: string; /** Needs to be converted to an `int`. */ subtype: string; /** Needs to be converted to an `int`. */ type: string; /** Needs to be converted to an `int`. */ variant: string; /** Needs to be converted to a `float`. */ weight: string; /** Needs to be converted to an `int`. */ width: string; }; door: JSONDoor[]; spawn: JSONSpawn[]; } /** Part of `JSONRoomsFile`. */ export declare interface JSONRooms { room: JSONRoom[]; } /** * The standard library has the feature to deploy a new room on-the-fly with the `deployJSONRoom` * helper function. It requires a `JSONRoomsFile` as an argument, which is simply an XML file * converted to JSON. (You can create XML room files using the Basement Renovator program.) * * You can convert your XML files using the following command: * * ```sh * npx convert-xml-to-json foo.xml foo.json * ``` * * Note that the custom stages feature of the standard library uses real XML/STB files, not JSON * rooms, so you would only need to do this if you are using the `deployJSONRoom` command * specifically. */ export declare interface JSONRoomsFile { rooms: JSONRooms; } /** Part of `JSONRoomsFile`. */ export declare interface JSONSpawn { $: { /** Needs to be converted to an `int`. */ x: string; /** Needs to be converted to an `int`. */ y: string; }; entity: JSONEntity[]; } /** * 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 K_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 Transparent: Readonly; readonly Brown: Readonly; readonly Gray: Readonly; readonly Orange: Readonly; readonly Purple: Readonly; }; /** * Equal to `KColor(1, 1, 1, 1)`. * * If you need to mutate this, make a copy first with the `copyKColor` helper function. */ export declare const KColorDefault: Readonly; export declare function kColorEquals(kColor1: KColor, kColor2: KColor): boolean; /** * Helper function to get the string that would be typed if someone pressed the corresponding key. * This is useful for creating in-game chat. * * Note that this function will only work for the keyboard values that are printable. Thus, it will * return undefined for e.g. `Keyboard.LEFT_SHIFT` (340). If all you want is the corresponding name * of the key, then simply use the enum reverse mapping (e.g. `Keyboard[keyboard]`). */ export declare function keyboardToString(keyboard: Keyboard, uppercase: boolean): string | undefined; /** * For `EntityType.EFFECT` (1000), `EffectVariant.LADDER` (8). * * Note that vanilla ladders only use a sub-type of 0. The `isaacscript-common` library uses ladders * to represent custom objects, since they are non-interacting and will not automatically despawn * after time passes, unlike most other effects. * * This enum tracks the kinds of custom objects that are represented by vanilla ladders. We start * assigning sub-types after 100 as to not interfere with any possible modded ladder variants. */ export declare enum LadderSubTypeCustom { LADDER = 0, CUSTOM_BACKDROP = 101, CUSTOM_SHADOW = 102, CUSTOM_PICKUP = 103 } /** * Equal to `PillColor.HORSE_WHITE_YELLOW` (2061). * * Note that `PillColor.HORSE_GOLD` is technically higher, but that is not considered for the * purposes of this constant. */ export declare const LAST_HORSE_PILL_COLOR = PillColor.HORSE_WHITE_YELLOW; /** * Equal to `PillColor.WHITE_YELLOW` (13). * * Note that `PillColor.GOLD` is technically higher, but that is not considered for the purposes of * this constant. */ export declare const LAST_NORMAL_PILL_COLOR = PillColor.WHITE_YELLOW; /** Calculated from the `CardType` enum. */ export declare const LAST_VANILLA_CARD_TYPE: CardType; /** Calculated from the `PlayerType` enum. */ export declare const LAST_VANILLA_CHARACTER: PlayerType; /** * Calculated from the `CollectibleType` enum. * * Note that this cannot be calculated from the length of the enum, because collectible types are * not contiguous. */ export declare const LAST_VANILLA_COLLECTIBLE_TYPE: CollectibleType; /** Calculated from the `PillEffect` enum. */ export declare const LAST_VANILLA_PILL_EFFECT: PillEffect; /** * Calculated from the `TrinketType` enum. * * Note that this cannot be calculated from the length of the enum, because trinket types are not * contiguous. */ export declare const LAST_VANILLA_TRINKET_TYPE: TrinketType; declare type Length = T extends { length: infer L; } ? L : never; export declare function lerp(a: number, b: number, pos: float): number; export declare function lerpAngleDegrees(aStart: number, aEnd: number, percent: float): number; /** * The floor is represented by a 13x13 grid. Room indexes start at 0. The first column is * represented by grid indexes 0, 13, 26, and so on. */ export declare const LEVEL_GRID_COLUMN_HEIGHT = 13; /** * The floor is represented by a 13x13 grid. Room indexes start at 0. The first row is represented * by grid indexes from 0 to 12. The second row is represented by grid indexes from 13 to 25, and so * on. */ export declare const LEVEL_GRID_ROW_WIDTH = 13; /** * Helper function to check if the current floor has a Boss Room that matches the boss ID provided. * * This function is variadic, meaning that you can pass as many boss IDs as you want to check for. * It will return true if one or more of the boss IDs are matched. */ export declare function levelHasBossID(...bossIDs: readonly BossID[]): boolean; /** * Helper function to check to see if the current floor has one or more of a specific room type in * it. * * This function is variadic, meaning that you can pass as many room types as you want to check for. * This function will return true if any of the room types are found. */ export declare function levelHasRoomType(...roomTypes: readonly RoomType[]): boolean; /** * Helper function to reset an unlocked door back to a locked state. Doing this is non-trivial * because in addition to calling the `GridEntityDoor.SetLocked` method, you must also: * * - Set the `VisitedCount` of the room's `RoomDescription` to 0. * - Set the variant to `DoorVariant.DOOR_LOCKED`. * - Close the door. */ export declare function lockDoor(door: GridEntityDoor): void; /** * Helper function to avoid typing out `Isaac.DebugString()`. * * If you have the "--luadebug" launch flag turned on, then this function will also prepend the * function name and the line number before the string, like this: * * ```text * [INFO] - Lua Debug: saveToDisk:42494 - The save data manager wrote data to the "save#.dat" file. * ``` * * Subsequently, it is recommended that you turn on the "--luadebug" launch flag when developing * your mod so that debugging becomes a little bit easier. * * @param msg The message to log. * @param includeParentFunction Optional. Whether to prefix the message with the function name and * line number, as shown in the above example. Default is true. */ export declare function log(this: void, msg: string | number, includeParentFunction?: boolean): void; /** Helper function for printing out every entity (or filtered entity) in the current room. */ export declare function logAllEntities(this: void, includeBackgroundEffects: boolean, entityTypeFilter?: EntityType): void; /** * Helper function for printing out every grid entity (or filtered grid entity) in the current room. * * @param includeWalls Optional. Whether oto log the walls. Default is false. * @param gridEntityTypeFilter Optional. If specified, will only log the given `GridEntityType`. * Default is undefined. */ export declare function logAllGridEntities(this: void, includeWalls?: boolean, gridEntityTypeFilter?: GridEntityType): void; /** * Helper function to log a message to the "log.txt" file and to print it to the screen at the same * time. */ export declare function logAndPrint(msg: string): void; /** * Helper function to log all of the values in an array. * * @param array The array to log. * @param name Optional. The name of the array, which will be logged before the elements. */ export declare function logArray(this: void, array: readonly unknown[], name?: string): void; /** * Helper function to log the names of a collectible type array. * * @param collectibleTypes The collectible types to log. * @param name Optional. The name of the array, which will be logged before the elements. */ export declare function logCollectibleTypes(this: void, collectibleTypes: readonly CollectibleType[], name?: string): void; /** * Helper function to log a `Color` object. * * @param color The `Color` object to log. * @param name Optional. The name of the object, which will be logged before the properties. */ export declare function logColor(this: void, color: Color, name?: string): void; /** Helper function to log every damage flag that is turned on. Useful when debugging. */ export declare function logDamageFlags(this: void, damageFlags: DamageFlag | BitFlags): void; /** Helper function to log every display flag that is turned on. Useful when debugging. */ export declare function logDisplayFlags(this: void, displayFlags: DisplayFlag | BitFlags): void; /** Helper function for logging an array of specific entities. */ export declare function logEntities(this: void, entities: readonly Entity[]): void; /** Helper function to log information about a specific entity. */ export declare function logEntity(this: void, entity: Entity): void; /** Helper function to log every entity flag that is turned on. Useful when debugging. */ export declare function logEntityFlags(this: void, entityFlags: EntityFlag | BitFlags): void; export declare function logEntityID(this: void, entity: Entity): void; /** * Helper function to log an error message and also print it to the console for better visibility. * * This is useful in situations where using the `error` function would be dangerous (since it * prevents all of the subsequent code in the callback from running). */ export declare function logError(this: void, msg: string): void; /** Helper function for logging every flag that is turned on. Useful when debugging. */ export declare function logFlags(this: void, flags: T | BitFlags, flagEnum: ReadonlyRecord, description?: string): void; /** Helper function for logging every game state flag that is turned on. Useful when debugging. */ export declare function logGameStateFlags(this: void): void; /** Helper function for logging an array of specific grid entities. */ export declare function logGridEntities(this: void, gridEntities: readonly GridEntity[]): void; /** Helper function for log information about a specific grid entity. */ export declare function logGridEntity(this: void, gridEntity: GridEntity): void; /** * Helper function to log the names of a item pool type array. * * @param itemPoolTypes The item pool types to log. * @param name Optional. The name of the array, which will be logged before the elements. */ export declare function logItemPoolTypes(this: void, itemPoolTypes: readonly ItemPoolType[], name?: string): void; /** * Helper function to log a `KColor` object. * * @param kColor The `KColor` object to log. * @param name Optional. The name of the object, which will be logged before the properties. */ export declare function logKColor(this: void, kColor: KColor, name?: string): void; /** Helper function for logging every level state flag that is turned on. Useful when debugging. */ export declare function logLevelStateFlags(this: void): void; /** * Helper function to log a TSTL `Map`. * * @param map The TSTL `Map` to log. * @param name Optional. The name of the map, which will be logged before the elements. */ export declare function logMap(this: void, map: ReadonlyMap, name?: string): void; export declare function logMusic(this: void): void; /** Helper function to log any added global variables in the Isaac Lua environment. */ export declare function logNewGlobals(): void; export declare function logPlayerEffects(this: void, player: EntityPlayer): void; export declare function logPlayerHealth(this: void, player: EntityPlayer): void; /** Helper function for logging every projectile flag that is turned on. Useful when debugging. */ export declare function logProjectileFlags(this: void, projectileFlags: ProjectileFlag | BitFlags): void; /** * Helper function to log information about the entity that corresponding to a pointer hash. (Only * use this when debugging, since retrieving the corresponding entity is expensive.) */ export declare function logPtrHash(this: void, ptrHash: PtrHash): void; /** * Helper function to log information about the entity that corresponding to one or more pointer * hashes. (Only use this when debugging, since retrieving the corresponding entity is expensive.) */ export declare function logPtrHashes(this: void, ptrHashes: readonly PtrHash[]): void; /** Helper function for logging information about the current room. */ export declare function logRoom(this: void): void; /** * Helper function for logging every seed effect (i.e. Easter Egg) that is turned on for the * particular run. */ export declare function logSeedEffects(this: void): void; /** * Helper function to log a TSTL `Set`. * * @param set The TSTL `Set` to log. * @param name Optional. The name of the set, which will be logged before the elements. */ export declare function logSet(this: void, set: ReadonlySet, name?: string): void; /** Helper function for logging every sound effect that is currently playing. */ export declare function logSounds(this: void): void; /** * Helper function for logging every key and value of a Lua table. This is a deep log; the function * will recursively call itself if it encounters a table within a table. * * This function will only work on tables that have string keys (because it logs the keys in order, * instead of randomly). It will throw a run-time error if it encounters a non-string key. * * In order to prevent infinite recursion, this function will not log a sub-table when there are 10 * or more parent tables. */ export declare function logTable(this: void, luaTable: unknown, parentTables?: number): void; /** * Helper function to log the differences between the entries of two tables. Note that this will * only do a shallow comparison. */ export declare function logTableDifferences(this: void, table1: LuaMap, table2: LuaMap): void; /** * Helper function to log the keys of a Lua table. This is not a deep log; only the keys of the * top-most table will be logged. * * This function is useful for tables that have recursive references. */ export declare function logTableKeys(this: void, luaTable: unknown): void; /** * Helper function to log every table key and value. This is a shallow log; the function will not * recursively traverse sub-tables. * * This function will only work on tables that have string keys (because it logs the keys in order, * instead of randomly). It will throw a run-time error if it encounters a non-string key. */ export declare function logTableShallow(this: void, luaTable: LuaMap): void; /** Helper function for log every tear flag that is turned on. Useful when debugging. */ export declare function logTearFlags(this: void, tearFlags: TearFlag | BitFlags): void; /** Helper function for printing out every use flag that is turned on. Useful when debugging. */ export declare function logUseFlags(this: void, useFlags: UseFlag | BitFlags): void; /** * Helper function to enumerate all of the properties of a "userdata" object (i.e. an object from * the Isaac API). */ export declare function logUserdata(this: void, userdata: unknown): void; /** * Helper function to log a `Vector` object. * * @param vector The `Vector` object to log. * @param name Optional. The name of the object, which will be logged before the properties. * @param round Optional. If true, will round the vector values to the nearest integer. Default is * false. */ export declare function logVector(this: void, vector: Vector, name?: string, round?: boolean): void; /** Helper type to match all of the lowercase keys of an object. */ export declare type LowercaseKeys = StartsWithLowercase; /** * An array containing every character that is selectable from the main menu (and has achievements * related to completing the various bosses and so on). */ export declare const MAIN_CHARACTERS: readonly [PlayerType.ISAAC, PlayerType.MAGDALENE, PlayerType.CAIN, PlayerType.JUDAS, PlayerType.BLUE_BABY, PlayerType.EVE, PlayerType.SAMSON, PlayerType.AZAZEL, PlayerType.LAZARUS, PlayerType.EDEN, PlayerType.LOST, PlayerType.LILITH, PlayerType.KEEPER, PlayerType.APOLLYON, PlayerType.FORGOTTEN, PlayerType.BETHANY, PlayerType.JACOB, PlayerType.ISAAC_B, PlayerType.MAGDALENE_B, PlayerType.CAIN_B, PlayerType.JUDAS_B, PlayerType.BLUE_BABY_B, PlayerType.EVE_B, PlayerType.SAMSON_B, PlayerType.AZAZEL_B, PlayerType.LAZARUS_B, PlayerType.EDEN_B, PlayerType.LOST_B, PlayerType.LILITH_B, PlayerType.KEEPER_B, PlayerType.APOLLYON_B, PlayerType.FORGOTTEN_B, PlayerType.BETHANY_B, PlayerType.JACOB_B]; declare type MainCharacter = (typeof MAIN_CHARACTERS)[number]; /** * Helper function for non-TypeScript users to convert all of the elements in an array to something * else. * * Internally, this just calls `Array.map`. */ export declare function map(array: readonly T[], func: (value: T, index: number, array: readonly T[]) => U): readonly U[]; /** * Helper function to make using maps with an type of `PtrHash` easier. Use this instead of the * `Map.delete` method if you have a set of this type. */ export declare function mapDeleteNPC(map: Map, npc: EntityNPC): boolean; /** * Helper function to make using maps with an type of `PlayerIndex` easier. Use this instead of the * `Map.delete` method if you have a set of this type. */ export declare function mapDeletePlayer(map: Map, player: EntityPlayer): boolean; /** * Helper function to make using maps with an index of `PtrHash` easier. Use this instead of the * `Map.get` method if you have a map of this type. * * For example: * * ```ts * const v = { * run: { * npcsSpeedBoost: new Map(), * }, * }; * * function incrementSpeedBoost(npc: EntityNPC) { * const oldSpeedBoost = mapGetNPC(v.run.npcsSpeedBoost, npc); * const newSpeedBoost = oldSpeedBoost + 0.1; * mapSetNPC(v.run.npcsSpeedBoost, npc); * } * ``` */ export declare function mapGetNPC(map: ReadonlyMap, npc: EntityNPC): V | undefined; /** * Helper function to make using maps with an index of `PlayerIndex` easier. Use this instead of the * `Map.get` method if you have a map of this type. * * For example: * * ```ts * const v = { * run: { * playersSpeedBoost: new Map(), * }, * }; * * function incrementSpeedBoost(player: EntityPlayer) { * const oldSpeedBoost = mapGetPlayer(v.run.playersSpeedBoost, player); * const newSpeedBoost = oldSpeedBoost + 0.1; * mapSetPlayer(v.run.playersSpeedBoost, player); * } * ``` */ export declare function mapGetPlayer(map: ReadonlyMap, player: EntityPlayer): V | undefined; /** * Helper function to make using maps with an index of `PtrHash` easier. Use this instead of the * `Map.has` method if you have a map of this type. */ export declare function mapHasNPC(map: ReadonlyMap, npc: EntityNPC): boolean; /** * Helper function to make using maps with an index of `PlayerIndex` easier. Use this instead of the * `Map.has` method if you have a map of this type. */ export declare function mapHasPlayer(map: ReadonlyMap, player: EntityPlayer): boolean; /** * All of the collectibles that grant vision on the map. * * Note that: * - Spelunker Hat is included. Historically, Spelunker Hat was not considered to be mapping, but it * was buffed in Repentance to show rooms two or more away. * - Book of Secrets is included, which is an "active mapping" instead of passive. * - Luna is included, even though it is not a very powerful mapping item. * - Cracked Orb is included, even though it requires the player to be damaged in order for it to be * activated. */ export declare const MAPPING_COLLECTIBLES: readonly [CollectibleType.COMPASS, CollectibleType.TREASURE_MAP, CollectibleType.SPELUNKER_HAT, CollectibleType.CRYSTAL_BALL, CollectibleType.BLUE_MAP, CollectibleType.BOOK_OF_SECRETS, CollectibleType.MIND, CollectibleType.SOL, CollectibleType.LUNA, CollectibleType.CRACKED_ORB]; /** * Helper function to set a value for a `DefaultMap` that corresponds to an entity, assuming that * the map uses `PtrHash` as an index. */ export declare function mapSetHash(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. * * For example: * * ```ts * const v = { * run: { * npcsSpeedBoost: new Map(), * }, * }; * * function incrementSpeedBoost(npc: EntityNPC) { * const oldSpeedBoost = mapGetNPC(v.run.npcsSpeedBoost, npc); * const newSpeedBoost = oldSpeedBoost + 0.1; * mapSetNPC(v.run.npcsSpeedBoost, npc); * } * ``` */ export declare function mapSetNPC(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. * * For example: * * ```ts * const v = { * run: { * playersSpeedBoost: new Map(), * }, * }; * * function incrementSpeedBoost(player: EntityPlayer) { * const oldSpeedBoost = mapGetPlayer(v.run.playersSpeedBoost, player); * const newSpeedBoost = oldSpeedBoost + 0.1; * mapSetPlayer(v.run.playersSpeedBoost, player); * } * ``` */ export declare function mapSetPlayer(map: Map, player: EntityPlayer, value: V): void; /** * The floor is represented by a 13x13 grid. Room indexes start at 0. The first row is represented * by grid indexes from 0 to 12. The second row is represented by grid indexes from 13 to 25, and so * on. The maximum room index possible is 168. (It is not 169 because we start at 0 instead of 1.) */ export declare const MAX_LEVEL_GRID_INDEX = 168; /** * The game has a limit on the number of currently spawned familiars and will refuse to spawn any * more if it reaches the limit. Blue flies and blue spiders have a lower priority and will be * deleted to make room for other familiars. */ export declare const MAX_NUM_FAMILIARS = 64; /** The game can only handle up to four different players. */ export declare const MAX_NUM_INPUTS = 4; /** With Birthright, it is possible for Magdalene to have 18 heart containers. */ export declare const MAX_PLAYER_HEART_CONTAINERS = 18; /** * As the player continues to move in a direction, they will accelerate. When going from one wall to * another in a 2x2 room at 2.0 speed (the maximum that the speed stat can rise to), the amount of * units moved per update frame will climb to around 9.797 as they hit the opposite wall. The * constant specifies a value of 9.8 to be safe. */ export declare const MAX_PLAYER_SPEED_IN_UNITS = 9.8; export declare const MAX_PLAYER_TRINKET_SLOTS: int; export declare const MAX_QUALITY: Quality; /** * The maximum speed stat that a player can have. Any additional speed beyond this will not take * effect. */ export declare const MAX_SPEED_STAT = 2; /** Corresponds to the maximum value for `EntityPlayer.SamsonBerserkCharge`. */ export declare const MAX_TAINTED_SAMSON_BERSERK_CHARGE = 100000; /** * `merge` takes the values from a new table and recursively merges them into an old object (while * performing appropriate deserialization). * * This function is used to merge incoming data from the "save#.dat" file into a mod's variables. * Merging is useful instead of blowing away a table entirely because mod code often relies on the * local table/object references. * * This function always assumes that the new table is serialized data and will attempt to perform * deserialization on the objects within. In other words, unlike the `deepCopy` function, the * `merge` function will always operates in the mode of `SerializationType.DESERIALIZE`. For the * types of objects that will be deserialized, see the documentation for the `deepCopy` function. * * This function does not iterate over the old object, like you would naively expect. This is * because it is common for a variable to have a type of `something | null`. If this is the case, * the key would not appear when iterating over the old object (because a value of null transpiles * to nil, which means the table key does not exist). Thus, we must instead iterate over the new * object and copy the values backwards. The consequence of this is that `merge` can copy over old * variables that are no longer used in the code, or copy over old variables of a different type, * which can cause run-time errors. In such cases, users will have to manually delete their save * data. * * @param oldObject The old object to merge the values into. This can be either a Lua table, a TSTL * map, or a TSTL set. * @param newTable The new table to merge the values from. This must be a Lua table that represents * serialized data. In other words, it should be created with the `deepCopy` * function using `SerializationType.SERIALIZE`. * @param traversalDescription Used to track the current key that we are operating on for debugging * purposes. Use a name that corresponds to the name of the merging * table. * @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. */ export declare function merge(oldObject: Readonly> | ReadonlyMap | ReadonlySet, newTable: LuaMap, traversalDescription: string, classConstructors?: LuaMap): void; /** If you set `EntityPlayer.ShotSpeed` lower than this value, it will have no effect. */ export declare const MIN_PLAYER_SHOT_SPEED_STAT = 0.6; /** If you set `EntityPlayer.Speed` lower than this value, it will have no effect. */ export declare const MIN_PLAYER_SPEED_STAT = 0.1; export declare const MINUTE_IN_MILLISECONDS: number; export declare const MOD_FEATURE_CALLBACKS_KEY = "__callbacks"; export declare const MOD_FEATURE_CUSTOM_CALLBACKS_KEY = "__customCallbacks"; /** * - The Isaac API offers a lot of callbacks, but a lot of times there isn't one for the specific * thing that you are looking to do. So, `isaacscript-common` adds a bunch of new callbacks that * you can use. * - The extra callbacks are efficient such that no code is executed until there is one or more * subscriptions. * - You must upgrade your mod with the `upgradeMod` helper function before using a custom callback. */ export declare enum ModCallbackCustom { /** * The exact same thing as the vanilla `ENTITY_TAKE_DMG` callback, except this callback allows you * to specify extra arguments for additional filtration. * * When registering the callback with the `ModUpgraded.AddCallbackCustom` method: * - You can provide an optional third argument that will make the callback only fire if it * matches the `EntityType` provided. * - You can provide an optional fourth argument that will make the callback only fire if it * matches the variant provided. * - You can provide an optional fifth argument that will make the callback only fire if it * matches the sub-type provided. * * ```ts * function entityTakeDmgFilter( * entity: Entity, * amount: float, * damageFlags: BitFlags, * source: EntityRef, * countdownFrames: int, * ): boolean | undefined {} * ``` */ ENTITY_TAKE_DMG_FILTER = 0, /** * The exact same thing as the vanilla `ENTITY_TAKE_DMG` callback, except this callback * automatically filters for `EntityType.ENTITY_PLAYER` and casts the `Entity` object to a * `EntityPlayer`. * * - You can provide an optional third argument that will make the callback only fire if it * matches the `PlayerVariant` provided. * - You can provide an optional fourth argument that will make the callback only fire if it * matches the `PlayerType` provided. * * ```ts * function entityTakeDmgPlayer( * player: EntityPlayer, * amount: float, * damageFlags: BitFlags, * source: EntityRef, * countdownFrames: int, * ): boolean | undefined {} * ``` */ ENTITY_TAKE_DMG_PLAYER = 1, /** * The exact same thing as the vanilla `INPUT_ACTION` callback, except this callback allows you to * specify extra arguments for additional filtration. * * When registering the callback with the `ModUpgraded.AddCallbackCustom` method: * - You can provide an optional third argument that will make the callback only fire if it * matches the `InputHook` provided. * - You can provide an optional fourth argument that will make the callback only fire if it * matches the `ButtonAction` provided. * * ```ts * function inputActionFilter( * entity: Entity | undefined, * inputHook: InputHook, * buttonAction: ButtonAction, * ): boolean | undefined {} * ``` */ INPUT_ACTION_FILTER = 2, /** * The exact same thing as the vanilla `INPUT_ACTION` callback, except this callback automatically * filters for `EntityType.ENTITY_PLAYER` and casts the `Entity` object to a `EntityPlayer`. It * also allows you to specify extra arguments for additional filtration. * * - You can provide an optional third argument that will make the callback only fire if it * matches the `PlayerVariant` provided. * - You can provide an optional fourth argument that will make the callback only fire if it * matches the `PlayerType` provided. * - You can provide an optional fifth argument that will make the callback only fire if it * matches the `InputHook` provided. * - You can provide an optional sixth argument that will make the callback only fire if it * matches the `ButtonAction` provided. * * ```ts * function inputActionPlayer( * player: EntityPlayer, * inputHook: InputHook, * buttonAction: ButtonAction, * ): boolean | undefined {} * ``` */ INPUT_ACTION_PLAYER = 3, /** * Fires from the `POST_UPDATE` callback when a Challenge Room or Boss Rush is started. * Specifically, this happens on the first frame that `Room.IsAmbushDone` is true. * * When registering the callback with the `ModUpgraded.AddCallbackCustom` method: * - You can provide an optional third argument that will make the callback only fire if it * matches the `AmbushType` provided. * * ```ts * function postAmbushFinished(ambushType: AmbushType): void {} * ``` */ POST_AMBUSH_FINISHED = 4, /** * Fires from the `POST_UPDATE` callback when a Challenge Room or Boss Rush is completed. * Specifically, this happens on the first frame that `Room.IsAmbushActive` is true. * * When registering the callback with the `ModUpgraded.AddCallbackCustom` method: * - You can provide an optional third argument that will make the callback only fire if it * matches the `AmbushType` provided. * * ```ts * function postAmbushStarted(ambushType: AmbushType): void {} * ``` */ POST_AMBUSH_STARTED = 5, /** * Fires on the `POST_BOMB_UPDATE` callback that it explodes. * * When registering the callback with the `ModUpgraded.AddCallbackCustom` method: * - You can provide an optional third argument that will make the callback only fire if it * matches the `BombVariant` provided. * - You can provide an optional forth argument that will make the callback only fire if it * matches the sub-type provided. * * ```ts * function postBombDetonated(bomb: EntityBomb): void {} * ``` */ POST_BOMB_EXPLODED = 6, /** * The exact same thing as the vanilla `POST_BOMB_INIT` callback, except this callback allows you * to specify extra arguments for additional filtration. * * When registering the callback with the `ModUpgraded.AddCallbackCustom` method: * - You can provide an optional third argument that will make the callback only fire if it * matches the `BombVariant` provided. * - You can provide an optional fourth argument that will make the callback only fire if it * matches the sub-type provided. * * ```ts * function postBombInitFilter(bomb: EntityBomb): void {} * ``` */ POST_BOMB_INIT_FILTER = 7, /** * Fires on the first `POST_BOMB_UPDATE` frame for each bomb. * * This callback is useful because many attributes cannot be set or retrieved properly in the * normal `POST_BOMB_INIT` callback. * * When registering the callback with the `ModUpgraded.AddCallbackCustom` method: * - You can provide an optional third argument that will make the callback only fire if it * matches the `BombVariant` provided. * - You can provide an optional forth argument that will make the callback only fire if it * matches the sub-type provided. * * ```ts * function postBombInitLate(bomb: EntityBomb): void {} * ``` */ POST_BOMB_INIT_LATE = 8, /** * The exact same thing as the vanilla `POST_BOMB_RENDER` callback, except this callback allows * you to specify extra arguments for additional filtration. * * When registering the callback with the `ModUpgraded.AddCallbackCustom` method: * - You can provide an optional third argument that will make the callback only fire if it * matches the `BombVariant` provided. * - You can provide an optional fourth argument that will make the callback only fire if it * matches the sub-type provided. * * ```ts * function postBombRenderFilter(bomb: EntityBomb, renderOffset: Vector): void {} * ``` */ POST_BOMB_RENDER_FILTER = 9, /** * The exact same thing as the vanilla `POST_BOMB_UPDATE` callback, except this callback allows * you to specify extra arguments for additional filtration. * * When registering the callback with the `ModUpgraded.AddCallbackCustom` method: * - You can provide an optional third argument that will make the callback only fire if it * matches the `BombVariant` provided. * - You can provide an optional fourth argument that will make the callback only fire if it * matches the sub-type provided. * * ```ts * function postBombUpdateFilter(bomb: EntityBomb): void {} * ``` */ POST_BOMB_UPDATE_FILTER = 10, /** * Fires from the `POST_RENDER` callback when one of Forgotten's bone clubs is swung or thrown. * * ```ts * function postBoneSwing(boneClub: EntityKnife): void {} * ``` */ POST_BONE_SWING = 11, /** * Fires from the `POST_PICKUP_UPDATE` callback when a collectible goes from a non-zero sub-type * to `CollectibleType.NULL` (i.e. an "empty" pedestal). * * When registering the callback with the `ModUpgraded.AddCallbackCustom` method: * - You can provide an optional third argument that will make the callback only fire if the * pedestal changed from the `CollectibleType` provided. * * ```ts * function postCollectibleEmpty( * collectible: EntityPickupCollectible, * oldCollectibleType: CollectibleType, * ): void {} * ``` */ POST_COLLECTIBLE_EMPTY = 12, /** * Fires from the `POST_PLAYER_RENDER` callback on the first frame that the "TeleportUp" animation * begins playing after a player triggers a Cursed Eye teleport or a Cursed Skull teleport. (Both * of these have the same effect in causing Isaac to be teleported to a random room.) * * When registering the callback with the `ModUpgraded.AddCallbackCustom` method: * - You can provide an optional third argument that will make the callback only fire if it * matches the `PlayerVariant` provided. * - You can provide an optional fourth argument that will make the callback only fire if it * matches the `PlayerType` provided. * * ```ts * function postCursedTeleport(player: EntityPlayer): void {} * ``` */ POST_CURSED_TELEPORT = 13, /** * Fires from the `POST_PLAYER_UPDATE` callback after the player has finished the death animation, * has teleported to the previous room, and is ready to play the animation for the modded revival * item. The `revivalType` will match the value returned from the `PRE_CUSTOM_REVIVE` callback. * * In this callback, you must play an animation with something along the lines of * `player.AnimateCollectible(CollectibleTypeCustom.COLLECTIBLE_MY_REVIVAL_ITEM);`, otherwise the * animation for a 1-Up will play. * * When registering the callback with the `ModUpgraded.AddCallbackCustom` method: * - You can provide an optional third argument that will make the callback only fire if the * revival type matches the one provided. * * ```ts * function postCustomRevive(player: EntityPlayer, revivalType: int): void {} * ``` */ POST_CUSTOM_REVIVE = 14, /** * Fires from the `EFFECT_POST_UPDATE` callback after a player has entered the range of a Dice * Room floor. * * When registering the callback with the `ModUpgraded.AddCallbackCustom` method: * - You can provide an optional third argument that will make the callback only fire if it * matches the `DiceFloorSubType` provided. * * ```ts * function postDiceRoomActivated( * player: EntityPlayer, * diceFloorSubType: DiceFloorSubType, * ): void {} * ``` */ POST_DICE_ROOM_ACTIVATED = 15, /** * Fires from the `POST_RENDER` callback on every frame that a door exists. * * When registering the callback with the `ModUpgraded.AddCallbackCustom` method: * - You can provide an optional third argument that will make the callback only fire if it * matches the variant provided. * * ```ts * function postDoorRender(door: GridEntityDoor): void {} * ``` */ POST_DOOR_RENDER = 16, /** * Fires from the `POST_UPDATE` callback on every frame that a door exists. * * When registering the callback with the `ModUpgraded.AddCallbackCustom` method: * - You can provide an optional third argument that will make the callback only fire if it * matches the variant provided. * * ```ts * function postDoorUpdate(door: GridEntityDoor): void {} * ``` */ POST_DOOR_UPDATE = 17, /** * The exact same thing as the vanilla `POST_EFFECT_INIT` callback, except this callback allows * you to specify extra arguments for additional filtration. * * When registering the callback with the `ModUpgraded.AddCallbackCustom` method: * - You can provide an optional third argument that will make the callback only fire if it * matches the `EffectVariant` provided. * - You can provide an optional fourth argument that will make the callback only fire if it * matches the sub-type provided. * * ```ts * function postEffectInitFilter(effect: EntityEffect): void {} * ``` */ POST_EFFECT_INIT_FILTER = 18, /** * Fires on the first `POST_EFFECT_UPDATE` frame for each effect. * * This callback is useful because many attributes cannot be set or retrieved properly in the * normal `POST_EFFECT_INIT` callback. * * When registering the callback with the `ModUpgraded.AddCallbackCustom` method: * - You can provide an optional third argument that will make the callback only fire if it * matches the `EffectVariant` provided. * - You can provide an optional forth argument that will make the callback only fire if it * matches the sub-type provided. * * ```ts * function postEffectInitLate(effect: EntityEffect): void {} * ``` */ POST_EFFECT_INIT_LATE = 19, /** * The exact same thing as the vanilla `POST_EFFECT_RENDER` callback, except this callback allows * you to specify extra arguments for additional filtration. * * When registering the callback with the `ModUpgraded.AddCallbackCustom` method: * - You can provide an optional third argument that will make the callback only fire if it * matches the `EffectVariant` provided. * - You can provide an optional fourth argument that will make the callback only fire if it * matches the sub-type provided. * * ```ts * function postEffectRenderFilter(effect: EntityEffect, renderOffset: Vector): void {} * ``` */ POST_EFFECT_RENDER_FILTER = 20, /** * Fires from the `POST_EFFECT_UPDATE` callback when an effect's state has changed from what it * was on the previous frame. (In this context, "state" refers to the `EntityEffect.State` field.) * * When registering the callback with the `ModUpgraded.AddCallbackCustom` method: * - You can provide an optional third argument that will make the callback only fire if it * matches the `EffectVariant` provided. * - You can provide an optional forth argument that will make the callback only fire if it * matches the sub-type provided. * * ```ts * function postEffectStateChanged( * effect: EntityEffect, * previousState: int, * currentState: int, * ): void {} * ``` */ POST_EFFECT_STATE_CHANGED = 21, /** * The exact same thing as the vanilla `POST_EFFECT_UPDATE` callback, except this callback allows * you to specify extra arguments for additional filtration. * * When registering the callback with the `ModUpgraded.AddCallbackCustom` method: * - You can provide an optional third argument that will make the callback only fire if it * matches the `EffectVariant` provided. * - You can provide an optional fourth argument that will make the callback only fire if it * matches the sub-type provided. * * ```ts * function postEffectUpdateFilter(effect: EntityEffect): void {} * ``` */ POST_EFFECT_UPDATE_FILTER = 22, /** * The exact same thing as the vanilla `POST_ENTITY_KILL` callback, except this callback allows * you to specify extra arguments for additional filtration. * * When registering the callback with the `ModUpgraded.AddCallbackCustom` method: * - You can provide an optional third argument that will make the callback only fire if it * matches the `EntityType` provided. * - You can provide an optional fourth argument that will make the callback only fire if it * matches the variant provided. * - You can provide an optional fifth argument that will make the callback only fire if it * matches the sub-type provided. * * ```ts * function postEntityKillFilter(entity: Entity): void {} * ``` */ POST_ENTITY_KILL_FILTER = 23, /** * The exact same thing as the vanilla `POST_ENTITY_REMOVE` callback, except this callback allows * you to specify extra arguments for additional filtration. * * When registering the callback with the `ModUpgraded.AddCallbackCustom` method: * - You can provide an optional third argument that will make the callback only fire if it * matches the `EntityType` provided. * - You can provide an optional fourth argument that will make the callback only fire if it * matches the variant provided. * - You can provide an optional fifth argument that will make the callback only fire if it * matches the sub-type provided. * * ```ts * function postEntityRemoveFilter(entity: Entity): void {} * ``` */ POST_ENTITY_REMOVE_FILTER = 24, /** * Fires one `POST_UPDATE` frame after the player has used the Esau Jr. item. (The player is not * updated to the new character until a game frame has passed.) * * ```ts * function postEsauJr(player: EntityPlayer): void {} * ``` */ POST_ESAU_JR = 25, /** * The exact same thing as the vanilla `POST_FAMILIAR_INIT` callback, except this callback allows * you to specify extra arguments for additional filtration. * * When registering the callback with the `ModUpgraded.AddCallbackCustom` method: * - You can provide an optional third argument that will make the callback only fire if it * matches the `FamiliarVariant` provided. * - You can provide an optional fourth argument that will make the callback only fire if it * matches the sub-type provided. * * ```ts * function postFamiliarInitFilter(familiar: EntityFamiliar): void {} * ``` */ POST_FAMILIAR_INIT_FILTER = 26, /** * Fires on the first `FAMILIAR_UPDATE` frame for each familiar. * * This callback is useful because many attributes cannot be set or retrieved properly in the * normal `POST_TEAR_INIT` callback. * * When registering the callback with the `ModUpgraded.AddCallbackCustom` method: * - You can provide an optional third argument that will make the callback only fire if it * matches the `FamiliarVariant` provided. * - You can provide an optional forth argument that will make the callback only fire if it * matches the sub-type provided. * * ```ts * function postFamiliarInitLate(familiar: EntityFamiliar): void {} * ``` */ POST_FAMILIAR_INIT_LATE = 27, /** * The exact same thing as the vanilla `POST_FAMILIAR_RENDER` callback, except this callback * allows you to specify extra arguments for additional filtration. * * When registering the callback with the `ModUpgraded.AddCallbackCustom` method: * - You can provide an optional third argument that will make the callback only fire if it * matches the `FamiliarVariant` provided. * - You can provide an optional fourth argument that will make the callback only fire if it * matches the sub-type provided. * * ```ts * function postFamiliarRenderFilter(familiar: EntityFamiliar, renderOffset: Vector): void {} * ``` */ POST_FAMILIAR_RENDER_FILTER = 28, /** * Fires from the `POST_FAMILIAR_UPDATE` callback when a familiar's state has changed from what it * was on the previous frame. (In this context, "state" refers to the `EntityFamiliar.State` * field.) * * When registering the callback with the `ModUpgraded.AddCallbackCustom` method: * - You can provide an optional third argument that will make the callback only fire if it * matches the `FamiliarVariant` provided. * - You can provide an optional forth argument that will make the callback only fire if it * matches the sub-type provided. * * ```ts * function postFamiliarStateChanged( * familiar: EntityFamiliar, * previousState: int, * currentState: int, * ): void {} * ``` */ POST_FAMILIAR_STATE_CHANGED = 29, /** * The exact same thing as the vanilla `POST_FAMILIAR_UPDATE` callback, except this callback * allows you to specify extra arguments for additional filtration. * * When registering the callback with the `ModUpgraded.AddCallbackCustom` method: * - You can provide an optional third argument that will make the callback only fire if it * matches the `FamiliarVariant` provided. * - You can provide an optional fourth argument that will make the callback only fire if it * matches the sub-type provided. * * ```ts * function postFamiliarUpdateFilter(familiar: EntityFamiliar): void {} * ``` */ POST_FAMILIAR_UPDATE_FILTER = 30, /** * Fires one `POST_UPDATE` frame after the player has first used the Esau Jr. item. (The player is * not updated to the new character until a game frame has passed.) * * This callback is useful because there is no way to get access to the Esau Jr. character entity * before the player has actually used the Esau Jr. item. * * ```ts * function postFirstEsauJr(player: EntityPlayer): void {} * ``` */ POST_FIRST_ESAU_JR = 31, /** * Fires after the player has used the Flip item for the first time. Unlike the vanilla `USE_ITEM` * callback, this callback will return the player object for the new Lazarus (not the one who used * the Flip item). * * This callback is useful because there is no way to get access to the "flipped" character entity * before the player has actually used the Flip item. * * ```ts * function postFirstFlip(newLazarus: EntityPlayer, oldLazarus: EntityPlayer): void {} * ``` */ POST_FIRST_FLIP = 32, /** * Fires after the player has used the Flip item. Unlike the vanilla `USE_ITEM` callback, this * callback will return the player object for the new Lazarus (not the one who used the Flip * item). * * This callback is useful because there is no way to get access to the "flipped" character entity * before the player has actually used the Flip item. * * ```ts * function postFlip(newLazarus: EntityPlayer, oldLazarus: EntityPlayer): void {} * ``` */ POST_FLIP = 33, /** * The exact same thing as the vanilla `POST_GAME_END` callback, except this callback allows you * to specify extra arguments for additional filtration. * * When registering the callback with the `ModUpgraded.AddCallbackCustom` method: * - You can provide an optional third argument that will make the callback only fire if it * matches the `isGameOver` value provided. * * ```ts * function postGameEndFilter(isGameOver: boolean): void {} * ``` */ POST_GAME_END_FILTER = 34, /** * Similar to the vanilla callback of the same name, but fires in the correct order with respect * to the `POST_NEW_LEVEL` and the `POST_NEW_ROOM` callbacks: * * `POST_GAME_STARTED_REORDERED` --> `POST_NEW_LEVEL_REORDERED` --> `POST_NEW_ROOM_REORDERED` * * You must provide a third argument: * * - Pass true if you want the callback to only fire if the run is continued. * - Pass false if you want the callback to only fire when the run is not continued. * - Pass undefined if you want the callback to fire in both situations. * * (The third argument for this callback is mandatory in order to prevent users from shooting * themselves in the foot with respect to logic unexpectedly being executed on continued runs.) * * ```ts * function postGameStartedReordered(isContinued: boolean): void {} * ``` */ POST_GAME_STARTED_REORDERED = 35, /** * Similar to the `POST_GAME_STARTED_REORDERED` callback, but fires after all of the subscribed * callbacks have finished firing. Thus, you can use this callback to do perform things after a * new run has started (or continued), but you can be sure that all new-run-related initialization * has been completed. * * You must provide a third argument: * * - Pass true if you want the callback to only fire if the run is continued. * - Pass false if you want the callback to only fire when the run is not continued. * - Pass undefined if you want the callback to fire in both situations. * * (The third argument for this callback is mandatory in order to prevent users from shooting * themselves in the foot with respect to logic unexpectedly being executed on continued runs.) * * ```ts * function postGameStartedReorderedLast(isContinued: boolean): void {} * ``` */ POST_GAME_STARTED_REORDERED_LAST = 36, /** * Fires from the `POST_UPDATE` callback when the Greed Mode wave increases. * * ```ts * function postGreedModeWave(oldWave: int, newWave: int): void {} * ``` */ POST_GREED_MODE_WAVE = 37, /** * Fires from the `POST_UPDATE` callback when a grid entity changes to a state that corresponds to * the broken state for the respective grid entity type. (For example, this will fire for a * `GridEntityType.ROCK` (2) when its state changes to `RockState.BROKEN` (2).) * * For grid entities created with `spawnCustomGridEntity`, use the * `POST_GRID_ENTITY_CUSTOM_BROKEN` callback instead. * * When registering the callback with the `ModUpgraded.AddCallbackCustom` method: * - You can provide an optional third argument that will make the callback only fire if it * matches the `GridEntityType` provided. * - You can provide an optional fourth argument that will make the callback only fire if it * matches the variant provided. * * ```ts * function postGridEntityBroken(gridEntity: GridEntity): void {} * ``` */ POST_GRID_ENTITY_BROKEN = 38, /** * Fires from the `POST_UPDATE` callback when a new entity collides with a grid entity. (After * this, the callback will not continue to fire. It will only fire again once the entity moves out * of range and then moves back into range.) * * For grid entities created with `spawnCustomGridEntity`, use the * `POST_GRID_ENTITY_CUSTOM_COLLISION` callback instead. * * When registering the callback with the `ModUpgraded.AddCallbackCustom` method: * - You can provide an optional third argument that will make the callback only fire if it * matches the `GridEntityType` provided. * - You can provide an optional fourth argument that will make the callback only fire if it * matches the variant provided (for the grid entity). * - You can provide an optional fifth argument that will make the callback only fire if the * colliding entity matches the `EntityType` provided. * - You can provide an optional sixth argument that will make the callback only fire if the * colliding entity matches the variant provided. * - You can provide an optional seventh argument that will make the callback only fire if the * colliding entity matches the sub-type provided. * * ```ts * function postGridEntityCollision( * gridEntity: GridEntity, * entity: Entity, * ): void {} * ``` */ POST_GRID_ENTITY_COLLISION = 39, /** * The same as the `POST_GRID_ENTITY_BROKEN` callback, but only fires for grid entities created * with the `spawnCustomGridEntity` helper function. * * When registering the callback with the `ModUpgraded.AddCallbackCustom` method: * - You can provide an optional third argument that will make the callback only fire if it * matches the custom `GridEntityType` provided. (Custom grid entities do not have variants, so * there is no need for an optional argument to filter by variant.) * * ```ts * function postGridEntityCustomBroken( * gridEntity: GridEntity, * gridEntityTypeCustom: GridEntityType, * ): void {} * ``` */ POST_GRID_ENTITY_CUSTOM_BROKEN = 40, /** * The same as the `POST_GRID_ENTITY_COLLISION` callback, but only fires for grid entities created * with the `spawnCustomGridEntity` helper function. * * When registering the callback with the `ModUpgraded.AddCallbackCustom` method: * - You can provide an optional third argument that will make the callback only fire if it * matches the custom `GridEntityType` provided. (Custom grid entities do not have variants, so * there is no need for an optional argument to filter by variant.) * - You can provide an optional fourth argument that will make the callback only fire if the * colliding entity matches the `EntityType` provided. * - You can provide an optional fifth argument that will make the callback only fire if the * colliding entity matches the variant provided. * - You can provide an optional sixth argument that will make the callback only fire if the * colliding entity matches the sub-type provided. * * ```ts * function postGridEntityCustomCollision( * gridEntity: GridEntity, * gridEntityTypeCustom: GridEntityType, * entity: Entity, * ): void {} * ``` */ POST_GRID_ENTITY_CUSTOM_COLLISION = 41, /** * The same as the `POST_GRID_ENTITY_INIT` callback, but only fires for grid entities created with * the `spawnCustomGridEntity` helper function. * * When registering the callback with the `ModUpgraded.AddCallbackCustom` method: * - You can provide an optional third argument that will make the callback only fire if it * matches the custom `GridEntityType` provided. (Custom grid entities do not have variants, so * there is no need for an optional argument to filter by variant.) * * ```ts * function postGridEntityCustomInit( * gridEntity: GridEntity, * gridEntityTypeCustom: GridEntityType, * ): void {} * ``` */ POST_GRID_ENTITY_CUSTOM_INIT = 42, /** * The same as the `POST_GRID_ENTITY_REMOVE` callback, but only fires for grid entities created * with the `spawnCustomGridEntity` helper function. * * When registering the callback with the `ModUpgraded.AddCallbackCustom` method: * - You can provide an optional third argument that will make the callback only fire if it * matches the custom `GridEntityType` provided. (Custom grid entities do not have variants, so * there is no need for an optional argument to filter by variant.) * * ```ts * function postGridEntityCustomRemove( * gridIndex: int, * gridEntityTypeCustom: GridEntityType, * ): void {} * ``` */ POST_GRID_ENTITY_CUSTOM_REMOVE = 43, /** * The same as the `POST_GRID_ENTITY_RENDER` callback, but only fires for grid entities created * with the `spawnCustomGridEntity` helper function. * * When registering the callback with the `ModUpgraded.AddCallbackCustom` method: * - You can provide an optional third argument that will make the callback only fire if it * matches the custom `GridEntityType` provided. (Custom grid entities do not have variants, so * there is no need for an optional argument to filter by variant.) * * ```ts * function postGridEntityCustomRender( * gridEntity: GridEntity, * gridEntityTypeCustom: GridEntityType, * ): void {} * ``` */ POST_GRID_ENTITY_CUSTOM_RENDER = 44, /** * The same as the `POST_GRID_ENTITY_STATE_CHANGED` callback, but only fires for grid entities * created with the `spawnCustomGridEntity` helper function. * * When registering the callback with the `ModUpgraded.AddCallbackCustom` method: * - You can provide an optional third argument that will make the callback only fire if it * matches the custom `GridEntityType` provided. (Custom grid entities do not have variants, so * there is no need for an optional argument to filter by variant.) * * ```ts * function postGridEntityCustomStateChanged( * gridEntity: GridEntity, * gridEntityTypeCustom: GridEntityType, * oldState: int, * newState: int, * ): void {} * ``` */ POST_GRID_ENTITY_CUSTOM_STATE_CHANGED = 45, /** * The same as the `POST_GRID_ENTITY_UPDATE` callback, but only fires for grid entities created * with the `spawnCustomGridEntity` helper function. * * When registering the callback with the `ModUpgraded.AddCallbackCustom` method: * - You can provide an optional third argument that will make the callback only fire if it * matches the custom `GridEntityType` provided. (Custom grid entities do not have variants, so * there is no need for an optional argument to filter by variant.) * * ```ts * function postGridEntityCustomUpdate( * gridEntity: GridEntity, * gridEntityTypeCustom: GridEntityType, * ): void {} * ``` */ POST_GRID_ENTITY_CUSTOM_UPDATE = 46, /** * Fires when a new grid entity is initialized. Specifically, this is either: * * - in the `POST_NEW_ROOM_REORDERED` callback (firing every time a room is entered, even if the * entity was previously there on a previous room entry) * - in the `POST_UPDATE` callback (if the entity appeared mid-way through the room, like when the * trapdoor appears after defeating It Lives) * * For grid entities created with `spawnCustomGridEntity`, use the `POST_GRID_ENTITY_CUSTOM_INIT` * callback instead. * * When registering the callback with the `ModUpgraded.AddCallbackCustom` method: * - You can provide an optional third argument that will make the callback only fire if it * matches the `GridEntityType` provided. * - You can provide an optional fourth argument that will make the callback only fire if it * matches the variant provided. * * ```ts * function postGridEntityInit(gridEntity: GridEntity): void {} * ``` */ POST_GRID_ENTITY_INIT = 47, /** * Fires from the `POST_UPDATE` callback when a new grid entity is removed. Specifically, this on * the frame after it no longer exists (where it did exist a frame ago). * * (Leaving a room with a grid entity does not count as "removing" it.) * * This will fire when a Polty/Kineti picks up a grid entity. * * For grid entities created with `spawnCustomGridEntity`, use the * `POST_GRID_ENTITY_CUSTOM_REMOVE` callback instead. * * When registering the callback with the `ModUpgraded.AddCallbackCustom` method: * - You can provide an optional third argument that will make the callback only fire if it * matches the `GridEntityType` provided. * - You can provide an optional fourth argument that will make the callback only fire if it * matches the variant provided. * * ```ts * function postGridEntityRemove( * gridIndex: int, * gridEntityType: GridEntityType, * ): void {} * ``` */ POST_GRID_ENTITY_REMOVE = 48, /** * Fires from the `POST_RENDER` callback on every frame that a grid entity exists. * * For grid entities created with `spawnCustomGridEntity`, use the * `POST_GRID_ENTITY_CUSTOM_RENDER` callback instead. * * When registering the callback with the `ModUpgraded.AddCallbackCustom` method: * - You can provide an optional third argument that will make the callback only fire if it * matches the `GridEntityType` provided. * - You can provide an optional fourth argument that will make the callback only fire if it * matches the variant provided. * * ```ts * function postGridEntityRender(gridEntity: GridEntity): void {} * ``` */ POST_GRID_ENTITY_RENDER = 49, /** * Fires from the `POST_UPDATE` callback when a grid entity changes its state. (In this context, * "state" refers to the `GridEntity.State` field.) * * For grid entities created with `spawnCustomGridEntity`, use the * `POST_GRID_ENTITY_CUSTOM_STATE_CHANGED` callback instead. * * When registering the callback with the `ModUpgraded.AddCallbackCustom` method: * - You can provide an optional third argument that will make the callback only fire if it * matches the `GridEntityType` provided. * - You can provide an optional fourth argument that will make the callback only fire if it * matches the variant provided. * * ```ts * function postGridEntityStateChanged( * gridEntity: GridEntity, * oldState: int, * newState: int, * ): void {} * ``` */ POST_GRID_ENTITY_STATE_CHANGED = 50, /** * Fires from the `POST_UPDATE` callback on every frame that a grid entity exists. * * For grid entities created with `spawnCustomGridEntity`, use the * `POST_GRID_ENTITY_CUSTOM_UPDATE` callback instead. * * When registering the callback with the `ModUpgraded.AddCallbackCustom` method: * - You can provide an optional third argument that will make the callback only fire if it * matches the `GridEntityType` provided. * - You can provide an optional fourth argument that will make the callback only fire if it * matches the variant provided. * * ```ts * function postGridEntityUpdate(gridEntity: GridEntity): void {} * ``` */ POST_GRID_ENTITY_UPDATE = 51, /** * Fires from the `POST_PEFFECT_UPDATE_REORDERED` callback when the player loses a Holy Mantle * temporary collectible effect. * * This callback is useful because you might want to have code that happens when the player is hit * from an enemy. Normally, you would accomplish this via the `ENTITY_TAKE_DMG` callback, but that * callback never fires if the player has a Holy Mantle shield. * * When registering the callback with the `ModUpgraded.AddCallbackCustom` method: * - You can provide an optional third argument that will make the callback only fire if it * matches the `PlayerVariant` provided. * - You can provide an optional fourth argument that will make the callback only fire if it * matches the `PlayerType` provided. * * ```ts * function postPlayerInitReordered( * player: EntityPlayer, * oldNumHolyMantles: int, * newNumHolyMantles: int, * ): void {} * ``` */ POST_HOLY_MANTLE_REMOVED = 52, /** * Fires from `POST_PEFFECT_UPDATE_REORDERED` callback when the player loses charge on their * active collectible item, implying that the item was just used. * * This callback is useful because the `USE_ITEM` callback does not fire when The Candle, Red * Candle, and Bob's Rotten Brain are discharged. * * Note that this callback will not fire if the active item is both discharged and swapped for * another item / discharged on the same frame, like in the case of Alabaster Box. * * When registering the callback with the `ModUpgraded.AddCallbackCustom` method: * - You can provide an optional third argument that will make the callback only fire if it * matches the `CollectibleType` provided. * * ```ts * function postItemDischarge( * player: EntityPlayer, * collectibleType: CollectibleType, * activeSlot: ActiveSlot, * ): void {} * ``` */ POST_ITEM_DISCHARGE = 53, /** * Fires from the `POST_PEFFECT_UPDATE_REORDERED` callback when an item is no longer queued (i.e. * when the animation of the player holding the item above their head is finished and the item is * actually added to the player's inventory). * * Note that this callback will only fire once per Forgotten/Soul pair. * * When registering the callback with the `ModUpgraded.AddCallbackCustom` method: * - You can provide an optional third argument that will make the callback only fire if it * matches the `ItemType` provided. * - You can provide an optional fourth argument that will make the callback only fire if the * sub-type matches the `CollectibleType` or the `TrinketType` provided. * * ```ts * function postItemPickup( * player: EntityPlayer, * pickingUpItem: PickingUpItem, * ): void {} * ``` */ POST_ITEM_PICKUP = 54, /** * Fires on the first `POST_RENDER` frame after a key on the keyboard has been pressed or * released. (In other words, the callback only fires when the "pressed" status is different than * what it was on the previous frame.) * * When registering the callback with the `ModUpgraded.AddCallbackCustom` method: * - You can provide an optional third argument that will make the callback only fire if it * matches the `Keyboard` provided. * - You can provide an optional fourth argument that will make the callback only fire if it * matches the pressed state provided. (`true` for pressed, `false` for released.) * * ```ts * function postKeyboardChanged(keyboard: Keyboard, pressed: boolean): void {} * ``` */ POST_KEYBOARD_CHANGED = 55, /** * The exact same thing as the vanilla `POST_KNIFE_INIT` callback, except this callback allows you * to specify extra arguments for additional filtration. * * When registering the callback with the `ModUpgraded.AddCallbackCustom` method: * - You can provide an optional third argument that will make the callback only fire if it * matches the `KnifeVariant` provided. * - You can provide an optional fourth argument that will make the callback only fire if it * matches the sub-type provided. * * ```ts * function postKnifeInitFilter(knife: EntityKnife): void {} * ``` */ POST_KNIFE_INIT_FILTER = 56, /** * Fires on the first `POST_KNIFE_UPDATE` frame for each knife. * * This callback is useful because many attributes cannot be set or retrieved properly in the * normal `POST_KNIFE_INIT` callback. * * When registering the callback with the `ModUpgraded.AddCallbackCustom` method: * - You can provide an optional third argument that will make the callback only fire if it * matches the `KnifeVariant` provided. * - You can provide an optional forth argument that will make the callback only fire if it * matches the sub-type provided. * * ```ts * function postKnifeInitLate(knife: EntityKnife): void {} * ``` */ POST_KNIFE_INIT_LATE = 57, /** * The exact same thing as the vanilla `POST_KNIFE_RENDER` callback, except this callback allows * you to specify extra arguments for additional filtration. * * When registering the callback with the `ModUpgraded.AddCallbackCustom` method: * - You can provide an optional third argument that will make the callback only fire if it * matches the `KnifeVariant` provided. * - You can provide an optional fourth argument that will make the callback only fire if it * matches the sub-type provided. * * ```ts * function postKnifeRenderFilter(knife: EntityKnife, renderOffset: Vector): void {} * ``` */ POST_KNIFE_RENDER_FILTER = 58, /** * The exact same thing as the vanilla `POST_KNIFE_UPDATE` callback, except this callback allows * you to specify extra arguments for additional filtration. * * When registering the callback with the `ModUpgraded.AddCallbackCustom` method: * - You can provide an optional third argument that will make the callback only fire if it * matches the `KnifeVariant` provided. * - You can provide an optional fourth argument that will make the callback only fire if it * matches the sub-type provided. * * ```ts * function postKnifeUpdateFilter(knife: EntityKnife): void {} * ``` */ POST_KNIFE_UPDATE_FILTER = 59, /** * The exact same thing as the vanilla `POST_LASER_INIT` callback, except this callback allows you * to specify extra arguments for additional filtration. * * When registering the callback with the `ModUpgraded.AddCallbackCustom` method: * - You can provide an optional third argument that will make the callback only fire if it * matches the `LaserVariant` provided. * - You can provide an optional fourth argument that will make the callback only fire if it * matches the sub-type provided. * * ```ts * function postLaserInitFilter(laser: EntityLaser): void {} * ``` */ POST_LASER_INIT_FILTER = 60, /** * Fires on the first `POST_LASER_UPDATE` frame for each laser. * * This callback is useful because many attributes cannot be set or retrieved properly in the * normal `POST_LASER_INIT` callback. * * When registering the callback with the `ModUpgraded.AddCallbackCustom` method: * - You can provide an optional third argument that will make the callback only fire if it * matches the `LaserVariant` provided. * - You can provide an optional forth argument that will make the callback only fire if it * matches the sub-type provided. * * ```ts * function postLaserInitLate(laser: EntityLaser): void {} * ``` */ POST_LASER_INIT_LATE = 61, /** * The exact same thing as the vanilla `POST_LASER_RENDER` callback, except this callback allows * you to specify extra arguments for additional filtration. * * When registering the callback with the `ModUpgraded.AddCallbackCustom` method: * - You can provide an optional third argument that will make the callback only fire if it * matches the `LaserVariant` provided. * - You can provide an optional fourth argument that will make the callback only fire if it * matches the sub-type provided. * * ```ts * function postLaserRenderFilter(laser: EntityLaser, renderOffset: Vector): void {} * ``` */ POST_LASER_RENDER_FILTER = 62, /** * The exact same thing as the vanilla `POST_LASER_UPDATE` callback, except this callback allows * you to specify extra arguments for additional filtration. * * When registering the callback with the `ModUpgraded.AddCallbackCustom` method: * - You can provide an optional third argument that will make the callback only fire if it * matches the `LaserVariant` provided. * - You can provide an optional fourth argument that will make the callback only fire if it * matches the sub-type provided. * * ```ts * function postLaserUpdateFilter(laser: EntityLaser): void {} * ``` */ POST_LASER_UPDATE_FILTER = 63, /** * The same as the vanilla callback of the same name, but fires in the correct order with respect * to the `POST_GAME_STARTED` and the `POST_NEW_ROOM` callbacks: * * `POST_GAME_STARTED_REORDERED` --> `POST_NEW_LEVEL_REORDERED` --> `POST_NEW_ROOM_REORDERED` * * Additionally, this callback will pass the `LevelStage` as the first callback argument and the * `StageType` as the second callback argument. * * Note that similar to the vanilla `POST_NEW_LEVEL` callback, this callback will not fire when a * player resumes a saved run. (In that case, only the `POST_GAME_STARTED_REORDERED` and the * `POST_NEW_ROOM_REORDERED` callbacks will fire, in that order). * * If some specific cases, mods can change the current level during run initialization (on the 0th * frame). However, due to how the callback reordering works, the custom * `POST_NEW_LEVEL_REORDERED` callback will never fire on the 0th frame. To get around this, call * the `forceNewLevelCallback()` function before changing levels to temporarily force the callback * to fire. * * When registering the callback with the `ModUpgraded.AddCallbackCustom` method: * - You can provide an optional third argument that will make the callback only fire if it * matches the `LevelStage` provided. * - You can provide an optional fourth argument that will make the callback only fire if it * matches the `StageType` provided. * * ```ts * function postNewLevelReordered(stage: LevelStage, stageType: StageType): void {} * ``` */ POST_NEW_LEVEL_REORDERED = 64, /** * Fires on the first `POST_NEW_ROOM` or `PRE_ENTITY_SPAWN` callback where being in a new room is * detected. This is useful because the vanilla `POST_NEW_ROOM` callback fires only after entities * in the room have been initialized and updated once, which means that it is possible for * entity-related code to run before room-related-initialization has been performed. * * Additionally, this callback will pass the `RoomType` as the first callback argument. * * When registering the callback with the `ModUpgraded.AddCallbackCustom` method: * - You can provide an optional third argument that will make the callback only fire if it * matches the `RoomType` provided. * * ```ts * function postNewRoomEarly(roomType: RoomType): void {} * ``` */ POST_NEW_ROOM_EARLY = 65, /** * The same as the vanilla callback of the same name, but fires in the correct order with respect * to the `POST_GAME_STARTED` and the `POST_NEW_LEVEL` callbacks: * * `POST_GAME_STARTED_REORDERED` --> `POST_NEW_LEVEL_REORDERED` --> `POST_NEW_ROOM_REORDERED` * * Additionally, this callback will pass the `RoomType` as the first callback argument. * * If some specific cases, mods can change the current room during run initialization (on the 0th * frame). However, due to how the callback reordering works, the custom `POST_NEW_ROOM_REORDERED` * callback will never fire on the 0th frame. To get around this, call the * `forceNewRoomCallback()` function before changing levels to temporarily force the callback to * fire. * * When registering the callback with the `ModUpgraded.AddCallbackCustom` method: * - You can provide an optional third argument that will make the callback only fire if it * matches the `RoomType` provided. * * ```ts * function postNewRoomReordered(roomType: RoomType): void {} * ``` */ POST_NEW_ROOM_REORDERED = 66, /** * The exact same thing as the vanilla `POST_NPC_DEATH` callback, except this callback allows you * to specify extra arguments for additional filtration. * * When registering the callback with the `ModUpgraded.AddCallbackCustom` method: * - You can provide an optional third argument that will make the callback only fire if it * matches the `EntityType` provided. * - You can provide an optional fourth argument that will make the callback only fire if it * matches the variant provided. * - You can provide an optional fifth argument that will make the callback only fire if it * matches the sub-type provided. * * ```ts * function postNPCDeathFilter(npc: EntityNPC): void {} * ``` */ POST_NPC_DEATH_FILTER = 67, /** * The exact same thing as the vanilla `POST_NPC_INIT` callback, except this callback allows you * to specify extra arguments for additional filtration. * * When registering the callback with the `ModUpgraded.AddCallbackCustom` method: * - You can provide an optional third argument that will make the callback only fire if it * matches the `EntityType` provided. * - You can provide an optional fourth argument that will make the callback only fire if it * matches the variant provided. * - You can provide an optional fifth argument that will make the callback only fire if it * matches the sub-type provided. * * ```ts * function postNPCInitFilter(npc: EntityNPC): void {} * ``` */ POST_NPC_INIT_FILTER = 68, /** * Fires on the first `NPC_UPDATE` frame for each NPC. * * This callback is useful because many attributes cannot be set or retrieved properly in the * normal `POST_NPC_INIT` callback. * * When registering the callback with the `ModUpgraded.AddCallbackCustom` method: * - You can provide an optional third argument that will make the callback only fire if it * matches the `EntityType` provided. * - You can provide an optional fourth argument that will make the callback only fire if it * matches the variant provided. * - You can provide an optional fifth argument that will make the callback only fire if it * matches the sub-type provided. * * ```ts * function postNPCInitLate(npc: EntityNPC): void {} * ``` */ POST_NPC_INIT_LATE = 69, /** * The exact same thing as the vanilla `POST_NPC_RENDER` callback, except this callback allows you * to specify extra arguments for additional filtration. * * When registering the callback with the `ModUpgraded.AddCallbackCustom` method: * - You can provide an optional third argument that will make the callback only fire if it * matches the `EntityType` provided. * - You can provide an optional fourth argument that will make the callback only fire if it * matches the variant provided. * - You can provide an optional fifth argument that will make the callback only fire if it * matches the sub-type provided. * * ```ts * function postNPCRenderFilter(npc: EntityNPC, renderOffset: Vector): void {} * ``` */ POST_NPC_RENDER_FILTER = 70, /** * Fires from the `POST_NPC_UPDATE` callback when an NPC's state has changed from what it was on * the previous frame. (In this context, "state" refers to the `EntityNPC.State` field.) * * When registering the callback with the `ModUpgraded.AddCallbackCustom` method: * - You can provide an optional third argument that will make the callback only fire if it * matches the `EntityType` provided. * - You can provide an optional fourth argument that will make the callback only fire if it * matches the variant provided. * - You can provide an optional fifth argument that will make the callback only fire if it * matches the sub-type provided. * * ```ts * function postNPCStateChanged( * npc: EntityNPC, * previousState: int, * currentState: int, * ): void {} * ``` */ POST_NPC_STATE_CHANGED = 71, /** * The exact same thing as the vanilla `POST_NPC_UPDATE` callback, except this callback allows you * to specify extra arguments for additional filtration. * * When registering the callback with the `ModUpgraded.AddCallbackCustom` method: * - You can provide an optional third argument that will make the callback only fire if it * matches the `EntityType` provided. * - You can provide an optional fourth argument that will make the callback only fire if it * matches the variant provided. * - You can provide an optional fifth argument that will make the callback only fire if it * matches the sub-type provided. * * ```ts * function postNPCUpdateFilter(npc: EntityNPC): void {} * ``` */ POST_NPC_UPDATE_FILTER = 72, /** * Similar to the vanilla callback of the same name, but fires after the * `POST_GAME_STARTED_REORDERED` callback fires (if the player is being updated on the 0th game * frame of the run). * * This callback is useful for two reasons: * * 1. Normally, `POST_PEFFECT_UPDATE` fires before `POST_GAME_STARTED`. Since mod variables are * often initialized at the beginning of the `POST_GAME_STARTED` callback, this can cause * problems. * 1. Some functions do not work (or crash the game) when called before the `POST_NEW_ROOM` * callback. For example, since the level is not generated yet, you will not be able to access * any rooms. * * When registering the callback with the `ModUpgraded.AddCallbackCustom` method: * - You can provide an optional third argument that will make the callback only fire if it * matches the `PlayerVariant` provided. * - You can provide an optional fourth argument that will make the callback only fire if it * matches the `PlayerType` provided. * * ```ts * function postPEffectUpdateReordered(player: EntityPlayer): void {} * ``` */ POST_PEFFECT_UPDATE_REORDERED = 73, /** * Fires from the `POST_PICKUP_UPDATE` callback when a pickup has a different variant or sub-type * than what it was on the previous frame. * * When registering the callback with the `ModUpgraded.AddCallbackCustom` method: * - You can provide an optional third argument that will make the callback only fire if the new * pickup matches the `PickupVariant` provided. * - You can provide an optional third argument that will make the callback only fire if the new * pickup matches the sub-type provided. * * ```ts * function postPickupChanged( * pickup: EntityPickup, * oldVariant: PickupVariant, * oldSubType: int, * newVariant: PickupVariant, * newSubType: int, * ): void {} * ``` */ POST_PICKUP_CHANGED = 74, /** * Fires on the first `POST_RENDER` frame that a pickup plays the "Collect" animation. * * Use this callback to know when a pickup is added to the player's inventory or health. * * Note that this will not fire when the player takes a collectible; use either the * `POST_PLAYER_COLLECTIBLE_ADDED` or the `PRE_ITEM_PICKUP` callback for that. * * When registering the callback with the `ModUpgraded.AddCallbackCustom` method: * - You can provide an optional third argument that will make the callback only fire if it * matches the `PickupVariant` provided. * - You can provide an optional fourth argument that will make the callback only fire if it * matches the sub-type provided. * * ```ts * function postPickupCollect(pickup: EntityPickup, player: EntityPlayer): void {} * ``` */ POST_PICKUP_COLLECT = 75, /** * The exact same thing as the vanilla `POST_PICKUP_INIT` callback, except this callback allows * you to specify extra arguments for additional filtration. * * When registering the callback with the `ModUpgraded.AddCallbackCustom` method: * - You can provide an optional third argument that will make the callback only fire if it * matches the `PickupVariant` provided. * - You can provide an optional fourth argument that will make the callback only fire if it * matches the sub-type provided. * * ```ts * function postPickupInitFilter(pickup: EntityPickup): void {} * ``` */ POST_PICKUP_INIT_FILTER = 76, /** * Fires from the `POST_PICKUP_INIT` callback on the first time that a player has seen the * respective pickup on the run. * * This callback is useful because pickups will despawn upon leaving the room and respawn upon * re-entering the room. * * When registering the callback with the `ModUpgraded.AddCallbackCustom` method: * - You can provide an optional third argument that will make the callback only fire if it * matches the `PickupVariant` provided. * - You can provide an optional fourth argument that will make the callback only fire if it * matches the sub-type provided. * * ```ts * function postPickupInitFirst(pickup: EntityPickup): void {} * ``` */ POST_PICKUP_INIT_FIRST = 77, /** * Fires on the first `POST_PICKUP_UPDATE` frame for each pickup. * * This callback is useful because many attributes cannot be set or retrieved properly in the * normal `POST_PICKUP_INIT` callback. * * When registering the callback with the `ModUpgraded.AddCallbackCustom` method: * - You can provide an optional third argument that will make the callback only fire if it * matches the `PickupVariant` provided. * - You can provide an optional fourth argument that will make the callback only fire if it * matches the sub-type provided. * * ```ts * function postPickupInitLate(pickup: EntityPickup): void {} * ``` */ POST_PICKUP_INIT_LATE = 78, /** * The exact same thing as the vanilla `POST_PICKUP_RENDER` callback, except this callback allows * you to specify extra arguments for additional filtration. * * When registering the callback with the `ModUpgraded.AddCallbackCustom` method: * - You can provide an optional third argument that will make the callback only fire if it * matches the `PickupVariant` provided. * - You can provide an optional fourth argument that will make the callback only fire if it * matches the sub-type provided. * * ```ts * function postPickupRenderFilter(pickup: EntityPickup, renderOffset: Vector): void {} * ``` */ POST_PICKUP_RENDER_FILTER = 79, /** * The exact same thing as the vanilla `POST_PICKUP_SELECTION` callback, except this callback * allows you to specify extra arguments for additional filtration. * * When registering the callback with the `ModUpgraded.AddCallbackCustom` method: * - You can provide an optional third argument that will make the callback only fire if it * matches the `PickupVariant` provided. * - You can provide an optional fourth argument that will make the callback only fire if it * matches the sub-type provided. * * ```ts * function postPickupSelectionFilter( * pickup: EntityPickup, * variant: PickupVariant, * subType: int, * ): [pickupVariant: PickupVariant, subType: int] | undefined {} * ``` */ POST_PICKUP_SELECTION_FILTER = 80, /** * Fires from the `POST_PICKUP_UPDATE` callback when a pickup's state has changed from what it was * on the previous frame. (In this context, "state" refers to the `EntityPickup.State` field.) * * When registering the callback with the `ModUpgraded.AddCallbackCustom` method: * - You can provide an optional third argument that will make the callback only fire if it * matches the `PickupVariant` provided. * - You can provide an optional fourth argument that will make the callback only fire if it * matches the sub-type provided. * * ```ts * function postPickupStateChanged( * pickup: EntityPickup, * previousState: int, * currentState: int, * ): void {} * ``` */ POST_PICKUP_STATE_CHANGED = 81, /** * The exact same thing as the vanilla `POST_PICKUP_UPDATE` callback, except this callback allows * you to specify extra arguments for additional filtration. * * When registering the callback with the `ModUpgraded.AddCallbackCustom` method: * - You can provide an optional third argument that will make the callback only fire if it * matches the `PickupVariant` provided. * - You can provide an optional fourth argument that will make the callback only fire if it * matches the sub-type provided. * * ```ts * function postPickupUpdateFilter(pickup: EntityPickup): void {} * ``` */ POST_PICKUP_UPDATE_FILTER = 82, /** * Fires from the `POST_RENDER` callback on every frame that a pit exists. * * When registering the callback with the `ModUpgraded.AddCallbackCustom` method: * - You can provide an optional third argument that will make the callback only fire if it * matches the variant provided. * * ```ts * function postPitRender(pit: GridEntityPit): void {} * ``` */ POST_PIT_RENDER = 83, /** * Fires from the `POST_UPDATE` callback on every frame that a pit exists. * * When registering the callback with the `ModUpgraded.AddCallbackCustom` method: * - You can provide an optional third argument that will make the callback only fire if it * matches the variant provided. * * ```ts * function postPitUpdate(pit: GridEntityPit): void {} * ``` */ POST_PIT_UPDATE = 84, /** * Fires from the `POST_PEFFECT_UPDATE_REORDERED` callback when a player's health (i.e. hearts) is * different than what it was on the previous frame. For more information, see the `PlayerHealth` * enum. * * When registering the callback with the `ModUpgraded.AddCallbackCustom` method: * - You can provide an optional third argument that will make the callback only fire if it * matches the `PlayerVariant` provided. * - You can provide an optional fourth argument that will make the callback only fire if it * matches the `PlayerType` provided. * * ```ts * function postPlayerChangeHealth( * player: EntityPlayer, * healthType: HealthType, * difference: int, * oldValue: int, * newValue: int, * ): void {} * ``` */ POST_PLAYER_CHANGE_HEALTH = 85, /** * Fires from the `POST_PEFFECT_UPDATE_REORDERED` callback when one of the player's stats change * from what they were on the previous frame. * * The type of `oldValue` and `newValue` will depend on what kind of stat it is. For example, * `StatType.FLYING` will be a boolean. (You can use the "Types" helper functions to narrow the * type.) * * For `StatType.TEAR_FLAG`, `StatType.TEAR_COLOR`, `StatType.FLYING`, and `StatType.SIZE`, the * `difference` argument will always be a value of 0, since the type of these stats are not * numbers. (For these cases, you should examine the `oldValue` and `newValue` arguments * accordingly.) * * When registering the callback with the `ModUpgraded.AddCallbackCustom` method: * - You can provide an optional third argument that will make the callback only fire if it * matches the `PlayerVariant` provided. * - You can provide an optional fourth argument that will make the callback only fire if it * matches the `PlayerType` provided. * * ```ts * function postPlayerChangeStat( * player: EntityPlayer, * statType: T, * difference: int, * oldValue: StatTypeType[T], * newValue: StatTypeType[T], * ) => void {} * ``` */ POST_PLAYER_CHANGE_STAT = 86, /** * Fires from the `POST_PEFFECT_UPDATE_REORDERED` callback when a player entity changes its player * type * (i.e. character) from what it was on the previous frame. For example, it will fire after using * Clicker, after dying with the Judas' Shadow collectible, etc. * * Notably, it does not fire after the player uses the Flip item or the Esau Jr. item, because * those items cause separate player entities to be created. Use the `POST_FLIP` and * `POST_ESAU_JR` callbacks to handle those situations. * * When registering the callback with the `ModUpgraded.AddCallbackCustom` method: * - You can provide an optional third argument that will make the callback only fire if it * matches the `PlayerVariant` provided. * * ```ts * function postPlayerChangeType( * player: EntityPlayer, * oldCharacter: PlayerType, * newCharacter: PlayerType, * ): void {} * ``` */ POST_PLAYER_CHANGE_TYPE = 87, /** * Fires from the `POST_PEFFECT_UPDATE_REORDERED` callback when a player's collectible count is * higher than what it was on the previous frame, or when the active items change, or when the * build is rerolled. * * When registering the callback with the `ModUpgraded.AddCallbackCustom` method: * - You can provide an optional third argument that will make the callback only fire if the * collectible matches the `CollectibleType` provided. * * ```ts * function postPlayerCollectibleAdded( * player: EntityPlayer, * collectibleType: CollectibleType, * ): void {} * ``` */ POST_PLAYER_COLLECTIBLE_ADDED = 88, /** * Fires from the `POST_PEFFECT_UPDATE_REORDERED` callback when a player's collectible count is * lower than what it was on the previous frame, or when the active items change, or when the * build is rerolled. * * When registering the callback with the `ModUpgraded.AddCallbackCustom` method: * - You can provide an optional third argument that will make the callback only fire if the * collectible matches the `CollectibleType` provided. * * ```ts * function postPlayerCollectibleRemoved( * player: EntityPlayer, * collectibleType: CollectibleType, * ): void {} * ``` */ POST_PLAYER_COLLECTIBLE_REMOVED = 89, /** * Fires from the `ENTITY_TAKE_DMG` callback when a player takes fatal damage. You can optionally * return false to prevent the fatal damage. * * Note that this function does properly take into account Guppy's Collar, Broken Ankh, Spirit * Shackles, and Mysterious Paper. It also takes into account using The Bible on Satan. * * When registering the callback with the `ModUpgraded.AddCallbackCustom` method: * - You can provide an optional third argument that will make the callback only fire if it * matches the `PlayerVariant` provided. * - You can provide an optional fourth argument that will make the callback only fire if it * matches the `PlayerType` provided. * * ```ts * function postPlayerFatalDamage(player: EntityPlayer): boolean | undefined {} * ``` */ POST_PLAYER_FATAL_DAMAGE = 90, /** * Fires on the first `POST_PEFFECT_UPDATE_REORDERED` frame for each player, similar to the * `POST_PLAYER_INIT_LATE` callback, with two changes: * * - This will not fire for "child" players (e.g. non-real players like the Strawman Keeper). * - This will fire when the player enters a Genesis room and all of their items are taken away. * * You should use this callback for any player-related initialization logic, like giving the * character their starting items for the run. (You do not want to use the vanilla * `POST_PLAYER_INIT` callback for this because it fires when a run is continued.) * * When registering the callback with the `ModUpgraded.AddCallbackCustom` method: * - You can provide an optional third argument that will make the callback only fire if it * matches the `PlayerVariant` provided. * - You can provide an optional fourth argument that will make the callback only fire if it * matches the `PlayerType` provided. * * ```ts * function postPlayerInitFirst(player: EntityPlayer): void {} * ``` */ POST_PLAYER_INIT_FIRST = 91, /** * Fires on the first `POST_PEFFECT_UPDATE_REORDERED` frame for each player. * * This callback is useful because many attributes cannot be set or retrieved properly in the * normal `POST_PLAYER_INIT` callback. * * For initializing a player with custom items and so forth, use the `POST_PLAYER_INIT_FIRST` * callback instead to handle the case of a Genesis room. * * When registering the callback with the `ModUpgraded.AddCallbackCustom` method: * - You can provide an optional third argument that will make the callback only fire if it * matches the `PlayerVariant` provided. * - You can provide an optional fourth argument that will make the callback only fire if it * matches the `PlayerType` provided. * * ```ts * function postPlayerInitLate(pickup: EntityPickup): void {} * ``` */ POST_PLAYER_INIT_LATE = 92, /** * Similar to the vanilla callback of the same name, but fires after the `POST_GAME_STARTED` * callback fires (if the player is spawning on the 0th game frame of the run). * * This callback is useful for two reasons: * * 1. Normally, `POST_PLAYER_RENDER` fires before `POST_GAME_STARTED`. Since mod variables are * often initialized at the beginning of the `POST_GAME_STARTED` callback, this can cause * problems. * 1. Some functions do not work (or crash the game) when called before the `POST_NEW_ROOM` * callback. For example, since the level is not generated yet, you will not be able to access * any rooms. * * When registering the callback with the `ModUpgraded.AddCallbackCustom` method: * - You can provide an optional third argument that will make the callback only fire if it * matches the `PlayerVariant` provided. * - You can provide an optional fourth argument that will make the callback only fire if it * matches the `PlayerType` provided. * * ```ts * function postPlayerRenderReordered(player: EntityPlayer, renderOffset: Vector): void {} * ``` */ POST_PLAYER_RENDER_REORDERED = 93, /** * Similar to the vanilla callback of the same name, but fires after the * `POST_GAME_STARTED_REORDERED` callback fires (if the player is being updated on the 0th game * frame of the run). * * This callback is useful for two reasons: * * 1. Normally, `POST_PLAYER_UPDATE` fires before `POST_GAME_STARTED`. Since mod variables are * often initialized at the beginning of the `POST_GAME_STARTED` callback, this can cause * problems. * 1. Some functions do not work (or crash the game) when called before the `POST_NEW_ROOM` * callback. For example, since the level is not generated yet, you will not be able to access * any rooms. * * When registering the callback with the `ModUpgraded.AddCallbackCustom` method: * - You can provide an optional third argument that will make the callback only fire if it * matches the `PlayerVariant` provided. * - You can provide an optional fourth argument that will make the callback only fire if it * matches the `PlayerType` provided. * * ```ts * function postPlayerUpdateReordered(player: EntityPlayer): void {} * ``` */ POST_PLAYER_UPDATE_REORDERED = 94, /** * Fires from the `POST_RENDER` callback on every frame that a poop exists. * * When registering the callback with the `ModUpgraded.AddCallbackCustom` method: * - You can provide an optional third argument that will make the callback only fire if it * matches the variant provided. * * ```ts * function postPoopRender(poop: GridEntityPoop): void {} * ``` */ POST_POOP_RENDER = 95, /** * Fires from the `POST_UPDATE` callback on every frame that a poop exists. * * When registering the callback with the `ModUpgraded.AddCallbackCustom` method: * - You can provide an optional third argument that will make the callback only fire if it * matches the variant provided. * * ```ts * function postPoopUpdate(poop: GridEntityPoop): void {} * ``` */ POST_POOP_UPDATE = 96, /** * Fires from the `POST_RENDER` callback on every frame that a pressure plate exists. * * When registering the callback with the `ModUpgraded.AddCallbackCustom` method: * - You can provide an optional third argument that will make the callback only fire if it * matches the variant provided. * * ```ts * function postPressurePlateRender(pressurePlate: GridEntityPressurePlate): void {} * ``` */ POST_PRESSURE_PLATE_RENDER = 97, /** * Fires from the `POST_UPDATE` callback on every frame that a pressure plate exists. * * When registering the callback with the `ModUpgraded.AddCallbackCustom` method: * - You can provide an optional third argument that will make the callback only fire if it * matches the variant provided. * * ```ts * function postPressurePlateUpdate(pressurePlate: GridEntityPressurePlate): void {} * ``` */ POST_PRESSURE_PLATE_UPDATE = 98, /** * The exact same thing as the vanilla `POST_PROJECTILE_INIT` callback, except this callback * allows you to specify extra arguments for additional filtration. * * When registering the callback with the `ModUpgraded.AddCallbackCustom` method: * - You can provide an optional third argument that will make the callback only fire if it * matches the `ProjectileVariant` provided. * - You can provide an optional fourth argument that will make the callback only fire if it * matches the sub-type provided. * * ```ts * function postProjectileInitFilter(projectile: EntityProjectile): void {} * ``` */ POST_PROJECTILE_INIT_FILTER = 99, /** * Fires on the first `POST_PROJECTILE_UPDATE` frame for each projectile. * * This callback is useful because many attributes cannot be set or retrieved properly in the * normal `POST_PROJECTILE_INIT` callback. * * When registering the callback with the `ModUpgraded.AddCallbackCustom` method: * - You can provide an optional third argument that will make the callback only fire if matches * the `ProjectileVariant` provided. * - You can provide an optional fourth argument that will make the callback only fire if it * matches the sub-type provided. * * ```ts * function postProjectileInitLate(projectile: EntityProjectile): void {} * ``` */ POST_PROJECTILE_INIT_LATE = 100, /** * Fires when the provided projectile is removed after colliding with an entity or grid entity. * * When registering the callback with the `ModUpgraded.AddCallbackCustom` method: * - You can provide an optional third argument that will make the callback only fire if it * matches the `ProjectileVariant` provided. * - You can provide an optional fourth argument that will make the callback only fire if it * matches the sub-type provided. * * ```ts * function postProjectileKill(projectile: EntityProjectile): void {} * ``` */ POST_PROJECTILE_KILL = 101, /** * The exact same thing as the vanilla `POST_PROJECTILE_RENDER` callback, except this callback * allows you to specify extra arguments for additional filtration. * * When registering the callback with the `ModUpgraded.AddCallbackCustom` method: * - You can provide an optional third argument that will make the callback only fire if it * matches the `ProjectileVariant` provided. * - You can provide an optional fourth argument that will make the callback only fire if it * matches the sub-type provided. * * ```ts * function postProjectileRenderFilter(projectile: EntityProjectile, renderOffset: Vector): void {} * ``` */ POST_PROJECTILE_RENDER_FILTER = 102, /** * The exact same thing as the vanilla `POST_PROJECTILE_INIT` callback, except this callback * allows you to specify extra arguments for additional filtration. * * When registering the callback with the `ModUpgraded.AddCallbackCustom` method: * - You can provide an optional third argument that will make the callback only fire if it * matches the `ProjectileVariant` provided. * - You can provide an optional fourth argument that will make the callback only fire if it * matches the sub-type provided. * * ```ts * function postProjectileUpdateFilter(projectile: EntityProjectile): void {} * ``` */ POST_PROJECTILE_UPDATE_FILTER = 103, /** * Fires from the `POST_PEFFECT_UPDATE_REORDERED` callback when a player first picks up a new * item. The pickup returned in the callback is assumed to be the first pickup that no longer * exists. * * When registering the callback with the `ModUpgraded.AddCallbackCustom` method: * - You can provide an optional third argument that will make the callback only fire if it * matches the `PickupVariant` provided. * - You can provide an optional fourth argument that will make the callback only fire if it * matches the sub-type provided. * * ```ts * function postPurchase(player: EntityPlayer, pickup: EntityPickup): void {} * ``` */ POST_PURCHASE = 104, /** * Fires from the `POST_RENDER` callback on every frame that a rock exists. * * When registering the callback with the `ModUpgraded.AddCallbackCustom` method: * - You can provide an optional third argument that will make the callback only fire if it * matches the `GridEntityType` provided. * - You can provide an optional fourth argument that will make the callback only fire if it * matches the variant provided. * * ```ts * function postRockRender(rock: GridEntityRock): void {} * ``` */ POST_ROCK_RENDER = 105, /** * Fires from the `POST_UPDATE` callback on every frame that a rock exists. * * When registering the callback with the `ModUpgraded.AddCallbackCustom` method: * - You can provide an optional third argument that will make the callback only fire if it * matches the `GridEntityType` provided. * - You can provide an optional fourth argument that will make the callback only fire if it * matches the variant provided. * * ```ts * function postRockUpdate(rock: GridEntityRock): void {} * ``` */ POST_ROCK_UPDATE = 106, /** * Fires from the `POST_UPDATE` callback when the clear state of a room changes (as according to * the `Room.IsClear` method). * * For example, this callback fires when you defeat all the enemies in a room (clear --> not * clear) or when you bomb an angel statue (not clear --> clear). This callback does not fire when * you travel between a cleared room and an uncleared room. * * When registering the callback with the `ModUpgraded.AddCallbackCustom` method: * - You can provide an optional third argument that will make the callback only fire if the room * clear state matches the boolean provided. * * ```ts * function postRoomClearChanged(roomClear: boolean): void {} * ``` */ POST_ROOM_CLEAR_CHANGED = 107, /** * Fires from the `ENTITY_TAKE_DMG` callback when a player takes damage from spikes in a Sacrifice * Room. * * When registering the callback with the `ModUpgraded.AddCallbackCustom` method: * - You can provide an optional third argument that will make the callback only fire if it * matches the `PlayerVariant` provided. * - You can provide an optional fourth argument that will make the callback only fire if it * matches the `PlayerType` provided. * * ```ts * function postSacrifice(player: EntityPlayer, numSacrifices: int): void {} * ``` */ POST_SACRIFICE = 108, /** * Fires from the `POST_RENDER` callback when a slot entity's animation changes. * * When registering the callback with the `ModUpgraded.AddCallbackCustom` method: * - You can provide an optional third argument that will make the callback only fire if it * matches the `SlotVariant` provided. * - You can provide an optional fourth argument that will make the callback only fire if it * matches the sub-type provided. * * ```ts * function postSlotAnimationChanged( * slot: Entity, * previousAnimation: string, * currentAnimation: string, * ): void {} * ``` */ POST_SLOT_ANIMATION_CHANGED = 109, /** * Fires from the `PRE_PLAYER_COLLISION` callback when when a player collides with a slot entity. * (It will not fire if any other type of entity collides with the slot entity.) * * When a player runs into a slot entity, this callback will continually fire, since the player is * colliding with it on every frame. Thus, you should only perform actions in this callback under * certain conditions, like if the slot entity is playing the "Idle" animation, and so on. * * When registering the callback with the `ModUpgraded.AddCallbackCustom` method: * - You can provide an optional third argument that will make the callback only fire if it * matches the `SlotVariant` provided. * - You can provide an optional fourth argument that will make the callback only fire if it * matches the sub-type provided. * - (Only players will cause this callback to fire, so there is no need for an optional argument * to filter by `EntityType`.) * * ```ts * function postSlotCollision( * slot: EntitySlot, * entity: Entity, * ): void {} * ``` */ POST_SLOT_COLLISION = 110, /** * Fires from the `POST_SLOT_UPDATE` or the `POST_ENTITY_REMOVE` callback when a slot machine is * destroyed or a beggar is removed. * * This callback will fire in four different kinds of situations: * * 1. When slot machine entities (e.g. `SlotVariant.SLOT_MACHINE` and * `SlotVariant.BLOOD_DONATION_MACHINE`) are destroyed with an explosion. When this happens, * they typically stay in the room and can be pushed around. This state is detected via a * change in the `GridCollisionClass`. * 2. When slot machine entities pay out with a collectible item. When this happens, they * immediately despawn without playing any special animation. * 3. When beggar entities (e.g. `SlotVariant.BEGGAR` and `SlotVariant.SHELL_GAME`) are destroyed * with an explosion. When this happens, they immediately despawn without playing any special * animation. * 4. When beggar entities pay out with a collectible item. When this happens, they despawn after * playing the "Teleport" animation. (This is not technically a "destruction" event, but the * callback will fire for this to remain consistent with the other types of slot entities.) * * Depending on the specific types of slot removal that you need to detect, you can filter using: * * 1. The `isSlotMachine` helper function to differentiate between slot machines and beggars. * 2. The passed callback argument of `SlotDestructionType` to differentiate between bombed slots * and slots that paid out with a collectible item. * * Note that when a Crane Game explodes after paying out three collectibles, the * `SlotDestructionType` will be equal to `SlotDestructionType.NORMAL` instead of * `SlotDestructionType.COLLECTIBLE_PAYOUT` like you might expect. (This is because it only * explodes after a short delay, and when doing so, it produces rewards in the same way that would * happen if you bombed it.) * * When registering the callback with the `ModUpgraded.AddCallbackCustom` method: * - You can provide an optional third argument that will make the callback only fire if it * matches the `SlotVariant` provided. * - You can provide an optional fourth argument that will make the callback only fire if it * matches the sub-type provided. * * ```ts * function postSlotDestroyed(slot: Entity, slotDestructionType: SlotDestructionType): void {} * ``` */ POST_SLOT_DESTROYED = 111, /** * Fires when a new slot entity is initialized. Specifically, this is either: * * - in the `POST_NEW_ROOM_REORDERED` callback (firing every time a room is entered, even if the * entity was previously there on a previous room entry) * - in the `POST_UPDATE` callback (if the entity appeared mid-way through the room, like when a * Wheel of Fortune card is used) * * When registering the callback with the `ModUpgraded.AddCallbackCustom` method: * - You can provide an optional third argument that will make the callback only fire if it * matches the `SlotVariant` provided. * - You can provide an optional fourth argument that will make the callback only fire if it * matches the sub-type provided. * * ```ts * function postSlotInit(slot: Entity): void {} * ``` */ POST_SLOT_INIT = 112, /** * Fires from the `POST_RENDER` callback on every frame that a slot entity exists. * * When registering the callback with the `ModUpgraded.AddCallbackCustom` method: * - You can provide an optional third argument that will make the callback only fire if it * matches the `SlotVariant` provided. * - You can provide an optional fourth argument that will make the callback only fire if it * matches the sub-type provided. * * ```ts * function postSlotRender(slot: Entity): void {} * ``` */ POST_SLOT_RENDER = 113, /** * Fires from the `POST_UPDATE` callback on every frame that a slot entity exists. * * When registering the callback with the `ModUpgraded.AddCallbackCustom` method: * - You can provide an optional third argument that will make the callback only fire if it * matches the `SlotVariant` provided. * - You can provide an optional fourth argument that will make the callback only fire if it * matches the sub-type provided. * * ```ts * function postSlotUpdate(slot: Entity): void {} * ``` */ POST_SLOT_UPDATE = 114, /** * Fires from the `POST_RENDER` callback on every frame that spikes exist. * * When registering the callback with the `ModUpgraded.AddCallbackCustom` method: * - You can provide an optional third argument that will make the callback only fire if it * matches the variant provided. * * ```ts * function postSpikesRender(spikes: GridEntitySpikes): void {} * ``` */ POST_SPIKES_RENDER = 115, /** * Fires from the `POST_UPDATE` callback on every frame that spikes exist. * * When registering the callback with the `ModUpgraded.AddCallbackCustom` method: * - You can provide an optional third argument that will make the callback only fire if it * matches the variant provided. * * ```ts * function postSpikesUpdate(spikes: GridEntitySpikes): void {} * ``` */ POST_SPIKES_UPDATE = 116, /** * The exact same thing as the vanilla `POST_TEAR_INIT` callback, except this callback allows you * to specify extra arguments for additional filtration. * * When registering the callback with the `ModUpgraded.AddCallbackCustom` method: * - You can provide an optional third argument that will make the callback only fire if it * matches the `TearVariant` provided. * - You can provide an optional fourth argument that will make the callback only fire if it * matches the sub-type provided. * * ```ts * function postTearInitFilter(tear: EntityTear): void {} * ``` */ POST_TEAR_INIT_FILTER = 117, /** * Fires on the first `POST_TEAR_UPDATE` frame for each tear (which is when * `EntityTear.FrameCount` is equal to 0). * * This callback is useful because many attributes cannot be set or retrieved properly in the * normal `POST_TEAR_INIT` callback. * * When registering the callback with the `ModUpgraded.AddCallbackCustom` method: * - You can provide an optional third argument that will make the callback only fire if it * matches the `TearVariant` provided. * - You can provide an optional fourth argument that will make the callback only fire if it * matches the sub-type provided. * * ```ts * function postTearInitLate(tear: EntityTear): void {} * ``` */ POST_TEAR_INIT_LATE = 118, /** * Fires on the second `POST_TEAR_UPDATE` frame for each tear (which is when * `EntityTear.FrameCount` is equal to 1). * * This callback is useful because Incubus tears are not distinguishable until the second frame. * * When registering the callback with the `ModUpgraded.AddCallbackCustom` method: * - You can provide an optional third argument that will make the callback only fire if it * matches the `TearVariant` provided. * - You can provide an optional fourth argument that will make the callback only fire if it * matches the sub-type provided. * * ```ts * function postTearInitVeryLate(tear: EntityTear): void {} * ``` */ POST_TEAR_INIT_VERY_LATE = 119, /** * Fires when the provided tear is removed after colliding with an entity or grid entity. * * When registering the callback with the `ModUpgraded.AddCallbackCustom` method: * - You can provide an optional third argument that will make the callback only fire if it * matches the `TearVariant` provided. * - You can provide an optional fourth argument that will make the callback only fire if it * matches the sub-type provided. * * ```ts * function postTearKill(tear: EntityTear): void {} * ``` */ POST_TEAR_KILL = 120, /** * The exact same thing as the vanilla `POST_TEAR_RENDER` callback, except this callback allows * you to specify extra arguments for additional filtration. * * When registering the callback with the `ModUpgraded.AddCallbackCustom` method: * - You can provide an optional third argument that will make the callback only fire if it * matches the `TearVariant` provided. * - You can provide an optional fourth argument that will make the callback only fire if it * matches the sub-type provided. * * ```ts * function postTearRenderFilter(tear: EntityTear, renderOffset: Vector): void {} * ``` */ POST_TEAR_RENDER_FILTER = 121, /** * The exact same thing as the vanilla `POST_TEAR_INIT` callback, except this callback allows you * to specify extra arguments for additional filtration. * * When registering the callback with the `ModUpgraded.AddCallbackCustom` method: * - You can provide an optional third argument that will make the callback only fire if it * matches the `TearVariant` provided. * - You can provide an optional fourth argument that will make the callback only fire if it * matches the sub-type provided. * * ```ts * function postTearUpdateFilter(tear: EntityTear): void {} * ``` */ POST_TEAR_UPDATE_FILTER = 122, /** * Fires from the `POST_RENDER` callback on every frame that a TNT exists. * * When registering the callback with the `ModUpgraded.AddCallbackCustom` method: * - You can provide an optional third argument that will make the callback only fire if it * matches the variant provided. * * ```ts * function postTNTRender(tnt: GridEntityTNT): void {} * ``` */ POST_TNT_RENDER = 123, /** * Fires from the `POST_UPDATE` callback on every frame that a TNT exists. * * When registering the callback with the `ModUpgraded.AddCallbackCustom` method: * - You can provide an optional third argument that will make the callback only fire if it * matches the variant provided. * * ```ts * function postTNTUpdate(tnt: GridEntityTNT): void {} * ``` */ POST_TNT_UPDATE = 124, /** * Fires from the `POST_PEFFECT_UPDATE_REORDERED` callback when a player gains or loses a new * transformation. * * Note that this callback will only fire once per Forgotten/Soul pair. * * When registering the callback with the `ModUpgraded.AddCallbackCustom` method: * - You can provide an optional third argument that will make the callback only fire if it * matches the `PlayerForm` provided. * * ```ts * function postTransformation( * player: EntityPlayer, * playerForm: PlayerForm, * hasForm: boolean, * ): void {} * ``` */ POST_TRANSFORMATION = 125, /** * Fires from `ENTITY_TAKE_DMG` callback when a Wishbone or a Walnut breaks. * * When registering the callback with the `ModUpgraded.AddCallbackCustom` method: * - You can provide an optional third argument that will make the callback only fire if it * matches the `TrinketType` provided. * * ```ts * function postTrinketBreak( * player: EntityPlayer, * trinketType: TrinketType, * ): void {} * ``` */ POST_TRINKET_BREAK = 126, /** * The same thing as the vanilla `POST_USE_PILL` callback, except this callback passes the * `PillColor` of the used pill as the final argument. It allows you to filter by the `PillColor`. * * In order to accomplish this, this callback tracks the held pills of the player on every frame. * If a matching `PillColor` could not be found, this callback passes `PillColor.NULL` (0). * * When registering the callback with the `ModUpgraded.AddCallbackCustom` method: * - You can provide an optional third argument that will make the callback only fire if it * matches the `PillEffect` provided. * - You can provide an optional fourth argument that will make the callback only fire if it * matches the `PillColor` provided. * * ```ts * function postUsePillFilter( * pillEffect: PillEffect, * pillColor: PillColor, * player: EntityPlayer, * useFlags: BitFlags, * ): void {} * ``` */ POST_USE_PILL_FILTER = 127, /** * Fires from the `POST_PEFFECT_UPDATE_REORDERED` callback on the frame before a Berserk effect * ends when the player is predicted to die (e.g. they currently have no health left or they took * damage in a "Lost" form). * * When registering the callback with the `ModUpgraded.AddCallbackCustom` method: * - You can provide an optional third argument that will make the callback only fire if it * matches the `PlayerVariant` provided. * - You can provide an optional fourth argument that will make the callback only fire if it * matches the `PlayerType` provided. * * ```ts * function preBerserkDeath(player: EntityPlayer): void {} * ``` */ PRE_BERSERK_DEATH = 128, /** * The exact same thing as the vanilla `PRE_BOMB_COLLISION` callback, except this callback allows * you to specify extra arguments for additional filtration. * * When registering the callback with the `ModUpgraded.AddCallbackCustom` method: * - You can provide an optional third argument that will make the callback only fire if it * matches the `BombVariant` provided. * - You can provide an optional fourth argument that will make the callback only fire if it * matches the sub-type provided. * * ```ts * function preBombCollisionFilter( * bomb: EntityBomb, * collider: Entity, * low: boolean, * ): void {} * ``` */ PRE_BOMB_COLLISION_FILTER = 129, /** * Fires from the `POST_PLAYER_FATAL_DAMAGE` callback when a player is about to die. If you want * to initiate a custom revival, return an integer that corresponds to the item or type of revival * that you are doing. Otherwise, return undefined to continue the fatal damage. * * This callback is useful because reviving the player after the game things that player should * have died will result in the save data for the run getting deleted. * * When registering the callback with the `ModUpgraded.AddCallbackCustom` method: * - You can provide an optional third argument that will make the callback only fire if it * matches the `PlayerVariant` provided. * - You can provide an optional fourth argument that will make the callback only fire if it * matches the `PlayerType` provided. * * ```ts * function preCustomRevive(player: EntityPlayer): int | undefined {} * ``` */ PRE_CUSTOM_REVIVE = 130, /** * The exact same thing as the vanilla `PRE_ENTITY_SPAWN` callback, except this callback allows * you to specify extra arguments for additional filtration. * * When registering the callback with the `ModUpgraded.AddCallbackCustom` method: * - You can provide an optional third argument that will make the callback only fire if it * matches the `EntityType` provided. * - You can provide an optional fourth argument that will make the callback only fire if it * matches the variant provided. * - You can provide an optional fifth argument that will make the callback only fire if it * matches the sub-type provided. * * ```ts * function preEntitySpawnFilter( * entityType: EntityType, * variant: int, * subType: int, * position: Vector, * velocity: Vector, * spawner: Entity | undefined, * initSeed: Seed, * ): [entityType: EntityType, variant: int, subType: int, initSeed: Seed] | undefined {} * ``` */ PRE_ENTITY_SPAWN_FILTER = 131, /** * The exact same thing as the vanilla `PRE_FAMILIAR_COLLISION` callback, except this callback * allows you to specify extra arguments for additional filtration. * * When registering the callback with the `ModUpgraded.AddCallbackCustom` method: * - You can provide an optional third argument that will make the callback only fire if it * matches the `FamiliarVariant` provided. * - You can provide an optional fourth argument that will make the callback only fire if it * matches the sub-type provided. * * ```ts * function preFamiliarCollisionFilter( * familiar: EntityFamiliar, * collider: Entity, * low: boolean, * ): void {} * ``` */ PRE_FAMILIAR_COLLISION_FILTER = 132, /** * Fires from the `PRE_PICKUP_COLLISION` callback when a player touches a collectible pedestal and * meets all of the conditions to pick it up. * * The return values of this callback are the same as the `PRE_PICKUP_COLLISION` callback. For * example, you can prevent a player from picking up the collectible by returning false. (However, * note that this callback will continue to fire for every frame that the player touches the * pedestal, so you would need to continue returning false.) * * When registering the callback with the `ModUpgraded.AddCallbackCustom` method: * - You can provide an optional third argument that will make the callback only fire if it * matches the `PlayerVariant` provided. * - You can provide an optional fourth argument that will make the callback only fire if it * matches the `PlayerType` provided. * * ```ts * function preGetPedestal(player: EntityPlayer, collectible: EntityPickupCollectible): void {} * ``` */ PRE_GET_PEDESTAL = 133, /** * Fires from the `POST_PEFFECT_UPDATE_REORDERED` callback when an item becomes queued (i.e. when * the player begins to hold the item above their head). You can optionally return false if you * want the item to not be granted to the player. * * Note that this callback will only fire once per Forgotten/Soul pair. * * When registering the callback with the `ModUpgraded.AddCallbackCustom` method: * - You can provide an optional third argument that will make the callback only fire if it * matches the `ItemType` provided. * - You can provide an optional fourth argument that will make the callback only fire if the * sub-type matches the `CollectibleType` or the `TrinketType` provided. * * ```ts * function preItemPickup( * player: EntityPlayer, * pickingUpItem: PickingUpItem, * ): boolean | undefined {} * ``` */ PRE_ITEM_PICKUP = 134, /** * The exact same thing as the vanilla `PRE_KNIFE_COLLISION` callback, except this callback allows * you to specify extra arguments for additional filtration. * * When registering the callback with the `ModUpgraded.AddCallbackCustom` method: * - You can provide an optional third argument that will make the callback only fire if it * matches the `KnifeVariant` provided. * - You can provide an optional fourth argument that will make the callback only fire if it * matches the sub-type provided. * * ```ts * function preKnifeCollisionFilter( * knife: EntityKnife, * collider: Entity, * low: boolean, * ): void {} * ``` */ PRE_KNIFE_COLLISION_FILTER = 135, /** * Fires on the `POST_RENDER` frame before the player is taken to a new floor. Only fires when a * player jumps into a trapdoor or enters a heaven door (beam of light). Does not fire on the * first floor of the run. Does not fire when the player reloads/reseeds the current floor (i.e. * Forget Me Now, 5-pip dice room). * * This callback passes the `EntityPlayer` object for the player who jumped into the trapdoor or * entered the heaven door, if needed. * * ```ts * function preNewLevel(player: EntityPlayer): void {} * ``` */ PRE_NEW_LEVEL = 136, /** * The exact same thing as the vanilla `PRE_NPC_COLLISION` callback, except this callback allows * you to specify extra arguments for additional filtration. * * When registering the callback with the `ModUpgraded.AddCallbackCustom` method: * - You can provide an optional third argument that will make the callback only fire if it * matches the `EntityType` provided. * - You can provide an optional fourth argument that will make the callback only fire if it * matches the variant provided. * - You can provide an optional fifth argument that will make the callback only fire if it * matches the sub-type provided. * * ```ts * function preNPCCollisionFilter( * npc: EntityNPC, * collider: Entity, * low: boolean, * ): boolean | undefined {} * ``` */ PRE_NPC_COLLISION_FILTER = 137, /** * The exact same thing as the vanilla `PRE_NPC_UPDATE` callback, except this callback allows you * to specify extra arguments for additional filtration. * * When registering the callback with the `ModUpgraded.AddCallbackCustom` method: * - You can provide an optional third argument that will make the callback only fire if it * matches the `EntityType` provided. * - You can provide an optional fourth argument that will make the callback only fire if it * matches the variant provided. * - You can provide an optional fifth argument that will make the callback only fire if it * matches the sub-type provided. * * ```ts * function preNPCUpdateFilter(entity: Entity): boolean | undefined {} * ``` */ PRE_NPC_UPDATE_FILTER = 138, /** * The exact same thing as the vanilla `PRE_PROJECTILE_COLLISION` callback, except this callback * allows you to specify extra arguments for additional filtration. * * When registering the callback with the `ModUpgraded.AddCallbackCustom` method: * - You can provide an optional third argument that will make the callback only fire if it * matches the `ProjectileVariant` provided. * - You can provide an optional fourth argument that will make the callback only fire if it * matches the sub-type provided. * * ```ts * function preProjectileCollisionFilter( * tear: EntityTear, * collider: Entity, * low: boolean, * ): void {} * ``` */ PRE_PROJECTILE_COLLISION_FILTER = 139, /** * The exact same thing as the vanilla `PRE_ROOM_ENTITY_SPAWN` callback, except this callback * allows you to specify extra arguments for additional filtration. * * When registering the callback with the `ModUpgraded.AddCallbackCustom` method: * - You can provide an optional third argument that will make the callback only fire if it * matches the `EntityType` or `GridEntityXMLType` provided. * - You can provide an optional fourth argument that will make the callback only fire if it * matches the variant provided. * - You can provide an optional fifth argument that will make the callback only fire if it * matches the sub-type provided. * * You can use the `isGridEntityXMLType` helper function to convert the * `entityTypeOrGridEntityXMLType` argument to an `EntityType` or `GridEntityXMLType`, if needed. * * ```ts * function preRoomEntitySpawnFilter( * entityTypeOrGridEntityXMLType: EntityType | GridEntityXMLType, * variant: int, * subType: int, * gridIndex: int, * seed: Seed, * ): [type: EntityType | GridEntityXMLType, variant: int, subType: int] | undefined {} * ``` */ PRE_ROOM_ENTITY_SPAWN_FILTER = 140, /** * The exact same thing as the vanilla `PRE_TEAR_COLLISION` callback, except this callback allows * you to specify extra arguments for additional filtration. * * When registering the callback with the `ModUpgraded.AddCallbackCustom` method: * - You can provide an optional third argument that will make the callback only fire if it * matches the `TearVariant` provided. * - You can provide an optional fourth argument that will make the callback only fire if it * matches the sub-type provided. * * ```ts * function preTearCollisionFilter( * tear: EntityTear, * collider: Entity, * low: boolean, * ): void {} * ``` */ PRE_TEAR_COLLISION_FILTER = 141 } /** * Mods can add extra things to the game (e.g. collectibles, trinkets, and so on). Since mods load * in alphabetical order, the total number of things can't be properly be known until at least one * callback fires (which indicates that all mods have been loaded). * * This feature gates all such functions behind a callback check. Subsequently, these functions will * throw a runtime error if they are called in the menu, before any callbacks have occurred. This * ensures that the proper values are always returned and allows you to get immediate feedback if * you accidentally access them from the menu. */ declare class ModdedElementDetection extends Feature { private atLeastOneCallbackFired; private readonly postPlayerInit; private errorIfNoCallbacksFired; /** * Returns the first modded collectible type, or undefined if there are no modded collectibles. * * This function can only be called if at least one callback has been executed. This is because * not all collectibles will necessarily be present when a mod first loads (due to mod load * order). * * In order to use this function, you must upgrade your mod with * `ISCFeature.MODDED_ELEMENT_DETECTION`. * * @public */ getFirstModdedCollectibleType(): CollectibleType | undefined; /** * Will change depending on how many modded collectibles there are. * * Equal to `itemConfig.GetCollectibles().Size - 1`. (`Size` includes invalid collectibles, like * 666. We subtract one to account for `CollectibleType.NULL`.) * * If there are no mods present that add any custom collectibles, this function will return * `CollectibleType.MOMS_RING` (732). * * This function can only be called if at least one callback has been executed. This is because * not all collectibles will necessarily be present when a mod first loads (due to mod load * order). * * In order to use this function, you must upgrade your mod with * `ISCFeature.MODDED_ELEMENT_DETECTION`. * * @public */ getLastCollectibleType(): CollectibleType; /** * Returns the total number of collectibles in the item config, including both vanilla and modded * collectibles. If you just need the number of vanilla collectible types, use the * `NUM_VANILLA_COLLECTIBLE_TYPES` constant. * * This function can only be called if at least one callback has been executed. This is because * not all collectibles will necessarily be present when a mod first loads (due to mod load * order). * * In order to use this function, you must upgrade your mod with * `ISCFeature.MODDED_ELEMENT_DETECTION`. * * @public */ getNumCollectibleTypes(): int; /** * Unlike vanilla collectible types, modded collectible types are always contiguous. * * This function can only be called if at least one callback has been executed. This is because * not all collectibles will necessarily be present when a mod first loads (due to mod load * order). * * In order to use this function, you must upgrade your mod with * `ISCFeature.MODDED_ELEMENT_DETECTION`. * * @public */ getNumModdedCollectibleTypes(): int; /** * Returns the first modded trinket type, or undefined if there are no modded trinkets. * * This function can only be called if at least one callback has been executed. This is because * not all trinkets will necessarily be present when a mod first loads (due to mod load order). * * In order to use this function, you must upgrade your mod with * `ISCFeature.MODDED_ELEMENT_DETECTION`. * * @public */ getFirstModdedTrinketType(): TrinketType | undefined; /** * Will change depending on how many modded trinkets there are. * * Equal to `itemConfig.GetTrinkets().Size - 1`. (`Size` includes invalid trinkets, like 47. We * subtract one to account for `TrinketType.NULL`.) * * If there are no mods present that add any custom trinkets, this function will return * `TrinketType.SIGIL_OF_BAPHOMET` (189). * * This function can only be called if at least one callback has been executed. This is because * not all trinkets will necessarily be present when a mod first loads (due to mod load order). * * In order to use this function, you must upgrade your mod with * `ISCFeature.MODDED_ELEMENT_DETECTION`. * * @public */ getLastTrinketType(): TrinketType; /** * Returns the total number of trinkets in the item config, including both vanilla and modded * trinkets. If you just need the number of vanilla trinket types, use the * `NUM_VANILLA_TRINKET_TYPES` constant. * * This function can only be called if at least one callback has been executed. This is because * not all trinkets will necessarily be present when a mod first loads (due to mod load order). * * In order to use this function, you must upgrade your mod with * `ISCFeature.MODDED_ELEMENT_DETECTION`. * * @public */ getNumTrinketTypes(): int; /** * Unlike vanilla trinket types, modded trinket types are always contiguous. * * This function can only be called if at least one callback has been executed. This is because * not all trinkets will necessarily be present when a mod first loads (due to mod load order). * * In order to use this function, you must upgrade your mod with * `ISCFeature.MODDED_ELEMENT_DETECTION`. * * @public */ getNumModdedTrinketTypes(): int; /** * Returns the first modded card sub-type, or undefined if there are no modded cards. * * This function can only be called if at least one callback has been executed. This is because * not all cards will necessarily be present when a mod first loads (due to mod load order). * * In order to use this function, you must upgrade your mod with * `ISCFeature.MODDED_ELEMENT_DETECTION`. * * @public */ getFirstModdedCardType(): CardType | undefined; /** * Will change depending on how many modded cards there are. * * Equal to `itemConfig.GetCards().Size - 1`. (`Size` includes invalid cards, but since cards are * contiguous, there are no invalid cards. We subtract one to account for `CardType.NULL`.) * * If there are no mods present that add any custom cards, this function will return * `CardType.SOUL_OF_JACOB_AND_ESAU` (97). * * This function can only be called if at least one callback has been executed. This is because * not all trinkets will necessarily be present when a mod first loads (due to mod load order). * * In order to use this function, you must upgrade your mod with * `ISCFeature.MODDED_ELEMENT_DETECTION`. * * @public */ getLastCardType(): CardType; /** * Returns the total number of cards in the item config, including both vanilla and modded cards. * If you just need the number of vanilla card types, use the `NUM_VANILLA_CARD_TYPES` constant. * * This function can only be called if at least one callback has been executed. This is because * not all cards will necessarily be present when a mod first loads (due to mod load order). * * In order to use this function, you must upgrade your mod with * `ISCFeature.MODDED_ELEMENT_DETECTION`. * * @public */ getNumCardTypes(): int; /** * Like vanilla card types, modded card types are always contiguous. * * This function can only be called if at least one callback has been executed. This is because * not all cards will necessarily be present when a mod first loads (due to mod load order). * * In order to use this function, you must upgrade your mod with * `ISCFeature.MODDED_ELEMENT_DETECTION`. * * @public */ getNumModdedCardTypes(): int; /** * Returns the first modded pill effect, or undefined if there are no modded pill effects. * * This function can only be called if at least one callback has been executed. This is because * not all pill effects will necessarily be present when a mod first loads (due to mod load * order). * * In order to use this function, you must upgrade your mod with * `ISCFeature.MODDED_ELEMENT_DETECTION`. * * @public */ getFirstModdedPillEffect(): PillEffect | undefined; /** * Will change depending on how many modded pill effects there are. * * Equal to `itemConfig.GetPillEffects().Size - 1`. (`Size` includes invalid pill effects, but * since pill effects are contiguous, there are no invalid pill effects. We subtract one to * account for the enum starting at 0 instead of 1.) * * If there are no mods present that add any custom pill effects, this function will return * `PillEffect.EXPERIMENTAL` (49). * * This function can only be called if at least one callback has been executed. This is because * not all pill effects will necessarily be present when a mod first loads (due to mod load * order). * * In order to use this function, you must upgrade your mod with * `ISCFeature.MODDED_ELEMENT_DETECTION`. * * @public */ getLastPillEffect(): PillEffect; /** * Returns the total number of pill effects in the item config, including both vanilla and modded * pill effects. If you just need the number of vanilla pill effects, use the * `NUM_VANILLA_PILL_EFFECTS` constant. * * This function can only be called if at least one callback has been executed. This is because * not all cards will necessarily be present when a mod first loads (due to mod load order). * * In order to use this function, you must upgrade your mod with * `ISCFeature.MODDED_ELEMENT_DETECTION`. * * @public */ getNumPillEffects(): int; /** * Like vanilla pill effects, modded pill effects are always contiguous. * * This function can only be called if at least one callback has been executed. This is because * not all cards will necessarily be present when a mod first loads (due to mod load order). * * In order to use this function, you must upgrade your mod with * `ISCFeature.MODDED_ELEMENT_DETECTION`. * * @public */ getNumModdedPillEffects(): int; } /** * A feature that lazy-inits and caches various arrays and sets that include both vanilla and modded * elements. This is useful for performance purposes (so that we do not have to reconstruct the * arrays/sets multiple times). * * The modded arrays/sets are created using the functions from * `ISCFeature.MODDED_ELEMENT_DETECTION`. */ declare class ModdedElementSets extends Feature { private arraysInitialized; private readonly allCollectibleTypesArray; private readonly allCollectibleTypesSet; private readonly moddedCollectibleTypesArray; private readonly moddedCollectibleTypesSet; private readonly allTrinketTypesArray; private readonly allTrinketTypesSet; private readonly moddedTrinketTypesArray; private readonly moddedTrinketTypesSet; private readonly allCardTypesArray; private readonly allCardTypesSet; private readonly moddedCardTypesArray; private readonly moddedCardTypesSet; private readonly allPillEffectsArray; private readonly allPillEffectsSet; private readonly moddedPillEffectsArray; private readonly moddedPillEffectsSet; private readonly cacheFlagToCollectibleTypesMap; private readonly cacheFlagToTrinketTypesMap; private flyingCollectibleTypes; private permanentFlyingCollectibleTypes; private flyingTrinketTypes; private readonly tagToCollectibleTypesMap; private readonly edenActiveCollectibleTypesSet; private readonly edenPassiveCollectibleTypesSet; private readonly qualityToCollectibleTypesMap; private readonly itemConfigCardTypeToCardTypeMap; /** * The array of card types that are not: * * - ItemConfigCardType.RUNE * - ItemConfigCardType.SPECIAL_OBJECT */ private readonly cardTypeCardArray; private readonly moddedElementDetection; private lazyInit; private lazyInitModdedCollectibleTypes; private lazyInitModdedTrinketTypes; private lazyInitModdedCardTypes; private lazyInitModdedPillEffects; private lazyInitTagToCollectibleTypesMap; private lazyInitCacheFlagToCollectibleTypesMap; private lazyInitCacheFlagToTrinketTypesMap; private lazyInitFlyingCollectibleTypesSet; private lazyInitFlyingTrinketTypesSet; private lazyInitEdenCollectibleTypesSet; private lazyInitQualityToCollectibleTypesMap; private lazyInitCardTypes; /** * Returns an array containing every valid collectible type in the game, including modded * collectibles. * * Use this if you need to iterate over the collectibles in order. If you need to do O(1) lookups, * then use the `getCollectibleTypesSet` helper function instead. * * This function can only be called if at least one callback has been executed. This is because * not all collectible types will necessarily be present when a mod first loads (due to mod load * order). * * In order to use this function, you must upgrade your mod with `ISCFeature.MODDED_ELEMENT_SETS`. * * @public */ getCollectibleTypes(): readonly CollectibleType[]; /** * Returns a set containing every valid collectible type in the game, including modded * collectibles. * * Use this if you need to do O(1) lookups. If you need to iterate over the collectibles in order, * then use the `getCollectibleTypes` helper function instead. * * This function can only be called if at least one callback has been executed. This is because * not all collectible types will necessarily be present when a mod first loads (due to mod load * order). * * In order to use this function, you must upgrade your mod with `ISCFeature.MODDED_ELEMENT_SETS`. * * @public */ getCollectibleTypeSet(): ReadonlySet; /** * Returns an array containing every modded collectible type in the game. * * Use this if you need to iterate over the collectibles in order. If you need to do O(1) lookups, * then use the `getModdedCollectibleTypesSet` helper function instead. * * This function can only be called if at least one callback has been executed. This is because * not all collectible types will necessarily be present when a mod first loads (due to mod load * order). * * In order to use this function, you must upgrade your mod with `ISCFeature.MODDED_ELEMENT_SETS`. * * @public */ getModdedCollectibleTypes(): readonly CollectibleType[]; /** * Returns a set containing every modded collectible type in the game. * * Use this if you need to do O(1) lookups. If you need to iterate over the collectibles in order, * then use the `getModdedCollectibleTypes` helper function instead. * * This function can only be called if at least one callback has been executed. This is because * not all collectible types will necessarily be present when a mod first loads (due to mod load * order). * * In order to use this function, you must upgrade your mod with `ISCFeature.MODDED_ELEMENT_SETS`. * * @public */ getModdedCollectibleTypesSet(): ReadonlySet; /** * Iterates over every collectible in the game and returns a map containing the number of each * item that the player has. * * Note that this will filter out non-real collectibles like Lilith's Incubus. * * This function can only be called if at least one callback has been executed. This is because * not all collectible types will necessarily be present when a mod first loads (due to mod load * order). * * In order to use this function, you must upgrade your mod with `ISCFeature.MODDED_ELEMENT_SETS`. * * @public */ getPlayerCollectibleMap(player: EntityPlayer): ReadonlyMap; /** * Returns an array containing every modded trinket type in the game. * * Use this if you need to iterate over the trinkets in order. If you need to do O(1) lookups, * then use the `getModdedTrinketTypesSet` helper function instead. * * This function can only be called if at least one callback has been executed. This is because * not all trinket types will necessarily be present when a mod first loads (due to mod load * order). * * In order to use this function, you must upgrade your mod with `ISCFeature.MODDED_ELEMENT_SETS`. * * @public */ getTrinketTypes(): readonly TrinketType[]; /** * Returns a set containing every modded trinket type in the game. * * Use this if you need to do O(1) lookups. If you need to iterate over the trinkets in order, * then use the `getModdedTrinketTypes` helper function instead. * * This function can only be called if at least one callback has been executed. This is because * not all trinket types will necessarily be present when a mod first loads (due to mod load * order). * * In order to use this function, you must upgrade your mod with `ISCFeature.MODDED_ELEMENT_SETS`. * * @public */ getTrinketTypesSet(): ReadonlySet; /** * Returns an array containing every modded trinket type in the game. * * Use this if you need to iterate over the trinkets in order. If you need to do O(1) lookups, * then use the `getModdedTrinketTypesSet` helper function instead. * * This function can only be called if at least one callback has been executed. This is because * not all trinket types will necessarily be present when a mod first loads (due to mod load * order). * * In order to use this function, you must upgrade your mod with `ISCFeature.MODDED_ELEMENT_SETS`. * * @public */ getModdedTrinketTypes(): readonly TrinketType[]; /** * Returns a set containing every modded trinket type in the game. * * Use this if you need to do O(1) lookups. If you need to iterate over the trinkets in order, * then use the `getModdedTrinketTypes` helper function instead. * * This function can only be called if at least one callback has been executed. This is because * not all trinket types will necessarily be present when a mod first loads (due to mod load * order). * * In order to use this function, you must upgrade your mod with `ISCFeature.MODDED_ELEMENT_SETS`. * * @public */ getModdedTrinketTypesSet(): ReadonlySet; /** * Returns an array containing every valid card type in the game, including modded cards. * * Use this if you need to iterate over the cards in order. If you need to do O(1) lookups, then * use the `getCardTypesSet` helper function instead. * * This function can only be called if at least one callback has been executed. This is because * not all card types will necessarily be present when a mod first loads (due to mod load order). * * In order to use this function, you must upgrade your mod with `ISCFeature.MODDED_ELEMENT_SETS`. * * @public */ getCardTypes(): readonly CardType[]; /** * Returns a set containing every valid card type in the game, including modded cards. * * Use this if you need to do O(1) lookups. If you need to iterate over the cards in order, then * use the `getCardTypes` helper function instead. * * This function can only be called if at least one callback has been executed. This is because * not all card types will necessarily be present when a mod first loads (due to mod load order). * * In order to use this function, you must upgrade your mod with `ISCFeature.MODDED_ELEMENT_SETS`. * * @public */ getCardTypesSet(): ReadonlySet; /** * Returns an array containing every modded card type in the game. * * Use this if you need to iterate over the cards in order. If you need to do O(1) lookups, then * use the `getModdedCardTypesSet` helper function instead. * * This function can only be called if at least one callback has been executed. This is because * not all card types will necessarily be present when a mod first loads (due to mod load order). * * In order to use this function, you must upgrade your mod with `ISCFeature.MODDED_ELEMENT_SETS`. * * @public */ getModdedCardTypes(): readonly CardType[]; /** * Returns a set containing every modded card type in the game. * * Use this if you need to do O(1) lookups. If you need to iterate over the cards in order, then * use the `getModdedCardTypes` helper function instead. * * This function can only be called if at least one callback has been executed. This is because * not all card types will necessarily be present when a mod first loads (due to mod load order). * * In order to use this function, you must upgrade your mod with `ISCFeature.MODDED_ELEMENT_SETS`. * * @public */ getModdedCardTypesSet(): ReadonlySet; /** * Returns an array containing every valid pill effect in the game, including modded pill effects. * * Use this if you need to iterate over the pill effects in order. If you need to do O(1) lookups, * then use the `getPillEffectSet` helper function instead. * * This function can only be called if at least one callback has been executed. This is because * not all pill effects will necessarily be present when a mod first loads (due to mod load * order). * * In order to use this function, you must upgrade your mod with `ISCFeature.MODDED_ELEMENT_SETS`. * * @public */ getPillEffects(): readonly PillEffect[]; /** * Returns a set containing every valid pill effect in the game, including modded pill effects. * * Use this if you need to do O(1) lookups. If you need to iterate over the pill effects in order, * then use the `getPillEffects` helper function instead. * * This function can only be called if at least one callback has been executed. This is because * not all pill effects will necessarily be present when a mod first loads (due to mod load * order). * * In order to use this function, you must upgrade your mod with `ISCFeature.MODDED_ELEMENT_SETS`. * * @public */ getPillEffectsSet(): ReadonlySet; /** * Returns an array containing every modded pill effect in the game. * * Use this if you need to iterate over the pill effects in order. If you need to do O(1) lookups, * then use the `getModdedPillEffectsSet` helper function instead. * * This function can only be called if at least one callback has been executed. This is because * not all pill effects will necessarily be present when a mod first loads (due to mod load * order). * * In order to use this function, you must upgrade your mod with `ISCFeature.MODDED_ELEMENT_SETS`. * * @public */ getModdedPillEffects(): readonly PillEffect[]; /** * Returns a set containing every modded pill effect in the game. * * Use this if you need to do O(1) lookups. If you need to iterate over the pill effects in order, * then use the `getModdedPillEffects` helper function instead. * * This function can only be called if at least one callback has been executed. This is because * not all pill effects will necessarily be present when a mod first loads (due to mod load * order). * * In order to use this function, you must upgrade your mod with `ISCFeature.MODDED_ELEMENT_SETS`. * * @public */ getModdedPillEffectsSet(): ReadonlySet; /** * Returns a set containing every collectible type with the given cache flag, including modded * collectibles. * * This function can only be called if at least one callback has been executed. This is because * not all collectible types will necessarily be present when a mod first loads (due to mod load * order). * * In order to use this function, you must upgrade your mod with `ISCFeature.MODDED_ELEMENT_SETS`. * * @public */ getCollectibleTypesWithCacheFlag(cacheFlag: CacheFlag): readonly CollectibleType[]; /** * Returns a set containing every trinket type with the given cache flag, including modded * trinkets. * * This function can only be called if at least one callback has been executed. This is because * not all trinket types will necessarily be present when a mod first loads (due to mod load * order). * * In order to use this function, you must upgrade your mod with `ISCFeature.MODDED_ELEMENT_SETS`. * * @public */ getTrinketsTypesWithCacheFlag(cacheFlag: CacheFlag): readonly TrinketType[]; /** * Returns an array containing every collectible type that the player has that matches the * provided `CacheFlag`. * * For example, if the cache flag is `CacheFlag.FLYING`, and the player has one Lord of the Pit * and two Dead Doves, then this function would return: * * ```ts * [ * CollectibleType.LORD_OF_THE_PIT, * CollectibleType.DEAD_DOVE, * CollectibleType.DEAD_DOVE, * ] * ``` * * Note that this array will not include collectibles that the player does not really have, like * Lilith's Incubus. * * This function can only be called if at least one callback has been executed. This is because * not all collectible types will necessarily be present when a mod first loads (due to mod load * order). * * In order to use this function, you must upgrade your mod with `ISCFeature.MODDED_ELEMENT_SETS`. * * @public */ getPlayerCollectiblesWithCacheFlag(player: EntityPlayer, cacheFlag: CacheFlag): readonly CollectibleType[]; /** * Returns a map containing every trinket type that the player has that matches the provided * `CacheFlag`. The values of the map correspond to the multiplier for that trinket. * * This function can only be called if at least one callback has been executed. This is because * not all trinket types will necessarily be present when a mod first loads (due to mod load * order). * * In order to use this function, you must upgrade your mod with `ISCFeature.MODDED_ELEMENT_SETS`. * * @public */ getPlayerTrinketsWithCacheFlag(player: EntityPlayer, cacheFlag: CacheFlag): ReadonlyMap; /** * Returns a set of all of the collectibles that grant flight. This is derived from collectibles * that have `CacheFlag.FLYING` set in the "items.xml" file. * * Vanilla collectibles that only grant flight conditionally are manually pruned. Collectibles * such as Empty Vessel should be checked for via the `hasFlyingTemporaryEffect` function. * * Under the hood, this is determined by looking at the collectibles that have `CacheFlag.FLYING` * and excluding the ones that have `CacheFlag.ALL`. (None of the collectibles with * `CacheFlag.ALL` grant flying, including all of the 3 Dollar Bill collectibles and all of the * Birthright effects.) * * This function can only be called if at least one callback has been executed. This is because * not all collectible types will necessarily be present when a mod first loads (due to mod load * order). * * In order to use this function, you must upgrade your mod with `ISCFeature.MODDED_ELEMENT_SETS`. * * @param includeConditionalItems Whether collectibles that only grant flight conditionally should * be included in the set (like Empty Vessel). * @public */ getFlyingCollectibleTypes(includeConditionalItems: boolean): readonly CollectibleType[]; /** * Returns a set of all of the trinkets that grant flight. (All vanilla trinkets that grant flight * do so conditionally, like Bat Wing and Azazel's Stump.) * * Under the hood, this is determined by looking at the trinkets that have `CacheFlag.FLYING` and * excluding the ones that have `CacheFlag.ALL`. (None of the trinket with `CacheFlag.ALL` grant * flying except for Azazel's Stump.) * * This function can only be called if at least one callback has been executed. This is because * not all trinket types will necessarily be present when a mod first loads (due to mod load * order). * * In order to use this function, you must upgrade your mod with `ISCFeature.MODDED_ELEMENT_SETS`. * * @public */ getFlyingTrinketTypes(): readonly TrinketType[]; /** * Returns a set containing every collectible type with the given tag. * * For example, to get all of the collectible types that count as offensive for the purposes of * Tainted Lost: * * ```ts * const offensiveCollectibleTypes = getCollectibleTypesWithTag(ItemConfigTag.OFFENSIVE); * ``` * * This function can only be called if at least one callback has been executed. This is because * not all collectible types will necessarily be present when a mod first loads (due to mod load * order). * * In order to use this function, you must upgrade your mod with `ISCFeature.MODDED_ELEMENT_SETS`. * * @public */ getCollectibleTypesWithTag(itemConfigTag: ItemConfigTag): readonly CollectibleType[]; /** * Returns an array of collectible types that a player has with a particular tag. * * This function can only be called if at least one callback has been executed. This is because * not all collectible types will necessarily be present when a mod first loads (due to mod load * order). * * In order to use this function, you must upgrade your mod with `ISCFeature.MODDED_ELEMENT_SETS`. * * @public */ getPlayerCollectiblesWithTag(player: EntityPlayer, itemConfigTag: ItemConfigTag): readonly CollectibleType[]; /** * Helper function to get all of the collectible types in the game that count towards a particular * transformation. * * For example, to get all of the collectible types that count towards Guppy: * * ```ts * const guppyCollectibleTypes = getCollectiblesForTransformation(PlayerForm.GUPPY); * ``` * * This function can only be called if at least one callback has been executed. This is because * not all collectible types will necessarily be present when a mod first loads (due to mod load * order). * * In order to use this function, you must upgrade your mod with `ISCFeature.MODDED_ELEMENT_SETS`. * * @public */ getCollectibleTypesForTransformation(playerForm: PlayerForm): readonly CollectibleType[]; /** * Returns an array of collectible types that a player has that count towards a particular * transformation. * * This function can only be called if at least one callback has been executed. This is because * not all collectible types will necessarily be present when a mod first loads (due to mod load * order). * * In order to use this function, you must upgrade your mod with `ISCFeature.MODDED_ELEMENT_SETS`. * * @public */ getPlayerCollectiblesForTransformation(player: EntityPlayer, playerForm: PlayerForm): readonly CollectibleType[]; /** * Returns a set containing every valid passive item that can be randomly granted to Eden as a * starting item. * * Under the hood, this is determined by looking at the "noeden" tag in "items_metadata.xml". * * This function can only be called if at least one callback has been executed. This is because * not all collectible types will necessarily be present when a mod first loads (due to mod load * order). * * In order to use this function, you must upgrade your mod with `ISCFeature.MODDED_ELEMENT_SETS`. * * @public */ getEdenActiveCollectibleTypes(): ReadonlySet; /** * Returns a set containing every valid passive item that can be randomly granted to Eden as a * starting item. * * Under the hood, this is determined by looking at the "noeden" tag in "items_metadata.xml". * * This function can only be called if at least one callback has been executed. This is because * not all collectible types will necessarily be present when a mod first loads (due to mod load * order). * * In order to use this function, you must upgrade your mod with `ISCFeature.MODDED_ELEMENT_SETS`. * * @public */ getEdenPassiveCollectibleTypes(): ReadonlySet; /** * Returns a random active collectible type that that is a valid starting item for Eden. * * This function can only be called if at least one callback has been executed. This is because * not all collectible types will necessarily be present when a mod first loads (due to mod load * order). * * 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.MODDED_ELEMENT_SETS`. * * @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 runes to not select. * @public */ getRandomEdenActiveCollectibleType(seedOrRNG: Seed | RNG | undefined, exceptions?: readonly CollectibleType[]): CollectibleType; /** * Returns a random passive collectible type that that is a valid starting item for Eden * (including familiars). * * This function can only be called if at least one callback has been executed. This is because * not all collectible types will necessarily be present when a mod first loads (due to mod load * order). * * 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.MODDED_ELEMENT_SETS`. * * @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 runes to not select. * @public */ getRandomEdenPassiveCollectibleType(seedOrRNG: Seed | RNG | undefined, exceptions?: readonly CollectibleType[]): CollectibleType; /** * Returns an array containing every collectible type with the given quality. * * This function can only be called if at least one callback has been executed. This is because * not all collectible types will necessarily be present when a mod first loads (due to mod load * order). * * In order to use this function, you must upgrade your mod with `ISCFeature.MODDED_ELEMENT_SETS`. * * @public */ getCollectibleTypesOfQuality(quality: Quality): readonly CollectibleType[]; /** * Returns an array of collectible types that a player has that are of a particular quality. * * This function can only be called if at least one callback has been executed. This is because * not all collectible types will necessarily be present when a mod first loads (due to mod load * order). * * In order to use this function, you must upgrade your mod with `ISCFeature.MODDED_ELEMENT_SETS`. * * @public */ getPlayerCollectiblesOfQuality(player: EntityPlayer, quality: Quality): readonly CollectibleType[]; /** * Helper function to get an array of card types matching the `ItemConfigCardType`. * * This function is variadic, meaning that you can you can specify N card types to get an array * containing cards that match any of the specified types. * * This function can only be called if at least one callback has been executed. This is because * not all card types will necessarily be present when a mod first loads (due to mod load order). * * In order to use this function, you must upgrade your mod with `ISCFeature.MODDED_ELEMENT_SETS`. * * @public */ getCardTypesOfType(...itemConfigCardTypes: readonly ItemConfigCardType[]): readonly CardType[]; /** * Helper function to get a random card type that matches the provided `ItemConfigCardType`. * * This function can only be called if at least one callback has been executed. This is because * not all card types will necessarily be present when a mod first loads (due to mod load order). * * If you want to get an unseeded card type, you must explicitly pass `undefined` to the * `seedOrRNG` parameter. * * In order to use this function, you must upgrade your mod with `ISCFeature.MODDED_ELEMENT_SETS`. * * @param itemConfigCardType The item config card type that represents the pool of cards to select * 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 cards to not select. * @public */ getRandomCardTypeOfType(itemConfigCardType: ItemConfigCardType, seedOrRNG: Seed | RNG | undefined, exceptions?: readonly CardType[]): CardType; /** * Has an equal chance of returning any card (e.g. Fool, Reverse Fool, Wild Card, etc.). * * This will not return: * - any runes * - any objects like Dice Shard * * This function can only be called if at least one callback has been executed. This is because * not all card types will necessarily be present when a mod first loads (due to mod load order). * * If you want to get an unseeded card type, you must explicitly pass `undefined` to the * `seedOrRNG` parameter. * * In order to use this function, you must upgrade your mod with `ISCFeature.MODDED_ELEMENT_SETS`. * * @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 cards to not select. * @public */ getRandomCard(seedOrRNG: Seed | RNG | undefined, exceptions?: readonly CardType[]): CardType; /** * Has an equal chance of returning any rune (e.g. Rune of Hagalaz, Blank Rune, Black Rune, Soul * of Isaac, etc.). This will never return a Rune Shard. * * This function can only be called if at least one callback has been executed. This is because * not all card types will necessarily be present when a mod first loads (due to mod load order). * * If you want to get an unseeded card type, you must explicitly pass `undefined` to the * `seedOrRNG` parameter. * * In order to use this function, you must upgrade your mod with `ISCFeature.MODDED_ELEMENT_SETS`. * * @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 runes to not select. * @public */ getRandomRune(seedOrRNG: Seed | RNG | undefined, exceptions?: readonly CardType[]): CardType; } /** * Helper class for mods that want to represent their individual features as classes. Extend your * mod features from this class in order to enable the `@Callback` and `@CustomCallback` decorators * that automatically subscribe to callbacks. * * It is recommended that you use the `initModFeatures` helper function to instantiate all of your * mod classes (instead of instantiating them yourself). This is so that any attached `v` objects * are properly registered with the save data manager; see below. * * If you are manually instantiating a mod feature yourself, then: * * - You must pass your upgraded mod as the first argument to the constructor. * - In almost all cases, you will want the callback functions to be immediately subscribed after * instantiating the class. However, if this is not the case, you can pass `false` as the optional * second argument to the constructor. * * If your mod feature has a property called `v`, it will be assumed that these are variables that * should be managed by the save data manager. Unfortunately, due to technical limitations with * classes, this registration will only occur if you initialize the class with the `initModFeatures` * helper function. (This is because the parent class does not have access to the child's properties * upon first construction.) */ export declare class ModFeature { private readonly mod; /** * An optional method that allows for conditional callback execution. If specified, any class * method that is annotated with a `@Callback` or `@CallbackCustom` decorator will only be fired * if the executed conditional function returns true. * * This property is used to easily turn entire mod features on and off (rather than repeating * conditional logic and early returning at the beginning of every callback function). * * Since the specific information for the firing callback is passed as arguments into the * conditional method, you can also write logic that would only apply to a specific type of * callback. * * By default, this is set to null, which means that all callback methods will fire * unconditionally. Override this property in your class if you need to use it. * * The function has the following signature: * * ```ts * ( * vanilla: T, // Whether this is a vanilla or custom callback. * modCallback: T extends true ? ModCallback : ModCallbackCustom, * ...callbackArgs: unknown[] // This would be e.g. `pickup: EntityPickup` for the `POST_PICKUP_INIT` callback. * ) => boolean; * ``` */ protected shouldCallbackMethodsFire: ((vanilla: T, modCallback: T extends true ? ModCallback : ModCallbackCustom, ...callbackArgs: readonly unknown[]) => boolean) | null; /** * Whether the feature has registered its callbacks yet. * * This will almost always be equal to true unless you explicitly passed `false` to the second * argument of the constructor. */ initialized: boolean; constructor(mod: ModUpgraded, init?: boolean); /** * Runs the `Mod.AddCallback` and `ModUpgraded.AddCallbackCustom` methods for all of the decorated * callbacks. Also registers/unregisters the "v" variable on the save data manager. * * @param init Optional. Whether to initialize or uninitialize. Default is true. */ init(init?: boolean): void; /** * Runs the `Mod.RemoveCallback` and `ModUpgraded.RemoveCallbackCustom` methods for all of the * decorated callbacks. * * This is just an alias for `ModFeature.init(false)`. */ uninit(): void; } export declare const MODIFIER_KEYS: readonly [Keyboard.LEFT_SHIFT, Keyboard.LEFT_CONTROL, Keyboard.LEFT_ALT, Keyboard.LEFT_SUPER, Keyboard.RIGHT_SHIFT, Keyboard.RIGHT_CONTROL, Keyboard.RIGHT_ALT, Keyboard.RIGHT_SUPER]; /** * `isaacscript-common` has many custom callbacks that you can use in your mods. Instead of * hijacking the vanilla `Mod` object, we provide a `ModUpgraded` object for you to use, which * extends the base class and adds a new method of `AddCallbackCustom`. * * To upgrade your mod, use the `upgradeMod` helper function. * * By specifying one or more optional features when upgrading your mod, you will get a version of * `ModUpgraded` that has extra methods corresponding to the features that were specified. (This * corresponds to the internal-type `ModUpgradedWithFeatures` type, which extends `ModUpgraded`.) */ export declare class ModUpgraded implements Mod { Name: string; /** We store a copy of the original mod object so that we can re-implement its functions. */ private readonly mod; private readonly debug; private readonly timeThreshold; private readonly callbacks; private readonly features; constructor(mod: Mod, debug: boolean, timeThreshold?: float); AddCallback(modCallback: T, ...args: T extends keyof AddCallbackParameters ? AddCallbackParameters[T] : unknown[]): void; AddPriorityCallback(modCallback: T, priority: CallbackPriority | int, ...args: T extends keyof AddCallbackParameters ? AddCallbackParameters[T] : unknown[]): void; HasData(): boolean; LoadData(): string; RemoveCallback(modCallback: T, callback: AddCallbackParameters[T][0]): void; RemoveData(): void; SaveData(data: string): void; /** * Registers a function to be executed when an in-game event happens. * * This method is specifically for events that are provided by the IsaacScript standard library. * For example, the `ModCallbackCustom.POST_BOMB_EXPLODE` event corresponds to when a bomb * explodes. */ AddCallbackCustom(modCallbackCustom: T, ...args: AddCallbackParametersCustom[T]): void; /** * The same as the `ModUpgraded.AddCallbackCustom` method, but allows setting a custom priority. * By default, callbacks are added with a priority of 0, so this allows you to add early or late * callbacks as necessary. See the `CallbackPriority` enum. */ AddPriorityCallbackCustom(modCallbackCustom: T, priority: CallbackPriority | int, ...args: AddCallbackParametersCustom[T]): void; /** * Unregisters a function that was previously registered with the `AddCallbackCustom` method. * * This method is specifically for events that are provided by the IsaacScript standard library. * For example, the `ModCallbackCustom.POST_BOMB_EXPLODE` event corresponds to when a bomb * explodes. * * This method does not care about the tertiary argument. In other words, regardless of the * conditions of how you registered the callback, it will be removed. */ RemoveCallbackCustom(modCallbackCustom: T, callback: AddCallbackParametersCustom[T][0]): void; /** * Logs every custom callback or extra feature that is currently enabled. Useful for debugging or * profiling. */ logUsedFeatures(): void; /** * This is used to initialize both custom callbacks and "extra features". * * This mirrors the `uninitFeature` method. */ private initFeature; /** * This is used to uninitialize both custom callbacks and "extra features". * * This mirrors the `initFeature` method. */ private uninitFeature; /** * Returns the names of the exported class methods from the features that were added. This is * called from the "upgradeMod" function, but we want to mark it as private so that end-users * don't have access to it. */ private initOptionalFeature; } /** * `isaacscript-common` has many custom callbacks that you can use in your mods. Instead of * hijacking the vanilla `Mod` object, we provide a `ModUpgraded` object for you to use, which * extends the base class and adds a new method of `AddCallbackCustom`. * * To upgrade your mod, use the `upgradeMod` helper function. * * By specifying one or more optional features, end-users will get a version of `ModUpgraded` that * has extra methods corresponding to the features that were specified. * * This type is in the private directory because if it was exported, it would cause all of the * internal feature classes to populate the auto-complete of end-user mods (which should never be * directly imported by end-users). */ declare type ModUpgradedWithFeatures = ModUpgraded & ISCFeaturesToKeys; export declare const MOVEMENT_BUTTON_ACTIONS: readonly [ButtonAction.LEFT, ButtonAction.RIGHT, ButtonAction.UP, ButtonAction.DOWN]; export declare const MOVEMENT_BUTTON_ACTIONS_SET: ReadonlySet; /** * Helper function to move all of the players to where they would normally go when arriving at a new * floor. (In normal mode, this is the center of the room. In Greed Mode, this is below the top * door.) * * If there is more than one player, they will be distributed around the center in a circle. * * This function emulates what happens in the vanilla game when you travel to a new floor. * * @param radius Optional. The radius of the circle. Default is 10. */ export declare function movePlayersToCenter(radius?: float): void; /** * A cached version of the class returned from the `MusicManager()` 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 musicManager: MusicManager; /** * The possible effects that the Mysterious Paper trinket can grant. * * This enum has hard-coded values because they correspond to the specific in-game frame count of * the player. */ export declare enum MysteriousPaperEffect { POLAROID = 0, NEGATIVE = 1, MISSING_PAGE = 2, MISSING_POSTER = 3 } /** * Helper type to get a range of integers between 0 and N - 1. * * From: * https://stackoverflow.com/questions/39494689/is-it-possible-to-restrict-number-to-a-certain-range */ export declare type NaturalNumbersLessThan = Acc["length"] extends N ? Acc[number] : NaturalNumbersLessThan; /** * Helper type to get a range of integers between 0 and N. * * From: * https://stackoverflow.com/questions/39494689/is-it-possible-to-restrict-number-to-a-certain-range */ export declare type NaturalNumbersLessThanOrEqualTo = Acc extends [unknown, ...infer Tail] ? Tail["length"] extends N ? Acc[number] : NaturalNumbersLessThanOrEqualTo : NaturalNumbersLessThanOrEqualTo; /** This is near the top door. */ export declare const NEW_FLOOR_STARTING_POSITION_GREED_MODE: Readonly; /** This is in the center of the room. */ export declare const NEW_FLOOR_STARTING_POSITION_NORMAL_MODE: Readonly; /** * This is next to the bottom door. Presumably, the player does not start in the center of the room * (like they do when getting to a new stage) so that the controls graphic is more visible. */ export declare const NEW_RUN_PLAYER_STARTING_POSITION: Readonly; /** * Initializes an array with all of the elements containing the specified default value. * * The provided default value will be copied with the `deepCopy` function before adding it to the * new array. Thus, you can initialize an array of arrays, or an array of maps, and so on. (If the * `deepCopy` function was not used, then all of the array elements would just be references to the * same underlying data structure.) * * For example: * * ```ts * const arrayWithZeroes = newArray(0, 10); // Has 10 elements of 0. * const arrayWithArrays = newArray([0], 20); // Has 20 elements of an array with a 0 in it. * ``` */ export declare function newArray(defaultValue: T, size: int): T[]; /** * Constructor for a `ChargeBarSprites` object. For more information, see the `renderChargeBar` * helper function. * * Note that this is for the vertical charge bar that represents the number of charges that an * active item has, not the circular charge bar that shows e.g. the charge rate of Brimstone. */ export declare function newChargeBarSprites(maxCharges: int): ChargeBarSprites; /** * Helper function to generate a new sprite based on a collectible. If the provided collectible type * is invalid, a sprite with a Curse of the Blind question mark will be returned. * * If you intentionally want a question mark sprite, pass -1 as the collectible type. */ export declare function newCollectibleSprite(collectibleType: CollectibleType | -1): Sprite; export declare function newPickingUpItem(): PickingUpItem; /** Returns a `PlayerHealth` object with all zeros. */ export declare function newPlayerHealth(): PlayerHealth; /** * Helper function to create a read-only `Color` object. (Otherwise, you would have to manually * specify both the type and the constructor.) * * Note that read-only colors will be writable at run-time. */ export declare function newReadonlyColor(r: float, g: float, b: float, a?: float, ro?: int, go?: int, bo?: int): Readonly; /** * Helper function to create a read-only `KColor` object. (Otherwise, you would have to manually * specify both the type and the constructor.) * * Note that read-only colors will be writable at run-time. */ export declare function newReadonlyKColor(r: float, g: float, b: float, a: float): Readonly; /** * Helper function to create a read-only `Vector` object. (Otherwise, you would have to manually * specify both the type and the constructor.) * * Note that read-only vectors will be writable at run-time. */ export declare function newReadonlyVector(x: float, y: float): Readonly; /** * Helper function to initialize a new RNG object using Blade's recommended shift index. * * @param seed Optional. The seed to initialize it with. Default is a random seed. */ export declare function newRNG(seed?: Seed): RNG; /** * Helper function to generate a new room on the floor. * * If you want to generate an unseeded room, you must explicitly pass `undefined` to the `seedOrRNG` * parameter. * * Under the hood, this function uses the `Level.MakeRedRoomDoor` method to create the room. * * @param seedOrRNG The `Seed` or `RNG` object to use. If an `RNG` object is provided, the * `RNG.Next` method will be called. Default is `Level.GetDungeonPlacementSeed`. * Note that the RNG is only used to select the random location to put the room on * the floor; it does not influence the randomly chosen room contents. (That is * performed by the game and can not be manipulated prior to its generation.) * @param ensureDeadEnd Optional. Whether to place the room at a valid dead end attached to a normal * room. If false, it will randomly appear at any valid location that would * have a red door. * @param customRoomData Optional. By default, the newly created room will have data corresponding * to the game's randomly generated red room. If you provide this function * with room data, it will be used to override the vanilla data. * @returns The room grid index of the new room or undefined if the floor had no valid dead ends to * place a room. */ export declare function newRoom(seedOrRNG: Seed | RNG | undefined, ensureDeadEnd?: boolean, customRoomData?: RoomConfig): int | undefined; /** * Helper function to load a new sprite and play its default animation. * * @param anm2Path The path to the "anm2" file that should be loaded. * @param pngPath Optional. The path to a custom PNG file that should be loaded on layer 0 of the * sprite. */ export declare function newSprite(anm2Path: string, pngPath?: string): Sprite; /** * Helper function to generate a new sprite based on a collectible. If the provided collectible type * is invalid, a sprite with a Curse of the Blind question mark will be returned. */ export declare function newTrinketSprite(trinketType: TrinketType): Sprite; /** * Initializes a new TypeScriptToLua class in the situation where you do not know what kind of class * it is. This function requires that you provide an instantiated class of the same type, as it will * use the class constructor that is present on the other object's metatable to initialize the new * class. */ export declare function newTSTLClass(oldClass: TSTLClass): TSTLClass; /** * Helper function to get the next seed value. * * This function is useful when you are working with seed values directly over RNG objects. */ export declare function nextSeed(seed: Seed): Seed; declare class NoSirenSteal extends Feature { private readonly postNPCInitSirenHelper; private checkReturnFamiliarToPlayer; private blacklistEntryExists; /** * Blacklists a familiar from being stolen by The Siren boss. This should be called once at the * beginning of every run. * * In order to use this function, you must upgrade your mod with `ISCFeature.NO_SIREN_STEAL`. * * @param familiarVariant The familiar variant to blacklist. * @param familiarSubType The sub-type to blacklist. Optional. The default is to blacklist all * sub-types of the given variant. * @public */ setFamiliarNoSirenSteal(familiarVariant: FamiliarVariant, familiarSubType?: int): void; } /** * The number of dimensions, not including `Dimension.CURRENT`. (This is derived from the * `Dimension` enum.) */ export declare const NUM_DIMENSIONS: number; /** * Calculated from the difference between the first pill color and the last pill color. This does * not include Gold Pills. In Repentance, this should be equal to 13. */ export declare const NUM_NORMAL_PILL_COLORS: number; /** * The pill pool for each run is comprised of one effect for each unique pill color (minus gold and * horse pills.) */ export declare const NUM_PILL_COLORS_IN_POOL: number; /** Calculated from the `Card` enum. `Card.NULL` is not included. */ export declare const NUM_VANILLA_CARD_TYPES: number; /** Calculated from the `Challenge` enum. `Challenge.NULL` is not included. */ export declare const NUM_VANILLA_CHALLENGES: number; /** Calculated from the `CollectibleType` enum. (`CollectibleType.NULL` is not included.) */ export declare const NUM_VANILLA_COLLECTIBLE_TYPES: number; /** * Calculated from the `PillEffect` enum. (There is no `PillEffect.NULL` in the custom enum, so we * do not have to subtract one here.) */ export declare const NUM_VANILLA_PILL_EFFECTS: int; /** Calculated from the `TrinketType` enum. (`TrinketType.NULL` is not included.) */ export declare const NUM_VANILLA_TRINKET_TYPES: number; /** * Helper function to convert the keys of an object to a read-only set. * * Note that the set values will be inserted in a random order, due to how `pairs` works under the * hood. * * Also see the `objectKeysToSet` function. */ export declare function objectKeysToReadonlySet(object: Record): ReadonlySet; /** * Helper function to convert the keys of an object to a set. * * Note that the set values will be inserted in a random order, due to how `pairs` works under the * hood. * * Also see the `objectKeysToReadonlySet` function. */ export declare function objectKeysToSet(object: Record): Set; /** * Helper function to convert an object to a map. * * This is useful when you need to construct a type safe object with the `satisfies` operator, but * then later on you need to query it in a way where you expect the return value to be T or * undefined. In this situation, by converting the object to a map, you can avoid unsafe type * assertions. * * Note that the map values will be inserted in a random order, due to how `pairs` works under the * hood. * * Also see the `objectToReadonlyMap` function. */ export declare function objectToMap(object: Record): ReadonlyMap; /** * Helper function to convert an object to a read-only map. * * This is useful when you need to construct a type safe object with the `satisfies` operator, but * then later on you need to query it in a way where you expect the return value to be T or * undefined. In this situation, by converting the object to a map, you can avoid unsafe type * assertions. * * Note that the map values will be inserted in a random order, due to how `pairs` works under the * hood. * * Also see the `objectToMap` function. */ export declare function objectToReadonlyMap(object: Record): ReadonlyMap; export declare type ObjectValues = T[keyof T]; /** * Helper function to convert the values of an object to a read-only set. * * Note that the set values will be inserted in a random order, due to how `pairs` works under the * hood. * * Also see the `objectValuesToSet` function. */ export declare function objectValuesToReadonlySet(object: Record): ReadonlySet; /** * Helper function to convert the values of an object to a set. * * Note that the set values will be inserted in a random order, due to how `pairs` works under the * hood. * * Also see the `objectValuesToReadonlySet` function. */ export declare function objectValuesToSet(object: Record): Set; /** Helper function to see if the player is playing any challenge. */ export declare function onAnyChallenge(): boolean; /** * Helper function to check if the player has taken Dad's Note. This sets the game state flag of * `GameStateFlag.BACKWARDS_PATH` and causes floor generation to change. */ export declare function onAscent(): boolean; export declare function onCathedral(): boolean; /** * Helper function to check to see if the player is playing a particular challenge. * * This function is variadic, meaning that you can specify as many challenges as you want to check * for. */ export declare function onChallenge(...challenges: readonly Challenge[]): boolean; export declare function onChest(): boolean; export declare function onDarkRoom(): boolean; export declare const ONE_BY_ONE_ROOM_GRID_SIZE = 135; /** * Helper function to check if the current stage matches one of the given stages. This uses the * `getEffectiveStage` helper function so that the Repentance floors are correctly adjusted. * * This function is variadic, which means you can pass as many stages as you want to match for. */ export declare function onEffectiveStage(...effectiveStages: readonly LevelStage[]): boolean; /** * Returns whether the player is on the "final floor" of the particular run. The final floor is * defined as one that prevents the player from entering the I AM ERROR room on. * * For example, when using Undefined on The Chest, it has a 50% chance of teleporting the player to * the Secret Room and a 50% chance of teleporting the player to the Super Secret Room, because the * I AM ERROR room is never entered into the list of possibilities. */ export declare function onFinalFloor(): boolean; /** * Returns whether the player is on the first floor of the particular run. * * This is tricky to determine because we have to handle the cases of Downpour/Dross 1 not being the * first floor and The Ascent. */ export declare function onFirstFloor(): boolean; /** * Helper function to check if the current game frame count is exactly equal to a specific game * frame count. * * This returns false if the submitted render frame count is null or undefined. */ export declare function onGameFrame(gameFrameCount: int | null | undefined): boolean; /** * Helper function to check if the current game frame count is equal to or higher than a specific * game frame count. */ export declare function onOrAfterGameFrame(gameFrameCount: int): boolean; /** * Helper function to check if the current render frame count is equal to or higher than a specific * render frame count. */ export declare function onOrAfterRenderFrame(renderFrameCount: int): boolean; /** * Helper function to check if the current room frame count is equal to or higher than a specific * room frame count. */ export declare function onOrAfterRoomFrame(roomFrameCount: int): boolean; /** * Helper function to check if the current game frame count is equal to or lower than a specific * game frame count. */ export declare function onOrBeforeGameFrame(gameFrameCount: int): boolean; /** * Helper function to check if the current render frame count is equal to or lower than a specific * render frame count. */ export declare function onOrBeforeRenderFrame(renderFrameCount: int): boolean; /** * Helper function to check if the current room frame count is equal to or lower than a specific * room frame count. */ export declare function onOrBeforeRoomFrame(roomFrameCount: int): boolean; /** * Helper function to check if the current render frame count is exactly equal to a specific render * frame count. * * This returns false if the submitted render frame count is null or undefined. */ export declare function onRenderFrame(renderFrameCount: int | null | undefined): boolean; /** * Helper function to check if the current stage type is equal to `StageType.REPENTANCE` or * `StageType.REPENTANCE_B`. */ export declare function onRepentanceStage(): boolean; /** * Helper function to check if the current room frame count is exactly equal to a specific room * frame count. * * This returns false if the submitted room frame count is null or undefined. */ export declare function onRoomFrame(roomFrameCount: int | null | undefined): boolean; /** * Helper function to check whether the player is playing on a set seed (i.e. that they entered in a * specific seed by pressing tab on the character selection screen). When the player resets the game * on a set seed, the game will not switch to a different seed. * * Under the hood, this checks if the current challenge is `Challenge.NULL` and the * `Seeds.IsCustomRun` method. */ export declare function onSetSeed(): boolean; export declare function onSheol(): boolean; /** * Helper function to check if the current stage matches one of the given stages. * * This function is variadic, which means you can pass as many stages as you want to match for. */ export declare function onStage(...stages: readonly LevelStage[]): boolean; /** Helper function to check if the current stage is equal to or higher than the given stage. */ export declare function onStageOrHigher(stage: LevelStage): boolean; /** Helper function to check if the current stage is equal to or higher than the given stage. */ export declare function onStageOrLower(stage: LevelStage): boolean; /** * Helper function to check if the current stage matches one of the given stage types. * * This function is variadic, which means you can pass as many room types as you want to match for. */ export declare function onStageType(...stageTypes: readonly StageType[]): boolean; /** * Helper function to check if the current stage is one that has the possibility to grant a natural * Devil Room or Angel Room after killing the boss. */ export declare function onStageWithNaturalDevilRoom(): boolean; /** * Helper function to check if the current stage is one that will have a random collectible drop * upon defeating the boss of the floor. * * This happens on most stages but will not happen on Depths 2, Womb 2, Sheol, Cathedral, Dark Room, * The Chest, and Home (due to the presence of a story boss). * * Note that even though Delirium does not drop a random boss collectible, The Void is still * considered to be a stage that has a random boss collectible since all of the non-Delirium Boss * Rooms will drop random boss collectibles. */ export declare function onStageWithRandomBossCollectible(): boolean; /** * Helper function to check if the current stage will spawn a locked door to Downpour/Dross after * defeating the boss. */ export declare function onStageWithSecretExitToDownpour(): boolean; /** * Helper function to check if the current stage will spawn a spiked door to Mausoleum/Gehenna after * defeating the boss. */ export declare function onStageWithSecretExitToMausoleum(): boolean; /** * Helper function to check if the current stage will spawn a wooden door to Mines/Ashpit after * defeating the boss. */ export declare function onStageWithSecretExitToMines(): boolean; /** * Helper function to check if the current stage is one that would create a trapdoor if We Need to * Go Deeper was used. */ export declare function onStageWithShovelTrapdoors(): boolean; /** * Helper function to check if the current stage is one with a story boss. Specifically, this is * Depths 2 (Mom), Womb 2 (Mom's Heart / It Lives), Blue Womb (Hush), Sheol (Satan), Cathedral * (Isaac), Dark Room (Lamb), The Chest (Blue Baby), The Void (Delirium), and Home (Dogma / The * Beast). */ export declare function onStageWithStoryBoss(): boolean; /** * Helper function to check whether the player is on a Victory Lap (i.e. they answered "yes" to the * popup that happens after defeating The Lamb). */ export declare function onVictoryLap(): boolean; /** * For the purposes of this function, doors to Secret Rooms or Super Secret Rooms that have not been * discovered yet will not be opened. */ export declare function openAllDoors(): void; /** * Use this instead of the `GridEntityDoor.Open` method if you want the door to immediately open * without an animation. */ export declare function openDoorFast(door: GridEntityDoor): void; declare type OptionalArgs = AllButFirst; /** * Helper function to parse a string that contains an entity type, a variant, and a sub-type, * separated by periods. * * For example, passing "45.0.1" would return an array of [45, 0, 1]. * * Returns undefined if the string cannot be parsed. */ export declare function parseEntityID(entityID: string): [entityType: EntityType, variant: int, subType: int] | undefined; /** * Helper function to parse a string that contains an entity type and a variant separated by a * period. * * For example, passing "45.0" would return an array of [45, 0]. * * Returns undefined if the string cannot be parsed. */ export declare function parseEntityTypeVariantString(entityTypeVariantString: string): [entityType: EntityType, variant: int] | undefined; /** * Helper function to convert a string to an integer. Returns undefined if the string is not an * integer. * * Under the hood, this uses the built-in `tonumber` and `math.floor` functions. * * This is named `parseIntSafe` in order to match the helper function from `complete-common`. */ export declare function parseIntSafe(string: string): int | undefined; /** * Helper function to parse a Semantic Versioning string into its individual constituents. Returns * undefined if the submitted string was not a proper Semantic Version string. * * @see https://semver.org/ */ export declare function parseSemanticVersion(versionString: string): { majorVersion: int; minorVersion: int; patchVersion: int; } | undefined; declare class Pause extends Feature { private readonly disableInputs; private readonly postUpdate; private stopTearsAndProjectilesFromMoving; private readonly inputActionGetActionValue; /** * Helper function to check if the pause feature from `isaacscript-common` is currently * pseudo-pausing the game. * * @public */ isPaused(): boolean; /** * Helper function to emulate what happens when the player pauses the game. Use the `unpause` * function to return things back to normal. * * Under the hood, this function: * - uses the Pause collectible on every game frame * - disables any player inputs (except for `ButtonAction.MENU_CONFIRM` and * `ButtonAction.CONSOLE`) * * In order to use this function, you must upgrade your mod with `ISCFeature.PAUSE`. * * @public */ pause(): void; /** * Helper function to put things back to normal after the `pause` function was used. * * In order to use this function, you must upgrade your mod with `ISCFeature.PAUSE`. * * @public */ unpause(): void; } declare class PersistentEntities extends Feature { private readonly roomHistory; private readonly postEntityRemove; /** * The persistent entity is despawning because the player is in the process of leaving the room. * Keep track of the position for later. */ private trackDespawningPickupPosition; private readonly postNewRoomReordered; private spawnAndTrack; /** * Helper function to stop an entity spawned with the `spawnPersistentEntity` helper function from * respawning. * * In order to use this function, you must upgrade your mod with `ISCFeature.PERSISTENT_ENTITIES`. * * @param persistentEntityIndex The index that was returned by the `spawnPersistentEntity` * function. * @param removeEntity Optional. True by default. Set to false if you want to stop an entity from * being persistent but you don't want to actually remove the * currently-spawned entity from the room. * @public */ removePersistentEntity(persistentEntityIndex: int, removeEntity?: boolean): void; /** * Helper function to spawn an entity that will have persistence similar to a pickup. * * By default, as soon as you leave a room, any spawned entities will be despawned and will not * return if the player revisits the room. This means that if you want to have an entity like a * pickup, you have to manually respawn it when the player re-enters the room. Use this helper * function to avoid having to do any tracking on your own. * * Conventionally, the word "persistent" refers to `EntityFlag.FLAG_PERSISTENT`, which is used on * e.g. familiars to make them appear in every room. On the other hand, pickups are also * persistent, but they are not present in every room, only one specific room. This function * spawns entities like pickups, not familiars. * * In order to use this function, you must upgrade your mod with `ISCFeature.PERSISTENT_ENTITIES`. * * @returns An object containing the entity and the persistent entity index. You can use the index * with the `removePersistentEntity` function. * @public */ spawnPersistentEntity(entityType: EntityType, variant: int, subType: int, position: Vector): { entity: Entity; persistentIndex: int; }; } export declare type PickingUpItem = PickingUpItemNull | PickingUpItemCollectible | PickingUpItemTrinket; /** Part of `PickingUpItem`. */ export declare interface PickingUpItemCollectible { /** Needed so that we can distinguish between picking up a collectible and a trinket. */ itemType: ItemType.PASSIVE | ItemType.ACTIVE | ItemType.FAMILIAR; /** Equal to either the collectible type, the trinket type, or 0. */ subType: CollectibleType; } /** Part of `PickingUpItem`. */ export declare interface PickingUpItemNull { /** Needed so that we can distinguish between picking up a collectible and a trinket. */ itemType: ItemType.NULL; /** Equal to either the collectible type, the trinket type, or 0. */ subType: 0; } /** Part of `PickingUpItem`. */ export declare interface PickingUpItemTrinket { /** Needed so that we can distinguish between picking up a collectible and a trinket. */ itemType: ItemType.TRINKET; /** Equal to either the collectible type, the trinket type, or 0. */ subType: TrinketType; } declare class PickupChangeDetection extends Feature { v: { room: { pickupVariants: Map; pickupSubTypes: Map; }; }; private readonly postPickupChanged; private readonly pickupIndexCreation; constructor(postPickupChanged: PostPickupChanged, pickupIndexCreation: PickupIndexCreation); private readonly postPickupUpdate; } /** * `PickupIndex` is a specific type of number that represents a unique identifier for a pickup. Mods * can signify that data structures handle collectibles by using this type. * * For more information, see the documentation for the `getPickupIndex` function. * * For example: * * ```ts * const pickupNameMap = new Map(); * ``` * * This type is branded for extra type safety. */ export declare type PickupIndex = int & { readonly __pickupIndexBrand: symbol; }; declare class PickupIndexCreation extends Feature { private readonly roomHistory; private readonly saveDataManager; private readonly postPickupInit; private setPickupIndex; private getPickupIndexFromPreviousData; private readonly postEntityRemovePickup; private checkDespawningFromPlayerLeavingRoom; /** * This is a pickup that is despawning because the player is in the process of leaving the room. * Keep track of the metadata for later. */ private trackDespawningPickupMetadata; /** * If the despawning pickup was in a Treasure Room or Boss Room, then it is possible that the * pickup could re-appear during The Ascent. If this is the case, we store the metadata on a * separate map to reference later. */ private getPickupDataMapForCurrentRoom; private getPostAscentPickupIndex; /** * Mods often have to track variables relating to a pickups. Finding an index for these kinds of * data structures is difficult, since pickups are respawned every time a player re-enters a room, * so the `PtrHash` will change. * * Use this function to get a unique index for a pickup to use in these data structures. * * Specifically, `PickupIndex` is a number that represents the spawn order of the pickup on the * current run. For example, the first pickup spawned will have an index of 1, the second one will * have an index of 2, and so on. * * Tracking pickups requires stateful tracking, so using pickup indexes requires an upgraded mod. * * Note that the pickup index will not change: * - When a pickup is rolled with e.g. D6 or D20. * - When an item is "rotated" via e.g. Tainted Isaac's mechanic. * * In order to use this function, you must upgrade your mod with * `ISCFeature.PICKUP_INDEX_CREATION`. */ getPickupIndex(pickup: EntityPickup): PickupIndex; } /** Maps pill effect names to the values of the `PillEffect` enum. */ export declare const PILL_NAME_TO_EFFECT_MAP: ReadonlyMap; /** * Helper function to play the appropriate sound effect for a player after getting one or more * charges on their active item. (There is a different sound depending on whether the item is fully * charged.) * * @param player The player to play the sound effect for. * @param activeSlot Optional. The slot that was just charged. Default is `ActiveSlot.PRIMARY`. */ export declare function playChargeSoundEffect(player: EntityPlayer, activeSlot?: ActiveSlot): void; declare class PlayerCollectibleDetection extends Feature { v: { run: { playersCollectibleCount: DefaultMap; playersCollectibleMap: DefaultMap, []>; playersActiveItemMap: DefaultMap, []>; }; }; private readonly postPlayerCollectibleAdded; private readonly postPlayerCollectibleRemoved; private readonly moddedElementSets; private readonly runInNFrames; constructor(postPlayerCollectibleAdded: PostPlayerCollectibleAdded, postPlayerCollectibleRemoved: PostPlayerCollectibleRemoved, moddedElementSets: ModdedElementSets, runInNFrames: RunInNFrames); /** * This is called when the collectible count changes and in situations where the entire build is * rerolled. * * Since getting a new player collectible map is expensive, we want to only run this function when * necessary, and not on e.g. every frame. Unfortunately, this has the side effect of missing out * on collectible changes from mods that add and remove a collectible on the same frame. * * @param player The player to update. * @param numCollectiblesChanged Pass undefined for situations where the entire build was * rerolled. */ private updateCollectibleMapAndFire; private readonly postUseItemD4; /** We need to handle the case of Tainted Eden taking damage. */ private readonly entityTakeDmgPlayer; /** * We need to handle TMTRAINER collectibles, since they do not cause the player's collectible * count to change. */ private readonly postItemPickup; private readonly postPEffectUpdateReordered; /** * Checking for collectible count will work to detect when a player swaps their active item for * another active item. This is because the collectible count will decrement by 1 when the item is * swapped onto the pedestal and the hold animation begins, and increment by 1 when the item is * dequeued and the hold animation ends. * * However, we also want to explicitly check for the case where a mod swaps in a custom active * collectible on the same frame, since doing so is cheap. */ private checkActiveItemsChanged; } declare class PlayerCollectibleTracking extends Feature { private readonly postPlayerCollectibleAdded; private readonly postPlayerCollectibleRemoved; /** * Helper function to get all of the collectible types that the player has gotten so far on this * run, in order. * * In the case of items given on the first frame of the run or the case where the player rerolls * their build in the middle of the run (e.g. with D4), the order of the collectible types will * not correspond to the order that the items were actually given to the player. In this case, the * order will be from the lowest `CollectibleType` to the highest. * * Under the hood, this feature works by tracking the number of collectibles that a player has on * every frame. Thus, in a situation where a collectible was both added and removed to the player * on the same frame, the amount of total collectibles would stay the same, and the collectible * types would not be updated. In vanilla, this situation would never happen, but another mod * might do this for some reason. (With that said, the next time that a collectible is normally * added or removed, it would trigger a re-scan, and the previous changes would be picked up.) * * In order to use this function, you must upgrade your mod with * `ISCFeature.PLAYER_COLLECTIBLE_TRACKING`. * * @param player The player to get the collectible types for. * @param includeActiveCollectibles Optional. If true, will include all active collectibles. * Default is true. * @public */ getPlayerCollectibleTypes(player: EntityPlayer, includeActiveCollectibles?: boolean): readonly CollectibleType[]; /** * Helper function to get the last passive collectible type that the player picked up. In most * cases, this will be the passive that would be removed if the player used Clicker. * * Returns undefined if the player does not have any passive collectibles. * * In order to use this function, you must upgrade your mod with * `ISCFeature.PLAYER_COLLECTIBLE_TRACKING`. * * @public */ getPlayerLastPassiveCollectibleType(player: EntityPlayer): CollectibleType | undefined; } /** * Helper function to remove all of a player's black hearts and add the corresponding amount of soul * hearts. */ export declare function playerConvertBlackHeartsToSoulHearts(player: EntityPlayer): void; /** * Helper function to remove all of a player's soul hearts and add the corresponding amount of black * hearts. */ export declare function playerConvertSoulHeartsToBlackHearts(player: EntityPlayer): void; /** * Helper function to see if the player is out of health. * * Specifically, this function will return false if the player has 0 red hearts, 0 soul/black * hearts, and 0 bone hearts. */ export declare function playerHasHealthLeft(player: EntityPlayer): boolean; /** This is used by the `getPlayerHealth` and `setPlayerHealth` helper functions. */ export declare interface PlayerHealth { maxHearts: int; hearts: int; eternalHearts: int; /** For soul hearts to apply, they also have to be specified in the `soulHeartTypes` array. */ soulHearts: int; /** For bone hearts to apply, they also have to be specified in the `soulHeartTypes` array. */ boneHearts: int; goldenHearts: int; rottenHearts: int; brokenHearts: int; soulCharges: int; bloodCharges: int; soulHeartTypes: SoulHeartType[]; } /** * `PlayerIndex` is a specific type of number that represents a unique identifier for a player. Mods * can signify that data structures handle `EntityPlayer` by using this type. * * For more information, see the documentation for the `getPlayerIndex` function. * * For example: * * ```ts * const playersNameMap = new Map(); * ``` * * This type is branded for extra type safety. */ export declare type PlayerIndex = int & { readonly __playerIndexBrand: symbol; }; declare class PlayerReorderedCallbacks extends Feature { v: { run: { postGameStartedFiredOnThisRun: boolean; postPEffectUpdateQueue: QueueElement[]; postPlayerUpdateQueue: QueueElement[]; postPlayerRenderQueue: QueueElement[]; }; }; private readonly postPEffectUpdateReordered; private readonly postPlayerRenderReordered; private readonly postPlayerUpdateReordered; constructor(postPEffectUpdateReordered: PostPEffectUpdateReordered, postPlayerRenderReordered: PostPlayerRenderReordered, postPlayerUpdateReordered: PostPlayerUpdateReordered); private readonly postPEffectUpdate; private readonly postPlayerUpdate; private readonly postPlayerRender; private readonly postGameStartedReorderedLast; } /** This represents the kinds of stats that a player can have. */ export declare enum PlayerStat { /** Corresponds to `CacheFlag.DAMAGE` (1 << 0) and `EntityPlayer.Damage`. */ DAMAGE = 0, /** Corresponds to `CacheFlag.FIRE_DELAY` (1 << 1) and `EntityPlayer.MaxFireDelay`. */ FIRE_DELAY = 1, /** Corresponds to `CacheFlag.SHOT_SPEED` (1 << 2) and `EntityPlayer.ShotSpeed`. */ SHOT_SPEED = 2, /** Corresponds to `CacheFlag.RANGE` (1 << 3) and `EntityPlayer.TearHeight`. */ TEAR_HEIGHT = 3, /** Corresponds to `CacheFlag.RANGE` (1 << 3) and `EntityPlayer.TearRange`. */ TEAR_RANGE = 4, /** Corresponds to `CacheFlag.RANGE` (1 << 3) and `EntityPlayer.TearFallingAcceleration`. */ TEAR_FALLING_ACCELERATION = 5, /** Corresponds to `CacheFlag.RANGE` (1 << 3) and `EntityPlayer.TearFallingSpeed`. */ TEAR_FALLING_SPEED = 6, /** Corresponds to `CacheFlag.SPEED` (1 << 4) and `EntityPlayer.MoveSpeed`. */ MOVE_SPEED = 7, /** Corresponds to `CacheFlag.TEAR_FLAG` (1 << 5) and `EntityPlayer.TearFlags`. */ TEAR_FLAG = 8, /** Corresponds to `CacheFlag.TEAR_COLOR` (1 << 6) and `EntityPlayer.TearColor`. */ TEAR_COLOR = 9, /** Corresponds to `CacheFlag.FLYING` (1 << 7) and `EntityPlayer.CanFly`. */ FLYING = 10, /** Corresponds to `CacheFlag.LUCK` (1 << 10) and `EntityPlayer.Luck`. */ LUCK = 11, /** Corresponds to `CacheFlag.SIZE` (1 << 11) and `EntityPlayer.SpriteScale`. */ SIZE = 12 } /** * Contains every player stat along with its corresponding data type. For example, `StatType.DAMAGE` * is a `float` type. */ export declare interface PlayerStats { [PlayerStat.DAMAGE]: float; [PlayerStat.FIRE_DELAY]: float; [PlayerStat.SHOT_SPEED]: float; [PlayerStat.TEAR_HEIGHT]: float; [PlayerStat.TEAR_RANGE]: float; [PlayerStat.TEAR_FALLING_ACCELERATION]: float; [PlayerStat.TEAR_FALLING_SPEED]: float; [PlayerStat.MOVE_SPEED]: float; [PlayerStat.TEAR_FLAG]: BitFlags; [PlayerStat.TEAR_COLOR]: Color; [PlayerStat.FLYING]: boolean; [PlayerStat.LUCK]: float; [PlayerStat.SIZE]: Vector; } /** This is used by the `getPocketItems` and related helper functions. */ export declare interface PocketItemDescription { slot: PocketItemSlot; type: PocketItemType; subType: int; } /** Helper function to see if two sets of pocket item descriptions are identical. */ export declare function pocketItemsEquals(pocketItems1: readonly PocketItemDescription[], pocketItems2: readonly PocketItemDescription[]): boolean; /** This is used in the various pocket item helper functions. */ export declare enum PocketItemType { EMPTY = 0, CARD = 1, PILL = 2, ACTIVE_ITEM = 3, DICE_BAG_DICE = 4, UNDETERMINABLE = 5 } declare class PonyDetection extends Feature { private readonly postPEffectUpdateReordered; /** * Helper function to see if the player is under the effects of A Pony or White Pony charge. * Detecting this is difficult, as the temporary effect will disappear upon entering a new room. * * In order to use this function, you must upgrade your mod with `ISCFeature.PONY_DETECTION`. * * @public */ isPlayerUsingPony(player: EntityPlayer): boolean; /** * Helper function to see if any player is under the effects of A Pony or White Pony charge. * Detecting this is difficult, as the temporary effect will disappear upon entering a new room. * * In order to use this function, you must upgrade your mod with `ISCFeature.PONY_DETECTION`. * * @public */ anyPlayerUsingPony(): boolean; } /** * These are the possible types that player stats can be. For example, `EntityPlayer.Damage` is of * type `float`, `EntityPlayer.CanFly` is of type `boolean`, and so on. */ export declare type PossibleStatType = number | boolean | BitFlags | Color | Vector; declare class PostCustomRevive extends CustomCallback { constructor(); protected shouldFire: (fireArgs: FireArgs, optionalArgs: OptionalArgs) => boolean; } declare class PostEsauJr extends CustomCallback { constructor(); } declare class PostFirstEsauJr extends CustomCallback { constructor(); } declare class PostFirstFlip extends CustomCallback { constructor(); } declare class PostFlip extends CustomCallback { constructor(); } declare class PostGridEntityBroken extends CustomCallback { constructor(); protected shouldFire: typeof shouldFireGridEntity; } declare class PostGridEntityCollision extends CustomCallback { constructor(); protected shouldFire: (fireArgs: FireArgs, optionalArgs: OptionalArgs) => boolean; } declare class PostGridEntityCustomBroken extends CustomCallback { constructor(); protected shouldFire: typeof shouldFireGridEntityCustom; } declare class PostGridEntityCustomCollision extends CustomCallback { constructor(); protected shouldFire: (fireArgs: FireArgs, optionalArgs: OptionalArgs) => boolean; } declare class PostGridEntityCustomInit extends CustomCallback { constructor(); protected shouldFire: typeof shouldFireGridEntityCustom; } declare class PostGridEntityCustomRemove extends CustomCallback { constructor(); protected shouldFire: (fireArgs: FireArgs, optionalArgs: OptionalArgs) => boolean; } declare class PostGridEntityCustomRender extends CustomCallback { constructor(); protected shouldFire: typeof shouldFireGridEntityCustom; } declare class PostGridEntityCustomStateChanged extends CustomCallback { constructor(); protected shouldFire: typeof shouldFireGridEntityCustom; } declare class PostGridEntityCustomUpdate extends CustomCallback { constructor(); protected shouldFire: typeof shouldFireGridEntityCustom; } declare class PostGridEntityInit extends CustomCallback { constructor(); protected shouldFire: typeof shouldFireGridEntity; } declare class PostGridEntityRemove extends CustomCallback { constructor(); protected shouldFire: (fireArgs: FireArgs, optionalArgs: OptionalArgs) => boolean; } declare class PostGridEntityRender extends CustomCallback { constructor(); protected shouldFire: typeof shouldFireGridEntity; } declare class PostGridEntityStateChanged extends CustomCallback { constructor(); protected shouldFire: typeof shouldFireGridEntity; } declare class PostGridEntityUpdate extends CustomCallback { constructor(); protected shouldFire: typeof shouldFireGridEntity; } declare class PostItemPickup extends CustomCallback { constructor(); protected shouldFire: typeof shouldFireItemPickup; } declare class PostPEffectUpdateReordered extends CustomCallback { constructor(); protected shouldFire: typeof shouldFirePlayer; } declare class PostPickupChanged extends CustomCallback { constructor(); protected shouldFire: typeof shouldFirePickup; } declare class PostPlayerCollectibleAdded extends CustomCallback { constructor(); protected shouldFire: typeof shouldFireCollectibleType; } declare class PostPlayerCollectibleRemoved extends CustomCallback { constructor(); protected shouldFire: typeof shouldFireCollectibleType; } declare class PostPlayerRenderReordered extends CustomCallback { constructor(); protected shouldFire: typeof shouldFirePlayer; } declare class PostPlayerUpdateReordered extends CustomCallback { constructor(); protected shouldFire: typeof shouldFirePlayer; } declare class PostSlotAnimationChanged extends CustomCallback { constructor(); protected shouldFire: typeof shouldFireSlot; } declare class PostSlotDestroyed extends CustomCallback { constructor(); protected shouldFire: typeof shouldFireSlot; } declare class PostSlotInit extends CustomCallback { constructor(); protected shouldFire: typeof shouldFireSlot; } declare class PostSlotRender extends CustomCallback { constructor(); protected shouldFire: typeof shouldFireSlot; } declare class PostSlotUpdate extends CustomCallback { constructor(); protected shouldFire: typeof shouldFireSlot; } declare class PreCustomRevive extends CustomCallback { constructor(); protected shouldFire: typeof shouldFirePlayer; } declare class PreItemPickup extends CustomCallback { constructor(); protected shouldFire: typeof shouldFireItemPickup; } declare class PressInput extends Feature { private readonly isActionTriggered; /** * Helper function to press an arbitrary `ButtonAction` on the next possible input poll. In most * cases, this will be equivalent to if the first player pressed the corresponding input. It * usually takes 1 frame for the input to take effect. * * In order to use this function, you must upgrade your mod with `ISCFeature.PRESS_INPUT`. */ pressInput(player: EntityPlayer, buttonAction: ButtonAction): void; } declare class PreventChildEntities extends Feature { private readonly postNPCInit; /** * Helper function to prevent an entity from spawning any other entities. Meant to be used on NPCs * like Squirts. This behavior will only last for the current room. * * Under the hood, this function will remove any new NPCs spawned that have a * `Entity.SpawnerEntity` or `Entity.Parent` value that matches the provided entity. (They are * removed during the `POST_NPC_INIT` callback specifically.) * * In order to use this function, you must upgrade your mod with * `ISCFeature.PREVENT_CHILD_ENTITIES`. * * @public */ preventChildEntities(entity: Entity): void; } /** * Helper function to remove the rotation behavior from a collectible. This will happen by default * when collectibles are spawned when playing as Tainted Isaac or when having Binge Eater. * * Under the hood, this is accomplished by morphing the collectible with the `ignoreModifiers` * argument set to true. */ export declare function preventCollectibleRotation(collectible: EntityPickup): void; declare class PreventGridEntityRespawn extends Feature { private readonly runInNFrames; private readonly preUseItemWeNeedToGoDeeper; private readonly postNewRoomReordered; /** * Every time we re-enter the room, the sprites for all of the decorations will come back, so we * have to remove them again. */ private setDecorationsInvisible; /** * Helper function to prevent any removed grid entities from respawning if the player re-enters * the current room. * * This is accomplished by spawning a new grid entity on every tile that does not already have a * grid entity. This will force the game to spawn the new grid entity instead of the old one. The * natural grid entity to choose for this purpose is a decoration, since it is non-interacting. * Then, the decorations are made invisible and any shovel uses are intercepted to avoid creating * a crawl space (instead of a trapdoor). * * Another option besides decorations would be to use a pressure plates with a state of 1, which * is a state that is normally unused by the game and makes it invisible & persistent. However, * pickups will not be able to spawn on pressure plates, which lead to various bugs (e.g. pickups * spawning on top of pits). Thus, using a decoration is preferable. * * Yet another option to accomplish this would be to replace the room data with that of an empty * room. However, the room data must exactly match the room type, the room shape, and the doors, * so this is not possible to do in a robust way without adding empty rooms to the mod's `content` * folder to draw the data from. * * In order to use this function, you must upgrade your mod with * `ISCFeature.PREVENT_GRID_ENTITY_RESPAWN`. */ preventGridEntityRespawn(): void; } /** Helper function to print whether something was enabled or disabled to the in-game console. */ export declare function printEnabled(enabled: boolean, description: string): void; /** * A decorator function that signifies that the decorated class method should be automatically * registered with `Mod.AddPriorityCallback`. * * @allowEmptyVariadic * @ignore */ export declare function PriorityCallback(modCallback: T, priority: CallbackPriority | int, ...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 PriorityCallbackCustom(modCallbackCustom: T, priority: CallbackPriority | int, ...optionalArgs: AllButFirst): (target: ModFeature, propertyKey: string, _descriptor: TypedPropertyDescriptor) => void; /** Helper type to extract only the public interface of a class. */ export declare type PublicInterface = Pick; /** * An array representing every valid collectible type quality. Specifically, this is: `[0, 1, 2, 3, * 4]` */ export declare const QUALITIES: readonly Quality[]; declare interface QueueElement { playerIndex: PlayerIndex; renderOffset: Vector; } /** An alias for the `Map` constructor that returns a read-only map. */ declare const ReadonlyMap_2: ReadonlyMapConstructor; export { ReadonlyMap_2 as ReadonlyMap } declare interface ReadonlyMapConstructor { new (): ReadonlyMap; new (entries?: ReadonlyArray | Iterable | null): ReadonlyMap; readonly prototype: ReadonlyMap; } export declare type ReadonlyRecord = Readonly>; /** An alias for the `Set` constructor that returns a read-only set. */ declare const ReadonlySet_2: ReadonlySetConstructor; export { ReadonlySet_2 as ReadonlySet } declare interface ReadonlySetConstructor { new (values?: readonly T[] | Iterable | null): ReadonlySet; readonly prototype: ReadonlySet; } /** * Helper function to let the Rebirth Item Tracker know that it should remove a collectible from its * list. * * The "item tracker" in this function does not refer to the in-game item tracker, but rather to the * external Python program. * * This function is variadic, meaning that you can pass as many collectible types as you want to * remove. * * Note that calling this function is not normally necessary when removing collectibles from * players. For example, when you remove a collectible with the `EntityPlayer.RemoveCollectible` * method, a message is sent to the log file by the game and the item tracker will automatically * remove it. However, in some cases, manually removing collectibles can be useful: * * - We may be giving the player a "fake" collectible (e.g. 1-Up for the purposes of an extra life) * and do not want the fake collectible to show up on the tracker. * - We may be removing a starting active item. Since active items are never removed from the * tracker, we want to tell the item tracker that the player never had a particular active item to * begin with. * * @see https://github.com/Rchardon/RebirthItemTracker */ export declare function rebirthItemTrackerRemoveCollectible(...collectibleTypes: readonly CollectibleType[]): void; /** * Helper function to let the Rebirth Item Tracker know that it should write the submitted text * string to a file. This is useful for capturing text in programs like Open Broadcaster Software * (OBS). * * The "item tracker" in this function does not refer to the in-game item tracker, but rather to the * external Python program. * * @see https://github.com/Rchardon/RebirthItemTracker */ export declare function rebirthItemTrackerWriteToFile(msg: string): void; /** * Helper function to reload the current room using `Game.StartRoomTransition`. * * This is useful for canceling the "goto" console command or to make the `Level.SetStage` method * take effect. */ export declare function reloadRoom(): void; /** * Helper function to remove all of the active items from a player. This includes the Schoolbag item * and any pocket actives. */ export declare function removeAllActiveItems(player: EntityPlayer): void; /** * Helper function to remove all of the batteries in the room. * * @param batterySubType Optional. If specified, will only remove the batteries that match this * sub-type. Default is -1, which matches every sub-type. * @param cap Optional. If specified, will only remove the given amount of cards. * @returns The batteries that were removed. */ export declare function removeAllBatteries(batterySubType?: BatterySubType | -1, cap?: int): readonly EntityPickupBattery[]; /** * Helper function to remove all of the bomb pickups in the room. (Specifically, this refers to bomb * pickups, not the `EntityBomb` class.) * * @param bombSubType Optional. If specified, will only remove bombs that match this sub-type. * Default is -1, which matches every sub-type. * @param cap Optional. If specified, will only remove the given amount of bombs. * @returns The bombs that were removed. */ export declare function removeAllBombPickups(bombSubType?: BombSubType | -1, cap?: int): readonly EntityPickupBomb[]; /** * Helper function to remove all of the bombs in the room. (Specifically, this refers to the * `EntityBomb` class, not bomb pickups.) * * @param bombVariant Optional. If specified, will only remove the bombs that match the variant. * Default is -1, which matches every variant. * @param subType Optional. If specified, will only remove the bombs that match the sub-type. * Default is -1, which matches every sub-type. * @param cap Optional. If specified, will only remove the given amount of bombs. * @returns An array of the bombs that were removed. */ export declare function removeAllBombs(bombVariant?: BombVariant | -1, subType?: number, cap?: int): readonly EntityBomb[]; /** * Helper function to remove all of the cards in the room. * * @param cardType Optional. If specified, will only remove cards that match this sub-type. Default * is -1, which matches every sub-type. * @param cap Optional. If specified, will only remove the given amount of cards. * @returns The cards that were removed. */ export declare function removeAllCards(cardType?: CardType | -1, cap?: int): readonly EntityPickupCard[]; export declare function removeAllCharacters(string: string, character: string): string; /** * Helper function to remove all of the chests 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 remove chests that match this sub-type. Default * is -1, which matches every sub-type. * @param cap Optional. If specified, will only remove the given amount of chests. * @returns The chests that were removed. */ export declare function removeAllChests(subType?: number, cap?: int): readonly EntityPickup[]; /** * Helper function to remove all of the coins in the room. * * @param coinSubType Optional. If specified, will only remove coins that match this sub-type. * Default is -1, which matches every sub-type. * @param cap Optional. If specified, will only remove the given amount of coins. * @returns The coins that were removed. */ export declare function removeAllCoins(coinSubType?: CoinSubType, cap?: int): readonly EntityPickupCoin[]; /** * Helper function to remove all of the collectibles in the room. * * @param collectibleType Optional. If specified, will only remove collectibles that match this * sub-type. Default is -1, which matches every sub-type. * @param cap Optional. If specified, will only remove the given amount of collectibles. * @returns The collectibles that were removed. */ export declare function removeAllCollectibles(collectibleType?: CollectibleType, cap?: int): readonly EntityPickupCollectible[]; /** * Helper function to remove all of the `GridEntityType.CRAWL_SPACE` (18) in the room. * * @param crawlSpaceVariant Optional. If specified, will only remove the crawl spaces that match * this variant. Default is -1, which matches every variant. * @param updateRoom Optional. Whether to update the room after the crawl spaces are removed. * Default is false. For more information, see the description of the * `removeGridEntities` helper function. * @param cap Optional. If specified, will only remove the given amount of crawl spaces. * @returns The crawl spaces that were removed. */ export declare function removeAllCrawlSpaces(crawlSpaceVariant?: CrawlSpaceVariant | -1, updateRoom?: boolean, cap?: int): readonly GridEntity[]; /** * Helper function to remove all of the doors in the room. By default, it will remove every door. * You can optionally specify one or more room types to remove only the doors that match the * specified room types. * * @returns The number of doors removed. * @allowEmptyVariadic */ export declare function removeAllDoors(...roomTypes: readonly RoomType[]): int; /** * Helper function to remove all of the effects in the room. * * @param effectVariant Optional. If specified, will only remove the effects that match the variant. * Default is -1, which matches every variant. * @param subType Optional. If specified, will only remove the effects that match the sub-type. * Default is -1, which matches every sub-type. * @param cap Optional. If specified, will only remove the given amount of effects. * @returns An array of the effects that were removed. */ export declare function removeAllEffects(effectVariant?: EffectVariant | -1, subType?: number, cap?: int): readonly EntityEffect[]; /** * Helper function to remove all of the familiars in the room. * * @param familiarVariant Optional. If specified, will only remove the familiars that match the * variant. Default is -1, which matches every variant. * @param subType Optional. If specified, will only remove the familiars that match the sub-type. * Default is -1, which matches every sub-type. * @param cap Optional. If specified, will only remove the given amount of familiars. * @returns An array of the familiars that were removed. */ export declare function removeAllFamiliars(familiarVariant?: FamiliarVariant | -1, subType?: number, cap?: int): readonly EntityFamiliar[]; /** * Helper function to all grid entities in the room except for ones matching the grid entity types * provided. * * Note that this function will automatically update the room. (This means that you can spawn new * grid entities on the same tile on the same frame, if needed.) * * For example: * * ```ts * removeAllGridEntitiesExcept( * GridEntityType.WALL, * GridEntityType.DOOR, * ); * ``` * * @returns The grid entities that were removed. */ export declare function removeAllGridEntitiesExcept(...gridEntityTypes: readonly GridEntityType[]): readonly GridEntity[]; /** * Helper function to remove all of the heart pickup entities in the room. * * @param heartSubType Optional. If specified, will only remove hearts that match this sub-type. * Default is -1, which matches every sub-type. * @param cap Optional. If specified, will only remove the given amount of hearts. * @returns The hearts that were removed. */ export declare function removeAllHearts(heartSubType?: HeartSubType, cap?: int): readonly EntityPickupHeart[]; /** * Helper function to remove all of the keys in the room. * * @param keySubType Optional. If specified, will only remove keys that match this sub-type. Default * is -1, which matches every sub-type. * @param cap Optional. If specified, will only remove the given amount of keys. * @returns The keys that were removed. */ export declare function removeAllKeys(keySubType?: KeySubType, cap?: int): readonly EntityPickupKey[]; /** * Helper function to remove all of the knives in the room. * * @param knifeVariant Optional. If specified, will only remove the knives that match the variant. * Default is -1, which matches every variant. * @param subType Optional. If specified, will only remove the knives that match the sub-type. * Default is -1, which matches every sub-type. * @param cap Optional. If specified, will only remove the given amount of knives. * @returns An array of the knives that were removed. */ export declare function removeAllKnives(knifeVariant?: KnifeVariant | -1, subType?: number, cap?: int): readonly EntityKnife[]; /** * Helper function to remove all of the lasers in the room. * * @param laserVariant Optional. If specified, will only remove the lasers that match the variant. * Default is -1, which matches every variant. * @param subType Optional. If specified, will only remove the lasers that match the sub-type. * Default is -1, which matches every sub-type. * @param cap Optional. If specified, will only remove the given amount of lasers. * @returns An array of the lasers that were removed. */ export declare function removeAllLasers(laserVariant?: LaserVariant | -1, subType?: number, cap?: int): readonly EntityLaser[]; /** * Helper function to remove all of the matching entities in the room. * * @param entityType The entity type to match. * @param entityVariant Optional. The variant to match. Default is -1, which matches every variant. * @param entitySubType Optional. The sub-type to match. Default is -1, which matches every * sub-type. * @param cap Optional. If specified, will only remove the given amount of collectibles. * @returns An array of the entities that were removed. */ export declare function removeAllMatchingEntities(entityType: EntityType, entityVariant?: number, entitySubType?: number, cap?: int): readonly Entity[]; /** * Helper function to remove all of the grid entities in the room that match the grid entity types * provided. * * Note that this function will automatically update the room. (This means that you can spawn new * grid entities on the same tile on the same frame, if needed.) * * For example: * * ```ts * removeAllMatchingGridEntities( * GridEntityType.ROCK, * GridEntityType.BLOCK, * GridEntityType.ROCK_TINTED, * ); * ``` * * @returns An array of the grid entities removed. */ export declare function removeAllMatchingGridEntities(...gridEntityType: readonly GridEntityType[]): readonly GridEntity[]; /** * Helper function to remove all of the NPCs in the room. * * @param entityType Optional. If specified, will only remove the NPCs that match the type. Default * is -1, which matches every type. * @param variant Optional. If specified, will only remove the NPCs that match the variant. Default * is -1, which matches every variant. * @param subType Optional. If specified, will only remove the NPCs that match the sub-type. Default * is -1, which matches every sub-type. * @param cap Optional. If specified, will only remove the given amount of NPCs. * @returns An array of the NPCs that were removed. */ export declare function removeAllNPCs(entityType?: EntityType | -1, variant?: number, subType?: number, cap?: int): readonly EntityNPC[]; /** * Helper function to remove all of the pickups in the room. * * @param pickupVariant Optional. If specified, will only remove pickups that match this variant. * Default is -1, which matches every variant. * @param subType Optional. If specified, will only remove pickups that match this sub-type. Default * is -1, which matches every sub-type. * @param cap Optional. If specified, will only remove the given amount of pickups. * @returns An array of the pickups that were removed. */ export declare function removeAllPickups(pickupVariant?: PickupVariant | -1, subType?: number, cap?: int): readonly EntityPickup[]; /** * Helper function to remove all of the pills in the room. * * @param pillColor Optional. If specified, will only remove pills that match this sub-type. Default * is -1, which matches every sub-type. * @param cap Optional. If specified, will only remove the given amount of pills. * @returns The pills that were removed. */ export declare function removeAllPills(pillColor?: PillColor, cap?: int): readonly EntityPickupPill[]; /** * Helper function to remove all of the `GridEntityPit` in the room. * * @param pitVariant Optional. If specified, will only remove the pits that match this variant. * Default is -1, which matches every variant. * @param updateRoom Optional. Whether to update the room after the pits are removed. Default is * false. For more information, see the description of the `removeGridEntities` * helper function. * @param cap Optional. If specified, will only remove the given amount of pits. * @returns The pits that were removed. */ export declare function removeAllPits(pitVariant?: PitVariant | -1, updateRoom?: boolean, cap?: int): readonly GridEntityPit[]; export declare function removeAllPlayerHealth(player: EntityPlayer): void; /** * Helper function to remove all of the held trinkets from a player. * * This will not remove any smelted trinkets, unless the player happens to also be holding a trinket * that they have smelted. (In that case, both the held and the smelted trinket will be removed.) */ export declare function removeAllPlayerTrinkets(player: EntityPlayer): void; /** * Helper function to remove all of the `GridEntityPoop` in the room. * * Note that poops can either be an entity or a grid entity, depending on the situation. This * function will only remove the grid entity poops. * * @param poopVariant Optional. If specified, will only remove the poops that match this variant. * Default is -1, which matches every variant. * @param updateRoom Optional. Whether to update the room after the poops are removed. Default is * false. For more information, see the description of the `removeGridEntities` * helper function. * @param cap Optional. If specified, will only remove the given amount of poops. * @returns The poops that were removed. */ export declare function removeAllPoops(poopVariant?: PoopGridEntityVariant | -1, updateRoom?: boolean, cap?: int): readonly GridEntityPoop[]; /** * Helper function to remove all of the `GridEntityPressurePlate` in the room. * * @param pressurePlateVariant Optional. If specified, will only remove the pressure plates that * match this variant. Default is -1, which matches every variant. * @param updateRoom Optional. Whether to update the room after the pressure plates are removed. * Default is false. For more information, see the description of the * `removeGridEntities` helper function. * @param cap Optional. If specified, will only remove the given amount of pressure plates. * @returns The pressure plates that were removed. */ export declare function removeAllPressurePlates(pressurePlateVariant?: PressurePlateVariant | -1, updateRoom?: boolean, cap?: int): readonly GridEntityPressurePlate[]; /** * Helper function to remove all of the projectiles in the room. * * @param projectileVariant Optional. If specified, will only remove projectiles that match this * variant. Default is -1, which matches every variant. * @param subType Optional. If specified, will only remove projectiles that match this sub-type. * Default is -1, which matches every sub-type. * @param cap Optional. If specified, will only remove the given amount of projectiles. * @returns An array of the projectiles that were removed. */ export declare function removeAllProjectiles(projectileVariant?: ProjectileVariant | -1, subType?: number, cap?: int): readonly EntityProjectile[]; /** * Helper function to remove all of the red heart pickup entities in the room. * * @param cap Optional. If specified, will only remove the given amount of hearts. * @returns The red hearts that were removed. */ export declare function removeAllRedHearts(cap?: int): readonly EntityPickupHeart[]; /** * Helper function to remove all of the `GridEntityRock` in the room. * * @param variant Optional. If specified, will only remove the rocks that match this 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. * @param updateRoom Optional. Whether to update the room after the rocks are removed. Default is * false. For more information, see the description of the `removeGridEntities` * helper function. * @param cap Optional. If specified, will only remove the given amount of rocks. * @returns The rocks that were removed. */ export declare function removeAllRocks(variant?: number, updateRoom?: boolean, cap?: int): readonly GridEntityRock[]; /** * Helper function to remove all of the sacks (i.e. grab bags) in the room. * * @param sackSubType Optional. If specified, will only remove sacks that match this sub-type. * Default is -1, which matches every sub-type. * @param cap Optional. If specified, will only remove the given amount of sacks. * @returns The sacks that were removed. */ export declare function removeAllSacks(sackSubType?: SackSubType, cap?: int): readonly EntityPickupSack[]; /** * Helper function to remove all of the slots in the room. * * @param slotVariant Optional. If specified, will only remove slots that match this variant. * Default is -1, which matches every variant. * @param subType Optional. If specified, will only remove slots that match this sub-type. Default * is -1, which matches every sub-type. * @param cap Optional. If specified, will only remove the given amount of slots. * @returns An array of the slots that were removed. */ export declare function removeAllSlots(slotVariant?: SlotVariant | -1, subType?: number, cap?: int): readonly Entity[]; /** * Helper function to remove all of the `GridEntitySpikes` in the room. * * @param variant Optional. If specified, will only remove the spikes that match this variant. * Default is -1, which matches every variant. * @param updateRoom Optional. Whether to update the room after the spikes are removed. Default is * false. For more information, see the description of the `removeGridEntities` * helper function. * @param cap Optional. If specified, will only remove the given amount of spikes. * @returns The spikes that were removed. */ export declare function removeAllSpikes(variant?: number, updateRoom?: boolean, cap?: int): readonly GridEntitySpikes[]; /** * Helper function to remove all of the tears in the room. * * @param tearVariant Optional. If specified, will only remove tears that match this variant. * Default is -1, which matches every variant. * @param subType Optional. If specified, will only remove tears that match this sub-type. Default * is -1, which matches every sub-type. * @param cap Optional. If specified, will only remove the given amount of tears. * @returns An array of the tears that were removed. */ export declare function removeAllTears(tearVariant?: TearVariant | -1, subType?: number, cap?: int): readonly EntityTear[]; /** * Helper function to remove all of the `GridEntityType.TELEPORTER` (23) in the room. * * @param variant Optional. If specified, will only remove the teleporters that match this variant. * Default is -1, which matches every variant. * @param updateRoom Optional. Whether to update the room after the teleporters are removed. Default * is false. For more information, see the description of the `removeGridEntities` * helper function. * @param cap Optional. If specified, will only remove the given amount of teleporters. * @returns The teleporters that were removed. */ export declare function removeAllTeleporters(variant?: number, updateRoom?: boolean, cap?: int): readonly GridEntity[]; /** * Helper function to remove all of the `GridEntityTNT` in the room. * * @param variant Optional. If specified, will only remove the TNTs that match this variant. Default * is -1, which matches every variant. * @param updateRoom Optional. Whether to update the room after the TNTs are removed. Default is * false. For more information, see the description of the `removeGridEntities` * helper function. * @param cap Optional. If specified, will only remove the given amount of TNTs. * @returns The TNTs that were removed. */ export declare function removeAllTNT(variant?: number, updateRoom?: boolean, cap?: int): readonly GridEntityTNT[]; /** * Helper function to remove all of the `GridEntityType.TRAPDOOR` (17) in the room. * * @param trapdoorVariant Optional. If specified, will only remove the trapdoors that match this * variant. Default is -1, which matches every variant. * @param updateRoom Optional. Whether to update the room after the trapdoors are removed. Default * is false. For more information, see the description of the `removeGridEntities` * helper function. * @param cap Optional. If specified, will only remove the given amount of trapdoors. * @returns The trapdoors that were removed. */ export declare function removeAllTrapdoors(trapdoorVariant?: TrapdoorVariant | -1, updateRoom?: boolean, cap?: int): readonly GridEntity[]; /** * Helper function to remove all of the trinkets in the room. * * @param trinketType Optional. If specified, will only remove trinkets that match this sub-type. * Default is -1, which matches every sub-type. * @param cap Optional. If specified, will only remove the given amount of trinkets. * @returns The trinkets that were removed. */ export declare function removeAllTrinkets(trinketType?: TrinketType, cap?: int): readonly EntityPickupTrinket[]; /** * Helper function to remove all of the characters in a string before a given substring. Returns the * modified string. */ export declare function removeCharactersBefore(string: string, substring: string): string; /** * Helper function to remove one or more collectibles to a player. * * This function is variadic, meaning that you can supply as many collectible types as you want to * remove. */ export declare function removeCollectible(player: EntityPlayer, ...collectibleTypes: readonly CollectibleType[]): void; /** * Helper function to remove a collectible costume from a player. Use this helper function to avoid * having to request the collectible from the item config. */ export declare function removeCollectibleCostume(player: EntityPlayer, collectibleType: CollectibleType): void; /** * Helper function to remove one or more collectibles from all players. If any player has more than * one copy of the item, then all copies of it will be removed. * * This function is variadic, meaning that you can specify as many collectibles as you want to * remove. */ export declare function removeCollectibleFromAllPlayers(...collectibleTypes: readonly CollectibleType[]): void; /** * Helper function to remove one or more collectibles from all item pools. * * This function is variadic, meaning you can pass as many collectible types as you want to remove. */ export declare function removeCollectibleFromPools(...collectibleTypes: readonly CollectibleType[]): void; /** * Helper function to remove all pickup delay on a collectible. By default, collectibles have a 20 * frame delay before they can be picked up by a player. */ export declare function removeCollectiblePickupDelay(collectible: EntityPickup): void; /** * Helper function to remove the Dead Eye multiplier from a player. * * Note that each time the `EntityPlayer.ClearDeadEyeCharge` method is called, it only has a chance * of working, so this function calls it 100 times to be safe. */ export declare function removeDeadEyeMultiplier(player: EntityPlayer): void; /** Helper function to remove a single door. */ export declare function removeDoor(door: GridEntityDoor): void; /** * Helper function to remove the doors provided. * * This function is variadic, meaning that you can specify as many doors as you want to remove. */ export declare function removeDoors(...doors: readonly GridEntityDoor[]): void; /** * Helper function to remove all of the entities in the supplied array. * * @param entities The array of entities to remove. * @param cap Optional. If specified, will only remove the given amount of entities. * @returns An array of the entities that were removed. */ export declare function removeEntities(entities: readonly T[], cap?: int): readonly T[]; /** * Helper function to remove all entities that just spawned from a grid entity breaking. * Specifically, this is any entities that overlap with the position of a grid entity and are on * frame 0. * * You must specify an array of entities to look through. */ export declare function removeEntitiesSpawnedFromGridEntity(entities: readonly Entity[], gridEntity: GridEntity): void; /** * Helper function to remove a bit flag from an existing set of bit flags. * * This is a variadic function, so pass as many flags as you want to remove. * * For example: * * ```ts * // Remove spectral tears from the player, if present * const player = Isaac.GetPlayer(); * player.TearFlags = removeFlag(player.TearFlags, TearFlags.TEAR_SPECTRAL); * ``` * * @param flags The existing set of bit flags. * @param flagsToRemove One or more bit flags to remove, each as a separate argument. * @returns The combined bit flags. */ export declare function removeFlag(flags: T | BitFlags, ...flagsToRemove: readonly T[]): BitFlags; /** * Helper function to remove all of the grid entities in the supplied array. * * @param gridEntities The array of grid entities to remove. * @param updateRoom Whether to update the room after the grid entities are removed. 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 this to false if you need to run this function multiple times. * @param cap Optional. If specified, will only remove the given amount of entities. * @returns An array of the entities that were removed. */ export declare function removeGridEntities(gridEntities: readonly T[], updateRoom: boolean, cap?: int): readonly T[]; /** * Helper function to remove a grid entity by providing the grid entity object or the grid index * inside of the room. * * If removing a Devil Statue or an Angel Statue, this will also remove the associated effect * (`EffectVariant.DEVIL` (6) or `EffectVariant.ANGEL` (9), respectively.) * * @param gridEntityOrGridIndex The grid entity or grid index to remove. * @param updateRoom Whether to update the room after the grid entity is removed. 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 * this to false if you need to run this function multiple times. */ export declare function removeGridEntity(gridEntityOrGridIndex: GridEntity | int, updateRoom: boolean): void; /** Helper function to remove all characters from a string that are not letters or numbers. */ export declare function removeNonAlphanumericCharacters(str: string): string; /** * Helper function to remove one or more substrings from a string, if they exist. Returns the * modified string. * * This function is variadic, meaning that you can pass as many substrings as you want to remove. */ export declare function removeSubstring(string: string, ...substrings: readonly string[]): string; /** * Helper function to remove a trinket costume from a player. Use this helper function to avoid * having to request the trinket from the item config. */ export declare function removeTrinketCostume(player: EntityPlayer, trinketType: TrinketType): void; /** * Helper function to remove one or more trinkets from all item pools. * * This function is variadic, meaning you can pass as many trinket types as you want to remove. */ export declare function removeTrinketFromPools(...trinketTypes: readonly TrinketType[]): void; /** * Helper function to remove all coins, trinkets, and so on that spawned from breaking an urn. * * The rewards are based on the ones from the wiki: * https://bindingofisaacrebirth.fandom.com/wiki/Rocks#Urns */ export declare function removeUrnRewards(gridEntity: GridEntity): void; /** Render frames are what is returned by the `Isaac.GetFrameCount` method. */ export declare const RENDER_FRAMES_PER_MINUTE: number; /** Render frames are what is returned by the `Isaac.GetFrameCount` method. */ export declare const RENDER_FRAMES_PER_SECOND = 60; /** * Helper function to render a charge bar on the screen. First, call the `newChargeBarSprites` * function to initialize the sprites, and then call this function on every render frame. * * Note that this is for the vertical charge bar that represents the number of charges that an * active item has, not the circular charge bar that shows e.g. the charge rate of Brimstone. */ export declare function renderChargeBar(sprites: ChargeBarSprites, position: Vector, normalCharges: int, batteryCharges: int): void; export declare function renderScaledTextOnEntity(entity: Entity | GridEntity, text: string, scaleX: float, scaleY: float): void; export declare function renderTextOnEntity(entity: Entity | GridEntity, text: string): void; /** * Helper function to repeat code N times. This is faster to type and cleaner than using a for loop. * * For example: * * ```ts * const player = Isaac.GetPlayer(); * repeat(10, () => { * player.AddCollectible(CollectibleType.STEVEN); * }); * ``` * * The repeated function is passed the index of the iteration, if needed: * * ```ts * repeat(3, (i) => { * print(i); // Prints "0", "1", "2" * }); * ``` */ export declare function repeat(num: int, func: (i: int) => void): void; /** * Helper function to reroll an enemy. Use this instead of the vanilla "Game.RerollEnemy" function * if you want the rerolled enemy to be returned. * * @param entity The entity to reroll. * @returns If the game failed to reroll the enemy, returns undefined. Otherwise, returns the * rerolled entity. */ export declare function rerollEnemy(entity: Entity): Entity | undefined; declare class RerunDetection extends Feature { private readonly postGameStartedReordered; private readonly postNewLevelReordered; /** * Helper function to detect if the current run was starting using the "Rerun" option from the * main menu. * * Under the hood, this assumes that any run that is past the first floor and continues in the * starting room of the run is a rerun. * * In order to use this function, you must upgrade your mod with `ISCFeature.RERUN_DETECTION`. * * @public */ onRerun(): boolean; } /** Helper function to reset a `PickupUpItem` object to all 0 values. */ export declare function resetPickingUpItem(pickingUpItem: PickingUpItem): void; /** * This is equivalent to the bottom-right screen position when the game is in windowed mode in a * 1600x900 resolution. */ export declare const RESOLUTION_1600_900: Vector; /** This is equivalent to the bottom-right screen position when the game is in full screen mode. */ export declare const RESOLUTION_FULL_SCREEN: Vector; /** * Helper function to restart the run using the console command of "restart". If the player is * playing a seeded run, then it will restart the game to the beginning of the seed. Otherwise, it * will put the player on a run with an entirely new seed. * * You can optionally specify a `PlayerType` to restart the game as that character. */ export declare function restart(character?: PlayerType): void; export declare function rngEquals(rng1: RNG, rng2: RNG): boolean; /** This is used in the various rock alt type helper functions. */ export declare enum RockAltType { URN = 0, MUSHROOM = 1, SKULL = 2, POLYP = 3, /** * Destroying buckets in Downpour give different outcomes than in Dross. * * See: https://bindingofisaacrebirth.fandom.com/wiki/Rocks#Buckets */ BUCKET_DOWNPOUR = 4, /** * Destroying buckets in Dross give different outcomes than in Downpour. * * See: https://bindingofisaacrebirth.fandom.com/wiki/Rocks#Buckets */ BUCKET_DROSS = 5 } /** Maps room names to the values of the `RoomType` enum. */ export declare const ROOM_NAME_TO_TYPE_MAP: ReadonlyMap; declare class RoomClearFrame extends Feature { private readonly postRoomClearChangedTrue; /** * Helper function to get the game frame (i.e. `Game.GetFrameCount`) of the last time that this * room was cleared. Returns undefined if the room has never been cleared. * * Note that if the room is left, all room clear tracking for it will be discarded. * * In order to use this function, you must upgrade your mod with `ISCFeature.ROOM_CLEAR_FRAME`. * * @public */ getRoomClearGameFrame(): int | undefined; /** * Helper function to get the render frame (i.e. `Isaac.GetFrameCount`) of the last time that this * room was cleared. Returns undefined if the room has never been cleared. * * Note that if the room is left, all room clear tracking for it will be discarded. * * In order to use this function, you must upgrade your mod with `ISCFeature.ROOM_CLEAR_FRAME`. * * @public */ getRoomClearRenderFrame(): int | undefined; /** * Helper function to get the room frame (i.e. `Room.GetFrameCount`) of the last time that this * room was cleared. Returns undefined if the room has never been cleared. * * Note that if the room is left, all room clear tracking for it will be discarded. * * In order to use this function, you must upgrade your mod with `ISCFeature.ROOM_CLEAR_FRAME`. * * @public */ getRoomClearRoomFrame(): int | undefined; } /** This is used by the room history feature of the standard library. */ export declare interface RoomDescription { startSeedString: string; stage: LevelStage; stageType: StageType; stageID: StageID | -1; dimension: Dimension; roomType: RoomType; roomVariant: int; roomSubType: int; roomName: string; roomGridIndex: int; roomListIndex: int; roomVisitedCount: int; } /** * Helper function to check if a room exists at the given room grid index. (A room will exist if it * has non-undefined data in the room descriptor.) */ export declare function roomExists(roomGridIndex: int): boolean; /** * Helper function to get the coordinates of a given room grid index. The floor is represented by a * 13x13 grid. * * - Since the starting room is in the center, the starting room grid index of 84 is equal to * coordinates of (6, 6). * - The top-left grid index of 0 is equal to coordinates of: (12, 0) * - The top-right grid index of 12 is equal to coordinates of: (0, 0) * - The bottom-left grid index of 156 is equal to coordinates of: (0, 12) * - The bottom-right grid index of 168 is equal to coordinates of: (12, 12) */ export declare function roomGridIndexToVector(roomGridIndex: int): Readonly; declare class RoomHistory extends Feature { private readonly postNewRoomEarly; /** * Helper function to manually delete the last room description from the internal array. This is * useful if a mod needs to send the player to a room temporarily and the room should not count as * the player having traveled to that room. * * @public */ deleteLastRoomDescription(): void; /** * Helper function to get the total number of rooms that the player has entered thus far on the * run. (Re-entering the same room will increment the number returned.) * * In order to use this function, you must upgrade your mod with `ISCFeature.ROOM_HISTORY`. * * @public */ getNumRoomsEntered(): int; /** * Helper function to get information about all of the rooms that a player has visited thus far on * this run. * * In order to use this function, you must upgrade your mod with `ISCFeature.ROOM_HISTORY`. * * @public */ getRoomHistory(): ReadonlyArray>; /** * Helper function to get information about the room that was previously visited. * * In the special case of only one room having been visited thus far (i.e. the starting room of * the run), the starting room will be returned. * * In order to use this function, you must upgrade your mod with `ISCFeature.ROOM_HISTORY`. * * @public */ getPreviousRoomDescription(): Readonly; /** * Helper function to get information about the most recent room that is stored in the room * history array. * * This is useful in the `POST_ENTITY_REMOVE` callback; see the `isLeavingRoom` function. * * Note that this function can return undefined in the case where it is called on the first room * of the run. * * In order to use this function, you must upgrade your mod with `ISCFeature.ROOM_HISTORY`. * * @public */ getLatestRoomDescription(): Readonly | undefined; /** * Helper function to detect if the player is on the first room of the room. * * @public */ inFirstRoom(): boolean; /** * Helper function to detect if the game is in the state where the room index has changed to a new * room, but the entities from the previous room are currently in the process of despawning. (At * this point, the `POST_NEW_ROOM` callback and the `POST_NEW_ROOM_EARLY` callback will not have * fired yet, and there will not be an entry in the room history array for the current room.) * * This function is intended to be used in the `POST_ENTITY_REMOVE` callback to detect when an * entity is despawning. * * In order to use this function, you must upgrade your mod with `ISCFeature.ROOM_HISTORY`. * * @public */ isLeavingRoom(): boolean; } /** * If the `Room.Update` method is called in a `POST_NEW_ROOM` callback, then some entities will * slide around (such as the player). Since those entity velocities are already at zero, setting * them to zero will have no effect. Thus, a generic solution is to record all of the entity * positions/velocities before updating the room, and then restore those positions/velocities. */ export declare function roomUpdateSafe(): void; /** * If rounding fails, this function returns 0. * * From: http://lua-users.org/wiki/SimpleRound * * @param num The number to round. * @param numDecimalPlaces Optional. Default is 0. */ export declare function round(num: float, numDecimalPlaces?: number): float; /** * Run the suite of tests that prove that the "deepCopy" helper function works properly. * * This function is only useful if you are troubleshooting the "deepCopy" function. */ export declare function runDeepCopyTests(): void; declare class RunInNFrames extends Feature { vConditionalFunc: () => boolean; private readonly roomHistory; private readonly postUpdate; private readonly postRender; /** * Helper function to restart on the next render frame. Useful because it is impossible to restart * the game inside of the `POST_NEW_ROOM`, `POST_NEW_LEVEL`, or `POST_GAME_STARTED` callbacks when * a run is first starting. * * In order to use this function, you must upgrade your mod with `ISCFeature.RUN_IN_N_FRAMES`. * * @param character Optional. If specified, will restart the game as the specified character. * @public */ restartNextRenderFrame(character?: PlayerType): void; /** * Supply a function to run N game frames from now in the `POST_UPDATE` callback. * * For a usage example, see the documentation for the `runNextGameFrame`, which is used in a * similar way. * * Note that this function will not handle saving and quitting. If a player saving and quitting * before the deferred function fires would cause a bug in your mod, then you should handle * deferred functions manually using serializable data. * * In order to use this function, you must upgrade your mod with `ISCFeature.RUN_IN_N_FRAMES`. * * @param func The function to run. * @param numGameFrames The amount of game frames to wait before running the function. * @param cancelIfRoomChanges Optional. Whether to cancel running the function if a new room is * loaded in the interim. Default is false. * @public */ runInNGameFrames(func: () => void, numGameFrames: int, cancelIfRoomChanges?: boolean): void; /** * Supply a function to run N render frames from now in the `POST_RENDER` callback. * * For a usage example, see the documentation for the `runNextGameFrame`, which is used in a * similar way. * * Note that this function will not handle saving and quitting. If a player saving and quitting * before the deferred function fires would cause a bug in your mod, then you should handle * deferred functions manually using serializable data. * * In order to use this function, you must upgrade your mod with `ISCFeature.RUN_IN_N_FRAMES`. * * @param func The function to run. * @param numRenderFrames The amount of render frames to wait before running the function. * @param cancelIfRoomChanges Optional. Whether to cancel running the function if a new room is * loaded in the interim. Default is false. * @public */ runInNRenderFrames(func: () => void, numRenderFrames: int, cancelIfRoomChanges?: boolean): void; /** * Supply a function to run on the next `POST_UPDATE` callback. * * For example: * * ```ts * const NUM_EXPLODER_EXPLOSIONS = 5; * * function useItemExploder(player: EntityPlayer) { * playSound("exploderBegin"); * explode(player, NUM_EXPLODER_EXPLOSIONS); * } * * function explode(player: EntityPlayer, numFramesLeft: int) { * Isaac.Explode(player, undefined, 1); * numFramesLeft -= 1; * if (numFramesLeft === 0) { * runNextFrame(() => { * explode(player, numFramesLeft); * }); * } * } * ``` * * Note that this function will not handle saving and quitting. If a player saving and quitting * before the deferred function fires would cause a bug in your mod, then you should handle * deferred functions manually using serializable data. * * In order to use this function, you must upgrade your mod with `ISCFeature.RUN_IN_N_FRAMES`. * * @param func The function to run. * @param cancelIfRoomChanges Optional. Whether to cancel running the function if a new room is * loaded in the interim. Default is false. * @public */ runNextGameFrame(func: () => void, cancelIfRoomChanges?: boolean): void; /** * Supply a function to run on the next `POST_RENDER` callback. * * For a usage example, see the documentation for the `runNextGameFrame`, which is used in a * similar way. * * Note that this function will not handle saving and quitting. * * In order to use this function, you must upgrade your mod with `ISCFeature.RUN_IN_N_FRAMES`. * * @param func The function to run. * @param cancelIfRoomChanges Optional. Whether to cancel running the function if a new room is * loaded in the interim. Default is false. * @public */ runNextRenderFrame(func: () => void, cancelIfRoomChanges?: boolean): void; /** * Supply a function to be repeatedly run on an interval of N game frames in the `POST_UPDATE` * callback. The function will continue to be fired until `false` is returned from the function. * * This is similar to the `setInterval` vanilla JavaScript function, except there is no * corresponding `clearInterval` function. (Instead, the return value from the supplied function * is used to stop the interval.) * * Note that this function will not handle saving and quitting. You must manually restart any * intervals if the player saves and quits in the middle of a run. * * In order to use this function, you must upgrade your mod with `ISCFeature.RUN_IN_N_FRAMES`. * * @param func The function to repeatedly run on an interval. * @param numGameFrames The amount of game frames to wait between each run. * @param runImmediately Whether to execute the function right now before waiting for the * interval. * @param cancelIfRoomChanges Optional. Whether to cancel running the function if a new room is * loaded in the interim. Default is false. * @public */ setIntervalGameFrames(func: () => boolean, numGameFrames: int, runImmediately: boolean, cancelIfRoomChanges?: boolean): void; /** * Supply a function to be repeatedly run on an interval of N render frames in the `POST_RENDER` * callback. The function will continue to be fired until `false` is returned from the function. * * This is similar to the `setInterval` vanilla JavaScript function, except there is no * corresponding `clearInterval` function. (Instead, the return value from the supplied function * is used to stop the interval.) * * Note that this function will not handle saving and quitting. You must manually restart any * intervals if the player saves and quits in the middle of a run. * * In order to use this function, you must upgrade your mod with `ISCFeature.RUN_IN_N_FRAMES`. * * @param func The function to repeatedly run on an interval. * @param numRenderFrames The amount of game frames to wait between each run. * @param runImmediately Whether to execute the function right now before waiting for the * interval. * @param cancelIfRoomChanges Optional. Whether to cancel running the function if a new room is * loaded in the interim. Default is false. * @public */ setIntervalRenderFrames(func: () => boolean, numRenderFrames: int, runImmediately: boolean, cancelIfRoomChanges?: boolean): void; } /** * Run the suite of tests that prove that the "merge" function works properly. * * This function is only useful if you are troubleshooting the save data manager. */ export declare function runMergeTests(): void; declare class RunNextRoom extends Feature { vConditionalFunc: () => boolean; private readonly postNewRoomReordered; /** * Supply a function to run on the next `POST_NEW_ROOM` callback. * * Note that this function will not handle saving and quitting. If a player saving and quitting * before the deferred function fires would cause a bug in your mod, then you should handle * deferred functions manually using serializable data. * * In order to use this function, you must upgrade your mod with `ISCFeature.RUN_NEXT_ROOM`. */ runNextRoom(func: () => void): void; } declare class RunNextRun extends Feature { vConditionalFunc: () => boolean; private readonly postGameStartedReorderedFalse; /** * Supply a function to run on the next `POST_GAME_STARTED` callback. * * Note that this function will not handle saving and quitting. If a player saving and quitting * before the deferred function fires would cause a bug in your mod, then you should handle * deferred functions manually using serializable data. * * In order to use this function, you must upgrade your mod with `ISCFeature.RUN_NEXT_ROOM`. * * @public */ runNextRun(func: () => void): void; } /** * This is the format of the object that you give to the save data manager. It will contains all of * the variables for the particular mod feature. * * Depending on which object keys you use, the variables will automatically be reset at certain * times and automatically saved to disk. * * Each sub-object of save data has a string as a key and arbitrary data as a value. However, the * data has to be serializable. Specifically, this means that you can only use the following types: * * - `boolean` * - `number` * - `string` * - `undefined` (will be skipped over when saving) * - `null` (will be skipped over when saving) * - `Map` / `DefaultMap` * - `Set` * - serializable Isaac API classes (such as `Color`) * - TSTL classes (i.e. classes that you made yourself) * - sub-objects or a `LuaMap` that contains the above values */ export declare interface SaveData { persistent?: Serializable; run?: Serializable; level?: Serializable; room?: Record; } /** * These are the types of keys that you can put on the local variables that you feed to the save * data manager. */ export declare enum SaveDataKey { PERSISTENT = "persistent", RUN = "run", LEVEL = "level", ROOM = "room" } declare class SaveDataManager extends Feature { /** * We store a local reference to the mod object so that we can access the corresponding methods * that read and write to the "save#.dat" file. */ private readonly mod; /** * The save data map is indexed by subscriber name. We use Lua tables instead of TypeScriptToLua * Maps for the master map so that we can access the variables via the in-game console when * debugging. (TSTL Maps don't expose the map keys as normal keys.) */ private readonly saveDataMap; /** * When mod feature data is initialized, we copy the initial values into a separate map so that we * can restore them later on. */ private readonly saveDataDefaultsMap; /** * Each mod feature can optionally provide a function that can control whether the save data is * written to disk. */ private readonly saveDataConditionalFuncMap; /** * We backup some save data keys on every new room for the purposes of restoring it when Glowing * Hour Glass is used. * * Note that the save data is backed up in serialized form so that we can use the `merge` function * to restore it. */ private readonly saveDataGlowingHourGlassMap; /** * End-users can register their classes with the save data manager for proper serialization when * contained in nested maps, sets, and arrays. */ private readonly classConstructors; private inARun; private restoreGlowingHourGlassDataOnNextRoom; private readonly postUseItemGlowingHourGlass; private readonly postPlayerInit; private readonly preGameExit; private readonly postNewLevel; private readonly postNewRoomEarly; /** * This is the entry point to the save data manager, a system which provides two major features: * * 1. Automatic resetting of variables on a new run, on a new level, or on a new room (as * desired). * 2. Automatic saving and loading of all tracked data to the "save#.dat" file. * * You provide this function with an object containing your variables, and then it will * automatically manage them for you. (See below for an example.) * * In order to use this function, you must upgrade your mod with `ISCFeature.SAVE_DATA_MANAGER`. * (Upgrade your mod before registering any of your own callbacks so that the save data manager * will run before any of your code does.) * * The save data manager is meant to be called once for each feature of your mod. In other words, * you should not put all of the variables for your mod on the same object. Instead, scope your * variables locally to a single file that contains a mod feature, and then call this function to * register them. For example: * * ```ts * // In file: feature1.ts * * // Declare local variables for this file or feature. * const v = { * // These variables are never reset; manage them yourself at will. * persistent: { * foo1: 0, * }, * * // These variables are reset at the beginning of every run. * run: { * foo2: 0, * }, * * // These variables are reset at the beginning of every level. * level: { * foo3: 0, * }, * * // These variables are reset at the beginning of every room. * room: { * foo4: 0, * }, * }; * // The child objects of "persistent", "run", "level", and "room are optional; only create the * // ones that you need. * * // Now, give `v` to the save data manager, and it will automatically manage the variables for * // you. * mod.saveDataManager("feature1", v); * * // Elsewhere in the file, use your variables. * function feature1Function() { * if (v.run.foo1 > 0) { * // Insert code here. * } * } * ``` * * - Save data is loaded from disk in the `POST_PLAYER_INIT` callback (i.e. the first callback * that can possibly run). * - Save data is recorded to disk in the `PRE_GAME_EXIT` callback. * * You can use many different variable types on your variable object, but not everything is * supported. For the specific things that are supported, see the documentation for the `deepCopy` * helper function. * * If you want the save data manager to load data before the `POST_PLAYER_INIT` callback (i.e. in * the main menu), then you should explicitly call the `saveDataManagerLoad` function. (The save * data manager cannot do this on its own because it cannot know when your mod features are * finished initializing.) * * Some features may have variables that need to be automatically reset per run/level, but not * saved to disk on game exit. (For example, if they contain functions or other non-serializable * data.) For these cases, set the second argument of this function to `false`. * * Note that when the player uses Glowing Hourglass, the save data manager will automatically * restore any variables on a "run" or "level" object with a backup that was created when the room * was entered. Thus, you should not have to explicitly program support for Glowing Hourglass into * your mod features that use the save data manager. If this is undesired for your specific * use-case, then add a key of `__ignoreGlowingHourGlass: true` to your "run" or "level" object. * * By default, the Glowing Hour Glass functionality will not apply to "persistent" objects. If * this is undesired, you can add a key of `__rewindWithGlowingHourGlass: true` to the object. * * @param key The name of the file or feature that is submitting data to be managed by the save * data manager. The save data manager will throw an error if the key is already * registered. Note that you can also pass a TSTL class instead of a string and the * save data manager will use the name of the class as the key. * @param v An object that corresponds to the `SaveData` interface. The object is conventionally * called "v" for brevity. ("v" is short for "local variables"). * @param conditionalFunc Optional. A function to run to check if this save data should be written * to disk. Default is `() => true`, meaning that this save data will * always be written to disk. Use a conditional function for the situations * when the local variables are for a feature that the end-user can * disable. (If the feature is disabled, then there would be no point in * writing any of the variables to the "save#.dat" file.) You can also * specify `false` to this argument in order to completely disable saving * data. (Specifying `false` will allow you to use non-serializable objects * in your save data, such as `EntityPtr`. * @public */ saveDataManager(key: string | object, v: SaveData, conditionalFunc?: () => boolean): void; saveDataManager(key: string | object, v: SaveData, conditionalFunc: false): void; /** * Recursively traverses an object, collecting all of the class constructors that it encounters. */ private storeClassConstructorsFromObject; /** * The save data manager will automatically load variables from disk at the appropriate times * (i.e. when a new run is started). Use this function to explicitly force the save data manager * to load all of its variables from disk immediately. * * Obviously, doing this will overwrite the current data, so using this function can potentially * result in lost state. * * In order to use this function, you must upgrade your mod with `ISCFeature.SAVE_DATA_MANAGER`. * * @public */ saveDataManagerLoad(): void; /** * The save data manager will automatically save variables to disk at the appropriate times (i.e. * when the run is exited). Use this function to explicitly force the save data manager to write * all of its variables to disk immediately. * * In order to use this function, you must upgrade your mod with `ISCFeature.SAVE_DATA_MANAGER`. * * @public */ saveDataManagerSave(): void; /** * Sets the global variable of "g" equal to all of the save data variables for this mod. * * This can make debugging easier, as you can access the variables from the game's debug console. * e.g. `l print(g.feature1.run.foo)` * * In order to use this function, you must upgrade your mod with `ISCFeature.SAVE_DATA_MANAGER`. * * @public */ saveDataManagerSetGlobal(): void; /** * By default, the save data manager will not be able to serialize/deserialize classes that are * nested inside of maps, sets, and arrays, because it does not have access to the corresponding * class constructor. If you want to use nested classes in this way, then use this function to * register the class constructor with the save data manager. Once registered, the save data * manager will automatically run the constructor when deserializing (in addition to copying over * the data fields). * * This function is variadic, which means you can pass as many classes as you want to register. * * In order to use this function, you must upgrade your mod with `ISCFeature.SAVE_DATA_MANAGER`. * * @public */ saveDataManagerRegisterClass(...tstlClasses: readonly AnyClass[]): void; /** * Removes a previously registered key from the save data manager. This is the opposite of the * "saveDataManager" method. * * In order to use this function, you must upgrade your mod with `ISCFeature.SAVE_DATA_MANAGER`. * * @public */ saveDataManagerRemove(key: string): void; /** * The save data manager will automatically reset variables at the appropriate times, like when a * player enters a new room. Use this function to explicitly force the save data manager to reset * a specific variable group. * * For example: * * ```ts * const v = { * room: { * foo: 123, * }, * }; * * mod.saveDataManager("file1", v); * * // Then, later on, to explicit reset all of the "room" variables: * mod.saveDataManagerReset("file1", "room"); * ``` * * In order to use this function, you must upgrade your mod with `ISCFeature.SAVE_DATA_MANAGER`. * * @public */ saveDataManagerReset(key: string, childObjectKey: SaveDataKey): void; /** * Helper function to check to see if the game is in the menu, as far as the save data manager is * concerned. This function will return true when the game is first opened until the * `POST_PLAYER_INIT` callback fires. It will also return true in between the `PRE_GAME_EXIT` * callback firing and the `POST_PLAYER_INIT` callback firing. * * This function is useful because the `POST_ENTITY_REMOVE` callback fires after the * `PRE_GAME_EXIT` callback. Thus, if save data needs to be updated from the `POST_ENTITY_REMOVE` * callback and the player is in the process of saving and quitting, the feature will have to * explicitly call the `saveDataManagerSave` function. * * In order to use this function, you must upgrade your mod with `ISCFeature.SAVE_DATA_MANAGER`. * * @public */ saveDataManagerInMenu(): boolean; /** * Helper function to see all of the mod features that are using the save data manager. Useful for * debugging if a certain mod feature is not getting its data saved correctly. * * @public */ saveDataManagerLogSubscribers(): void; } export declare const SECOND_IN_MILLISECONDS = 1000; /** * A type that represents valid serializable data fed to the save data manager. * * Custom errors are thrown when an Isaac API class or a nested custom class is detected. * * The recursive nature of this type is based on the `Immutable` type: * https://stackoverflow.com/questions/41879327/deepreadonly-object-typescript */ declare type Serializable = T extends SerializablePrimitive ? T : T extends CopyableIsaacAPIClass ? T : T extends IsaacAPIClass ? ErrorIsaacAPIClassIsNotSerializable : T extends Array ? SerializableArray : T extends ReadonlyArray ? SerializableReadonlyArray : T extends Map ? SerializableMap : T extends ReadonlyMap ? SerializableReadonlyMap : T extends Set ? SerializableSet : T extends ReadonlySet ? SerializableReadonlySet : SerializableObject; declare type SerializableArray = Array>; /** * This is mostly copied from the `Serializable` type. The difference is that we want to disallow * functions inside of containers. */ declare type SerializableInsideArrayOrMap = T extends SerializablePrimitive ? T : T extends CopyableIsaacAPIClass ? T : T extends IsaacAPIClass ? ErrorIsaacAPIClassIsNotSerializable : T extends Array ? SerializableArray : T extends ReadonlyArray ? SerializableReadonlyArray : T extends Map ? SerializableMap : T extends ReadonlyMap ? SerializableReadonlyMap : T extends Set ? SerializableSet : T extends ReadonlySet ? SerializableReadonlySet : T extends Function ? FunctionIsNotSerializable : SerializableObject; declare type SerializableMap = Map, SerializableInsideArrayOrMap>; declare type SerializableObject = { [K in keyof T]: Serializable; }; declare type SerializablePrimitive = boolean | string | number | undefined | null; declare type SerializableReadonlyArray = ReadonlyArray>; declare type SerializableReadonlyMap = ReadonlyMap, SerializableInsideArrayOrMap>; declare type SerializableReadonlySet = ReadonlySet>; declare type SerializableSet = Set>; /** This is used with the `deepCopy` and `merge` functions. */ export declare enum SerializationType { NONE = 0, SERIALIZE = 1, DESERIALIZE = 2 } /** * Helper function to convert a `BitSet128` object to a `SerializedBitSet128` object. (This is used * by the save data manager when writing data from the "save#.dat" file.) */ export declare function serializeBitSet128(bitSet128: BitSet128): SerializedBitSet128; /** * Helper function to convert a `Color` object to a `SerializedColor` object. (This is used by the * save data manager when writing data from the "save#.dat" file.) */ export declare function serializeColor(color: Color): SerializedColor; export declare type SerializedBitSet128 = LuaMap & { readonly __serializedBitSet128Brand: symbol; readonly __kind: CopyableIsaacAPIClassType.BIT_SET_128; }; export declare type SerializedColor = LuaMap & { readonly __serializedColorBrand: symbol; readonly __kind: CopyableIsaacAPIClassType.COLOR; }; /** * A type representing an Isaac API class like `Color` or `RNG` that has been written to the * "save#.dat" file. It is used by the save data manager when reading and writing to that file. * * For the list of supported classes, see the `CopyableIsaacAPIClassType` enum. */ declare type SerializedIsaacAPIClass = SerializedBitSet128 | SerializedColor | SerializedKColor | SerializedRNG | SerializedVector; export declare type SerializedKColor = LuaMap & { readonly __serializedKColorBrand: symbol; readonly __kind: CopyableIsaacAPIClassType.K_COLOR; }; export declare type SerializedRNG = LuaMap & { readonly __serializedRNGBrand: symbol; readonly __kind: CopyableIsaacAPIClassType.RNG; }; export declare type SerializedVector = LuaMap & { readonly __serializedVectorBrand: symbol; readonly __kind: CopyableIsaacAPIClassType.VECTOR; }; /** * Helper function to generically serialize an Isaac API class without knowing what specific type of * class it is. (This is used by the save data manager when writing data to the "save#.dat" file.) * * For the list of supported classes, see the `CopyableIsaacAPIClassType` enum. */ export declare function serializeIsaacAPIClass(isaacAPIClass: T): IsaacAPIClassTypeToSerializedType[T["__kind"]]; /** * Helper function to convert a `KColor` object to a `SerializedKColor` object. (This is used by the * save data manager when writing data from the "save#.dat" file.) */ export declare function serializeKColor(kColor: KColor): SerializedKColor; /** * Helper function to convert a `RNG` object to a `SerializedRNG` object. (This is used by the save * data manager when writing data from the "save#.dat" file.) */ export declare function serializeRNG(rng: RNG): SerializedRNG; /** * Helper function to convert a `Vector` object to a `SerializedVector` object. (This is used by the * save data manager when writing data from the "save#.dat" file.) */ export declare function serializeVector(vector: Vector): SerializedVector; /** * Helper function to set an active collectible to a particular slot. This has different behavior * than calling the `player.AddCollectible` method with the `activeSlot` argument, because this * function will not shift existing items into the Schoolbag and it handles * `ActiveSlot.SLOT_POCKET2`. * * Note that if an item is set to `ActiveSlot.SLOT_POCKET2`, it will disappear after being used and * will be automatically removed upon entering a new room. * * @param player The player to give the item to. * @param collectibleType The collectible type of the item to give. * @param activeSlot Optional. The slot to set. Default is `ActiveSlot.PRIMARY`. * @param charge Optional. The argument of charges to set. If not specified, the item will be set * with maximum charges. * @param keepInPools Optional. Whether to remove the item from pools. Default is false. */ export declare function setActiveItem(player: EntityPlayer, collectibleType: CollectibleType, activeSlot?: ActiveSlot, charge?: int, keepInPools?: boolean): void; /** * Helper function to add one or more elements to a set at once without having to repeatedly call * the `Set.add` method. * * This function is variadic, meaning that you can pass as many things as you want to add. */ export declare function setAdd(set: Set, ...elements: readonly T[]): void; /** * Helper function to make using sets with an type of `PtrHash` easier. Use this instead of the * `Set.add` method if you have a set of this type. */ export declare function setAddNPC(set: Set, npc: EntityNPC): void; /** * Helper function to make using sets with an type of `PlayerIndex` easier. Use this instead of the * `Set.add` method if you have a set of this type. */ export declare function setAddPlayer(set: Set, player: EntityPlayer): void; /** Helper function to set every element in an array to a specific value. */ export declare function setAllArrayElements(array: T[], value: T): void; /** * Helper function to set the minimap `DisplayFlag` value for every room on the floor at once. * * This function automatically calls the `Level.UpdateVisibility` after setting the flags so that * the changes will be immediately visible. * * This function automatically accounts for if MinimapAPI is being used. */ export declare function setAllDisplayFlags(displayFlags: BitFlags): void; /** * Helper function to iterate over the provided object and set the seed for all of the values that * are RNG objects equal to a particular seed. */ export declare function setAllRNGToSeed(object: ReadonlyRecord, seed: Seed): void; /** * Helper function to iterate over the provided object and set the seed for all of the values that * are RNG objects equal to the start seed for the current run. */ export declare function setAllRNGToStartSeed(object: ReadonlyRecord): void; /** Helper function to set the backdrop (i.e. background) of the current room. */ export declare function setBackdrop(backdropType: BackdropType): void; /** * Helper function to blindfold the player by using a hack with the challenge variable. * * Note that if the player dies and respawns (from e.g. Dead Cat), the blindfold will have to be * reapplied. * * Under the hood, this function sets the challenge to one with a blindfold, changes the player to * the same character that they currently are, and then changes the challenge back. This method was * discovered by im_tem. * * @param player The player to apply or remove the blindfold state from. * @param enabled Whether to apply or remove the blindfold. * @param modifyCostume Optional. Whether to add or remove the blindfold costume. Default is true. */ export declare function setBlindfold(player: EntityPlayer, enabled: boolean, modifyCostume?: boolean): void; /** * Helper function to restart the run on a particular challenge. * * If the player is already in the particular challenge, this function will do nothing. * * Under the hood, this function executes the `challenge 0` console command. */ export declare function setChallenge(challenge: Challenge): void; /** * Helper function to set a collectible sprite to a question mark (i.e. how collectibles look when * the player has Curse of the Blind). */ export declare function setCollectibleBlind(collectible: EntityPickup): void; /** * Helper function to remove the collectible from a collectible pedestal and make it appear as if a * player has already taken the item. This is accomplished by changing the sub-type to * `CollectibleType.NULL` and then setting the sprite to an empty/missing PNG file. * * For more information, see the documentation for the "clearSprite" helper function. */ export declare function setCollectibleEmpty(collectible: EntityPickup): void; /** * Helper function to change a collectible into a "glitched" item (like the ones that appear when * the player has TMTRAINER). */ export declare function setCollectibleGlitched(collectible: EntityPickup): void; /** * Helper function to set the "pedestal type" of a collectible. For example, it might be sitting on * top of a broken Blood Donation Machine and you want to change it to be sitting on top of an * opened Spiked Chest. */ export declare function setCollectiblePedestalType(collectible: EntityPickup, collectiblePedestalType: CollectiblePedestalType): void; /** * Helper function to change the sprite of a collectible pedestal entity. * * For more information about removing the collectible sprite, see the documentation for the * "clearSprite" helper function. * * @param collectible The collectible whose sprite you want to modify. * @param pngPath Equal to either the spritesheet path to load (e.g. * "gfx/items/collectibles/collectibles_001_thesadonion.png") or undefined. If * undefined, the sprite will be removed, making it appear like the collectible has * already been taken by the player. */ export declare function setCollectibleSprite(collectible: EntityPickup, pngPath: string | undefined): void; /** * Helper function to put a message in the log.txt file to let the Rebirth Item Tracker know that * the build has been rerolled. */ export declare function setCollectiblesRerolledForItemTracker(): void; /** * Helper function to change the collectible on a pedestal. Simply updating the `SubType` field is * not sufficient because the sprite will not change. */ export declare function setCollectibleSubType(collectible: EntityPickup, newCollectibleType: CollectibleType): void; /** * Helper function to make using sets with an type of `PtrHash` easier. Use this instead of the * `Set.delete` method if you have a set of this type. */ export declare function setDeleteNPC(set: Set, npc: EntityNPC): boolean; /** * Helper function to make using sets with an type of `PlayerIndex` easier. Use this instead of the * `Set.delete` method if you have a set of this type. */ export declare function setDeletePlayer(set: Set, player: EntityPlayer): boolean; /** * Helper function to make an entity flash red like it is taking damage. This is useful when you * want to make it appear as if an entity is taking damage without actually dealing any damage to * it. */ export declare function setEntityDamageFlash(entity: Entity): void; /** * Helper function to keep an entity's color the same values as it already is but set the opacity to * a specific value. * * @param entity The entity to set. * @param alpha A value between 0 and 1 that represents the fade amount. */ export declare function setEntityOpacity(entity: Entity, alpha: float): void; /** * Helper function to set the position of every entity in the room based on a map of positions. If * an entity is found that does not have matching element in the provided map, then that entity will * be skipped. * * This function is useful for rewinding entity positions at a later time. Also see * `getEntityPositions`. * * @param entityPositions The map providing the positions for every entity. * @param entities Optional. If provided, will only set the positions of the provided entities. Use * this with cached entities to avoid invoking the `Isaac.GetRoomEntities` method * multiple times. */ export declare function setEntityPositions(entityPositions: ReadonlyMap, entities?: readonly Entity[]): void; export declare function setEntityRandomColor(entity: Entity): void; /** * Helper function to set the velocity of every entity in the room based on a map of velocities. If * an entity is found that does not have matching element in the provided map, then that entity will * be skipped. * * This function is useful for rewinding entity velocities at a later time. Also see * `getEntityVelocities`. * * @param entityVelocities The map providing the velocities for every entity. * @param entities Optional. If provided, will only set the velocities of the provided entities. Use * this with cached entities to avoid invoking the `Isaac.GetRoomEntities` method * multiple times. */ export declare function setEntityVelocities(entityVelocities: ReadonlyMap, entities?: readonly Entity[]): void; /** * Helper function to set the minimap `DisplayFlag` value for multiple rooms at once. * * This function automatically calls the `Level.UpdateVisibility` after setting the flags so that * the changes will be immediately visible. * * This function automatically accounts for if MinimapAPI is being used. * * @param displayFlagsMap A map of the display flags that is indexed by the room's safe grid index. */ export declare function setFloorDisplayFlags(displayFlagsMap: ReadonlyMap>): void; /** * Helper function to make a grid entity invisible. This is accomplished by resetting the sprite. * * Note that this function is destructive such that once you make a grid entity invisible, it can no * longer become visible. (This is because the information about the sprite is lost when it is * reset.) */ export declare function setGridEntityInvisible(gridEntity: GridEntity): void; /** * Helper function to change the type of a grid entity to another type. Use this instead of the * `GridEntity.SetType` method since that does not properly handle updating the sprite of the grid * entity after the type is changed. * * Setting the new type to `GridEntityType.NULL` (0) will have no effect. */ export declare function setGridEntityType(gridEntity: GridEntity, gridEntityType: GridEntityType): void; /** * Helper function to check for one or more elements in a set at once without having to repeatedly * call the `Set.has` method. * * This function is variadic, meaning that you can pass as many things as you want to check for. It * will return true if one or more elements are found. */ export declare function setHas(set: ReadonlySet, ...elements: readonly T[]): boolean; /** * Helper function to make using sets with an type of `PtrHash` easier. Use this instead of the * `Set.has` method if you have a set of this type. */ export declare function setHasNPC(set: ReadonlySet, npc: EntityNPC): boolean; /** * Helper function to make using sets with an type of `PlayerIndex` easier. Use this instead of the * `Set.has` method if you have a set of this type. */ export declare function setHasPlayer(set: ReadonlySet, player: EntityPlayer): boolean; /** * Converts every `isaacscript-common` function that begins with "log" to a global function. * * This is useful when printing out variables from the in-game debug console. */ export declare function setLogFunctionsGlobal(): void; /** * Helper function to set a player's health to a specific state. You can use this in combination * with the `getPlayerHealth` function to restore the player's health back to a certain * configuration at a later time. * * Based on the `REVEL.LoadHealth` function in the Revelations mod. */ export declare function setPlayerHealth(player: EntityPlayer, playerHealth: PlayerHealth): void; /** * Helper function to convert an uncleared room to a cleared room in the `POST_NEW_ROOM` callback. * This is useful because if enemies are removed in this callback, a room drop will be awarded and * the doors will start closed and then open. */ export declare function setRoomCleared(): void; /** * Helper function to set the data for a given room. This will change the room type, contents, and * so on. */ export declare function setRoomData(roomGridIndex: int, roomData: RoomConfig): void; /** * Helper function to set 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 displayFlags The bit flags value 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. Set this to false * if you are doing a bunch of display flag setting and then manually call * the `Level.UpdateVisibility` method after you are done. */ export declare function setRoomDisplayFlags(roomGridIndex: int | undefined, displayFlags: BitFlags, updateVisibility?: boolean): void; /** * Helper function to emulate what happens when you bomb an Angel Statue or push a Reward Plate that * spawns an NPC. */ export declare function setRoomUncleared(): void; /** * Helper function to restart the run on a particular starting seed. * * Under the hood, this function executes the `seed` console command. * * @param startSeedOrStartSeedString Either the numerical start seed (e.g. 268365970) or the start * seed string (e.g. "AAJ2 8V9C"). */ export declare function setRunSeed(startSeedOrStartSeedString: Seed | string): void; /** Helper function to set a seed to an RNG object using Blade's recommended shift index. */ export declare function setSeed(rng: RNG, seed: Seed): void; /** * Helper function to keep a sprite's color the same values as it already is but set the opacity to * a specific value. * * @param sprite The sprite to set. * @param alpha A value between 0 and 1 that represents the fade amount. */ export declare function setSpriteOpacity(sprite: Sprite, alpha: float): void; /** * Helper function to directly warp to a specific stage using the "stage" console command. * * This is different from the vanilla `Level.SetStage` method, which will change the stage and/or * stage type of the current floor without moving the player to a new floor. * * Note that if you use this function on game frame 0, it will confuse the * `POST_GAME_STARTED_REORDERED`, `POST_NEW_LEVEL_REORDERED`, and `POST_NEW_ROOM_REORDERED` custom * callbacks. If you are using the function in this situation, remember to call the * `reorderedCallbacksSetStage` function. * * @param stage The stage number to warp to. * @param stageType The stage type to warp to. * @param reseed Optional. Whether to reseed the floor upon arrival. Default is false. Set this to * true if you are warping to the same stage but a different stage type (or else the * floor layout will be identical to the old floor). */ export declare function setStage(stage: LevelStage, stageType: StageType, reseed?: boolean): void; /** Helper function to convert a set of flags to a single `BitFlags` object. */ export declare function setToBitFlags(set: ReadonlySet): BitFlags; /** * Sets the `traceback` and `getTraceback` functions to be global functions. * * This is useful when editing Lua files when troubleshooting. */ export declare function setTracebackFunctionsGlobal(): void; /** * Helper function to change the sprite of a trinket entity. * * For more information about removing the trinket sprite, see the documentation for the * "clearSprite" helper function. * * @param trinket The trinket whose sprite you want to modify. * @param pngPath Equal to either the spritesheet path to load (e.g. * "gfx/items/trinkets/trinket_001_swallowedpenny.png") or undefined. If undefined, * the sprite will be removed, making the trinket effectively invisible (except for * the shadow underneath it). */ export declare function setTrinketSprite(trinket: EntityPickup, pngPath: string | undefined): void; /** * Helper function to change the run status to that of an unseeded run with a new random seed. * * This is useful to revert the behavior where playing on a set seed and restarting the game will * not take you to a new seed. * * Under the hood, this function calls the `Seeds.Reset` method and the * `Seeds.Restart(Challenge.NULL)` method. */ export declare function setUnseeded(): void; /** * A cached version of the class returned from the `SFXManager()` 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 sfxManager: SFXManager; export declare const SHOOTING_BUTTON_ACTIONS: readonly [ButtonAction.SHOOT_LEFT, ButtonAction.SHOOT_RIGHT, ButtonAction.SHOOT_UP, ButtonAction.SHOOT_DOWN]; export declare const SHOOTING_BUTTON_ACTIONS_SET: ReadonlySet; declare function shouldFireCollectibleType(fireArgs: [player: EntityPlayer, collectibleType: CollectibleType], optionalArgs: [collectibleType?: CollectibleType]): boolean; declare function shouldFireGridEntity(fireArgs: [gridEntity: GridEntity] | [gridEntity: GridEntity, oldState: int, newState: int], optionalArgs: [gridEntityType?: GridEntityType, variant?: int]): boolean; declare function shouldFireGridEntityCustom(fireArgs: [gridEntity: GridEntity, gridEntityTypeCustom: GridEntityType] | [ gridEntity: GridEntity, gridEntityTypeCustom: GridEntityType, oldState: int, newState: int ], optionalArgs: [gridEntityTypeCustom?: GridEntityType]): boolean; declare function shouldFireItemPickup(fireArgs: [player: EntityPlayer, pickingUpItem: PickingUpItem], optionalArgs: [itemType?: ItemType, subType?: int]): boolean; declare function shouldFirePickup(fireArgs: [pickup: EntityPickup] | [pickup: EntityPickup, renderOffset: Vector] | [pickup: EntityPickup, player: EntityPlayer] | [pickup: EntityPickup, previousState: int, currentState: int] | [ pickup: EntityPickup, oldVariant: PickupVariant, oldSubType: int, newVariant: PickupVariant, newSubType: int ], optionalArgs: [pickupVariant?: PickupVariant, subType?: int]): boolean; declare function shouldFirePlayer(fireArgs: [player: EntityPlayer] | [player: EntityPlayer, renderOffset: Vector] | [player: EntityPlayer, numSacrifices: int] | [player: EntityPlayer, collectible: EntityPickupCollectible] | [player: EntityPlayer, oldCharacter: PlayerType, newCharacter: PlayerType] | [ player: EntityPlayer, healthType: HealthType, difference: int, oldValue: int, newValue: int ] | [ player: EntityPlayer, amount: float, damageFlags: BitFlags, source: EntityRef, countdownFrames: int ] | [ player: EntityPlayer, playerStat: PlayerStat, difference: int, oldValue: PossibleStatType, newValue: PossibleStatType ], optionalArgs: [playerVariant?: PlayerVariant, character?: PlayerType]): boolean; declare function shouldFireSlot(fireArgs: [slot: EntitySlot] | [slot: EntitySlot, player: EntityPlayer] | [slot: EntitySlot, slotDestructionType: SlotDestructionType] | [slot: EntitySlot, previousAnimation: string, currentAnimation: string], optionalArgs: [slotVariant?: SlotVariant, subType?: int]): boolean; /** * Helper function to check if a player should have Whore of Babylon active at their current health * level. * * - For most characters, Whore of Babylon activates when the red hearts are at 1/2 or less. * - For Eve, Whore of Babylon activates when the red hearts are at 1 or less. */ export declare function shouldWhoreOfBabylonBeActive(player: EntityPlayer): boolean; /** * Shallow copies and shuffles the array using the Fisher-Yates algorithm. Returns the copied array. * * If you want an unseeded shuffle, you must explicitly pass `undefined` to the `seedOrRNG` * parameter. * * From: https://stackoverflow.com/questions/2450954/how-to-randomize-shuffle-a-javascript-array * * @param originalArray The array to shuffle. * @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 shuffleArray(originalArray: readonly T[], seedOrRNG: Seed | RNG | undefined): T[]; /** * Shuffles the provided array in-place using the Fisher-Yates algorithm. * * If you want an unseeded shuffle, you must explicitly pass `undefined` to the `seedOrRNG` * parameter. * * From: https://stackoverflow.com/questions/2450954/how-to-randomize-shuffle-a-javascript-array * * @param array The array to shuffle. * @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 shuffleArrayInPlace(array: unknown[], seedOrRNG: Seed | RNG | undefined): void; /** @returns 1 if n is positive, -1 if n is negative, or 0 if n is 0. */ export declare function sign(n: number): int; declare class SlotDestroyedDetection extends Feature { v: { room: { destroyedSlotSet: Set; }; }; private readonly postSlotDestroyed; private readonly roomHistory; constructor(postSlotDestroyed: PostSlotDestroyed, roomHistory: RoomHistory); private readonly postEntityRemoveSlot; private postEntityRemoveSlotMachine; private postEntityRemoveBeggar; private readonly postSlotUpdate; /** * Slots normally have an entity collision class of `EntityCollisionClass.ALL` (4) and a grid * collision class of `EntityGridCollisionClass.NONE` (0). When they are destroyed with a bomb, * the entity collision class stays the same, but the grid collision class switches to * `EntityGridCollisionClass.GROUND` (5). */ private checkDestroyedFromCollisionClass; } /** This is used in the `POST_SLOT_DESTROYED` custom callback. */ export declare enum SlotDestructionType { /** * When a machine or a beggar is blown up by a bomb or is otherwise removed without spawning a * collectible. * * Note that the destruction type for a Crane Game will be `SlotDestructionType.NORMAL`, even if * it destroyed via spawning three separate collectibles. */ NORMAL = 0, /** * When a machine or a beggar is removed while spawning a collectible reward. * * Note that the destruction type for a Crane Game will be `SlotDestructionType.NORMAL`, even if * it destroyed via spawning three separate collectibles. */ COLLECTIBLE_PAYOUT = 1 } declare class SlotRenderDetection extends Feature { v: { room: { slotAnimations: DefaultMap; brokenSlots: Set; }; }; private readonly postSlotRender; private readonly postSlotAnimationChanged; constructor(postSlotRender: PostSlotRender, postSlotAnimationChanged: PostSlotAnimationChanged); private readonly postRender; private checkSlotAnimationChanged; } declare class SlotUpdateDetection extends Feature { v: { room: { initializedSlots: Set; }; }; private readonly postSlotInit; private readonly postSlotUpdate; constructor(postSlotInit: PostSlotInit, postSlotUpdate: PostSlotUpdate); private readonly postUpdate; private readonly postNewRoomReordered; private checkNewEntity; } /** * Helper function to smelt a trinket. Before smelting, this function will automatically remove the * trinkets that the player is holding, if any, and then give them back after the new trinket is * smelted. * * @param player The player to smelt the trinkets to. * @param trinketType The trinket type to smelt. * @param numTrinkets Optional. If specified, will smelt the given number of trinkets. Use this to * avoid calling this function multiple times. Default is 1. */ export declare function smeltTrinket(player: EntityPlayer, trinketType: TrinketType, numTrinkets?: number): void; /** * Helper function to smelt two or more different trinkets. If you want to smelt one trinket (or * multiple copies of one trinket), then use the `smeltTrinket` helper function instead. * * This function is variadic, meaning that you can pass as many trinket types as you want to smelt. * * Before smelting, this function will automatically remove the trinkets that the player is holding, * if any, and then give them back after the new trinket is smelted. * * @param player The player to smelt the trinkets to. * @param trinketTypes The trinket types to smelt. */ export declare function smeltTrinkets(player: EntityPlayer, ...trinketTypes: readonly TrinketType[]): void; /** * Helper function for non-TypeScript users to check if one or more elements in the array is equal * to a condition. * * Internally, this just calls `Array.some`. */ export declare function some(array: readonly T[], func: (value: T, index: number, array: readonly T[]) => boolean): boolean; export declare function sortNormal(a: unknown, b: unknown): -1 | 0 | 1; /** * Helper function to sort an array of objects by one of the object keys. * * For example: * * ```ts * const myArray = [ * { * name: "alice", * age: 30, * }, * { * name: "bob", * age: 20, * }, * ]; * myArray.sort(sortObjectArrayByKey("age")); * ``` */ export declare function sortObjectArrayByKey(key: string): (a: unknown, b: unknown) => -1 | 0 | 1; /** * Helper function to sort a two-dimensional array by the first element. * * For example: * * ```ts * const myArray = [[1, 2], [2, 3], [3, 4]]; * myArray.sort(sortTwoDimensionalArray); * ``` * * This function also properly handles when the array elements are strings or numbers (instead of * another array). * * From: * https://stackoverflow.com/questions/16096872/how-to-sort-2-dimensional-array-by-column-value */ export declare function sortTwoDimensionalArray(a: readonly T[], b: readonly T[]): -1 | 0 | 1; export declare type SoulHeartType = HeartSubType.SOUL | HeartSubType.BLACK | HeartSubType.BONE; /** * Helper function to spawn an entity. Always use this instead of the `Isaac.Spawn` method, since * using that method can crash the game. * * Also see the `spawnWithSeed` helper function. * * @param entityType The `EntityType` of the entity to spawn. * @param variant The variant of the entity to spawn. * @param subType The sub-type of the entity to spawn. * @param positionOrGridIndex The position or grid index of the entity to spawn. * @param velocity Optional. The velocity of the entity to spawn. Default is `VectorZero`. * @param spawner Optional. The entity that will be the `SpawnerEntity`. Default is undefined. * @param seedOrRNG Optional. The seed or RNG object to use to generate the `InitSeed` of the * entity. Default is undefined, which will make the entity spawn with a random * seed. */ export declare function spawn(entityType: EntityType, variant: int, subType: int, positionOrGridIndex: Vector | int, velocity?: Vector, spawner?: Entity, seedOrRNG?: Seed | RNG): Entity; /** * Helper function to spawn a `EntityType.PICKUP` (5) with variant `PickupVariant.LIL_BATTERY` (90). */ export declare function spawnBattery(batterySubType: BatterySubType, positionOrGridIndex: Vector | int, velocity?: Vector, spawner?: Entity, seedOrRNG?: Seed | RNG): EntityPickupBattery; /** * Helper function to spawn a `EntityType.PICKUP` (5) with variant `PickupVariant.LIL_BATTERY` (90) * and a specific seed. */ export declare function spawnBatteryWithSeed(batterySubType: BatterySubType, positionOrGridIndex: Vector | int, seedOrRNG: Seed | RNG, velocity?: Vector, spawner?: Entity): EntityPickupBattery; /** Helper function to spawn a `EntityType.BOMB` (4). */ export declare function spawnBomb(bombVariant: BombVariant, subType: int, positionOrGridIndex: Vector | int, velocity?: Vector, spawner?: Entity, seedOrRNG?: Seed | RNG): EntityBomb; /** Helper function to spawn a `EntityType.PICKUP` (5) with variant `PickupVariant.BOMB` (40). */ export declare function spawnBombPickup(bombSubType: BombSubType, positionOrGridIndex: Vector | int, velocity?: Vector, spawner?: Entity, seedOrRNG?: Seed | RNG): EntityPickupBomb; /** * Helper function to spawn a `EntityType.PICKUP` (5) with variant `PickupVariant.BOMB` (40) and a * specific seed. */ export declare function spawnBombPickupWithSeed(bombSubType: BombSubType, positionOrGridIndex: Vector | int, seedOrRNG: Seed | RNG, velocity?: Vector, spawner?: Entity): EntityPickupBomb; /** Helper function to spawn a `EntityType.BOMB` (4) with a specific seed. */ export declare function spawnBombWithSeed(bombVariant: BombVariant, subType: int, positionOrGridIndex: Vector | int, seedOrRNG: Seed | RNG, velocity?: Vector, spawner?: Entity): EntityBomb; /** * Helper function to spawn a boss. * * Use this function instead of `spawnNPC` since it handles automatically spawning multiple segments * for multi-segment bosses. * * By default, this will spawn Chub (and his variants) with 3 segments, Lokii with 2 copies, * Gurglings/Turdlings with 2 copies, and other multi-segment bosses with 4 segments. You can * customize this via the "numSegments" argument. */ export declare function spawnBoss(entityType: EntityType, variant: int, subType: int, positionOrGridIndex: Vector | int, velocity?: Vector, spawner?: Entity, seedOrRNG?: Seed | RNG, numSegments?: int): EntityNPC; /** * Helper function to spawn a boss with a specific seed. * * For more information, see the documentation for the `spawnBoss` function. */ export declare function spawnBossWithSeed(entityType: EntityType, variant: int, subType: int, positionOrGridIndex: Vector | int, seedOrRNG: Seed | RNG, velocity?: Vector, spawner?: Entity, numSegments?: int): EntityNPC; /** Helper function to spawn a `EntityType.PICKUP` (5) with variant `PickupVariant.CARD` (300). */ export declare function spawnCard(cardType: CardType, positionOrGridIndex: Vector | int, velocity?: Vector, spawner?: Entity, seedOrRNG?: Seed | RNG): EntityPickupCard; /** * Helper function to spawn a `EntityType.PICKUP` (5) with variant `PickupVariant.CARD` (300) and a * specific seed. */ export declare function spawnCardWithSeed(cardType: CardType, positionOrGridIndex: Vector | int, seedOrRNG: Seed | RNG, velocity?: Vector, spawner?: Entity): EntityPickupCard; /** Helper function to spawn a `EntityType.PICKUP` (5) with variant `PickupVariant.COIN` (20). */ export declare function spawnCoin(coinSubType: CoinSubType, positionOrGridIndex: Vector | int, velocity?: Vector, spawner?: Entity, seedOrRNG?: Seed | RNG): EntityPickupCoin; /** * Helper function to spawn a `EntityType.PICKUP` (5) with variant `PickupVariant.COIN` (20) and a * specific seed. */ export declare function spawnCoinWithSeed(coinSubType: CoinSubType, positionOrGridIndex: Vector | int, seedOrRNG: Seed | RNG, velocity?: Vector, spawner?: Entity): EntityPickupCoin; /** * Helper function to spawn a collectible. * * Use this instead of the `Game.Spawn` method because it handles the cases of Tainted Keeper * collectibles costing coins and prevents quest items from being rotated by Tainted Isaac's * rotation mechanic. * * If you want to spawn an unseeded collectible, you must explicitly pass `undefined` to the * `seedOrRNG` parameter. * * @param collectibleType The collectible type to spawn. * @param positionOrGridIndex The position or grid index to spawn the collectible at. * @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 options Optional. Set to true to make the collectible a "There's Options" style * collectible. Default is false. * @param forceFreeItem Optional. Set to true to disable the logic that gives the item a price for * Tainted Keeper. Default is false. * @param spawner Optional. */ export declare function spawnCollectible(collectibleType: CollectibleType, positionOrGridIndex: Vector | int, seedOrRNG: Seed | RNG | undefined, options?: boolean, forceFreeItem?: boolean, spawner?: Entity): EntityPickupCollectible; /** * Helper function to spawn a collectible from a specific item pool. * * Use this instead of the `Game.Spawn` method because it handles the cases of Tainted Keeper * collectibles costing coins and prevents quest items from being rotated by Tainted Isaac's * rotation mechanic. * * If you want to spawn an unseeded collectible, you must explicitly pass `undefined` to the * `seedOrRNG` parameter. * * In order to use this function, you must upgrade your mod with `ISCFeature.SPAWN_COLLECTIBLE`. * * @param itemPoolType The item pool to draw the collectible type from. * @param positionOrGridIndex The position or grid index to spawn the collectible at. * @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 options Optional. Set to true to make the collectible a "There's Options" style * collectible. Default is false. * @param forceFreeItem Optional. Set to true to disable the logic that gives the item a price for * Tainted Keeper. Default is false. * @param spawner Optional. */ export declare function spawnCollectibleFromPool(itemPoolType: ItemPoolType, positionOrGridIndex: Vector | int, seedOrRNG: Seed | RNG | undefined, options?: boolean, forceFreeItem?: boolean, spawner?: Entity): EntityPickupCollectible; /** Helper function to spawn a `GridEntityType.CRAWL_SPACE` (18). */ export declare function spawnCrawlSpace(gridIndexOrPosition: int | Vector): GridEntity | undefined; /** Helper function to spawn a `GridEntityType.CRAWL_SPACE` (18) with a specific variant. */ export declare function spawnCrawlSpaceWithVariant(crawlSpaceVariant: CrawlSpaceVariant, gridIndexOrPosition: int | Vector): GridEntity | undefined; /** Helper function to spawn a `GridEntityType.PIT` (7) with a specific variant. */ export declare function spawnDoor(gridIndexOrPosition: int | Vector): GridEntityDoor | undefined; /** Helper function to spawn a `GridEntityType.DOOR` (16). */ export declare function spawnDoorWithVariant(doorVariant: DoorVariant, gridIndexOrPosition: int | Vector): GridEntityDoor | undefined; /** Helper function to spawn a `EntityType.EFFECT` (1000). */ export declare function spawnEffect(effectVariant: EffectVariant, subType: int, positionOrGridIndex: Vector | int, velocity?: Vector, spawner?: Entity, seedOrRNG?: Seed | RNG): EntityEffect; /** Helper function to spawn a `EntityType.EFFECT` (1000) with a specific seed. */ export declare function spawnEffectWithSeed(effectVariant: EffectVariant, subType: int, positionOrGridIndex: Vector | int, seedOrRNG: Seed | RNG, velocity?: Vector, spawner?: Entity): EntityEffect; /** * Helper function to spawn an empty collectible. Doing this is tricky since spawning a collectible * with `CollectibleType.NULL` will result in spawning a collectible with a random type from the * current room's item pool. * * Instead, this function arbitrarily spawns a collectible with `CollectibleType.BROKEN_SHOVEL_1`, * and then converts it to an empty pedestal afterward. (Broken Shovel is used instead of e.g. Sad * Onion because it is a quest collectible and quest collectibles will prevent Damocles from * duplicating the pedestal.) * * If you want to spawn an unseeded collectible, you must explicitly pass `undefined` to the * `seedOrRNG` parameter. * * @param positionOrGridIndex The position or grid index to spawn the empty collectible at. * @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 spawnEmptyCollectible(positionOrGridIndex: Vector | int, seedOrRNG: Seed | RNG | undefined): EntityPickup; /** * Helper function to spawn the entity corresponding to an `EntityID`. * * @param entityID The `EntityID` of the entity to spawn. * @param positionOrGridIndex The position or grid index of the entity to spawn. * @param velocity Optional. The velocity of the entity to spawn. Default is `VectorZero`. * @param spawner Optional. The entity that will be the `SpawnerEntity`. Default is undefined. * @param seedOrRNG Optional. The seed or RNG object to use to generate the `InitSeed` of the * entity. Default is undefined, which will make the entity spawn with a random * seed using the `Isaac.Spawn` method. */ export declare function spawnEntityID(entityID: EntityID, positionOrGridIndex: Vector | int, velocity?: Vector, spawner?: Entity, seedOrRNG?: Seed | RNG): Entity; /** * Helper function to spawn a `EntityType.FAMILIAR` (3). * * If you are trying to implement a custom familiar, you probably want to use the * `checkFamiliarFromCollectibles` helper function instead. */ export declare function spawnFamiliar(familiarVariant: FamiliarVariant, subType: int, positionOrGridIndex: Vector | int, velocity?: Vector, spawner?: Entity, seedOrRNG?: Seed | RNG): EntityFamiliar; /** Helper function to spawn a `EntityType.FAMILIAR` (3) with a specific seed. */ export declare function spawnFamiliarWithSeed(familiarVariant: FamiliarVariant, subType: int, positionOrGridIndex: Vector | int, seedOrRNG: Seed | RNG, velocity?: Vector, spawner?: Entity): EntityFamiliar; /** * Helper function to spawn a giant poop. This is performed by spawning each of the four quadrant * grid entities in the appropriate positions. * * @returns Whether spawning the four quadrants was successful. */ export declare function spawnGiantPoop(topLeftGridIndex: int): boolean; /** * Helper function to spawn a grid entity with a specific type. * * This function assumes you want to give the grid entity a variant of 0. If you want to specify a * variant, use the `spawnGridEntityWithVariant` helper function instead. * * Use this instead of the `Isaac.GridSpawn` method since it: * - handles giving pits collision * - removes existing grid entities on the same tile, if any * - allows you to specify either the grid index or the position * * @param gridEntityType The `GridEntityType` to use. * @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 removeExistingGridEntity Optional. Whether to remove the existing grid entity on the same * tile, if it exists. Defaults to true. If false, this function * will do nothing, since spawning a grid entity on top of another * grid entity will not replace it. */ export declare function spawnGridEntity(gridEntityType: GridEntityType, gridIndexOrPosition: int | Vector, removeExistingGridEntity?: boolean): GridEntity | undefined; /** * Helper function to spawn a grid entity with a specific variant. * * Use this instead of the `Isaac.GridSpawn` method since it: * - handles giving pits collision * - removes existing grid entities on the same tile, if any * - allows you to specify the grid index or the position * * @param gridEntityType The `GridEntityType` to use. * @param variant The variant to use. * @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 removeExistingGridEntity Optional. Whether to remove the existing grid entity on the same * tile, if it exists. Defaults to true. If false, this function * will do nothing, since spawning a grid entity on top of another * grid entity will not replace it. */ export declare function spawnGridEntityWithVariant(gridEntityType: GridEntityType, variant: int, gridIndexOrPosition: int | Vector, removeExistingGridEntity?: boolean): GridEntity | undefined; /** Helper function to spawn a `EntityType.PICKUP` (5) with variant `PickupVariant.HEART` (10). */ export declare function spawnHeart(heartSubType: HeartSubType, positionOrGridIndex: Vector | int, velocity?: Vector, spawner?: Entity, seedOrRNG?: Seed | RNG): EntityPickupHeart; export declare function spawnHeartWithSeed(heartSubType: HeartSubType, positionOrGridIndex: Vector | int, seedOrRNG: Seed | RNG, velocity?: Vector, spawner?: Entity): EntityPickupHeart; /** Helper function to spawn a `EntityType.PICKUP` (5) with variant `PickupVariant.KEY` (30). */ export declare function spawnKey(keySubType: KeySubType, positionOrGridIndex: Vector | int, velocity?: Vector, spawner?: Entity, seedOrRNG?: Seed | RNG): EntityPickupKey; /** * Helper function to spawn a `EntityType.PICKUP` (5) with variant `PickupVariant.KEY` (30) and a * specific seed. */ export declare function spawnKeyWithSeed(keySubType: KeySubType, positionOrGridIndex: Vector | int, seedOrRNG: Seed | RNG, velocity?: Vector, spawner?: Entity): EntityPickupKey; /** Helper function to spawn a `EntityType.KNIFE` (8). */ export declare function spawnKnife(knifeVariant: KnifeVariant, subType: int, positionOrGridIndex: Vector | int, velocity?: Vector, spawner?: Entity, seedOrRNG?: Seed | RNG): EntityKnife; /** Helper function to spawn a `EntityType.KNIFE` (8) with a specific seed. */ export declare function spawnKnifeWithSeed(knifeVariant: KnifeVariant, subType: int, positionOrGridIndex: Vector | int, seedOrRNG: Seed | RNG, velocity?: Vector, spawner?: Entity): EntityKnife; /** Helper function to spawn a `EntityType.LASER` (7). */ export declare function spawnLaser(laserVariant: LaserVariant, subType: int, positionOrGridIndex: Vector | int, velocity?: Vector, spawner?: Entity, seedOrRNG?: Seed | RNG): EntityLaser; /** Helper function to spawn a `EntityType.LASER` (7) with a specific seed. */ export declare function spawnLaserWithSeed(laserVariant: LaserVariant, subType: int, positionOrGridIndex: Vector | int, seedOrRNG: Seed | RNG, velocity?: Vector, spawner?: Entity): EntityLaser; /** * Helper function to spawn an NPC. * * Note that if you pass a non-NPC `EntityType` to this function, it will cause a run-time error, * since the `Entity.ToNPC` method will return undefined. */ export declare function spawnNPC(entityType: EntityType, variant: int, subType: int, positionOrGridIndex: Vector | int, velocity?: Vector, spawner?: Entity, seedOrRNG?: Seed | RNG): EntityNPC; /** * Helper function to spawn an NPC with a specific seed. * * Note that if you pass a non-NPC `EntityType` to this function, it will cause a run-time error, * since the `Entity.ToNPC` method will return undefined. */ export declare function spawnNPCWithSeed(entityType: EntityType, variant: int, subType: int, positionOrGridIndex: Vector | int, seedOrRNG: Seed | RNG, velocity?: Vector, spawner?: Entity): EntityNPC; /** Helper function to spawn a `EntityType.PICKUP` (5). */ export declare function spawnPickup(pickupVariant: PickupVariant, subType: int, positionOrGridIndex: Vector | int, velocity?: Vector, spawner?: Entity, seedOrRNG?: Seed | RNG): EntityPickup; /** Helper function to spawn a `EntityType.PICKUP` (5) with a specific seed. */ export declare function spawnPickupWithSeed(pickupVariant: PickupVariant, subType: int, positionOrGridIndex: Vector | int, seedOrRNG: Seed | RNG, velocity?: Vector, spawner?: Entity): EntityPickup; /** Helper function to spawn a `EntityType.PICKUP` (5) with variant `PickupVariant.PILL` (70). */ export declare function spawnPill(pillColor: PillColor, positionOrGridIndex: Vector | int, velocity?: Vector, spawner?: Entity, seedOrRNG?: Seed | RNG): EntityPickupPill; /** * Helper function to spawn a `EntityType.PICKUP` (5) with variant `PickupVariant.PILL` (70) and a * specific seed. */ export declare function spawnPillWithSeed(pillColor: PillColor, positionOrGridIndex: Vector | int, seedOrRNG: Seed | RNG, velocity?: Vector, spawner?: Entity): EntityPickupPill; /** Helper function to spawn a `GridEntityType.DOOR` (16) with a specific variant. */ export declare function spawnPit(gridIndexOrPosition: int | Vector): GridEntityPit | undefined; /** Helper function to spawn a `GridEntityType.PIT` (7) with a specific variant. */ export declare function spawnPitWithVariant(pitVariant: PitVariant, gridIndexOrPosition: int | Vector): GridEntityPit | undefined; /** Helper function to spawn a `GridEntityType.POOP` (14). */ export declare function spawnPoop(gridIndexOrPosition: int | Vector): GridEntityPoop | undefined; /** Helper function to spawn a `GridEntityType.POOP` (14) with a specific variant. */ export declare function spawnPoopWithVariant(poopVariant: PoopGridEntityVariant, gridIndexOrPosition: int | Vector): GridEntityPoop | undefined; /** Helper function to spawn a `GridEntityType.PRESSURE_PLATE` (20). */ export declare function spawnPressurePlate(gridIndexOrPosition: int | Vector): GridEntityPressurePlate | undefined; /** Helper function to spawn a `GridEntityType.PRESSURE_PLATE` (20) with a specific variant. */ export declare function spawnPressurePlateWithVariant(pressurePlateVariant: PressurePlateVariant, gridIndexOrPosition: int | Vector): GridEntityPressurePlate | undefined; /** Helper function to spawn a `EntityType.PROJECTILE` (9). */ export declare function spawnProjectile(projectileVariant: ProjectileVariant, subType: int, positionOrGridIndex: Vector | int, velocity?: Vector, spawner?: Entity, seedOrRNG?: Seed | RNG): EntityProjectile; /** Helper function to spawn a `EntityType.PROJECTILE` (9) with a specific seed. */ export declare function spawnProjectileWithSeed(projectileVariant: ProjectileVariant, subType: int, positionOrGridIndex: Vector | int, seedOrRNG: Seed | RNG, velocity?: Vector, spawner?: Entity): EntityProjectile; /** Helper function to spawn a `GridEntityType.ROCK` (2). */ export declare function spawnRock(gridIndexOrPosition: int | Vector): GridEntityRock | undefined; declare class SpawnRockAltRewards extends Feature { private readonly itemPoolDetection; /** * Helper function for emulating what happens when a vanilla `GridEntityType.ROCK_ALT` grid entity * breaks. * * Most of the time, this function will do nothing, similar to how most of the time, when an * individual urn is destroyed, nothing will spawn. * * Note that in vanilla, trinkets will not spawn if they have already been removed from the * trinket pool. This function cannot replicate that behavior because there is no way to check to * see if a trinket is still in the pool. Thus, it will always have a chance to spawn the * respective trinket * (e.g. Swallowed Penny from urns). * * When filled buckets are destroyed, 6 projectiles will always spawn in a random pattern (in * addition to any other rewards that are spawned). This function does not account for this, so if * you want to specifically emulate destroying a filled bucket, you have to account for the * projectiles yourself. * * The logic in this function is based on the rewards listed on the wiki: * https://bindingofisaacrebirth.fandom.com/wiki/Rocks * * If you want to spawn an unseeded reward, you must explicitly pass `undefined` to the * `seedOrRNG` parameter. * * In order to use this function, you must upgrade your mod with * `ISCFeature.SPAWN_ALT_ROCK_REWARDS`. * * @param positionOrGridIndex The position or grid index to spawn the reward. * @param rockAltType The type of reward to spawn. For example, `RockAltType.URN` will have a * chance at spawning coins and spiders. * @param seedOrRNG The `Seed` or `RNG` object to use. Normally, you should pass the `InitSeed` of * the grid entity that was broken. If an `RNG` object is provided, the * `RNG.Next` method will be called. If `undefined` is provided, it will default * to a random seed. * @returns Whether this function spawned something. * @public */ spawnRockAltReward(positionOrGridIndex: Vector | int, rockAltType: RockAltType, seedOrRNG: Seed | RNG | undefined): boolean; /** * Helper function for emulating what happens when a vanilla `GridEntityType.ROCK_ALT` grid entity * breaks of `RockAltType.URN`. * * For more information, see the documentation for the `spawnRockAltReward` function. * * In order to use this function, you must upgrade your mod with * `ISCFeature.SPAWN_ALT_ROCK_REWARDS`. */ spawnRockAltRewardUrn(position: Vector, rng: RNG): boolean; /** * Helper function for emulating what happens when a vanilla `GridEntityType.ROCK_ALT` grid entity * breaks of `RockAltType.MUSHROOM`. * * For more information, see the documentation for the `spawnRockAltReward` function. * * In order to use this function, you must upgrade your mod with * `ISCFeature.SPAWN_ALT_ROCK_REWARDS`. */ spawnRockAltRewardMushroom(position: Vector, rng: RNG): boolean; /** * Helper function for emulating what happens when a vanilla `GridEntityType.ROCK_ALT` grid entity * breaks of `RockAltType.SKULL`. * * For more information, see the documentation for the `spawnRockAltReward` function. * * In order to use this function, you must upgrade your mod with * `ISCFeature.SPAWN_ALT_ROCK_REWARDS`. */ spawnRockAltRewardSkull(position: Vector, rng: RNG): boolean; /** * Helper function for emulating what happens when a vanilla `GridEntityType.ROCK_ALT` grid entity * breaks of `RockAltType.POLYP`. * * For more information, see the documentation for the `spawnRockAltReward` function. * * In order to use this function, you must upgrade your mod with * `ISCFeature.SPAWN_ALT_ROCK_REWARDS`. */ spawnRockAltRewardPolyp(position: Vector, rng: RNG): boolean; /** * Helper function for emulating what happens when a vanilla `GridEntityType.ROCK_ALT` grid entity * breaks of `RockAltType.BUCKET_DOWNPOUR`. * * For more information, see the documentation for the `spawnRockAltReward` function. * * In order to use this function, you must upgrade your mod with * `ISCFeature.SPAWN_ALT_ROCK_REWARDS`. */ spawnRockAltRewardBucketDownpour(position: Vector, rng: RNG): boolean; /** * Helper function for emulating what happens when a vanilla `GridEntityType.ROCK_ALT` grid entity * breaks of `RockAltType.BUCKET_DROSS`. * * For more information, see the documentation for the `spawnRockAltReward` function. * * In order to use this function, you must upgrade your mod with * `ISCFeature.SPAWN_ALT_ROCK_REWARDS`. */ spawnRockAltRewardBucketDross(position: Vector, rng: RNG): boolean; } /** Helper function to spawn a `GridEntityType.ROCK` (2) with a specific variant. */ export declare function spawnRockWithVariant(rockVariant: RockVariant, gridIndexOrPosition: int | Vector): GridEntityRock | undefined; /** Helper function to spawn a `EntityType.PICKUP` (5) with variant `PickupVariant.SACK` (69). */ export declare function spawnSack(sackSubType: SackSubType, positionOrGridIndex: Vector | int, velocity?: Vector, spawner?: Entity, seedOrRNG?: Seed | RNG): EntityPickupSack; /** * Helper function to spawn a `EntityType.PICKUP` (5) with variant `PickupVariant.SACK` (69) and a * specific seed. */ export declare function spawnSackWithSeed(sackSubType: SackSubType, positionOrGridIndex: Vector | int, seedOrRNG: Seed | RNG, velocity?: Vector, spawner?: Entity): EntityPickupSack; /** Helper function to spawn a `EntityType.SLOT` (6). */ export declare function spawnSlot(slotVariant: SlotVariant, subType: int, positionOrGridIndex: Vector | int, velocity?: Vector, spawner?: Entity, seedOrRNG?: Seed | RNG): EntitySlot; /** Helper function to spawn a `EntityType.SLOT` (6) with a specific seed. */ export declare function spawnSlotWithSeed(slotVariant: SlotVariant, subType: int, positionOrGridIndex: Vector | int, seedOrRNG: Seed | RNG, velocity?: Vector, spawner?: Entity): EntitySlot; /** Helper function to spawn a `GridEntityType.SPIKES` (8). */ export declare function spawnSpikes(gridIndexOrPosition: int | Vector): GridEntitySpikes | undefined; /** Helper function to spawn a `GridEntityType.SPIKES` (8) with a specific variant. */ export declare function spawnSpikesWithVariant(variant: int, gridIndexOrPosition: int | Vector): GridEntitySpikes | undefined; /** Helper function to spawn a `EntityType.TEAR` (2). */ export declare function spawnTear(tearVariant: TearVariant, subType: int, positionOrGridIndex: Vector | int, velocity?: Vector, spawner?: Entity, seedOrRNG?: Seed | RNG): EntityTear; /** Helper function to spawn a `EntityType.EntityType` (2) with a specific seed. */ export declare function spawnTearWithSeed(tearVariant: TearVariant, subType: int, positionOrGridIndex: Vector | int, seedOrRNG: Seed | RNG, velocity?: Vector, spawner?: Entity): EntityTear; /** Helper function to spawn a `GridEntityType.TELEPORTER` (23). */ export declare function spawnTeleporter(gridIndexOrPosition: int | Vector): GridEntity | undefined; /** Helper function to spawn a `GridEntityType.TELEPORTER` (23) with a specific variant. */ export declare function spawnTeleporterWithVariant(variant: int, gridIndexOrPosition: int | Vector): GridEntity | undefined; /** Helper function to spawn a `GridEntityType.TNT` (12). */ export declare function spawnTNT(gridIndexOrPosition: int | Vector): GridEntityTNT | undefined; /** Helper function to spawn a `GridEntityType.TNT` (12) with a specific variant. */ export declare function spawnTNTWithVariant(variant: int, gridIndexOrPosition: int | Vector): GridEntityTNT | undefined; /** Helper function to spawn a `GridEntityType.TRAPDOOR` (17). */ export declare function spawnTrapdoor(gridIndexOrPosition: int | Vector): GridEntity | undefined; /** Helper function to spawn a `GridEntityType.TRAPDOOR` (17) with a specific variant. */ export declare function spawnTrapdoorWithVariant(trapdoorVariant: TrapdoorVariant, gridIndexOrPosition: int | Vector): GridEntity | undefined; /** * Helper function to spawn a `EntityType.PICKUP` (5) with variant `PickupVariant.TRINKET` (350). */ export declare function spawnTrinket(trinketType: TrinketType, positionOrGridIndex: Vector | int, velocity?: Vector, spawner?: Entity, seedOrRNG?: Seed | RNG): EntityPickupTrinket; /** * Helper function to spawn a `EntityType.PICKUP` (5) with variant `PickupVariant.TRINKET` (350) and * a specific seed. */ export declare function spawnTrinketWithSeed(trinketType: TrinketType, positionOrGridIndex: Vector | int, seedOrRNG: Seed | RNG, velocity?: Vector, spawner?: Entity): EntityPickupTrinket; /** * Helper function to spawn a Void Portal. This is more complicated than simply spawning a trapdoor * with the appropriate variant, as the game does not give it the correct sprite automatically. */ export declare function spawnVoidPortal(gridIndex: int): GridEntity | undefined; /** * Helper function to spawn an entity. Use this instead of the `Game.Spawn` method if you do not * need to specify the velocity or spawner. */ export declare function spawnWithSeed(entityType: EntityType, variant: int, subType: int, positionOrGridIndex: Vector | int, seedOrRNG: Seed | RNG, velocity?: Vector, spawner?: Entity): Entity; /** * Breaks a number into chunks of a given size. This is similar to the `String.split` method, but * for a number instead of a string. * * For example, `splitNumber(90, 25)` would return an array with four elements: * * - [1, 25] * - [26, 50] * - [51, 75] * - [76, 90] * * @param num The number to split into chunks. This must be a positive integer. * @param size The size of each chunk. This must be a positive integer. * @param startAtZero Whether to start at 0. Defaults to false. If true, the chunks will start at 0 * instead of 1. */ export declare function splitNumber(num: int, size: int, startAtZero?: boolean): ReadonlyArray; /** * Helper function to check if two sprite layers have the same sprite sheet by using the * `Sprite.GetTexel` method. * * Since checking every single texel in the entire sprite is very expensive, this function requires * that you provide a range of specific texels to check. */ export declare function spriteEquals(sprite1: Sprite, sprite2: Sprite, layerID: int, xStart: int, xFinish: int, xIncrement: int, yStart: int, yFinish: int, yIncrement: int): boolean; /** * Helper function to sort an array in a stable way. * * This is useful because by default, the transpiled `Array.sort` method from TSTL is not stable. * * Under the hood, this uses the merge sort algorithm. */ export declare function stableSort(array: T[], sortFunc?: (a: T, b: T) => -1 | 0 | 1): T[]; declare class StageHistory extends Feature { private readonly postNewLevelReordered; /** * 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. * * This function accounts for the previous floors that a player has visited thus far on the run so * that the next stage type can be properly calculated on The Ascent (which makes it unlike the * `getNextStageType` function). * * In order to use this function, you must upgrade your mod with `ISCFeature.STAGE_HISTORY`. * * @param upwards Whether the player should go up to Cathedral in the case of being on Womb 2. * Default is false. * @public */ getNextStageTypeWithHistory(upwards?: boolean): StageType; /** * 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. * * This function accounts for the previous floors that a player has visited thus far on the run so * that the next stage can be properly calculated on The Ascent (which makes it unlike the * `getNextStage` function). * * In order to use this function, you must upgrade your mod with `ISCFeature.STAGE_HISTORY`. */ getNextStageWithHistory(): LevelStage; /** * Helper function to get all of the stages that a player has visited thus far on this run. * * In order to use this function, you must upgrade your mod with `ISCFeature.STAGE_HISTORY`. * * @public */ getStageHistory(): readonly StageHistoryEntry[]; /** * Helper function to check if a player has previous visited a particular stage (or stage + stage * type combination) on this run. * * In order to use this function, you must upgrade your mod with `ISCFeature.STAGE_HISTORY`. * * @param stage The stage to check for. * @param stageType Optional. If provided, will check for a specific stage and stage type * combination. */ hasVisitedStage(stage: LevelStage, stageType?: StageType): boolean; } /** This is used by the `StageHistory` feature. */ export declare interface StageHistoryEntry { readonly stage: LevelStage; readonly stageType: StageType; } declare class StartAmbush extends Feature { private readonly runInNFrames; /** * Helper function to start a Challenge Room or the Boss Rush. * * Specifically, this is performed by spawning a sack on top of the player, waiting a game frame, * and then removing the sack and the pickups that the sack dropped. * * In order to use this function, you must upgrade your mod with `ISCFeature.START_AMBUSH`. * * @public */ startAmbush(): void; } /** * The starting room of the floor is always at the same grid index, which is in the middle of the * 13x13 grid. */ export declare const STARTING_ROOM_GRID_INDEX = 84; /** Helper type to ensure that the given string starts with an lowercase letter. */ export declare type StartsWithLowercase = S extends string ? Extract> : never; /** Helper type to ensure that the given string starts with an uppercase letter. */ export declare type StartsWithUppercase = S extends string ? Extract> : never; /** * Helper function to manually stop every vanilla sound effect. If you also want to stop custom * sound effects in addition to vanilla ones, then pass the `SoundEffectCustom` enum for your mod. * * @param soundEffectCustom Optional. The enum that represents all of the custom sound effects for * your mod. */ export declare function stopAllSoundEffects(soundEffectCustom?: TranspiledEnum): void; declare const STORY_BOSS_IDS: readonly [BossID.MOM, BossID.MOMS_HEART, BossID.SATAN, BossID.IT_LIVES, BossID.ISAAC, BossID.BLUE_BABY, BossID.LAMB, BossID.MEGA_SATAN, BossID.ULTRA_GREED, BossID.HUSH, BossID.DELIRIUM, BossID.ULTRA_GREEDIER, BossID.MOTHER, BossID.MAUSOLEUM_MOM, BossID.MAUSOLEUM_MOMS_HEART, BossID.DOGMA, BossID.BEAST]; /** * A helper type that is a union of every story boss. Useful for data structures that must contain * one entry for each story boss. */ export declare type StoryBossID = (typeof STORY_BOSS_IDS)[number]; /** * Helper type to subtract two other types. * * From: https://gist.github.com/ryandabler/8b4ff4f36aed47bc09acc03174638468 */ export declare type Subtract = A extends A ? BuildTuple extends [...infer U, ...BuildTuple] ? Length : never : never; /** Helper function to sum every value in an array together. */ export declare function sumArray(array: readonly number[]): number; /** Helper function to sum every value in a map together. */ export declare function sumMap(map: ReadonlyMap): number; /** Helper function to sum every value in a set together. */ export declare function sumSet(set: ReadonlySet): number; /** * Helper function to swap two different array elements. (The elements will be swapped in-place.) */ export declare function swapArrayElements(array: unknown[], i: number, j: number): void; declare type T = ModCallbackCustom.POST_CUSTOM_REVIVE; declare type T_2 = ModCallbackCustom.POST_GRID_ENTITY_COLLISION; declare type T_3 = ModCallbackCustom.POST_GRID_ENTITY_CUSTOM_COLLISION; declare type T_4 = ModCallbackCustom.POST_GRID_ENTITY_REMOVE; declare type T_5 = ModCallbackCustom.POST_GRID_ENTITY_CUSTOM_REMOVE; /** * Helper function to check if a Lua table has all of the provided keys. * * This function is variadic, meaning that you can specify as many arguments as you want to check * for. */ export declare function tableHasKeys(luaMap: LuaMap, ...keys: readonly string[]): boolean; /** After taking damage, `EntityPlayer.SamsonBerserkCharge` is incremented by this amount. */ export declare const TAINTED_SAMSON_BERSERK_CHARGE_FROM_TAKING_DAMAGE = 10000; /** * This feature provides a way for end-users to get the `EntityPlayer` object for the other Tainted * Lazarus. */ declare class TaintedLazarusPlayers extends Feature { vConditionalFunc: () => boolean; private readonly postPlayerInit; /** * Indexes are the `PtrHash`, values are the `EntityPtr` of the *other* Lazarus. * * When starting a run, the `POST_PLAYER_INIT` callback will fire first for Dead Tainted Lazarus, * then for Tainted Lazarus. When continuing a run, the `POST_PLAYER_INIT` callback will fire * first for the character that is currently active. Thus, since the order of the characters is * not certain, we insert each of their pointers into a queue, and then only populate the map when * we have one Tainted Lazarus and one Dead Tainted Lazarus. */ private checkDequeue; /** * Helper function to get the other version of Tainted Lazarus. * * - On Tainted Lazarus, returns the player object for Dead Tainted Lazarus. * - On Dead Tainted Lazarus, returns the player object for Tainted Lazarus. * - Returns undefined if player object retrieval failed for any reason. * * If you call the `EntityPlayer.Exists` method on the returned object, it will return false. * However, you can still call the other methods like you normally would (e.g. * `EntityPlayer.AddCollectible`). * * In order to use this function, you must upgrade your mod with * `ISCFeature.CHARACTER_HEALTH_CONVERSION`. * * @public */ getTaintedLazarusSubPlayer(player: EntityPlayer): EntityPlayer | undefined; } export declare function tanh(x: number): number; /** * Helper function to change the current room. It can be used for both teleportation and "normal" * room transitions, depending on what is passed for the `direction` and `roomTransitionAnim` * arguments. * * Use this function instead of invoking the `Game.StartRoomTransition` method directly so that: * - you do not forget to set the `Level.LeaveDoor` field * - to prevent crashing on invalid room grid indexes * * Note that if the current floor has Curse of the Maze, it may redirect the intended teleport. * * @param roomGridIndex The room grid index of the destination room. * @param direction Optional. Default is `Direction.NO_DIRECTION`. * @param roomTransitionAnim Optional. Default is `RoomTransitionAnim.TELEPORT`. */ export declare function teleport(roomGridIndex: int, direction?: Direction, roomTransitionAnim?: RoomTransitionAnim): void; /** For `GridEntityType.TELEPORTER` (23). */ export declare const TELEPORTER_ACTIVATION_DISTANCE: number; /** * Helper function to temporarily remove a specific kind of trinket from the player. Use this in * combination with the `giveTrinketsBack` function to take away and give back a trinket on the same * frame. This function correctly handles multiple trinket slots and ensures that all copies of the * trinket are removed, including smelted trinkets. * * Note that one smelted golden trinket is the same as two smelted normal trinkets. * * @returns Undefined if the player does not have the trinket, or TrinketSituation if they do. */ export declare function temporarilyRemoveTrinket(player: EntityPlayer, trinketType: TrinketType): TrinketSituation | undefined; /** * Helper function to temporarily removes a player's held trinkets, if any. This will not remove any * smelted trinkets. Use this in combination with the `giveTrinketsBack` function to take away and * give back trinkets on the same frame. * * @returns Undefined if the player does not have any trinkets, or TrinketSituation if they do. */ export declare function temporarilyRemoveTrinkets(player: EntityPlayer): TrinketSituation | undefined; /** Helper function to check if two texels on a sprite are equivalent to each other. */ export declare function texelEquals(sprite1: Sprite, sprite2: Sprite, position: Vector, layerID: int): boolean; /** In milliseconds, as reported by the `Isaac.GetTime` method. */ export declare const TIME_GAME_OPENED: int; /** * Helper function to signify that the enclosing code block is not yet complete. Using this function * is similar to writing a "TODO" comment, but it has the benefit of preventing ESLint errors due to * unused variables or early returns. * * When you see this function, it simply means that the programmer intends to add in more code to * this spot later. * * This function is variadic, meaning that you can pass as many arguments as you want. (This is * useful as a means to prevent unused variables.) * * This function does not actually do anything. (It is an "empty" function.) * * @allowEmptyVariadic */ export declare function todo(...args: readonly unknown[]): void; /** * Helper function to log a stack trace to the "log.txt" file, similar to JavaScript's * `console.trace` function. * * This will only work if the `--luadebug` launch option is enabled. If it isn't, then a error * string will be logged. */ export declare function traceback(this: void): void; /** Maps transformation names to the values of the `PlayerForm` enum. */ export declare const TRANSFORMATION_NAME_TO_PLAYER_FORM_MAP: ReadonlyMap; /** * In Lua, tables can have number keys, but since this is a type only being validated in TypeScript, * we can match the JavaScript definition, meaning that we can omit the number from the keys. */ export declare type TranspiledEnum = Record; /** Helper function to trim a prefix from a string, if it exists. Returns the trimmed string. */ export declare function trimPrefix(string: string, prefix: string): string; /** Helper function to trim a suffix from a string, if it exists. Returns the trimmed string. */ export declare function trimSuffix(string: string, prefix: string): string; /** * Maps trinket names to the values of the `TrinketType` enum. * * For a mapping of `TrinketType` to name, see the `TRINKET_NAMES` constant. */ export declare const TRINKET_NAME_TO_TYPE_MAP: ReadonlyMap; /** Helper function to check in the item config if a given trinket has a given cache flag. */ export declare function trinketHasCacheFlag(trinketType: TrinketType, cacheFlag: CacheFlag): boolean; /** This is used by the `temporarilyRemoveTrinkets` and related helper functions. */ export declare interface TrinketSituation { trinketTypeRemoved: TrinketType; trinketType1: TrinketType; trinketType2: TrinketType; numSmeltedTrinkets: int; } /** * This is a type representing a user-created class from TypeScript code. (TypeScriptToLua * transpiles TypeScript classes to a Lua table with a specific kind of metatable.) * * This type is used by the save data manager to when copying, serializing, and deserializing. */ export declare type TSTLClass = LuaMap & { readonly __tstlClassBrand: symbol; }; /** * This is a type representing the metatable of a user-created class from TypeScript code. * (TypeScriptToLua transpiles TypeScript classes to a Lua table with a specific kind of metatable.) */ export declare interface TSTLClassMetatable { ____constructor: () => void; __index: unknown; constructor: { name: string; prototype: LuaMetatable>; }; } /** * Helper type to represent a tuple of length N. * * From: * https://stackoverflow.com/questions/52489261/typescript-can-i-define-an-n-length-tuple-type/52490977#52490977 */ export declare type Tuple = N extends N ? number extends N ? T[] : _TupleOf : never; /** * Helper type to get the valid indexes for a tuple. For example, using a tuple of length 3 will * return `0 | 1 | 2`. */ export declare type TupleKeys = ERange<0, T["length"]>; declare type _TupleOf = R["length"] extends N ? R : _TupleOf; export declare type TupleToIntersection = T extends readonly [infer F, ...infer R] ? F & TupleToIntersection : unknown; /** Helper type to convert a tuple to a union. */ export declare type TupleToUnion = T[number]; /** * Helper type that validates that a tuple has a length between `MinLength` and `MaxLength` * (inclusive on both ends). * * For example, `TupleWithLengthBetween` will allow string tuples of size 2, 3, or 4. */ export declare type TupleWithLengthBetween = readonly T[] & { length: IRange; }; /** * Helper type that validates that a tuple does not have a length greater than N. * * For example, `TupleWithMaxLength` will allow string tuples of size 0, 1, 2, or 3. */ export declare type TupleWithMaxLength = readonly T[] & { length: IRange<0, MaxLength>; }; /** * This is the number of draw coordinates that each heart spans on the UI in the upper left hand * corner. */ export declare const UI_HEART_WIDTH = 12; export declare function uncapitalizeFirstLetter(string: string): string; /** Helper type to convert a union to an intersection. */ export declare type UnionToIntersection = (U extends U ? (u: U) => 0 : never) extends (i: infer I) => 0 ? Extract : never; declare class UnlockAchievementsDetection extends Feature { private readonly postGameStartedReordered; /** * Helper function to see if the current run can unlock achievements. For example, if playing on a * set seed or in a victory lap, achievements are disabled. * * Under the hood, this is determined by spawning a Greed Donation Machine at the beginning of the * run and then seeing if it exists before removing it. (The results are cached for the entire * run.) * * In order to use this function, you must upgrade your mod with * `ISCFeature.UNLOCK_ACHIEVEMENTS_DETECTION`. * * @public */ canRunUnlockAchievements(): boolean; } /** * Use this function to enable the custom callbacks and other optional features provided by * `isaacscript-common`. * * For example: * * ```ts * const modVanilla = RegisterMod("My Mod", 1); * const mod = upgradeMod(modVanilla); * * // Subscribe to vanilla callbacks. * mod.AddCallback(ModCallback.POST_UPDATE, postUpdate); * * // Subscribe to custom callbacks. * mod.AddCallbackCustom(ModCallbackCustom.POST_ITEM_PICKUP, postItemPickup); * ``` * * @param modVanilla The mod object returned by the `RegisterMod` function. * @param features Optional. An array containing the optional standard library features that you * want to enable, if any. Default is an empty array. * @param debug Optional. Whether to log additional output when a callback is fired. Default is * false. * @param timeThreshold Optional. If provided, will only log callbacks that take longer than the * specified number of seconds (if the "--luadebug" launch flag is turned on) * or milliseconds (if the "--luadebug" launch flag is turned off). * @returns The upgraded mod object. */ export declare function upgradeMod(modVanilla: Mod, features?: ISCFeatureTuple, debug?: boolean, timeThreshold?: float): ModUpgradedWithFeatures; /** Helper type to match all of the uppercase keys of an object. */ export declare type UppercaseKeys = StartsWithUppercase; /** * Helper function to use an active item without showing an animation, keeping the item, or adding * any costumes. */ export declare function useActiveItemTemp(player: EntityPlayer, collectibleType: CollectibleType): void; /** * Helper function to use a card without showing an animation and without the announcer voice * playing. */ export declare function useCardTemp(player: EntityPlayer, cardType: CardType): void; /** * Helper function to check every value of a custom enum for -1. Will throw an run-time error if any * -1 values are found. This is helpful because many methods of the Isaac class return -1 if they * fail. * * For example: * * ```ts * enum EntityTypeCustom { * FOO = Isaac.GetEntityTypeByName("Foo"), * } * * validateCustomEnum("EntityTypeCustom", EntityTypeCustom); * ``` */ export declare function validateCustomEnum(transpiledEnumName: string, transpiledEnum: TranspiledEnum): void; /** * Helper function to validate if every value in a number enum is contiguous, starting at 0. * * This is useful to automate checking large enums for typos. */ export declare function validateEnumContiguous(transpiledEnumName: string, transpiledEnum: TranspiledEnum): void; /** * An array that represents the range from the first vanilla card type to the last vanilla card * type. * * This function is only useful when building card type objects. For most purposes, you should use * the `VANILLA_CARD_TYPES` or `VANILLA_CARD_TYPES_SET` constants instead. */ export declare const VANILLA_CARD_TYPE_RANGE: readonly int[]; /** * An array that contains every valid vanilla card type, as verified by the `ItemConfig.GetCard` * method. Vanilla card types are contiguous, but we validate every entry to double check. * * If you need to do O(1) lookups, use the `VANILLA_CARD_TYPES_SET` constant instead. */ export declare const VANILLA_CARD_TYPES: readonly CardType[]; /** * A set that contains every valid vanilla card type, as verified by the `ItemConfig.GetCard` * method. Vanilla card types are contiguous, but we validate every entry to double check. */ export declare const VANILLA_CARD_TYPES_SET: ReadonlySet; /** * An array that represents the range from the first vanilla collectible type to the last vanilla * collectible type. This will include integers that do not represent any valid collectible types. * * This function is only useful when building collectible type objects. For most purposes, you * should use the `VANILLA_COLLECTIBLE_TYPES` or `VANILLA_COLLECTIBLE_TYPES_SET` constants instead. */ export declare const VANILLA_COLLECTIBLE_TYPE_RANGE: readonly int[]; /** * An array that contains every valid vanilla collectible type, as verified by the * `ItemConfig.GetCollectible` method. Vanilla collectible types are not contiguous, so every valid * must be verified. (There are several gaps, e.g. 666.) * * If you need to do O(1) lookups, use the `VANILLA_COLLECTIBLE_TYPES_SET` constant instead. */ export declare const VANILLA_COLLECTIBLE_TYPES: readonly CollectibleType[]; /** * A set that contains every valid vanilla collectible type, as verified by the * `ItemConfig.GetCollectible` method. Vanilla collectible types are not contiguous, so every valid * must be verified. (There are several gaps, e.g. 666.) */ export declare const VANILLA_COLLECTIBLE_TYPES_SET: ReadonlySet; /** * An array that represents the range from the first vanilla pill effect to the last vanilla pill * effect. * * This function is only useful when building pill effect objects. For most purposes, you should use * the `VANILLA_PILL_EFFECTS` or `VANILLA_PILL_EFFECTS_SET` constants instead. */ export declare const VANILLA_PILL_EFFECT_RANGE: readonly int[]; /** * An array that contains every valid vanilla pill effect, as verified by the * `ItemConfig.GetPillEffect` method. Vanilla pill effects are contiguous, but we validate every * entry to double check. * * If you need to do O(1) lookups, use the `VANILLA_PILL_EFFECT_SET` constant instead. */ export declare const VANILLA_PILL_EFFECTS: readonly PillEffect[]; /** * A set that contains every valid vanilla pill effect, as verified by the * `ItemConfig.GetPillEffect` method. Vanilla pill effects are contiguous, but we validate every * entry to double check. */ export declare const VANILLA_PILL_EFFECTS_SET: ReadonlySet; /** * An array that represents the range from the first vanilla trinket type to the last vanilla * trinket type. This will include integers that do not represent any valid trinket types. * * This function is only useful when building trinket type objects. For most purposes, you should * use the `VANILLA_TRINKET_TYPES` or `VANILLA_TRINKET_TYPES_SET` constants instead. */ export declare const VANILLA_TRINKET_TYPE_RANGE: readonly int[]; /** * An array that contains every valid vanilla trinket type, as verified by the * `ItemConfig.GetTrinket` method. Vanilla trinket types are not contiguous, so every valid must be * verified. (The only gap is 47 for `POLAROID_OBSOLETE`.) * * If you need to do O(1) lookups, use the `VANILLA_TRINKET_TYPES_SET` constant instead. */ export declare const VANILLA_TRINKET_TYPES: readonly TrinketType[]; /** * A set that contains every valid vanilla trinket type, as verified by the `ItemConfig.GetTrinket` * method. Vanilla trinket types are not contiguous, so every valid must be verified. (The only gap * is 47 for `POLAROID_OBSOLETE`.) */ export declare const VANILLA_TRINKET_TYPES_SET: ReadonlySet; /** * Helper function to compare two vectors for equality. * * This function is useful because vectors are not directly comparable. In other words, `Vector(1.2) * === Vector(1.2)` will be equal to false. */ export declare function vectorEquals(vector1: Vector, vector2: Vector): boolean; /** * Equal to `Vector(1, 1)`. * * This is a safe version of the `Vector.One` constant. (Other mods can mutate `Vector.One`, so it * is not safe to use.) */ export declare const VectorOne: Readonly; /** Helper function for finding out which way a vector is pointing. */ export declare function vectorToDirection(vector: Vector): Direction; /** * Helper function to convert a room grid index expressed as a vector back into an integer. * * Also see the `roomGridIndexToVector` helper function. */ export declare function vectorToRoomGridIndex(roomVector: Vector): int; /** * Helper function to convert a vector to a string. * * @param vector The vector to convert. * @param round Optional. If true, will round the vector values to the nearest integer. Default is * false. */ export declare function vectorToString(vector: Vector, round?: boolean): string; /** * Equal to `Vector(0, 0)`. * * This is a safe version of the `Vector.Zero` constant. (Other mods can mutate `Vector.Zero`, so it * is not safe to use.) */ export declare const VectorZero: Readonly; /** An array where each element is paired with a number indicating that element's weight. */ export declare type WeightedArray = Array<[T, float]>; export declare type WidenLiteral = T extends string ? string : T extends number ? number : T extends boolean ? boolean : T extends bigint ? bigint : T extends symbol ? symbol : T; /** * Assuming that we are on the frame of fatal damage, this function returns whether Mysterious Paper * would rotate to Missing Poster on the frame that the "Game Over" screen would appear (which would * subsequently save the player from fatal damage). * * Mysterious Paper rotates between the 4 items on every frame, in order. The formula for whether * Mysterious Paper be Missing Power is: `gameFrameCount % 4 === 3` */ export declare function willMysteriousPaperRevive(player: EntityPlayer): boolean; /** * The `EntityPlayer.WillPlayerRevive` method does not properly account for Mysterious Paper, so use * this helper function instead for more robust revival detection. */ export declare function willPlayerRevive(player: EntityPlayer): boolean; /** * Helper function to determine if the player will be revived by the Heartbreak collectible if they * take fatal damage. This is contingent on the character that they are playing as and the amount of * broken hearts that they already have. */ export declare function willReviveFromHeartbreak(player: EntityPlayer): boolean; /** * Helper function to determine if the Spirit Shackles item is in an enabled state. (It can be * either enabled or disabled.) */ export declare function willReviveFromSpiritShackles(player: EntityPlayer): boolean; /** * Helper function to convert a world position `Vector` to a grid position `Vector`. * * In this context, the grid position of the top-left wall is "Vector(-1, -1)". */ export declare function worldPositionToGridPosition(worldPos: Vector): Readonly; /** * Helper function to convert a world position `Vector` to a grid position `Vector`. * * In this context, the grid position of the top-left wall is "Vector(-1, -1)". * * This is similar to the `worldPositionToGridPosition` function, but the values are not rounded. */ export declare function worldPositionToGridPositionFast(worldPos: Vector): Readonly; /** * Helper function to see if a certain damage amount would deal "permanent" damage to Tainted * Magdalene. * * Tainted Magdalene has "permanent" health and "temporary" health. When standing still and doing * nothing, all of Tainted Magdalene's temporary health will eventually go away. * * Before using this function, it is expected that you check to see if the player is Tainted * Magdalene first, or else it will give a nonsensical result. */ export declare function wouldDamageTaintedMagdaleneNonTemporaryHeartContainers(player: EntityPlayer, damageAmount: float): boolean; /** * Helper type to convert a read-only object into a writable object. * * This is the opposite of the built-in `Readonly` utility type. */ export declare type Writeable = { -readonly [P in keyof T]: T[P]; }; export { }