diff --git a/packages/isaac-typescript-definitions-repentogon/src/enums/AltRockType.ts b/packages/isaac-typescript-definitions-repentogon/src/enums/AltRockType.ts new file mode 100644 index 000000000..5febfa5f8 --- /dev/null +++ b/packages/isaac-typescript-definitions-repentogon/src/enums/AltRockType.ts @@ -0,0 +1,23 @@ +/** + * This enum is for REPENTOGON, an exe-hack which expands the modding API. + * + * @see https://repentogon.com/ + */ +export enum AltRockType { + URN = 1, + MUSHROOM = 2, + SKULL = 3, + POLYP = 4, + /** + * Destroying buckets in Downpour give different outcomes than in Dross. + * + * See: https://bindingofisaacrebirth.fandom.com/wiki/Rocks#Buckets + */ + BUCKET_DOWNPOUR = 5, + /** + * Destroying buckets in Dross give different outcomes than in Downpour. + * + * See: https://bindingofisaacrebirth.fandom.com/wiki/Rocks#Buckets + */ + BUCKET_DROSS = 6, +} diff --git a/packages/isaac-typescript-definitions-repentogon/src/enums/CoinJamAnimation.ts b/packages/isaac-typescript-definitions-repentogon/src/enums/CoinJamAnimation.ts new file mode 100644 index 000000000..3712ccb1c --- /dev/null +++ b/packages/isaac-typescript-definitions-repentogon/src/enums/CoinJamAnimation.ts @@ -0,0 +1,11 @@ +/** + * This enum is for REPENTOGON, an exe-hack which expands the modding API. + * + * @see https://repentogon.com/ + */ +export enum CoinJamAnimation { + COIN_JAM_1 = "CoinJam", + COIN_JAM_2 = "CoinJam2", + COIN_JAM_3 = "CoinJam3", + COIN_JAM_4 = "CoinJam4", +} diff --git a/packages/isaac-typescript-definitions-repentogon/src/enums/SlotState.ts b/packages/isaac-typescript-definitions-repentogon/src/enums/SlotState.ts new file mode 100644 index 000000000..9934a6e6f --- /dev/null +++ b/packages/isaac-typescript-definitions-repentogon/src/enums/SlotState.ts @@ -0,0 +1,17 @@ +/** + * This enum is for REPENTOGON, an exe-hack which expands the modding API. + * + * @see https://repentogon.com/ + */ +export enum SlotState { + IDLE = 1, + + /** Only used by Shell Game and Hell Game. */ + IDLE_REWARD = 2, + + BOMBED = 3, + PAYOUT = 4, + + /** Only used by Shell Game and Hell Game. */ + REWARD = 5, +} diff --git a/packages/isaac-typescript-definitions-repentogon/src/index.ts b/packages/isaac-typescript-definitions-repentogon/src/index.ts index 6acbfe1bb..d0953eb37 100644 --- a/packages/isaac-typescript-definitions-repentogon/src/index.ts +++ b/packages/isaac-typescript-definitions-repentogon/src/index.ts @@ -1,4 +1,5 @@ export * from "./enums/Achievement"; +export * from "./enums/AltRockType"; export * from "./enums/AutocompleteType"; export * from "./enums/BagOfCraftingPickup"; export * from "./enums/BlendFactor"; @@ -6,6 +7,7 @@ export * from "./enums/BlendType"; export * from "./enums/BombCostumeLayer"; export * from "./enums/CambionPregnancyLevel"; export * from "./enums/CharacterMenuType"; +export * from "./enums/CoinJamAnimation"; export * from "./enums/CompletionMarkDifficulty"; export * from "./enums/CompletionMarkType"; export * from "./enums/DailyChallengeMenuState"; @@ -45,6 +47,7 @@ export * from "./enums/PocketItemType"; export * from "./enums/ProceduralEffectActionType"; export * from "./enums/ProceduralEffectConditionType"; export * from "./enums/PurityState"; +export * from "./enums/SlotState"; export * from "./enums/SpecialQuest"; export * from "./enums/StbRailVariant"; export * from "./enums/TaintedMarksGroup"; diff --git a/packages/isaac-typescript-definitions-repentogon/src/types/classes/FXParams.d.ts b/packages/isaac-typescript-definitions-repentogon/src/types/classes/FXParams.d.ts index 5abeddc5b..d63d706ef 100644 --- a/packages/isaac-typescript-definitions-repentogon/src/types/classes/FXParams.d.ts +++ b/packages/isaac-typescript-definitions-repentogon/src/types/classes/FXParams.d.ts @@ -13,7 +13,7 @@ declare interface FXParams extends IsaacAPIClass { ColorModifier: ColorModifier; /** The base color. */ - KColor: KColor; + LightColor: KColor; /** Opacity of the room's shadow overlay. */ ShadowAlpha: number; @@ -24,8 +24,12 @@ declare interface FXParams extends IsaacAPIClass { /** Enables the reflective water shader. */ UseWaterV2: boolean; + /** The water's color. */ + WaterColor: KColor; + /** A multiplier applied to the water color. */ WaterColorMultiplier: KColor; + /** The water effects' color. */ WaterEffectColor: Color; } diff --git a/packages/isaac-typescript-definitions-repentogon/src/types/classes/Game.d.ts b/packages/isaac-typescript-definitions-repentogon/src/types/classes/Game.d.ts index 64d72c6e5..064ad1ad1 100644 --- a/packages/isaac-typescript-definitions-repentogon/src/types/classes/Game.d.ts +++ b/packages/isaac-typescript-definitions-repentogon/src/types/classes/Game.d.ts @@ -8,26 +8,77 @@ import type { DebugFlag } from "../../enums/flags/DebugFlag"; declare global { interface Game extends IsaacAPIClass { + /** + * Returns whether achievements cannot be unlocked in this run. + * + * Achievements can be blocked for a variety of reasons, such as: + * - The player playing on a challenge. + * - The player is doing a victory lap. + * - The player is playing on a seeded run. + */ AchievementUnlocksDisallowed: () => boolean; - AddDebugFlags: (flags: BitFlags) => void; + + /** Enables one or more debug flags. */ + AddDebugFlags: (flags: BitFlag | BitFlags) => void; + + /** Increases the unique amount of shops visited in this run. */ AddShopVisits: (count: int) => void; - /** Removes all enemies that were erased by the Eraser item. */ + /** + * Clears the list of enemies that were erased by the Eraser item, allowing them to appear + * again. + */ ClearErasedEnemies: () => void; + /** Devolves the provided enemy as if the D10 was used on them. */ DevolveEnemy: (enemy: Entity) => void; + + /** Returns the `ChallengeParams` object for the current run. */ GetChallengeParams: () => ChallengeParams; + + /** + * Returns a copy of the current color correction. This represents the vaw color values being + * used globally, which may be influenced by items such as Astral Projection. + * + * The returned `ColorModifier` do not necessarily reflect the specific color correction being + * applied in the current room. To get the current room's color correction, use + * `FXParams.ColorModifier`. + */ GetCurrentColorModifier: () => ColorModifier; + + /** Returns a bitmask of the currently enabled debug flags. */ GetDebugFlags: () => BitFlags; - GetDizzyAmount: () => int; + + /** Returns the current level of dizziness applied to the screen. */ + GetDizzyAmount: () => number; + + /** Returns the currently active `GenericPrompt` object. */ GetGenericPrompt: () => GenericPrompt; + + /** + * Returns the transitioning color modifier. This is formatted as the absolute rate of change, + * with all values are positive. + */ GetLerpColorModifier: () => ColorModifier; + + /** Returns the current state of the pause menu. */ GetPauseMenuState: () => PauseMenuState; + + /** Returns the number of unique planetariums visited during the current run. */ GetPlanetariumsVisited: () => int; - GetShopVisits: () => void; + + /** Returns the number of unique shops visited during the current run. */ + GetShopVisits: () => int; + + /** + * Returns the target color modifier if the game is currently transitioning between two color + * modifiers. Otherwise, returns the current color modifier. + */ GetTargetColorModifier: () => ColorModifier; /** + * Returns whether the entity has been erased by the Eraser item. + * * @param entity * @param entityType * @param variant Optional. Default is -1. @@ -37,38 +88,68 @@ declare global { | ((entity: Entity) => boolean) | ((entityType: EntityType, variant?: int, subType?: int) => boolean); + /** Returns whether the current wave is a boss wave in Greed Mode. */ IsGreedBoss: () => boolean; + + /** Returns whether the current wave is the optional "nightmare" wave in Greed Mode. */ IsGreedFinalBoss: () => boolean; + + /** Returns whether the current game mode is Hard Mode or Greedier. */ IsHardMode: () => boolean; + + /** Returns whether the pause menu is currently opened. */ IsPauseMenuOpen: () => boolean; + + /** Returns whether the run is a "re-run", meaning the player manually set the seed. */ IsRerun: () => boolean; + /** + * Records the provided completion type for all players in the current run, unlocking the + * relevant achievements and giving them the relevant completion mark. + */ RecordPlayerCompletion: (completionType: CompletionMarkType) => void; + /** Sets the bloom amount for a certain duration. */ + SetBloom: (duration: number, amount: number) => void; + /** + * Sets the game's current color modifier. + * * @param colorModifier - * @param lerp Optional. Default is true. - * @param rate Optional. Default is 0.015. + * @param lerp Optional. If true, the game will smoothly transition to the new color modifier. + * Default is true. + * @param rate Optional. The rate at which the colors transition. Default is 0.015. */ SetColorModifier: ( colorModifier: ColorModifier, lerp?: boolean, rate?: number, ) => void; - SetBloom: (time: number, strength: number) => void; + + /** + * Sets current dizziness amount, the effect normally used by Wavy Cap. + * + * @param targetIntensity + * @param currentIntensity Optional. If defined, the current intensity is set to this value + * before transitioning to the target intensity. Default is undefined. + */ SetDizzyAmount: ( targetIntensity: number, currentIntensity?: number, ) => void; + SetDonationModAngel: (amount: int) => void; SetDonationModGreed: (amount: int) => void; + ShowGenericLeaderboard: () => void; /** + * Spawns a bomb crater. The spawned bomb crater is returned. + * * @param position * @param radius Optional. Default is 1. */ - SpawnBombCrater: (position: Vector, radius?: number) => void; + SpawnBombCrater: (position: Vector, radius?: number) => Entity; /** * Repentogon's modified `Game.StartStageTransition` method. diff --git a/packages/isaac-typescript-definitions-repentogon/src/types/classes/GenericPrompt.d.ts b/packages/isaac-typescript-definitions-repentogon/src/types/classes/GenericPrompt.d.ts index 91aaa60cd..76d682e71 100644 --- a/packages/isaac-typescript-definitions-repentogon/src/types/classes/GenericPrompt.d.ts +++ b/packages/isaac-typescript-definitions-repentogon/src/types/classes/GenericPrompt.d.ts @@ -4,42 +4,6 @@ import type { GenericPromptSubmittedSelection } from "../../enums/GenericPromptS /** * Constructs a new `GenericPrompt` class. * - * **Example** - * - * ```ts - * const mod = RegisterMod("Foo", 1); - * - * const prompt = GenericPrompt(); - * prompt.Initialize(); - * prompt.SetText("Some test text"); - * - * let wasPromptDisplayed = false; - * - * function postRender() { - * prompt.Render(); - * } - * - * mod.AddCallback(ModCallback.POST_RENDER, postRender); - * - * function postUpdate() { - * prompt.Update(true); // Process user inputs - * - * if (wasPromptDisplayed && !prompt.IsActive()) { - * // Prompt was closed by user. - * const submittedSelection = prompt.GetSubmittedSelection(); - * print(`User selected option: ${submittedSelection}`); - * wasPromptDisplayed = false; - * } - * - * if (Input.IsButtonTriggered(Keyboard.MINUS, 0)) { - * prompt.Show(); - * wasPromptDisplayed = true; - * } - * } - * - * mod.AddCallback(ModCallback.POST_UPDATE, postUpdate); - * ``` - * * This class is for REPENTOGON, an exe-hack which expands the modding API. * * @see https://repentogon.com/ @@ -53,33 +17,60 @@ declare global { * @see https://repentogon.com/ */ interface GenericPrompt { + /** Returns the selection the player is hovering over. */ GetCurrentSelection: () => GenericPromptSelection; + + /** Returns the sprite used by the prompt. */ GetSprite: () => Sprite; + + /** Returns the selection the player has submitted. */ GetSubmittedSelection: () => GenericPromptSubmittedSelection; - /** @param smallPrompt Optional. Default is false. */ + /** + * Initializes the generic prompt. This method should be called immediately after constructing + * the object. + * + * @param smallPrompt Optional. Default is false. + */ Initialize: (smallPrompt?: boolean) => void; + /** Returns whether the prompt is currently active. */ IsActive: () => boolean; + + /** + * Renders the prompt on the screen. This method should be called in `ModCallback.POST_RENDER`. + */ Render: () => void; + + /** Sets the prompt's image to the victory run image. */ SetImageToVictoryRun: () => void; /** + * Sets the paper's text. + * + * @param header1 Optional. Default is an empty string. + * @param header2 Optional. Default is an empty string. * @param line1 Optional. Default is an empty string. * @param line2 Optional. Default is an empty string. * @param line3 Optional. Default is an empty string. - * @param line4 Optional. Default is an empty string. - * @param line5 Optional. Default is an empty string. */ SetText: ( + header1?: string, + header?: string, line1?: string, line2?: string, line3?: string, - line4?: string, - line5?: string, ) => void; + /** Displays the prompt on-screen. */ Show: () => void; + + /** + * Updates the animation of the prompt paper and its functionality. This method should be called + * in `ModCallback.POST_UPDATE`. + * + * @param processInput If true, the game will process the player's input for selecting yes/no. + */ Update: (processInput: boolean) => void; } } diff --git a/packages/isaac-typescript-definitions-repentogon/src/types/classes/ImGui.d.ts b/packages/isaac-typescript-definitions-repentogon/src/types/classes/ImGui.d.ts index 90860100f..4b665b121 100644 --- a/packages/isaac-typescript-definitions-repentogon/src/types/classes/ImGui.d.ts +++ b/packages/isaac-typescript-definitions-repentogon/src/types/classes/ImGui.d.ts @@ -42,7 +42,7 @@ declare global { function AddCallback( elementID: string, callbackType: ImGuiCallback, - callbackFunction: () => void, + callbackFunction: (clickCount: int) => void, ): void; /** diff --git a/packages/isaac-typescript-definitions-repentogon/src/types/classes/Isaac.d.ts b/packages/isaac-typescript-definitions-repentogon/src/types/classes/Isaac.d.ts index 7e4690555..db2ea05b8 100644 --- a/packages/isaac-typescript-definitions-repentogon/src/types/classes/Isaac.d.ts +++ b/packages/isaac-typescript-definitions-repentogon/src/types/classes/Isaac.d.ts @@ -71,19 +71,20 @@ declare global { /** * Spawns a timer effect. * - * The timer is called every game update, meaning only frames in which the game is actively - * running and not paused are taken into consideration. - * - * If your use case requires a timer that takes paused time into account, stick with a custom - * timer running on a render callback. - * - * @param callback Ran after `interval` amount of frames has passed. - * @param interval The interval in frames for `callback` to be ran. + * The timer function is called every game update, meaning only frames in which the game is + * actively running and not paused are taken into consideration. If your use case requires a + * timer that takes paused time into account, stick with a custom timer running on a render + * callback. + * + * @param timerFunction + * @param delay The delay in frames between each time `timerFunction` is ran. + * @param times How many times `timerFunction` is ran. * @param persistent Whether the timer persists across rooms. */ function CreateTimer( - callback: () => void, - interval: int, + timerFunction: () => void, + delay: int, + times: int, persistent: boolean, ): EntityEffect; @@ -135,9 +136,20 @@ declare global { */ function FindInCapsule( capsule: Capsule, - partitions: BitFlags, + partitions: EntityPartition | BitFlags, ): Entity[]; + /** + * @param position + * @param targetPosition + * @param pitIndex Optional. Default is -1. + */ + function FindTargetPit( + position: Vector, + targetPosition: Vector, + pitIndex?: int, + ): int; + /** * This method is meant to be used when creating local enums that represent custom achievements. * (We have to retrieve the ID of the achievement at run-time, because it is dynamically @@ -174,6 +186,7 @@ declare global { */ function GetClipboard(): string | undefined; + /** Returns the corrected position a collectible would spawn at. */ function GetCollectibleSpawnPosition(position: Vector): Vector; /** Returns a completion mark value for the specified character. */ @@ -208,6 +221,7 @@ declare global { */ function GetCutsceneIdByName(name: string): Cutscene; + /** Returns the window's current Dwm attribute. */ function GetDwmWindowAttribute(): DwmWindowAttribute; /** @@ -245,7 +259,7 @@ declare global { * Returns an array of all of the loaded script files. The key for each element is the file's * path and the value is what the file returns. */ - function GetLoadedModules(): Array>; + function GetLoadedModules(): Array>; /** * Returns the translation string associated with the specified key in the specified category. @@ -278,6 +292,9 @@ declare global { */ function GetNullItemIdByName(name: string): NullItemID; + /** + * Returns the game's `PersistentGameData` object, which is used to manage persistent game data. + */ function GetPersistentGameData(): PersistentGameData; /** @@ -293,9 +310,11 @@ declare global { * * Returns -1 if no item pool with the specified name was found. */ - function GetPoolByName(itemPool: string): ItemPoolType | -1; + function GetPoolIdByName(itemPool: string): ItemPoolType | -1; /** + * Returns the render position from the provided position in world coordinates. + * * @param position * @param scale Optional. Default is true. */ @@ -307,6 +326,7 @@ declare global { */ function GetString(category: string, key: LanguageAbbreviation): string; + /** Returns the appended text on the game's window title. */ function GetWindowTitle(): string; /** Returns whether the specified challenge is complete. */ @@ -325,7 +345,8 @@ declare global { * Plays the specified cutscene. * * @param cutscene - * @param clearGameState Optional. Default is false. + * @param clearGameState Optional. If true, the run will end and the player is taken back to the + * main menu once the cutscene is finished. Default is false. */ function PlayCutscene(cutscene: Cutscene, clearGameState?: boolean): void; @@ -369,8 +390,17 @@ declare global { */ function SetCurrentFlorName(name: string): void; + /** Sets the game's Dwm window attribute. */ function SetDwmWindowAttribute(attribute: DwmWindowAttribute): void; + /** + * Sets the game's taskbar icon. + * + * @param windowIcon You can choose to either pass `WindowIcon` to use one of the two vanilla + * game icons or pass a path to an .ico file to use as the game's taskbar + * icon. + * @param bypassResolutionLimit Optional. If true, the 16x16 resolution cap is bypassed. + */ function SetIcon( windowIcon: WindowIcon | string, bypassResolutionLimit: boolean, @@ -383,6 +413,11 @@ declare global { * Displays a Win32 message box. Returns a `DialogReturn` value which indicates the button * pressed. * + * It's a good idea to not heavily rely on this function as: + * - Players using a gamepad are unable to navigate the popup. They will have to use a mouse, + * keyboard, or touchscreen. + * - The window title will not show up in some environments such as the Steam Deck. + * * @param title * @param text * @param dialogIcon Optional. Default is `DialogIcon.ERROR`. diff --git a/packages/isaac-typescript-definitions-repentogon/src/types/classes/ItemOverlay.d.ts b/packages/isaac-typescript-definitions-repentogon/src/types/classes/ItemOverlay.d.ts index f151d822b..dea43eb6a 100644 --- a/packages/isaac-typescript-definitions-repentogon/src/types/classes/ItemOverlay.d.ts +++ b/packages/isaac-typescript-definitions-repentogon/src/types/classes/ItemOverlay.d.ts @@ -14,6 +14,7 @@ declare namespace ItemOverlay { */ function GetDelay(): int; + /** Returns the sprite used to play the the Mega Mush transformation animation. */ function GetMegaMushPlayerSprite(): Sprite; /** Returns the `GiantbookType` of the last played giantbook animation. */ diff --git a/packages/isaac-typescript-definitions-repentogon/src/types/classes/entity-config/EntityConfigEntity.d.ts b/packages/isaac-typescript-definitions-repentogon/src/types/classes/entity-config/EntityConfigEntity.d.ts index 41353456b..bfdcee4d5 100644 --- a/packages/isaac-typescript-definitions-repentogon/src/types/classes/entity-config/EntityConfigEntity.d.ts +++ b/packages/isaac-typescript-definitions-repentogon/src/types/classes/entity-config/EntityConfigEntity.d.ts @@ -28,7 +28,7 @@ declare global { */ CanShutDoors: () => boolean; - /** Returns a path to the entity's .anm2 file, , as defined in `entities2.xml`. */ + /** Returns a path to the entity's .anm2 file, as defined in `entities2.xml`. */ GetAnm2Path: () => string; /** Returns the entity's base HP, as defined in `entities2.xml`. */ @@ -68,13 +68,13 @@ declare global { GetCollisionInterval: () => int; /** Returns the entity's collision radius, as defined in `entities2.xml`. */ - GetCollisionRadius: () => int; + GetCollisionRadius: () => number; /** * Returns a read-only `Vector` of the entity's collision radius multiplier, as defined in * `entities2.xml`. */ - readonly GetCollisionRadiusMultiplier: () => Vector; + GetCollisionRadiusMultiplier: () => Readonly; /** * Returns an array containing all of the tags defined in the entity's `customtags` attribute in @@ -131,7 +131,13 @@ declare global { HasCustomTag: (tag: string) => boolean; /** Returns true if the entity has all of the entity tags in the provided bitset. */ - HasEntityTags: (tags: BitFlags) => boolean; + HasEntityTags: (tags: BitFlags | EntityTag) => boolean; + + /** Returns whether the entity has floor alts. */ + HasFloorAlts: () => boolean; + + /** Returns whether the entity has all of the gib flags in the provided bitset. */ + HasGibFlags: (flags: GibFlag | BitFlags) => boolean; /** Returns true if the entity is a boss, as defined in `entities2.xml`. */ IsBoss: () => boolean; diff --git a/packages/isaac-typescript-definitions-repentogon/src/types/classes/entity-config/EntityConfigPlayer.d.ts b/packages/isaac-typescript-definitions-repentogon/src/types/classes/entity-config/EntityConfigPlayer.d.ts index 33d29bfbf..2935536be 100644 --- a/packages/isaac-typescript-definitions-repentogon/src/types/classes/entity-config/EntityConfigPlayer.d.ts +++ b/packages/isaac-typescript-definitions-repentogon/src/types/classes/entity-config/EntityConfigPlayer.d.ts @@ -47,7 +47,7 @@ declare global { GetCoins: () => int; /** Returns an array of collectibles the player starts with. */ - GetCollectibles: () => CollectibleType; + GetCollectibles: () => CollectibleType[]; /** * Returns the player's starting costume ID, as defined in `players.xml`. If the player has no diff --git a/packages/isaac-typescript-definitions-repentogon/src/types/classes/entity/EntityPickup.d.ts b/packages/isaac-typescript-definitions-repentogon/src/types/classes/entity/EntityPickup.d.ts index d5b497022..5ee8b59c5 100644 --- a/packages/isaac-typescript-definitions-repentogon/src/types/classes/entity/EntityPickup.d.ts +++ b/packages/isaac-typescript-definitions-repentogon/src/types/classes/entity/EntityPickup.d.ts @@ -5,13 +5,14 @@ import type { declare global { interface EntityPickup extends Entity { - /** Adds a collectible to the cycle, if the pickup is a pedestal. */ + /** Adds a collectible to the cycle if the pickup is a collectible pedestal. */ AddCollectibleCycle: (collectible: CollectibleType) => boolean; /** Returns whether the pickup can be rerolled. */ CanReroll: () => boolean; - GetAlternatePedestal: () => int; + /** Returns the pickup's `CollectiblePedestalType`. */ + GetAlternatePedestal: () => CollectiblePedestalType; /** * Returns an array of all of the collectibles being used in the pickup's collectible cycle, if @@ -19,16 +20,26 @@ declare global { */ GetCollectibleCycle: () => CollectibleType[]; + /** Returns the pickup's drop delay. */ GetDropDelay: () => int; - /** @param shouldAdvance Optional. Default is false. */ - GetLootList: (shouldAdvance?: boolean) => LootList; + /** + * Returns a read-only version of the pickup's `LootList`. + * + * @param shouldAdvance Optional. Default is false. + */ + GetLootList: (shouldAdvance?: boolean) => Readonly; + /** + * Returns the ghost effect that is visible if a player has Guppy's Eye. Returns undefined if + * the ghost isn't visible. + */ GetPickupGhost: () => EntityEffect | undefined; /** Returns sprite used by the pickup's price label. */ GetPriceSprite: () => Sprite; + /** Returns the pickup's `VarData`. */ GetVarData: () => int; /** @@ -40,12 +51,16 @@ declare global { */ IsBlind: () => boolean; + /** Turns the pickup into a shop item, automatically assigning its price. */ MakeShopItem: (shopItemID: int) => void; + + /** Stops the collectible cycle if the pickup is a collectible pedestal. */ RemoveCollectibleCycle: () => void; /** Sets the graphics of the item pedestal. Does nothing if the pickup is not a collectible. */ SetAlternatePedestal: (pedestalType: CollectiblePedestalType) => void; + /** Sets the pickup's drop delay. */ SetDropDelay: (delay: int) => void; /** @@ -54,6 +69,7 @@ declare global { */ SetForceBlind: (blind: boolean) => void; + /** Sets the pickup's Options index and returns the new pickup index. */ SetNewOptionsIndex: () => int; /** @@ -70,6 +86,10 @@ declare global { */ TryFlip: () => boolean; + /** + * Causes the pedestal to start cycling through the provided amount of collectibles, including + * its own collectible type. + */ TryInitOptionCycle: (numCycle: int) => boolean; /** @@ -80,6 +100,7 @@ declare global { */ TryRemoveCollectible: () => boolean; + /** Updates the ghost entity effect in accordance to the pickup's `LootList`. */ UpdatePickupGhosts: () => void; } diff --git a/packages/isaac-typescript-definitions-repentogon/src/types/classes/entity/EntityProjectile.d.ts b/packages/isaac-typescript-definitions-repentogon/src/types/classes/entity/EntityProjectile.d.ts index 273667651..9a68bfccc 100644 --- a/packages/isaac-typescript-definitions-repentogon/src/types/classes/entity/EntityProjectile.d.ts +++ b/packages/isaac-typescript-definitions-repentogon/src/types/classes/entity/EntityProjectile.d.ts @@ -1,3 +1,4 @@ declare interface EntityProjectile extends Entity { + /** Deflects the projectile to the provided direction. */ Deflect: (newVelocity: Vector) => void; } diff --git a/packages/isaac-typescript-definitions-repentogon/src/types/classes/entity/EntitySlot.d.ts b/packages/isaac-typescript-definitions-repentogon/src/types/classes/entity/EntitySlot.d.ts index b328bcc15..39142213f 100644 --- a/packages/isaac-typescript-definitions-repentogon/src/types/classes/entity/EntitySlot.d.ts +++ b/packages/isaac-typescript-definitions-repentogon/src/types/classes/entity/EntitySlot.d.ts @@ -1,4 +1,6 @@ import type { CollectibleType } from "isaac-typescript-definitions"; +import type { CoinJamAnimation } from "../../../enums/CoinJamAnimation"; +import type { SlotState } from "../../../enums/SlotState"; /** * This class is for REPENTOGON, an exe-hack which expands the modding API. @@ -10,29 +12,83 @@ declare global { /** Forces the slot to drop what it typically would drop if blown up. */ CreateDropsFromExplosion: () => void; + /** + * Returns the slot's donation value. The donation value varies on the slot's variant: + * + * - Beggar: How many coins have been donated. + * - Demon Beggar: How many hearts have been donated. + * - Battery Bum and Rotten Beggar: Increases with each payment by random amounts, up to 3. It + * is reset back to 0 upon giving a reward. + * - For every other variant, it is 0. + * + * The donation value can be overridden by using `EntitySlot.SetDonationValue`. + */ GetDonationValue: () => int; + + /** + * Returns the collectible that the slot will pay out with. This is only used by Crane Game and + * Hell Game. + */ + GetPrizeCollectible: () => CollectibleType; + + /** Returns the slot's prize type. */ GetPrizeType: () => int; + + /** + * Returns the index used by Shell Game and Hell Game used to determine which animation to play. + */ GetShellGameAnimationIndex: () => int; - GetState: () => int; + + /** Returns the slot's state. */ + GetState: () => SlotState; + + /** Returns the timeout in frames until the slot determines its prize. */ GetTimeout: () => int; - GetTriggerTimerNum: () => int; - /** Returns how many frames a player has been touching the slot. */ + /** + * Returns how many frames a player has been touching the slot. This is reset once no player is + * touching it. + */ GetTouch: () => int; - RandomCoinJamAnim: () => string; + /** + * Returns the slot's trigger timer number. This is only used by Bomb Bums and Reroll Machines. + */ + GetTriggerTimerNum: () => int; + + /** Returns a random coin jam animation name. */ + RandomCoinJamAnim: () => CoinJamAnimation; + + /** Sets the slot's donation value. */ SetDonationValue: (value: int) => void; - /** Sets the prize collectible. Only used by Crane Game, Shell Game and Hell Game. */ + /** + * Sets the collectible that the slot will pay out with. This is only used by Crane Game and + * Hell Game. + */ SetPrizeCollectible: (collectible: CollectibleType) => void; + /** Sets the slot's prize type. */ SetPrizeType: (prizeType: int) => void; + + /** + * Sets the index used by Shell Game and Hell game to determine which prize animation to play. + */ SetShellGameAnimationIndex: (index: int) => void; - SetState: (state: int) => void; + + /** Sets the slot's state. */ + SetState: (state: SlotState) => void; + + /** Sets the slot's timeout. */ SetTimeout: (timeout: int) => void; - SetTriggerTimerNum: (timerNum: int) => void; - /** Sets how many frames a player has been touching the slot. */ + /** + * Sets how many frames a player has been touching the slot. This is reset to 0 once no players + * are touching the slot. + */ SetTouch: (duration: int) => void; + + /** Sets the slot's trigger timer number. */ + SetTriggerTimerNum: (timerNum: int) => void; } } diff --git a/packages/isaac-typescript-definitions-repentogon/src/types/classes/entity/EntityTear.d.ts b/packages/isaac-typescript-definitions-repentogon/src/types/classes/entity/EntityTear.d.ts index 8f44f4c24..6efd793d3 100644 --- a/packages/isaac-typescript-definitions-repentogon/src/types/classes/entity/EntityTear.d.ts +++ b/packages/isaac-typescript-definitions-repentogon/src/types/classes/entity/EntityTear.d.ts @@ -5,7 +5,7 @@ */ declare interface EntityTear extends Entity { /** - * Returns the intensity value of the tear as a result of the Dead Eye Collectible. The intensity + * Returns the intensity value of the tear as a result of the Dead Eye collectible. The intensity * is between 0 and 1. */ GetDeadEyeIntensity: () => float; @@ -16,8 +16,16 @@ declare interface EntityTear extends Entity { */ MakeMultidimensionalCopy: () => EntityTear; + /** Returns the red aura sprite used by Dead Eye. */ GetDeadEyeSprite: () => Sprite; + + /** + * Returns the effect sprite used by numerous tear variants such as Fire Mind and Mysterious + * Liquid. + */ GetTearEffectSprite: () => Sprite; + + /** Returns the aura sprite used by Godhead tears. */ GetTearHaloSprite: () => Sprite; /** Returns whether the tear was created through the Multidimensional Baby effect. */ @@ -32,11 +40,14 @@ declare interface EntityTear extends Entity { * Behaves the same as `EntityTear.ResetSpriteScale` except you can now choose to have it * re-evaluate which scale animation to play. * - * @param force Optional. Default is false. + * This method has been renamed to include "Ex" so it can not conflict with the vanilla type + * definitions. However, when the project compiles the method's name will change to what it's + * supposed to be. * + * @param force Optional. Default is false. * @customName ResetSpriteScale */ - ResetSpriteScaleEx: (force: boolean) => void; + ResetSpriteScaleEx: (force?: boolean) => void; /** Sets whether the tear was created through the Multidimensional Baby effect. */ SetMultidimensionalTouched: (touched: boolean) => void; diff --git a/packages/isaac-typescript-definitions-repentogon/src/types/classes/grid-entity/GridEntity.d.ts b/packages/isaac-typescript-definitions-repentogon/src/types/classes/grid-entity/GridEntity.d.ts index 6559973c1..e4dcf183e 100644 --- a/packages/isaac-typescript-definitions-repentogon/src/types/classes/grid-entity/GridEntity.d.ts +++ b/packages/isaac-typescript-definitions-repentogon/src/types/classes/grid-entity/GridEntity.d.ts @@ -1,69 +1,22 @@ -import type { - BackdropType, - DamageFlag, - GridEntityType, -} from "isaac-typescript-definitions"; +import type { DamageFlag } from "isaac-typescript-definitions"; declare global { interface GridEntity extends IsaacAPIClass { - GetAltRockType: (backdropType: BackdropType) => int; - - /** Returns the rock's render position. */ + /** Returns the grid's render position. */ GetRenderPosition: () => Vector; - /** - * @param entity - * @param damage - * @param damageFlags - * @param unknown1 The behavior of this parameter is currently unknown and is undocumented. - * @param unknown2 The behavior of this parameter is currently unknown and is undocumented. - */ + /** Forces the grid entity to hurt the provided entity. */ HurtDamage: ( entity: Entity, damage: int, - damageFlags: BitFlags, - unknown1: float, - unknown2: boolean, + damageFlags: DamageFlag | BitFlags, + unknownNumber: number, + unknownBool: boolean, ) => void; - /** - * @param int - * @param damageFlags - * @param unknown1 The behavior of this parameter is currently unknown and is undocumented. - * @param unknown2 The behavior of this parameter is currently unknown and is undocumented. - */ - HurtSurroundings: ( - int: DamageFlag, - damageFlags: BitFlags, - unknown1: float, - unknown2: boolean, - ) => void; + // `HurtSurroundings` currently crashes the game when called. /** Returns whether the grid entity is a breakable rock. */ IsBreakableRock: () => boolean; - - /** - * Makes the grid entity play the sound it plays when it breaks. - * - * @param gridEntityType The type of grid break sound to play. For example, - * `GridEntityType.ROCK` would play the sound of a rock being broken. - * @param backdrop The backdrop variant of the specified `gridEntityType`. - */ - PlayBreakSound: ( - gridEntityType: GridEntityType, - backdrop: BackdropType, - ) => void; - - RegisterRockDestroyed: (gridEntityType: GridEntityType) => void; - - RenderTop: (offset: Vector) => void; - - // All of the `ToX` methods are not implemented as their associated classes don't have any - // methods yet. - - TrySpawnLadder: () => void; - TrySpawnWorms: () => void; - UpdateCollision: () => void; - UpdateNeighbors: () => void; } } diff --git a/packages/isaac-typescript-definitions-repentogon/src/types/classes/grid-entity/GridEntityDoor.d.ts b/packages/isaac-typescript-definitions-repentogon/src/types/classes/grid-entity/GridEntityDoor.d.ts index 1b5c6136b..7d176c287 100644 --- a/packages/isaac-typescript-definitions-repentogon/src/types/classes/grid-entity/GridEntityDoor.d.ts +++ b/packages/isaac-typescript-definitions-repentogon/src/types/classes/grid-entity/GridEntityDoor.d.ts @@ -2,8 +2,12 @@ import type { DoorState, DoorVariant } from "isaac-typescript-definitions"; declare global { interface GridEntityDoor extends GridEntity { + /** Returns the door's extra sprite. */ GetExtraSprite: () => Sprite; + /** Plays the door's animation. */ + PlayAnimation: () => void; + PreviousState: DoorState; PreviousVariant: DoorVariant; } diff --git a/packages/isaac-typescript-definitions-repentogon/src/types/classes/grid-entity/GridEntityRock.d.ts b/packages/isaac-typescript-definitions-repentogon/src/types/classes/grid-entity/GridEntityRock.d.ts new file mode 100644 index 000000000..41514cbf4 --- /dev/null +++ b/packages/isaac-typescript-definitions-repentogon/src/types/classes/grid-entity/GridEntityRock.d.ts @@ -0,0 +1,57 @@ +import type { + BackdropType, + GridEntityType, +} from "isaac-typescript-definitions"; + +declare global { + interface GridEntityRock extends GridEntity { + /** + * Returns the alternative rock type (i.e. urn, mushroom, etc.) that th rock is. + * + * @param backdrop Optional. The alternative rock type that is returned depends on the backdrop. + * For example, if the backdrop is `BackdropType.CAVES`, the alternative rock + * type is a mushroom. Default is `BackdropType.NULL` (The current backdrop). + */ + GetAltRockType: (backdropType?: BackdropType) => int; + + /** + * Plays the grid break sound. + * + * @param gridEntityType The grid entity type that the sound corresponds to. + * @param backdrop Optional. Some grid entities have unique break sounds based on the room's + * current backdrop. Default is `BackdropType.NULL` (The current backdrop). + */ + PlayBreakSound: ( + gridEntityType: GridEntityType, + backdrop?: BackdropType, + ) => void; + + /** Forces the game to treat the rock as if it's been destroyed. */ + RegisterRockDestroyed: (gridEntityType: GridEntityType) => void; + + RenderTop: (offset: Vector) => void; + + /** + * @param gridEntityType + * @param gridVariant + * @param seed + * @param unknown + * @param backdrop Optional. Default is `BackdropType.NULL` (The current backdrop). + */ + SpawnDrops: ( + gridEntityType: GridEntityType, + gridVariant: int, + seed: Seed, + unknown: boolean, + backdrop: BackdropType, + ) => void; + + TrySpawnLadder: () => void; + TrySpawnWorms: () => void; + + /** Updates the rock's collision. */ + UpdateCollision: () => void; + + UpdateNeighbors: () => void; + } +} diff --git a/packages/isaac-typescript-definitions-repentogon/src/types/classes/hud/HUD.d.ts b/packages/isaac-typescript-definitions-repentogon/src/types/classes/hud/HUD.d.ts index 50bfebde0..778420055 100644 --- a/packages/isaac-typescript-definitions-repentogon/src/types/classes/hud/HUD.d.ts +++ b/packages/isaac-typescript-definitions-repentogon/src/types/classes/hud/HUD.d.ts @@ -23,25 +23,29 @@ declare interface HUD extends IsaacAPIClass { /** Returns the sprite used to render the fortune popup window. */ GetFortuneSprite: () => Sprite; + /** Returns the sprite used to render health. */ GetHeartsSprite: () => Sprite; /** Returns the sprite used to render Tainted Isaac's inventory. */ GetInventorySprite: () => Sprite; + /** Returns the sprite used to render the pickups HUD. */ GetPickupsHUDSprite: () => Sprite; /** + * Returns the `PlayerHUD` from the provided index. + * * @param index Optional. The index must be between 0 - 7, otherwise an error is thrown. Default * is 0. */ - GetPlayerHUD: (index: int) => PlayerHUD; + GetPlayerHUD: (index?: int) => PlayerHUD; /** Returns the sprite used to render Tainted Blue Baby's poop spells. */ GetPoopSpellSprite: () => Sprite; /** - * Returns the sprite used to render streak popups (Picking up items, displaying floor names, - * etc.). + * Returns the sprite used to render streak popups (e.g. Picking up items, displaying floor + * names). */ GetStreakSprite: () => Sprite; diff --git a/packages/isaac-typescript-definitions-repentogon/src/types/classes/hud/PlayerHUDHeart.d.ts b/packages/isaac-typescript-definitions-repentogon/src/types/classes/hud/PlayerHUDHeart.d.ts index dabbf5bce..a046f4bec 100644 --- a/packages/isaac-typescript-definitions-repentogon/src/types/classes/hud/PlayerHUDHeart.d.ts +++ b/packages/isaac-typescript-definitions-repentogon/src/types/classes/hud/PlayerHUDHeart.d.ts @@ -7,6 +7,7 @@ declare global { * @see https://repentogon.com/ */ interface PlayerHUDHeart extends IsaacAPIClass { + /** Returns the heart's flash type. */ GetFlashType: () => HeartFlashType; /** Returns the name of the animation currently playing on the heart. */ @@ -15,7 +16,10 @@ declare global { /** Returns the name of the overlay animation currently playing on the heart. */ GetHeartOverlayAnim: () => string; + /** Returns whether the Eternal Heart overlay is visible. */ IsEternalHeartOverlayVisible: () => boolean; + + /** Returns whether the heart is fading. */ IsFadingHeart: () => boolean; /** Returns whether the golden heart overlay is visible on the heart. */ diff --git a/packages/isaac-typescript-definitions-repentogon/src/types/classes/item-config/ItemConfig.d.ts b/packages/isaac-typescript-definitions-repentogon/src/types/classes/item-config/ItemConfig.d.ts index 9a5c7ca83..4ab6548b1 100644 --- a/packages/isaac-typescript-definitions-repentogon/src/types/classes/item-config/ItemConfig.d.ts +++ b/packages/isaac-typescript-definitions-repentogon/src/types/classes/item-config/ItemConfig.d.ts @@ -10,8 +10,11 @@ declare global { CanRerollCollectible: (collectible: CollectibleType) => boolean; /** Returns an array of `ItemConfigItem` that match the specified tags. */ - GetTaggedItems: (tags: BitFlags) => ItemConfigItem[]; + GetTaggedItems: ( + tags: ItemConfigTag | BitFlags, + ) => ItemConfigItem[]; + /** Returns whether the trinket is valid. */ IsValidTrinket: (trinketType: TrinketType) => boolean; } } diff --git a/packages/isaac-typescript-definitions-repentogon/src/types/classes/item-config/ItemConfigCard.d.ts b/packages/isaac-typescript-definitions-repentogon/src/types/classes/item-config/ItemConfigCard.d.ts new file mode 100644 index 000000000..3e7cce670 --- /dev/null +++ b/packages/isaac-typescript-definitions-repentogon/src/types/classes/item-config/ItemConfigCard.d.ts @@ -0,0 +1,3 @@ +declare interface ItemConfigCard extends IsaacAPIClass { + ModdedCardFront: Sprite; +} diff --git a/packages/isaac-typescript-definitions-repentogon/src/types/classes/item-config/ItemConfigItem.d.ts b/packages/isaac-typescript-definitions-repentogon/src/types/classes/item-config/ItemConfigItem.d.ts index 22bf4343c..b1092eb1b 100644 --- a/packages/isaac-typescript-definitions-repentogon/src/types/classes/item-config/ItemConfigItem.d.ts +++ b/packages/isaac-typescript-definitions-repentogon/src/types/classes/item-config/ItemConfigItem.d.ts @@ -1,6 +1,27 @@ declare interface ItemConfigItem extends IsaacAPIClass { + /** + * Returns an array of the strings defined in the item's `customcache` attribute in `items.xml`. + * + * The tags in the array are always in lowercase regardless of its casing in `items.xml`. + */ GetCustomCacheTags: () => string[]; + + /** + * Returns an array of the strings defined in the item's `customtags` attribute in `items.xml`. + * + * The tags in the array are always in lowercase regardless of its casing in `items.xml`. + */ GetCustomTags: () => string[]; + + /** + * Returns whether the provided cache tag was specified in the item's `customcache` attribute in + * `items.xml`. The tag name is case insensitive. + */ HasCustomCacheTag: (tagName: string) => boolean; + + /** + * Returns whether the provided tag was specified in the item's `customtags` attribute in + * `items.xml`. The tag name is case insensitive. + */ HasCustomTag: (tag: string) => boolean; } diff --git a/packages/isaac-typescript-definitions-repentogon/src/types/index.d.ts b/packages/isaac-typescript-definitions-repentogon/src/types/index.d.ts index f6875915e..b3364d3e6 100644 --- a/packages/isaac-typescript-definitions-repentogon/src/types/index.d.ts +++ b/packages/isaac-typescript-definitions-repentogon/src/types/index.d.ts @@ -23,6 +23,7 @@ /// /// /// +/// /// /// /// @@ -32,6 +33,7 @@ /// /// /// +/// /// /// /// diff --git a/packages/isaacscript-spell/dictionaries/isaac/isaac.txt b/packages/isaacscript-spell/dictionaries/isaac/isaac.txt index d9b676150..37ca7383f 100644 --- a/packages/isaacscript-spell/dictionaries/isaac/isaac.txt +++ b/packages/isaacscript-spell/dictionaries/isaac/isaac.txt @@ -30,6 +30,7 @@ coregfx # REPENTOGON API costumesuffix # REPENTOGON API craftable Cucco # Creator of Job +customcache # REPENTOGON API customtags # REPENTOGON API damagemodifier # REPENTOGON API damagemultiplier # REPENTOGON API