isaacscript-common 68.0.0 → 69.1.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 +5 -5
- package/dist/isaacscript-common.lua +22 -20
- 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.map +1 -1
- package/dist/src/functions/frames.lua +0 -9
- package/dist/src/functions/logMisc.d.ts.map +1 -1
- package/dist/src/functions/logMisc.lua +3 -2
- package/package.json +2 -2
- package/src/functions/bosses.ts +28 -7
- package/src/functions/frames.ts +0 -12
- package/src/functions/logMisc.ts +2 -2
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
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
--[[
|
|
2
2
|
|
|
3
|
-
isaacscript-common
|
|
3
|
+
isaacscript-common 69.1.0
|
|
4
4
|
|
|
5
5
|
This is the "isaacscript-common" library, which was created with the IsaacScript tool.
|
|
6
6
|
|
|
@@ -19140,9 +19140,6 @@ function ____exports.isBeforeRoomFrame(self, roomFrameCount)
|
|
|
19140
19140
|
return thisGameFrameCount < roomFrameCount
|
|
19141
19141
|
end
|
|
19142
19142
|
function ____exports.onGameFrame(self, gameFrameCount)
|
|
19143
|
-
if gameFrameCount == nil or gameFrameCount == nil then
|
|
19144
|
-
return false
|
|
19145
|
-
end
|
|
19146
19143
|
local thisGameFrameCount = game:GetFrameCount()
|
|
19147
19144
|
return thisGameFrameCount == gameFrameCount
|
|
19148
19145
|
end
|
|
@@ -19173,16 +19170,10 @@ function ____exports.onOrBeforeRoomFrame(self, roomFrameCount)
|
|
|
19173
19170
|
return thisGameFrameCount <= roomFrameCount
|
|
19174
19171
|
end
|
|
19175
19172
|
function ____exports.onRenderFrame(self, renderFrameCount)
|
|
19176
|
-
if renderFrameCount == nil or renderFrameCount == nil then
|
|
19177
|
-
return false
|
|
19178
|
-
end
|
|
19179
19173
|
local thisRenderFrameCount = Isaac.GetFrameCount()
|
|
19180
19174
|
return thisRenderFrameCount == renderFrameCount
|
|
19181
19175
|
end
|
|
19182
19176
|
function ____exports.onRoomFrame(self, roomFrameCount)
|
|
19183
|
-
if roomFrameCount == nil or roomFrameCount == nil then
|
|
19184
|
-
return false
|
|
19185
|
-
end
|
|
19186
19177
|
local room = game:GetRoom()
|
|
19187
19178
|
local thisGameFrameCount = room:GetFrameCount()
|
|
19188
19179
|
return thisGameFrameCount == roomFrameCount
|
|
@@ -44905,6 +44896,7 @@ local ____isaac_2Dtypescript_2Ddefinitions = require("lua_modules.isaac-typescri
|
|
|
44905
44896
|
local BossID = ____isaac_2Dtypescript_2Ddefinitions.BossID
|
|
44906
44897
|
local EntityType = ____isaac_2Dtypescript_2Ddefinitions.EntityType
|
|
44907
44898
|
local LokiVariant = ____isaac_2Dtypescript_2Ddefinitions.LokiVariant
|
|
44899
|
+
local UltraGreedVariant = ____isaac_2Dtypescript_2Ddefinitions.UltraGreedVariant
|
|
44908
44900
|
local ____cachedClasses = require("src.core.cachedClasses")
|
|
44909
44901
|
local game = ____cachedClasses.game
|
|
44910
44902
|
local ____constants = require("src.core.constants")
|
|
@@ -44929,6 +44921,8 @@ local ____sinEntityTypesSet = require("src.sets.sinEntityTypesSet")
|
|
|
44929
44921
|
local SIN_ENTITY_TYPES_SET = ____sinEntityTypesSet.SIN_ENTITY_TYPES_SET
|
|
44930
44922
|
local ____ReadonlySet = require("src.types.ReadonlySet")
|
|
44931
44923
|
local ReadonlySet = ____ReadonlySet.ReadonlySet
|
|
44924
|
+
local ____entities = require("src.functions.entities")
|
|
44925
|
+
local doesEntityExist = ____entities.doesEntityExist
|
|
44932
44926
|
local ____entitiesSpecific = require("src.functions.entitiesSpecific")
|
|
44933
44927
|
local getNPCs = ____entitiesSpecific.getNPCs
|
|
44934
44928
|
local spawnNPC = ____entitiesSpecific.spawnNPC
|
|
@@ -44990,7 +44984,14 @@ function ____exports.getBossID(self)
|
|
|
44990
44984
|
return BossID.BEAST
|
|
44991
44985
|
end
|
|
44992
44986
|
local room = game:GetRoom()
|
|
44993
|
-
|
|
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
|
|
44994
44995
|
end
|
|
44995
44996
|
function ____exports.getBossIDFromEntityTypeVariant(self, entityType, variant)
|
|
44996
44997
|
local entityTypeVariant = (tostring(entityType) .. ".") .. tostring(variant)
|
|
@@ -45039,21 +45040,21 @@ local function getNumBossSegments(self, entityType, variant, numSegments)
|
|
|
45039
45040
|
return numSegments
|
|
45040
45041
|
end
|
|
45041
45042
|
repeat
|
|
45042
|
-
local
|
|
45043
|
-
local
|
|
45044
|
-
if
|
|
45043
|
+
local ____switch22 = entityType
|
|
45044
|
+
local ____cond22 = ____switch22 == EntityType.CHUB
|
|
45045
|
+
if ____cond22 then
|
|
45045
45046
|
do
|
|
45046
45047
|
return 3
|
|
45047
45048
|
end
|
|
45048
45049
|
end
|
|
45049
|
-
|
|
45050
|
-
if
|
|
45050
|
+
____cond22 = ____cond22 or ____switch22 == EntityType.LOKI
|
|
45051
|
+
if ____cond22 then
|
|
45051
45052
|
do
|
|
45052
45053
|
return variant == asNumber(nil, LokiVariant.LOKII) and 2 or 1
|
|
45053
45054
|
end
|
|
45054
45055
|
end
|
|
45055
|
-
|
|
45056
|
-
if
|
|
45056
|
+
____cond22 = ____cond22 or ____switch22 == EntityType.GURGLING
|
|
45057
|
+
if ____cond22 then
|
|
45057
45058
|
do
|
|
45058
45059
|
return 2
|
|
45059
45060
|
end
|
|
@@ -49258,6 +49259,8 @@ local ReadonlySet = ____ReadonlySet.ReadonlySet
|
|
|
49258
49259
|
local ____array = require("src.functions.array")
|
|
49259
49260
|
local arrayToString = ____array.arrayToString
|
|
49260
49261
|
local isArray = ____array.isArray
|
|
49262
|
+
local ____bosses = require("src.functions.bosses")
|
|
49263
|
+
local getBossID = ____bosses.getBossID
|
|
49261
49264
|
local ____collectibles = require("src.functions.collectibles")
|
|
49262
49265
|
local getCollectibleName = ____collectibles.getCollectibleName
|
|
49263
49266
|
local ____entities = require("src.functions.entities")
|
|
@@ -49467,8 +49470,7 @@ function ____exports.logProjectileFlags(projectileFlags)
|
|
|
49467
49470
|
____exports.logFlags(projectileFlags, ProjectileFlag, "projectile")
|
|
49468
49471
|
end
|
|
49469
49472
|
function ____exports.logRoom()
|
|
49470
|
-
local
|
|
49471
|
-
local bossID = room:GetBossID()
|
|
49473
|
+
local bossID = getBossID(nil)
|
|
49472
49474
|
local roomGridIndex = getRoomGridIndex(nil)
|
|
49473
49475
|
local roomListIndex = getRoomListIndex(nil)
|
|
49474
49476
|
local roomData = getRoomData(nil)
|
|
@@ -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,GA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,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
|
|
@@ -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;;;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,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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"}
|
|
@@ -57,9 +57,6 @@ end
|
|
|
57
57
|
--
|
|
58
58
|
-- This returns false if the submitted render frame count is null or undefined.
|
|
59
59
|
function ____exports.onGameFrame(self, gameFrameCount)
|
|
60
|
-
if gameFrameCount == nil or gameFrameCount == nil then
|
|
61
|
-
return false
|
|
62
|
-
end
|
|
63
60
|
local thisGameFrameCount = game:GetFrameCount()
|
|
64
61
|
return thisGameFrameCount == gameFrameCount
|
|
65
62
|
end
|
|
@@ -106,9 +103,6 @@ end
|
|
|
106
103
|
--
|
|
107
104
|
-- This returns false if the submitted render frame count is null or undefined.
|
|
108
105
|
function ____exports.onRenderFrame(self, renderFrameCount)
|
|
109
|
-
if renderFrameCount == nil or renderFrameCount == nil then
|
|
110
|
-
return false
|
|
111
|
-
end
|
|
112
106
|
local thisRenderFrameCount = Isaac.GetFrameCount()
|
|
113
107
|
return thisRenderFrameCount == renderFrameCount
|
|
114
108
|
end
|
|
@@ -117,9 +111,6 @@ end
|
|
|
117
111
|
--
|
|
118
112
|
-- This returns false if the submitted room frame count is null or undefined.
|
|
119
113
|
function ____exports.onRoomFrame(self, roomFrameCount)
|
|
120
|
-
if roomFrameCount == nil or roomFrameCount == nil then
|
|
121
|
-
return false
|
|
122
|
-
end
|
|
123
114
|
local room = game:GetRoom()
|
|
124
115
|
local thisGameFrameCount = room:GetFrameCount()
|
|
125
116
|
return thisGameFrameCount == roomFrameCount
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logMisc.d.ts","sourceRoot":"","sources":["../../../src/functions/logMisc.ts"],"names":[],"mappings":";AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AACpE,OAAO,EACL,UAAU,EACV,WAAW,EACX,UAAU,EAMV,cAAc,EAGd,QAAQ,EACR,OAAO,EACR,MAAM,8BAA8B,CAAC;
|
|
1
|
+
{"version":3,"file":"logMisc.d.ts","sourceRoot":"","sources":["../../../src/functions/logMisc.ts"],"names":[],"mappings":";AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AACpE,OAAO,EACL,UAAU,EACV,WAAW,EACX,UAAU,EAMV,cAAc,EAGd,QAAQ,EACR,OAAO,EACR,MAAM,8BAA8B,CAAC;AAqBtC;;;;;GAKG;AACH,wBAAgB,QAAQ,CAAC,CAAC,EACxB,IAAI,EAAE,IAAI,EACV,KAAK,EAAE,CAAC,EAAE,GAAG,SAAS,CAAC,EAAE,EACzB,IAAI,CAAC,EAAE,MAAM,GACZ,IAAI,CAaN;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,CACjC,IAAI,EAAE,IAAI,EACV,gBAAgB,EAAE,eAAe,EAAE,EACnC,IAAI,CAAC,EAAE,MAAM,GACZ,IAAI,CAaN;AAED;;;;;GAKG;AACH,wBAAgB,QAAQ,CAAC,IAAI,EAAE,IAAI,EAAE,KAAK,EAA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AAI,CAkBhE;AAED;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,CAAC,SAAS,SAAS,EAAE,CAAC,EACpD,IAAI,EAAE,IAAI,EACV,QAAQ,EAAE,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,GACrB,IAAI,CAqBN;AAED,wFAAwF;AACxF,wBAAgB,YAAY,CAC1B,IAAI,EAAE,IAAI,EACV,SAAS,EAAE,QAAQ,GAAG,QAAQ,CAAC,QAAQ,CAAC,GACvC,IAAI,CAEN;AAED,gGAAgG;AAChG,wBAAgB,WAAW,CACzB,IAAI,EAAE,IAAI,EACV,QAAQ,EAAE,OAAO,GAAG,QAAQ,CAAC,OAAO,CAAC,GACpC,IAAI,CAEN;AAED;;;GAGG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,GAAG,IAAI,CAoB/D;AAED;;;;;;;GAOG;AACH,wBAAgB,SAAS,CACvB,IAAI,EAAE,IAAI,EACV,MAAM,EAAE,MAAM,EACd,IAAI,CAAC,EAAE,MAAM,EACb,KAAK,UAAQ,GACZ,IAAI,CAON"}
|
|
@@ -32,6 +32,8 @@ local ReadonlySet = ____ReadonlySet.ReadonlySet
|
|
|
32
32
|
local ____array = require("src.functions.array")
|
|
33
33
|
local arrayToString = ____array.arrayToString
|
|
34
34
|
local isArray = ____array.isArray
|
|
35
|
+
local ____bosses = require("src.functions.bosses")
|
|
36
|
+
local getBossID = ____bosses.getBossID
|
|
35
37
|
local ____collectibles = require("src.functions.collectibles")
|
|
36
38
|
local getCollectibleName = ____collectibles.getCollectibleName
|
|
37
39
|
local ____entities = require("src.functions.entities")
|
|
@@ -269,8 +271,7 @@ function ____exports.logProjectileFlags(projectileFlags)
|
|
|
269
271
|
end
|
|
270
272
|
--- Helper function for logging information about the current room.
|
|
271
273
|
function ____exports.logRoom()
|
|
272
|
-
local
|
|
273
|
-
local bossID = room:GetBossID()
|
|
274
|
+
local bossID = getBossID(nil)
|
|
274
275
|
local roomGridIndex = getRoomGridIndex(nil)
|
|
275
276
|
local roomListIndex = getRoomListIndex(nil)
|
|
276
277
|
local roomData = getRoomData(nil)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "isaacscript-common",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "69.1.0",
|
|
4
4
|
"description": "Helper functions and features for IsaacScript mods.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"isaac",
|
|
@@ -25,6 +25,6 @@
|
|
|
25
25
|
"main": "dist/src/index",
|
|
26
26
|
"types": "dist/index.rollup.d.ts",
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"isaac-typescript-definitions": "^33.0
|
|
28
|
+
"isaac-typescript-definitions": "^33.1.0"
|
|
29
29
|
}
|
|
30
30
|
}
|
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,22 @@ export function getBossID(): BossID | 0 {
|
|
|
102
108
|
}
|
|
103
109
|
|
|
104
110
|
const room = game.GetRoom();
|
|
105
|
-
|
|
111
|
+
|
|
112
|
+
// eslint-disable-next-line deprecation/deprecation
|
|
113
|
+
const bossID = room.GetBossID();
|
|
114
|
+
if (bossID === 0) {
|
|
115
|
+
return undefined;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
// The Ultra Greed room holds both Ultra Greed and Ultra Greedier.
|
|
119
|
+
if (
|
|
120
|
+
bossID === BossID.ULTRA_GREED &&
|
|
121
|
+
doesEntityExist(EntityType.ULTRA_GREED, UltraGreedVariant.ULTRA_GREEDIER)
|
|
122
|
+
) {
|
|
123
|
+
return BossID.ULTRA_GREEDIER;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
return bossID;
|
|
106
127
|
}
|
|
107
128
|
|
|
108
129
|
export function getBossIDFromEntityTypeVariant(
|
package/src/functions/frames.ts
CHANGED
|
@@ -81,10 +81,6 @@ export function isBeforeRoomFrame(roomFrameCount: int): boolean {
|
|
|
81
81
|
* This returns false if the submitted render frame count is null or undefined.
|
|
82
82
|
*/
|
|
83
83
|
export function onGameFrame(gameFrameCount: int | null | undefined): boolean {
|
|
84
|
-
if (gameFrameCount === null || gameFrameCount === undefined) {
|
|
85
|
-
return false;
|
|
86
|
-
}
|
|
87
|
-
|
|
88
84
|
const thisGameFrameCount = game.GetFrameCount();
|
|
89
85
|
return thisGameFrameCount === gameFrameCount;
|
|
90
86
|
}
|
|
@@ -156,10 +152,6 @@ export function onOrBeforeRoomFrame(roomFrameCount: int): boolean {
|
|
|
156
152
|
export function onRenderFrame(
|
|
157
153
|
renderFrameCount: int | null | undefined,
|
|
158
154
|
): boolean {
|
|
159
|
-
if (renderFrameCount === null || renderFrameCount === undefined) {
|
|
160
|
-
return false;
|
|
161
|
-
}
|
|
162
|
-
|
|
163
155
|
const thisRenderFrameCount = Isaac.GetFrameCount();
|
|
164
156
|
return thisRenderFrameCount === renderFrameCount;
|
|
165
157
|
}
|
|
@@ -171,10 +163,6 @@ export function onRenderFrame(
|
|
|
171
163
|
* This returns false if the submitted room frame count is null or undefined.
|
|
172
164
|
*/
|
|
173
165
|
export function onRoomFrame(roomFrameCount: int | null | undefined): boolean {
|
|
174
|
-
if (roomFrameCount === null || roomFrameCount === undefined) {
|
|
175
|
-
return false;
|
|
176
|
-
}
|
|
177
|
-
|
|
178
166
|
const room = game.GetRoom();
|
|
179
167
|
|
|
180
168
|
const thisGameFrameCount = room.GetFrameCount();
|
package/src/functions/logMisc.ts
CHANGED
|
@@ -17,6 +17,7 @@ import {
|
|
|
17
17
|
import { game, musicManager, sfxManager } from "../core/cachedClasses";
|
|
18
18
|
import { ReadonlySet } from "../types/ReadonlySet";
|
|
19
19
|
import { arrayToString, isArray } from "./array";
|
|
20
|
+
import { getBossID } from "./bosses";
|
|
20
21
|
import { getCollectibleName } from "./collectibles";
|
|
21
22
|
import { getEntityID } from "./entities";
|
|
22
23
|
import { getEnumEntries } from "./enums";
|
|
@@ -310,8 +311,7 @@ export function logProjectileFlags(
|
|
|
310
311
|
|
|
311
312
|
/** Helper function for logging information about the current room. */
|
|
312
313
|
export function logRoom(this: void): void {
|
|
313
|
-
const
|
|
314
|
-
const bossID = room.GetBossID();
|
|
314
|
+
const bossID = getBossID();
|
|
315
315
|
const roomGridIndex = getRoomGridIndex();
|
|
316
316
|
const roomListIndex = getRoomListIndex();
|
|
317
317
|
const roomData = getRoomData();
|