diff --git a/packages/isaac-typescript-definitions-repentogon/src/enums/BlendEquation.ts b/packages/isaac-typescript-definitions-repentogon/src/enums/BlendEquation.ts new file mode 100644 index 000000000..8cee9dcc0 --- /dev/null +++ b/packages/isaac-typescript-definitions-repentogon/src/enums/BlendEquation.ts @@ -0,0 +1,12 @@ +/** + * This enum is for REPENTOGON, an exe-hack which expands the modding API. + * + * @see https://repentogon.com/ + */ +export enum BlendEquation { + ADD = 0, + SUBTRACT = 1, + REVERSE_SUBTRACT = 2, + MIN = 3, + MAX = 4, +} diff --git a/packages/isaac-typescript-definitions-repentogon/src/enums/BlendFactor.ts b/packages/isaac-typescript-definitions-repentogon/src/enums/BlendFactor.ts index a93a8dc7d..b0e9604f2 100644 --- a/packages/isaac-typescript-definitions-repentogon/src/enums/BlendFactor.ts +++ b/packages/isaac-typescript-definitions-repentogon/src/enums/BlendFactor.ts @@ -1,3 +1,8 @@ +/** + * This enum is for REPENTOGON, an exe-hack which expands the modding API. + * + * @see https://repentogon.com/ + */ export enum BlendFactor { ZERO = 0, ONE = 1, diff --git a/packages/isaac-typescript-definitions-repentogon/src/enums/SplitTearType.ts b/packages/isaac-typescript-definitions-repentogon/src/enums/SplitTearType.ts new file mode 100644 index 000000000..5e242bb05 --- /dev/null +++ b/packages/isaac-typescript-definitions-repentogon/src/enums/SplitTearType.ts @@ -0,0 +1,18 @@ +/** + * This enum is for REPENTOGON, an exe-hack which expands the modding API. + * + * @see https://repentogon.com/ + */ +export enum SplitTearType { + GENERIC = 0, + QUAD = 1, + PARASITE = 2, + BONE = 3, + ABSORB = 4, + SPORE = 5, + STICKY = 6, + BURST = 7, + POP = 8, + MULTIDIMENSIONAL = 9, + ANGELIC_PRISM = 10, +} diff --git a/packages/isaac-typescript-definitions-repentogon/src/enums/SuplexState.ts b/packages/isaac-typescript-definitions-repentogon/src/enums/SuplexState.ts new file mode 100644 index 000000000..280922e21 --- /dev/null +++ b/packages/isaac-typescript-definitions-repentogon/src/enums/SuplexState.ts @@ -0,0 +1,12 @@ +/** + * This enum is for REPENTOGON, an exe-hack which expands the modding API. + * + * @see https://repentogon.com/ + */ +export enum SuplexState { + INACTIVE = 0, + DASH = 1, + HOLD = 2, + JUMP = 3, + FALL = 4, +} diff --git a/packages/isaac-typescript-definitions-repentogon/src/enums/flags/WaterClipFlag.ts b/packages/isaac-typescript-definitions-repentogon/src/enums/flags/WaterClipFlag.ts new file mode 100644 index 000000000..2c8ce1950 --- /dev/null +++ b/packages/isaac-typescript-definitions-repentogon/src/enums/flags/WaterClipFlag.ts @@ -0,0 +1,47 @@ +/** + * This is represented as an object instead of an enum due to limitations with TypeScript enums. (We + * want this type to be a child of the `BitFlag` type.) + * + * This enum is for REPENTOGON, an exe-hack which expands the modding API. + * + * @enum + * @notExported + * @rename WaterClipFlag + * @see https://repentogon.com/ + */ +const WaterClipFlagInternal = { + /** When set for an Entity, also enables rendering below water. */ + DISABLE_RENDER_ABOVE_WATER: 1 << 1, + /** + * Allows the entity to be rendered below the water along with being rendered above the water. + * Only works for entities. + */ + ENABLE_RENDER_BELOW_WATER: 1 << 2, + + /** Prevents the entity from being rendered below the water. Takes priority over other flags. */ + DISABLE_RENDER_BELOW_WATER: 1 << 3, + + /** Prevents the entity from having its reflection be rendered. Only works for entities. */ + DISABLE_RENDER_REFLECTION: 1 << 5, + + /** Overrides other flags and only allows the entity to render above water with no reflection. */ + IGNORE_WATER_RENDERING: 1 << 6, + + /** + * Forces the entity to spawn water ripple effects regardless of if they're on the ground or not. + * Only works for entities. + */ + FORCE_WATER_RIPPLE_WHEN_MOVING: 1 << 7, +} as const; + +type WaterClipFlagValue = BitFlag & { + readonly __waterClipFlagBrand: symbol; +}; +type WaterClipFlagType = { + readonly [K in keyof typeof WaterClipFlagInternal]: WaterClipFlagValue; +}; + +export const WaterClipFlag = WaterClipFlagInternal as WaterClipFlagType; +export type WaterClipFlag = WaterClipFlagType[keyof WaterClipFlagType]; + +export const WaterClipFlagZero = 0 as BitFlags; diff --git a/packages/isaac-typescript-definitions-repentogon/src/index.ts b/packages/isaac-typescript-definitions-repentogon/src/index.ts index 27af4510c..97272d40e 100644 --- a/packages/isaac-typescript-definitions-repentogon/src/index.ts +++ b/packages/isaac-typescript-definitions-repentogon/src/index.ts @@ -2,6 +2,7 @@ export * from "./enums/Achievement"; export * from "./enums/AltRockType"; export * from "./enums/AutocompleteType"; export * from "./enums/BagOfCraftingPickup"; +export * from "./enums/BlendEquation"; export * from "./enums/BlendFactor"; export * from "./enums/BlendType"; export * from "./enums/BombCostumeLayer"; @@ -26,6 +27,7 @@ export * from "./enums/flags/DebugFlag"; export * from "./enums/flags/EntityTag"; export * from "./enums/flags/GetCollectibleFlag"; export * from "./enums/flags/GibFlag"; +export * from "./enums/flags/WaterClipFlag"; export * from "./enums/flags/WeaponModifierFlag"; export * from "./enums/FollowerPriority"; export * from "./enums/GameMode"; @@ -51,7 +53,9 @@ export * from "./enums/ProceduralEffectConditionType"; export * from "./enums/PurityState"; export * from "./enums/SlotState"; export * from "./enums/SpecialQuest"; +export * from "./enums/SplitTearType"; export * from "./enums/StbRailVariant"; +export * from "./enums/SuplexState"; export * from "./enums/TaintedMarksGroup"; export * from "./enums/WeaponSlot"; export * from "./enums/WindowIcon"; diff --git a/packages/isaac-typescript-definitions-repentogon/src/types/classes/Ambush.d.ts b/packages/isaac-typescript-definitions-repentogon/src/types/classes/Ambush.d.ts index b6be86ea7..1709357c4 100644 --- a/packages/isaac-typescript-definitions-repentogon/src/types/classes/Ambush.d.ts +++ b/packages/isaac-typescript-definitions-repentogon/src/types/classes/Ambush.d.ts @@ -39,7 +39,7 @@ declare namespace Ambush { * * Calling this method will error if the current room's type is not `RoomType.CHALLENGE`. */ - function GetNextWave(): RoomConfig; + function GetNextWave(): RoomConfig | undefined; /** * Returns an array containing the `RoomConfig` of the next Challenge Room waves. diff --git a/packages/isaac-typescript-definitions-repentogon/src/types/classes/Camera.d.ts b/packages/isaac-typescript-definitions-repentogon/src/types/classes/Camera.d.ts index b4780b1ef..b3a4ddcd0 100644 --- a/packages/isaac-typescript-definitions-repentogon/src/types/classes/Camera.d.ts +++ b/packages/isaac-typescript-definitions-repentogon/src/types/classes/Camera.d.ts @@ -4,15 +4,21 @@ * @see https://repentogon.com/ */ declare interface Camera extends IsaacAPIClass { + /** Returns whether the camera is clamped to the room's boundaries. */ + IsClampEnabled: () => boolean; + /** Returns whether the specified position is visible within the camera's current view. */ IsPosVisible: (position: Vector) => boolean; + /** Sets whether the camera is clamped to the room's boundaries. */ + SetClampEnabled: (enabled: boolean) => void; + /** * Sets the camera's current focus position, causing it to shift towards the specified position. * If you want the camera to change its position instantly, use `Camera.SnapToPosition` instead. * - * The camera will only move if the current room size is larger than 1x1. If the room size is 1x1 - * or smaller, this method will do nothing. + * By default, he camera will only move if the current room size is larger than 1x1. To allow the + * camera to move regardless of the room's shape, you must call `Camera.SetClampEnabled(false)`. * * This method must be called on every game update, otherwise the game will override the camera's * focus position. @@ -23,8 +29,8 @@ declare interface Camera extends IsaacAPIClass { * Changes the camera's position immediately. If you want the camera to smoothly change its * position, use `Camera.SetFocusPosition` instead. * - * The camera will only move if the current room size is larger than 1x1. If the room size is 1x1 - * or smaller, this method will do nothing. + * By default, he camera will only move if the current room size is larger than 1x1. To allow the + * camera to move regardless of the room's shape, you must call `Camera.SetClampEnabled(false)`. * * This method must be called on every game update, otherwise the game will override the camera's * focus position. diff --git a/packages/isaac-typescript-definitions-repentogon/src/types/classes/Capsule.d.ts b/packages/isaac-typescript-definitions-repentogon/src/types/classes/Capsule.d.ts index 6706a8333..4c748fff3 100644 --- a/packages/isaac-typescript-definitions-repentogon/src/types/classes/Capsule.d.ts +++ b/packages/isaac-typescript-definitions-repentogon/src/types/classes/Capsule.d.ts @@ -34,7 +34,7 @@ declare interface Capsule extends IsaacAPIClass { * Attempts to trigger a collision between two capsules at a specific position. Returns whether * the capsules have collided or not. */ - Collide: (capsule: Capsule, point: Vector) => boolean; + Collide: (capsule1: Capsule, capsule2: Capsule, point: Vector) => boolean; /** * Returns a unit vector corresponding to the direction the capsule relative to its origin. This @@ -42,6 +42,23 @@ declare interface Capsule extends IsaacAPIClass { */ GetDirection: () => Vector; + /** Returns the end point of the capsule. */ + GetEndPoint: () => Vector; + + /** Returns the capsule's position. */ + GetPosition: () => Vector; + + /** Returns the size of the capsule. */ + GetSize: () => number; + + /** Returns the start point of the capsule. */ + GetStartPoint: () => Vector; + + /** Returns the size difference of the capsule. */ + GetSizeDifference: () => number; + + // DEPRECATED METHODS + /** * Returns the capsule's radius. * @@ -50,6 +67,8 @@ declare interface Capsule extends IsaacAPIClass { * "GetF1" to prevent errors. REPENTOGON will give these methods proper names in a later update. * * @customName GetF1 + * @deprecated Use `Capsule.GetSize` instead as REPENTOGON added new methods that accurately + * reflect what the capsule does. */ GetRadius: () => number; @@ -62,12 +81,11 @@ declare interface Capsule extends IsaacAPIClass { * names in a later update. * * @customName GetF2 + * @deprecated Use `Capsule.GetSizeDifference` instead as REPENTOGON added new methods that + * accurately reflect what the capsule does. */ GetEndpointsDistance: () => number; - /** Returns the capsule's position. */ - GetPosition: () => Vector; - /** * Returns the position of one of the two capsule's endpoints. * @@ -77,6 +95,8 @@ declare interface Capsule extends IsaacAPIClass { * proper names in a later update. * * @customName GetVec2 + * @deprecated Use `Capsule.GetStartPoint` instead as REPENTOGON added new methods that accurately + * reflect what the capsule does. */ GetEndpoint1Position: () => Vector; @@ -89,6 +109,8 @@ declare interface Capsule extends IsaacAPIClass { * proper names in a later update. * * @customName GetVec3 + * @deprecated Use `Capsule.GetEndPoint` instead as REPENTOGON added new methods that accurately + * reflect what the capsule does. */ GetEndpoint2Position: () => Vector; } diff --git a/packages/isaac-typescript-definitions-repentogon/src/types/classes/EntityDesc.d.ts b/packages/isaac-typescript-definitions-repentogon/src/types/classes/EntityDesc.d.ts new file mode 100644 index 000000000..44f3d7090 --- /dev/null +++ b/packages/isaac-typescript-definitions-repentogon/src/types/classes/EntityDesc.d.ts @@ -0,0 +1,41 @@ +import type { ChampionColor, EntityType } from "isaac-typescript-definitions"; + +declare global { + /** + * Constructs an EntityDesc object. + * + * @param this + * @param entityType Optional. Default is `EntityType.NULL`. + * @param variant Optional. Default is 0. + * @param subType Optional. Default is 0. + * @param championColor Optional. Default is -1. + * @param health Optional. Default is 0. + * @param maxHealth Optional. Default is 0. + * @param playerControlled Optional. Default is false. + */ + function EntityDesc( + this: void, + entityType?: EntityType, + variant?: int, + subType?: int, + championColor?: ChampionColor, + health?: number, + maxHealth?: number, + playerControlled?: boolean, + ): EntityDesc; + + interface EntityDesc extends IsaacAPIClass { + GetHealth: () => void; + GetMaxHealth: () => void; + GetSubtype: () => int; + GetType: () => EntityType; + GetVariant: () => int; + IsPlayerControlled: () => boolean; + SetHealth: (health: int) => void; + SetMaxHealth: (maxHealth: int) => void; + SetPlayerControlled: (controlled: boolean) => void; + SetSubtype: (subType: int) => void; + SetType: (entityType: EntityType) => void; + SetVariant: (variant: int) => void; + } +} diff --git a/packages/isaac-typescript-definitions-repentogon/src/types/classes/Room.d.ts b/packages/isaac-typescript-definitions-repentogon/src/types/classes/Room.d.ts index a37bcfa28..97fb65d4f 100644 --- a/packages/isaac-typescript-definitions-repentogon/src/types/classes/Room.d.ts +++ b/packages/isaac-typescript-definitions-repentogon/src/types/classes/Room.d.ts @@ -16,6 +16,12 @@ declare global { /** Returns whether an obstacle can be spawned at the provided grid index. */ CanSpawnObstacleAtPosition: (gridIndex: int, force: boolean) => boolean; + /** + * @param excludeNPCs Optional. Default is false. + * @param source Optional. Default is undefined. + */ + ClearBossHazards: (excludeNPCs?: boolean, source?: Entity) => void; + /** * Creates a lightning strike effect as seen in Downpour. * @@ -26,9 +32,11 @@ declare global { */ DoLightningStrike: (seed?: Seed) => void; - /** Returns the room's `Backdrop` object. */ GetBackdrop: () => Backdrop; + /** Returns the room's `BackdropType`. */ + GetBackdropType: () => BackdropType; + /** Returns the room's boss victory jingle. */ GetBossVictoryJingle: () => Music; @@ -61,7 +69,7 @@ declare global { * @param seed Optional. Default is a call to `Random()`. * @param raw Optional. Default is false. */ - GetItemPool: (seed?: Seed, raw?: boolean) => void; + GetItemPool: (seed?: Seed, raw?: boolean) => ItemPoolType; /** Returns the intensity of the lightning effect. */ GetLightningIntensity: () => float; @@ -99,6 +107,8 @@ declare global { shopItemID: int, ) => int; + GetWallColor: () => Color; + /** * Returns the amount of water in the room. * @@ -137,6 +147,8 @@ declare global { keepDecoration: boolean, ) => void; + SaveState: () => void; + /** * Sets the room's backdrop. * @@ -228,6 +240,15 @@ declare global { ) => void) & ((gridIndex: int, descriptor: GridEntityDesc) => void); + /** + * Triggers an event in the room. + * + * @param output Must be between 0 and 9, otherwise the method will error. + */ + TriggerOutput: (output: int) => void; + + TriggerRestock: (gridIndex: int, shopIndex: int) => void; + /** Returns a discounted price of a shop item. */ TryGetShopDiscount: (shopItem: int, price: int) => int; diff --git a/packages/isaac-typescript-definitions-repentogon/src/types/classes/boss-pools/BossPool.d.ts b/packages/isaac-typescript-definitions-repentogon/src/types/classes/boss-pools/BossPool.d.ts index dd6be0b65..ede3760de 100644 --- a/packages/isaac-typescript-definitions-repentogon/src/types/classes/boss-pools/BossPool.d.ts +++ b/packages/isaac-typescript-definitions-repentogon/src/types/classes/boss-pools/BossPool.d.ts @@ -6,6 +6,7 @@ declare interface BossPool extends IsaacAPIClass { /** Returns the ID of the Boss Pool's Double Trouble room. */ GetDoubleTroubleRoomID: () => int; + GetDoubleTroubleRoomVariantStart: () => int; /** Returns an array of the Boss Pool's entries. */ GetEntries: () => BossPoolEntry[]; diff --git a/packages/isaac-typescript-definitions-repentogon/src/types/classes/boss-pools/BossPoolManager.d.ts b/packages/isaac-typescript-definitions-repentogon/src/types/classes/boss-pools/BossPoolManager.d.ts index 8d55e0972..b11cd7c14 100644 --- a/packages/isaac-typescript-definitions-repentogon/src/types/classes/boss-pools/BossPoolManager.d.ts +++ b/packages/isaac-typescript-definitions-repentogon/src/types/classes/boss-pools/BossPoolManager.d.ts @@ -8,6 +8,9 @@ declare global { * @see https://repentogon.com/ */ namespace BossPoolManager { + /** Returns a map containing bosses that are blacklisted from the current stage's boss pool. */ + function GetLevelBlacklist(): LuaMap; + /** Returns the Boss Pool corresponding to the provided `stageID`. */ function GetPool(stageID: StageID): BossPool; diff --git a/packages/isaac-typescript-definitions-repentogon/src/types/classes/entity/Entity.d.ts b/packages/isaac-typescript-definitions-repentogon/src/types/classes/entity/Entity.d.ts index 2e7383b17..d9bda3e08 100644 --- a/packages/isaac-typescript-definitions-repentogon/src/types/classes/entity/Entity.d.ts +++ b/packages/isaac-typescript-definitions-repentogon/src/types/classes/entity/Entity.d.ts @@ -2,6 +2,7 @@ import type { BloodExplosionSubType, EntityType, } from "isaac-typescript-definitions"; +import type { WaterClipFlag } from "../../../enums/flags/WaterClipFlag"; declare global { interface Entity extends IsaacAPIClass { @@ -87,6 +88,9 @@ declare global { */ AddWeakness: (source: EntityRef, duration: int) => void; + /** Returns whether the entity can devolve from D10. */ + CanDevolve: () => boolean; + ComputeStatusEffectDuration: (initialLength: int, source: EntityRef) => int; /** @@ -206,13 +210,13 @@ declare global { GetMinecart: () => EntityNPC | undefined; /** Returns the entity's null capsule. */ - GetNullCapsule: (nullLayerNameOrId: string | int) => Capsule; + GetNullCapsule: (name: string) => Capsule; /** * Returns the position of the null layer mark. If the layer is not visible or no frame is * available for the current animation, `VectorZero` is returned instead. */ - GetNullOffset: (nullLayerNameOrId: string | undefined) => Vector; + GetNullOffset: (nullLayerName: string | undefined) => Vector; /** Returns how many frames are left until the pause status effect goes away. */ GetPauseTime: () => int; @@ -251,6 +255,9 @@ declare global { /** Returns the entity's `EntityType`. */ GetType: () => EntityType; + /** Returns the entity's water clip flags. */ + GetWaterClipFlags: () => BitFlags; + /** Returns how many frames are left until the weakness status effect goes away. */ GetWeaknessCountdown: () => int; @@ -292,6 +299,9 @@ declare global { scale?: number, ) => EntityEffect; + /** Resets the entity's water clip flags. */ + ResetWaterClipFlags: () => void; + /** * Updates the remaining frames until the baited status effect is removed. If the entity does * not have the status effect, then this method will do nothing. @@ -441,6 +451,9 @@ declare global { /** Sets the entity's speed multiplier. */ SetSpeedMultiplier: (multiplier: number) => void; + /** Sets the entity's water clip flags. */ + SetWaterClipFlags: (flags: BitFlags) => void; + /** * Updates the remaining frames until the weakness status effect is removed. If the entity does * not have the status effect, then this method will do nothing. diff --git a/packages/isaac-typescript-definitions-repentogon/src/types/classes/entity/EntityEffect.d.ts b/packages/isaac-typescript-definitions-repentogon/src/types/classes/entity/EntityEffect.d.ts index 8be374346..046994e64 100644 --- a/packages/isaac-typescript-definitions-repentogon/src/types/classes/entity/EntityEffect.d.ts +++ b/packages/isaac-typescript-definitions-repentogon/src/types/classes/entity/EntityEffect.d.ts @@ -17,4 +17,25 @@ declare namespace EntityEffect { state?: int, color?: Color, ): EntityEffect; + + /** + * Creates a LootList preview effect. This is the same effect used by Guppy's Eye. + * + * @param loot + * @param position + * @param owner + * @param effect The purpose of this argument is currently unknown. + */ + function CreateLootPreview( + loot: LootList, + position: Vector, + owner: EntityPickup, + effect: EntityEffect, + ): EntityEffect; + + /** + * Returns the GridEntityDesc corresponding to the effect if its variant is + * `EffectVariant.GRID_ENTITY_PROJECTILE_HELPER`, otherwise returns undefined. + */ + function GetGridEntityDesc(): GridEntityDesc | undefined; } diff --git a/packages/isaac-typescript-definitions-repentogon/src/types/classes/entity/EntityFamiliar.d.ts b/packages/isaac-typescript-definitions-repentogon/src/types/classes/entity/EntityFamiliar.d.ts index b4c4310a1..debf9c88f 100644 --- a/packages/isaac-typescript-definitions-repentogon/src/types/classes/entity/EntityFamiliar.d.ts +++ b/packages/isaac-typescript-definitions-repentogon/src/types/classes/entity/EntityFamiliar.d.ts @@ -1,4 +1,8 @@ -import type { Direction, WeaponType } from "isaac-typescript-definitions"; +import type { + CollectibleType, + Direction, + WeaponType, +} from "isaac-typescript-definitions"; import type { FollowerPriority } from "../../../enums/FollowerPriority"; declare global { @@ -12,9 +16,24 @@ declare global { /** Returns whether the familiar can be damaged by enemy projectiles. */ CanBeDamagedByProjectiles: () => boolean; + /** Returns whether the familiar can block projectiles. */ + CanBlockProjectiles: () => boolean; + /** Returns whether the familiar can charm enemies. */ CanCharm: () => boolean; + /** + * Returns the weapon entity the familiar is holding. Returns undefined if the familiar has no + * weapon. + */ + GetActiveWeaponEntity: () => Entity | undefined; + + /** + * Returns how many times the familiar has attacked with its current weapon. Returns undefined + * for familiars that do not attack with a weapon. + */ + GetActiveWeaponNumFired: () => int | undefined; + /** Returns the familiar's dirt color. */ GetDirtColor: () => Color; @@ -73,17 +92,37 @@ declare global { TriggerRoomClear: () => void; /** - * Attempts to aim at the marked target effect if the player has the Marked collectible. + * Makes the familiar attempt to aim at the marked target effect if the player has the Marked + * collectible. * - * Returns the position of the effect if the familiar successfully targeted it, otherwise - * undefined is returned. + * When called with exactly 2 arguments (aimDirection, direction): Returns the position of the + * effect if the familiar successfully targeted it, otherwise undefined is returned. */ - TryAimAtMarkedTarget: ( + TryAimAtMarkedTarget: (( aimDirection: Vector, direction: Direction, - ) => Vector | undefined; + ) => Vector | undefined) + & (( + /** + * @param aimDirection + * @param direction + * @param targetPosBuffer + * @returns 2 values: + * - success: Whether the targeting was successful. + * - result: An array containing the modified aim direction Vector, the modified direction + * integer, and the modified target position buffer Vector. + */ + aimDirection?: Vector, + direction?: int, + targetPosBuffer?: Vector, + ) => LuaMultiReturn<[success: boolean, result: [Vector, int, Vector]]>); /** Updates the familiar's dirt color. */ UpdateDirtColor: () => void; } } + +/** @noSelf */ +declare namespace EntityFamiliar { + function GetRandomWisp(rng: RNG): CollectibleType; +} diff --git a/packages/isaac-typescript-definitions-repentogon/src/types/classes/entity/EntityKnife.d.ts b/packages/isaac-typescript-definitions-repentogon/src/types/classes/entity/EntityKnife.d.ts index 1be17e753..425ffb8fe 100644 --- a/packages/isaac-typescript-definitions-repentogon/src/types/classes/entity/EntityKnife.d.ts +++ b/packages/isaac-typescript-definitions-repentogon/src/types/classes/entity/EntityKnife.d.ts @@ -1,4 +1,31 @@ +import type { TearVariant } from "isaac-typescript-definitions"; +import type { SplitTearType } from "../../../enums/SplitTearType"; + declare interface EntityKnife extends Entity { + /** Adds an entity to the knife's hit list. */ + AddToHitList: (entity: Entity) => void; + + /** + * Fires a split tear. + * + * @param position + * @param velocity + * @param damageMultiplier Optional. Default is 0.5. + * @param sizeMultiplier Optional. Default is 0.6. + * @param variant Optional. Default is `TearVariant.BLUE`. + * @param splitTearType Optional. Default is `SplitTearType.GENERIC`. + */ + FireSplitTear: ( + position: Vector, + velocity: Vector, + damageMultiplier?: number, + sizeMultiplier?: number, + variant?: TearVariant, + splitTearType?: SplitTearType, + ) => EntityTear; + + GetHitboxParentKnife: () => EntityKnife | undefined; + /** Returns an array of entity indexes that the knife is currently hitting. */ GetHitList: () => int[]; @@ -8,12 +35,20 @@ declare interface EntityKnife extends Entity { /** Returns whether the entity knife is swinging. */ GetIsSwinging: () => boolean; + /** Returns whether the entity is in the knife's hit list. */ + InHitList: (entity: Entity) => boolean; + /** Returns whether the knife was created through the Multidimensional Baby effect. */ IsMultidimensionalTouched: () => boolean; /** Returns whether the knife was created through the Angelic Prism effect. */ IsPrismTouched: () => boolean; + /** Removes an entity from the knife's hit list. */ + RemoveFromHitList: (entity: Entity) => void; + + SetHitboxParentKnife: (parentKnife: EntityKnife | undefined) => void; + /** Returns whether the entity knife is performing a spin attack. */ SetIsSpinAttack: (isSpinAttack: boolean) => void; diff --git a/packages/isaac-typescript-definitions-repentogon/src/types/classes/entity/EntityLaser.d.ts b/packages/isaac-typescript-definitions-repentogon/src/types/classes/entity/EntityLaser.d.ts index 2cde3ce0e..3f235330c 100644 --- a/packages/isaac-typescript-definitions-repentogon/src/types/classes/entity/EntityLaser.d.ts +++ b/packages/isaac-typescript-definitions-repentogon/src/types/classes/entity/EntityLaser.d.ts @@ -1,4 +1,29 @@ +import type { TearVariant } from "isaac-typescript-definitions"; +import type { SplitTearType } from "../../../enums/SplitTearType"; + declare interface EntityLaser extends Entity { + /** Adds an entity to the laser's hit list. */ + AddToHitList: (entity: Entity) => void; + + /** + * Fires a split tear. + * + * @param position + * @param velocity + * @param damageMultiplier Optional. Default is 0.5. + * @param sizeMultiplier Optional. Default is 0.6. + * @param variant Optional. Default is `TearVariant.BLUE`. + * @param splitTearType Optional. Default is `SplitTearType.GENERIC`. + */ + FireSplitTear: ( + position: Vector, + velocity: Vector, + damageMultiplier?: number, + sizeMultiplier?: number, + variant?: TearVariant, + splitTearType?: SplitTearType, + ) => EntityTear; + /** Returns the laser's damage multiplier. */ GetDamageMultiplier: () => number; @@ -8,6 +33,8 @@ declare interface EntityLaser extends Entity { /** Returns an array of entity indexes that the laser is hitting. */ GetHitList: () => int[]; + GetHomingType: () => int; + /** Returns whether entities can only take damage once from the laser during its lifetime. */ GetOneHit: () => boolean; @@ -20,12 +47,17 @@ declare interface EntityLaser extends Entity { /** Returns how many frames until the laser times out and is removed. */ GetTimeout: () => int; + /** Returns whether the entity is in the laser's hit list. */ + InHitList: (entity: Entity) => boolean; + /** Returns whether the laser was created through the Multidimensional Baby effect. */ IsMultidimensionalTouched: () => boolean; /** Returns whether the laser was created through the Angelic Prism effect. */ IsPrismTouched: () => boolean; + SetHomingType: (homingType: int) => void; + /** * Causes the laser's shape to be fully recalculated on its next update. This can be used to force * the laser to instantly change to its `MaxDistance`/`Radius` properties without transitioning to @@ -36,6 +68,9 @@ declare interface EntityLaser extends Entity { */ RecalculateSamplesNextUpdate: () => void; + /** Removes an entity from the laser's hit list. */ + RemoveFromHitList: (entity: Entity) => void; + /** Resets the laser's sprite scale. */ ResetSpriteScale: () => void; diff --git a/packages/isaac-typescript-definitions-repentogon/src/types/classes/entity/EntityNPC.d.ts b/packages/isaac-typescript-definitions-repentogon/src/types/classes/entity/EntityNPC.d.ts index a1fb33ef2..85758fc16 100644 --- a/packages/isaac-typescript-definitions-repentogon/src/types/classes/entity/EntityNPC.d.ts +++ b/packages/isaac-typescript-definitions-repentogon/src/types/classes/entity/EntityNPC.d.ts @@ -3,16 +3,30 @@ import type { ControllerIndex, ProjectilesMode, RockSpiderVariant, + TearFlag, } from "isaac-typescript-definitions"; declare global { interface EntityNPC extends Entity { + /** + * @param position + * @param flags + * @param source Optional. Default is undefined. + * @param damage Optional. Default is 3.5. + */ + ApplyTearflagEffects: ( + position: Vector, + flags: BitFlags, + source?: Entity, + damage?: number, + ) => void; + /** Clears the flying override set by `EntityNPC.SetFlyingOverride`. */ ClearFlyingOverride: () => void; /** - * Behaves the same as `EntityNPC.FireProjectiles` except it returns an array of the projectiles - * fired. + * Behaves the same as `EntityNPC.FireBossProjectiles` except it returns an array of the + * projectiles fired. */ FireBossProjectilesEx: ( numProjectiles: int, @@ -65,9 +79,25 @@ declare global { /** Returns a unique `LootList` used by fireplaces when they are extinguished. */ GetFireplaceLoot: () => LootList; + /** Returns whether the NPC's flying override was set. */ + GetFlyingOverride: () => boolean; + /** Returns an array of entity indexes that the NPC is hitting. */ GetHitList: () => int[]; + /** + * Returns the NPC's pathfinder with fixed bindings. + * + * Due to a bug with the vanilla API, accessing the NPC's pathfinder through the + * `EntityNPC.Pathfinder` field returns a version of the Pathfinder with broken bindings, + * leading to multiple methods not working as intended, such as some function arguments not + * working at all. + * + * To not break existing mods, the Pathfinder object returned from the `Pathfinder` field is + * unchanged, so you should use `EntityNPC.GetPathfinder` whenever possible. + */ + GetPathfinder: () => PathFinder; + /** Returns the NPC's shield strength/armor. */ GetShieldStrength: () => number; @@ -120,8 +150,13 @@ declare global { /** Sets the NPC's shield strength/armor. */ SetShieldStrength: (strength: number) => void; - /** Spawns a blood cloud effect. */ - SpawnBloodCloud: (position: Vector, color: Color) => EntityEffect; + /** + * Spawns a blood cloud effect. + * + * @param position Optional. Default is the entity's current position. + * @param color Optional. Default is `ColorDefault`. + */ + SpawnBloodCloud: (position?: Vector, color?: Color) => EntityEffect; /** Spawns a blood splash effect. */ SpawnBloodSplash: () => void; @@ -130,7 +165,7 @@ declare global { * Attempts to change the NPC's target. This is used by Lost Fly to force NPCs to target it. * Returns whether the NPCs target changed successfully. */ - TryForceTarget: (target: Entity, duration: int) => void; + TryForceTarget: (target: Entity, duration: int) => boolean; /** * Attempts to split the NPC in half. This is used by the Meat Cleaver collectible when @@ -197,12 +232,25 @@ declare global { */ function ThrowLeech( origin: Vector, - source: Entity, + source: Entity | undefined, target: Vector, yPosOffset?: number, big?: number, ): EntityNPC; + /** + * @param origin + * @param target + * @param yOffset Optional. Default is -10. + * @param fallSpeed Optional. Default is -8. + */ + function ThrowMaggot( + origin: Vector, + target: Vector, + yOffset?: number, + fallSpeed?: number, + ): EntityNPC; + /** * @param origin * @param target @@ -223,7 +271,7 @@ declare global { */ function ThrowRockSpider( position: Vector, - source: Entity, + source: Entity | undefined, velocity: Vector, variant?: RockSpiderVariant, yPosOffset?: number, @@ -231,7 +279,7 @@ declare global { function ThrowStrider( position: Vector, - source: Entity, + source: Entity | undefined, target: Vector, ): EntityNPC; } 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 5ee8b59c5..d4b3890a0 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 @@ -23,6 +23,12 @@ declare global { /** Returns the pickup's drop delay. */ GetDropDelay: () => int; + /** + * Returns the pickup's flipped collectible. Returns undefined if it does not have a flipped + * collectible. + */ + GetFlipCollectible: () => CollectibleType | undefined; + /** * Returns a read-only version of the pickup's `LootList`. * @@ -30,6 +36,15 @@ declare global { */ GetLootList: (shouldAdvance?: boolean) => Readonly; + GetMegaChestLeftCollectible: () => EntityPickupCollectible | undefined; + GetMegaChestOtherCollectible: () => LuaMultiReturn< + [ + otherCollectible: EntityPickupCollectible | undefined, + isRight: boolean | undefined, + ] + >; + GetMegaChestRightCollectible: () => EntityPickupCollectible | undefined; + /** * Returns the ghost effect that is visible if a player has Guppy's Eye. Returns undefined if * the ghost isn't visible. @@ -42,14 +57,27 @@ declare global { /** Returns the pickup's `VarData`. */ GetVarData: () => int; + HasFlipData: () => boolean; + + /** + * @param collectible Optional. Default is `CollectibleType.COLLECTIBLE_NULL`. + * @param loadGraphics Optional. Default is true. + */ + InitFlipState: ( + collectible?: CollectibleType, + loadGraphics?: boolean, + ) => void; + /** * Returns whether the collectible is hidden or not. * * This method does not account for Curse of the Blind, it only reflects the blind state of * pickups that are normally blind without curses involved, such as the extra item in the alt * path treasure rooms. + * + * @param checkForcedBlindOnly Optional. Default is true. */ - IsBlind: () => boolean; + IsBlind: (checkForcedBlindOnly?: boolean) => boolean; /** Turns the pickup into a shop item, automatically assigning its price. */ MakeShopItem: (shopItemID: int) => void; @@ -70,7 +98,9 @@ declare global { SetForceBlind: (blind: boolean) => void; /** Sets the pickup's Options index and returns the new pickup index. */ - SetNewOptionsIndex: () => int; + SetNewOptionsPickupIndex: () => int; + + SetVarData: (varData: int) => void; /** * Triggers the effect of the "Theres Options" collectible and removes all pickups in the room diff --git a/packages/isaac-typescript-definitions-repentogon/src/types/classes/entity/EntityPlayer.d.ts b/packages/isaac-typescript-definitions-repentogon/src/types/classes/entity/EntityPlayer.d.ts index 79fc46592..9cfaa2a37 100644 --- a/packages/isaac-typescript-definitions-repentogon/src/types/classes/entity/EntityPlayer.d.ts +++ b/packages/isaac-typescript-definitions-repentogon/src/types/classes/entity/EntityPlayer.d.ts @@ -5,6 +5,7 @@ import type { CardType, CollectibleType, ControllerIndex, + DamageFlag, Direction, EntityGridCollisionClass, FamiliarVariant, @@ -22,14 +23,15 @@ import type { import type { BagOfCraftingPickup } from "../../../enums/BagOfCraftingPickup"; import type { CambionPregnancyLevel } from "../../../enums/CambionPregnancyLevel"; import type { DeathAnimationName } from "../../../enums/DeathAnimationName"; +import type { ConceptionFamiliarFlag } from "../../../enums/flags/ConceptionFamiliarFlag"; +import type { WeaponModifierFlag } from "../../../enums/flags/WeaponModifierFlag"; import type { HealthType } from "../../../enums/HealthType"; import type { PillCardSlot } from "../../../enums/PillCardSlot"; import type { PlayerFoot } from "../../../enums/PlayerFoot"; import type { PocketItemType } from "../../../enums/PocketItemType"; import type { PurityState } from "../../../enums/PurityState"; +import type { SuplexState } from "../../../enums/SuplexState"; import type { WeaponSlot } from "../../../enums/WeaponSlot"; -import type { ConceptionFamiliarFlag } from "../../../enums/flags/ConceptionFamiliarFlag"; -import type { WeaponModifierFlag } from "../../../enums/flags/WeaponModifierFlag"; declare global { interface EntityPlayer extends Entity { @@ -71,6 +73,41 @@ declare global { */ AddCacheFlagsEx: (flag: CacheFlag, evaluateItems?: boolean) => void; + /** + * Adds a candy heart bonus to the player. + * + * @param cacheFlags Optional. Default is CacheFlagZero. + * @param amount Optional. Default is 1. + */ + AddCandyHeartBonus: ( + cacheFlags?: BitFlags, + amount?: int, + ) => void; + + /** + * Behaves the same as `EntityPlayer.CheckFamiliar` except it returns an array of all of the + * familiars. + * + * @param collectibleType + * @param charge Default is 0. + * @param firstTimePickingUp Setting this to false will not spawn or add consumables for the + * item and will not cause it to count towards transformations. + * Default is true. + * @param activeSlot Sets the active slot this collectible should be added to. Default is + * `ActiveSlot.SLOT_PRIMARY`. + * @param varData Sets the variable data for this collectible (this is used to store extra data + * for some active items like the number of uses for Jar of Wisps). Default is 0. + * @param itemPoolType Optional. Default is `ItemPoolType.TREASURE`. + */ + AddCollectibleEx: ( + collectibleType: CollectibleType, + charge?: int, + firstTimePickingUp?: boolean, + activeSlot?: ActiveSlot.PRIMARY | ActiveSlot.SECONDARY, + varData?: int, + itemPoolType?: ItemPoolType, + ) => void; + /** * Adds a collectible effect associated with the provided `collectibleType`. * @@ -128,8 +165,13 @@ declare global { * * @param collectible * @param amount Optional. Default is 1. + * @param evaluateItems Optional. Default is true. */ - AddInnateCollectible: (collectible: CollectibleType, amount?: int) => void; + AddInnateCollectible: ( + collectible: CollectibleType, + amount?: int, + evaluateItems?: boolean, + ) => void; /** * Adds a Leprosy orbital to the player. This is capped at a maximum of three Leprosy orbitals. @@ -179,16 +221,39 @@ declare global { firstTimePickingUp?: boolean, ) => boolean; + /** + * @param cacheFlags Optional. Default is `CacheFlagZero`. + * @param amount Optional. Default is 1. + */ + AddSoulLocketBonus: ( + cacheFlags?: BitFlags, + amount?: int, + ) => void; + + /** + * A shortcut of `TemporaryEffects.AddTrinketEffect` with extra cooldown arguments. + * + * @param trinket + * @param showCostume + * @param cooldown Optional. Default is the cooldown as defined in `items.xml`. + * @param additive Optional. If true, calling this method will increment the current cooldown. + * Default is true. + */ + AddTrinketEffect: ( + trinket: TrinketType, + showCostume: boolean, + cooldown?: int, + additive?: boolean, + ) => void; + /** * Adds charges to the player's Urn of Souls if they are currently holding it. This is capped at * 20 souls. * * The game always keeps track of the amount of souls the player has, even if they do not have * the Urn of Souls in their inventory. - * - * @param count Optional. Default is 0. */ - AddUrnSouls: (count?: number) => void; + AddUrnSouls: (count: number) => void; /** * Blocks the provided `collectibleType`. @@ -235,7 +300,7 @@ declare global { /** * Behaves the same as `EntityPlayer.CheckFamiliar` except it returns an array of all of the - * familiars. + * spawned familiars. * * @param familiar * @param targetCount @@ -296,6 +361,9 @@ declare global { */ ClearQueueItem: () => void; + /** Creates an afterimage of the player that is used by items such as Suplex and A Pony. */ + CreateAfterimage: (duration: int, position: Vector) => void; + /** * Removes the collectible from the player's inventory and spawns a pedestal containing the * collectible. @@ -380,8 +448,10 @@ declare global { /** * Returns how many times the player has attacked with their currently active weapon. The value * resets if the player's current weapon changes or they exit the run. + * + * Returns undefined if the player has no weapon. */ - GetActiveWeaponNumFired: () => int; + GetActiveWeaponNumFired: () => int | undefined; /** Returns an array containing the contents of the player's Bag of Crafting. */ GetBagOfCraftingContent: () => BagOfCraftingPickup[]; @@ -392,6 +462,9 @@ declare global { */ GetBagOfCraftingOutput: () => CollectibleType; + /** Returns the `ItemPoolType` corresponding to the Bag of Crafting's output. */ + GetBagOfCraftingOutputItemPool: () => ItemPoolType; + /** Returns the `BagOfCraftingPickup` in the player's Bag of Crafting at the provided index. */ GetBagOfCraftingSlot: (slot: int) => BagOfCraftingPickup; @@ -423,6 +496,21 @@ declare global { /** Returns the current visible state of Cambion Conception's costume. */ GetCambionPregnancyLevel: () => CambionPregnancyLevel; + /** + * Returns an object of every Candy Heart stat boost and how many times each has been applied to + * the player. + */ + GetCandyHeartBonus: () => { + Damage: int; + FireDelay: int; + Luck: int; + MoveSpeed: int; + ShotSpeed: int; + TearRange: int; + }; + + GetCharmOfTheVampireKills: () => int; + /** * Returns a dictionary with the keys being a collectible and their value being how many of the * collectible the player has in their inventory. Innate collectibles are not counted. @@ -606,6 +694,18 @@ declare global { /** Returns the color of the player's footprint. */ GetFootprintColor: (useLeftFootprint: boolean) => KColor; + /** + * Returns how many frames until the player can switch between the Skeleton/Soul form as the + * Forgotten. + */ + GetForgottenSwapFormCooldown: () => int; + + /** + * Returns the EntityDesc corresponding to the enemy the player last captured using Friendly + * Ball. + */ + GetFriendBallEnemy: () => EntityDesc; + /** Returns the SubType of the glitched baby. */ GetGlitchBabySubType: () => BabySubType; @@ -617,8 +717,8 @@ declare global { * @param subType Optional. Default is -1. */ GetGlyphOfBalanceDrop: ( - variant: PickupVariant, - subType: int, + variant?: PickupVariant, + subType?: int, ) => [PickupVariant, int]; /** @@ -681,6 +781,12 @@ declare global { */ GetLuckModifier: () => number; + /** + * Returns how many frames are left until one of Tainted Magdalene's temporary hearts is + * drained. + */ + GetMaggyHealthDrainCooldown: () => int; + /** * Returns how many frames are left until Tainted Magdalene's swing attack can be used again. * Returns 0 if the player is not Tainted Magdalene. @@ -721,7 +827,7 @@ declare global { * Returns the `EntitiesSaveStateVector` corresponding to the pickups the player has stored * using the Moving Box collectible. */ - GetMovingBoxContents: () => EntitiesSaveStateVector[]; + GetMovingBoxContents: () => EntitiesSaveStateVector; /** Returns the `MultiShotParams` of the provided `weaponType`. */ GetMultiShotParams: (weaponType: WeaponType) => MultiShotParams; @@ -746,6 +852,8 @@ declare global { /** Returns the amount of collectibles the player has tied to the specified transformation. */ GetPlayerFormCounter: (playerFormID: PlayerForm) => void; + GetPlayerHUD: () => PlayerHUD | undefined; + /** * Returns the player's index. * @@ -753,7 +861,7 @@ declare global { * function. If you need to store any data pertaining to a player, use `getPlayerIndex` over * this. */ - GetPlayerIndex: (player: EntityPlayer) => int; + GetPlayerIndex: () => int; /** Returns the `PocketItem` from the provided `slotId`. */ GetPocketItem: (slotId: PillCardSlot) => PocketItem; @@ -773,6 +881,15 @@ declare global { /** Returns the frames left until the damage bonus from Red Stew expires. */ GetRedStewBonusDuration: () => int; + GetRevelationCharge: () => int; + + GetRockBottomDamage: () => number; + GetRockBottomLuck: () => number; + GetRockBottomMaxFireDelay: () => number; + GetRockBottomMoveSpeed: () => number; + GetRockBottomShotSpeed: () => number; + GetRockBottomTearRange: () => number; + /** * Returns the player's current shot speed modifier. The shot speed modifier is either set * through Experimental Treatment or `EntityPlayer.SetShotSpeedModifier`. @@ -783,11 +900,25 @@ declare global { * Returns a table with the keys being the `TrinketType` and the value being being a table with * the corresponding amount of smelted trinkets. */ - GetSmeltedTrinket: () => LuaTable< + GetSmeltedTrinkets: () => LuaTable< TrinketType, { trinketAmount: int; goldenTrinketAmount: int } >; + GetSmeltedTrinketDesc: (trinket: TrinketType) => { + trinketAmount: int; + goldenTrinketAmount: int; + }; + + GetSoulLocketBonus: () => { + Damage: int; + FireDelay: int; + TearRange: int; + ShotSpeed: int; + MoveSpeed: int; + Luck: int; + }; + /** @param position Optional. Default is the player's position. */ GetSpecialGridCollision: (position?: Vector) => EntityGridCollisionClass; @@ -804,17 +935,25 @@ declare global { IsBlocked: boolean; }>; + GetStatMultiplier: () => number; + GetSuplexAimCountdown: () => int; + GetSuplexLandPosition: () => Vector; + GetSuplexState: () => SuplexState; + GetSuplexTargetPosition: () => Vector; + /** * Returns the player's tear displacement. The displacement corresponds to the eye the tear is * being fired from, with 1 being the right eye and -1 being the left eye. */ GetTearDisplacement: () => number; + GetTearsCap: () => number; + /** * Returns the amount of charges the collectible in the provided slot has. Returns 0 if there is * no collectible in the slot. */ - GetTotalActiveCharge: (slot: ActiveSlot) => void; + GetTotalActiveCharge: (slot: ActiveSlot) => int; /** Returns the amount charges the player has for the Urn of Souls item. */ GetUrnSouls: () => int; @@ -850,6 +989,8 @@ declare global { */ GetWispCollectiblesList: () => LuaMap; + HasCamoEffect: () => boolean; + /** * Repentogon's modified `EntityPlayer.HasCollectible` method. * @@ -880,6 +1021,8 @@ declare global { */ HasChanceRevive: () => boolean; + HasForcedCamoEffect: () => boolean; + /** Returns whether the player has the golden variant of the provided trinket. */ HasGoldenTrinket: (trinket: TrinketType) => boolean; @@ -890,6 +1033,19 @@ declare global { */ HasInstantDeathCurse: () => boolean; + /** + * Behaves the same as `EntityPlayer.HasInvincibility` except it now allows for passing an + * EntityRef parameter. + * + * @param damageFlag Optional. Default is 0. + * @param source Optional. Default is undefined. + * @customName HasInvincibility + */ + HasInvincibilityEx: ( + damageFlag?: BitFlags, + source?: EntityRef, + ) => boolean; + /** Returns whether the player is immune to poison. */ HasPoisonImmunity: () => boolean; @@ -921,7 +1077,7 @@ declare global { IsCollectibleAnimFinished: ( collectible: CollectibleType, animation: string, - ) => void; + ) => boolean; /** * Returns whether the player has blocked the collectible. @@ -948,7 +1104,7 @@ declare global { IsCollectibleBlocked: (collectible: CollectibleType) => boolean; /** Returns whether the costume associated with the collectible is visible. */ - IsCostumeVisible: ( + IsCollectibleCostumeVisible: ( collectible: CollectibleType, playerSpriteLayerIDOrName: int | string, ) => boolean; @@ -984,16 +1140,19 @@ declare global { IsLocalPlayer: () => boolean; /** Returns whether the costume associated with the null item is visible. */ - IsNullCostumeVisible: ( + IsNullItemCostumeVisible: ( nullItem: NullItemID, playerSpriteLayerIDOrName: int | string, ) => boolean; + IsPacifist: () => boolean; + IsPostLevelInitFinished: () => boolean; + /** Returns whether the player can no longer shoot due to charging the Kidney Stone item. */ IsUrethraBlocked: () => boolean; /** Turns the player into a co-op ghost. */ - MorphToCoopGhost: () => boolean; + MorphToCoopGhost: () => void; /** * Plays an animation tied to the provided collectible. @@ -1025,6 +1184,8 @@ declare global { volume?: number, ) => void; + RemoveCollectibleByHistoryIndex: (index: int) => void; + /** Removes the pocket item from the provided slot. */ RemovePocketItem: (slot: PillCardSlot) => void; @@ -1090,6 +1251,8 @@ declare global { /** Sets the `VarData` of the collectible at the provided active slot. */ SetActiveVarData: (varData: int, slot: ActiveSlot) => void; + SetBabySkin: (skin: BabySubType) => void; + /** Sets the contents of the player's Bag of Crafting. */ SetBagOfCraftingContent: (content: readonly BagOfCraftingPickup[]) => void; @@ -1131,7 +1294,7 @@ declare global { * This does not spawn the familiar even if it's set to a value where the player gives birth. * The birth is only triggered once the player takes damage. */ - SetCambionConceptionState: (damage: int) => void; + SetCambionConceptionState: (state: int) => void; /** Sets whether the player can shoot. */ SetCanShoot: (canShoot: boolean) => void; @@ -1145,9 +1308,17 @@ declare global { flags: BitFlags | ConceptionFamiliarFlag, ) => void; + /** Sets how many kills the player got with Charm of the Vampire. */ + SetCharmOfTheVampireKills: (kills: int) => void; + /** Sets the player's controller index. */ SetControllerIndex: (index: ControllerIndex) => void; + SetD8DamageModifier: (modifier: number) => void; + SetD8FireDelayModifier: (modifier: number) => void; + SetD8RangeModifier: (modifier: number) => void; + SetD8SpeedModifier: (modifier: number) => void; + /** Sets the player's current damage modifier used by Experimental Treatment. */ SetDamageModifier: (modifier: number) => void; @@ -1201,6 +1372,10 @@ declare global { */ SetFootprintColor: (color: KColor, rightFoot?: boolean) => void; + SetForceCamoEffect: (force: boolean) => void; + SetForgottenSwapFormCooldown: (cooldown: int) => void; + SetFriendBallEnemy: (desc: EntityDesc) => void; + /** * Sets how many frames the player has been holding still with Gnawed Leaf in their inventory. */ @@ -1220,7 +1395,11 @@ declare global { * @param force Optional. If true, existing head direction locks are overridden. Default is * false. */ - SetHeadDirection: (direction: Direction, time: int, force: boolean) => void; + SetHeadDirection: ( + direction: Direction, + time: int, + force?: boolean, + ) => void; /** Sets how many frames the player's head direction is locked in its current direction. */ SetHeadDirectionLockTime: (time: int) => void; @@ -1251,7 +1430,10 @@ declare global { /** Sets the player's current luck modifier used by Experimental Treatment. */ SetLuckModifier: (modifier: int) => void; - /** Sets how many frames until Tainted Maggy's swing attack can be used again. */ + /** Sets how many frames until one of Tainted Magdalene's hearts are drained. */ + SetMaggyHealthDrainCooldown: (cooldown: int) => void; + + /** Sets how many frames until Tainted Magdalene's swing attack can be used again. */ SetMaggySwingCooldown: (cooldown: int) => void; /** @@ -1263,11 +1445,6 @@ declare global { /** * Sets the countdown in frames until the Mega Blast laser goes away. Setting the countdown to a * value above 0 will activate the effects of Mega Blast. - * - * This method has a bug where setting the countdown to a value lower than its current countdown - * causes the laser to persist indefinitely until the player leaves the room. Before calling - * this method, you should check to see if the laser is active by using - * `EntityPlayer.GetMegaBlastDuration`. */ SetMegaBlastDuration: (countdown: int) => void; @@ -1299,12 +1476,26 @@ declare global { */ SetRedStewBonusDuration: (duration: int) => void; + SetRevelationCharge: (charge: int) => void; + + SetRockBottomDamage: (damage: number) => void; + SetRockBottomLuck: (luck: number) => void; + SetRockBottomMaxFireDelay: (maxFireDelay: number) => void; + SetRockBottomMoveSpeed: (speed: number) => void; + SetRockBottomShotSpeed: (shotSpeed: number) => void; + SetRockBottomTearRange: (range: number) => void; + /** Sets the player's current shot speed modifier used by Experimental Treatment. */ SetShotSpeedModifier: (modifier: int) => void; /** Sets the player's current speed modifier used by Experimental Treatment. */ SetSpeedModifier: (modifier: int) => void; + SetSuplexAimCountdown: (countdown: int) => void; + SetSuplexLandPosition: (position: Vector) => void; + SetSuplexState: (state: SuplexState) => void; + SetSuplexTargetPosition: (position: Vector) => void; + /** Sets the amount of damage the player's poison tears deals. */ SetTearPoisonDamage: (damage: number) => void; @@ -1339,7 +1530,7 @@ declare global { * undefined will have the creep inherit the player's current tear params * instead. Default is undefined. */ - SpawnAquariusCreep: (tearParams: TearParams) => EntityEffect; + SpawnAquariusCreep: (tearParams?: TearParams) => EntityEffect; /** * Removes half a heart and spawns a Blood Clot based on the type of heart removed. @@ -1389,8 +1580,11 @@ declare global { /** Triggers effects on the player as if a room was cleared (i.e Charging active items). */ TriggerRoomClear: () => void; - /** Attempts to add the specified pickup to the player's Bag of Crafting. */ - TryAddToBagOfCrafting: (pickup: EntityPickup) => void; + /** + * Attempts to add the specified pickup to the player's Bag of Crafting. Returns whether the + * addition was successful. + */ + TryAddToBagOfCrafting: (pickup: EntityPickup) => boolean; /** * Attempts to decrease the uses left for the Glowing Hourglass collectible, if the player has @@ -1466,5 +1660,6 @@ declare global { VoidHasCollectible: (collectible: CollectibleType) => boolean; BabySkin: BabySubType; + FriendBallEnemy: EntityDesc; } } 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 39142213f..d1045b9e6 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 @@ -31,6 +31,8 @@ declare global { */ GetPrizeCollectible: () => CollectibleType; + GetPrizeSprite: () => Sprite; + /** Returns the slot's prize type. */ GetPrizeType: () => int; 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 6efd793d3..869d8485c 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 @@ -1,57 +1,96 @@ -/** - * This class is for REPENTOGON, an exe-hack which expands the modding API. - * - * @see https://repentogon.com/ - */ -declare interface EntityTear extends Entity { - /** - * Returns the intensity value of the tear as a result of the Dead Eye collectible. The intensity - * is between 0 and 1. - */ - GetDeadEyeIntensity: () => float; +import type { TearVariant } from "isaac-typescript-definitions"; +import type { SplitTearType } from "../../../enums/SplitTearType"; +declare global { /** - * Copies the tear and applies the Multidimensional Baby tear effect to it. Returns the copied - * tear. + * This class is for REPENTOGON, an exe-hack which expands the modding API. + * + * @see https://repentogon.com/ */ - MakeMultidimensionalCopy: () => EntityTear; + interface EntityTear extends Entity { + /** Adds an entity to the tear's hit list. */ + AddToHitList: (entity: Entity) => void; - /** Returns the red aura sprite used by Dead Eye. */ - GetDeadEyeSprite: () => Sprite; + /** Clears the tear's hit list. */ + ClearHitList: () => void; - /** - * Returns the effect sprite used by numerous tear variants such as Fire Mind and Mysterious - * Liquid. - */ - GetTearEffectSprite: () => Sprite; + /** + * Fires a split tear. + * + * @param position + * @param velocity + * @param damageMultiplier Optional. Default is 0.5. + * @param sizeMultiplier Optional. Default is 0.6. + * @param variant Optional. Default is `TearVariant.BLUE`. + * @param splitTearType Optional. Default is `SplitTearType.GENERIC`. + */ + FireSplitTear: ( + position: Vector, + velocity: Vector, + damageMultiplier?: number, + sizeMultiplier?: number, + variant?: TearVariant, + splitTearType?: SplitTearType, + ) => EntityTear; - /** Returns the aura sprite used by Godhead tears. */ - GetTearHaloSprite: () => Sprite; + /** + * Returns the intensity value of the tear as a result of the Dead Eye collectible. The + * intensity is between 0 and 1. + */ + GetDeadEyeIntensity: () => float; - /** Returns whether the tear was created through the Multidimensional Baby effect. */ - IsMultidimensionalTouched: () => boolean; + /** Returns the hit list indices of all entities the tear has hit. */ + GetHitList: () => int[]; - /** Returns whether the tear was created through the Angelic Prism effect. */ - IsPrismTouched: () => boolean; + /** + * Copies the tear and applies the Multidimensional Baby tear effect to it. Returns the copied + * tear. + */ + MakeMultidimensionalCopy: () => EntityTear; - /** - * Repentogon's modified `EntityTear.ResetSpriteScale` method. - * - * Behaves the same as `EntityTear.ResetSpriteScale` except you can now choose to have it - * re-evaluate which scale animation to play. - * - * 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; + /** 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 entity is in the tear's hit list. */ + InHitList: (entity: Entity) => boolean; + + /** Returns whether the tear was created through the Multidimensional Baby effect. */ + IsMultidimensionalTouched: () => boolean; + + /** Returns whether the tear was created through the Angelic Prism effect. */ + IsPrismTouched: () => boolean; + + /** Removes an entity from the tear's hit list. */ + RemoveFromHitList: (entity: Entity) => void; + + /** + * Repentogon's modified `EntityTear.ResetSpriteScale` method. + * + * Behaves the same as `EntityTear.ResetSpriteScale` except you can now choose to have it + * re-evaluate which scale animation to play. + * + * 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; - /** Sets whether the tear was created through the Multidimensional Baby effect. */ - SetMultidimensionalTouched: (touched: boolean) => void; + /** Sets whether the tear was created through the Multidimensional Baby effect. */ + SetMultidimensionalTouched: (touched: boolean) => void; - /** Sets whether the tear was created through the Angelic Prism effect. */ - SetPrismTouched: (touched: boolean) => void; + /** Sets whether the tear was created through the Angelic Prism effect. */ + SetPrismTouched: (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 e4dcf183e..ad4622c4a 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,22 +1,35 @@ import type { DamageFlag } from "isaac-typescript-definitions"; +import type { WaterClipFlag } from "../../../enums/flags/WaterClipFlag"; declare global { interface GridEntity extends IsaacAPIClass { /** Returns the grid's render position. */ GetRenderPosition: () => Vector; + GetWaterClipFlags: () => BitFlags; + /** Forces the grid entity to hurt the provided entity. */ HurtDamage: ( entity: Entity, damage: int, damageFlags: DamageFlag | BitFlags, - unknownNumber: number, - unknownBool: boolean, + enemyDamage: number, + ignoreGridCollision: boolean, ) => void; - // `HurtSurroundings` currently crashes the game when called. + HurtSurroundings: ( + enemyDistance: number, + playerDistance: number, + enemyDamage: number, + playerDamage: number, + damageFlags: BitFlags, + ignoreGridCollisions: boolean, + ) => void; /** Returns whether the grid entity is a breakable rock. */ IsBreakableRock: () => boolean; + + ResetWaterClipFlags: () => void; + SetWaterClipFlags: (flags: BitFlags) => void; } } 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 index 41514cbf4..84bbae9de 100644 --- 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 @@ -31,27 +31,31 @@ declare global { RenderTop: (offset: Vector) => void; + TrySpawnLadder: () => void; + TrySpawnWorms: () => void; + + /** Updates the rock's collision. */ + UpdateCollision: () => void; + + UpdateNeighbors: () => void; + } + + namespace GridEntityRock { /** + * @param position * @param gridEntityType * @param gridVariant * @param seed * @param unknown * @param backdrop Optional. Default is `BackdropType.NULL` (The current backdrop). */ - SpawnDrops: ( + function SpawnDrops( + position: Vector, gridEntityType: GridEntityType, gridVariant: int, seed: Seed, unknown: boolean, backdrop: BackdropType, - ) => void; - - TrySpawnLadder: () => void; - TrySpawnWorms: () => void; - - /** Updates the rock's collision. */ - UpdateCollision: () => void; - - UpdateNeighbors: () => void; + ): 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 778420055..c16c22947 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 @@ -14,6 +14,9 @@ declare interface HUD extends IsaacAPIClass { /** Returns the sprite object used to render the charge bar. */ GetChargeBarSprite: () => Sprite; + /** @param index Optional. Must be between 0 and 3. Default is 0. */ + GetCoopPlayerMessage: (index?: int) => HUDMessage; + /** Returns the sprite used to render the co-op player select menu. */ GetCoopMenuSprite: () => Sprite; @@ -29,6 +32,8 @@ declare interface HUD extends IsaacAPIClass { /** Returns the sprite used to render Tainted Isaac's inventory. */ GetInventorySprite: () => Sprite; + GetMainMessage: () => HUDMessage; + /** Returns the sprite used to render the pickups HUD. */ GetPickupsHUDSprite: () => Sprite; @@ -43,6 +48,9 @@ declare interface HUD extends IsaacAPIClass { /** Returns the sprite used to render Tainted Blue Baby's poop spells. */ GetPoopSpellSprite: () => Sprite; + /** @param index Optional. Must be between 0 and 5. Default is 0. */ + GetStackedMessage: () => HUDMessage; + /** * Returns the sprite used to render streak popups (e.g. Picking up items, displaying floor * names). diff --git a/packages/isaac-typescript-definitions-repentogon/src/types/classes/hud/HUDMessage.d.ts b/packages/isaac-typescript-definitions-repentogon/src/types/classes/hud/HUDMessage.d.ts new file mode 100644 index 000000000..298918fb9 --- /dev/null +++ b/packages/isaac-typescript-definitions-repentogon/src/types/classes/hud/HUDMessage.d.ts @@ -0,0 +1,22 @@ +declare interface HUDMessage extends IsaacAPIClass { + GetMainText: () => string; + GetSprite: () => Sprite; + GetSubText: () => string; + Hide: () => void; + IsShowing: () => boolean; + SetMainText: (text: string) => void; + SetSubText: (subText: string) => void; + + /** + * @param text + * @param subText Optional. Default is an empty string. + * @param sticky Optional. Default is false. + * @param curseDisplay Optional. Default is false. + */ + Show: ( + text: string, + subText?: string, + sticky?: boolean, + curseDisplay?: boolean, + ) => void; +} diff --git a/packages/isaac-typescript-definitions-repentogon/src/types/classes/hud/Minimap.d.ts b/packages/isaac-typescript-definitions-repentogon/src/types/classes/hud/Minimap.d.ts index 1e75c3852..49cb8580f 100644 --- a/packages/isaac-typescript-definitions-repentogon/src/types/classes/hud/Minimap.d.ts +++ b/packages/isaac-typescript-definitions-repentogon/src/types/classes/hud/Minimap.d.ts @@ -31,6 +31,9 @@ declare namespace Minimap { /** Returns the current state of the minimap. */ function GetState(): MinimapState; + /** Sets how many frames the minimap has been in its expanded state. */ + function SetHoldTime(holdTime: int): void; + /** Sets the duration (in frames) of the minimap's screen shake effect. */ function SetShakeDuration(duration: int): void; diff --git a/packages/isaac-typescript-definitions-repentogon/src/types/classes/hud/PlayerHUD.d.ts b/packages/isaac-typescript-definitions-repentogon/src/types/classes/hud/PlayerHUD.d.ts index 0c86e59f1..808398a79 100644 --- a/packages/isaac-typescript-definitions-repentogon/src/types/classes/hud/PlayerHUD.d.ts +++ b/packages/isaac-typescript-definitions-repentogon/src/types/classes/hud/PlayerHUD.d.ts @@ -19,6 +19,9 @@ declare global { /** Returns the `HUD`. */ GetHUD: () => HUD; + GetIndex: () => int; + GetLayout: () => int; + /** Returns the `EntityPlayer` associated with the `PlayerHUD`. */ GetPlayer: () => EntityPlayer; diff --git a/packages/isaac-typescript-definitions-repentogon/src/types/classes/procedural-items/ProceduralEffect.d.ts b/packages/isaac-typescript-definitions-repentogon/src/types/classes/procedural-items/ProceduralEffect.d.ts index fa551d812..838879bfb 100644 --- a/packages/isaac-typescript-definitions-repentogon/src/types/classes/procedural-items/ProceduralEffect.d.ts +++ b/packages/isaac-typescript-definitions-repentogon/src/types/classes/procedural-items/ProceduralEffect.d.ts @@ -40,7 +40,11 @@ declare global { */ GetConditionType: () => ProceduralEffectConditionType; + GetScore: () => number; + /** Returns the chance (between 0 and 1) for the effect to be triggered. */ GetTriggerChance: () => float; + + GetTriggerChanceScale: () => number; } } diff --git a/packages/isaac-typescript-definitions-repentogon/src/types/classes/rendering/Beam.d.ts b/packages/isaac-typescript-definitions-repentogon/src/types/classes/rendering/Beam.d.ts index c2547276e..e7bf6550a 100644 --- a/packages/isaac-typescript-definitions-repentogon/src/types/classes/rendering/Beam.d.ts +++ b/packages/isaac-typescript-definitions-repentogon/src/types/classes/rendering/Beam.d.ts @@ -33,14 +33,18 @@ declare interface RenderBeam extends IsaacAPIClass { * * @param point * @param position - * @param spritesheetCoordinate + * @param spritesheetCoordinate Optional. Default is 0. * @param width Optional. Default is 1. + * @param color Optional. Default is `ColorDefault`. + * @param worldSpace Optional. Default is false. */ Add: ((point: Point) => void) & (( position: Vector, - spritesheetCoordinate: number, + spritesheetCoordinate?: number, width?: number, + color?: Color, + worldSpace?: boolean, ) => void); /** Returns the layer of the beam. */ @@ -52,6 +56,12 @@ declare interface RenderBeam extends IsaacAPIClass { /** Returns the beam's sprite. */ GetSprite: () => Sprite; + /** + * Returns the unknown boolean set from the beam's constructor. The exact behavior of this boolean + * is unknown. + */ + GetUnkBool: () => boolean; + /** Returns whether the beam is an overlay. */ GetUseOverlay: () => boolean; @@ -76,6 +86,12 @@ declare interface RenderBeam extends IsaacAPIClass { useOverlay: boolean, ) => void); + /** + * Sets the unknown boolean used in the beam's constructor. The exact behavior of this boolean is + * unknown. + */ + SetUnkBool: (bool: boolean) => void; + /** Sets whether the beam is an overlay. */ SetUseOverlay: (useOverlay: boolean) => void; } diff --git a/packages/isaac-typescript-definitions-repentogon/src/types/classes/rendering/BlendMode.d.ts b/packages/isaac-typescript-definitions-repentogon/src/types/classes/rendering/BlendMode.d.ts index cbe3d6f6e..8aa8ad6c1 100644 --- a/packages/isaac-typescript-definitions-repentogon/src/types/classes/rendering/BlendMode.d.ts +++ b/packages/isaac-typescript-definitions-repentogon/src/types/classes/rendering/BlendMode.d.ts @@ -1,5 +1,5 @@ +import type { BlendEquation } from "../../../enums/BlendEquation"; import type { BlendFactor } from "../../../enums/BlendFactor"; -import type { BlendType } from "../../../enums/BlendType"; declare global { /** @@ -8,10 +8,25 @@ declare global { * @see https://repentogon.com/ */ interface BlendMode extends IsaacAPIClass { - SetMode: (blendType: BlendType) => void; + /** + * @param rgbSrc Optional. Default is its current value. + * @param rgbDst Optional. Default is its current value. + * @param alphaSrc Optional. Default is its current value. + * @param alphaDst Optional. Default is its current value. + * @param equation Optional. Default is its current value. + */ + SetMode: ((blendMode: BlendMode) => void) + & (( + rgbSrc?: int, + rgbDst?: int, + alphaSrc?: int, + alphaDst?: int, + equation?: BlendEquation, + ) => void); AlphaDestinationFactor: BlendFactor; AlphaSourceFactor: BlendFactor; + Equation: BlendEquation; RGBDestinationFactor: BlendFactor; RGBSourceFactor: BlendFactor; } diff --git a/packages/isaac-typescript-definitions-repentogon/src/types/classes/room-config/RoomConfig.d.ts b/packages/isaac-typescript-definitions-repentogon/src/types/classes/room-config/RoomConfig.d.ts index 182630abe..9019d3c31 100644 --- a/packages/isaac-typescript-definitions-repentogon/src/types/classes/room-config/RoomConfig.d.ts +++ b/packages/isaac-typescript-definitions-repentogon/src/types/classes/room-config/RoomConfig.d.ts @@ -1,12 +1,99 @@ -import type { StageID } from "isaac-typescript-definitions"; +import type { + DoorSlot, + DoorSlotFlag, + RoomShape, + RoomType, + StageID, +} from "isaac-typescript-definitions"; +import type { GameMode } from "../../../enums/GameMode"; declare global { + interface LuaRoomSpawnEntryREPENTOGON { + TYPE: int; + VARIANT?: int; + SUBTYPE?: int; + WEIGHT?: number; + } + + interface LuaRoomDoorREPENTOGON { + ISDOOR: true; // cspell:ignore ISDOOR + EXISTS: boolean; + SLOT?: DoorSlot; + GRIDX?: int; // cspell:ignore GRIDX + GRIDY?: int; // cspell:ignore GRIDY + } + + interface LuaRoomSpawnREPENTOGON { + GRIDX: int; // cspell:ignore GRIDX + GRIDY: int; // cspell:ignore GRIDY + [index: int]: LuaRoomSpawnEntryREPENTOGON; + } + + interface LuaRoomREPENTOGON { + TYPE: RoomType; + VARIANT: int; + NAME: string; + SHAPE: RoomShape; + SUBTYPE?: int; + DIFFICULTY?: int; + WEIGHT?: number; + [index: int]: LuaRoomDoorREPENTOGON | LuaRoomSpawnREPENTOGON; + } + interface RoomConfig extends IsaacAPIClass { Mode: int; } /** @noSelf */ namespace RoomConfig { + function AddRooms( + stbType: StageID, + gameMode: GameMode | -1, + rooms: readonly LuaRoomREPENTOGON[], + ): Array; + + /** + * @param seed + * @param reduceWeight + * @param stage + * @param roomType + * @param shape Optional. If undefined, any RoomShape can be chosen. + * @param minVariant Optional. Default is 0. + * @param maxVariant Optional. Default is -1. + * @param minDifficulty Optional. Default is 0. + * @param maxDifficulty Optional. Default is 10. + * @param doors Optional. Default allows for any DoorSlots. + * @param subType Optional. Default is -1. + * @param gameMode Optional. Default allows any room regardless of the game mode to be chosen. + */ + function GetRandomRoom( + seed: Seed, + reduceWeight: boolean, + stage: StageID, + roomType: RoomType, + shape?: RoomShape, + minVariant?: int, + maxVariant?: int, + minDifficulty?: int, + maxDifficulty?: int, + doors?: BitFlags, + subType?: int, + gameMode?: GameMode, + ): RoomConfig; + + /** + * @param stage + * @param roomType + * @param variant + * @param gameMode Optional. Default allows any room regardless of the game mode to be chosen. + */ + function GetRoomByStageTypeAndVariant( + stage: StageID, + roomType: RoomType, + variant: int, + gameMode?: GameMode, + ): RoomConfig | undefined; + function GetStage(stbType: StageID): RoomConfigStage; } } diff --git a/packages/isaac-typescript-definitions-repentogon/src/types/classes/room-config/RoomConfigSet.d.ts b/packages/isaac-typescript-definitions-repentogon/src/types/classes/room-config/RoomConfigSet.d.ts index ac949ae41..ffa8daa28 100644 --- a/packages/isaac-typescript-definitions-repentogon/src/types/classes/room-config/RoomConfigSet.d.ts +++ b/packages/isaac-typescript-definitions-repentogon/src/types/classes/room-config/RoomConfigSet.d.ts @@ -4,6 +4,12 @@ * @see https://repentogon.com/ */ declare interface RoomConfigSet extends IsaacAPIClass { + /** + * Adds REPENTOGON LuaRooms to the `RoomConfigSet`. Returns a `RoomConfig` array of the newly + * created rooms. + */ + AddRooms: (rooms: readonly LuaRoomREPENTOGON[]) => RoomConfig[]; + /** * Returns a `RoomConfig` at the provided index. Returns undefined if no `RoomConfig` was found. */ diff --git a/packages/isaac-typescript-definitions-repentogon/src/types/classes/room-config/RoomConfigStage.d.ts b/packages/isaac-typescript-definitions-repentogon/src/types/classes/room-config/RoomConfigStage.d.ts index c62a696e4..c4b53db83 100644 --- a/packages/isaac-typescript-definitions-repentogon/src/types/classes/room-config/RoomConfigStage.d.ts +++ b/packages/isaac-typescript-definitions-repentogon/src/types/classes/room-config/RoomConfigStage.d.ts @@ -1,4 +1,8 @@ -import type { BackdropType, Music } from "isaac-typescript-definitions"; +import type { + BackdropType, + Music, + StageID, +} from "isaac-typescript-definitions"; import type { GameMode } from "../../../enums/GameMode"; declare global { @@ -17,6 +21,9 @@ declare global { /** Returns the stage's name. */ GetDisplayName: () => string; + /** Returns the stage's `StageID`. */ + GetID: () => StageID; + /** Returns the music that is played in default rooms. */ GetMusic: () => Music; @@ -31,6 +38,12 @@ declare global { /** Returns the suffix used by the stage for stage-unique sprites. */ GetSuffix: () => string; + /** Returns the name of the stage's rooms XML file. */ + GetXMLName: () => string; + + /** Returns whether the `RoomConfigSet` of the provided `GameMode` has loaded. */ + IsLoaded: (gameMode: GameMode) => boolean; + /** Sets the backdrop used in default rooms. */ SetBackdrop: (backdrop: BackdropType) => void; @@ -48,5 +61,8 @@ declare global { /** Sets the suffix used by the stage for stage-unique sprites. */ SetSuffix: (suffix: string) => void; + + /** Sets the name of the stage's rooms XML file. */ + SetXMLName: (name: string) => void; } } diff --git a/packages/isaac-typescript-definitions-repentogon/src/types/classes/room-config/RoomDescriptor.d.ts b/packages/isaac-typescript-definitions-repentogon/src/types/classes/room-config/RoomDescriptor.d.ts index c4aa768a8..f086e9e0a 100644 --- a/packages/isaac-typescript-definitions-repentogon/src/types/classes/room-config/RoomDescriptor.d.ts +++ b/packages/isaac-typescript-definitions-repentogon/src/types/classes/room-config/RoomDescriptor.d.ts @@ -8,6 +8,9 @@ declare global { interface RoomDescriptor extends IsaacAPIClass { AddRestrictedGridIndex: (gridIndex: int) => void; + /** Returns the `EntitiesSaveStateVector` of the room's decorations. */ + GetDecoSaveState: () => EntitiesSaveStateVector; + /** Returns the dimension that the room is in. */ GetDimension: () => Dimension; @@ -34,5 +37,7 @@ declare global { * doesn't allow a door in that slot. */ readonly Doors: LuaTable; + + readonly BossDeathSeed: Seed; } } diff --git a/packages/isaac-typescript-definitions-repentogon/src/types/classes/sprite/AnimationFrame.d.ts b/packages/isaac-typescript-definitions-repentogon/src/types/classes/sprite/AnimationFrame.d.ts index 5785fcad1..0d90628c1 100644 --- a/packages/isaac-typescript-definitions-repentogon/src/types/classes/sprite/AnimationFrame.d.ts +++ b/packages/isaac-typescript-definitions-repentogon/src/types/classes/sprite/AnimationFrame.d.ts @@ -10,6 +10,9 @@ declare interface AnimationFrame extends IsaacAPIClass { /** Returns the frame's crop. */ GetCrop: () => Readonly; + /** Returns the final frame of the animation. */ + GetEndFrame: () => int; + /** Returns the frame's height. */ GetHeight: () => number; diff --git a/packages/isaac-typescript-definitions-repentogon/src/types/classes/sprite/Sprite.d.ts b/packages/isaac-typescript-definitions-repentogon/src/types/classes/sprite/Sprite.d.ts index 8e145f7d8..4983bf8bc 100644 --- a/packages/isaac-typescript-definitions-repentogon/src/types/classes/sprite/Sprite.d.ts +++ b/packages/isaac-typescript-definitions-repentogon/src/types/classes/sprite/Sprite.d.ts @@ -43,8 +43,14 @@ declare global { */ GetAllAnimationData: () => AnimationData[]; - /** Returns the current animation data. */ - GetCurrentAnimationData: () => AnimationData; + /** + * Returns the animation data from the provided animation name. Returns undefined if the + * animation does not exist. + */ + GetAnimationData: (animationName: string) => AnimationData | undefined; + + /** Returns the current animation data. Returns undefined if no animation is playing. */ + GetCurrentAnimationData: () => AnimationData | undefined; /** Returns the layer data from the specified layer id. Returns undefined if none were found. */ GetLayer: (layerIdOrName: string | int) => LayerState | undefined; @@ -97,7 +103,8 @@ declare global { * Repentogon's modified `Sprite.ReplaceSpritesheet` method. * * Behaves the same as `Sprite.ReplaceSpritesheet` except specify an additional parameter that - * forces the sprite to immediately load its graphics after replacing the spritesheet. + * forces the sprite to immediately load its graphics after replacing the spritesheet. It also + * returns a boolean whether the sprite has been loaded successfully. * * 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 @@ -112,7 +119,7 @@ declare global { layerID: int, pngFileName: string, loadGraphics?: boolean, - ) => void; + ) => boolean; /** * Overrides the `coloroffset_champion` shader the sprite uses with a custom one. This shader is 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 d09920455..d37a32420 100644 --- a/packages/isaac-typescript-definitions-repentogon/src/types/index.d.ts +++ b/packages/isaac-typescript-definitions-repentogon/src/types/index.d.ts @@ -35,6 +35,7 @@ /// /// /// +/// /// /// /// @@ -99,6 +100,7 @@ /// /// /// +/// /// /// /// diff --git a/packages/isaac-typescript-definitions-repentogon/src/types/unofficial/BossPoolEntry.d.ts b/packages/isaac-typescript-definitions-repentogon/src/types/unofficial/BossPoolEntry.d.ts index 3ce1bd929..958ecf0ad 100644 --- a/packages/isaac-typescript-definitions-repentogon/src/types/unofficial/BossPoolEntry.d.ts +++ b/packages/isaac-typescript-definitions-repentogon/src/types/unofficial/BossPoolEntry.d.ts @@ -9,7 +9,8 @@ declare global { */ interface BossPoolEntry { achievementID: Achievement; - bossId: BossID; + bossID: BossID; + initialWeight: float; weight: float; weightAlt: float; }