Skip to content

Commit

Permalink
Documentation Revision #2 (#122)
Browse files Browse the repository at this point in the history
* docs: EntityPickup

* docs: EntityProjectile

* docs: EntitySlot

* docs: EntityTear

* docs: EntityConfigEntity

* docs: EntityConfig

* docs: FXParams

* docs: Game

* docs: GenericPrompt

* docs: GridEntity

* docs: GridEntityDoor

* docs: GridEntityRock

* docs: HUD

* docs: PlayerHUDHeart

* docs: ImGui

* docs: Isaac

* docs: ItemConfig

* feat: ItemConfigCard class

* docs: ItemConfigItem

* docs: ItemOverlay

* Update EntityTear.d.ts

* fix: lint

* Update GridEntityRock.d.ts

* Update SlotState.ts

* Update EntitySlot.d.ts

* Update GridEntityRock.d.ts

---------

Co-authored-by: James <5511220+Zamiell@users.noreply.github.com>
  • Loading branch information
Syntax-Sculptor and Zamiell authored Oct 18, 2024
1 parent 61d9bb1 commit 57abd2c
Show file tree
Hide file tree
Showing 26 changed files with 456 additions and 143 deletions.
Original file line number Diff line number Diff line change
@@ -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,
}
Original file line number Diff line number Diff line change
@@ -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",
}
Original file line number Diff line number Diff line change
@@ -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,
}
3 changes: 3 additions & 0 deletions packages/isaac-typescript-definitions-repentogon/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
export * from "./enums/Achievement";
export * from "./enums/AltRockType";
export * from "./enums/AutocompleteType";
export * from "./enums/BagOfCraftingPickup";
export * from "./enums/BlendFactor";
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";
Expand Down Expand Up @@ -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";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
}
Original file line number Diff line number Diff line change
Expand Up @@ -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<DebugFlag>) => void;

/** Enables one or more debug flags. */
AddDebugFlags: (flags: BitFlag | BitFlags<DebugFlag>) => 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<DebugFlag>;
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.
Expand All @@ -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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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/
Expand All @@ -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;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ declare global {
function AddCallback(
elementID: string,
callbackType: ImGuiCallback,
callbackFunction: () => void,
callbackFunction: (clickCount: int) => void,
): void;

/**
Expand Down
Loading

0 comments on commit 57abd2c

Please sign in to comment.