isaacscript-common 67.3.0 → 69.0.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 +18 -42
- package/dist/isaacscript-common.lua +19 -54
- package/dist/src/functions/bosses.d.ts +5 -5
- package/dist/src/functions/bosses.d.ts.map +1 -1
- package/dist/src/functions/bosses.lua +22 -12
- package/dist/src/functions/frames.d.ts +13 -37
- package/dist/src/functions/frames.d.ts.map +1 -1
- package/dist/src/functions/frames.lua +1 -70
- package/package.json +1 -1
- package/src/functions/bosses.ts +26 -7
- package/src/functions/frames.ts +13 -121
package/dist/index.rollup.d.ts
CHANGED
|
@@ -4967,13 +4967,13 @@ export declare function getBooleansFromTable(luaMap: LuaMap<string, unknown>, ob
|
|
|
4967
4967
|
export declare function getBosses(entityType?: EntityType, variant?: int, subType?: int, ignoreFriendly?: boolean): EntityNPC[];
|
|
4968
4968
|
|
|
4969
4969
|
/**
|
|
4970
|
-
* Helper function to get the boss ID corresponding to the current room. Returns
|
|
4971
|
-
* room is not a Boss Room.
|
|
4970
|
+
* Helper function to get the boss ID corresponding to the current room. Returns undefined if the
|
|
4971
|
+
* current room is not a Boss Room.
|
|
4972
4972
|
*
|
|
4973
|
-
* Use this instead of the vanilla `Room.GetBossID` method since it
|
|
4974
|
-
* Beast.
|
|
4973
|
+
* Use this instead of the vanilla `Room.GetBossID` method since it has a saner return type and it
|
|
4974
|
+
* correctly handles Dogma, The Beast, and Ultra Greedier.
|
|
4975
4975
|
*/
|
|
4976
|
-
export declare function getBossID(): BossID |
|
|
4976
|
+
export declare function getBossID(): BossID | undefined;
|
|
4977
4977
|
|
|
4978
4978
|
export declare function getBossIDFromEntityTypeVariant(entityType: EntityType, variant: int): BossID | undefined;
|
|
4979
4979
|
|
|
@@ -8597,26 +8597,20 @@ export declare function isActiveSlotEmpty(player: EntityPlayer, activeSlot?: Act
|
|
|
8597
8597
|
/**
|
|
8598
8598
|
* Helper function to check if the current game frame count is higher than a specific game frame
|
|
8599
8599
|
* count.
|
|
8600
|
-
*
|
|
8601
|
-
* This returns false if the submitted game frame count is null or undefined.
|
|
8602
8600
|
*/
|
|
8603
|
-
export declare function isAfterGameFrame(gameFrameCount: int
|
|
8601
|
+
export declare function isAfterGameFrame(gameFrameCount: int): boolean;
|
|
8604
8602
|
|
|
8605
8603
|
/**
|
|
8606
8604
|
* Helper function to check if the current render frame count is higher than a specific render frame
|
|
8607
8605
|
* count.
|
|
8608
|
-
*
|
|
8609
|
-
* This returns false if the submitted render frame count is null or undefined.
|
|
8610
8606
|
*/
|
|
8611
|
-
export declare function isAfterRenderFrame(renderFrameCount: int
|
|
8607
|
+
export declare function isAfterRenderFrame(renderFrameCount: int): boolean;
|
|
8612
8608
|
|
|
8613
8609
|
/**
|
|
8614
8610
|
* Helper function to check if the current room frame count is higher than a specific room frame
|
|
8615
8611
|
* count.
|
|
8616
|
-
*
|
|
8617
|
-
* This returns false if the submitted room frame count is null or undefined.
|
|
8618
8612
|
*/
|
|
8619
|
-
export declare function isAfterRoomFrame(roomFrameCount: int
|
|
8613
|
+
export declare function isAfterRoomFrame(roomFrameCount: int): boolean;
|
|
8620
8614
|
|
|
8621
8615
|
/**
|
|
8622
8616
|
* Checks for specific NPCs that have "CanShutDoors" set to true naturally by the game, but should
|
|
@@ -8701,26 +8695,20 @@ export declare function isBeastRoom(roomData: RoomConfig): boolean;
|
|
|
8701
8695
|
/**
|
|
8702
8696
|
* Helper function to check if the current game frame count is lower than a specific game frame
|
|
8703
8697
|
* count.
|
|
8704
|
-
*
|
|
8705
|
-
* This returns false if the submitted game frame count is null or undefined.
|
|
8706
8698
|
*/
|
|
8707
|
-
export declare function isBeforeGameFrame(gameFrameCount: int
|
|
8699
|
+
export declare function isBeforeGameFrame(gameFrameCount: int): boolean;
|
|
8708
8700
|
|
|
8709
8701
|
/**
|
|
8710
8702
|
* Helper function to check if the current render frame count is lower than a specific render frame
|
|
8711
8703
|
* count.
|
|
8712
|
-
*
|
|
8713
|
-
* This returns false if the submitted render frame count is null or undefined.
|
|
8714
8704
|
*/
|
|
8715
|
-
export declare function isBeforeRenderFrame(renderFrameCount: int
|
|
8705
|
+
export declare function isBeforeRenderFrame(renderFrameCount: int): boolean;
|
|
8716
8706
|
|
|
8717
8707
|
/**
|
|
8718
8708
|
* Helper function to check if the current room frame count is lower than a specific room frame
|
|
8719
8709
|
* count.
|
|
8720
|
-
*
|
|
8721
|
-
* This returns false if the submitted room frame count is null or undefined.
|
|
8722
8710
|
*/
|
|
8723
|
-
export declare function isBeforeRoomFrame(roomFrameCount: int
|
|
8711
|
+
export declare function isBeforeRoomFrame(roomFrameCount: int): boolean;
|
|
8724
8712
|
|
|
8725
8713
|
/**
|
|
8726
8714
|
* Helper function for detecting when a player is Bethany or Tainted Bethany. This is useful if you
|
|
@@ -14475,57 +14463,45 @@ export declare function onFirstFloor(): boolean;
|
|
|
14475
14463
|
* Helper function to check if the current game frame count is exactly equal to a specific game
|
|
14476
14464
|
* frame count.
|
|
14477
14465
|
*
|
|
14478
|
-
* This returns false if the submitted
|
|
14466
|
+
* This returns false if the submitted render frame count is null or undefined.
|
|
14479
14467
|
*/
|
|
14480
14468
|
export declare function onGameFrame(gameFrameCount: int | null | undefined): boolean;
|
|
14481
14469
|
|
|
14482
14470
|
/**
|
|
14483
14471
|
* Helper function to check if the current game frame count is equal to or higher than a specific
|
|
14484
14472
|
* game frame count.
|
|
14485
|
-
*
|
|
14486
|
-
* This returns false if the submitted game frame count is null or undefined.
|
|
14487
14473
|
*/
|
|
14488
|
-
export declare function onOrAfterGameFrame(gameFrameCount: int
|
|
14474
|
+
export declare function onOrAfterGameFrame(gameFrameCount: int): boolean;
|
|
14489
14475
|
|
|
14490
14476
|
/**
|
|
14491
14477
|
* Helper function to check if the current render frame count is equal to or higher than a specific
|
|
14492
14478
|
* render frame count.
|
|
14493
|
-
*
|
|
14494
|
-
* This returns false if the submitted render frame count is null or undefined.
|
|
14495
14479
|
*/
|
|
14496
|
-
export declare function onOrAfterRenderFrame(renderFrameCount: int
|
|
14480
|
+
export declare function onOrAfterRenderFrame(renderFrameCount: int): boolean;
|
|
14497
14481
|
|
|
14498
14482
|
/**
|
|
14499
14483
|
* Helper function to check if the current room frame count is equal to or higher than a specific
|
|
14500
14484
|
* room frame count.
|
|
14501
|
-
*
|
|
14502
|
-
* This returns false if the submitted room frame count is null or undefined.
|
|
14503
14485
|
*/
|
|
14504
|
-
export declare function onOrAfterRoomFrame(roomFrameCount: int
|
|
14486
|
+
export declare function onOrAfterRoomFrame(roomFrameCount: int): boolean;
|
|
14505
14487
|
|
|
14506
14488
|
/**
|
|
14507
14489
|
* Helper function to check if the current game frame count is equal to or lower than a specific
|
|
14508
14490
|
* game frame count.
|
|
14509
|
-
*
|
|
14510
|
-
* This returns false if the submitted game frame count is null or undefined.
|
|
14511
14491
|
*/
|
|
14512
|
-
export declare function onOrBeforeGameFrame(gameFrameCount: int
|
|
14492
|
+
export declare function onOrBeforeGameFrame(gameFrameCount: int): boolean;
|
|
14513
14493
|
|
|
14514
14494
|
/**
|
|
14515
14495
|
* Helper function to check if the current render frame count is equal to or lower than a specific
|
|
14516
14496
|
* render frame count.
|
|
14517
|
-
*
|
|
14518
|
-
* This returns false if the submitted render frame count is null or undefined.
|
|
14519
14497
|
*/
|
|
14520
|
-
export declare function onOrBeforeRenderFrame(renderFrameCount: int
|
|
14498
|
+
export declare function onOrBeforeRenderFrame(renderFrameCount: int): boolean;
|
|
14521
14499
|
|
|
14522
14500
|
/**
|
|
14523
14501
|
* Helper function to check if the current room frame count is equal to or lower than a specific
|
|
14524
14502
|
* room frame count.
|
|
14525
|
-
*
|
|
14526
|
-
* This returns false if the submitted room frame count is null or undefined.
|
|
14527
14503
|
*/
|
|
14528
|
-
export declare function onOrBeforeRoomFrame(roomFrameCount: int
|
|
14504
|
+
export declare function onOrBeforeRoomFrame(roomFrameCount: int): boolean;
|
|
14529
14505
|
|
|
14530
14506
|
/**
|
|
14531
14507
|
* Helper function to check if the current render frame count is exactly equal to a specific render
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
--[[
|
|
2
2
|
|
|
3
|
-
isaacscript-common
|
|
3
|
+
isaacscript-common 69.0.0
|
|
4
4
|
|
|
5
5
|
This is the "isaacscript-common" library, which was created with the IsaacScript tool.
|
|
6
6
|
|
|
@@ -19114,111 +19114,66 @@ function ____exports.getElapsedRoomFramesSince(self, roomFrameCount)
|
|
|
19114
19114
|
return thisRoomFrameCount - roomFrameCount
|
|
19115
19115
|
end
|
|
19116
19116
|
function ____exports.isAfterGameFrame(self, gameFrameCount)
|
|
19117
|
-
if gameFrameCount == nil or gameFrameCount == nil then
|
|
19118
|
-
return false
|
|
19119
|
-
end
|
|
19120
19117
|
local thisGameFrameCount = game:GetFrameCount()
|
|
19121
19118
|
return thisGameFrameCount > gameFrameCount
|
|
19122
19119
|
end
|
|
19123
19120
|
function ____exports.isAfterRenderFrame(self, renderFrameCount)
|
|
19124
|
-
if renderFrameCount == nil or renderFrameCount == nil then
|
|
19125
|
-
return false
|
|
19126
|
-
end
|
|
19127
19121
|
local thisRenderFrameCount = Isaac.GetFrameCount()
|
|
19128
19122
|
return thisRenderFrameCount > renderFrameCount
|
|
19129
19123
|
end
|
|
19130
19124
|
function ____exports.isAfterRoomFrame(self, roomFrameCount)
|
|
19131
|
-
if roomFrameCount == nil or roomFrameCount == nil then
|
|
19132
|
-
return false
|
|
19133
|
-
end
|
|
19134
19125
|
local room = game:GetRoom()
|
|
19135
19126
|
local thisGameFrameCount = room:GetFrameCount()
|
|
19136
19127
|
return thisGameFrameCount > roomFrameCount
|
|
19137
19128
|
end
|
|
19138
19129
|
function ____exports.isBeforeGameFrame(self, gameFrameCount)
|
|
19139
|
-
if gameFrameCount == nil or gameFrameCount == nil then
|
|
19140
|
-
return false
|
|
19141
|
-
end
|
|
19142
19130
|
local thisGameFrameCount = game:GetFrameCount()
|
|
19143
19131
|
return thisGameFrameCount < gameFrameCount
|
|
19144
19132
|
end
|
|
19145
19133
|
function ____exports.isBeforeRenderFrame(self, renderFrameCount)
|
|
19146
|
-
if renderFrameCount == nil or renderFrameCount == nil then
|
|
19147
|
-
return false
|
|
19148
|
-
end
|
|
19149
19134
|
local thisRenderFrameCount = Isaac.GetFrameCount()
|
|
19150
19135
|
return thisRenderFrameCount < renderFrameCount
|
|
19151
19136
|
end
|
|
19152
19137
|
function ____exports.isBeforeRoomFrame(self, roomFrameCount)
|
|
19153
|
-
if roomFrameCount == nil or roomFrameCount == nil then
|
|
19154
|
-
return false
|
|
19155
|
-
end
|
|
19156
19138
|
local room = game:GetRoom()
|
|
19157
19139
|
local thisGameFrameCount = room:GetFrameCount()
|
|
19158
19140
|
return thisGameFrameCount < roomFrameCount
|
|
19159
19141
|
end
|
|
19160
19142
|
function ____exports.onGameFrame(self, gameFrameCount)
|
|
19161
|
-
if gameFrameCount == nil or gameFrameCount == nil then
|
|
19162
|
-
return false
|
|
19163
|
-
end
|
|
19164
19143
|
local thisGameFrameCount = game:GetFrameCount()
|
|
19165
19144
|
return thisGameFrameCount == gameFrameCount
|
|
19166
19145
|
end
|
|
19167
19146
|
function ____exports.onOrAfterGameFrame(self, gameFrameCount)
|
|
19168
|
-
if gameFrameCount == nil or gameFrameCount == nil then
|
|
19169
|
-
return false
|
|
19170
|
-
end
|
|
19171
19147
|
local thisGameFrameCount = game:GetFrameCount()
|
|
19172
19148
|
return thisGameFrameCount >= gameFrameCount
|
|
19173
19149
|
end
|
|
19174
19150
|
function ____exports.onOrAfterRenderFrame(self, renderFrameCount)
|
|
19175
|
-
if renderFrameCount == nil or renderFrameCount == nil then
|
|
19176
|
-
return false
|
|
19177
|
-
end
|
|
19178
19151
|
local thisRenderFrameCount = Isaac.GetFrameCount()
|
|
19179
19152
|
return thisRenderFrameCount >= renderFrameCount
|
|
19180
19153
|
end
|
|
19181
19154
|
function ____exports.onOrAfterRoomFrame(self, roomFrameCount)
|
|
19182
|
-
if roomFrameCount == nil or roomFrameCount == nil then
|
|
19183
|
-
return false
|
|
19184
|
-
end
|
|
19185
19155
|
local room = game:GetRoom()
|
|
19186
19156
|
local thisGameFrameCount = room:GetFrameCount()
|
|
19187
19157
|
return thisGameFrameCount >= roomFrameCount
|
|
19188
19158
|
end
|
|
19189
19159
|
function ____exports.onOrBeforeGameFrame(self, gameFrameCount)
|
|
19190
|
-
if gameFrameCount == nil or gameFrameCount == nil then
|
|
19191
|
-
return false
|
|
19192
|
-
end
|
|
19193
19160
|
local thisGameFrameCount = game:GetFrameCount()
|
|
19194
19161
|
return thisGameFrameCount <= gameFrameCount
|
|
19195
19162
|
end
|
|
19196
19163
|
function ____exports.onOrBeforeRenderFrame(self, renderFrameCount)
|
|
19197
|
-
if renderFrameCount == nil or renderFrameCount == nil then
|
|
19198
|
-
return false
|
|
19199
|
-
end
|
|
19200
19164
|
local thisRenderFrameCount = Isaac.GetFrameCount()
|
|
19201
19165
|
return thisRenderFrameCount <= renderFrameCount
|
|
19202
19166
|
end
|
|
19203
19167
|
function ____exports.onOrBeforeRoomFrame(self, roomFrameCount)
|
|
19204
|
-
if roomFrameCount == nil or roomFrameCount == nil then
|
|
19205
|
-
return false
|
|
19206
|
-
end
|
|
19207
19168
|
local room = game:GetRoom()
|
|
19208
19169
|
local thisGameFrameCount = room:GetFrameCount()
|
|
19209
19170
|
return thisGameFrameCount <= roomFrameCount
|
|
19210
19171
|
end
|
|
19211
19172
|
function ____exports.onRenderFrame(self, renderFrameCount)
|
|
19212
|
-
if renderFrameCount == nil or renderFrameCount == nil then
|
|
19213
|
-
return false
|
|
19214
|
-
end
|
|
19215
19173
|
local thisRenderFrameCount = Isaac.GetFrameCount()
|
|
19216
19174
|
return thisRenderFrameCount == renderFrameCount
|
|
19217
19175
|
end
|
|
19218
19176
|
function ____exports.onRoomFrame(self, roomFrameCount)
|
|
19219
|
-
if roomFrameCount == nil or roomFrameCount == nil then
|
|
19220
|
-
return false
|
|
19221
|
-
end
|
|
19222
19177
|
local room = game:GetRoom()
|
|
19223
19178
|
local thisGameFrameCount = room:GetFrameCount()
|
|
19224
19179
|
return thisGameFrameCount == roomFrameCount
|
|
@@ -44941,6 +44896,7 @@ local ____isaac_2Dtypescript_2Ddefinitions = require("lua_modules.isaac-typescri
|
|
|
44941
44896
|
local BossID = ____isaac_2Dtypescript_2Ddefinitions.BossID
|
|
44942
44897
|
local EntityType = ____isaac_2Dtypescript_2Ddefinitions.EntityType
|
|
44943
44898
|
local LokiVariant = ____isaac_2Dtypescript_2Ddefinitions.LokiVariant
|
|
44899
|
+
local UltraGreedVariant = ____isaac_2Dtypescript_2Ddefinitions.UltraGreedVariant
|
|
44944
44900
|
local ____cachedClasses = require("src.core.cachedClasses")
|
|
44945
44901
|
local game = ____cachedClasses.game
|
|
44946
44902
|
local ____constants = require("src.core.constants")
|
|
@@ -44965,6 +44921,8 @@ local ____sinEntityTypesSet = require("src.sets.sinEntityTypesSet")
|
|
|
44965
44921
|
local SIN_ENTITY_TYPES_SET = ____sinEntityTypesSet.SIN_ENTITY_TYPES_SET
|
|
44966
44922
|
local ____ReadonlySet = require("src.types.ReadonlySet")
|
|
44967
44923
|
local ReadonlySet = ____ReadonlySet.ReadonlySet
|
|
44924
|
+
local ____entities = require("src.functions.entities")
|
|
44925
|
+
local doesEntityExist = ____entities.doesEntityExist
|
|
44968
44926
|
local ____entitiesSpecific = require("src.functions.entitiesSpecific")
|
|
44969
44927
|
local getNPCs = ____entitiesSpecific.getNPCs
|
|
44970
44928
|
local spawnNPC = ____entitiesSpecific.spawnNPC
|
|
@@ -45026,7 +44984,14 @@ function ____exports.getBossID(self)
|
|
|
45026
44984
|
return BossID.BEAST
|
|
45027
44985
|
end
|
|
45028
44986
|
local room = game:GetRoom()
|
|
45029
|
-
|
|
44987
|
+
local bossID = room:GetBossID()
|
|
44988
|
+
if bossID == 0 then
|
|
44989
|
+
return nil
|
|
44990
|
+
end
|
|
44991
|
+
if bossID == BossID.ULTRA_GREED and doesEntityExist(nil, EntityType.ULTRA_GREED, UltraGreedVariant.ULTRA_GREEDIER) then
|
|
44992
|
+
return BossID.ULTRA_GREEDIER
|
|
44993
|
+
end
|
|
44994
|
+
return bossID
|
|
45030
44995
|
end
|
|
45031
44996
|
function ____exports.getBossIDFromEntityTypeVariant(self, entityType, variant)
|
|
45032
44997
|
local entityTypeVariant = (tostring(entityType) .. ".") .. tostring(variant)
|
|
@@ -45075,21 +45040,21 @@ local function getNumBossSegments(self, entityType, variant, numSegments)
|
|
|
45075
45040
|
return numSegments
|
|
45076
45041
|
end
|
|
45077
45042
|
repeat
|
|
45078
|
-
local
|
|
45079
|
-
local
|
|
45080
|
-
if
|
|
45043
|
+
local ____switch22 = entityType
|
|
45044
|
+
local ____cond22 = ____switch22 == EntityType.CHUB
|
|
45045
|
+
if ____cond22 then
|
|
45081
45046
|
do
|
|
45082
45047
|
return 3
|
|
45083
45048
|
end
|
|
45084
45049
|
end
|
|
45085
|
-
|
|
45086
|
-
if
|
|
45050
|
+
____cond22 = ____cond22 or ____switch22 == EntityType.LOKI
|
|
45051
|
+
if ____cond22 then
|
|
45087
45052
|
do
|
|
45088
45053
|
return variant == asNumber(nil, LokiVariant.LOKII) and 2 or 1
|
|
45089
45054
|
end
|
|
45090
45055
|
end
|
|
45091
|
-
|
|
45092
|
-
if
|
|
45056
|
+
____cond22 = ____cond22 or ____switch22 == EntityType.GURGLING
|
|
45057
|
+
if ____cond22 then
|
|
45093
45058
|
do
|
|
45094
45059
|
return 2
|
|
45095
45060
|
end
|
|
@@ -37,13 +37,13 @@ export declare function getAliveBosses(entityType?: EntityType | -1, variant?: n
|
|
|
37
37
|
*/
|
|
38
38
|
export declare function getAllBossesSet(includeStoryBosses?: boolean): ReadonlySet<BossID>;
|
|
39
39
|
/**
|
|
40
|
-
* Helper function to get the boss ID corresponding to the current room. Returns
|
|
41
|
-
* room is not a Boss Room.
|
|
40
|
+
* Helper function to get the boss ID corresponding to the current room. Returns undefined if the
|
|
41
|
+
* current room is not a Boss Room.
|
|
42
42
|
*
|
|
43
|
-
* Use this instead of the vanilla `Room.GetBossID` method since it
|
|
44
|
-
* Beast.
|
|
43
|
+
* Use this instead of the vanilla `Room.GetBossID` method since it has a saner return type and it
|
|
44
|
+
* correctly handles Dogma, The Beast, and Ultra Greedier.
|
|
45
45
|
*/
|
|
46
|
-
export declare function getBossID(): BossID |
|
|
46
|
+
export declare function getBossID(): BossID | undefined;
|
|
47
47
|
export declare function getBossIDFromEntityTypeVariant(entityType: EntityType, variant: int): BossID | undefined;
|
|
48
48
|
/**
|
|
49
49
|
* Helper function to get the proper English name for a boss. For example, the name for
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bosses.d.ts","sourceRoot":"","sources":["../../../src/functions/bosses.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AAC1E,OAAO,
|
|
1
|
+
{"version":3,"file":"bosses.d.ts","sourceRoot":"","sources":["../../../src/functions/bosses.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AAC1E,OAAO,EACL,MAAM,EACN,UAAU,EAGX,MAAM,8BAA8B,CAAC;AAmCtC;;;;;;;;;;;;;GAaG;AACH,wBAAgB,cAAc,CAC5B,UAAU,GAAE,UAAU,GAAG,CAAC,CAAM,EAChC,OAAO,SAAK,EACZ,OAAO,SAAK,EACZ,cAAc,UAAQ,GACrB,SAAS,EAAE,CAGb;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,eAAe,CAC7B,kBAAkB,UAAO,GACxB,WAAW,CAAC,MAAM,CAAC,CAIrB;AAED;;;;;;GAMG;AACH,wBAAgB,SAAS,IAAI,MAAM,GAAG,SAAS,CAwB9C;AAED,wBAAgB,8BAA8B,CAC5C,UAAU,EAAE,UAAU,EACtB,OAAO,EAAE,GAAG,GACX,MAAM,GAAG,SAAS,CAGpB;AAED;;;GAGG;AACH,wBAAgB,WAAW,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAIlD;AAED;;;;;GAKG;AACH,wBAAgB,UAAU,CACxB,KAAK,EAAE,UAAU,EACjB,SAAS,EAAE,SAAS,GACnB,WAAW,CAAC,MAAM,CAAC,GAAG,SAAS,CAOjC;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,SAAS,CACvB,UAAU,CAAC,EAAE,UAAU,EACvB,OAAO,CAAC,EAAE,GAAG,EACb,OAAO,CAAC,EAAE,GAAG,EACb,cAAc,UAAQ,GACrB,SAAS,EAAE,CAGb;AAED;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAChC,KAAK,EAAE,UAAU,GAChB,WAAW,CAAC,MAAM,CAAC,GAAG,SAAS,CAEjC;AAED,wBAAgB,8BAA8B,CAC5C,MAAM,EAAE,MAAM,GACb,SAAS,CAAC,UAAU,EAAE,GAAG,CAAC,CAE5B;AAED;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAExD;AAED,6FAA6F;AAC7F,wBAAgB,KAAK,CAAC,GAAG,EAAE,SAAS,GAAG,OAAO,CAE7C;AAmCD;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,UAAU,EAAE,UAAU,GAAG,OAAO,CAE3D;AAED;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAErD;AAED;;;;;;;;;GASG;AACH,wBAAgB,SAAS,CACvB,UAAU,EAAE,UAAU,EACtB,OAAO,EAAE,GAAG,EACZ,OAAO,EAAE,GAAG,EACZ,mBAAmB,EAAE,MAAM,GAAG,GAAG,EACjC,QAAQ,GAAE,MAAmB,EAC7B,OAAO,GAAE,MAAM,GAAG,SAAqB,EACvC,SAAS,GAAE,IAAI,GAAG,GAAG,GAAG,SAAqB,EAC7C,WAAW,CAAC,EAAE,GAAG,GAChB,SAAS,CAiCX;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,CAC/B,UAAU,EAAE,UAAU,EACtB,OAAO,EAAE,GAAG,EACZ,OAAO,EAAE,GAAG,EACZ,mBAAmB,EAAE,MAAM,GAAG,GAAG,EACjC,SAAS,EAAE,IAAI,GAAG,GAAG,EACrB,QAAQ,GAAE,MAAmB,EAC7B,OAAO,GAAE,MAAM,GAAG,SAAqB,EACvC,WAAW,CAAC,EAAE,GAAG,GAChB,SAAS,CAYX"}
|
|
@@ -6,6 +6,7 @@ local ____isaac_2Dtypescript_2Ddefinitions = require("isaac-typescript-definitio
|
|
|
6
6
|
local BossID = ____isaac_2Dtypescript_2Ddefinitions.BossID
|
|
7
7
|
local EntityType = ____isaac_2Dtypescript_2Ddefinitions.EntityType
|
|
8
8
|
local LokiVariant = ____isaac_2Dtypescript_2Ddefinitions.LokiVariant
|
|
9
|
+
local UltraGreedVariant = ____isaac_2Dtypescript_2Ddefinitions.UltraGreedVariant
|
|
9
10
|
local ____cachedClasses = require("src.core.cachedClasses")
|
|
10
11
|
local game = ____cachedClasses.game
|
|
11
12
|
local ____constants = require("src.core.constants")
|
|
@@ -30,6 +31,8 @@ local ____sinEntityTypesSet = require("src.sets.sinEntityTypesSet")
|
|
|
30
31
|
local SIN_ENTITY_TYPES_SET = ____sinEntityTypesSet.SIN_ENTITY_TYPES_SET
|
|
31
32
|
local ____ReadonlySet = require("src.types.ReadonlySet")
|
|
32
33
|
local ReadonlySet = ____ReadonlySet.ReadonlySet
|
|
34
|
+
local ____entities = require("src.functions.entities")
|
|
35
|
+
local doesEntityExist = ____entities.doesEntityExist
|
|
33
36
|
local ____entitiesSpecific = require("src.functions.entitiesSpecific")
|
|
34
37
|
local getNPCs = ____entitiesSpecific.getNPCs
|
|
35
38
|
local spawnNPC = ____entitiesSpecific.spawnNPC
|
|
@@ -113,11 +116,11 @@ function ____exports.getAllBossesSet(self, includeStoryBosses)
|
|
|
113
116
|
end
|
|
114
117
|
return includeStoryBosses and ALL_BOSSES_SET or ALL_BOSSES_EXCLUDING_STORY_BOSSES_SET
|
|
115
118
|
end
|
|
116
|
-
--- Helper function to get the boss ID corresponding to the current room. Returns
|
|
117
|
-
-- room is not a Boss Room.
|
|
119
|
+
--- Helper function to get the boss ID corresponding to the current room. Returns undefined if the
|
|
120
|
+
-- current room is not a Boss Room.
|
|
118
121
|
--
|
|
119
|
-
-- Use this instead of the vanilla `Room.GetBossID` method since it
|
|
120
|
-
-- Beast.
|
|
122
|
+
-- Use this instead of the vanilla `Room.GetBossID` method since it has a saner return type and it
|
|
123
|
+
-- correctly handles Dogma, The Beast, and Ultra Greedier.
|
|
121
124
|
function ____exports.getBossID(self)
|
|
122
125
|
if inDogmaRoom(nil) then
|
|
123
126
|
return BossID.DOGMA
|
|
@@ -126,7 +129,14 @@ function ____exports.getBossID(self)
|
|
|
126
129
|
return BossID.BEAST
|
|
127
130
|
end
|
|
128
131
|
local room = game:GetRoom()
|
|
129
|
-
|
|
132
|
+
local bossID = room:GetBossID()
|
|
133
|
+
if bossID == 0 then
|
|
134
|
+
return nil
|
|
135
|
+
end
|
|
136
|
+
if bossID == BossID.ULTRA_GREED and doesEntityExist(nil, EntityType.ULTRA_GREED, UltraGreedVariant.ULTRA_GREEDIER) then
|
|
137
|
+
return BossID.ULTRA_GREEDIER
|
|
138
|
+
end
|
|
139
|
+
return bossID
|
|
130
140
|
end
|
|
131
141
|
function ____exports.getBossIDFromEntityTypeVariant(self, entityType, variant)
|
|
132
142
|
local entityTypeVariant = (tostring(entityType) .. ".") .. tostring(variant)
|
|
@@ -201,21 +211,21 @@ local function getNumBossSegments(self, entityType, variant, numSegments)
|
|
|
201
211
|
return numSegments
|
|
202
212
|
end
|
|
203
213
|
repeat
|
|
204
|
-
local
|
|
205
|
-
local
|
|
206
|
-
if
|
|
214
|
+
local ____switch22 = entityType
|
|
215
|
+
local ____cond22 = ____switch22 == EntityType.CHUB
|
|
216
|
+
if ____cond22 then
|
|
207
217
|
do
|
|
208
218
|
return 3
|
|
209
219
|
end
|
|
210
220
|
end
|
|
211
|
-
|
|
212
|
-
if
|
|
221
|
+
____cond22 = ____cond22 or ____switch22 == EntityType.LOKI
|
|
222
|
+
if ____cond22 then
|
|
213
223
|
do
|
|
214
224
|
return variant == asNumber(nil, LokiVariant.LOKII) and 2 or 1
|
|
215
225
|
end
|
|
216
226
|
end
|
|
217
|
-
|
|
218
|
-
if
|
|
227
|
+
____cond22 = ____cond22 or ____switch22 == EntityType.GURGLING
|
|
228
|
+
if ____cond22 then
|
|
219
229
|
do
|
|
220
230
|
return 2
|
|
221
231
|
end
|
|
@@ -5,94 +5,70 @@ export declare function getElapsedRoomFramesSince(roomFrameCount: int): int;
|
|
|
5
5
|
/**
|
|
6
6
|
* Helper function to check if the current game frame count is higher than a specific game frame
|
|
7
7
|
* count.
|
|
8
|
-
*
|
|
9
|
-
* This returns false if the submitted game frame count is null or undefined.
|
|
10
8
|
*/
|
|
11
|
-
export declare function isAfterGameFrame(gameFrameCount: int
|
|
9
|
+
export declare function isAfterGameFrame(gameFrameCount: int): boolean;
|
|
12
10
|
/**
|
|
13
11
|
* Helper function to check if the current render frame count is higher than a specific render frame
|
|
14
12
|
* count.
|
|
15
|
-
*
|
|
16
|
-
* This returns false if the submitted render frame count is null or undefined.
|
|
17
13
|
*/
|
|
18
|
-
export declare function isAfterRenderFrame(renderFrameCount: int
|
|
14
|
+
export declare function isAfterRenderFrame(renderFrameCount: int): boolean;
|
|
19
15
|
/**
|
|
20
16
|
* Helper function to check if the current room frame count is higher than a specific room frame
|
|
21
17
|
* count.
|
|
22
|
-
*
|
|
23
|
-
* This returns false if the submitted room frame count is null or undefined.
|
|
24
18
|
*/
|
|
25
|
-
export declare function isAfterRoomFrame(roomFrameCount: int
|
|
19
|
+
export declare function isAfterRoomFrame(roomFrameCount: int): boolean;
|
|
26
20
|
/**
|
|
27
21
|
* Helper function to check if the current game frame count is lower than a specific game frame
|
|
28
22
|
* count.
|
|
29
|
-
*
|
|
30
|
-
* This returns false if the submitted game frame count is null or undefined.
|
|
31
23
|
*/
|
|
32
|
-
export declare function isBeforeGameFrame(gameFrameCount: int
|
|
24
|
+
export declare function isBeforeGameFrame(gameFrameCount: int): boolean;
|
|
33
25
|
/**
|
|
34
26
|
* Helper function to check if the current render frame count is lower than a specific render frame
|
|
35
27
|
* count.
|
|
36
|
-
*
|
|
37
|
-
* This returns false if the submitted render frame count is null or undefined.
|
|
38
28
|
*/
|
|
39
|
-
export declare function isBeforeRenderFrame(renderFrameCount: int
|
|
29
|
+
export declare function isBeforeRenderFrame(renderFrameCount: int): boolean;
|
|
40
30
|
/**
|
|
41
31
|
* Helper function to check if the current room frame count is lower than a specific room frame
|
|
42
32
|
* count.
|
|
43
|
-
*
|
|
44
|
-
* This returns false if the submitted room frame count is null or undefined.
|
|
45
33
|
*/
|
|
46
|
-
export declare function isBeforeRoomFrame(roomFrameCount: int
|
|
34
|
+
export declare function isBeforeRoomFrame(roomFrameCount: int): boolean;
|
|
47
35
|
/**
|
|
48
36
|
* Helper function to check if the current game frame count is exactly equal to a specific game
|
|
49
37
|
* frame count.
|
|
50
38
|
*
|
|
51
|
-
* This returns false if the submitted
|
|
39
|
+
* This returns false if the submitted render frame count is null or undefined.
|
|
52
40
|
*/
|
|
53
41
|
export declare function onGameFrame(gameFrameCount: int | null | undefined): boolean;
|
|
54
42
|
/**
|
|
55
43
|
* Helper function to check if the current game frame count is equal to or higher than a specific
|
|
56
44
|
* game frame count.
|
|
57
|
-
*
|
|
58
|
-
* This returns false if the submitted game frame count is null or undefined.
|
|
59
45
|
*/
|
|
60
|
-
export declare function onOrAfterGameFrame(gameFrameCount: int
|
|
46
|
+
export declare function onOrAfterGameFrame(gameFrameCount: int): boolean;
|
|
61
47
|
/**
|
|
62
48
|
* Helper function to check if the current render frame count is equal to or higher than a specific
|
|
63
49
|
* render frame count.
|
|
64
|
-
*
|
|
65
|
-
* This returns false if the submitted render frame count is null or undefined.
|
|
66
50
|
*/
|
|
67
|
-
export declare function onOrAfterRenderFrame(renderFrameCount: int
|
|
51
|
+
export declare function onOrAfterRenderFrame(renderFrameCount: int): boolean;
|
|
68
52
|
/**
|
|
69
53
|
* Helper function to check if the current room frame count is equal to or higher than a specific
|
|
70
54
|
* room frame count.
|
|
71
|
-
*
|
|
72
|
-
* This returns false if the submitted room frame count is null or undefined.
|
|
73
55
|
*/
|
|
74
|
-
export declare function onOrAfterRoomFrame(roomFrameCount: int
|
|
56
|
+
export declare function onOrAfterRoomFrame(roomFrameCount: int): boolean;
|
|
75
57
|
/**
|
|
76
58
|
* Helper function to check if the current game frame count is equal to or lower than a specific
|
|
77
59
|
* game frame count.
|
|
78
|
-
*
|
|
79
|
-
* This returns false if the submitted game frame count is null or undefined.
|
|
80
60
|
*/
|
|
81
|
-
export declare function onOrBeforeGameFrame(gameFrameCount: int
|
|
61
|
+
export declare function onOrBeforeGameFrame(gameFrameCount: int): boolean;
|
|
82
62
|
/**
|
|
83
63
|
* Helper function to check if the current render frame count is equal to or lower than a specific
|
|
84
64
|
* render frame count.
|
|
85
|
-
*
|
|
86
|
-
* This returns false if the submitted render frame count is null or undefined.
|
|
87
65
|
*/
|
|
88
|
-
export declare function onOrBeforeRenderFrame(renderFrameCount: int
|
|
66
|
+
export declare function onOrBeforeRenderFrame(renderFrameCount: int): boolean;
|
|
89
67
|
/**
|
|
90
68
|
* Helper function to check if the current room frame count is equal to or lower than a specific
|
|
91
69
|
* room frame count.
|
|
92
|
-
*
|
|
93
|
-
* This returns false if the submitted room frame count is null or undefined.
|
|
94
70
|
*/
|
|
95
|
-
export declare function onOrBeforeRoomFrame(roomFrameCount: int
|
|
71
|
+
export declare function onOrBeforeRoomFrame(roomFrameCount: int): boolean;
|
|
96
72
|
/**
|
|
97
73
|
* Helper function to check if the current render frame count is exactly equal to a specific render
|
|
98
74
|
* frame count.
|
|
@@ -1 +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
|
|
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;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,cAAc,EAAE,GAAG,GAAG,OAAO,CAG7D;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,gBAAgB,EAAE,GAAG,GAAG,OAAO,CAGjE;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,cAAc,EAAE,GAAG,GAAG,OAAO,CAK7D;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,cAAc,EAAE,GAAG,GAAG,OAAO,CAG9D;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,gBAAgB,EAAE,GAAG,GAAG,OAAO,CAGlE;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,cAAc,EAAE,GAAG,GAAG,OAAO,CAK9D;AAED;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,cAAc,EAAE,GAAG,GAAG,IAAI,GAAG,SAAS,GAAG,OAAO,CAG3E;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,cAAc,EAAE,GAAG,GAAG,OAAO,CAG/D;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,gBAAgB,EAAE,GAAG,GAAG,OAAO,CAGnE;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,cAAc,EAAE,GAAG,GAAG,OAAO,CAK/D;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,cAAc,EAAE,GAAG,GAAG,OAAO,CAGhE;AAED;;;GAGG;AACH,wBAAgB,qBAAqB,CAAC,gBAAgB,EAAE,GAAG,GAAG,OAAO,CAGpE;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,cAAc,EAAE,GAAG,GAAG,OAAO,CAKhE;AAED;;;;;GAKG;AACH,wBAAgB,aAAa,CAC3B,gBAAgB,EAAE,GAAG,GAAG,IAAI,GAAG,SAAS,GACvC,OAAO,CAGT;AAED;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,cAAc,EAAE,GAAG,GAAG,IAAI,GAAG,SAAS,GAAG,OAAO,CAK3E"}
|
|
@@ -16,68 +16,38 @@ function ____exports.getElapsedRoomFramesSince(self, roomFrameCount)
|
|
|
16
16
|
end
|
|
17
17
|
--- Helper function to check if the current game frame count is higher than a specific game frame
|
|
18
18
|
-- count.
|
|
19
|
-
--
|
|
20
|
-
-- This returns false if the submitted game frame count is null or undefined.
|
|
21
19
|
function ____exports.isAfterGameFrame(self, gameFrameCount)
|
|
22
|
-
if gameFrameCount == nil or gameFrameCount == nil then
|
|
23
|
-
return false
|
|
24
|
-
end
|
|
25
20
|
local thisGameFrameCount = game:GetFrameCount()
|
|
26
21
|
return thisGameFrameCount > gameFrameCount
|
|
27
22
|
end
|
|
28
23
|
--- Helper function to check if the current render frame count is higher than a specific render frame
|
|
29
24
|
-- count.
|
|
30
|
-
--
|
|
31
|
-
-- This returns false if the submitted render frame count is null or undefined.
|
|
32
25
|
function ____exports.isAfterRenderFrame(self, renderFrameCount)
|
|
33
|
-
if renderFrameCount == nil or renderFrameCount == nil then
|
|
34
|
-
return false
|
|
35
|
-
end
|
|
36
26
|
local thisRenderFrameCount = Isaac.GetFrameCount()
|
|
37
27
|
return thisRenderFrameCount > renderFrameCount
|
|
38
28
|
end
|
|
39
29
|
--- Helper function to check if the current room frame count is higher than a specific room frame
|
|
40
30
|
-- count.
|
|
41
|
-
--
|
|
42
|
-
-- This returns false if the submitted room frame count is null or undefined.
|
|
43
31
|
function ____exports.isAfterRoomFrame(self, roomFrameCount)
|
|
44
|
-
if roomFrameCount == nil or roomFrameCount == nil then
|
|
45
|
-
return false
|
|
46
|
-
end
|
|
47
32
|
local room = game:GetRoom()
|
|
48
33
|
local thisGameFrameCount = room:GetFrameCount()
|
|
49
34
|
return thisGameFrameCount > roomFrameCount
|
|
50
35
|
end
|
|
51
36
|
--- Helper function to check if the current game frame count is lower than a specific game frame
|
|
52
37
|
-- count.
|
|
53
|
-
--
|
|
54
|
-
-- This returns false if the submitted game frame count is null or undefined.
|
|
55
38
|
function ____exports.isBeforeGameFrame(self, gameFrameCount)
|
|
56
|
-
if gameFrameCount == nil or gameFrameCount == nil then
|
|
57
|
-
return false
|
|
58
|
-
end
|
|
59
39
|
local thisGameFrameCount = game:GetFrameCount()
|
|
60
40
|
return thisGameFrameCount < gameFrameCount
|
|
61
41
|
end
|
|
62
42
|
--- Helper function to check if the current render frame count is lower than a specific render frame
|
|
63
43
|
-- count.
|
|
64
|
-
--
|
|
65
|
-
-- This returns false if the submitted render frame count is null or undefined.
|
|
66
44
|
function ____exports.isBeforeRenderFrame(self, renderFrameCount)
|
|
67
|
-
if renderFrameCount == nil or renderFrameCount == nil then
|
|
68
|
-
return false
|
|
69
|
-
end
|
|
70
45
|
local thisRenderFrameCount = Isaac.GetFrameCount()
|
|
71
46
|
return thisRenderFrameCount < renderFrameCount
|
|
72
47
|
end
|
|
73
48
|
--- Helper function to check if the current room frame count is lower than a specific room frame
|
|
74
49
|
-- count.
|
|
75
|
-
--
|
|
76
|
-
-- This returns false if the submitted room frame count is null or undefined.
|
|
77
50
|
function ____exports.isBeforeRoomFrame(self, roomFrameCount)
|
|
78
|
-
if roomFrameCount == nil or roomFrameCount == nil then
|
|
79
|
-
return false
|
|
80
|
-
end
|
|
81
51
|
local room = game:GetRoom()
|
|
82
52
|
local thisGameFrameCount = room:GetFrameCount()
|
|
83
53
|
return thisGameFrameCount < roomFrameCount
|
|
@@ -85,78 +55,45 @@ end
|
|
|
85
55
|
--- Helper function to check if the current game frame count is exactly equal to a specific game
|
|
86
56
|
-- frame count.
|
|
87
57
|
--
|
|
88
|
-
-- This returns false if the submitted
|
|
58
|
+
-- This returns false if the submitted render frame count is null or undefined.
|
|
89
59
|
function ____exports.onGameFrame(self, gameFrameCount)
|
|
90
|
-
if gameFrameCount == nil or gameFrameCount == nil then
|
|
91
|
-
return false
|
|
92
|
-
end
|
|
93
60
|
local thisGameFrameCount = game:GetFrameCount()
|
|
94
61
|
return thisGameFrameCount == gameFrameCount
|
|
95
62
|
end
|
|
96
63
|
--- Helper function to check if the current game frame count is equal to or higher than a specific
|
|
97
64
|
-- game frame count.
|
|
98
|
-
--
|
|
99
|
-
-- This returns false if the submitted game frame count is null or undefined.
|
|
100
65
|
function ____exports.onOrAfterGameFrame(self, gameFrameCount)
|
|
101
|
-
if gameFrameCount == nil or gameFrameCount == nil then
|
|
102
|
-
return false
|
|
103
|
-
end
|
|
104
66
|
local thisGameFrameCount = game:GetFrameCount()
|
|
105
67
|
return thisGameFrameCount >= gameFrameCount
|
|
106
68
|
end
|
|
107
69
|
--- Helper function to check if the current render frame count is equal to or higher than a specific
|
|
108
70
|
-- render frame count.
|
|
109
|
-
--
|
|
110
|
-
-- This returns false if the submitted render frame count is null or undefined.
|
|
111
71
|
function ____exports.onOrAfterRenderFrame(self, renderFrameCount)
|
|
112
|
-
if renderFrameCount == nil or renderFrameCount == nil then
|
|
113
|
-
return false
|
|
114
|
-
end
|
|
115
72
|
local thisRenderFrameCount = Isaac.GetFrameCount()
|
|
116
73
|
return thisRenderFrameCount >= renderFrameCount
|
|
117
74
|
end
|
|
118
75
|
--- Helper function to check if the current room frame count is equal to or higher than a specific
|
|
119
76
|
-- room frame count.
|
|
120
|
-
--
|
|
121
|
-
-- This returns false if the submitted room frame count is null or undefined.
|
|
122
77
|
function ____exports.onOrAfterRoomFrame(self, roomFrameCount)
|
|
123
|
-
if roomFrameCount == nil or roomFrameCount == nil then
|
|
124
|
-
return false
|
|
125
|
-
end
|
|
126
78
|
local room = game:GetRoom()
|
|
127
79
|
local thisGameFrameCount = room:GetFrameCount()
|
|
128
80
|
return thisGameFrameCount >= roomFrameCount
|
|
129
81
|
end
|
|
130
82
|
--- Helper function to check if the current game frame count is equal to or lower than a specific
|
|
131
83
|
-- game frame count.
|
|
132
|
-
--
|
|
133
|
-
-- This returns false if the submitted game frame count is null or undefined.
|
|
134
84
|
function ____exports.onOrBeforeGameFrame(self, gameFrameCount)
|
|
135
|
-
if gameFrameCount == nil or gameFrameCount == nil then
|
|
136
|
-
return false
|
|
137
|
-
end
|
|
138
85
|
local thisGameFrameCount = game:GetFrameCount()
|
|
139
86
|
return thisGameFrameCount <= gameFrameCount
|
|
140
87
|
end
|
|
141
88
|
--- Helper function to check if the current render frame count is equal to or lower than a specific
|
|
142
89
|
-- render frame count.
|
|
143
|
-
--
|
|
144
|
-
-- This returns false if the submitted render frame count is null or undefined.
|
|
145
90
|
function ____exports.onOrBeforeRenderFrame(self, renderFrameCount)
|
|
146
|
-
if renderFrameCount == nil or renderFrameCount == nil then
|
|
147
|
-
return false
|
|
148
|
-
end
|
|
149
91
|
local thisRenderFrameCount = Isaac.GetFrameCount()
|
|
150
92
|
return thisRenderFrameCount <= renderFrameCount
|
|
151
93
|
end
|
|
152
94
|
--- Helper function to check if the current room frame count is equal to or lower than a specific
|
|
153
95
|
-- room frame count.
|
|
154
|
-
--
|
|
155
|
-
-- This returns false if the submitted room frame count is null or undefined.
|
|
156
96
|
function ____exports.onOrBeforeRoomFrame(self, roomFrameCount)
|
|
157
|
-
if roomFrameCount == nil or roomFrameCount == nil then
|
|
158
|
-
return false
|
|
159
|
-
end
|
|
160
97
|
local room = game:GetRoom()
|
|
161
98
|
local thisGameFrameCount = room:GetFrameCount()
|
|
162
99
|
return thisGameFrameCount <= roomFrameCount
|
|
@@ -166,9 +103,6 @@ end
|
|
|
166
103
|
--
|
|
167
104
|
-- This returns false if the submitted render frame count is null or undefined.
|
|
168
105
|
function ____exports.onRenderFrame(self, renderFrameCount)
|
|
169
|
-
if renderFrameCount == nil or renderFrameCount == nil then
|
|
170
|
-
return false
|
|
171
|
-
end
|
|
172
106
|
local thisRenderFrameCount = Isaac.GetFrameCount()
|
|
173
107
|
return thisRenderFrameCount == renderFrameCount
|
|
174
108
|
end
|
|
@@ -177,9 +111,6 @@ end
|
|
|
177
111
|
--
|
|
178
112
|
-- This returns false if the submitted room frame count is null or undefined.
|
|
179
113
|
function ____exports.onRoomFrame(self, roomFrameCount)
|
|
180
|
-
if roomFrameCount == nil or roomFrameCount == nil then
|
|
181
|
-
return false
|
|
182
|
-
end
|
|
183
114
|
local room = game:GetRoom()
|
|
184
115
|
local thisGameFrameCount = room:GetFrameCount()
|
|
185
116
|
return thisGameFrameCount == roomFrameCount
|
package/package.json
CHANGED
package/src/functions/bosses.ts
CHANGED
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
import type { LevelStage, StageType } from "isaac-typescript-definitions";
|
|
2
|
-
import {
|
|
2
|
+
import {
|
|
3
|
+
BossID,
|
|
4
|
+
EntityType,
|
|
5
|
+
LokiVariant,
|
|
6
|
+
UltraGreedVariant,
|
|
7
|
+
} from "isaac-typescript-definitions";
|
|
3
8
|
import { game } from "../core/cachedClasses";
|
|
4
9
|
import { VectorZero } from "../core/constants";
|
|
5
10
|
import { ENTITY_TYPE_VARIANT_TO_BOSS_ID_MAP } from "../maps/entityTypeVariantToBossIDMap";
|
|
@@ -16,6 +21,7 @@ import {
|
|
|
16
21
|
import { REPENTANCE_ONLY_BOSS_IDS_SET } from "../sets/repentanceBossIDsSet";
|
|
17
22
|
import { SIN_ENTITY_TYPES_SET } from "../sets/sinEntityTypesSet";
|
|
18
23
|
import { ReadonlySet } from "../types/ReadonlySet";
|
|
24
|
+
import { doesEntityExist } from "./entities";
|
|
19
25
|
import { getNPCs, spawnNPC } from "./entitiesSpecific";
|
|
20
26
|
import { getAliveNPCs } from "./npcs";
|
|
21
27
|
import { isRNG } from "./rng";
|
|
@@ -86,13 +92,13 @@ export function getAllBossesSet(
|
|
|
86
92
|
}
|
|
87
93
|
|
|
88
94
|
/**
|
|
89
|
-
* Helper function to get the boss ID corresponding to the current room. Returns
|
|
90
|
-
* room is not a Boss Room.
|
|
95
|
+
* Helper function to get the boss ID corresponding to the current room. Returns undefined if the
|
|
96
|
+
* current room is not a Boss Room.
|
|
91
97
|
*
|
|
92
|
-
* Use this instead of the vanilla `Room.GetBossID` method since it
|
|
93
|
-
* Beast.
|
|
98
|
+
* Use this instead of the vanilla `Room.GetBossID` method since it has a saner return type and it
|
|
99
|
+
* correctly handles Dogma, The Beast, and Ultra Greedier.
|
|
94
100
|
*/
|
|
95
|
-
export function getBossID(): BossID |
|
|
101
|
+
export function getBossID(): BossID | undefined {
|
|
96
102
|
if (inDogmaRoom()) {
|
|
97
103
|
return BossID.DOGMA;
|
|
98
104
|
}
|
|
@@ -102,7 +108,20 @@ export function getBossID(): BossID | 0 {
|
|
|
102
108
|
}
|
|
103
109
|
|
|
104
110
|
const room = game.GetRoom();
|
|
105
|
-
|
|
111
|
+
const bossID = room.GetBossID();
|
|
112
|
+
if (bossID === 0) {
|
|
113
|
+
return undefined;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
// The Ultra Greed room holds both Ultra Greed and Ultra Greedier.
|
|
117
|
+
if (
|
|
118
|
+
bossID === BossID.ULTRA_GREED &&
|
|
119
|
+
doesEntityExist(EntityType.ULTRA_GREED, UltraGreedVariant.ULTRA_GREEDIER)
|
|
120
|
+
) {
|
|
121
|
+
return BossID.ULTRA_GREEDIER;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
return bossID;
|
|
106
125
|
}
|
|
107
126
|
|
|
108
127
|
export function getBossIDFromEntityTypeVariant(
|
package/src/functions/frames.ts
CHANGED
|
@@ -19,16 +19,8 @@ export function getElapsedRoomFramesSince(roomFrameCount: int): int {
|
|
|
19
19
|
/**
|
|
20
20
|
* Helper function to check if the current game frame count is higher than a specific game frame
|
|
21
21
|
* count.
|
|
22
|
-
*
|
|
23
|
-
* This returns false if the submitted game frame count is null or undefined.
|
|
24
22
|
*/
|
|
25
|
-
export function isAfterGameFrame(
|
|
26
|
-
gameFrameCount: int | null | undefined,
|
|
27
|
-
): boolean {
|
|
28
|
-
if (gameFrameCount === null || gameFrameCount === undefined) {
|
|
29
|
-
return false;
|
|
30
|
-
}
|
|
31
|
-
|
|
23
|
+
export function isAfterGameFrame(gameFrameCount: int): boolean {
|
|
32
24
|
const thisGameFrameCount = game.GetFrameCount();
|
|
33
25
|
return thisGameFrameCount > gameFrameCount;
|
|
34
26
|
}
|
|
@@ -36,16 +28,8 @@ export function isAfterGameFrame(
|
|
|
36
28
|
/**
|
|
37
29
|
* Helper function to check if the current render frame count is higher than a specific render frame
|
|
38
30
|
* count.
|
|
39
|
-
*
|
|
40
|
-
* This returns false if the submitted render frame count is null or undefined.
|
|
41
31
|
*/
|
|
42
|
-
export function isAfterRenderFrame(
|
|
43
|
-
renderFrameCount: int | null | undefined,
|
|
44
|
-
): boolean {
|
|
45
|
-
if (renderFrameCount === null || renderFrameCount === undefined) {
|
|
46
|
-
return false;
|
|
47
|
-
}
|
|
48
|
-
|
|
32
|
+
export function isAfterRenderFrame(renderFrameCount: int): boolean {
|
|
49
33
|
const thisRenderFrameCount = Isaac.GetFrameCount();
|
|
50
34
|
return thisRenderFrameCount > renderFrameCount;
|
|
51
35
|
}
|
|
@@ -53,16 +37,8 @@ export function isAfterRenderFrame(
|
|
|
53
37
|
/**
|
|
54
38
|
* Helper function to check if the current room frame count is higher than a specific room frame
|
|
55
39
|
* count.
|
|
56
|
-
*
|
|
57
|
-
* This returns false if the submitted room frame count is null or undefined.
|
|
58
40
|
*/
|
|
59
|
-
export function isAfterRoomFrame(
|
|
60
|
-
roomFrameCount: int | null | undefined,
|
|
61
|
-
): boolean {
|
|
62
|
-
if (roomFrameCount === null || roomFrameCount === undefined) {
|
|
63
|
-
return false;
|
|
64
|
-
}
|
|
65
|
-
|
|
41
|
+
export function isAfterRoomFrame(roomFrameCount: int): boolean {
|
|
66
42
|
const room = game.GetRoom();
|
|
67
43
|
|
|
68
44
|
const thisGameFrameCount = room.GetFrameCount();
|
|
@@ -72,16 +48,8 @@ export function isAfterRoomFrame(
|
|
|
72
48
|
/**
|
|
73
49
|
* Helper function to check if the current game frame count is lower than a specific game frame
|
|
74
50
|
* count.
|
|
75
|
-
*
|
|
76
|
-
* This returns false if the submitted game frame count is null or undefined.
|
|
77
51
|
*/
|
|
78
|
-
export function isBeforeGameFrame(
|
|
79
|
-
gameFrameCount: int | null | undefined,
|
|
80
|
-
): boolean {
|
|
81
|
-
if (gameFrameCount === null || gameFrameCount === undefined) {
|
|
82
|
-
return false;
|
|
83
|
-
}
|
|
84
|
-
|
|
52
|
+
export function isBeforeGameFrame(gameFrameCount: int): boolean {
|
|
85
53
|
const thisGameFrameCount = game.GetFrameCount();
|
|
86
54
|
return thisGameFrameCount < gameFrameCount;
|
|
87
55
|
}
|
|
@@ -89,16 +57,8 @@ export function isBeforeGameFrame(
|
|
|
89
57
|
/**
|
|
90
58
|
* Helper function to check if the current render frame count is lower than a specific render frame
|
|
91
59
|
* count.
|
|
92
|
-
*
|
|
93
|
-
* This returns false if the submitted render frame count is null or undefined.
|
|
94
60
|
*/
|
|
95
|
-
export function isBeforeRenderFrame(
|
|
96
|
-
renderFrameCount: int | null | undefined,
|
|
97
|
-
): boolean {
|
|
98
|
-
if (renderFrameCount === null || renderFrameCount === undefined) {
|
|
99
|
-
return false;
|
|
100
|
-
}
|
|
101
|
-
|
|
61
|
+
export function isBeforeRenderFrame(renderFrameCount: int): boolean {
|
|
102
62
|
const thisRenderFrameCount = Isaac.GetFrameCount();
|
|
103
63
|
return thisRenderFrameCount < renderFrameCount;
|
|
104
64
|
}
|
|
@@ -106,16 +66,8 @@ export function isBeforeRenderFrame(
|
|
|
106
66
|
/**
|
|
107
67
|
* Helper function to check if the current room frame count is lower than a specific room frame
|
|
108
68
|
* count.
|
|
109
|
-
*
|
|
110
|
-
* This returns false if the submitted room frame count is null or undefined.
|
|
111
69
|
*/
|
|
112
|
-
export function isBeforeRoomFrame(
|
|
113
|
-
roomFrameCount: int | null | undefined,
|
|
114
|
-
): boolean {
|
|
115
|
-
if (roomFrameCount === null || roomFrameCount === undefined) {
|
|
116
|
-
return false;
|
|
117
|
-
}
|
|
118
|
-
|
|
70
|
+
export function isBeforeRoomFrame(roomFrameCount: int): boolean {
|
|
119
71
|
const room = game.GetRoom();
|
|
120
72
|
|
|
121
73
|
const thisGameFrameCount = room.GetFrameCount();
|
|
@@ -126,13 +78,9 @@ export function isBeforeRoomFrame(
|
|
|
126
78
|
* Helper function to check if the current game frame count is exactly equal to a specific game
|
|
127
79
|
* frame count.
|
|
128
80
|
*
|
|
129
|
-
* This returns false if the submitted
|
|
81
|
+
* This returns false if the submitted render frame count is null or undefined.
|
|
130
82
|
*/
|
|
131
83
|
export function onGameFrame(gameFrameCount: int | null | undefined): boolean {
|
|
132
|
-
if (gameFrameCount === null || gameFrameCount === undefined) {
|
|
133
|
-
return false;
|
|
134
|
-
}
|
|
135
|
-
|
|
136
84
|
const thisGameFrameCount = game.GetFrameCount();
|
|
137
85
|
return thisGameFrameCount === gameFrameCount;
|
|
138
86
|
}
|
|
@@ -140,16 +88,8 @@ export function onGameFrame(gameFrameCount: int | null | undefined): boolean {
|
|
|
140
88
|
/**
|
|
141
89
|
* Helper function to check if the current game frame count is equal to or higher than a specific
|
|
142
90
|
* game frame count.
|
|
143
|
-
*
|
|
144
|
-
* This returns false if the submitted game frame count is null or undefined.
|
|
145
91
|
*/
|
|
146
|
-
export function onOrAfterGameFrame(
|
|
147
|
-
gameFrameCount: int | null | undefined,
|
|
148
|
-
): boolean {
|
|
149
|
-
if (gameFrameCount === null || gameFrameCount === undefined) {
|
|
150
|
-
return false;
|
|
151
|
-
}
|
|
152
|
-
|
|
92
|
+
export function onOrAfterGameFrame(gameFrameCount: int): boolean {
|
|
153
93
|
const thisGameFrameCount = game.GetFrameCount();
|
|
154
94
|
return thisGameFrameCount >= gameFrameCount;
|
|
155
95
|
}
|
|
@@ -157,16 +97,8 @@ export function onOrAfterGameFrame(
|
|
|
157
97
|
/**
|
|
158
98
|
* Helper function to check if the current render frame count is equal to or higher than a specific
|
|
159
99
|
* render frame count.
|
|
160
|
-
*
|
|
161
|
-
* This returns false if the submitted render frame count is null or undefined.
|
|
162
100
|
*/
|
|
163
|
-
export function onOrAfterRenderFrame(
|
|
164
|
-
renderFrameCount: int | null | undefined,
|
|
165
|
-
): boolean {
|
|
166
|
-
if (renderFrameCount === null || renderFrameCount === undefined) {
|
|
167
|
-
return false;
|
|
168
|
-
}
|
|
169
|
-
|
|
101
|
+
export function onOrAfterRenderFrame(renderFrameCount: int): boolean {
|
|
170
102
|
const thisRenderFrameCount = Isaac.GetFrameCount();
|
|
171
103
|
return thisRenderFrameCount >= renderFrameCount;
|
|
172
104
|
}
|
|
@@ -174,16 +106,8 @@ export function onOrAfterRenderFrame(
|
|
|
174
106
|
/**
|
|
175
107
|
* Helper function to check if the current room frame count is equal to or higher than a specific
|
|
176
108
|
* room frame count.
|
|
177
|
-
*
|
|
178
|
-
* This returns false if the submitted room frame count is null or undefined.
|
|
179
109
|
*/
|
|
180
|
-
export function onOrAfterRoomFrame(
|
|
181
|
-
roomFrameCount: int | null | undefined,
|
|
182
|
-
): boolean {
|
|
183
|
-
if (roomFrameCount === null || roomFrameCount === undefined) {
|
|
184
|
-
return false;
|
|
185
|
-
}
|
|
186
|
-
|
|
110
|
+
export function onOrAfterRoomFrame(roomFrameCount: int): boolean {
|
|
187
111
|
const room = game.GetRoom();
|
|
188
112
|
|
|
189
113
|
const thisGameFrameCount = room.GetFrameCount();
|
|
@@ -193,16 +117,8 @@ export function onOrAfterRoomFrame(
|
|
|
193
117
|
/**
|
|
194
118
|
* Helper function to check if the current game frame count is equal to or lower than a specific
|
|
195
119
|
* game frame count.
|
|
196
|
-
*
|
|
197
|
-
* This returns false if the submitted game frame count is null or undefined.
|
|
198
120
|
*/
|
|
199
|
-
export function onOrBeforeGameFrame(
|
|
200
|
-
gameFrameCount: int | null | undefined,
|
|
201
|
-
): boolean {
|
|
202
|
-
if (gameFrameCount === null || gameFrameCount === undefined) {
|
|
203
|
-
return false;
|
|
204
|
-
}
|
|
205
|
-
|
|
121
|
+
export function onOrBeforeGameFrame(gameFrameCount: int): boolean {
|
|
206
122
|
const thisGameFrameCount = game.GetFrameCount();
|
|
207
123
|
return thisGameFrameCount <= gameFrameCount;
|
|
208
124
|
}
|
|
@@ -210,16 +126,8 @@ export function onOrBeforeGameFrame(
|
|
|
210
126
|
/**
|
|
211
127
|
* Helper function to check if the current render frame count is equal to or lower than a specific
|
|
212
128
|
* render frame count.
|
|
213
|
-
*
|
|
214
|
-
* This returns false if the submitted render frame count is null or undefined.
|
|
215
129
|
*/
|
|
216
|
-
export function onOrBeforeRenderFrame(
|
|
217
|
-
renderFrameCount: int | null | undefined,
|
|
218
|
-
): boolean {
|
|
219
|
-
if (renderFrameCount === null || renderFrameCount === undefined) {
|
|
220
|
-
return false;
|
|
221
|
-
}
|
|
222
|
-
|
|
130
|
+
export function onOrBeforeRenderFrame(renderFrameCount: int): boolean {
|
|
223
131
|
const thisRenderFrameCount = Isaac.GetFrameCount();
|
|
224
132
|
return thisRenderFrameCount <= renderFrameCount;
|
|
225
133
|
}
|
|
@@ -227,16 +135,8 @@ export function onOrBeforeRenderFrame(
|
|
|
227
135
|
/**
|
|
228
136
|
* Helper function to check if the current room frame count is equal to or lower than a specific
|
|
229
137
|
* room frame count.
|
|
230
|
-
*
|
|
231
|
-
* This returns false if the submitted room frame count is null or undefined.
|
|
232
138
|
*/
|
|
233
|
-
export function onOrBeforeRoomFrame(
|
|
234
|
-
roomFrameCount: int | null | undefined,
|
|
235
|
-
): boolean {
|
|
236
|
-
if (roomFrameCount === null || roomFrameCount === undefined) {
|
|
237
|
-
return false;
|
|
238
|
-
}
|
|
239
|
-
|
|
139
|
+
export function onOrBeforeRoomFrame(roomFrameCount: int): boolean {
|
|
240
140
|
const room = game.GetRoom();
|
|
241
141
|
|
|
242
142
|
const thisGameFrameCount = room.GetFrameCount();
|
|
@@ -252,10 +152,6 @@ export function onOrBeforeRoomFrame(
|
|
|
252
152
|
export function onRenderFrame(
|
|
253
153
|
renderFrameCount: int | null | undefined,
|
|
254
154
|
): boolean {
|
|
255
|
-
if (renderFrameCount === null || renderFrameCount === undefined) {
|
|
256
|
-
return false;
|
|
257
|
-
}
|
|
258
|
-
|
|
259
155
|
const thisRenderFrameCount = Isaac.GetFrameCount();
|
|
260
156
|
return thisRenderFrameCount === renderFrameCount;
|
|
261
157
|
}
|
|
@@ -267,10 +163,6 @@ export function onRenderFrame(
|
|
|
267
163
|
* This returns false if the submitted room frame count is null or undefined.
|
|
268
164
|
*/
|
|
269
165
|
export function onRoomFrame(roomFrameCount: int | null | undefined): boolean {
|
|
270
|
-
if (roomFrameCount === null || roomFrameCount === undefined) {
|
|
271
|
-
return false;
|
|
272
|
-
}
|
|
273
|
-
|
|
274
166
|
const room = game.GetRoom();
|
|
275
167
|
|
|
276
168
|
const thisGameFrameCount = room.GetFrameCount();
|