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.
- package/dist/index.rollup.d.ts +86 -1
- package/dist/isaacscript-common.lua +149 -47
- package/dist/src/classes/ModUpgraded.d.ts.map +1 -1
- package/dist/src/classes/ModUpgraded.lua +2 -2
- package/dist/src/classes/callbacks/PostCursedTeleport.d.ts.map +1 -1
- package/dist/src/classes/callbacks/PostCursedTeleport.lua +3 -2
- package/dist/src/classes/callbacks/PostItemDischarge.d.ts.map +1 -1
- package/dist/src/classes/callbacks/PostPickupInitFirst.d.ts.map +1 -1
- package/dist/src/classes/callbacks/PostPickupInitFirst.lua +3 -5
- package/dist/src/classes/features/callbackLogic/GameReorderedCallbacks.d.ts.map +1 -1
- package/dist/src/classes/features/callbackLogic/GameReorderedCallbacks.lua +5 -5
- package/dist/src/classes/features/other/CustomTrapdoors.d.ts.map +1 -1
- package/dist/src/classes/features/other/CustomTrapdoors.lua +10 -12
- package/dist/src/classes/features/other/PickupIndexCreation.d.ts.map +1 -1
- package/dist/src/classes/features/other/PickupIndexCreation.lua +3 -2
- package/dist/src/classes/features/other/PreventCollectibleRotation.d.ts.map +1 -1
- package/dist/src/classes/features/other/PreventCollectibleRotation.lua +3 -2
- package/dist/src/classes/features/other/SaveDataManager.d.ts.map +1 -1
- package/dist/src/classes/features/other/SaveDataManager.lua +3 -4
- package/dist/src/classes/features/other/customStages/streakText.d.ts.map +1 -1
- package/dist/src/classes/features/other/customStages/streakText.lua +6 -5
- package/dist/src/functions/debugFunctions.d.ts +7 -1
- package/dist/src/functions/debugFunctions.d.ts.map +1 -1
- package/dist/src/functions/debugFunctions.lua +22 -16
- package/dist/src/functions/frames.d.ts +68 -0
- package/dist/src/functions/frames.d.ts.map +1 -0
- package/dist/src/functions/frames.lua +119 -0
- package/dist/src/functions/revive.d.ts.map +1 -1
- package/dist/src/functions/revive.lua +3 -4
- package/dist/src/index.d.ts +1 -0
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.lua +8 -0
- package/package.json +1 -1
- package/src/classes/ModUpgraded.ts +2 -3
- package/src/classes/callbacks/PostCursedTeleport.ts +2 -2
- package/src/classes/callbacks/PostItemDischarge.ts +2 -0
- package/src/classes/callbacks/PostPickupInitFirst.ts +2 -4
- package/src/classes/features/callbackLogic/GameReorderedCallbacks.ts +4 -6
- package/src/classes/features/other/CustomTrapdoors.ts +11 -14
- package/src/classes/features/other/PickupIndexCreation.ts +2 -2
- package/src/classes/features/other/PreventCollectibleRotation.ts +2 -3
- package/src/classes/features/other/SaveDataManager.ts +2 -3
- package/src/classes/features/other/customStages/streakText.ts +10 -6
- package/src/functions/debugFunctions.ts +10 -1
- package/src/functions/frames.ts +172 -0
- package/src/functions/revive.ts +2 -3
- package/src/index.ts +1 -0
|
@@ -6,8 +6,8 @@ local __TS__New = ____lualib.__TS__New
|
|
|
6
6
|
local ____exports = {}
|
|
7
7
|
local ____isaac_2Dtypescript_2Ddefinitions = require("isaac-typescript-definitions")
|
|
8
8
|
local ModCallback = ____isaac_2Dtypescript_2Ddefinitions.ModCallback
|
|
9
|
-
local
|
|
10
|
-
local
|
|
9
|
+
local ____frames = require("src.functions.frames")
|
|
10
|
+
local isPastRoomFrame = ____frames.isPastRoomFrame
|
|
11
11
|
local ____roomData = require("src.functions.roomData")
|
|
12
12
|
local getRoomVisitedCount = ____roomData.getRoomVisitedCount
|
|
13
13
|
local ____shouldFire = require("src.shouldFire")
|
|
@@ -23,10 +23,8 @@ function PostPickupInitFirst.prototype.____constructor(self)
|
|
|
23
23
|
self.v = {room = {firedSet = __TS__New(Set)}}
|
|
24
24
|
self.shouldFire = shouldFirePickup
|
|
25
25
|
self.postPickupInit = function(____, pickup)
|
|
26
|
-
local room = game:GetRoom()
|
|
27
|
-
local roomFrameCount = room:GetFrameCount()
|
|
28
26
|
local roomVisitedCount = getRoomVisitedCount(nil)
|
|
29
|
-
if
|
|
27
|
+
if isPastRoomFrame(nil, 0) or roomVisitedCount == 0 then
|
|
30
28
|
self:fire(pickup)
|
|
31
29
|
end
|
|
32
30
|
end
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GameReorderedCallbacks.d.ts","sourceRoot":"","sources":["../../../../../src/classes/features/callbackLogic/GameReorderedCallbacks.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;
|
|
1
|
+
{"version":3,"file":"GameReorderedCallbacks.d.ts","sourceRoot":"","sources":["../../../../../src/classes/features/callbackLogic/GameReorderedCallbacks.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AAS1E,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAEhD;;;;;;;;;;;;;;GAcG;AACH,qBAAa,sBAAuB,SAAQ,OAAO;IACjD,oDAAoD;IACpD,OAAO,CAAC,qBAAqB,CAAoB;IAEjD,OAAO,CAAC,YAAY,CAAoB;IACxC,OAAO,CAAC,gBAAgB,CAAoB;IAC5C,OAAO,CAAC,oBAAoB,CAAS;IACrC,OAAO,CAAC,aAAa,CAAS;IAC9B,OAAO,CAAC,YAAY,CAAS;IAE7B,OAAO,CAAC,QAAQ,CAAC,wBAAwB,CAA2B;IACpE,OAAO,CAAC,QAAQ,CAAC,qBAAqB,CAAwB;IAC9D,OAAO,CAAC,QAAQ,CAAC,oBAAoB,CAAuB;IAC5D,OAAO,CAAC,QAAQ,CAAC,4BAA4B,CAA+B;IA8C5E,OAAO,CAAC,QAAQ,CAAC,2BAA2B,CAM1C;IAGF,OAAO,CAAC,QAAQ,CAAC,cAAc,CAI7B;IAGF,OAAO,CAAC,QAAQ,CAAC,eAAe,CAgB9B;IAGF,OAAO,CAAC,QAAQ,CAAC,WAAW,CAE1B;IAGF,OAAO,CAAC,QAAQ,CAAC,YAAY,CAgB3B;IAGF,OAAO,CAAC,QAAQ,CAAC,WAAW,CAiC1B;IAEF,OAAO,CAAC,kBAAkB;IAS1B;;;;;;;;;;;;OAYG;IAEI,qBAAqB,IAAI,IAAI;IAIpC;;;;;;;;;;;;OAYG;IAEI,oBAAoB,IAAI,IAAI;IAInC;;;;;;;;;OASG;IAEI,0BAA0B,CAC/B,KAAK,EAAE,UAAU,EACjB,SAAS,EAAE,SAAS,GACnB,IAAI;CAIR"}
|
|
@@ -10,6 +10,9 @@ local ____cachedClasses = require("src.core.cachedClasses")
|
|
|
10
10
|
local game = ____cachedClasses.game
|
|
11
11
|
local ____decorators = require("src.decorators")
|
|
12
12
|
local Exported = ____decorators.Exported
|
|
13
|
+
local ____frames = require("src.functions.frames")
|
|
14
|
+
local onGameFrame = ____frames.onGameFrame
|
|
15
|
+
local onRenderFrame = ____frames.onRenderFrame
|
|
13
16
|
local ____Feature = require("src.classes.private.Feature")
|
|
14
17
|
local Feature = ____Feature.Feature
|
|
15
18
|
--- By default, callbacks fire in the following order:
|
|
@@ -64,13 +67,12 @@ function GameReorderedCallbacks.prototype.____constructor(self, postGameStartedR
|
|
|
64
67
|
self.renderFrameRunStarted = nil
|
|
65
68
|
end
|
|
66
69
|
self.postNewLevel = function()
|
|
67
|
-
local gameFrameCount = game:GetFrameCount()
|
|
68
70
|
local level = game:GetLevel()
|
|
69
71
|
local stage = level:GetStage()
|
|
70
72
|
local stageType = level:GetStageType()
|
|
71
73
|
local room = game:GetRoom()
|
|
72
74
|
local roomType = room:GetType()
|
|
73
|
-
if
|
|
75
|
+
if onGameFrame(nil, 0) and not self.forceNewLevel then
|
|
74
76
|
return
|
|
75
77
|
end
|
|
76
78
|
self.forceNewLevel = false
|
|
@@ -79,13 +81,11 @@ function GameReorderedCallbacks.prototype.____constructor(self, postGameStartedR
|
|
|
79
81
|
self.postNewRoomReordered:fire(roomType)
|
|
80
82
|
end
|
|
81
83
|
self.postNewRoom = function()
|
|
82
|
-
local gameFrameCount = game:GetFrameCount()
|
|
83
84
|
local level = game:GetLevel()
|
|
84
85
|
local stage = level:GetStage()
|
|
85
86
|
local stageType = level:GetStageType()
|
|
86
87
|
local room = game:GetRoom()
|
|
87
88
|
local roomType = room:GetType()
|
|
88
|
-
local renderFrameCount = Isaac.GetFrameCount()
|
|
89
89
|
if self.usedGlowingHourGlass then
|
|
90
90
|
self.usedGlowingHourGlass = false
|
|
91
91
|
if self.currentStage ~= stage or self.currentStageType ~= stageType then
|
|
@@ -95,7 +95,7 @@ function GameReorderedCallbacks.prototype.____constructor(self, postGameStartedR
|
|
|
95
95
|
return
|
|
96
96
|
end
|
|
97
97
|
end
|
|
98
|
-
if (
|
|
98
|
+
if (onGameFrame(nil, 0) or onRenderFrame(nil, self.renderFrameRunStarted) or self.currentStage ~= stage or self.currentStageType ~= stageType) and not self.forceNewRoom then
|
|
99
99
|
return
|
|
100
100
|
end
|
|
101
101
|
self.forceNewRoom = false
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CustomTrapdoors.d.ts","sourceRoot":"","sources":["../../../../../src/classes/features/other/CustomTrapdoors.ts"],"names":[],"mappings":"AAAA,OAAO,EAOL,UAAU,EAKV,SAAS,EACV,MAAM,8BAA8B,CAAC;
|
|
1
|
+
{"version":3,"file":"CustomTrapdoors.d.ts","sourceRoot":"","sources":["../../../../../src/classes/features/other/CustomTrapdoors.ts"],"names":[],"mappings":"AAAA,OAAO,EAOL,UAAU,EAKV,SAAS,EACV,MAAM,8BAA8B,CAAC;AAmCtC,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAkDhD,qBAAa,eAAgB,SAAQ,OAAO;IAC1C,qCAAqC;IACrC,OAAO,CAAC,QAAQ,CAAC,kBAAkB,CAO/B;IAKJ;;;;;OAKG;IACH,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAY;IAExC,OAAO,CAAC,QAAQ,CAAC,kBAAkB,CAAqB;IACxD,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAgB;IAC9C,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAgB;IAC9C,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAiB;IAChD,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAe;IAC5C,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAc;IAC1C,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAe;IAmD5C,OAAO,CAAC,QAAQ,CAAC,UAAU,CAMzB;IAEF,OAAO,CAAC,2BAA2B;IA+BnC,OAAO,CAAC,8BAA8B;IAiDtC,OAAO,CAAC,6BAA6B;IAsBrC,OAAO,CAAC,kBAAkB;IAqB1B,OAAO,CAAC,4BAA4B;IA+CpC,OAAO,CAAC,iCAAiC;IAqBzC,OAAO,CAAC,eAAe;IAoBvB,OAAO,CAAC,QAAQ,CAAC,kCAAkC,CAcjD;IAEF,OAAO,CAAC,4BAA4B;IAcpC,OAAO,CAAC,kBAAkB;IAc1B,OAAO,CAAC,sBAAsB;IAkB9B,OAAO,CAAC,gCAAgC;IAuCxC,OAAO,CAAC,2BAA2B;IAoCnC,OAAO,CAAC,gBAAgB;IAoBxB,OAAO,CAAC,8BAA8B;IAmDtC,OAAO,CAAC,QAAQ,CAAC,0BAA0B,CAEzC;IAEF,OAAO,CAAC,iBAAiB;IAezB,OAAO,CAAC,uBAAuB;IA2B/B,OAAO,CAAC,eAAe;IAUvB;;;;;;;;;;;;;;;;;;OAkBG;IAEI,iCAAiC,CACtC,eAAe,EAAE,MAAM,EACvB,eAAe,EAAE,CACf,eAAe,EAAE,MAAM,GAAG,SAAS,EACnC,gBAAgB,EAAE,UAAU,EAC5B,oBAAoB,EAAE,SAAS,KAC5B,IAAI,GACR,IAAI;IAUP;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAqCG;IAEI,mBAAmB,CACxB,mBAAmB,EAAE,GAAG,GAAG,MAAM,EACjC,eAAe,CAAC,EAAE,MAAM,EACxB,gBAAgB,CAAC,EAAE,UAAU,EAC7B,oBAAoB,CAAC,EAAE,SAAS,EAChC,QAAQ,SAAmC,EAC3C,SAAS,CAAC,EAAE,OAAO,GAClB,UAAU;CAsDd"}
|
|
@@ -40,6 +40,9 @@ local ____TrapdoorAnimation = require("src.enums.private.TrapdoorAnimation")
|
|
|
40
40
|
local TrapdoorAnimation = ____TrapdoorAnimation.TrapdoorAnimation
|
|
41
41
|
local ____easing = require("src.functions.easing")
|
|
42
42
|
local easeOutSine = ____easing.easeOutSine
|
|
43
|
+
local ____frames = require("src.functions.frames")
|
|
44
|
+
local isPastRoomFrame = ____frames.isPastRoomFrame
|
|
45
|
+
local onOrPastRenderFrame = ____frames.onOrPastRenderFrame
|
|
43
46
|
local ____log = require("src.functions.log")
|
|
44
47
|
local log = ____log.log
|
|
45
48
|
local ____playerCenter = require("src.functions.playerCenter")
|
|
@@ -198,14 +201,13 @@ function CustomTrapdoors.prototype.checkPixelationToBlackComplete(self)
|
|
|
198
201
|
if v.run.state ~= StageTravelState.PIXELATION_TO_BLACK or v.run.stateRenderFrame == nil then
|
|
199
202
|
return
|
|
200
203
|
end
|
|
201
|
-
local hud = game:GetHUD()
|
|
202
|
-
local renderFrameCount = Isaac.GetFrameCount()
|
|
203
204
|
local renderFrameScreenBlack = v.run.stateRenderFrame + PIXELATION_TO_BLACK_FRAMES
|
|
204
|
-
if
|
|
205
|
+
if not onOrPastRenderFrame(nil, renderFrameScreenBlack) then
|
|
205
206
|
return
|
|
206
207
|
end
|
|
207
208
|
v.run.state = StageTravelState.WAITING_FOR_FIRST_PIXELATION_TO_END
|
|
208
209
|
self:logStateChanged()
|
|
210
|
+
local hud = game:GetHUD()
|
|
209
211
|
hud:SetVisible(false)
|
|
210
212
|
self.runInNFrames:runNextGameFrame(function()
|
|
211
213
|
local level = game:GetLevel()
|
|
@@ -244,14 +246,13 @@ function CustomTrapdoors.prototype.checkSecondPixelationHalfWay(self)
|
|
|
244
246
|
if v.run.state ~= StageTravelState.WAITING_FOR_SECOND_PIXELATION_TO_GET_HALF_WAY or v.run.stateRenderFrame == nil then
|
|
245
247
|
return
|
|
246
248
|
end
|
|
247
|
-
local hud = game:GetHUD()
|
|
248
|
-
local renderFrameCount = Isaac.GetFrameCount()
|
|
249
249
|
local renderFrameScreenBlack = v.run.stateRenderFrame + PIXELATION_TO_BLACK_FRAMES
|
|
250
|
-
if
|
|
250
|
+
if not onOrPastRenderFrame(nil, renderFrameScreenBlack) then
|
|
251
251
|
return
|
|
252
252
|
end
|
|
253
253
|
v.run.state = StageTravelState.PIXELATION_TO_ROOM
|
|
254
254
|
self:logStateChanged()
|
|
255
|
+
local hud = game:GetHUD()
|
|
255
256
|
hud:SetVisible(true)
|
|
256
257
|
self.runNextRoom:runNextRoom(function()
|
|
257
258
|
v.run.state = StageTravelState.PLAYERS_LAYING_DOWN
|
|
@@ -307,11 +308,10 @@ function CustomTrapdoors.prototype.shouldTrapdoorOpen(self, gridEntity, firstSpa
|
|
|
307
308
|
return not anyPlayerCloserThan(nil, gridEntity.Position, TRAPDOOR_OPEN_DISTANCE) and not self:isPlayerCloseAfterBoss(gridEntity.Position) and not shouldBeClosedFromStartingInRoomWithEnemies(nil, firstSpawn, roomClear)
|
|
308
309
|
end
|
|
309
310
|
function CustomTrapdoors.prototype.isPlayerCloseAfterBoss(self, position)
|
|
310
|
-
local gameFrameCount = game:GetFrameCount()
|
|
311
311
|
local room = game:GetRoom()
|
|
312
312
|
local roomType = room:GetType()
|
|
313
313
|
local roomClearGameFrame = self.roomClearFrame:getRoomClearGameFrame()
|
|
314
|
-
if roomType ~= RoomType.BOSS or roomClearGameFrame == nil or
|
|
314
|
+
if roomType ~= RoomType.BOSS or roomClearGameFrame == nil or onOrPastRenderFrame(nil, roomClearGameFrame + TRAPDOOR_BOSS_REACTION_FRAMES) then
|
|
315
315
|
return false
|
|
316
316
|
end
|
|
317
317
|
return anyPlayerCloserThan(nil, position, TRAPDOOR_OPEN_DISTANCE_AFTER_BOSS)
|
|
@@ -421,9 +421,8 @@ function CustomTrapdoors.prototype.checkJumpComplete(self, player)
|
|
|
421
421
|
end
|
|
422
422
|
function CustomTrapdoors.prototype.shouldTrapdoorSpawnOpen(self, gridEntity, firstSpawn)
|
|
423
423
|
local room = game:GetRoom()
|
|
424
|
-
local roomFrameCount = room:GetFrameCount()
|
|
425
424
|
local roomClear = room:IsClear()
|
|
426
|
-
if
|
|
425
|
+
if isPastRoomFrame(nil, 0) then
|
|
427
426
|
return false
|
|
428
427
|
end
|
|
429
428
|
if not roomClear then
|
|
@@ -457,7 +456,6 @@ function CustomTrapdoors.prototype.spawnCustomTrapdoor(self, gridIndexOrPosition
|
|
|
457
456
|
destinationStageType = self.stageHistory:getNextStageTypeWithHistory()
|
|
458
457
|
end
|
|
459
458
|
local room = game:GetRoom()
|
|
460
|
-
local roomFrameCount = room:GetFrameCount()
|
|
461
459
|
local roomListIndex = getRoomListIndex(nil)
|
|
462
460
|
local gridIndex = isVector(nil, gridIndexOrPosition) and room:GetGridIndex(gridIndexOrPosition) or gridIndexOrPosition
|
|
463
461
|
local gridEntity = self.customGridEntities:spawnCustomGridEntity(
|
|
@@ -467,7 +465,7 @@ function CustomTrapdoors.prototype.spawnCustomTrapdoor(self, gridIndexOrPosition
|
|
|
467
465
|
anm2Path,
|
|
468
466
|
TrapdoorAnimation.OPENED
|
|
469
467
|
)
|
|
470
|
-
local firstSpawn =
|
|
468
|
+
local firstSpawn = isPastRoomFrame(nil, 0)
|
|
471
469
|
local ____spawnOpen_0 = spawnOpen
|
|
472
470
|
if ____spawnOpen_0 == nil then
|
|
473
471
|
____spawnOpen_0 = self:shouldTrapdoorSpawnOpen(gridEntity, firstSpawn)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PickupIndexCreation.d.ts","sourceRoot":"","sources":["../../../../../src/classes/features/other/PickupIndexCreation.ts"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"PickupIndexCreation.d.ts","sourceRoot":"","sources":["../../../../../src/classes/features/other/PickupIndexCreation.ts"],"names":[],"mappings":";AAaA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAE9D,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AA8BhD,qBAAa,mBAAoB,SAAQ,OAAO;IAI9C,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAc;IAC1C,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAkB;IAyBlD,OAAO,CAAC,QAAQ,CAAC,cAAc,CAE7B;IAEF,OAAO,CAAC,cAAc;IA+BtB,OAAO,CAAC,8BAA8B;IAiBtC,OAAO,CAAC,QAAQ,CAAC,sBAAsB,CAErC;IAEF,OAAO,CAAC,oCAAoC;IAc5C;;;OAGG;IACH,OAAO,CAAC,6BAA6B;IAkCrC;;;;OAIG;IACH,OAAO,CAAC,8BAA8B;IAyBtC,OAAO,CAAC,wBAAwB;IA2BhC;;;;;;;;;;;;;;;;;;;OAmBG;IAEI,cAAc,CAAC,MAAM,EAAE,YAAY,GAAG,WAAW;CAgBzD"}
|
|
@@ -19,6 +19,8 @@ local ____ISCFeature = require("src.enums.ISCFeature")
|
|
|
19
19
|
local ISCFeature = ____ISCFeature.ISCFeature
|
|
20
20
|
local ____entities = require("src.functions.entities")
|
|
21
21
|
local getEntityID = ____entities.getEntityID
|
|
22
|
+
local ____frames = require("src.functions.frames")
|
|
23
|
+
local isPastRoomFrame = ____frames.isPastRoomFrame
|
|
22
24
|
local ____roomData = require("src.functions.roomData")
|
|
23
25
|
local getRoomListIndex = ____roomData.getRoomListIndex
|
|
24
26
|
local ____stage = require("src.functions.stage")
|
|
@@ -77,8 +79,7 @@ function PickupIndexCreation.prototype.setPickupIndex(self, pickup)
|
|
|
77
79
|
local pickupIndexFromLevelData = self:getPickupIndexFromPreviousData(pickup)
|
|
78
80
|
local room = game:GetRoom()
|
|
79
81
|
local isFirstVisit = room:IsFirstVisit()
|
|
80
|
-
|
|
81
|
-
if pickupIndexFromLevelData ~= nil and not isFirstVisit and roomFrameCount <= 0 then
|
|
82
|
+
if pickupIndexFromLevelData ~= nil and not isFirstVisit and not isPastRoomFrame(nil, 0) then
|
|
82
83
|
v.room.pickupIndexes:set(ptrHash, pickupIndexFromLevelData)
|
|
83
84
|
return
|
|
84
85
|
end
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PreventCollectibleRotation.d.ts","sourceRoot":"","sources":["../../../../../src/classes/features/other/PreventCollectibleRotation.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,eAAe,EAIhB,MAAM,8BAA8B,CAAC;
|
|
1
|
+
{"version":3,"file":"PreventCollectibleRotation.d.ts","sourceRoot":"","sources":["../../../../../src/classes/features/other/PreventCollectibleRotation.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,eAAe,EAIhB,MAAM,8BAA8B,CAAC;AAatC,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAwBhD,qBAAa,0BAA2B,SAAQ,OAAO;IAIrD,OAAO,CAAC,QAAQ,CAAC,mBAAmB,CAAsB;IAC1D,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAe;IAmC5C,OAAO,CAAC,QAAQ,CAAC,UAAU,CAQzB;IAEF;;;OAGG;IAGH,OAAO,CAAC,QAAQ,CAAC,sBAAsB,CAMrC;IAGF,OAAO,CAAC,QAAQ,CAAC,qBAAqB,CAOpC;IAGF,OAAO,CAAC,QAAQ,CAAC,iBAAiB,CAuChC;IAEF;;;;;;;;;;;OAWG;IAEI,0BAA0B,CAC/B,WAAW,EAAE,YAAY,EACzB,eAAe,EAAE,eAAe,GAC/B,IAAI;CA6BR"}
|
|
@@ -23,6 +23,8 @@ local ____collectibles = require("src.functions.collectibles")
|
|
|
23
23
|
local setCollectibleSubType = ____collectibles.setCollectibleSubType
|
|
24
24
|
local ____entities = require("src.functions.entities")
|
|
25
25
|
local getEntityID = ____entities.getEntityID
|
|
26
|
+
local ____frames = require("src.functions.frames")
|
|
27
|
+
local onGameFrame = ____frames.onGameFrame
|
|
26
28
|
local ____pickupVariants = require("src.functions.pickupVariants")
|
|
27
29
|
local isCollectible = ____pickupVariants.isCollectible
|
|
28
30
|
local ____pickupsSpecific = require("src.functions.pickupsSpecific")
|
|
@@ -76,8 +78,7 @@ function PreventCollectibleRotation.prototype.____constructor(self, pickupIndexC
|
|
|
76
78
|
if trackedCollectibleType == nil then
|
|
77
79
|
return
|
|
78
80
|
end
|
|
79
|
-
|
|
80
|
-
if v.run.rollGameFrame ~= nil and (gameFrameCount == v.run.rollGameFrame or gameFrameCount == v.run.rollGameFrame + 1) then
|
|
81
|
+
if v.run.rollGameFrame ~= nil and (onGameFrame(nil, v.run.rollGameFrame) or onGameFrame(nil, v.run.rollGameFrame + 1)) then
|
|
81
82
|
v.run.trackedCollectibles:delete(pickupIndex)
|
|
82
83
|
return
|
|
83
84
|
end
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SaveDataManager.d.ts","sourceRoot":"","sources":["../../../../../src/classes/features/other/SaveDataManager.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"SaveDataManager.d.ts","sourceRoot":"","sources":["../../../../../src/classes/features/other/SaveDataManager.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AASzD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAC;AAC7D,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAExD,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAsBhD,qBAAa,eAAgB,SAAQ,OAAO;IAC1C;;;OAGG;IACH,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAM;IAE1B;;;;OAIG;IACH,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAkC;IAE9D;;;OAGG;IACH,OAAO,CAAC,QAAQ,CAAC,mBAAmB,CAAkC;IAEtE;;;OAGG;IACH,OAAO,CAAC,QAAQ,CAAC,0BAA0B,CAGvC;IAEJ;;;;;;OAMG;IACH,OAAO,CAAC,QAAQ,CAAC,2BAA2B,CAAkC;IAE9E;;;OAGG;IACH,OAAO,CAAC,QAAQ,CAAC,iBAAiB,CAAkC;IAGpE,OAAO,CAAC,MAAM,CAAS;IACvB,OAAO,CAAC,qCAAqC,CAAS;IAmCtD,OAAO,CAAC,QAAQ,CAAC,2BAA2B,CAU1C;IAGF,OAAO,CAAC,QAAQ,CAAC,cAAc,CAyB7B;IAGF,OAAO,CAAC,QAAQ,CAAC,WAAW,CAa1B;IAGF,OAAO,CAAC,QAAQ,CAAC,YAAY,CAY3B;IAGF,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAuB/B;IAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAoGG;IAEI,eAAe,CAAC,UAAU,EAAE,GAAG,EAAE,KAAK,EAC3C,GAAG,EAAE,MAAM,GAAG,MAAM,EACpB,CAAC,EAAE,QAAQ,CAAC,UAAU,EAAE,GAAG,EAAE,KAAK,CAAC,EACnC,eAAe,CAAC,EAAE,MAAM,OAAO,GAC9B,IAAI;IAEA,eAAe,CACpB,GAAG,EAAE,MAAM,GAAG,MAAM,EACpB,CAAC,EAAE,QAAQ,EACX,eAAe,EAAE,KAAK,GACrB,IAAI;IA4DP;;OAEG;IACH,OAAO,CAAC,gCAAgC;IAgBxC;;;;;;;;;OASG;IAEI,mBAAmB,IAAI,IAAI;IAIlC;;;;;;OAMG;IAEI,mBAAmB,IAAI,IAAI;IAIlC;;;;;;;OAOG;IAEI,wBAAwB,IAAI,IAAI;IAIvC;;;;;;;;;;;OAWG;IAEI,4BAA4B,CAAC,GAAG,WAAW,EAAE,QAAQ,EAAE,GAAG,IAAI;IAarE;;;;;OAKG;IAEI,qBAAqB,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI;IAoB/C;;;;;;;;;;;;;;;;;;;;;OAqBG;IAEI,oBAAoB,CAAC,GAAG,EAAE,MAAM,EAAE,cAAc,EAAE,WAAW,GAAG,IAAI;IAqB3E;;;;;;;;;;;;OAYG;IAEI,qBAAqB,IAAI,OAAO;IAKhC,6BAA6B,IAAI,IAAI;CAQ7C"}
|
|
@@ -10,8 +10,6 @@ local ____exports = {}
|
|
|
10
10
|
local ____isaac_2Dtypescript_2Ddefinitions = require("isaac-typescript-definitions")
|
|
11
11
|
local CollectibleType = ____isaac_2Dtypescript_2Ddefinitions.CollectibleType
|
|
12
12
|
local ModCallback = ____isaac_2Dtypescript_2Ddefinitions.ModCallback
|
|
13
|
-
local ____cachedClasses = require("src.core.cachedClasses")
|
|
14
|
-
local game = ____cachedClasses.game
|
|
15
13
|
local ____decorators = require("src.decorators")
|
|
16
14
|
local Exported = ____decorators.Exported
|
|
17
15
|
local ____ModCallbackCustom = require("src.enums.ModCallbackCustom")
|
|
@@ -22,6 +20,8 @@ local ____SerializationType = require("src.enums.SerializationType")
|
|
|
22
20
|
local SerializationType = ____SerializationType.SerializationType
|
|
23
21
|
local ____deepCopy = require("src.functions.deepCopy")
|
|
24
22
|
local deepCopy = ____deepCopy.deepCopy
|
|
23
|
+
local ____frames = require("src.functions.frames")
|
|
24
|
+
local isPastGameFrame = ____frames.isPastGameFrame
|
|
25
25
|
local ____log = require("src.functions.log")
|
|
26
26
|
local log = ____log.log
|
|
27
27
|
local ____stage = require("src.functions.stage")
|
|
@@ -74,8 +74,7 @@ function SaveDataManager.prototype.____constructor(self, mod)
|
|
|
74
74
|
self.inARun = true
|
|
75
75
|
self.restoreGlowingHourGlassDataOnNextRoom = false
|
|
76
76
|
loadFromDisk(nil, self.mod, self.saveDataMap, self.classConstructors)
|
|
77
|
-
local
|
|
78
|
-
local isContinued = gameFrameCount ~= 0
|
|
77
|
+
local isContinued = isPastGameFrame(nil, 0)
|
|
79
78
|
if not isContinued then
|
|
80
79
|
restoreDefaultsForAllFeaturesAndKeys(nil, self.saveDataMap, self.saveDataDefaultsMap)
|
|
81
80
|
end
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"streakText.d.ts","sourceRoot":"","sources":["../../../../../../src/classes/features/other/customStages/streakText.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"streakText.d.ts","sourceRoot":"","sources":["../../../../../../src/classes/features/other/customStages/streakText.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,4CAA4C,CAAC;AA4E9E,wBAAgB,oBAAoB,IAAI,IAAI,CAS3C;AA0FD,wBAAgB,yBAAyB,CACvC,WAAW,EAAE,WAAW,EACxB,UAAU,EAAE,MAAM,GACjB,IAAI,CAYN;AA0ED,wBAAgB,kBAAkB,IAAI,IAAI,CAWzC"}
|
|
@@ -14,6 +14,9 @@ local KColorDefault = ____constants.KColorDefault
|
|
|
14
14
|
local VectorOne = ____constants.VectorOne
|
|
15
15
|
local ____UIStreakAnimation = require("src.enums.private.UIStreakAnimation")
|
|
16
16
|
local UIStreakAnimation = ____UIStreakAnimation.UIStreakAnimation
|
|
17
|
+
local ____frames = require("src.functions.frames")
|
|
18
|
+
local getElapsedGameFramesSince = ____frames.getElapsedGameFramesSince
|
|
19
|
+
local getElapsedRenderFramesSince = ____frames.getElapsedRenderFramesSince
|
|
17
20
|
local ____ui = require("src.functions.ui")
|
|
18
21
|
local getScreenBottomCenterPos = ____ui.getScreenBottomCenterPos
|
|
19
22
|
local getScreenTopCenterPos = ____ui.getScreenTopCenterPos
|
|
@@ -23,16 +26,15 @@ function checkEndTopStreakText(self)
|
|
|
23
26
|
if v.run.topStreakTextStartedRenderFrame == nil or v.run.topStreakText.animation ~= UIStreakAnimation.TEXT_STAY then
|
|
24
27
|
return
|
|
25
28
|
end
|
|
26
|
-
local
|
|
27
|
-
local elapsedFrames = renderFrameCount - v.run.topStreakTextStartedRenderFrame
|
|
29
|
+
local elapsedFrames = getElapsedRenderFramesSince(nil, v.run.topStreakTextStartedRenderFrame)
|
|
28
30
|
if elapsedFrames >= 115 then
|
|
29
31
|
v.run.topStreakText.animation = UIStreakAnimation.TEXT
|
|
30
32
|
v.run.topStreakText.frame = TEXT_OUT_FRAME - 2
|
|
31
33
|
end
|
|
32
34
|
end
|
|
33
35
|
function trackMapInputPressed(self)
|
|
36
|
+
local gameFrameCount = game:GetFrameCount()
|
|
34
37
|
for ____, controllerIndex in ipairs(CONTROLLER_INDEX_VALUES) do
|
|
35
|
-
local gameFrameCount = game:GetFrameCount()
|
|
36
38
|
local oldPushedMapFrame = v.run.controllerIndexPushingMapRenderFrame:get(controllerIndex)
|
|
37
39
|
local isPushingMap = Input.IsActionPressed(ButtonAction.MAP, controllerIndex)
|
|
38
40
|
if isPushingMap then
|
|
@@ -53,8 +55,7 @@ function checkStartBottomStreakText(self)
|
|
|
53
55
|
return
|
|
54
56
|
end
|
|
55
57
|
local earliestFrame = math.min(table.unpack(pushedMapFrames))
|
|
56
|
-
local
|
|
57
|
-
local elapsedFrames = gameFrameCount - earliestFrame
|
|
58
|
+
local elapsedFrames = getElapsedGameFramesSince(nil, earliestFrame)
|
|
58
59
|
if elapsedFrames >= NUM_RENDER_FRAMES_MAP_HELD_BEFORE_STREAK_TEXT then
|
|
59
60
|
v.run.bottomStreakText.animation = UIStreakAnimation.TEXT
|
|
60
61
|
v.run.bottomStreakText.frame = 0
|
|
@@ -1,4 +1,10 @@
|
|
|
1
1
|
/// <reference types="isaac-typescript-definitions" />
|
|
2
|
+
/**
|
|
3
|
+
* Helper function to get the amount of elapsed time for benchmarking / profiling purposes.
|
|
4
|
+
*
|
|
5
|
+
* For more information, see the documentation for the `getTime` helper function.
|
|
6
|
+
*/
|
|
7
|
+
export declare function getElapsedTimeSince(time: int | float): int;
|
|
2
8
|
/**
|
|
3
9
|
* Helper function to get the current time for benchmarking / profiling purposes.
|
|
4
10
|
*
|
|
@@ -17,7 +23,7 @@
|
|
|
17
23
|
* Default is true. If set to false, the `Isaac.GetTime()` method will
|
|
18
24
|
* always be used.
|
|
19
25
|
*/
|
|
20
|
-
export declare function getTime(useSocketIfAvailable?: boolean): float;
|
|
26
|
+
export declare function getTime(useSocketIfAvailable?: boolean): int | float;
|
|
21
27
|
/**
|
|
22
28
|
* Helper function to get a stack trace.
|
|
23
29
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"debugFunctions.d.ts","sourceRoot":"","sources":["../../../src/functions/debugFunctions.ts"],"names":[],"mappings":";AAEA;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,OAAO,CAAC,oBAAoB,UAAO,GAAG,KAAK,
|
|
1
|
+
{"version":3,"file":"debugFunctions.d.ts","sourceRoot":"","sources":["../../../src/functions/debugFunctions.ts"],"names":[],"mappings":";AAEA;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,GAAG,GAAG,KAAK,GAAG,GAAG,CAE1D;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,OAAO,CAAC,oBAAoB,UAAO,GAAG,GAAG,GAAG,KAAK,CAoBhE;AAED;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,IAAI,GAAG,MAAM,CAa/C;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,iBAAiB,IAAI,OAAO,CAI3C;AAED;;;;;;GAMG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,IAAI,GAAG,IAAI,CAG1C"}
|
|
@@ -1,22 +1,6 @@
|
|
|
1
1
|
local ____exports = {}
|
|
2
2
|
local ____log = require("src.functions.log")
|
|
3
3
|
local log = ____log.log
|
|
4
|
-
--- Players can boot the game with an launch option called "--luadebug", which will enable additional
|
|
5
|
-
-- functionality that is considered to be unsafe. For more information about this flag, see the
|
|
6
|
-
-- wiki: https://bindingofisaacrebirth.fandom.com/wiki/Launch_Options
|
|
7
|
-
--
|
|
8
|
-
-- When this flag is enabled, the global environment will be slightly different. The differences are
|
|
9
|
-
-- documented here: https://wofsauge.github.io/IsaacDocs/rep/Globals.html
|
|
10
|
-
--
|
|
11
|
-
-- This function uses the `package` global variable as a proxy to determine if the "--luadebug" flag
|
|
12
|
-
-- is enabled.
|
|
13
|
-
--
|
|
14
|
-
-- Note that this function will return false if the Racing+ sandbox is enabled, even if the
|
|
15
|
-
-- "--luadebug" flag is really turned on. If checking for this case is needed, check for the
|
|
16
|
-
-- presence of the `sandboxGetTraceback` function.
|
|
17
|
-
function ____exports.isLuaDebugEnabled(self)
|
|
18
|
-
return _G.package ~= nil
|
|
19
|
-
end
|
|
20
4
|
--- Helper function to get the current time for benchmarking / profiling purposes.
|
|
21
5
|
--
|
|
22
6
|
-- The return value will either be in seconds or milliseconds, depending on if the "--luadebug" flag
|
|
@@ -51,6 +35,28 @@ function ____exports.getTime(self, useSocketIfAvailable)
|
|
|
51
35
|
end
|
|
52
36
|
return Isaac.GetTime()
|
|
53
37
|
end
|
|
38
|
+
--- Players can boot the game with an launch option called "--luadebug", which will enable additional
|
|
39
|
+
-- functionality that is considered to be unsafe. For more information about this flag, see the
|
|
40
|
+
-- wiki: https://bindingofisaacrebirth.fandom.com/wiki/Launch_Options
|
|
41
|
+
--
|
|
42
|
+
-- When this flag is enabled, the global environment will be slightly different. The differences are
|
|
43
|
+
-- documented here: https://wofsauge.github.io/IsaacDocs/rep/Globals.html
|
|
44
|
+
--
|
|
45
|
+
-- This function uses the `package` global variable as a proxy to determine if the "--luadebug" flag
|
|
46
|
+
-- is enabled.
|
|
47
|
+
--
|
|
48
|
+
-- Note that this function will return false if the Racing+ sandbox is enabled, even if the
|
|
49
|
+
-- "--luadebug" flag is really turned on. If checking for this case is needed, check for the
|
|
50
|
+
-- presence of the `sandboxGetTraceback` function.
|
|
51
|
+
function ____exports.isLuaDebugEnabled(self)
|
|
52
|
+
return _G.package ~= nil
|
|
53
|
+
end
|
|
54
|
+
--- Helper function to get the amount of elapsed time for benchmarking / profiling purposes.
|
|
55
|
+
--
|
|
56
|
+
-- For more information, see the documentation for the `getTime` helper function.
|
|
57
|
+
function ____exports.getElapsedTimeSince(self, time)
|
|
58
|
+
return ____exports.getTime(nil) - time
|
|
59
|
+
end
|
|
54
60
|
--- Helper function to get a stack trace.
|
|
55
61
|
--
|
|
56
62
|
-- This will only work if the `--luadebug` launch option is enabled. If it isn't, then a error
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
/// <reference types="isaac-typescript-definitions" />
|
|
2
|
+
export declare function getElapsedGameFramesSince(gameFrameCount: int): int;
|
|
3
|
+
export declare function getElapsedRenderFramesSince(renderFrameCount: int): int;
|
|
4
|
+
export declare function getElapsedRoomFramesSince(roomFrameCount: int): int;
|
|
5
|
+
/**
|
|
6
|
+
* Helper function to check if the current game frame count is higher than a specific game frame
|
|
7
|
+
* count.
|
|
8
|
+
*
|
|
9
|
+
* This returns false if the submitted game frame count is null or undefined.
|
|
10
|
+
*/
|
|
11
|
+
export declare function isPastGameFrame(gameFrameCount: int | null | undefined): boolean;
|
|
12
|
+
/**
|
|
13
|
+
* Helper function to check if the current render frame count is higher than a specific render frame
|
|
14
|
+
* count.
|
|
15
|
+
*
|
|
16
|
+
* This returns false if the submitted render frame count is null or undefined.
|
|
17
|
+
*/
|
|
18
|
+
export declare function isPastRenderFrame(renderFrameCount: int | null | undefined): boolean;
|
|
19
|
+
/**
|
|
20
|
+
* Helper function to check if the current room frame count is higher than a specific room frame
|
|
21
|
+
* count.
|
|
22
|
+
*
|
|
23
|
+
* This returns false if the submitted room frame count is null or undefined.
|
|
24
|
+
*/
|
|
25
|
+
export declare function isPastRoomFrame(roomFrameCount: int | null | undefined): boolean;
|
|
26
|
+
/**
|
|
27
|
+
* Helper function to check if the current game frame count is exactly equal to a specific game
|
|
28
|
+
* frame count.
|
|
29
|
+
*
|
|
30
|
+
* This returns false if the submitted game frame count is null or undefined.
|
|
31
|
+
*/
|
|
32
|
+
export declare function onGameFrame(gameFrameCount: int | null | undefined): boolean;
|
|
33
|
+
/**
|
|
34
|
+
* Helper function to check if the current game frame count is equal to or higher than a specific
|
|
35
|
+
* game frame count.
|
|
36
|
+
*
|
|
37
|
+
* This returns false if the submitted game frame count is null or undefined.
|
|
38
|
+
*/
|
|
39
|
+
export declare function onOrPastGameFrame(gameFrameCount: int | null | undefined): boolean;
|
|
40
|
+
/**
|
|
41
|
+
* Helper function to check if the current render frame count is equal to or higher than a specific
|
|
42
|
+
* render frame count.
|
|
43
|
+
*
|
|
44
|
+
* This returns false if the submitted render frame count is null or undefined.
|
|
45
|
+
*/
|
|
46
|
+
export declare function onOrPastRenderFrame(renderFrameCount: int | null | undefined): boolean;
|
|
47
|
+
/**
|
|
48
|
+
* Helper function to check if the current room frame count is equal to or higher than a specific
|
|
49
|
+
* room frame count.
|
|
50
|
+
*
|
|
51
|
+
* This returns false if the submitted room frame count is null or undefined.
|
|
52
|
+
*/
|
|
53
|
+
export declare function onOrPastRoomFrame(roomFrameCount: int | null | undefined): boolean;
|
|
54
|
+
/**
|
|
55
|
+
* Helper function to check if the current render frame count is exactly equal to a specific render
|
|
56
|
+
* frame count.
|
|
57
|
+
*
|
|
58
|
+
* This returns false if the submitted render frame count is null or undefined.
|
|
59
|
+
*/
|
|
60
|
+
export declare function onRenderFrame(renderFrameCount: int | null | undefined): boolean;
|
|
61
|
+
/**
|
|
62
|
+
* Helper function to check if the current room frame count is exactly equal to a specific room
|
|
63
|
+
* frame count.
|
|
64
|
+
*
|
|
65
|
+
* This returns false if the submitted room frame count is null or undefined.
|
|
66
|
+
*/
|
|
67
|
+
export declare function onRoomFrame(roomFrameCount: int | null | undefined): boolean;
|
|
68
|
+
//# sourceMappingURL=frames.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"frames.d.ts","sourceRoot":"","sources":["../../../src/functions/frames.ts"],"names":[],"mappings":";AAEA,wBAAgB,yBAAyB,CAAC,cAAc,EAAE,GAAG,GAAG,GAAG,CAGlE;AAED,wBAAgB,2BAA2B,CAAC,gBAAgB,EAAE,GAAG,GAAG,GAAG,CAGtE;AAED,wBAAgB,yBAAyB,CAAC,cAAc,EAAE,GAAG,GAAG,GAAG,CAIlE;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,CAC7B,cAAc,EAAE,GAAG,GAAG,IAAI,GAAG,SAAS,GACrC,OAAO,CAOT;AAED;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAC/B,gBAAgB,EAAE,GAAG,GAAG,IAAI,GAAG,SAAS,GACvC,OAAO,CAOT;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,CAC7B,cAAc,EAAE,GAAG,GAAG,IAAI,GAAG,SAAS,GACrC,OAAO,CAST;AAED;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,cAAc,EAAE,GAAG,GAAG,IAAI,GAAG,SAAS,GAAG,OAAO,CAO3E;AAED;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAC/B,cAAc,EAAE,GAAG,GAAG,IAAI,GAAG,SAAS,GACrC,OAAO,CAOT;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,CACjC,gBAAgB,EAAE,GAAG,GAAG,IAAI,GAAG,SAAS,GACvC,OAAO,CAOT;AAED;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAC/B,cAAc,EAAE,GAAG,GAAG,IAAI,GAAG,SAAS,GACrC,OAAO,CAST;AAED;;;;;GAKG;AACH,wBAAgB,aAAa,CAC3B,gBAAgB,EAAE,GAAG,GAAG,IAAI,GAAG,SAAS,GACvC,OAAO,CAOT;AAED;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,cAAc,EAAE,GAAG,GAAG,IAAI,GAAG,SAAS,GAAG,OAAO,CAS3E"}
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
local ____exports = {}
|
|
2
|
+
local ____cachedClasses = require("src.core.cachedClasses")
|
|
3
|
+
local game = ____cachedClasses.game
|
|
4
|
+
function ____exports.getElapsedGameFramesSince(self, gameFrameCount)
|
|
5
|
+
local thisGameFrameCount = game:GetFrameCount()
|
|
6
|
+
return thisGameFrameCount - gameFrameCount
|
|
7
|
+
end
|
|
8
|
+
function ____exports.getElapsedRenderFramesSince(self, renderFrameCount)
|
|
9
|
+
local thisRenderFrameCount = Isaac.GetFrameCount()
|
|
10
|
+
return thisRenderFrameCount - renderFrameCount
|
|
11
|
+
end
|
|
12
|
+
function ____exports.getElapsedRoomFramesSince(self, roomFrameCount)
|
|
13
|
+
local room = game:GetRoom()
|
|
14
|
+
local thisRoomFrameCount = room:GetFrameCount()
|
|
15
|
+
return thisRoomFrameCount - roomFrameCount
|
|
16
|
+
end
|
|
17
|
+
--- Helper function to check if the current game frame count is higher than a specific game frame
|
|
18
|
+
-- count.
|
|
19
|
+
--
|
|
20
|
+
-- This returns false if the submitted game frame count is null or undefined.
|
|
21
|
+
function ____exports.isPastGameFrame(self, gameFrameCount)
|
|
22
|
+
if gameFrameCount == nil or gameFrameCount == nil then
|
|
23
|
+
return false
|
|
24
|
+
end
|
|
25
|
+
local thisGameFrameCount = game:GetFrameCount()
|
|
26
|
+
return thisGameFrameCount > gameFrameCount
|
|
27
|
+
end
|
|
28
|
+
--- Helper function to check if the current render frame count is higher than a specific render frame
|
|
29
|
+
-- count.
|
|
30
|
+
--
|
|
31
|
+
-- This returns false if the submitted render frame count is null or undefined.
|
|
32
|
+
function ____exports.isPastRenderFrame(self, renderFrameCount)
|
|
33
|
+
if renderFrameCount == nil or renderFrameCount == nil then
|
|
34
|
+
return false
|
|
35
|
+
end
|
|
36
|
+
local thisRenderFrameCount = Isaac.GetFrameCount()
|
|
37
|
+
return thisRenderFrameCount >= renderFrameCount
|
|
38
|
+
end
|
|
39
|
+
--- Helper function to check if the current room frame count is higher than a specific room frame
|
|
40
|
+
-- count.
|
|
41
|
+
--
|
|
42
|
+
-- This returns false if the submitted room frame count is null or undefined.
|
|
43
|
+
function ____exports.isPastRoomFrame(self, roomFrameCount)
|
|
44
|
+
if roomFrameCount == nil or roomFrameCount == nil then
|
|
45
|
+
return false
|
|
46
|
+
end
|
|
47
|
+
local room = game:GetRoom()
|
|
48
|
+
local thisGameFrameCount = room:GetFrameCount()
|
|
49
|
+
return thisGameFrameCount > roomFrameCount
|
|
50
|
+
end
|
|
51
|
+
--- Helper function to check if the current game frame count is exactly equal to a specific game
|
|
52
|
+
-- frame count.
|
|
53
|
+
--
|
|
54
|
+
-- This returns false if the submitted game frame count is null or undefined.
|
|
55
|
+
function ____exports.onGameFrame(self, gameFrameCount)
|
|
56
|
+
if gameFrameCount == nil or gameFrameCount == nil then
|
|
57
|
+
return false
|
|
58
|
+
end
|
|
59
|
+
local thisGameFrameCount = game:GetFrameCount()
|
|
60
|
+
return thisGameFrameCount == gameFrameCount
|
|
61
|
+
end
|
|
62
|
+
--- Helper function to check if the current game frame count is equal to or higher than a specific
|
|
63
|
+
-- game frame count.
|
|
64
|
+
--
|
|
65
|
+
-- This returns false if the submitted game frame count is null or undefined.
|
|
66
|
+
function ____exports.onOrPastGameFrame(self, gameFrameCount)
|
|
67
|
+
if gameFrameCount == nil or gameFrameCount == nil then
|
|
68
|
+
return false
|
|
69
|
+
end
|
|
70
|
+
local thisGameFrameCount = game:GetFrameCount()
|
|
71
|
+
return thisGameFrameCount >= gameFrameCount
|
|
72
|
+
end
|
|
73
|
+
--- Helper function to check if the current render frame count is equal to or higher than a specific
|
|
74
|
+
-- render frame count.
|
|
75
|
+
--
|
|
76
|
+
-- This returns false if the submitted render frame count is null or undefined.
|
|
77
|
+
function ____exports.onOrPastRenderFrame(self, renderFrameCount)
|
|
78
|
+
if renderFrameCount == nil or renderFrameCount == nil then
|
|
79
|
+
return false
|
|
80
|
+
end
|
|
81
|
+
local thisRenderFrameCount = Isaac.GetFrameCount()
|
|
82
|
+
return thisRenderFrameCount >= renderFrameCount
|
|
83
|
+
end
|
|
84
|
+
--- Helper function to check if the current room frame count is equal to or higher than a specific
|
|
85
|
+
-- room frame count.
|
|
86
|
+
--
|
|
87
|
+
-- This returns false if the submitted room frame count is null or undefined.
|
|
88
|
+
function ____exports.onOrPastRoomFrame(self, roomFrameCount)
|
|
89
|
+
if roomFrameCount == nil or roomFrameCount == nil then
|
|
90
|
+
return false
|
|
91
|
+
end
|
|
92
|
+
local room = game:GetRoom()
|
|
93
|
+
local thisGameFrameCount = room:GetFrameCount()
|
|
94
|
+
return thisGameFrameCount >= roomFrameCount
|
|
95
|
+
end
|
|
96
|
+
--- Helper function to check if the current render frame count is exactly equal to a specific render
|
|
97
|
+
-- frame count.
|
|
98
|
+
--
|
|
99
|
+
-- This returns false if the submitted render frame count is null or undefined.
|
|
100
|
+
function ____exports.onRenderFrame(self, renderFrameCount)
|
|
101
|
+
if renderFrameCount == nil or renderFrameCount == nil then
|
|
102
|
+
return false
|
|
103
|
+
end
|
|
104
|
+
local thisRenderFrameCount = Isaac.GetFrameCount()
|
|
105
|
+
return thisRenderFrameCount >= renderFrameCount
|
|
106
|
+
end
|
|
107
|
+
--- Helper function to check if the current room frame count is exactly equal to a specific room
|
|
108
|
+
-- frame count.
|
|
109
|
+
--
|
|
110
|
+
-- This returns false if the submitted room frame count is null or undefined.
|
|
111
|
+
function ____exports.onRoomFrame(self, roomFrameCount)
|
|
112
|
+
if roomFrameCount == nil or roomFrameCount == nil then
|
|
113
|
+
return false
|
|
114
|
+
end
|
|
115
|
+
local room = game:GetRoom()
|
|
116
|
+
local thisGameFrameCount = room:GetFrameCount()
|
|
117
|
+
return thisGameFrameCount == roomFrameCount
|
|
118
|
+
end
|
|
119
|
+
return ____exports
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"revive.d.ts","sourceRoot":"","sources":["../../../src/functions/revive.ts"],"names":[],"mappings":";;;AAoBA;;;GAGG;AACH,wBAAgB,qBAAqB,CACnC,MAAM,EAAE,YAAY,EACpB,MAAM,EAAE,GAAG,EACX,MAAM,EAAE,SAAS,EACjB,mBAAmB,EAAE,GAAG,GAAG,SAAS,GACnC,OAAO,
|
|
1
|
+
{"version":3,"file":"revive.d.ts","sourceRoot":"","sources":["../../../src/functions/revive.ts"],"names":[],"mappings":";;;AAoBA;;;GAGG;AACH,wBAAgB,qBAAqB,CACnC,MAAM,EAAE,YAAY,EACpB,MAAM,EAAE,GAAG,EACX,MAAM,EAAE,SAAS,EACjB,mBAAmB,EAAE,GAAG,GAAG,SAAS,GACnC,OAAO,CAsFT;AAED;;;;;;;GAOG;AACH,wBAAgB,yBAAyB,CAAC,MAAM,EAAE,YAAY,GAAG,OAAO,CAmBvE;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,YAAY,GAAG,OAAO,CAa9D;AAED;;;;GAIG;AACH,wBAAgB,wBAAwB,CAAC,MAAM,EAAE,YAAY,GAAG,OAAO,CAYtE;AAED;;;GAGG;AACH,wBAAgB,4BAA4B,CAAC,MAAM,EAAE,YAAY,GAAG,OAAO,CAe1E"}
|
|
@@ -5,8 +5,6 @@ local EntityType = ____isaac_2Dtypescript_2Ddefinitions.EntityType
|
|
|
5
5
|
local NullItemID = ____isaac_2Dtypescript_2Ddefinitions.NullItemID
|
|
6
6
|
local PlayerType = ____isaac_2Dtypescript_2Ddefinitions.PlayerType
|
|
7
7
|
local TrinketType = ____isaac_2Dtypescript_2Ddefinitions.TrinketType
|
|
8
|
-
local ____cachedClasses = require("src.core.cachedClasses")
|
|
9
|
-
local game = ____cachedClasses.game
|
|
10
8
|
local ____constants = require("src.core.constants")
|
|
11
9
|
local MAX_TAINTED_SAMSON_BERSERK_CHARGE = ____constants.MAX_TAINTED_SAMSON_BERSERK_CHARGE
|
|
12
10
|
local TAINTED_SAMSON_BERSERK_CHARGE_FROM_TAKING_DAMAGE = ____constants.TAINTED_SAMSON_BERSERK_CHARGE_FROM_TAKING_DAMAGE
|
|
@@ -14,6 +12,8 @@ local ____MysteriousPaperEffect = require("src.enums.MysteriousPaperEffect")
|
|
|
14
12
|
local MysteriousPaperEffect = ____MysteriousPaperEffect.MysteriousPaperEffect
|
|
15
13
|
local ____characters = require("src.functions.characters")
|
|
16
14
|
local getCharacterDeathAnimationName = ____characters.getCharacterDeathAnimationName
|
|
15
|
+
local ____frames = require("src.functions.frames")
|
|
16
|
+
local onGameFrame = ____frames.onGameFrame
|
|
17
17
|
local ____playerHealth = require("src.functions.playerHealth")
|
|
18
18
|
local getPlayerMaxHeartContainers = ____playerHealth.getPlayerMaxHeartContainers
|
|
19
19
|
local ____players = require("src.functions.players")
|
|
@@ -54,7 +54,6 @@ end
|
|
|
54
54
|
--- Uses the player's current health and other miscellaneous things to determine if incoming damage
|
|
55
55
|
-- will be fatal.
|
|
56
56
|
function ____exports.isDamageToPlayerFatal(self, player, amount, source, lastDamageGameFrame)
|
|
57
|
-
local gameFrameCount = game:GetFrameCount()
|
|
58
57
|
local character = player:GetPlayerType()
|
|
59
58
|
local effects = player:GetEffects()
|
|
60
59
|
local isBerserk = effects:HasCollectibleEffect(CollectibleType.BERSERK)
|
|
@@ -84,7 +83,7 @@ function ____exports.isDamageToPlayerFatal(self, player, amount, source, lastDam
|
|
|
84
83
|
if ____exports.willReviveFromHeartbreak(nil, player) then
|
|
85
84
|
return false
|
|
86
85
|
end
|
|
87
|
-
if player:HasCollectible(CollectibleType.BROKEN_GLASS_CANNON) and
|
|
86
|
+
if player:HasCollectible(CollectibleType.BROKEN_GLASS_CANNON) and onGameFrame(nil, lastDamageGameFrame) then
|
|
88
87
|
return false
|
|
89
88
|
end
|
|
90
89
|
local hearts = player:GetHearts()
|
package/dist/src/index.d.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";
|