isaacscript-common 33.2.0 → 33.3.1

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.
@@ -7737,6 +7737,13 @@ export declare function inRange(num: int, start: int, end: int): boolean;
7737
7737
  */
7738
7738
  export declare function inRectangle(position: Vector, topLeft: Vector, bottomRight: Vector): boolean;
7739
7739
 
7740
+ /**
7741
+ * Helper function to check if the current room shape matches one of the given room shapes.
7742
+ *
7743
+ * This function is variadic, which means you can pass as many room shapes as you want to match for.
7744
+ */
7745
+ export declare function inRoomShape(...roomShapes: RoomShape[]): boolean;
7746
+
7740
7747
  /**
7741
7748
  * Helper function to check if the current room matches one of the given room types.
7742
7749
  *
@@ -8731,6 +8738,13 @@ export declare function isRock(variable: unknown): variable is GridEntityRock;
8731
8738
  */
8732
8739
  export declare function isRoomInsideGrid(roomGridIndex?: int): boolean;
8733
8740
 
8741
+ /**
8742
+ * Helper function to check if the provided room matches one of the given room shapes.
8743
+ *
8744
+ * This function is variadic, which means you can pass as many room shapes as you want to match for.
8745
+ */
8746
+ export declare function isRoomShape(roomData: RoomConfig, ...roomShapes: RoomShape[]): boolean;
8747
+
8734
8748
  /**
8735
8749
  * Helper function to see if a given room shape will grant a single charge or a double charge to the
8736
8750
  * player's active item(s).
@@ -16130,6 +16144,11 @@ export declare function setStage(stage: LevelStage, stageType: StageType, reseed
16130
16144
  /** Helper function to convert a set of flags to a single `BitFlags` object. */
16131
16145
  export declare function setToBitFlags<T extends BitFlag | BitFlag128>(set: Set<T> | ReadonlySet<T>): BitFlags<T>;
16132
16146
 
16147
+ /**
16148
+ * Sets the `traceback` and `getTraceback` functions to be global functions.
16149
+ *
16150
+ * This is useful when editing Lua files when troubleshooting.
16151
+ */
16133
16152
  export declare function setTracebackFunctionsGlobal(): void;
16134
16153
 
16135
16154
  /**
@@ -1,6 +1,6 @@
1
1
  --[[
2
2
 
3
- isaacscript-common 33.2.0
3
+ isaacscript-common 33.3.1
4
4
 
5
5
  This is the "isaacscript-common" library, which was created with the IsaacScript tool.
6
6
 
@@ -27686,6 +27686,10 @@ end
27686
27686
  function ____exports.isMirrorRoom(self, roomData)
27687
27687
  return roomData.Type == RoomType.DEFAULT and (roomData.StageID == StageID.DOWNPOUR or roomData.StageID == StageID.DROSS) and roomData.Subtype == asNumber(nil, DownpourRoomSubType.MIRROR)
27688
27688
  end
27689
+ function ____exports.isRoomShape(self, roomData, ...)
27690
+ local roomShapes = {...}
27691
+ return __TS__ArrayIncludes(roomShapes, roomData.Shape)
27692
+ end
27689
27693
  function ____exports.isRoomType(self, roomData, ...)
27690
27694
  local roomTypes = {...}
27691
27695
  return __TS__ArrayIncludes(roomTypes, roomData.Type)
@@ -27822,6 +27826,10 @@ function ____exports.inMirrorRoom(self)
27822
27826
  local roomData = getRoomData(nil)
27823
27827
  return ____exports.isMirrorRoom(nil, roomData)
27824
27828
  end
27829
+ function ____exports.inRoomShape(self, ...)
27830
+ local roomData = getRoomData(nil)
27831
+ return ____exports.isRoomShape(nil, roomData, ...)
27832
+ end
27825
27833
  function ____exports.inRoomType(self, ...)
27826
27834
  local roomData = getRoomData(nil)
27827
27835
  return ____exports.isRoomType(nil, roomData, ...)
@@ -27901,12 +27909,12 @@ function ____exports.setRoomCleared(self)
27901
27909
  for ____, door in ipairs(getDoors(nil)) do
27902
27910
  do
27903
27911
  if isHiddenSecretRoomDoor(nil, door) then
27904
- goto __continue76
27912
+ goto __continue78
27905
27913
  end
27906
27914
  openDoorFast(nil, door)
27907
27915
  door.ExtraVisible = false
27908
27916
  end
27909
- ::__continue76::
27917
+ ::__continue78::
27910
27918
  end
27911
27919
  sfxManager:Stop(SoundEffect.DOOR_HEAVY_OPEN)
27912
27920
  game:ShakeScreen(0)
@@ -18,5 +18,10 @@ export declare function logNewGlobals(): void;
18
18
  * This is useful when printing out variables from the in-game debug console.
19
19
  */
20
20
  export declare function setLogFunctionsGlobal(): void;
21
+ /**
22
+ * Sets the `traceback` and `getTraceback` functions to be global functions.
23
+ *
24
+ * This is useful when editing Lua files when troubleshooting.
25
+ */
21
26
  export declare function setTracebackFunctionsGlobal(): void;
22
27
  //# sourceMappingURL=globals.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"globals.d.ts","sourceRoot":"","sources":["../../../src/functions/globals.ts"],"names":[],"mappings":";AA6LA;;;;;GAKG;AACH,wBAAgB,iBAAiB,IAAI,WAAW,CAAC,MAAM,CAAC,CAYvD;AAMD;;;GAGG;AACH,wBAAgB,aAAa,IAAI,aAAa,CAAC,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC,CAcnE;AAED,wBAAgB,aAAa,IAAI,IAAI,CAapC;AAED;;;;GAIG;AACH,wBAAgB,qBAAqB,IAAI,IAAI,CAS5C;AAED,wBAAgB,2BAA2B,IAAI,IAAI,CAKlD"}
1
+ {"version":3,"file":"globals.d.ts","sourceRoot":"","sources":["../../../src/functions/globals.ts"],"names":[],"mappings":";AA6LA;;;;;GAKG;AACH,wBAAgB,iBAAiB,IAAI,WAAW,CAAC,MAAM,CAAC,CAYvD;AAMD;;;GAGG;AACH,wBAAgB,aAAa,IAAI,aAAa,CAAC,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC,CAcnE;AAED,wBAAgB,aAAa,IAAI,IAAI,CAapC;AAED;;;;GAIG;AACH,wBAAgB,qBAAqB,IAAI,IAAI,CAS5C;AAED;;;;GAIG;AACH,wBAAgB,2BAA2B,IAAI,IAAI,CAKlD"}
@@ -254,6 +254,9 @@ function ____exports.setLogFunctionsGlobal(self)
254
254
  end
255
255
  end
256
256
  end
257
+ --- Sets the `traceback` and `getTraceback` functions to be global functions.
258
+ --
259
+ -- This is useful when editing Lua files when troubleshooting.
257
260
  function ____exports.setTracebackFunctionsGlobal(self)
258
261
  local globals = _G
259
262
  globals.getTraceback = getTraceback
@@ -1,5 +1,5 @@
1
1
  import type { BackdropType, BossID, ItemPoolType, MinibossID } from "isaac-typescript-definitions";
2
- import { Dimension, RoomType } from "isaac-typescript-definitions";
2
+ import { Dimension, RoomShape, RoomType } from "isaac-typescript-definitions";
3
3
  /**
4
4
  * Helper function for quickly switching to a new room without playing a particular animation. Use
5
5
  * this helper function over invoking the `Game.ChangeRoom` method directly to ensure that you do
@@ -167,6 +167,12 @@ export declare function inMinibossRoomOf(minibossID: MinibossID): boolean;
167
167
  * rooms are marked with a specific sub-type.)
168
168
  */
169
169
  export declare function inMirrorRoom(): boolean;
170
+ /**
171
+ * Helper function to check if the current room shape matches one of the given room shapes.
172
+ *
173
+ * This function is variadic, which means you can pass as many room shapes as you want to match for.
174
+ */
175
+ export declare function inRoomShape(...roomShapes: RoomShape[]): boolean;
170
176
  /**
171
177
  * Helper function to check if the current room matches one of the given room types.
172
178
  *
@@ -280,6 +286,12 @@ export declare function isMinibossRoomOf(roomData: RoomConfig, minibossID: Minib
280
286
  * rooms are marked with a specific sub-type.)
281
287
  */
282
288
  export declare function isMirrorRoom(roomData: RoomConfig): boolean;
289
+ /**
290
+ * Helper function to check if the provided room matches one of the given room shapes.
291
+ *
292
+ * This function is variadic, which means you can pass as many room shapes as you want to match for.
293
+ */
294
+ export declare function isRoomShape(roomData: RoomConfig, ...roomShapes: RoomShape[]): boolean;
283
295
  /**
284
296
  * Helper function to check if the provided room matches one of the given room types.
285
297
  *
@@ -1 +1 @@
1
- {"version":3,"file":"rooms.d.ts","sourceRoot":"","sources":["../../../src/functions/rooms.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,YAAY,EACZ,MAAM,EACN,YAAY,EACZ,UAAU,EACX,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAEL,SAAS,EAQT,QAAQ,EAGT,MAAM,8BAA8B,CAAC;AAuCtC;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,aAAa,EAAE,GAAG,GAAG,IAAI,CAcnD;AAED;;;GAGG;AACH,wBAAgB,WAAW,IAAI,GAAG,CAGjC;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,gBAAgB,IAAI,KAAK,CAAC,QA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O,CAO1D;AAED;;;;GAIG;AACH,wBAAgB,WAAW,CACzB,QAAQ,EAAE,UAAU,EACpB,GAAG,UAAU,EAAE,SAAS,EAAE,GACzB,OAAO,CAET;AAED;;;;GAIG;AACH,wBAAgB,UAAU,CACxB,QAAQ,EAAE,UAAU,EACpB,GAAG,SAAS,EAAE,QAAQ,EAAE,GACvB,OAAO,CAET;AAED;;;GAGG;AACH,wBAAgB,YAAY,CAAC,cAAc,EAAE,cAAc,GAAG,OAAO,CAEpE;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,QAAQ,GAAG,OAAO,CAE5D;AAED;;;;;;;GAOG;AACH,wBAAgB,YAAY,CAAC,cAAc,EAAE,cAAc,GAAG,OAAO,CAEpE;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,IAAI,IAAI,CAWrC;AAED,iFAAiF;AACjF,wBAAgB,WAAW,CAAC,YAAY,EAAE,YAAY,GAAG,IAAI,CAG5D;AAED;;;;GAIG;AACH,wBAAgB,cAAc,IAAI,IAAI,CA8BrC;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,IAAI,IAAI,CAKvC"}
@@ -213,6 +213,13 @@ end
213
213
  function ____exports.isMirrorRoom(self, roomData)
214
214
  return roomData.Type == RoomType.DEFAULT and (roomData.StageID == StageID.DOWNPOUR or roomData.StageID == StageID.DROSS) and roomData.Subtype == asNumber(nil, DownpourRoomSubType.MIRROR)
215
215
  end
216
+ --- Helper function to check if the provided room matches one of the given room shapes.
217
+ --
218
+ -- This function is variadic, which means you can pass as many room shapes as you want to match for.
219
+ function ____exports.isRoomShape(self, roomData, ...)
220
+ local roomShapes = {...}
221
+ return __TS__ArrayIncludes(roomShapes, roomData.Shape)
222
+ end
216
223
  --- Helper function to check if the provided room matches one of the given room types.
217
224
  --
218
225
  -- This function is variadic, which means you can pass as many room types as you want to match for.
@@ -442,6 +449,13 @@ function ____exports.inMirrorRoom(self)
442
449
  local roomData = getRoomData(nil)
443
450
  return ____exports.isMirrorRoom(nil, roomData)
444
451
  end
452
+ --- Helper function to check if the current room shape matches one of the given room shapes.
453
+ --
454
+ -- This function is variadic, which means you can pass as many room shapes as you want to match for.
455
+ function ____exports.inRoomShape(self, ...)
456
+ local roomData = getRoomData(nil)
457
+ return ____exports.isRoomShape(nil, roomData, ...)
458
+ end
445
459
  --- Helper function to check if the current room matches one of the given room types.
446
460
  --
447
461
  -- This function is variadic, which means you can pass as many room types as you want to match for.
@@ -557,12 +571,12 @@ function ____exports.setRoomCleared(self)
557
571
  for ____, door in ipairs(getDoors(nil)) do
558
572
  do
559
573
  if isHiddenSecretRoomDoor(nil, door) then
560
- goto __continue76
574
+ goto __continue78
561
575
  end
562
576
  openDoorFast(nil, door)
563
577
  door.ExtraVisible = false
564
578
  end
565
- ::__continue76::
579
+ ::__continue78::
566
580
  end
567
581
  sfxManager:Stop(SoundEffect.DOOR_HEAVY_OPEN)
568
582
  game:ShakeScreen(0)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "isaacscript-common",
3
- "version": "33.2.0",
3
+ "version": "33.3.1",
4
4
  "description": "Helper functions and features for IsaacScript mods.",
5
5
  "keywords": [
6
6
  "isaac",
@@ -262,6 +262,11 @@ export function setLogFunctionsGlobal(): void {
262
262
  }
263
263
  }
264
264
 
265
+ /**
266
+ * Sets the `traceback` and `getTraceback` functions to be global functions.
267
+ *
268
+ * This is useful when editing Lua files when troubleshooting.
269
+ */
265
270
  export function setTracebackFunctionsGlobal(): void {
266
271
  const globals = _G as Record<string, unknown>;
267
272
 
@@ -266,13 +266,13 @@ export function getGridEntitiesInRadius(
266
266
  targetPosition: Vector,
267
267
  radius: number,
268
268
  ): GridEntity[] {
269
- radius = math.abs(radius);
269
+ radius = Math.abs(radius);
270
270
  const topLeftOffset = VectorOne.mul(-radius);
271
271
  const mostTopLeftPosition = targetPosition.add(topLeftOffset);
272
272
  const room = game.GetRoom();
273
273
 
274
274
  const diameter = radius * 2;
275
- const iterations = math.ceil(diameter / DISTANCE_OF_GRID_TILE);
275
+ const iterations = Math.ceil(diameter / DISTANCE_OF_GRID_TILE);
276
276
  const separation = diameter / iterations;
277
277
 
278
278
  const gridEntities: GridEntity[] = [];
@@ -136,7 +136,7 @@ export function getPlayerAvailableHeartSlots(player: EntityPlayer): int {
136
136
  const effectiveMaxHearts = player.GetEffectiveMaxHearts();
137
137
  const normalAndBoneHeartContainers = effectiveMaxHearts / 2;
138
138
  const soulHearts = player.GetSoulHearts();
139
- const soulHeartContainers = math.ceil(soulHearts / 2);
139
+ const soulHeartContainers = Math.ceil(soulHearts / 2);
140
140
  const totalHeartContainers =
141
141
  normalAndBoneHeartContainers + soulHeartContainers;
142
142
  const brokenHearts = player.GetBrokenHearts();
@@ -197,7 +197,7 @@ export function getPlayerHealth(player: EntityPlayer): PlayerHealth {
197
197
  }
198
198
 
199
199
  // This is the number of individual hearts shown in the HUD, minus heart containers.
200
- const extraHearts = math.ceil(soulHearts / 2) + boneHearts;
200
+ const extraHearts = Math.ceil(soulHearts / 2) + boneHearts;
201
201
 
202
202
  // Since bone hearts can be inserted anywhere between soul hearts, we need a separate counter to
203
203
  // track which soul heart we're currently at.
@@ -413,6 +413,16 @@ export function inMirrorRoom(): boolean {
413
413
  return isMirrorRoom(roomData);
414
414
  }
415
415
 
416
+ /**
417
+ * Helper function to check if the current room shape matches one of the given room shapes.
418
+ *
419
+ * This function is variadic, which means you can pass as many room shapes as you want to match for.
420
+ */
421
+ export function inRoomShape(...roomShapes: RoomShape[]): boolean {
422
+ const roomData = getRoomData();
423
+ return isRoomShape(roomData, ...roomShapes);
424
+ }
425
+
416
426
  /**
417
427
  * Helper function to check if the current room matches one of the given room types.
418
428
  *
@@ -674,6 +684,18 @@ export function isMirrorRoom(roomData: RoomConfig): boolean {
674
684
  );
675
685
  }
676
686
 
687
+ /**
688
+ * Helper function to check if the provided room matches one of the given room shapes.
689
+ *
690
+ * This function is variadic, which means you can pass as many room shapes as you want to match for.
691
+ */
692
+ export function isRoomShape(
693
+ roomData: RoomConfig,
694
+ ...roomShapes: RoomShape[]
695
+ ): boolean {
696
+ return roomShapes.includes(roomData.Shape);
697
+ }
698
+
677
699
  /**
678
700
  * Helper function to check if the provided room matches one of the given room types.
679
701
  *
@@ -31,7 +31,7 @@ export function addTearsStat(player: EntityPlayer, tearsStat: float): void {
31
31
  * - In this context, the "tears stat" represents what is shown on the in-game stat UI.
32
32
  */
33
33
  export function getFireDelay(tearsStat: float): float {
34
- return math.max(30 / tearsStat - 1, -0.9999);
34
+ return Math.max(30 / tearsStat - 1, -0.9999);
35
35
  }
36
36
 
37
37
  /**
@@ -15,7 +15,7 @@ import { copyVector } from "./vector";
15
15
  */
16
16
  export function getHUDOffsetVector(): Readonly<Vector> {
17
17
  // Convert e.g. 0.4 to 4.
18
- const hudOffset = math.floor(Options.HUDOffset * 10);
18
+ const hudOffset = Math.floor(Options.HUDOffset * 10);
19
19
 
20
20
  // Expected values are integers between 1 and 10.
21
21
  if (hudOffset < 1 || hudOffset > 10) {
@@ -145,9 +145,9 @@ export function getVisibleHearts(player: EntityPlayer): int {
145
145
  const soulHearts = player.GetSoulHearts();
146
146
  const boneHearts = player.GetBoneHearts();
147
147
 
148
- const maxHearts = math.max(effectiveMaxHearts, boneHearts * 2);
148
+ const maxHearts = Math.max(effectiveMaxHearts, boneHearts * 2);
149
149
 
150
- let visibleHearts = math.ceil((maxHearts + soulHearts) / 2);
150
+ let visibleHearts = Math.ceil((maxHearts + soulHearts) / 2);
151
151
  if (visibleHearts < 1) {
152
152
  visibleHearts = 1;
153
153
  }