isaacscript-common 59.4.1 → 59.5.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 (47) hide show
  1. package/dist/index.rollup.d.ts +86 -1
  2. package/dist/isaacscript-common.lua +149 -47
  3. package/dist/src/classes/ModUpgraded.d.ts.map +1 -1
  4. package/dist/src/classes/ModUpgraded.lua +2 -2
  5. package/dist/src/classes/callbacks/PostCursedTeleport.d.ts.map +1 -1
  6. package/dist/src/classes/callbacks/PostCursedTeleport.lua +3 -2
  7. package/dist/src/classes/callbacks/PostItemDischarge.d.ts.map +1 -1
  8. package/dist/src/classes/callbacks/PostPickupInitFirst.d.ts.map +1 -1
  9. package/dist/src/classes/callbacks/PostPickupInitFirst.lua +3 -5
  10. package/dist/src/classes/features/callbackLogic/GameReorderedCallbacks.d.ts.map +1 -1
  11. package/dist/src/classes/features/callbackLogic/GameReorderedCallbacks.lua +5 -5
  12. package/dist/src/classes/features/other/CustomTrapdoors.d.ts.map +1 -1
  13. package/dist/src/classes/features/other/CustomTrapdoors.lua +10 -12
  14. package/dist/src/classes/features/other/PickupIndexCreation.d.ts.map +1 -1
  15. package/dist/src/classes/features/other/PickupIndexCreation.lua +3 -2
  16. package/dist/src/classes/features/other/PreventCollectibleRotation.d.ts.map +1 -1
  17. package/dist/src/classes/features/other/PreventCollectibleRotation.lua +3 -2
  18. package/dist/src/classes/features/other/SaveDataManager.d.ts.map +1 -1
  19. package/dist/src/classes/features/other/SaveDataManager.lua +3 -4
  20. package/dist/src/classes/features/other/customStages/streakText.d.ts.map +1 -1
  21. package/dist/src/classes/features/other/customStages/streakText.lua +6 -5
  22. package/dist/src/functions/debugFunctions.d.ts +7 -1
  23. package/dist/src/functions/debugFunctions.d.ts.map +1 -1
  24. package/dist/src/functions/debugFunctions.lua +22 -16
  25. package/dist/src/functions/frames.d.ts +68 -0
  26. package/dist/src/functions/frames.d.ts.map +1 -0
  27. package/dist/src/functions/frames.lua +119 -0
  28. package/dist/src/functions/revive.d.ts.map +1 -1
  29. package/dist/src/functions/revive.lua +3 -4
  30. package/dist/src/index.d.ts +1 -0
  31. package/dist/src/index.d.ts.map +1 -1
  32. package/dist/src/index.lua +8 -0
  33. package/package.json +1 -1
  34. package/src/classes/ModUpgraded.ts +2 -3
  35. package/src/classes/callbacks/PostCursedTeleport.ts +2 -2
  36. package/src/classes/callbacks/PostItemDischarge.ts +2 -0
  37. package/src/classes/callbacks/PostPickupInitFirst.ts +2 -4
  38. package/src/classes/features/callbackLogic/GameReorderedCallbacks.ts +4 -6
  39. package/src/classes/features/other/CustomTrapdoors.ts +11 -14
  40. package/src/classes/features/other/PickupIndexCreation.ts +2 -2
  41. package/src/classes/features/other/PreventCollectibleRotation.ts +2 -3
  42. package/src/classes/features/other/SaveDataManager.ts +2 -3
  43. package/src/classes/features/other/customStages/streakText.ts +10 -6
  44. package/src/functions/debugFunctions.ts +10 -1
  45. package/src/functions/frames.ts +172 -0
  46. package/src/functions/revive.ts +2 -3
  47. package/src/index.ts +1 -0
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC;AACrC,cAAc,sBAAsB,CAAC;AACrC,cAAc,uBAAuB,CAAC;AACtC,cAAc,sBAAsB,CAAC;AACrC,cAAc,kBAAkB,CAAC;AACjC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,yBAAyB,CAAC;AACxC,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,oBAAoB,CAAC;AACnC,cAAc,oBAAoB,CAAC;AACnC,cAAc,oBAAoB,CAAC;AACnC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,oBAAoB,CAAC;AACnC,cAAc,wBAAwB,CAAC;AACvC,cAAc,qBAAqB,CAAC;AACpC,cAAc,qBAAqB,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ACpC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,mBAAmB,CAAC;AAClC,cAAc,eAAe,CAAC;AAC9B,cAAc,mBAAmB,CAAC;AAClC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,sBAAsB,CAAC;AACrC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,uBAAuB,CAAC;AACtC,cAAc,uBAAuB,CAAC;AACtC,cAAc,sBAAsB,CAAC;AACrC,cAAc,kBAAkB,CAAC"}
@@ -447,6 +447,14 @@ do
447
447
  end
448
448
  end
449
449
  end
450
+ do
451
+ local ____export = require("src.functions.frames")
452
+ for ____exportKey, ____exportValue in pairs(____export) do
453
+ if ____exportKey ~= "default" then
454
+ ____exports[____exportKey] = ____exportValue
455
+ end
456
+ end
457
+ end
450
458
  do
451
459
  local ____export = require("src.functions.globals")
452
460
  for ____exportKey, ____exportValue in pairs(____export) do
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "isaacscript-common",
3
- "version": "59.4.1",
3
+ "version": "59.5.0",
4
4
  "description": "Helper functions and features for IsaacScript mods.",
5
5
  "keywords": [
6
6
  "isaac",
@@ -5,7 +5,7 @@ import { EXPORTED_METHOD_NAMES_KEY } from "../decorators";
5
5
  import { ISCFeature } from "../enums/ISCFeature";
6
6
  import { ModCallbackCustom } from "../enums/ModCallbackCustom";
7
7
  import { getFeatures } from "../features";
8
- import { getTime } from "../functions/debugFunctions";
8
+ import { getElapsedTimeSince, getTime } from "../functions/debugFunctions";
9
9
  import { getParentFunctionDescription, log } from "../functions/log";
10
10
  import {
11
11
  getTSTLClassConstructor,
@@ -116,8 +116,7 @@ export class ModUpgraded implements Mod {
116
116
  // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, n/no-callback-literal
117
117
  const returnValue = callback(...callbackArgs);
118
118
 
119
- const endTime = getTime();
120
- const elapsedTime = endTime - startTime;
119
+ const elapsedTime = getElapsedTimeSince(startTime);
121
120
  if (
122
121
  this.timeThreshold === undefined ||
123
122
  this.timeThreshold <= elapsedTime
@@ -8,6 +8,7 @@ import {
8
8
  import { game } from "../../core/cachedClasses";
9
9
  import { ModCallbackCustom } from "../../enums/ModCallbackCustom";
10
10
  import { hasFlag } from "../../functions/flag";
11
+ import { onGameFrame } from "../../functions/frames";
11
12
  import {
12
13
  mapGetPlayer,
13
14
  mapSetPlayer,
@@ -146,8 +147,7 @@ export class PostCursedTeleport extends CustomCallback<ModCallbackCustom.POST_CU
146
147
  lastDamageFrame: int,
147
148
  ) {
148
149
  // Check to see if this is the frame that we last took damage.
149
- const gameFrameCount = game.GetFrameCount();
150
- if (gameFrameCount !== lastDamageFrame) {
150
+ if (!onGameFrame(lastDamageFrame)) {
151
151
  return false;
152
152
  }
153
153
 
@@ -172,8 +172,10 @@ export class PostItemDischarge extends CustomCallback<T> {
172
172
  v.room.playersBulbLastCollisionFrame,
173
173
  player,
174
174
  );
175
+
175
176
  const collidedOnThisFrame = gameFrameCount === bulbLastCollisionFrame;
176
177
  const collidedOnLastFrame = gameFrameCount - 1 === bulbLastCollisionFrame;
178
+
177
179
  return collidedOnThisFrame || collidedOnLastFrame;
178
180
  }
179
181
  }
@@ -1,6 +1,6 @@
1
1
  import { ModCallback } from "isaac-typescript-definitions";
2
- import { game } from "../../core/cachedClasses";
3
2
  import type { ModCallbackCustom } from "../../enums/ModCallbackCustom";
3
+ import { isPastRoomFrame } from "../../functions/frames";
4
4
  import { getRoomVisitedCount } from "../../functions/roomData";
5
5
  import { shouldFirePickup } from "../../shouldFire";
6
6
  import { CustomCallback } from "../private/CustomCallback";
@@ -25,13 +25,11 @@ export class PostPickupInitFirst extends CustomCallback<ModCallbackCustom.POST_P
25
25
 
26
26
  // ModCallback.POST_PICKUP_INIT (34)
27
27
  private readonly postPickupInit = (pickup: EntityPickup) => {
28
- const room = game.GetRoom();
29
- const roomFrameCount = room.GetFrameCount();
30
28
  const roomVisitedCount = getRoomVisitedCount();
31
29
 
32
30
  // The room visited count is not reset when re-entering a Treasure Room or Boss room in the
33
31
  // Ascent.
34
- if (roomFrameCount > 0 || roomVisitedCount === 0) {
32
+ if (isPastRoomFrame(0) || roomVisitedCount === 0) {
35
33
  this.fire(pickup);
36
34
  }
37
35
  };
@@ -2,6 +2,7 @@ import type { LevelStage, StageType } from "isaac-typescript-definitions";
2
2
  import { CollectibleType, ModCallback } from "isaac-typescript-definitions";
3
3
  import { game } from "../../../core/cachedClasses";
4
4
  import { Exported } from "../../../decorators";
5
+ import { onGameFrame, onRenderFrame } from "../../../functions/frames";
5
6
  import type { PostGameStartedReordered } from "../../callbacks/PostGameStartedReordered";
6
7
  import type { PostGameStartedReorderedLast } from "../../callbacks/PostGameStartedReorderedLast";
7
8
  import type { PostNewLevelReordered } from "../../callbacks/PostNewLevelReordered";
@@ -123,14 +124,13 @@ export class GameReorderedCallbacks extends Feature {
123
124
 
124
125
  // ModCallback.POST_NEW_LEVEL (18)
125
126
  private readonly postNewLevel = (): void => {
126
- const gameFrameCount = game.GetFrameCount();
127
127
  const level = game.GetLevel();
128
128
  const stage = level.GetStage();
129
129
  const stageType = level.GetStageType();
130
130
  const room = game.GetRoom();
131
131
  const roomType = room.GetType();
132
132
 
133
- if (gameFrameCount === 0 && !this.forceNewLevel) {
133
+ if (onGameFrame(0) && !this.forceNewLevel) {
134
134
  // Wait for the `POST_GAME_STARTED` callback to fire.
135
135
  return;
136
136
  }
@@ -143,13 +143,11 @@ export class GameReorderedCallbacks extends Feature {
143
143
 
144
144
  // ModCallback.POST_NEW_ROOM (19)
145
145
  private readonly postNewRoom = (): void => {
146
- const gameFrameCount = game.GetFrameCount();
147
146
  const level = game.GetLevel();
148
147
  const stage = level.GetStage();
149
148
  const stageType = level.GetStageType();
150
149
  const room = game.GetRoom();
151
150
  const roomType = room.GetType();
152
- const renderFrameCount = Isaac.GetFrameCount();
153
151
 
154
152
  if (this.usedGlowingHourGlass) {
155
153
  this.usedGlowingHourGlass = false;
@@ -166,8 +164,8 @@ export class GameReorderedCallbacks extends Feature {
166
164
  }
167
165
 
168
166
  if (
169
- (gameFrameCount === 0 ||
170
- renderFrameCount === this.renderFrameRunStarted ||
167
+ (onGameFrame(0) ||
168
+ onRenderFrame(this.renderFrameRunStarted) ||
171
169
  this.currentStage !== stage ||
172
170
  this.currentStageType !== stageType) &&
173
171
  !this.forceNewRoom
@@ -21,6 +21,10 @@ import { GridEntityTypeCustom } from "../../../enums/private/GridEntityTypeCusto
21
21
  import { StageTravelState } from "../../../enums/private/StageTravelState";
22
22
  import { TrapdoorAnimation } from "../../../enums/private/TrapdoorAnimation";
23
23
  import { easeOutSine } from "../../../functions/easing";
24
+ import {
25
+ isPastRoomFrame,
26
+ onOrPastRenderFrame,
27
+ } from "../../../functions/frames";
24
28
  import { log } from "../../../functions/log";
25
29
  import { movePlayersToCenter } from "../../../functions/playerCenter";
26
30
  import {
@@ -218,12 +222,9 @@ export class CustomTrapdoors extends Feature {
218
222
  return;
219
223
  }
220
224
 
221
- const hud = game.GetHUD();
222
- const renderFrameCount = Isaac.GetFrameCount();
223
-
224
225
  const renderFrameScreenBlack =
225
226
  v.run.stateRenderFrame + PIXELATION_TO_BLACK_FRAMES;
226
- if (renderFrameCount < renderFrameScreenBlack) {
227
+ if (!onOrPastRenderFrame(renderFrameScreenBlack)) {
227
228
  return;
228
229
  }
229
230
 
@@ -232,6 +233,7 @@ export class CustomTrapdoors extends Feature {
232
233
 
233
234
  // Now, we display a black sprite on top of the pixelation effect, to prevent showing the rest
234
235
  // of the animation.
236
+ const hud = game.GetHUD();
235
237
  hud.SetVisible(false);
236
238
 
237
239
  // If the pixelation effect is not fully allowed to complete, the game's internal buffer will
@@ -313,18 +315,16 @@ export class CustomTrapdoors extends Feature {
313
315
  return;
314
316
  }
315
317
 
316
- const hud = game.GetHUD();
317
- const renderFrameCount = Isaac.GetFrameCount();
318
-
319
318
  const renderFrameScreenBlack =
320
319
  v.run.stateRenderFrame + PIXELATION_TO_BLACK_FRAMES;
321
- if (renderFrameCount < renderFrameScreenBlack) {
320
+ if (!onOrPastRenderFrame(renderFrameScreenBlack)) {
322
321
  return;
323
322
  }
324
323
 
325
324
  v.run.state = StageTravelState.PIXELATION_TO_ROOM;
326
325
  this.logStateChanged();
327
326
 
327
+ const hud = game.GetHUD();
328
328
  hud.SetVisible(true);
329
329
 
330
330
  this.runNextRoom.runNextRoom(() => {
@@ -439,7 +439,6 @@ export class CustomTrapdoors extends Feature {
439
439
  }
440
440
 
441
441
  private isPlayerCloseAfterBoss(position: Vector) {
442
- const gameFrameCount = game.GetFrameCount();
443
442
  const room = game.GetRoom();
444
443
  const roomType = room.GetType();
445
444
  const roomClearGameFrame = this.roomClearFrame.getRoomClearGameFrame();
@@ -449,7 +448,7 @@ export class CustomTrapdoors extends Feature {
449
448
  if (
450
449
  roomType !== RoomType.BOSS ||
451
450
  roomClearGameFrame === undefined ||
452
- gameFrameCount >= roomClearGameFrame + TRAPDOOR_BOSS_REACTION_FRAMES
451
+ onOrPastRenderFrame(roomClearGameFrame + TRAPDOOR_BOSS_REACTION_FRAMES)
453
452
  ) {
454
453
  return false;
455
454
  }
@@ -627,7 +626,6 @@ export class CustomTrapdoors extends Feature {
627
626
  firstSpawn: boolean,
628
627
  ): boolean {
629
628
  const room = game.GetRoom();
630
- const roomFrameCount = room.GetFrameCount();
631
629
  const roomClear = room.IsClear();
632
630
 
633
631
  // Trapdoors created after a room has already initialized should spawn closed by default:
@@ -635,7 +633,7 @@ export class CustomTrapdoors extends Feature {
635
633
  // into them.
636
634
  // - Trapdoors created by We Need to Go Deeper should spawn closed because the player will be
637
635
  // standing on top of them.
638
- if (roomFrameCount > 0) {
636
+ if (isPastRoomFrame(0)) {
639
637
  return false;
640
638
  }
641
639
 
@@ -762,7 +760,6 @@ export class CustomTrapdoors extends Feature {
762
760
  }
763
761
 
764
762
  const room = game.GetRoom();
765
- const roomFrameCount = room.GetFrameCount();
766
763
  const roomListIndex = getRoomListIndex();
767
764
  const gridIndex = isVector(gridIndexOrPosition)
768
765
  ? room.GetGridIndex(gridIndexOrPosition)
@@ -776,7 +773,7 @@ export class CustomTrapdoors extends Feature {
776
773
  TrapdoorAnimation.OPENED,
777
774
  );
778
775
 
779
- const firstSpawn = roomFrameCount !== 0;
776
+ const firstSpawn = isPastRoomFrame(0);
780
777
  const open =
781
778
  spawnOpen ?? this.shouldTrapdoorSpawnOpen(gridEntity, firstSpawn);
782
779
 
@@ -7,6 +7,7 @@ import { game } from "../../../core/cachedClasses";
7
7
  import { Exported } from "../../../decorators";
8
8
  import { ISCFeature } from "../../../enums/ISCFeature";
9
9
  import { getEntityID } from "../../../functions/entities";
10
+ import { isPastRoomFrame } from "../../../functions/frames";
10
11
  import { getRoomListIndex } from "../../../functions/roomData";
11
12
  import { onAscent } from "../../../functions/stage";
12
13
  import { vectorEquals } from "../../../functions/vector";
@@ -93,11 +94,10 @@ export class PickupIndexCreation extends Feature {
93
94
  this.getPickupIndexFromPreviousData(pickup);
94
95
  const room = game.GetRoom();
95
96
  const isFirstVisit = room.IsFirstVisit();
96
- const roomFrameCount = room.GetFrameCount();
97
97
  if (
98
98
  pickupIndexFromLevelData !== undefined &&
99
99
  !isFirstVisit &&
100
- roomFrameCount <= 0
100
+ !isPastRoomFrame(0)
101
101
  ) {
102
102
  v.room.pickupIndexes.set(ptrHash, pickupIndexFromLevelData);
103
103
  return;
@@ -11,6 +11,7 @@ import { ISCFeature } from "../../../enums/ISCFeature";
11
11
  import { ModCallbackCustom } from "../../../enums/ModCallbackCustom";
12
12
  import { setCollectibleSubType } from "../../../functions/collectibles";
13
13
  import { getEntityID } from "../../../functions/entities";
14
+ import { onGameFrame } from "../../../functions/frames";
14
15
  import { isCollectible } from "../../../functions/pickupVariants";
15
16
  import { getCollectibles } from "../../../functions/pickupsSpecific";
16
17
  import { asCollectibleType } from "../../../functions/types";
@@ -142,11 +143,9 @@ export class PreventCollectibleRotation extends Feature {
142
143
  }
143
144
 
144
145
  // It can take a frame after the activation of the D6 for the sub-type to change.
145
- const gameFrameCount = game.GetFrameCount();
146
146
  if (
147
147
  v.run.rollGameFrame !== null &&
148
- (gameFrameCount === v.run.rollGameFrame ||
149
- gameFrameCount === v.run.rollGameFrame + 1)
148
+ (onGameFrame(v.run.rollGameFrame) || onGameFrame(v.run.rollGameFrame + 1))
150
149
  ) {
151
150
  v.run.trackedCollectibles.delete(pickupIndex);
152
151
  return;
@@ -1,11 +1,11 @@
1
1
  import type { ActiveSlot, UseFlag } from "isaac-typescript-definitions";
2
2
  import { CollectibleType, ModCallback } from "isaac-typescript-definitions";
3
- import { game } from "../../../core/cachedClasses";
4
3
  import { Exported } from "../../../decorators";
5
4
  import { ModCallbackCustom } from "../../../enums/ModCallbackCustom";
6
5
  import { SaveDataKey } from "../../../enums/SaveDataKey";
7
6
  import { SerializationType } from "../../../enums/SerializationType";
8
7
  import { deepCopy } from "../../../functions/deepCopy";
8
+ import { isPastGameFrame } from "../../../functions/frames";
9
9
  import { log } from "../../../functions/log";
10
10
  import { onFirstFloor } from "../../../functions/stage";
11
11
  import { getTSTLClassName, isTSTLClass } from "../../../functions/tstlClass";
@@ -145,8 +145,7 @@ export class SaveDataManager extends Feature {
145
145
  // data that is not tied to an individual run.
146
146
  loadFromDisk(this.mod, this.saveDataMap, this.classConstructors);
147
147
 
148
- const gameFrameCount = game.GetFrameCount();
149
- const isContinued = gameFrameCount !== 0;
148
+ const isContinued = isPastGameFrame(0);
150
149
  if (!isContinued) {
151
150
  restoreDefaultsForAllFeaturesAndKeys(
152
151
  this.saveDataMap,
@@ -3,6 +3,10 @@ import { CONTROLLER_INDEX_VALUES } from "../../../../arrays/cachedEnumValues";
3
3
  import { fonts, game } from "../../../../core/cachedClasses";
4
4
  import { KColorDefault, VectorOne } from "../../../../core/constants";
5
5
  import { UIStreakAnimation } from "../../../../enums/private/UIStreakAnimation";
6
+ import {
7
+ getElapsedGameFramesSince,
8
+ getElapsedRenderFramesSince,
9
+ } from "../../../../functions/frames";
6
10
  import {
7
11
  getScreenBottomCenterPos,
8
12
  getScreenTopCenterPos,
@@ -102,9 +106,9 @@ function checkEndTopStreakText() {
102
106
  return;
103
107
  }
104
108
 
105
- const renderFrameCount = Isaac.GetFrameCount();
106
- const elapsedFrames =
107
- renderFrameCount - v.run.topStreakTextStartedRenderFrame;
109
+ const elapsedFrames = getElapsedRenderFramesSince(
110
+ v.run.topStreakTextStartedRenderFrame,
111
+ );
108
112
  if (elapsedFrames >= 115) {
109
113
  v.run.topStreakText.animation = UIStreakAnimation.TEXT;
110
114
  // We adjust by the frame backwards by an arbitrary amount to roughly align with the speed of
@@ -114,8 +118,9 @@ function checkEndTopStreakText() {
114
118
  }
115
119
 
116
120
  function trackMapInputPressed() {
121
+ const gameFrameCount = game.GetFrameCount();
122
+
117
123
  for (const controllerIndex of CONTROLLER_INDEX_VALUES) {
118
- const gameFrameCount = game.GetFrameCount();
119
124
  const oldPushedMapFrame =
120
125
  v.run.controllerIndexPushingMapRenderFrame.get(controllerIndex);
121
126
  const isPushingMap = Input.IsActionPressed(
@@ -153,8 +158,7 @@ function checkStartBottomStreakText() {
153
158
  }
154
159
 
155
160
  const earliestFrame = Math.min(...pushedMapFrames);
156
- const gameFrameCount = game.GetFrameCount();
157
- const elapsedFrames = gameFrameCount - earliestFrame;
161
+ const elapsedFrames = getElapsedGameFramesSince(earliestFrame);
158
162
  if (elapsedFrames >= NUM_RENDER_FRAMES_MAP_HELD_BEFORE_STREAK_TEXT) {
159
163
  v.run.bottomStreakText.animation = UIStreakAnimation.TEXT;
160
164
  v.run.bottomStreakText.frame = 0;
@@ -1,5 +1,14 @@
1
1
  import { log } from "./log";
2
2
 
3
+ /**
4
+ * Helper function to get the amount of elapsed time for benchmarking / profiling purposes.
5
+ *
6
+ * For more information, see the documentation for the `getTime` helper function.
7
+ */
8
+ export function getElapsedTimeSince(time: int | float): int {
9
+ return getTime() - time;
10
+ }
11
+
3
12
  /**
4
13
  * Helper function to get the current time for benchmarking / profiling purposes.
5
14
  *
@@ -18,7 +27,7 @@ import { log } from "./log";
18
27
  * Default is true. If set to false, the `Isaac.GetTime()` method will
19
28
  * always be used.
20
29
  */
21
- export function getTime(useSocketIfAvailable = true): float {
30
+ export function getTime(useSocketIfAvailable = true): int | float {
22
31
  if (useSocketIfAvailable) {
23
32
  if (SandboxGetTime !== undefined) {
24
33
  return SandboxGetTime();
@@ -0,0 +1,172 @@
1
+ import { game } from "../core/cachedClasses";
2
+
3
+ export function getElapsedGameFramesSince(gameFrameCount: int): int {
4
+ const thisGameFrameCount = game.GetFrameCount();
5
+ return thisGameFrameCount - gameFrameCount;
6
+ }
7
+
8
+ export function getElapsedRenderFramesSince(renderFrameCount: int): int {
9
+ const thisRenderFrameCount = Isaac.GetFrameCount();
10
+ return thisRenderFrameCount - renderFrameCount;
11
+ }
12
+
13
+ export function getElapsedRoomFramesSince(roomFrameCount: int): int {
14
+ const room = game.GetRoom();
15
+ const thisRoomFrameCount = room.GetFrameCount();
16
+ return thisRoomFrameCount - roomFrameCount;
17
+ }
18
+
19
+ /**
20
+ * Helper function to check if the current game frame count is higher than a specific game frame
21
+ * count.
22
+ *
23
+ * This returns false if the submitted game frame count is null or undefined.
24
+ */
25
+ export function isPastGameFrame(
26
+ gameFrameCount: int | null | undefined,
27
+ ): boolean {
28
+ if (gameFrameCount === null || gameFrameCount === undefined) {
29
+ return false;
30
+ }
31
+
32
+ const thisGameFrameCount = game.GetFrameCount();
33
+ return thisGameFrameCount > gameFrameCount;
34
+ }
35
+
36
+ /**
37
+ * Helper function to check if the current render frame count is higher than a specific render frame
38
+ * count.
39
+ *
40
+ * This returns false if the submitted render frame count is null or undefined.
41
+ */
42
+ export function isPastRenderFrame(
43
+ renderFrameCount: int | null | undefined,
44
+ ): boolean {
45
+ if (renderFrameCount === null || renderFrameCount === undefined) {
46
+ return false;
47
+ }
48
+
49
+ const thisRenderFrameCount = Isaac.GetFrameCount();
50
+ return thisRenderFrameCount >= renderFrameCount;
51
+ }
52
+
53
+ /**
54
+ * Helper function to check if the current room frame count is higher than a specific room frame
55
+ * count.
56
+ *
57
+ * This returns false if the submitted room frame count is null or undefined.
58
+ */
59
+ export function isPastRoomFrame(
60
+ roomFrameCount: int | null | undefined,
61
+ ): boolean {
62
+ if (roomFrameCount === null || roomFrameCount === undefined) {
63
+ return false;
64
+ }
65
+
66
+ const room = game.GetRoom();
67
+
68
+ const thisGameFrameCount = room.GetFrameCount();
69
+ return thisGameFrameCount > roomFrameCount;
70
+ }
71
+
72
+ /**
73
+ * Helper function to check if the current game frame count is exactly equal to a specific game
74
+ * frame count.
75
+ *
76
+ * This returns false if the submitted game frame count is null or undefined.
77
+ */
78
+ export function onGameFrame(gameFrameCount: int | null | undefined): boolean {
79
+ if (gameFrameCount === null || gameFrameCount === undefined) {
80
+ return false;
81
+ }
82
+
83
+ const thisGameFrameCount = game.GetFrameCount();
84
+ return thisGameFrameCount === gameFrameCount;
85
+ }
86
+
87
+ /**
88
+ * Helper function to check if the current game frame count is equal to or higher than a specific
89
+ * game frame count.
90
+ *
91
+ * This returns false if the submitted game frame count is null or undefined.
92
+ */
93
+ export function onOrPastGameFrame(
94
+ gameFrameCount: int | null | undefined,
95
+ ): boolean {
96
+ if (gameFrameCount === null || gameFrameCount === undefined) {
97
+ return false;
98
+ }
99
+
100
+ const thisGameFrameCount = game.GetFrameCount();
101
+ return thisGameFrameCount >= gameFrameCount;
102
+ }
103
+
104
+ /**
105
+ * Helper function to check if the current render frame count is equal to or higher than a specific
106
+ * render frame count.
107
+ *
108
+ * This returns false if the submitted render frame count is null or undefined.
109
+ */
110
+ export function onOrPastRenderFrame(
111
+ renderFrameCount: int | null | undefined,
112
+ ): boolean {
113
+ if (renderFrameCount === null || renderFrameCount === undefined) {
114
+ return false;
115
+ }
116
+
117
+ const thisRenderFrameCount = Isaac.GetFrameCount();
118
+ return thisRenderFrameCount >= renderFrameCount;
119
+ }
120
+
121
+ /**
122
+ * Helper function to check if the current room frame count is equal to or higher than a specific
123
+ * room frame count.
124
+ *
125
+ * This returns false if the submitted room frame count is null or undefined.
126
+ */
127
+ export function onOrPastRoomFrame(
128
+ roomFrameCount: int | null | undefined,
129
+ ): boolean {
130
+ if (roomFrameCount === null || roomFrameCount === undefined) {
131
+ return false;
132
+ }
133
+
134
+ const room = game.GetRoom();
135
+
136
+ const thisGameFrameCount = room.GetFrameCount();
137
+ return thisGameFrameCount >= roomFrameCount;
138
+ }
139
+
140
+ /**
141
+ * Helper function to check if the current render frame count is exactly equal to a specific render
142
+ * frame count.
143
+ *
144
+ * This returns false if the submitted render frame count is null or undefined.
145
+ */
146
+ export function onRenderFrame(
147
+ renderFrameCount: int | null | undefined,
148
+ ): boolean {
149
+ if (renderFrameCount === null || renderFrameCount === undefined) {
150
+ return false;
151
+ }
152
+
153
+ const thisRenderFrameCount = Isaac.GetFrameCount();
154
+ return thisRenderFrameCount >= renderFrameCount;
155
+ }
156
+
157
+ /**
158
+ * Helper function to check if the current room frame count is exactly equal to a specific room
159
+ * frame count.
160
+ *
161
+ * This returns false if the submitted room frame count is null or undefined.
162
+ */
163
+ export function onRoomFrame(roomFrameCount: int | null | undefined): boolean {
164
+ if (roomFrameCount === null || roomFrameCount === undefined) {
165
+ return false;
166
+ }
167
+
168
+ const room = game.GetRoom();
169
+
170
+ const thisGameFrameCount = room.GetFrameCount();
171
+ return thisGameFrameCount === roomFrameCount;
172
+ }
@@ -5,13 +5,13 @@ import {
5
5
  PlayerType,
6
6
  TrinketType,
7
7
  } from "isaac-typescript-definitions";
8
- import { game } from "../core/cachedClasses";
9
8
  import {
10
9
  MAX_TAINTED_SAMSON_BERSERK_CHARGE,
11
10
  TAINTED_SAMSON_BERSERK_CHARGE_FROM_TAKING_DAMAGE,
12
11
  } from "../core/constants";
13
12
  import { MysteriousPaperEffect } from "../enums/MysteriousPaperEffect";
14
13
  import { getCharacterDeathAnimationName } from "./characters";
14
+ import { onGameFrame } from "./frames";
15
15
  import { getPlayerMaxHeartContainers } from "./playerHealth";
16
16
  import { getPlayerNumHitsRemaining, hasLostCurse, isKeeper } from "./players";
17
17
  import { getLastFrameOfAnimation } from "./sprites";
@@ -28,7 +28,6 @@ export function isDamageToPlayerFatal(
28
28
  source: EntityRef,
29
29
  lastDamageGameFrame: int | undefined,
30
30
  ): boolean {
31
- const gameFrameCount = game.GetFrameCount();
32
31
  const character = player.GetPlayerType();
33
32
  const effects = player.GetEffects();
34
33
  const isBerserk = effects.HasCollectibleEffect(CollectibleType.BERSERK);
@@ -91,7 +90,7 @@ export function isDamageToPlayerFatal(
91
90
  // damage on the same frame.
92
91
  if (
93
92
  player.HasCollectible(CollectibleType.BROKEN_GLASS_CANNON) &&
94
- gameFrameCount === lastDamageGameFrame
93
+ onGameFrame(lastDamageGameFrame)
95
94
  ) {
96
95
  return false;
97
96
  }
package/src/index.ts CHANGED
@@ -54,6 +54,7 @@ export * from "./functions/enums";
54
54
  export * from "./functions/external";
55
55
  export * from "./functions/familiars";
56
56
  export * from "./functions/flag";
57
+ export * from "./functions/frames";
57
58
  export * from "./functions/globals";
58
59
  export * from "./functions/gridEntities";
59
60
  export * from "./functions/gridEntitiesSpecific";