isaacscript-common 13.0.0 → 13.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +105 -26
- package/dist/isaacscript-common.lua +615 -168
- package/dist/src/features/customStage/backdrop.lua +4 -4
- package/dist/src/features/customStage/versusScreen.lua +2 -2
- package/dist/src/features/deployJSONRoom.d.ts +0 -11
- package/dist/src/features/deployJSONRoom.d.ts.map +1 -1
- package/dist/src/features/deployJSONRoom.lua +10 -74
- package/dist/src/features/extraConsoleCommands/listCommands.lua +2 -2
- package/dist/src/features/firstLast.lua +8 -8
- package/dist/src/features/setHotkey.d.ts +27 -8
- package/dist/src/features/setHotkey.d.ts.map +1 -1
- package/dist/src/features/setHotkey.lua +41 -30
- package/dist/src/functions/array.lua +2 -2
- package/dist/src/functions/cards.lua +2 -2
- package/dist/src/functions/collectibles.lua +2 -2
- package/dist/src/functions/dimensions.lua +2 -2
- package/dist/src/functions/emptyRoom.d.ts +8 -0
- package/dist/src/functions/emptyRoom.d.ts.map +1 -0
- package/dist/src/functions/emptyRoom.lua +74 -0
- package/dist/src/functions/enums.d.ts.map +1 -1
- package/dist/src/functions/enums.lua +3 -3
- package/dist/src/functions/gridEntities.lua +2 -2
- package/dist/src/functions/gridIndex.d.ts +10 -0
- package/dist/src/functions/gridIndex.d.ts.map +1 -0
- package/dist/src/functions/gridIndex.lua +32 -0
- package/dist/src/functions/log.d.ts.map +1 -1
- package/dist/src/functions/log.lua +9 -8
- package/dist/src/functions/logEntities.d.ts.map +1 -1
- package/dist/src/functions/logEntities.lua +17 -9
- package/dist/src/functions/pills.lua +4 -4
- package/dist/src/functions/roomShape.d.ts +6 -1
- package/dist/src/functions/roomShape.d.ts.map +1 -1
- package/dist/src/functions/roomShape.lua +3 -0
- package/dist/src/functions/roomShapeWalls.d.ts +20 -0
- package/dist/src/functions/roomShapeWalls.d.ts.map +1 -0
- package/dist/src/functions/roomShapeWalls.lua +285 -0
- package/dist/src/functions/rooms.d.ts +7 -0
- package/dist/src/functions/rooms.d.ts.map +1 -1
- package/dist/src/functions/rooms.lua +16 -5
- package/dist/src/functions/set.d.ts +7 -0
- package/dist/src/functions/set.d.ts.map +1 -1
- package/dist/src/functions/set.lua +10 -0
- package/dist/src/functions/sprites.lua +2 -2
- package/dist/src/functions/trinkets.lua +2 -2
- package/dist/src/functions/utils.d.ts +18 -12
- package/dist/src/functions/utils.d.ts.map +1 -1
- package/dist/src/functions/utils.lua +26 -14
- package/dist/src/index.d.ts +3 -0
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.lua +24 -0
- package/dist/src/interfaces/Corner.d.ts +8 -0
- package/dist/src/interfaces/Corner.d.ts.map +1 -1
- package/dist/src/objects/roomShapeCorners.d.ts +6 -1
- package/dist/src/objects/roomShapeCorners.d.ts.map +1 -1
- package/dist/src/objects/roomShapeCorners.lua +71 -14
- package/package.json +2 -2
- package/src/features/customStage/backdrop.ts +3 -3
- package/src/features/customStage/versusScreen.ts +2 -2
- package/src/features/deployJSONRoom.ts +8 -98
- package/src/features/extraConsoleCommands/listCommands.ts +2 -2
- package/src/features/firstLast.ts +8 -8
- package/src/features/setHotkey.ts +60 -40
- package/src/functions/array.ts +2 -2
- package/src/functions/cards.ts +2 -2
- package/src/functions/collectibles.ts +2 -2
- package/src/functions/dimensions.ts +2 -2
- package/src/functions/emptyRoom.ts +85 -0
- package/src/functions/enums.ts +4 -3
- package/src/functions/gridEntities.ts +2 -2
- package/src/functions/gridIndex.ts +40 -0
- package/src/functions/log.ts +9 -10
- package/src/functions/logEntities.ts +25 -9
- package/src/functions/pills.ts +4 -4
- package/src/functions/roomShape.ts +6 -1
- package/src/functions/roomShapeWalls.ts +359 -0
- package/src/functions/rooms.ts +22 -3
- package/src/functions/set.ts +12 -0
- package/src/functions/sprites.ts +2 -2
- package/src/functions/trinkets.ts +2 -2
- package/src/functions/utils.ts +20 -14
- package/src/index.ts +3 -0
- package/src/interfaces/Corner.ts +9 -0
- package/src/objects/roomShapeCorners.ts +74 -16
package/dist/index.d.ts
CHANGED
|
@@ -967,6 +967,13 @@ export declare function copyVector(vector: Vector): Vector;
|
|
|
967
967
|
*/
|
|
968
968
|
export declare interface Corner {
|
|
969
969
|
readonly type: CornerType;
|
|
970
|
+
/** The grid index of the corresponding wall tile. */
|
|
971
|
+
readonly gridIndex: int;
|
|
972
|
+
/**
|
|
973
|
+
* The position is not the same as the center of the corresponding grid index. Rather, it is the
|
|
974
|
+
* exact position of the corner, which will be offset from the grid index position by half of a
|
|
975
|
+
* grid tile.
|
|
976
|
+
*/
|
|
970
977
|
readonly position: Readonly<Vector>;
|
|
971
978
|
}
|
|
972
979
|
|
|
@@ -2051,12 +2058,8 @@ export declare function emptyArray<T>(array: T[]): void;
|
|
|
2051
2058
|
* this will not remove players (1), tears (2), familiars (3), lasers (7), knives (8), projectiles
|
|
2052
2059
|
* (9), blacklisted NPCs such as Dark Esau, charmed NPCs, friendly NPCs, persistent NPCs, most
|
|
2053
2060
|
* effects (1000), doors, and walls.
|
|
2054
|
-
*
|
|
2055
|
-
* @param fillWithDecorations Optional. Set to true to fill every grid tile with an invisible
|
|
2056
|
-
* decoration, which prevents vanilla entities in the room from
|
|
2057
|
-
* respawning the next time that the player enters. Default is false.
|
|
2058
2061
|
*/
|
|
2059
|
-
export declare function emptyRoom(
|
|
2062
|
+
export declare function emptyRoom(): void;
|
|
2060
2063
|
|
|
2061
2064
|
/**
|
|
2062
2065
|
* Helper function to enable all inputs. Use this function to set things back to normal after having
|
|
@@ -2126,15 +2129,18 @@ export declare function enableExtraConsoleCommands(mod: ModUpgraded): void;
|
|
|
2126
2129
|
export declare function enableFastReset(): void;
|
|
2127
2130
|
|
|
2128
2131
|
/**
|
|
2129
|
-
* Helper function to return an array with the
|
|
2130
|
-
*
|
|
2132
|
+
* Helper function to return an array of integers with the specified range, inclusive on the lower
|
|
2133
|
+
* end and exclusive on the high end. (The "e" stands for exclusive.)
|
|
2131
2134
|
*
|
|
2132
|
-
*
|
|
2135
|
+
* - For example, `eRange(1, 3)` will return `[1, 2]`.
|
|
2136
|
+
* - For example, `eRange(2)` will return `[0, 1]`.
|
|
2133
2137
|
*
|
|
2134
|
-
*
|
|
2135
|
-
*
|
|
2138
|
+
* @param start The number to start at.
|
|
2139
|
+
* @param end Optional. The number to end at. If not specified, then the start will be 0 and the
|
|
2140
|
+
* first argument will be the end.
|
|
2141
|
+
* @param increment Optional. The increment to use. Default is 1.
|
|
2136
2142
|
*/
|
|
2137
|
-
export declare function
|
|
2143
|
+
export declare function eRange(start: int, end?: int, increment?: number): int[];
|
|
2138
2144
|
|
|
2139
2145
|
declare type ErrorCustomClassNotSerializable = "Error: Custom classes with one or more methods are not serializable when inside of an array, map, or set. For more information, see: https://isaacscript.github.io/main/gotchas#custom-classes-are-not-serializable";
|
|
2140
2146
|
|
|
@@ -3400,6 +3406,15 @@ export declare function getGridEntityIDFromConstituents(gridEntityType: GridEnti
|
|
|
3400
3406
|
*/
|
|
3401
3407
|
export declare function getGridIndexDelta(roomShape: RoomShape, doorSlot: DoorSlot): int | undefined;
|
|
3402
3408
|
|
|
3409
|
+
/**
|
|
3410
|
+
* Helper function to get all of the grid indexes between two grid indexes on either a horizontal or
|
|
3411
|
+
* vertical line, inclusive on both ends.
|
|
3412
|
+
*
|
|
3413
|
+
* This function will throw a run-time error if the two provided grid indexes are not on the same
|
|
3414
|
+
* horizontal or vertical line.
|
|
3415
|
+
*/
|
|
3416
|
+
export declare function getGridIndexesBetween(gridIndex1: int, gridIndex2: int, roomShape: RoomShape): int[];
|
|
3417
|
+
|
|
3403
3418
|
/**
|
|
3404
3419
|
* Returns how many hearts are in the heart UI row. If the player has more than 6 hearts, this
|
|
3405
3420
|
* function will return 6.
|
|
@@ -4883,7 +4898,12 @@ export declare function getRoomShapeBounds(roomShape: RoomShape): readonly [widt
|
|
|
4883
4898
|
*/
|
|
4884
4899
|
export declare function getRoomShapeCharges(roomShape: RoomShape): int;
|
|
4885
4900
|
|
|
4886
|
-
/**
|
|
4901
|
+
/**
|
|
4902
|
+
* Helper function to get the corners that exist in the given room shape.
|
|
4903
|
+
*
|
|
4904
|
+
* Note that these corner locations are not accurate for the Mother Boss Room and the Home closet
|
|
4905
|
+
* rooms. (Those rooms have custom shapes.)
|
|
4906
|
+
*/
|
|
4887
4907
|
export declare function getRoomShapeCorners(roomShape: RoomShape): readonly Corner[];
|
|
4888
4908
|
|
|
4889
4909
|
/**
|
|
@@ -5640,6 +5660,14 @@ export declare function inDoubleTrouble(): boolean;
|
|
|
5640
5660
|
|
|
5641
5661
|
export declare function inGenesisRoom(): boolean;
|
|
5642
5662
|
|
|
5663
|
+
/**
|
|
5664
|
+
* Helper function to check if the current room is either the left Home closet (behind the red door)
|
|
5665
|
+
* or the right Home closet (with one random pickup).
|
|
5666
|
+
*
|
|
5667
|
+
* Home closets have a unique shape that is different from any other room in the game.
|
|
5668
|
+
*/
|
|
5669
|
+
export declare function inHomeCloset(): boolean;
|
|
5670
|
+
|
|
5643
5671
|
/**
|
|
5644
5672
|
* Initializes an array with all of the elements containing the specified default value.
|
|
5645
5673
|
*
|
|
@@ -5740,15 +5768,18 @@ export declare function inSecretShop(): boolean;
|
|
|
5740
5768
|
export declare function inStartingRoom(): boolean;
|
|
5741
5769
|
|
|
5742
5770
|
/**
|
|
5743
|
-
* Helper function to return an array with the
|
|
5744
|
-
* stands for inclusive.)
|
|
5771
|
+
* Helper function to return an array of integers with the specified range, inclusive on both ends.
|
|
5772
|
+
* (The "i" stands for inclusive.)
|
|
5745
5773
|
*
|
|
5746
|
-
*
|
|
5774
|
+
* - For example, `iRange(1, 3)` will return `[1, 2, 3]`.
|
|
5775
|
+
* - For example, `iRange(2)` will return `[0, 1, 2]`.
|
|
5747
5776
|
*
|
|
5748
|
-
*
|
|
5749
|
-
*
|
|
5777
|
+
* @param start The number to start at.
|
|
5778
|
+
* @param end Optional. The number to end at. If not specified, then the start will be 0 and the
|
|
5779
|
+
* first argument will be the end.
|
|
5780
|
+
* @param increment Optional. The increment to use. Default is 1.
|
|
5750
5781
|
*/
|
|
5751
|
-
export declare function
|
|
5782
|
+
export declare function iRange(start: int, end?: int, increment?: number): int[];
|
|
5752
5783
|
|
|
5753
5784
|
/**
|
|
5754
5785
|
* Helper function to check if an instantiated Isaac API class is equal to another one of the same
|
|
@@ -6597,6 +6628,25 @@ export declare function isVanillaTrinketType(trinketType: TrinketType): boolean;
|
|
|
6597
6628
|
*/
|
|
6598
6629
|
export declare function isVanillaTSTLClass(object: unknown): boolean;
|
|
6599
6630
|
|
|
6631
|
+
/**
|
|
6632
|
+
* Helper function to determine if a given wall is a "real" wall generated by the vanilla game. This
|
|
6633
|
+
* is useful because mods can use custom spawned walls as a stand-in for custom grid entities.
|
|
6634
|
+
*
|
|
6635
|
+
* This function checks for identity via a combination of `StageAPI.IsCustomGrid` and the
|
|
6636
|
+
* `isVanillaWallGridIndex` function.
|
|
6637
|
+
*/
|
|
6638
|
+
export declare function isVanillaWall(gridEntity: GridEntity): boolean;
|
|
6639
|
+
|
|
6640
|
+
/**
|
|
6641
|
+
* Helper function to determine if a given grid index should have a wall generated by the vanilla
|
|
6642
|
+
* game. This is useful as a mechanism to distinguish between real walls and custom walls spawned by
|
|
6643
|
+
* mods.
|
|
6644
|
+
*
|
|
6645
|
+
* This function properly handles the special cases of the Mother boss room and the Home closet
|
|
6646
|
+
* rooms, which are both non-standard room shapes.
|
|
6647
|
+
*/
|
|
6648
|
+
export declare function isVanillaWallGridIndex(gridIndex: int): boolean;
|
|
6649
|
+
|
|
6600
6650
|
/** Helper function to check if something is an instantiated `Vector` object. */
|
|
6601
6651
|
export declare function isVector(object: unknown): object is Vector;
|
|
6602
6652
|
|
|
@@ -10655,6 +10705,14 @@ export declare function serializeVector(vector: Vector): SerializedVector;
|
|
|
10655
10705
|
*/
|
|
10656
10706
|
export declare function setActiveItem(player: EntityPlayer, collectibleType: CollectibleType, activeSlot: ActiveSlot, charge?: int, keepInPools?: boolean): void;
|
|
10657
10707
|
|
|
10708
|
+
/**
|
|
10709
|
+
* Helper function to add one or more elements to a set at once without having to repeatedly call
|
|
10710
|
+
* the `Set.add` method.
|
|
10711
|
+
*
|
|
10712
|
+
* This function is variadic, meaning that you can pass as many things as you want to add.
|
|
10713
|
+
*/
|
|
10714
|
+
export declare function setAdd<T>(set: Set<T>, ...elements: T[]): void;
|
|
10715
|
+
|
|
10658
10716
|
/**
|
|
10659
10717
|
* Helper function to make using sets with an type of `PlayerIndex` easier. Use this instead of the
|
|
10660
10718
|
* `Set.add` method if you have a set of this type.
|
|
@@ -10744,6 +10802,22 @@ export declare function setCollectiblesRerolledForItemTracker(): void;
|
|
|
10744
10802
|
*/
|
|
10745
10803
|
export declare function setCollectibleSubType(collectible: EntityPickup, newCollectibleType: CollectibleType): void;
|
|
10746
10804
|
|
|
10805
|
+
/**
|
|
10806
|
+
* Helper function to run arbitrary code when you press and release a specific keyboard key.
|
|
10807
|
+
*
|
|
10808
|
+
* This can be used to easily set up custom hotkeys to facilitate custom game features or to assist
|
|
10809
|
+
* in debugging.
|
|
10810
|
+
*
|
|
10811
|
+
* This is different from the `setHotkey` function in that the keyboard activation key is not
|
|
10812
|
+
* hardcoded and is instead the return value of a provided function. This is useful for situations
|
|
10813
|
+
* where the key can change (like if end-users can specify a custom hotkey using Mod Config Menu).
|
|
10814
|
+
*
|
|
10815
|
+
* @param getKeyFunc The function that returns the key that will trigger the hotkey.
|
|
10816
|
+
* @param triggerFunc A function containing the arbitrary code that you want to execute when the
|
|
10817
|
+
* hotkey is triggered.
|
|
10818
|
+
*/
|
|
10819
|
+
export declare function setConditionalHotkey(getKeyFunc: () => Keyboard | undefined, triggerFunc: () => void): void;
|
|
10820
|
+
|
|
10747
10821
|
/**
|
|
10748
10822
|
* Helper function to warp to a custom stage/level.
|
|
10749
10823
|
*
|
|
@@ -10877,15 +10951,11 @@ export declare function setHasPlayer(set: Set<PlayerIndex>, player: EntityPlayer
|
|
|
10877
10951
|
* This can be used to easily set up custom hotkeys to facilitate custom game features or to assist
|
|
10878
10952
|
* in debugging.
|
|
10879
10953
|
*
|
|
10880
|
-
* @param
|
|
10881
|
-
* returns the key that will trigger the hotkey. Normally, you would just
|
|
10882
|
-
* specify the key directly, but you can use a function for situations where
|
|
10883
|
-
* the key can change (like if end-users can specify a custom hotkey using Mod
|
|
10884
|
-
* Config Menu).
|
|
10954
|
+
* @param keyboard The key that you want to trigger the hotkey.
|
|
10885
10955
|
* @param triggerFunc A function containing the arbitrary code that you want to execute when the
|
|
10886
10956
|
* hotkey is triggered.
|
|
10887
10957
|
*/
|
|
10888
|
-
export declare function setHotkey(
|
|
10958
|
+
export declare function setHotkey(keyboard: Keyboard, triggerFunc: () => void): void;
|
|
10889
10959
|
|
|
10890
10960
|
/**
|
|
10891
10961
|
* Supply a function to be repeatedly run on an interval of N game frames in the `POST_UPDATE`
|
|
@@ -12122,12 +12192,21 @@ export declare const UI_HEART_WIDTH = 12;
|
|
|
12122
12192
|
/** Helper function to put things back to normal after the `pause` function was used. */
|
|
12123
12193
|
export declare function unpause(): void;
|
|
12124
12194
|
|
|
12195
|
+
/**
|
|
12196
|
+
* Helper function to remove a hotkey created with the `setConditionalHotkey` function.
|
|
12197
|
+
*
|
|
12198
|
+
* @param getKeyFunc Equal to the `getKeyFunc` that you passed when initially registering the
|
|
12199
|
+
* hotkey.
|
|
12200
|
+
*/
|
|
12201
|
+
export declare function unsetConditionalHotkey(getKeyFunc: () => Keyboard | undefined): void;
|
|
12202
|
+
|
|
12125
12203
|
/**
|
|
12126
12204
|
* Helper function to remove a hotkey created with the `setHotkey` function.
|
|
12127
12205
|
*
|
|
12128
|
-
* @param
|
|
12206
|
+
* @param keyboard Equal to the keyboard value that you passed when initially registering the
|
|
12207
|
+
* hotkey.
|
|
12129
12208
|
*/
|
|
12130
|
-
export declare function unsetHotkey(
|
|
12209
|
+
export declare function unsetHotkey(keyboard: Keyboard): void;
|
|
12131
12210
|
|
|
12132
12211
|
/**
|
|
12133
12212
|
* Use this function to enable the custom callbacks and other optional features provided by
|