isaacscript-common 68.0.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.
@@ -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 0 if the current
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 correctly handles Dogma and The
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 | 0;
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 68.0.0
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
 
@@ -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
- return room:GetBossID()
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 ____switch20 = entityType
45043
- local ____cond20 = ____switch20 == EntityType.CHUB
45044
- if ____cond20 then
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
- ____cond20 = ____cond20 or ____switch20 == EntityType.LOKI
45050
- if ____cond20 then
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
- ____cond20 = ____cond20 or ____switch20 == EntityType.GURGLING
45056
- if ____cond20 then
45056
+ ____cond22 = ____cond22 or ____switch22 == EntityType.GURGLING
45057
+ if ____cond22 then
45057
45058
  do
45058
45059
  return 2
45059
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 0 if the current
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 correctly handles Dogma and The
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 | 0;
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,EAAE,MAAM,EAAE,UAAU,EAAe,MAAM,8BAA8B,CAAC;AAkC/E;;;;;;;;;;;;;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,CAAC,CAWtC;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,GAA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AAC,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 0 if the current
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 correctly handles Dogma and The
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
- return room:GetBossID()
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 ____switch20 = entityType
205
- local ____cond20 = ____switch20 == EntityType.CHUB
206
- if ____cond20 then
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
- ____cond20 = ____cond20 or ____switch20 == EntityType.LOKI
212
- if ____cond20 then
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
- ____cond20 = ____cond20 or ____switch20 == EntityType.GURGLING
218
- if ____cond20 then
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,CAAC,cAAc,EAAE,GAAG,GAAG,OAAO,CAK7D;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,cAAc,EAAE,GAAG,GAAG,OAAO,CAG9D;AAED;;;GAGG;AACH,wBAAgB,mBAAm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
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
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "isaacscript-common",
3
- "version": "68.0.0",
3
+ "version": "69.0.0",
4
4
  "description": "Helper functions and features for IsaacScript mods.",
5
5
  "keywords": [
6
6
  "isaac",
@@ -1,5 +1,10 @@
1
1
  import type { LevelStage, StageType } from "isaac-typescript-definitions";
2
- import { BossID, EntityType, LokiVariant } from "isaac-typescript-definitions";
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 0 if the current
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 correctly handles Dogma and The
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 | 0 {
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
- return room.GetBossID();
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(
@@ -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();