isaacscript-common 33.3.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.
@@ -16144,6 +16144,11 @@ export declare function setStage(stage: LevelStage, stageType: StageType, reseed
16144
16144
  /** Helper function to convert a set of flags to a single `BitFlags` object. */
16145
16145
  export declare function setToBitFlags<T extends BitFlag | BitFlag128>(set: Set<T> | ReadonlySet<T>): BitFlags<T>;
16146
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
+ */
16147
16152
  export declare function setTracebackFunctionsGlobal(): void;
16148
16153
 
16149
16154
  /**
@@ -1,6 +1,6 @@
1
1
  --[[
2
2
 
3
- isaacscript-common 33.3.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
 
@@ -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
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "isaacscript-common",
3
- "version": "33.3.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.
@@ -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
  }