isaacscript-common 9.10.0 → 9.12.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.
Files changed (45) hide show
  1. package/dist/features/customGridEntity.d.ts +36 -0
  2. package/dist/features/customGridEntity.d.ts.map +1 -1
  3. package/dist/features/customGridEntity.lua +36 -0
  4. package/dist/features/extraConsoleCommands/listCommands.d.ts +2 -4
  5. package/dist/features/extraConsoleCommands/listCommands.d.ts.map +1 -1
  6. package/dist/features/extraConsoleCommands/listCommands.lua +15 -17
  7. package/dist/features/saveDataManager/exports.d.ts +2 -2
  8. package/dist/features/saveDataManager/exports.lua +2 -2
  9. package/dist/functions/array.d.ts +0 -2
  10. package/dist/functions/array.d.ts.map +1 -1
  11. package/dist/functions/array.lua +0 -13
  12. package/dist/functions/benchmark.d.ts +6 -1
  13. package/dist/functions/benchmark.d.ts.map +1 -1
  14. package/dist/functions/benchmark.lua +6 -1
  15. package/dist/functions/collectibles.d.ts +5 -0
  16. package/dist/functions/collectibles.d.ts.map +1 -1
  17. package/dist/functions/collectibles.lua +5 -0
  18. package/dist/functions/deepCopy.d.ts +5 -2
  19. package/dist/functions/deepCopy.d.ts.map +1 -1
  20. package/dist/functions/deepCopy.lua +5 -2
  21. package/dist/functions/entities.d.ts +2 -3
  22. package/dist/functions/entities.d.ts.map +1 -1
  23. package/dist/functions/entities.lua +2 -3
  24. package/dist/functions/gridEntities.d.ts +2 -2
  25. package/dist/functions/gridEntities.d.ts.map +1 -1
  26. package/dist/functions/gridEntities.lua +2 -2
  27. package/dist/functions/initArray.d.ts +18 -0
  28. package/dist/functions/initArray.d.ts.map +1 -0
  29. package/dist/functions/initArray.lua +37 -0
  30. package/dist/functions/input.d.ts +9 -1
  31. package/dist/functions/input.d.ts.map +1 -1
  32. package/dist/functions/input.lua +7 -1
  33. package/dist/index.d.ts +67 -14
  34. package/package.json +2 -2
  35. package/src/features/customGridEntity.ts +36 -0
  36. package/src/features/extraConsoleCommands/listCommands.ts +6 -10
  37. package/src/features/saveDataManager/exports.ts +2 -2
  38. package/src/functions/array.ts +1 -11
  39. package/src/functions/benchmark.ts +6 -1
  40. package/src/functions/collectibles.ts +5 -0
  41. package/src/functions/deepCopy.ts +5 -2
  42. package/src/functions/entities.ts +2 -3
  43. package/src/functions/gridEntities.ts +2 -2
  44. package/src/functions/initArray.ts +32 -0
  45. package/src/functions/input.ts +9 -1
@@ -18,6 +18,42 @@ import { GridEntityCustomData } from "../interfaces/GridEntityCustomData";
18
18
  * Custom grid entities are an IsaacScript feature because the vanilla game does not support any
19
19
  * custom grid entities.
20
20
  *
21
+ * For example, this would be code to create a custom rock called a "Silver Rock" that produces a
22
+ * dime when destroyed:
23
+ *
24
+ * ```ts
25
+ * // This is local to the mod and can safely overlap with the values of `GridEntityType`.
26
+ * const GridEntityTypeCustom = {
27
+ * SILVER_ROCK: 0 as GridEntityType,
28
+ * } as const;
29
+ *
30
+ * // This is copied from "gfx/grid/grid_rock.anm2" with some tweaks to make it look special.
31
+ * const SILVER_ROCK_ANM2_PATH = "gfx/grid/grid_rock_silver.anm2";
32
+ *
33
+ * export function silverRockInit(mod: ModUpgraded): void {
34
+ * mod.AddCallbackCustom(
35
+ * ModCallbackCustom.POST_GRID_ENTITY_CUSTOM_BROKEN,
36
+ * postGridEntityCustomBrokenSilverRock,
37
+ * GridEntityTypeCustom.SILVER_ROCK,
38
+ * );
39
+ * }
40
+ *
41
+ * function postGridEntityCustomBrokenSilverRock(gridEntity: GridEntity) {
42
+ * spawnCoin(CoinSubType.DIME, gridEntity.Position);
43
+ * }
44
+ *
45
+ * export function spawnSilverRock(gridIndex: int): GridEntity {
46
+ * return spawnCustomGridEntity(
47
+ * GridEntityTypeCustom.SILVER_ROCK,
48
+ * gridIndex,
49
+ * undefined,
50
+ * SILVER_ROCK_ANM2_PATH,
51
+ * undefined,
52
+ * GridEntityType.ROCK,
53
+ * );
54
+ * }
55
+ * ```
56
+ *
21
57
  * @param gridEntityTypeCustom An integer that identifies what kind of grid entity you are creating.
22
58
  * It should correspond to a local enum value created in your mod. The
23
59
  * integer can be any unique value and will not correspond to the actual
@@ -1 +1 @@
1
- {"version":3,"file":"customGridEntity.d.ts","sourceRoot":"","sources":["../../src/features/customGridEntity.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,kBAAkB,EAClB,cAAc,EAGf,MAAM,8BAA8B,CAAC;AAgBtC,OAAO,EAAE,oBAAoB,EAAE,MAAM,oCAAoC,CAAC;AAyH1E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AACH,wBAAgB,qBAAqB,CACnC,oBAAoB,EAAE,cAAc,EACpC,mBAAmB,EAAE,GAAG,GAAG,MAAM,EACjC,kBAAkB,CAAC,EAAE,kBAAkB,EACvC,QAAQ,CAAC,EAAE,MAAM,EACjB,gBAAgB,CAAC,EAAE,MAAM,EACzB,kBAAkB,iBAA4B,EAC9C,qBAAqB,SAAI,GACxB,UAAU,CA8CZ;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,sBAAsB,CACpC,+BAA+B,EAAE,GAAG,GAAG,MAAM,GAAG,UAAU,EAC1D,UAAU,UAAO,GAChB,UAAU,GAAG,SAAS,CAuCxB;AAED;;;GAGG;AACH,wBAAgB,qBAAqB,IAAI,KAAK,CAC5C;IAAC,UAAU,EAAE,UAAU;IAAE,IAAI,EAAE,oBAAoB;CAAC,CACrD,CAqBA;AAED;;;;GAIG;AACH,wBAAgB,uBAAuB,CACrC,qBAAqB,EAAE,UAAU,GAAG,GAAG,GACtC,cAAc,GAAG,SAAS,CAsB5B;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAChC,qBAAqB,EAAE,UAAU,GAAG,GAAG,GACtC,OAAO,CAOT"}
1
+ {"version":3,"file":"customGridEntity.d.ts","sourceRoot":"","sources":["../../src/features/customGridEntity.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,kBAAkB,EAClB,cAAc,EAGf,MAAM,8BAA8B,CAAC;AAgBtC,OAAO,EAAE,oBAAoB,EAAE,MAAM,oCAAoC,CAAC;AAyH1E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0EG;AACH,wBAAgB,qBAAqB,CACnC,oBAAoB,EAAE,cAAc,EACpC,mBAAmB,EAAE,GAAG,GAAG,MAAM,EACjC,kBAAkB,CAAC,EAAE,kBAAkB,EACvC,QAAQ,CAAC,EAAE,MAAM,EACjB,gBAAgB,CAAC,EAAE,MAAM,EACzB,kBAAkB,iBAA4B,EAC9C,qBAAqB,SAAI,GACxB,UAAU,CA8CZ;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,sBAAsB,CACpC,+BAA+B,EAAE,GAAG,GAAG,MAAM,GAAG,UAAU,EAC1D,UAAU,UAAO,GAChB,UAAU,GAAG,SAAS,CAuCxB;AAED;;;GAGG;AACH,wBAAgB,qBAAqB,IAAI,KAAK,CAC5C;IAAC,UAAU,EAAE,UAAU;IAAE,IAAI,EAAE,oBAAoB;CAAC,CACrD,CAqBA;AAED;;;;GAIG;AACH,wBAAgB,uBAAuB,CACrC,qBAAqB,EAAE,UAAU,GAAG,GAAG,GACtC,cAAc,GAAG,SAAS,CAsB5B;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAChC,qBAAqB,EAAE,UAAU,GAAG,GAAG,GACtC,OAAO,CAOT"}
@@ -128,6 +128,42 @@ end
128
128
  -- Custom grid entities are an IsaacScript feature because the vanilla game does not support any
129
129
  -- custom grid entities.
130
130
  --
131
+ -- For example, this would be code to create a custom rock called a "Silver Rock" that produces a
132
+ -- dime when destroyed:
133
+ --
134
+ -- ```ts
135
+ -- // This is local to the mod and can safely overlap with the values of `GridEntityType`.
136
+ -- const GridEntityTypeCustom = {
137
+ -- SILVER_ROCK: 0 as GridEntityType,
138
+ -- } as const;
139
+ --
140
+ -- // This is copied from "gfx/grid/grid_rock.anm2" with some tweaks to make it look special.
141
+ -- const SILVER_ROCK_ANM2_PATH = "gfx/grid/grid_rock_silver.anm2";
142
+ --
143
+ -- export function silverRockInit(mod: ModUpgraded): void {
144
+ -- mod.AddCallbackCustom(
145
+ -- ModCallbackCustom.POST_GRID_ENTITY_CUSTOM_BROKEN,
146
+ -- postGridEntityCustomBrokenSilverRock,
147
+ -- GridEntityTypeCustom.SILVER_ROCK,
148
+ -- );
149
+ -- }
150
+ --
151
+ -- function postGridEntityCustomBrokenSilverRock(gridEntity: GridEntity) {
152
+ -- spawnCoin(CoinSubType.DIME, gridEntity.Position);
153
+ -- }
154
+ --
155
+ -- export function spawnSilverRock(gridIndex: int): GridEntity {
156
+ -- return spawnCustomGridEntity(
157
+ -- GridEntityTypeCustom.SILVER_ROCK,
158
+ -- gridIndex,
159
+ -- undefined,
160
+ -- SILVER_ROCK_ANM2_PATH,
161
+ -- undefined,
162
+ -- GridEntityType.ROCK,
163
+ -- );
164
+ -- }
165
+ -- ```
166
+ --
131
167
  -- @param gridEntityTypeCustom An integer that identifies what kind of grid entity you are creating.
132
168
  -- It should correspond to a local enum value created in your mod. The
133
169
  -- integer can be any unique value and will not correspond to the actual
@@ -13,8 +13,6 @@ export declare function angelRoom(): void;
13
13
  export declare function ascent(): void;
14
14
  /** Warps to the first Clean Bedroom or Dirty Bedroom on the floor. */
15
15
  export declare function bedroom(): void;
16
- /** Alias for the "blackhearts" command. */
17
- export declare function bh(params: string): void;
18
16
  /**
19
17
  * Gives a half black heart. Provide a number to give a custom amount of hearts. (You can use
20
18
  * negative numbers to remove hearts.)
@@ -130,8 +128,6 @@ export declare function down(params: string): void;
130
128
  export declare function dungeon(): void;
131
129
  /** Logs the player's current temporary effects to the "log.txt" file. */
132
130
  export declare function effects(): void;
133
- /** Alias for the "eternalHearts" command. */
134
- export declare function eh(params: string): void;
135
131
  /** Alias for the "iAmError" command. */
136
132
  export declare function errorRoom(): void;
137
133
  /**
@@ -281,6 +277,8 @@ export declare function poopMana(params: string): void;
281
277
  export declare function position(): void;
282
278
  /** Alias for the "hearts" command. */
283
279
  export declare function redHearts(params: string): void;
280
+ /** Starts a room transition to the same room that you are already in. */
281
+ export declare function reloadRoom(): void;
284
282
  /** Moves the player 0.5 units right. Provide a number to move a custom amount of units. */
285
283
  export declare function right(params: string): void;
286
284
  /** Logs information about the room to the "log.txt" file. */
@@ -1 +1 @@
1
- {"version":3,"file":"listCommands.d.ts","sourceRoot":"","sources":["../../../src/features/extraConsoleCommands/listCommands.ts"],"names":[],"mappings":"AAyHA;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CA2C/C;AAED;;;GAGG;AACH,wBAAgB,SAAS,IAAI,IAAI,CAEhC;AAED,gEAAgE;AAChE,wBAAgB,MAAM,IAAI,IAAI,CAK7B;AAED,sEAAsE;AACtE,wBAAgB,OAAO,IAAI,IAAI,CAkB9B;AAED,2CAA2C;AAC3C,wBAAgB,EAAE,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAEvC;AAED;;;GAGG;AACH,wBAAgB,WAAW,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAEhD;AAED,+CAA+C;AAC/C,wBAAgB,WAAW,IAAI,IAAI,CAElC;AAED,4CAA4C;AAC5C,wBAAgB,KAAK,IAAI,IAAI,CAG5B;AAED;;;GAGG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAcjD;AAED,2CAA2C;AAC3C,wBAAgB,EAAE,IAAI,IAAI,CAEzB;AAED;;;GAGG;AACH,wBAAgB,IAAI,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAczC;AAED;;;GAGG;AACH,wBAAgB,KAAK,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAc1C;AAED;;;GAGG;AACH,wBAAgB,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAE/C;AAED,wCAAwC;AACxC,wBAAgB,IAAI,IAAI,IAAI,CAE3B;AAED,kEAAkE;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,IAAI,IAAI,CAEtC;AAED;;;GAGG;AACH,wBAAgB,KAAK,IAAI,IAAI,CAQ5B;AAED,wCAAwC;AACxC,wBAAgB,KAAK,IAAI,IAAI,CAE5B;AAED,6CAA6C;AAC7C,wBAAgB,QAAQ,IAAI,IAAI,CAE/B;AAED,qDAAqD;AACrD,wBAAgB,YAAY,IAAI,IAAI,CAEnC;AAED,yDAAyD;AACzD,wBAAgB,eAAe,IAAI,IAAI,CAEtC;AAED,8CAA8C;AAC9C,wBAAgB,OAAO,IAAI,IAAI,CAG9B;AAED,sFAAsF;AACtF,wBAAgB,MAAM,IAAI,IAAI,CAQ7B;AAED,wFAAwF;AACxF,wBAAgB,EAAE,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAEvC;AAED;;;;;;;GAOG;AACH,wBAAgB,IAAI,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CA0BzC"}
1
+ {"version":3,"file":"listCommands.d.ts","sourceRoot":"","sources":["../../../src/features/extraConsoleCommands/listCommands.ts"],"names":[],"mappings":"AA0HA;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CA2C/C;AAED;;;GAGG;AACH,wBAAgB,SAAS,IAAI,IAAI,CAEhC;AAED,gEAAgE;AAChE,wBAAgB,MAAM,IAAI,IAAI,CAK7B;AAED,sEAAsE;AACtE,wBAAgB,OAAO,IAAI,IAAI,CAkB9B;AAED;;;GAGG;AACH,wBAAgB,WAAW,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAEhD;AAED,+CAA+C;AAC/C,wBAAgB,WAAW,IAAI,IAAI,CAElC;AAED,4CAA4C;AAC5C,wBAAgB,KAAK,IAAI,IAAI,CAG5B;AAED;;;GAGG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAcjD;AAED,2CAA2C;AAC3C,wBAAgB,EAAE,IAAI,IAAI,CAEzB;AAED;;;GAGG;AACH,wBAAgB,IAAI,C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C,MAAM,EAAE,MAAM,GAAG,IAAI,CAkBvD;AAED,gEAAgE;AAChE,wBAAgB,KAAK,IAAI,IAAI,CAY5B;AAED,4CAA4C;AAC5C,wBAAgB,SAAS,IAAI,IAAI,CAEhC;AAED,+CAA+C;AAC/C,wBAAgB,YAAY,IAAI,IAAI,CAInC;AAED,yDAAyD;AACzD,wBAAgB,eAAe,IAAI,IAAI,CAEtC;AAED;;;GAGG;AACH,wBAAgB,KAAK,IAAI,IAAI,CAQ5B;AAED,wCAAwC;AACxC,wBAAgB,KAAK,IAAI,IAAI,CAE5B;AAED,6CAA6C;AAC7C,wBAAgB,QAAQ,IAAI,IAAI,CAE/B;AAED,qDAAqD;AACrD,wBAAgB,YAAY,IAAI,IAAI,CAEnC;AAED,yDAAyD;AACzD,wBAAgB,eAAe,IAAI,IAAI,CAEtC;AAED,8CAA8C;AAC9C,wBAAgB,OAAO,IAAI,IAAI,CAG9B;AAED,sFAAsF;AACtF,wBAAgB,MAAM,IAAI,IAAI,CAQ7B;AAED,wFAAwF;AACxF,wBAAgB,EAAE,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAEvC;AAED;;;;;;;GAOG;AACH,wBAAgB,IAAI,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CA0BzC"}
@@ -81,6 +81,8 @@ local ____roomGrid = require("functions.roomGrid")
81
81
  local gridCoordinatesToWorldPosition = ____roomGrid.gridCoordinatesToWorldPosition
82
82
  local ____rooms = require("functions.rooms")
83
83
  local changeRoom = ____rooms.changeRoom
84
+ local ____roomTransition = require("functions.roomTransition")
85
+ local reloadRoomFunction = ____roomTransition.reloadRoom
84
86
  local ____run = require("functions.run")
85
87
  local onSetSeed = ____run.onSetSeed
86
88
  local restart = ____run.restart
@@ -117,11 +119,6 @@ local warpNextToRoomType = ____commandsSubroutines.warpNextToRoomType
117
119
  local warpToRoomType = ____commandsSubroutines.warpToRoomType
118
120
  local ____v = require("features.extraConsoleCommands.v")
119
121
  local v = ____v.default
120
- --- Gives a half black heart. Provide a number to give a custom amount of hearts. (You can use
121
- -- negative numbers to remove hearts.)
122
- function ____exports.blackHearts(self, params)
123
- addHeart(nil, params, HealthType.BLACK)
124
- end
125
122
  --- Warps to the first Boss Room on the floor.
126
123
  function ____exports.bossRoom(self)
127
124
  warpToRoomType(nil, RoomType.BOSS)
@@ -137,11 +134,6 @@ end
137
134
  function ____exports.devilRoom(self)
138
135
  devilAngel(nil, true)
139
136
  end
140
- --- Gives an eternal heart. Provide a number to give a custom amount of hearts. (You can use negative
141
- -- numbers to remove hearts.)
142
- function ____exports.eternalHearts(self, params)
143
- addHeart(nil, params, HealthType.ETERNAL)
144
- end
145
137
  --- Gives the player a golden bomb.
146
138
  function ____exports.goldenBomb(self)
147
139
  local player = Isaac.GetPlayer()
@@ -271,9 +263,10 @@ function ____exports.bedroom(self)
271
263
  end
272
264
  printConsole(nil, "There are no Clean Bedrooms or Dirty Bedrooms on this floor.")
273
265
  end
274
- --- Alias for the "blackhearts" command.
275
- function ____exports.bh(self, params)
276
- ____exports.blackHearts(nil, params)
266
+ --- Gives a half black heart. Provide a number to give a custom amount of hearts. (You can use
267
+ -- negative numbers to remove hearts.)
268
+ function ____exports.blackHearts(self, params)
269
+ addHeart(nil, params, HealthType.BLACK)
277
270
  end
278
271
  --- Warps to the Black Market for the floor.
279
272
  function ____exports.blackMarket(self)
@@ -560,14 +553,15 @@ function ____exports.effects(self)
560
553
  logPlayerEffects(player)
561
554
  printConsole(nil, "Logged the player's effects to the \"log.txt\" file.")
562
555
  end
563
- --- Alias for the "eternalHearts" command.
564
- function ____exports.eh(self, params)
565
- ____exports.eternalHearts(nil, params)
566
- end
567
556
  --- Alias for the "iAmError" command.
568
557
  function ____exports.errorRoom(self)
569
558
  ____exports.iAmErrorRoom(nil)
570
559
  end
560
+ --- Gives an eternal heart. Provide a number to give a custom amount of hearts. (You can use negative
561
+ -- numbers to remove hearts.)
562
+ function ____exports.eternalHearts(self, params)
563
+ addHeart(nil, params, HealthType.ETERNAL)
564
+ end
571
565
  --- Toggles flight for the player.
572
566
  function ____exports.flight(self, params)
573
567
  local player = Isaac.GetPlayer()
@@ -896,6 +890,10 @@ end
896
890
  function ____exports.redHearts(self, params)
897
891
  ____exports.hearts(nil, params)
898
892
  end
893
+ --- Starts a room transition to the same room that you are already in.
894
+ function ____exports.reloadRoom(self)
895
+ reloadRoomFunction(nil)
896
+ end
899
897
  --- Moves the player 0.5 units right. Provide a number to move a custom amount of units.
900
898
  function ____exports.right(self, params)
901
899
  movePlayer(nil, params, Direction.RIGHT)
@@ -6,8 +6,8 @@ import { SaveData } from "../../interfaces/SaveData";
6
6
  * 1. automatic resetting of variables on a new run, on a new level, or on a new room (as desired)
7
7
  * 2. automatic saving and loading of all tracked data to the "save#.dat" file
8
8
  *
9
- * You feed this function with an anonymous object containing your variables, and then it will
10
- * automatically manage them for you. (See below for an example.)
9
+ * You feed this function with an object containing your variables, and then it will automatically
10
+ * manage them for you. (See below for an example.)
11
11
  *
12
12
  * The save data manager is meant to be called once for each feature of your mod. In other words,
13
13
  * you should not put all of the data for your mod on the same object. Instead, scope your variables
@@ -25,8 +25,8 @@ local SAVE_DATA_MANAGER_FEATURE_NAME = ____saveDataManagerConstants.SAVE_DATA_MA
25
25
  -- 1. automatic resetting of variables on a new run, on a new level, or on a new room (as desired)
26
26
  -- 2. automatic saving and loading of all tracked data to the "save#.dat" file
27
27
  --
28
- -- You feed this function with an anonymous object containing your variables, and then it will
29
- -- automatically manage them for you. (See below for an example.)
28
+ -- You feed this function with an object containing your variables, and then it will automatically
29
+ -- manage them for you. (See below for an example.)
30
30
  --
31
31
  -- The save data manager is meant to be called once for each feature of your mod. In other words,
32
32
  -- you should not put all of the data for your mod on the same object. Instead, scope your variables
@@ -159,8 +159,6 @@ export declare function getRandomArrayElementAndRemove<T>(array: T[], seedOrRNG?
159
159
  * index. Default is an empty array.
160
160
  */
161
161
  export declare function getRandomArrayIndex<T>(array: T[] | readonly T[], seedOrRNG?: Seed | RNG, exceptions?: int[] | readonly int[]): int;
162
- /** Initializes an array with all elements containing the specified default value. */
163
- export declare function initArray<T>(defaultValue: T, size: int): T[];
164
162
  /**
165
163
  * Since Lua uses tables for every non-primitive data structure, it is non-trivial to determine if a
166
164
  * particular table is being used as an array. `isArray` returns true if:
@@ -1 +1 @@
1
- {"version":3,"file":"array.d.ts","sourceRoot":"","sources":["../../src/functions/array.ts"],"names":[],"mappings":";;;AAKA;;;GAGG;AACH,wBAAgB,WAAW,CAAC,CAAC,EAC3B,MAAM,EAAE,CAAC,EAAE,GAAG,SAAS,CAAC,EAAE,EAC1B,MAAM,EAAE,CAAC,EAAE,GAAG,SAAS,CAAC,EAAE,GACzB,OAAO,CAST;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,WAAW,CAAC,CAAC,EAC3B,aAAa,EAAE,CAAC,EAAE,GAAG,SAAS,CAAC,EAAE,EACjC,GAAG,gBAAgB,EAAE,CAAC,EAAE,GACvB,CAAC,EAAE,CAIL;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,cAAc,CAAC,CAAC,EAC9B,aAAa,EAAE,CAAC,EAAE,GAAG,SAAS,CAAC,EAAE,EACjC,GAAG,gBAAgB,EAAE,CAAC,EAAE,GACvB,CAAC,EAAE,CAIL;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,qBAAqB,CAAC,CAAC,EACrC,KAAK,EAAE,CAAC,EAAE,EACV,GAAG,gBAAgB,EAAE,CAAC,EAAE,GACvB,OAAO,CAcT;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,kBAAkB,CAAC,CAAC,EAClC,KAAK,EAAE,CAAC,EAAE,EACV,GAAG,gBAAgB,EAAE,CAAC,EAAE,GACvB,OAAO,CAWT;AAED;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,CAAC,EAChC,aAAa,EAAE,CAAC,EAAE,GAAG,SAAS,CAAC,EAAE,EACjC,GAAG,eAAe,EAAE,GAAG,EAAE,GACxB,CAAC,EAAE,CAWL;AAED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AED;;;;;;;;GAQG;AACH,wBAAgB,mBAAmB,CAAC,CAAC,EACnC,KAAK,EAAE,CAAC,EAAE,EACV,SAAS,GAAE,IAAI,GAAG,GAAqB,GACtC,IAAI,CAWN;AAED,+DAA+D;AAC/D,wBAAgB,QAAQ,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,SAAS,MAAM,EAAE,GAAG,MAAM,CAEpE;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,IAAI,CAM3E"}
@@ -26,7 +26,6 @@ local isNumber = ____types.isNumber
26
26
  local isTable = ____types.isTable
27
27
  local ____utils = require("functions.utils")
28
28
  local erange = ____utils.erange
29
- local ____repeat = ____utils["repeat"]
30
29
  --- Removes all of the specified element(s) from the array. If the specified element(s) are not found
31
30
  -- in the array, this function will do nothing.
32
31
  --
@@ -398,18 +397,6 @@ function ____exports.getRandomArrayElementAndRemove(self, array, seedOrRNG, exce
398
397
  ____exports.arrayRemoveInPlace(nil, array, randomArrayElement)
399
398
  return randomArrayElement
400
399
  end
401
- --- Initializes an array with all elements containing the specified default value.
402
- function ____exports.initArray(self, defaultValue, size)
403
- local array = {}
404
- ____repeat(
405
- nil,
406
- size,
407
- function()
408
- array[#array + 1] = defaultValue
409
- end
410
- )
411
- return array
412
- end
413
400
  --- Since Lua uses tables for every non-primitive data structure, it is non-trivial to determine if a
414
401
  -- particular table is being used as an array. `isArray` returns true if:
415
402
  --
@@ -2,7 +2,12 @@
2
2
  /**
3
3
  * Helper function to benchmark the performance of a function.
4
4
  *
5
- * This function is variadic, which means that you can supply as many as you want to benchmark.
5
+ * This function is variadic, which means that you can supply as many functions as you want to
6
+ * benchmark.
7
+ *
8
+ * This function uses the `Isaac.GetTime` method to record how long the function took to execute.
9
+ * This method only reports time in milliseconds. For this reason, if you are benchmarking smaller
10
+ * functions, then you should provide a very high value for the number of trials.
6
11
  *
7
12
  * @returns An array containing the average time in milliseconds for each function. (This will also
8
13
  * be printed to the log.)
@@ -1 +1 @@
1
- {"version":3,"file":"benchmark.d.ts","sourceRoot":"","sources":["../../src/functions/benchmark.ts"],"names":[],"mappings":";AAEA;;;;;;;GAOG;AACH,wBAAgB,SAAS,CACvB,SAAS,EAAE,GAAG,EACd,GAAG,SAAS,EAAE,KAAK,CAAC,MAAM,IAAI,CAAC,GAC9B,GAAG,EAAE,CAsBP"}
1
+ {"version":3,"file":"benchmark.d.ts","sourceRoot":"","sources":["../../src/functions/benchmark.ts"],"names":[],"mappings":";AAEA;;;;;;;;;;;;GAYG;AACH,wBAAgB,SAAS,CACvB,SAAS,EAAE,GAAG,EACd,GAAG,SAAS,EAAE,KAAK,CAAC,MAAM,IAAI,CAAC,GAC9B,GAAG,EAAE,CAsBP"}
@@ -5,7 +5,12 @@ local ____log = require("functions.log")
5
5
  local log = ____log.log
6
6
  --- Helper function to benchmark the performance of a function.
7
7
  --
8
- -- This function is variadic, which means that you can supply as many as you want to benchmark.
8
+ -- This function is variadic, which means that you can supply as many functions as you want to
9
+ -- benchmark.
10
+ --
11
+ -- This function uses the `Isaac.GetTime` method to record how long the function took to execute.
12
+ -- This method only reports time in milliseconds. For this reason, if you are benchmarking smaller
13
+ -- functions, then you should provide a very high value for the number of trials.
9
14
  --
10
15
  -- @returns An array containing the average time in milliseconds for each function. (This will also
11
16
  -- be printed to the log.)
@@ -173,6 +173,11 @@ export declare function newCollectibleSprite(collectibleType: CollectibleType):
173
173
  *
174
174
  * The "item tracker" in this function does not refer to the in-game item tracker, but rather to the
175
175
  * Python program located at: https://github.com/Rchardon/RebirthItemTracker
176
+ *
177
+ * This function is useful when you need to add a "fake" collectible to a player. Note that calling
178
+ * this function is not necessary when removing items from players. For example, when you remove a
179
+ * collectible with the `EntityPlayer.RemoveCollectible` method, a proper message is sent to the log
180
+ * the item tracker will automatically remove it.
176
181
  */
177
182
  export declare function removeCollectibleFromItemTracker(collectibleType: CollectibleType): void;
178
183
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"collectibles.d.ts","sourceRoot":"","sources":["../../src/functions/collectibles.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,uBAAuB,EACvB,eAAe,EAEf,aAAa,EAEb,QAAQ,EACR,WAAW,EAGZ,MAAM,8BAA8B,CAAC;AAgBtC,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AA0B7D,wBAAgB,sBAAsB,CAAC,WAAW,EAAE,YAAY,GAAG,IAAI,CAEtE;AAED,6FAA6F;AAC7F,wBAAgB,uBAAuB,CACrC,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,MAAM,GACd,OAAO,CAsBT;AAED;;;GAGG;AACH,wBAAgB,yBAAyB,CACvC,eAAe,EAAE,eAAe,GAC/B,MAAM,CAeR;AAED;;;GAGG;AACH,wBAAgB,4BAA4B,CAC1C,eAAe,EAAE,eAAe,GAC/B,GAAG,CAYL;AAED;;;GAGG;AACH,wBAAgB,6BAA6B,CAC3C,eAAe,EAAE,eAAe,EAChC,MAAM,EAAE,YAAY,GACnB,WAAW,CAyBb;AAED;;;;;;;GAOG;AACH,wBAAgB,yBAAyB,CACvC,eAAe,EAAE,eAAe,GAC/B,MAAM,CAOR;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiDG;AACH,wBAAgB,mBAAmB,CACjC,WAAW,EAAE,YAAY,GACxB,gBAAgB,CAsBlB;AAED;;;GAGG;AACH,wBAAgB,wBAAwB,CACtC,eAAe,EAAE,eAAe,GAC/B,GAAG,CAOL;AAED;;;GAGG;AACH,wBAAgB,sBAAsB,CACpC,eAAe,EAAE,eAAe,GAC/B,QAAQ,CAOV;AAED;;;GAGG;AACH,wBAAgB,wBAAwB,CACtC,eAAe,EAAE,eAAe,GAC/B,GAAG,CAOL;AAED;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,eAAe,EAAE,eAAe,GAAG,MA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AG,IAAI,CAS5E;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,WAAW,EAAE,YAAY,GAAG,IAAI,CASnE;AAED;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CAAC,WAAW,EAAE,YAAY,GAAG,IAAI,CAUnE;AAED;;;GAGG;AACH,wBAAgB,sBAAsB,CAAC,WAAW,EAAE,YAAY,GAAG,IAAI,CAuBtE;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,oBAAoB,CAClC,WAAW,EAAE,YAAY,EACzB,OAAO,EAAE,MAAM,GAAG,SAAS,GAC1B,IAAI,CAeN;AAED;;;GAGG;AACH,wBAAgB,qBAAqB,CACnC,WAAW,EAAE,YAAY,EACzB,kBAAkB,EAAE,eAAe,GAClC,IAAI,CA2BN;AAED;;;GAGG;AACH,wBAAgB,qCAAqC,IAAI,IAAI,CAK5D"}
1
+ {"version":3,"file":"collectibles.d.ts","sourceRoot":"","sources":["../../src/functions/collectibles.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,uBAAuB,EACvB,eAAe,EAEf,aAAa,EAEb,QAAQ,EACR,WAAW,EAGZ,MAAM,8BAA8B,CAAC;AAgBtC,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AA0B7D,wBAAgB,sBAAsB,CAAC,WAAW,EAAE,YAAY,GAAG,IAAI,CAEtE;AAED,6FAA6F;AAC7F,wBAAgB,uBAAuB,CACrC,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,MAAM,GACd,OAAO,CAsBT;AAED;;;GAGG;AACH,wBAAgB,yBAAyB,CACvC,eAAe,EAAE,eAAe,GAC/B,MAAM,CAeR;AAED;;;GAGG;AACH,wBAAgB,4BAA4B,CAC1C,eAAe,EAAE,eAAe,GAC/B,GAAG,CAYL;AAED;;;GAGG;AACH,wBAAgB,6BAA6B,CAC3C,eAAe,EAAE,eAAe,EAChC,MAAM,EAAE,YAAY,GACnB,WAAW,CAyBb;AAED;;;;;;;GAOG;AACH,wBA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GAGG;AACH,wBAAgB,oBAAoB,CAClC,eAAe,EAAE,eAAe,GAC/B,OAAO,CAGT;AAED;;;;GAIG;AACH,wBAAgB,sBAAsB,CACpC,eAAe,EAAE,eAAe,GAC/B,OAAO,CAET;AAED,wBAAgB,sBAAsB,CACpC,eAAe,EAAE,eAAe,GAC/B,OAAO,CAGT;AAED,wBAAgB,wBAAwB,CACtC,eAAe,EAAE,eAAe,GAC/B,OAAO,CAET;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,eAAe,EAAE,eAAe,GAAG,MAAM,CAa7E;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,gCAAgC,CAC9C,eAAe,EAAE,eAAe,GAC/B,IAAI,CAQN;AAED;;;GAGG;AACH,wBAAgB,4BAA4B,CAAC,WAAW,EAAE,YAAY,GAAG,IAAI,CAS5E;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,WAAW,EAAE,YAAY,GAAG,IAAI,CASnE;AAED;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CAAC,WAAW,EAAE,YAAY,GAAG,IAAI,CAUnE;AAED;;;GAGG;AACH,wBAAgB,sBAAsB,CAAC,WAAW,EAAE,YAAY,GAAG,IAAI,CAuBtE;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,oBAAoB,CAClC,WAAW,EAAE,YAAY,EACzB,OAAO,EAAE,MAAM,GAAG,SAAS,GAC1B,IAAI,CAeN;AAED;;;GAGG;AACH,wBAAgB,qBAAqB,CACnC,WAAW,EAAE,YAAY,EACzB,kBAAkB,EAAE,eAAe,GAClC,IAAI,CA2BN;AAED;;;GAGG;AACH,wBAAgB,qCAAqC,IAAI,IAAI,CAK5D"}
@@ -402,6 +402,11 @@ end
402
402
  --
403
403
  -- The "item tracker" in this function does not refer to the in-game item tracker, but rather to the
404
404
  -- Python program located at: https://github.com/Rchardon/RebirthItemTracker
405
+ --
406
+ -- This function is useful when you need to add a "fake" collectible to a player. Note that calling
407
+ -- this function is not necessary when removing items from players. For example, when you remove a
408
+ -- collectible with the `EntityPlayer.RemoveCollectible` method, a proper message is sent to the log
409
+ -- the item tracker will automatically remove it.
405
410
  function ____exports.removeCollectibleFromItemTracker(self, collectibleType)
406
411
  local collectibleName = ____exports.getCollectibleName(nil, collectibleType)
407
412
  Isaac.DebugString(((("Removing collectible " .. tostring(collectibleType)) .. " (") .. collectibleName) .. ") on player 0 (Player)")
@@ -3,10 +3,13 @@ import { SerializationType } from "../enums/SerializationType";
3
3
  * `deepCopy` is a semi-generic deep cloner. It will recursively copy all of the values so that none
4
4
  * of the nested references remain.
5
5
  *
6
- * It supports the following object types:
6
+ * `deepCopy` is used by the IsaacScript save data manager to make a backup of your variables, so
7
+ * that it can restore them to the default values at the beginning of a new room, floor, or run.
8
+ *
9
+ * `deepCopy` supports the following object types:
7
10
  *
8
11
  * - Primitives (i.e. strings, numbers, and booleans)
9
- * - Basic TSTL objects / tables
12
+ * - Basic TSTL objects (which are the same thing as Lua tables)
10
13
  * - TSTL `Map`
11
14
  * - TSTL `Set`
12
15
  * - TSTL classes
@@ -1 +1 @@
1
- {"version":3,"file":"deepCopy.d.ts","sourceRoot":"","sources":["../../src/functions/deepCopy.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AA6B/D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,wBAAgB,QAAQ,CACtB,KAAK,EAAE,OAAO,EACd,iBAAiB,oBAAyB,EAC1C,oBAAoB,SAAK,EACzB,SAAS,UAAQ,GAChB,OAAO,CAkDT"}
1
+ {"version":3,"file":"deepCopy.d.ts","sourceRoot":"","sources":["../../src/functions/deepCopy.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AA6B/D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,wBAAgB,QAAQ,CACtB,KAAK,EAAE,OAAO,EACd,iBAAiB,oBAAyB,EAC1C,oBAAoB,SAAK,EACzB,SAAS,UAAQ,GAChB,OAAO,CAkDT"}
@@ -49,10 +49,13 @@ local twoDimensionalSort = ____utils.twoDimensionalSort
49
49
  --- `deepCopy` is a semi-generic deep cloner. It will recursively copy all of the values so that none
50
50
  -- of the nested references remain.
51
51
  --
52
- -- It supports the following object types:
52
+ -- `deepCopy` is used by the IsaacScript save data manager to make a backup of your variables, so
53
+ -- that it can restore them to the default values at the beginning of a new room, floor, or run.
54
+ --
55
+ -- `deepCopy` supports the following object types:
53
56
  --
54
57
  -- - Primitives (i.e. strings, numbers, and booleans)
55
- -- - Basic TSTL objects / tables
58
+ -- - Basic TSTL objects (which are the same thing as Lua tables)
56
59
  -- - TSTL `Map`
57
60
  -- - TSTL `Set`
58
61
  -- - TSTL classes
@@ -77,11 +77,10 @@ export declare function getEntityFields(entity: Entity): LuaMap<string, boolean
77
77
  * reference, you would use an `EntityPtr` instead of a `PtrHash`.
78
78
  */
79
79
  export declare function getEntityFromPtrHash(ptrHash: PtrHash): Entity | undefined;
80
- /** Helper function to return a string containing the entity's type, variant, and sub-type. */
80
+ /** Helper function to get a string containing the entity's type, variant, and sub-type. */
81
81
  export declare function getEntityID(entity: Entity): string;
82
82
  /**
83
- * Helper function to return a formatted string in the format returned by the `getEntityID`
84
- * function.
83
+ * Helper function to get a formatted string in the format returned by the `getEntityID` function.
85
84
  */
86
85
  export declare function getEntityIDFromConstituents(entityType: EntityType, variant: int, subType: int): string;
87
86
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"entities.d.ts","sourceRoot":"","sources":["../../src/functions/entities.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAI1D,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAO/C;;;;;;;;;GASG;AACH,wBAAgB,aAAa,CAC3B,UAAU,GAAE,UAAe,EAC3B,OAAO,SAAK,EACZ,OAAO,SAAK,EACZ,cAAc,UAAQ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GAAG,EACZ,QAAQ,EAAE,MAAM,EAChB,QAAQ,GAAE,MAAmB,EAC7B,OAAO,GAAE,MAAM,GAAG,SAAqB,EACvC,SAAS,GAAE,IAAI,GAAG,GAAG,GAAG,SAAqB,GAC5C,MAAM,CAsCR;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAC3B,UAAU,EAAE,UAAU,EACtB,OAAO,EAAE,GAAG,EACZ,OAAO,EAAE,GAAG,EACZ,QAAQ,EAAE,MAAM,EAChB,SAAS,EAAE,IAAI,GAAG,GAAG,EACrB,QAAQ,GAAE,MAAmB,EAC7B,OAAO,GAAE,MAAM,GAAG,SAAqB,GACtC,MAAM,CAUR"}
@@ -219,12 +219,11 @@ function ____exports.getEntityFromPtrHash(self, ptrHash)
219
219
  function(____, entity) return GetPtrHash(entity) == ptrHash end
220
220
  )
221
221
  end
222
- --- Helper function to return a string containing the entity's type, variant, and sub-type.
222
+ --- Helper function to get a string containing the entity's type, variant, and sub-type.
223
223
  function ____exports.getEntityID(self, entity)
224
224
  return (((tostring(entity.Type) .. ".") .. tostring(entity.Variant)) .. ".") .. tostring(entity.SubType)
225
225
  end
226
- --- Helper function to return a formatted string in the format returned by the `getEntityID`
227
- -- function.
226
+ --- Helper function to get a formatted string in the format returned by the `getEntityID` function.
228
227
  function ____exports.getEntityIDFromConstituents(self, entityType, variant, subType)
229
228
  return (((tostring(entityType) .. ".") .. tostring(variant)) .. ".") .. tostring(subType)
230
229
  end
@@ -60,10 +60,10 @@ export declare function getGridEntitiesExcept(...gridEntityTypes: GridEntityType
60
60
  * arguments to match specific grid entity types.
61
61
  */
62
62
  export declare function getGridEntitiesMap(...gridEntityTypes: GridEntityType[]): Map<int, GridEntity>;
63
- /** Helper function to return a string containing the grid entity's type and variant. */
63
+ /** Helper function to get a string containing the grid entity's type and variant. */
64
64
  export declare function getGridEntityID(gridEntity: GridEntity): string;
65
65
  /**
66
- * Helper function to return a formatted string in the format returned by the `getGridEntityID`
66
+ * Helper function to get a formatted string in the format returned by the `getGridEntityID`
67
67
  * function.
68
68
  */
69
69
  export declare function getGridEntityIDFromConstituents(gridEntityType: GridEntityType, variant: int): string;
@@ -1 +1 @@
1
- {"version":3,"file":"gridEntities.d.ts","sourceRoot":"","sources":["../../src/functions/gridEntities.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,cAAc,EACd,iBAAiB,EAIlB,MAAM,8BAA8B,CAAC;AAStC,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAgCvD;;;;GAIG;AACH,wBAAgB,wBAAwB,CACtC,iBAAiB,EAAE,iBAAiB,EACpC,oBAAoB,EAAE,GAAG,GACxB,CAAC,cAAc,EAAE,GAAG,CAAC,GAAG,SAAS,CAqBnC;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,IAAI,GAAG,EAAE,CAKzC;AAED;;;;;;GAMG;AACH,wBAAgB,kCAAkC,CAChD,UAAU,EAAE,UAAU,GACrB,MAAM,EAAE,CA4BV;AAED;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAgB,eAAe,CAC7B,GAAG,eAAe,EAAE,cAAc,EAAE,GACnC,UAAU,EAAE,CAYd;AAgBD;;;;;GAKG;AACH,wBAAgB,qBAAqB,CACnC,GAAG,eAAe,EAAE,cAAc,EAAE,GACnC,UAAU,EAAE,CAYd;AAED;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAChC,GAAG,eAAe,EAAE,cAAc,EAAE,GACnC,GAAG,CAAC,GAAG,EAAE,UAAU,CAAC,CAUtB;AAED,wFAAwF;AACxF,wBAAgB,eAAe,CAAC,UAAU,EAAE,UAAU,GAAG,MAAM,CAI9D;AAED;;;GAGG;AACH,wBAAgB,+BAA+B,CAC7C,cAAc,EAAE,cAAc,EAC9B,OAAO,EAAE,GAAG,GACX,MAAM,CAER;AAED;;;;;GAKG;AACH,wBAAgB,uBAAuB,CACrC,cAAc,EAAE,cAAc,EAC9B,OAAO,EAAE,GAAG,GACX,UAAU,EAAE,CAKd;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C,gBAAgB,EAAE,GAAG,GAAG,IAAI,CA4B1D;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,eAAe,CAC7B,cAAc,EAAE,cAAc,EAC9B,mBAAmB,EAAE,GAAG,GAAG,MAAM,GAChC,UAAU,GAAG,SAAS,CAExB;AAED;;;;;;;GAOG;AACH,wBAAgB,0BAA0B,CACxC,cAAc,EAAE,cAAc,EAC9B,OAAO,EAAE,GAAG,EACZ,mBAAmB,EAAE,GAAG,GAAG,MAAM,GAChC,UAAU,GAAG,SAAS,CAgCxB;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAAC,SAAS,EAAE,GAAG,GAAG,UAAU,GAAG,SAAS,CAkBtE"}
@@ -265,13 +265,13 @@ function ____exports.getGridEntitiesMap(self, ...)
265
265
  end
266
266
  return gridEntityMap
267
267
  end
268
- --- Helper function to return a string containing the grid entity's type and variant.
268
+ --- Helper function to get a string containing the grid entity's type and variant.
269
269
  function ____exports.getGridEntityID(self, gridEntity)
270
270
  local gridEntityType = gridEntity:GetType()
271
271
  local variant = gridEntity:GetVariant()
272
272
  return (tostring(gridEntityType) .. ".") .. tostring(variant)
273
273
  end
274
- --- Helper function to return a formatted string in the format returned by the `getGridEntityID`
274
+ --- Helper function to get a formatted string in the format returned by the `getGridEntityID`
275
275
  -- function.
276
276
  function ____exports.getGridEntityIDFromConstituents(self, gridEntityType, variant)
277
277
  return (tostring(gridEntityType) .. ".") .. tostring(variant)
@@ -0,0 +1,18 @@
1
+ /// <reference types="isaac-typescript-definitions" />
2
+ /**
3
+ * Initializes an array with all of the elements containing the specified default value.
4
+ *
5
+ * If the provided default value is not a boolean, number, or string, then it will be copied with
6
+ * the `deepCopy` function before adding it to the new array. In this way, you can initialize an
7
+ * array of arrays, or an array of maps, and so on. (If the `deepCopy` function was not used, then
8
+ * all of the array elements would just be references to the same underlying data structure.)
9
+ *
10
+ * For example:
11
+ *
12
+ * ```ts
13
+ * const arrayWithZeroes = initArray(0, 10); // Has 10 elements of 0.
14
+ * const arrayWithArrays = initArray([0], 20); // Has 20 elements of an array with a 0 in it.
15
+ * ```
16
+ */
17
+ export declare function initArray<T>(defaultValue: T, size: int): T[];
18
+ //# sourceMappingURL=initArray.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"initArray.d.ts","sourceRoot":"","sources":["../../src/functions/initArray.ts"],"names":[],"mappings":";AAIA;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,SAAS,CAAC,CAAC,EAAE,YAAY,EAAE,CAAC,EAAE,IAAI,EAAE,GAAG,GAAG,CAAC,EAAE,CAY5D"}
@@ -0,0 +1,37 @@
1
+ local ____exports = {}
2
+ local ____deepCopy = require("functions.deepCopy")
3
+ local deepCopy = ____deepCopy.deepCopy
4
+ local ____types = require("functions.types")
5
+ local isPrimitive = ____types.isPrimitive
6
+ local ____utils = require("functions.utils")
7
+ local ____repeat = ____utils["repeat"]
8
+ --- Initializes an array with all of the elements containing the specified default value.
9
+ --
10
+ -- If the provided default value is not a boolean, number, or string, then it will be copied with
11
+ -- the `deepCopy` function before adding it to the new array. In this way, you can initialize an
12
+ -- array of arrays, or an array of maps, and so on. (If the `deepCopy` function was not used, then
13
+ -- all of the array elements would just be references to the same underlying data structure.)
14
+ --
15
+ -- For example:
16
+ --
17
+ -- ```ts
18
+ -- const arrayWithZeroes = initArray(0, 10); // Has 10 elements of 0.
19
+ -- const arrayWithArrays = initArray([0], 20); // Has 20 elements of an array with a 0 in it.
20
+ -- ```
21
+ function ____exports.initArray(self, defaultValue, size)
22
+ local array = {}
23
+ ____repeat(
24
+ nil,
25
+ size,
26
+ function()
27
+ if isPrimitive(nil, defaultValue) then
28
+ array[#array + 1] = defaultValue
29
+ else
30
+ local copy = deepCopy(nil, defaultValue)
31
+ array[#array + 1] = copy
32
+ end
33
+ end
34
+ )
35
+ return array
36
+ end
37
+ return ____exports
@@ -1,5 +1,8 @@
1
1
  import { ButtonAction, Controller, Keyboard } from "isaac-typescript-definitions";
2
- /** Helper function to get the enum name for the specified `Controller` value. */
2
+ /**
3
+ * Helper function to get the enum name for the specified `Controller` value. Note that this will
4
+ * trim off the "BUTTON_" prefix.
5
+ */
3
6
  export declare function controllerToString(controller: Controller): string | undefined;
4
7
  export declare function getMoveActions(): ReadonlySet<ButtonAction>;
5
8
  export declare function getShootActions(): ReadonlySet<ButtonAction>;
@@ -31,6 +34,11 @@ export declare function isShootActionPressedOnAnyInput(): boolean;
31
34
  export declare function isShootActionTriggeredOnAnyInput(): boolean;
32
35
  /**
33
36
  * Helper function to get the string that would be typed if someone pressed the corresponding key.
37
+ * This is useful for creating in-game chat.
38
+ *
39
+ * Note that this function will only work for the keyboard values that are printable. Thus, it will
40
+ * return undefined for e.g. `Keyboard.LEFT_SHIFT` (340). If all you want is the corresponding name
41
+ * of the key, then simply use the enum reverse mapping (e.g. `Keyboard[keyboard]`).
34
42
  */
35
43
  export declare function keyboardToString(keyboard: Keyboard, uppercase: boolean): string | undefined;
36
44
  //# sourceMappingURL=input.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"input.d.ts","sourceRoot":"","sources":["../../src/functions/input.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EACZ,UAAU,EAEV,QAAQ,EACT,MAAM,8BAA8B,CAAC;AAsCtC,iFAAiF;AACjF,wBAAgB,kBAAkB,CAAC,UAAU,EAAE,UAAU,GAAG,MAAM,GAAG,SAAS,CAO7E;AAED,wBAAgB,cAAc,IAAI,WAAW,CAAC,YAAY,CAAC,CAE1D;AAED,wBAAgB,eAAe,IAAI,WAAW,CAAC,YAAY,CAAC,CAE3D;AAED,gGAAgG;AAChG,wBAAgB,yBAAyB,CAAC,YAAY,EAAE,YAAY,GAAG,OAAO,CAK7E;AAED;;;GAGG;AACH,wBAAgB,2BAA2B,CACzC,YAAY,EAAE,YAAY,GACzB,OAAO,CAKT;AAED;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,GAAG,IAAI,EAAE,QAAQ,EAAE,GAAG,OAAO,CAI9D;A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B,+BAA+B,IAAI,OAAO,CAIzD;AAED,wBAAgB,aAAa,CAAC,YAAY,EAAE,YAAY,GAAG,OAAO,CAEjE;AAED,wBAAgB,8BAA8B,IAAI,OAAO,CAIxD;AAED,wBAAgB,gCAAgC,IAAI,OAAO,CAI1D;AAED;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAC9B,QAAQ,EAAE,QAAQ,EAClB,SAAS,EAAE,OAAO,GACjB,MAAM,GAAG,SAAS,CAQpB"}
@@ -28,7 +28,8 @@ local MOVEMENT_ACTIONS = {ButtonAction.LEFT, ButtonAction.RIGHT, ButtonAction.UP
28
28
  local MOVEMENT_ACTIONS_SET = __TS__New(Set, MOVEMENT_ACTIONS)
29
29
  local SHOOTING_ACTIONS = {ButtonAction.SHOOT_LEFT, ButtonAction.SHOOT_RIGHT, ButtonAction.SHOOT_UP, ButtonAction.SHOOT_DOWN}
30
30
  local SHOOTING_ACTIONS_SET = __TS__New(Set, SHOOTING_ACTIONS)
31
- --- Helper function to get the enum name for the specified `Controller` value.
31
+ --- Helper function to get the enum name for the specified `Controller` value. Note that this will
32
+ -- trim off the "BUTTON_" prefix.
32
33
  function ____exports.controllerToString(self, controller)
33
34
  local key = Controller[controller]
34
35
  if key == nil then
@@ -110,6 +111,11 @@ function ____exports.isShootActionTriggeredOnAnyInput(self)
110
111
  )
111
112
  end
112
113
  --- Helper function to get the string that would be typed if someone pressed the corresponding key.
114
+ -- This is useful for creating in-game chat.
115
+ --
116
+ -- Note that this function will only work for the keyboard values that are printable. Thus, it will
117
+ -- return undefined for e.g. `Keyboard.LEFT_SHIFT` (340). If all you want is the corresponding name
118
+ -- of the key, then simply use the enum reverse mapping (e.g. `Keyboard[keyboard]`).
113
119
  function ____exports.keyboardToString(self, keyboard, uppercase)
114
120
  local tuple = KEYBOARD_TO_STRING:get(keyboard)
115
121
  if tuple == nil then
package/dist/index.d.ts CHANGED
@@ -542,7 +542,12 @@ export declare const AZAZEL_DEFAULT_BRIMSTONE_DISTANCE = 75.125;
542
542
  /**
543
543
  * Helper function to benchmark the performance of a function.
544
544
  *
545
- * This function is variadic, which means that you can supply as many as you want to benchmark.
545
+ * This function is variadic, which means that you can supply as many functions as you want to
546
+ * benchmark.
547
+ *
548
+ * This function uses the `Isaac.GetTime` method to record how long the function took to execute.
549
+ * This method only reports time in milliseconds. For this reason, if you are benchmarking smaller
550
+ * functions, then you should provide a very high value for the number of trials.
546
551
  *
547
552
  * @returns An array containing the average time in milliseconds for each function. (This will also
548
553
  * be printed to the log.)
@@ -851,7 +856,10 @@ export declare function combineArrays<T>(...arrays: Array<T[] | readonly T[]>):
851
856
  */
852
857
  export declare function combineSets<T>(...sets: Array<Set<T> | ReadonlySet<T>>): Set<T>;
853
858
 
854
- /** Helper function to get the enum name for the specified `Controller` value. */
859
+ /**
860
+ * Helper function to get the enum name for the specified `Controller` value. Note that this will
861
+ * trim off the "BUTTON_" prefix.
862
+ */
855
863
  export declare function controllerToString(controller: Controller): string | undefined;
856
864
 
857
865
  export declare type ConversionHeartSubType = HeartSubType.SOUL | HeartSubType.BLACK;
@@ -1477,10 +1485,13 @@ export declare interface CustomStageTSConfig {
1477
1485
  * `deepCopy` is a semi-generic deep cloner. It will recursively copy all of the values so that none
1478
1486
  * of the nested references remain.
1479
1487
  *
1480
- * It supports the following object types:
1488
+ * `deepCopy` is used by the IsaacScript save data manager to make a backup of your variables, so
1489
+ * that it can restore them to the default values at the beginning of a new room, floor, or run.
1490
+ *
1491
+ * `deepCopy` supports the following object types:
1481
1492
  *
1482
1493
  * - Primitives (i.e. strings, numbers, and booleans)
1483
- * - Basic TSTL objects / tables
1494
+ * - Basic TSTL objects (which are the same thing as Lua tables)
1484
1495
  * - TSTL `Map`
1485
1496
  * - TSTL `Set`
1486
1497
  * - TSTL classes
@@ -2990,12 +3001,11 @@ export declare function getEntityFields(entity: Entity): LuaMap<string, boolean
2990
3001
  */
2991
3002
  export declare function getEntityFromPtrHash(ptrHash: PtrHash): Entity | undefined;
2992
3003
 
2993
- /** Helper function to return a string containing the entity's type, variant, and sub-type. */
3004
+ /** Helper function to get a string containing the entity's type, variant, and sub-type. */
2994
3005
  export declare function getEntityID(entity: Entity): string;
2995
3006
 
2996
3007
  /**
2997
- * Helper function to return a formatted string in the format returned by the `getEntityID`
2998
- * function.
3008
+ * Helper function to get a formatted string in the format returned by the `getEntityID` function.
2999
3009
  */
3000
3010
  export declare function getEntityIDFromConstituents(entityType: EntityType, variant: int, subType: int): string;
3001
3011
 
@@ -3249,11 +3259,11 @@ export declare function getGridEntitiesExcept(...gridEntityTypes: GridEntityType
3249
3259
  */
3250
3260
  export declare function getGridEntitiesMap(...gridEntityTypes: GridEntityType[]): Map<int, GridEntity>;
3251
3261
 
3252
- /** Helper function to return a string containing the grid entity's type and variant. */
3262
+ /** Helper function to get a string containing the grid entity's type and variant. */
3253
3263
  export declare function getGridEntityID(gridEntity: GridEntity): string;
3254
3264
 
3255
3265
  /**
3256
- * Helper function to return a formatted string in the format returned by the `getGridEntityID`
3266
+ * Helper function to get a formatted string in the format returned by the `getGridEntityID`
3257
3267
  * function.
3258
3268
  */
3259
3269
  export declare function getGridEntityIDFromConstituents(gridEntityType: GridEntityType, variant: int): string;
@@ -5424,9 +5434,6 @@ export declare function inDoubleTrouble(): boolean;
5424
5434
 
5425
5435
  export declare function inGenesisRoom(): boolean;
5426
5436
 
5427
- /** Initializes an array with all elements containing the specified default value. */
5428
- export declare function initArray<T>(defaultValue: T, size: int): T[];
5429
-
5430
5437
  /**
5431
5438
  * `isaacscript-common` provides custom doors that can be spawned where any wall segment is. If you
5432
5439
  * use this feature, you must first call this initialization function at the beginning of your mod.
@@ -6454,6 +6461,11 @@ export declare function kColorEquals(kColor1: KColor, kColor2: KColor): boolean;
6454
6461
 
6455
6462
  /**
6456
6463
  * Helper function to get the string that would be typed if someone pressed the corresponding key.
6464
+ * This is useful for creating in-game chat.
6465
+ *
6466
+ * Note that this function will only work for the keyboard values that are printable. Thus, it will
6467
+ * return undefined for e.g. `Keyboard.LEFT_SHIFT` (340). If all you want is the corresponding name
6468
+ * of the key, then simply use the enum reverse mapping (e.g. `Keyboard[keyboard]`).
6457
6469
  */
6458
6470
  export declare function keyboardToString(keyboard: Keyboard, uppercase: boolean): string | undefined;
6459
6471
 
@@ -9587,6 +9599,11 @@ export declare function removeCollectibleCostume(player: EntityPlayer, collectib
9587
9599
  *
9588
9600
  * The "item tracker" in this function does not refer to the in-game item tracker, but rather to the
9589
9601
  * Python program located at: https://github.com/Rchardon/RebirthItemTracker
9602
+ *
9603
+ * This function is useful when you need to add a "fake" collectible to a player. Note that calling
9604
+ * this function is not necessary when removing items from players. For example, when you remove a
9605
+ * collectible with the `EntityPlayer.RemoveCollectible` method, a proper message is sent to the log
9606
+ * the item tracker will automatically remove it.
9590
9607
  */
9591
9608
  export declare function removeCollectibleFromItemTracker(collectibleType: CollectibleType): void;
9592
9609
 
@@ -10009,8 +10026,8 @@ export declare enum SaveDataKey {
10009
10026
  * 1. automatic resetting of variables on a new run, on a new level, or on a new room (as desired)
10010
10027
  * 2. automatic saving and loading of all tracked data to the "save#.dat" file
10011
10028
  *
10012
- * You feed this function with an anonymous object containing your variables, and then it will
10013
- * automatically manage them for you. (See below for an example.)
10029
+ * You feed this function with an object containing your variables, and then it will automatically
10030
+ * manage them for you. (See below for an example.)
10014
10031
  *
10015
10032
  * The save data manager is meant to be called once for each feature of your mod. In other words,
10016
10033
  * you should not put all of the data for your mod on the same object. Instead, scope your variables
@@ -10958,6 +10975,42 @@ export declare function spawnCustomDoor(effectVariant: EffectVariant, doorSlot:
10958
10975
  * Custom grid entities are an IsaacScript feature because the vanilla game does not support any
10959
10976
  * custom grid entities.
10960
10977
  *
10978
+ * For example, this would be code to create a custom rock called a "Silver Rock" that produces a
10979
+ * dime when destroyed:
10980
+ *
10981
+ * ```ts
10982
+ * // This is local to the mod and can safely overlap with the values of `GridEntityType`.
10983
+ * const GridEntityTypeCustom = {
10984
+ * SILVER_ROCK: 0 as GridEntityType,
10985
+ * } as const;
10986
+ *
10987
+ * // This is copied from "gfx/grid/grid_rock.anm2" with some tweaks to make it look special.
10988
+ * const SILVER_ROCK_ANM2_PATH = "gfx/grid/grid_rock_silver.anm2";
10989
+ *
10990
+ * export function silverRockInit(mod: ModUpgraded): void {
10991
+ * mod.AddCallbackCustom(
10992
+ * ModCallbackCustom.POST_GRID_ENTITY_CUSTOM_BROKEN,
10993
+ * postGridEntityCustomBrokenSilverRock,
10994
+ * GridEntityTypeCustom.SILVER_ROCK,
10995
+ * );
10996
+ * }
10997
+ *
10998
+ * function postGridEntityCustomBrokenSilverRock(gridEntity: GridEntity) {
10999
+ * spawnCoin(CoinSubType.DIME, gridEntity.Position);
11000
+ * }
11001
+ *
11002
+ * export function spawnSilverRock(gridIndex: int): GridEntity {
11003
+ * return spawnCustomGridEntity(
11004
+ * GridEntityTypeCustom.SILVER_ROCK,
11005
+ * gridIndex,
11006
+ * undefined,
11007
+ * SILVER_ROCK_ANM2_PATH,
11008
+ * undefined,
11009
+ * GridEntityType.ROCK,
11010
+ * );
11011
+ * }
11012
+ * ```
11013
+ *
10961
11014
  * @param gridEntityTypeCustom An integer that identifies what kind of grid entity you are creating.
10962
11015
  * It should correspond to a local enum value created in your mod. The
10963
11016
  * integer can be any unique value and will not correspond to the actual
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "isaacscript-common",
3
- "version": "9.10.0",
3
+ "version": "9.12.0",
4
4
  "description": "Helper functions and features for IsaacScript mods.",
5
5
  "keywords": [
6
6
  "isaac",
@@ -22,6 +22,6 @@
22
22
  "main": "dist/index",
23
23
  "types": "dist/index.d.ts",
24
24
  "dependencies": {
25
- "isaac-typescript-definitions": "^4.0.3"
25
+ "isaac-typescript-definitions": "^4.0.4"
26
26
  }
27
27
  }
@@ -160,6 +160,42 @@ function postNewRoomReordered() {
160
160
  * Custom grid entities are an IsaacScript feature because the vanilla game does not support any
161
161
  * custom grid entities.
162
162
  *
163
+ * For example, this would be code to create a custom rock called a "Silver Rock" that produces a
164
+ * dime when destroyed:
165
+ *
166
+ * ```ts
167
+ * // This is local to the mod and can safely overlap with the values of `GridEntityType`.
168
+ * const GridEntityTypeCustom = {
169
+ * SILVER_ROCK: 0 as GridEntityType,
170
+ * } as const;
171
+ *
172
+ * // This is copied from "gfx/grid/grid_rock.anm2" with some tweaks to make it look special.
173
+ * const SILVER_ROCK_ANM2_PATH = "gfx/grid/grid_rock_silver.anm2";
174
+ *
175
+ * export function silverRockInit(mod: ModUpgraded): void {
176
+ * mod.AddCallbackCustom(
177
+ * ModCallbackCustom.POST_GRID_ENTITY_CUSTOM_BROKEN,
178
+ * postGridEntityCustomBrokenSilverRock,
179
+ * GridEntityTypeCustom.SILVER_ROCK,
180
+ * );
181
+ * }
182
+ *
183
+ * function postGridEntityCustomBrokenSilverRock(gridEntity: GridEntity) {
184
+ * spawnCoin(CoinSubType.DIME, gridEntity.Position);
185
+ * }
186
+ *
187
+ * export function spawnSilverRock(gridIndex: int): GridEntity {
188
+ * return spawnCustomGridEntity(
189
+ * GridEntityTypeCustom.SILVER_ROCK,
190
+ * gridIndex,
191
+ * undefined,
192
+ * SILVER_ROCK_ANM2_PATH,
193
+ * undefined,
194
+ * GridEntityType.ROCK,
195
+ * );
196
+ * }
197
+ * ```
198
+ *
163
199
  * @param gridEntityTypeCustom An integer that identifies what kind of grid entity you are creating.
164
200
  * It should correspond to a local enum value created in your mod. The
165
201
  * integer can be any unique value and will not correspond to the actual
@@ -97,6 +97,7 @@ import {
97
97
  } from "../../functions/players";
98
98
  import { gridCoordinatesToWorldPosition } from "../../functions/roomGrid";
99
99
  import { changeRoom } from "../../functions/rooms";
100
+ import { reloadRoom as reloadRoomFunction } from "../../functions/roomTransition";
100
101
  import { onSetSeed, restart, setUnseeded } from "../../functions/run";
101
102
  import { setStage } from "../../functions/stage";
102
103
  import { getGoldenTrinketType } from "../../functions/trinkets";
@@ -206,11 +207,6 @@ export function bedroom(): void {
206
207
  printConsole("There are no Clean Bedrooms or Dirty Bedrooms on this floor.");
207
208
  }
208
209
 
209
- /** Alias for the "blackhearts" command. */
210
- export function bh(params: string): void {
211
- blackHearts(params);
212
- }
213
-
214
210
  /**
215
211
  * Gives a half black heart. Provide a number to give a custom amount of hearts. (You can use
216
212
  * negative numbers to remove hearts.)
@@ -572,11 +568,6 @@ export function effects(): void {
572
568
  printConsole('Logged the player\'s effects to the "log.txt" file.');
573
569
  }
574
570
 
575
- /** Alias for the "eternalHearts" command. */
576
- export function eh(params: string): void {
577
- eternalHearts(params);
578
- }
579
-
580
571
  /** Alias for the "iAmError" command. */
581
572
  export function errorRoom(): void {
582
573
  iAmErrorRoom();
@@ -1050,6 +1041,11 @@ export function redHearts(params: string): void {
1050
1041
  hearts(params);
1051
1042
  }
1052
1043
 
1044
+ /** Starts a room transition to the same room that you are already in. */
1045
+ export function reloadRoom(): void {
1046
+ reloadRoomFunction();
1047
+ }
1048
+
1053
1049
  /** Moves the player 0.5 units right. Provide a number to move a custom amount of units. */
1054
1050
  export function right(params: string): void {
1055
1051
  movePlayer(params, Direction.RIGHT);
@@ -22,8 +22,8 @@ import { SAVE_DATA_MANAGER_FEATURE_NAME } from "./saveDataManagerConstants";
22
22
  * 1. automatic resetting of variables on a new run, on a new level, or on a new room (as desired)
23
23
  * 2. automatic saving and loading of all tracked data to the "save#.dat" file
24
24
  *
25
- * You feed this function with an anonymous object containing your variables, and then it will
26
- * automatically manage them for you. (See below for an example.)
25
+ * You feed this function with an object containing your variables, and then it will automatically
26
+ * manage them for you. (See below for an example.)
27
27
  *
28
28
  * The save data manager is meant to be called once for each feature of your mod. In other words,
29
29
  * you should not put all of the data for your mod on the same object. Instead, scope your variables
@@ -1,7 +1,7 @@
1
1
  import { getRandomInt } from "./random";
2
2
  import { getRandomSeed, isRNG, newRNG } from "./rng";
3
3
  import { isNumber, isTable } from "./types";
4
- import { erange, repeat } from "./utils";
4
+ import { erange } from "./utils";
5
5
 
6
6
  /**
7
7
  * Helper function for determining if two arrays contain the exact same elements. Note that this
@@ -399,16 +399,6 @@ export function getRandomArrayIndex<T>(
399
399
  return getRandomInt(0, array.length - 1, seedOrRNG, exceptions);
400
400
  }
401
401
 
402
- /** Initializes an array with all elements containing the specified default value. */
403
- export function initArray<T>(defaultValue: T, size: int): T[] {
404
- const array: T[] = [];
405
- repeat(size, () => {
406
- array.push(defaultValue);
407
- });
408
-
409
- return array;
410
- }
411
-
412
402
  /**
413
403
  * Since Lua uses tables for every non-primitive data structure, it is non-trivial to determine if a
414
404
  * particular table is being used as an array. `isArray` returns true if:
@@ -3,7 +3,12 @@ import { log } from "./log";
3
3
  /**
4
4
  * Helper function to benchmark the performance of a function.
5
5
  *
6
- * This function is variadic, which means that you can supply as many as you want to benchmark.
6
+ * This function is variadic, which means that you can supply as many functions as you want to
7
+ * benchmark.
8
+ *
9
+ * This function uses the `Isaac.GetTime` method to record how long the function took to execute.
10
+ * This method only reports time in milliseconds. For this reason, if you are benchmarking smaller
11
+ * functions, then you should provide a very high value for the number of trials.
7
12
  *
8
13
  * @returns An array containing the average time in milliseconds for each function. (This will also
9
14
  * be printed to the log.)
@@ -494,6 +494,11 @@ export function newCollectibleSprite(collectibleType: CollectibleType): Sprite {
494
494
  *
495
495
  * The "item tracker" in this function does not refer to the in-game item tracker, but rather to the
496
496
  * Python program located at: https://github.com/Rchardon/RebirthItemTracker
497
+ *
498
+ * This function is useful when you need to add a "fake" collectible to a player. Note that calling
499
+ * this function is not necessary when removing items from players. For example, when you remove a
500
+ * collectible with the `EntityPlayer.RemoveCollectible` method, a proper message is sent to the log
501
+ * the item tracker will automatically remove it.
497
502
  */
498
503
  export function removeCollectibleFromItemTracker(
499
504
  collectibleType: CollectibleType,
@@ -34,10 +34,13 @@ const COPYABLE_ISAAC_API_CLASS_TYPES_SET = new Set<string>(
34
34
  * `deepCopy` is a semi-generic deep cloner. It will recursively copy all of the values so that none
35
35
  * of the nested references remain.
36
36
  *
37
- * It supports the following object types:
37
+ * `deepCopy` is used by the IsaacScript save data manager to make a backup of your variables, so
38
+ * that it can restore them to the default values at the beginning of a new room, floor, or run.
39
+ *
40
+ * `deepCopy` supports the following object types:
38
41
  *
39
42
  * - Primitives (i.e. strings, numbers, and booleans)
40
- * - Basic TSTL objects / tables
43
+ * - Basic TSTL objects (which are the same thing as Lua tables)
41
44
  * - TSTL `Map`
42
45
  * - TSTL `Set`
43
46
  * - TSTL classes
@@ -204,14 +204,13 @@ export function getEntityFromPtrHash(ptrHash: PtrHash): Entity | undefined {
204
204
  return entities.find((entity) => GetPtrHash(entity) === ptrHash);
205
205
  }
206
206
 
207
- /** Helper function to return a string containing the entity's type, variant, and sub-type. */
207
+ /** Helper function to get a string containing the entity's type, variant, and sub-type. */
208
208
  export function getEntityID(entity: Entity): string {
209
209
  return `${entity.Type}.${entity.Variant}.${entity.SubType}`;
210
210
  }
211
211
 
212
212
  /**
213
- * Helper function to return a formatted string in the format returned by the `getEntityID`
214
- * function.
213
+ * Helper function to get a formatted string in the format returned by the `getEntityID` function.
215
214
  */
216
215
  export function getEntityIDFromConstituents(
217
216
  entityType: EntityType,
@@ -226,7 +226,7 @@ export function getGridEntitiesMap(
226
226
  return gridEntityMap;
227
227
  }
228
228
 
229
- /** Helper function to return a string containing the grid entity's type and variant. */
229
+ /** Helper function to get a string containing the grid entity's type and variant. */
230
230
  export function getGridEntityID(gridEntity: GridEntity): string {
231
231
  const gridEntityType = gridEntity.GetType();
232
232
  const variant = gridEntity.GetVariant();
@@ -234,7 +234,7 @@ export function getGridEntityID(gridEntity: GridEntity): string {
234
234
  }
235
235
 
236
236
  /**
237
- * Helper function to return a formatted string in the format returned by the `getGridEntityID`
237
+ * Helper function to get a formatted string in the format returned by the `getGridEntityID`
238
238
  * function.
239
239
  */
240
240
  export function getGridEntityIDFromConstituents(
@@ -0,0 +1,32 @@
1
+ import { deepCopy } from "./deepCopy";
2
+ import { isPrimitive } from "./types";
3
+ import { repeat } from "./utils";
4
+
5
+ /**
6
+ * Initializes an array with all of the elements containing the specified default value.
7
+ *
8
+ * If the provided default value is not a boolean, number, or string, then it will be copied with
9
+ * the `deepCopy` function before adding it to the new array. In this way, you can initialize an
10
+ * array of arrays, or an array of maps, and so on. (If the `deepCopy` function was not used, then
11
+ * all of the array elements would just be references to the same underlying data structure.)
12
+ *
13
+ * For example:
14
+ *
15
+ * ```ts
16
+ * const arrayWithZeroes = initArray(0, 10); // Has 10 elements of 0.
17
+ * const arrayWithArrays = initArray([0], 20); // Has 20 elements of an array with a 0 in it.
18
+ * ```
19
+ */
20
+ export function initArray<T>(defaultValue: T, size: int): T[] {
21
+ const array: T[] = [];
22
+ repeat(size, () => {
23
+ if (isPrimitive(defaultValue)) {
24
+ array.push(defaultValue);
25
+ } else {
26
+ const copy = deepCopy(defaultValue) as T;
27
+ array.push(copy);
28
+ }
29
+ });
30
+
31
+ return array;
32
+ }
@@ -41,7 +41,10 @@ const SHOOTING_ACTIONS_SET: ReadonlySet<ButtonAction> = new Set(
41
41
  SHOOTING_ACTIONS,
42
42
  );
43
43
 
44
- /** Helper function to get the enum name for the specified `Controller` value. */
44
+ /**
45
+ * Helper function to get the enum name for the specified `Controller` value. Note that this will
46
+ * trim off the "BUTTON_" prefix.
47
+ */
45
48
  export function controllerToString(controller: Controller): string | undefined {
46
49
  const key = Controller[controller];
47
50
  if (key === undefined) {
@@ -135,6 +138,11 @@ export function isShootActionTriggeredOnAnyInput(): boolean {
135
138
 
136
139
  /**
137
140
  * Helper function to get the string that would be typed if someone pressed the corresponding key.
141
+ * This is useful for creating in-game chat.
142
+ *
143
+ * Note that this function will only work for the keyboard values that are printable. Thus, it will
144
+ * return undefined for e.g. `Keyboard.LEFT_SHIFT` (340). If all you want is the corresponding name
145
+ * of the key, then simply use the enum reverse mapping (e.g. `Keyboard[keyboard]`).
138
146
  */
139
147
  export function keyboardToString(
140
148
  keyboard: Keyboard,