isaacscript-common 87.9.0 → 87.9.3

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.
@@ -1,5 +1,5 @@
1
- import type { BackdropType, BossID, ItemPoolType, MinibossID, RoomShape } from "isaac-typescript-definitions";
2
- import { Dimension, RoomType } from "isaac-typescript-definitions";
1
+ import type { BackdropType, BossID, MinibossID, RoomShape } from "isaac-typescript-definitions";
2
+ import { Dimension, ItemPoolType, RoomType } from "isaac-typescript-definitions";
3
3
  /**
4
4
  * Helper function for quickly switching to a new room without playing a particular animation. Use
5
5
  * this helper function over invoking the `Game.ChangeRoom` method directly to ensure that you do
@@ -51,6 +51,14 @@ export declare function getRoomDataForTypeVariant(roomType: RoomType, roomVarian
51
51
  /**
52
52
  * Helper function to get the item pool type for the current room. For example, this returns
53
53
  * `ItemPoolType.ItemPoolType.POOL_ANGEL` if you are in an Angel Room.
54
+ *
55
+ * This function is a wrapper around the `ItemPool.GetPoolForRoom` method.
56
+ *
57
+ * Note that `ItemPool.GetPoolForRoom` will return -1 in `RoomType.DEFAULT` (1) rooms, but this
58
+ * function will convert -1 to `ItemPoolType.TREASURE` (0) for convenience purposes (since the game
59
+ * is "supposed" to use the Treasure Room pool for collections spawned in normal rooms). If you need
60
+ * to distinguish between real Treasure Rooms and default rooms, then use the
61
+ * `ItemPool.GetPoolForRoom` method directly.
54
62
  */
55
63
  export declare function getRoomItemPoolType(): ItemPoolType;
56
64
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"rooms.d.ts","sourceRoot":"","sources":["../../src/functions/rooms.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,YAAY,EACZ,MAAM,EACN,YAAY,EACZ,UAAU,EACV,SAAS,EACV,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAEL,SAAS,EAQT,QAAQ,EAGT,MAAM,8BAA8B,CAAC;AAsCtC;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,aAAa,EAAE,GAAG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AMzD;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAC9B,QAAQ,EAAE,UAAU,EACpB,UAAU,EAAE,UAAU,GACrB,OAAO,CAOT;AAED;;;GAGG;AACH,wBAAgB,YAAY,CAAC,QAAQ,EAAE,UAAU,GAAG,OAAO,CAQ1D;AAED;;;;GAIG;AACH,wBAAgB,WAAW,CACzB,QAAQ,EAAE,UAAU,EACpB,GAAG,UAAU,EAAE,SAAS,SAAS,EAAE,GAClC,OAAO,CAET;AAED;;;;GAIG;AACH,wBAAgB,UAAU,CACxB,QAAQ,EAAE,UAAU,EACpB,GAAG,SAAS,EAAE,SAAS,QAAQ,EAAE,GAChC,OAAO,CAET;AAED;;;GAGG;AACH,wBAAgB,YAAY,CAAC,aAAa,EAAE,GAAG,GAAG,OAAO,CAGxD;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,QAAQ,GAAG,OAAO,CAE5D;AAED;;;;;;;GAOG;AACH,wBAAgB,YAAY,CAAC,aAAa,EAAE,GAAG,GAAG,OAAO,CAGxD;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,IAAI,IAAI,CAWrC;AAED,iFAAiF;AACjF,wBAAgB,WAAW,CAAC,YAAY,EAAE,YAAY,GAAG,IAAI,CAG5D;AAED;;;;GAIG;AACH,wBAAgB,cAAc,IAAI,IAAI,CA8BrC;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,IAAI,IAAI,CAKvC"}
@@ -166,13 +166,24 @@ function getRoomDataForTypeVariant(roomType, roomVariant, cancelRoomTransition =
166
166
  /**
167
167
  * Helper function to get the item pool type for the current room. For example, this returns
168
168
  * `ItemPoolType.ItemPoolType.POOL_ANGEL` if you are in an Angel Room.
169
+ *
170
+ * This function is a wrapper around the `ItemPool.GetPoolForRoom` method.
171
+ *
172
+ * Note that `ItemPool.GetPoolForRoom` will return -1 in `RoomType.DEFAULT` (1) rooms, but this
173
+ * function will convert -1 to `ItemPoolType.TREASURE` (0) for convenience purposes (since the game
174
+ * is "supposed" to use the Treasure Room pool for collections spawned in normal rooms). If you need
175
+ * to distinguish between real Treasure Rooms and default rooms, then use the
176
+ * `ItemPool.GetPoolForRoom` method directly.
169
177
  */
170
178
  function getRoomItemPoolType() {
171
179
  const itemPool = cachedClasses_1.game.GetItemPool();
172
180
  const room = cachedClasses_1.game.GetRoom();
173
181
  const roomType = room.GetType();
174
182
  const roomSeed = room.GetSpawnSeed();
175
- return itemPool.GetPoolForRoom(roomType, roomSeed);
183
+ const itemPoolTypeOrNegativeOne = itemPool.GetPoolForRoom(roomType, roomSeed);
184
+ return itemPoolTypeOrNegativeOne === -1
185
+ ? isaac_typescript_definitions_1.ItemPoolType.TREASURE
186
+ : itemPoolTypeOrNegativeOne;
176
187
  }
177
188
  /**
178
189
  * Helper function to get the proper name of a room type.
@@ -20,6 +20,7 @@ local DownpourRoomSubType = ____isaac_2Dtypescript_2Ddefinitions.DownpourRoomSub
20
20
  local DungeonSubType = ____isaac_2Dtypescript_2Ddefinitions.DungeonSubType
21
21
  local GridRoom = ____isaac_2Dtypescript_2Ddefinitions.GridRoom
22
22
  local HomeRoomSubType = ____isaac_2Dtypescript_2Ddefinitions.HomeRoomSubType
23
+ local ItemPoolType = ____isaac_2Dtypescript_2Ddefinitions.ItemPoolType
23
24
  local RoomDescriptorFlag = ____isaac_2Dtypescript_2Ddefinitions.RoomDescriptorFlag
24
25
  local RoomType = ____isaac_2Dtypescript_2Ddefinitions.RoomType
25
26
  local SoundEffect = ____isaac_2Dtypescript_2Ddefinitions.SoundEffect
@@ -334,12 +335,21 @@ function ____exports.getRoomDataForTypeVariant(self, roomType, roomVariant, canc
334
335
  end
335
336
  --- Helper function to get the item pool type for the current room. For example, this returns
336
337
  -- `ItemPoolType.ItemPoolType.POOL_ANGEL` if you are in an Angel Room.
338
+ --
339
+ -- This function is a wrapper around the `ItemPool.GetPoolForRoom` method.
340
+ --
341
+ -- Note that `ItemPool.GetPoolForRoom` will return -1 in `RoomType.DEFAULT` (1) rooms, but this
342
+ -- function will convert -1 to `ItemPoolType.TREASURE` (0) for convenience purposes (since the game
343
+ -- is "supposed" to use the Treasure Room pool for collections spawned in normal rooms). If you need
344
+ -- to distinguish between real Treasure Rooms and default rooms, then use the
345
+ -- `ItemPool.GetPoolForRoom` method directly.
337
346
  function ____exports.getRoomItemPoolType(self)
338
347
  local itemPool = game:GetItemPool()
339
348
  local room = game:GetRoom()
340
349
  local roomType = room:GetType()
341
350
  local roomSeed = room:GetSpawnSeed()
342
- return itemPool:GetPoolForRoom(roomType, roomSeed)
351
+ local itemPoolTypeOrNegativeOne = itemPool:GetPoolForRoom(roomType, roomSeed)
352
+ return itemPoolTypeOrNegativeOne == -1 and ItemPoolType.TREASURE or itemPoolTypeOrNegativeOne
343
353
  end
344
354
  --- Helper function to get the proper name of a room type.
345
355
  --
@@ -7511,6 +7511,14 @@ export declare function getRoomGridIndexesForType(...roomTypes: readonly RoomTyp
7511
7511
  /**
7512
7512
  * Helper function to get the item pool type for the current room. For example, this returns
7513
7513
  * `ItemPoolType.ItemPoolType.POOL_ANGEL` if you are in an Angel Room.
7514
+ *
7515
+ * This function is a wrapper around the `ItemPool.GetPoolForRoom` method.
7516
+ *
7517
+ * Note that `ItemPool.GetPoolForRoom` will return -1 in `RoomType.DEFAULT` (1) rooms, but this
7518
+ * function will convert -1 to `ItemPoolType.TREASURE` (0) for convenience purposes (since the game
7519
+ * is "supposed" to use the Treasure Room pool for collections spawned in normal rooms). If you need
7520
+ * to distinguish between real Treasure Rooms and default rooms, then use the
7521
+ * `ItemPool.GetPoolForRoom` method directly.
7514
7522
  */
7515
7523
  export declare function getRoomItemPoolType(): ItemPoolType;
7516
7524
 
@@ -1,6 +1,6 @@
1
1
  --[[
2
2
 
3
- isaacscript-common 87.8.3
3
+ isaacscript-common 87.9.2
4
4
 
5
5
  This is the "isaacscript-common" library, which was created with the IsaacScript tool.
6
6
 
@@ -2295,7 +2295,7 @@ local function __TS__SourceMapTraceBack(fileName, sourceMap)
2295
2295
  end
2296
2296
  local result = string.gsub(
2297
2297
  trace,
2298
- "(%S+)%.lua:(%d+)",
2298
+ "([^%s<]+)%.lua:(%d+)",
2299
2299
  function(file, line) return replacer(nil, file .. ".lua", file .. ".ts", line) end
2300
2300
  )
2301
2301
  local function stringReplacer(____, file, line)
@@ -33364,6 +33364,7 @@ local DownpourRoomSubType = ____isaac_2Dtypescript_2Ddefinitions.DownpourRoomSub
33364
33364
  local DungeonSubType = ____isaac_2Dtypescript_2Ddefinitions.DungeonSubType
33365
33365
  local GridRoom = ____isaac_2Dtypescript_2Ddefinitions.GridRoom
33366
33366
  local HomeRoomSubType = ____isaac_2Dtypescript_2Ddefinitions.HomeRoomSubType
33367
+ local ItemPoolType = ____isaac_2Dtypescript_2Ddefinitions.ItemPoolType
33367
33368
  local RoomDescriptorFlag = ____isaac_2Dtypescript_2Ddefinitions.RoomDescriptorFlag
33368
33369
  local RoomType = ____isaac_2Dtypescript_2Ddefinitions.RoomType
33369
33370
  local SoundEffect = ____isaac_2Dtypescript_2Ddefinitions.SoundEffect
@@ -33678,12 +33679,21 @@ function ____exports.getRoomDataForTypeVariant(self, roomType, roomVariant, canc
33678
33679
  end
33679
33680
  --- Helper function to get the item pool type for the current room. For example, this returns
33680
33681
  -- `ItemPoolType.ItemPoolType.POOL_ANGEL` if you are in an Angel Room.
33682
+ --
33683
+ -- This function is a wrapper around the `ItemPool.GetPoolForRoom` method.
33684
+ --
33685
+ -- Note that `ItemPool.GetPoolForRoom` will return -1 in `RoomType.DEFAULT` (1) rooms, but this
33686
+ -- function will convert -1 to `ItemPoolType.TREASURE` (0) for convenience purposes (since the game
33687
+ -- is "supposed" to use the Treasure Room pool for collections spawned in normal rooms). If you need
33688
+ -- to distinguish between real Treasure Rooms and default rooms, then use the
33689
+ -- `ItemPool.GetPoolForRoom` method directly.
33681
33690
  function ____exports.getRoomItemPoolType(self)
33682
33691
  local itemPool = game:GetItemPool()
33683
33692
  local room = game:GetRoom()
33684
33693
  local roomType = room:GetType()
33685
33694
  local roomSeed = room:GetSpawnSeed()
33686
- return itemPool:GetPoolForRoom(roomType, roomSeed)
33695
+ local itemPoolTypeOrNegativeOne = itemPool:GetPoolForRoom(roomType, roomSeed)
33696
+ return itemPoolTypeOrNegativeOne == -1 and ItemPoolType.TREASURE or itemPoolTypeOrNegativeOne
33687
33697
  end
33688
33698
  --- Helper function to get the proper name of a room type.
33689
33699
  --
@@ -70872,4 +70882,5 @@ end
70872
70882
  return ____exports
70873
70883
  end,
70874
70884
  }
70875
- return require("indexLua", ...)
70885
+ local ____entry = require("indexLua", ...)
70886
+ return ____entry
@@ -2241,7 +2241,7 @@ local function __TS__SourceMapTraceBack(fileName, sourceMap)
2241
2241
  end
2242
2242
  local result = string.gsub(
2243
2243
  trace,
2244
- "(%S+)%.lua:(%d+)",
2244
+ "([^%s<]+)%.lua:(%d+)",
2245
2245
  function(file, line) return replacer(nil, file .. ".lua", file .. ".ts", line) end
2246
2246
  )
2247
2247
  local function stringReplacer(____, file, line)
@@ -5,7 +5,7 @@
5
5
  "toolPackages": [
6
6
  {
7
7
  "packageName": "@microsoft/api-extractor",
8
- "packageVersion": "7.55.2"
8
+ "packageVersion": "7.57.7"
9
9
  }
10
10
  ]
11
11
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "isaacscript-common",
3
- "version": "87.9.0",
3
+ "version": "87.9.3",
4
4
  "description": "Helper functions and features for IsaacScript mods.",
5
5
  "keywords": [
6
6
  "isaac",
@@ -34,13 +34,13 @@
34
34
  "lint": "tsx --tsconfig ./scripts/tsconfig.json ./scripts/lint.mts"
35
35
  },
36
36
  "dependencies": {
37
- "isaac-typescript-definitions": "43.0.1"
37
+ "isaac-typescript-definitions": "43.0.5"
38
38
  },
39
39
  "devDependencies": {
40
- "@microsoft/api-extractor": "7.55.2",
41
- "complete-node": "16.2.0",
40
+ "@microsoft/api-extractor": "7.57.7",
41
+ "complete-node": "16.3.0",
42
42
  "eslint-plugin-sort-exports": "0.9.1",
43
- "typescript-eslint": "8.51.0",
44
- "typescript-to-lua": "1.33.2"
43
+ "typescript-eslint": "8.57.0",
44
+ "typescript-to-lua": "1.34.0"
45
45
  }
46
46
  }
@@ -1,7 +1,6 @@
1
1
  import type {
2
2
  BackdropType,
3
3
  BossID,
4
- ItemPoolType,
5
4
  MinibossID,
6
5
  RoomShape,
7
6
  } from "isaac-typescript-definitions";
@@ -14,6 +13,7 @@ import {
14
13
  DungeonSubType,
15
14
  GridRoom,
16
15
  HomeRoomSubType,
16
+ ItemPoolType,
17
17
  RoomDescriptorFlag,
18
18
  RoomType,
19
19
  SoundEffect,
@@ -166,14 +166,25 @@ export function getRoomDataForTypeVariant(
166
166
  /**
167
167
  * Helper function to get the item pool type for the current room. For example, this returns
168
168
  * `ItemPoolType.ItemPoolType.POOL_ANGEL` if you are in an Angel Room.
169
+ *
170
+ * This function is a wrapper around the `ItemPool.GetPoolForRoom` method.
171
+ *
172
+ * Note that `ItemPool.GetPoolForRoom` will return -1 in `RoomType.DEFAULT` (1) rooms, but this
173
+ * function will convert -1 to `ItemPoolType.TREASURE` (0) for convenience purposes (since the game
174
+ * is "supposed" to use the Treasure Room pool for collections spawned in normal rooms). If you need
175
+ * to distinguish between real Treasure Rooms and default rooms, then use the
176
+ * `ItemPool.GetPoolForRoom` method directly.
169
177
  */
170
178
  export function getRoomItemPoolType(): ItemPoolType {
171
179
  const itemPool = game.GetItemPool();
172
180
  const room = game.GetRoom();
173
181
  const roomType = room.GetType();
174
182
  const roomSeed = room.GetSpawnSeed();
183
+ const itemPoolTypeOrNegativeOne = itemPool.GetPoolForRoom(roomType, roomSeed);
175
184
 
176
- return itemPool.GetPoolForRoom(roomType, roomSeed);
185
+ return itemPoolTypeOrNegativeOne === -1
186
+ ? ItemPoolType.TREASURE
187
+ : itemPoolTypeOrNegativeOne;
177
188
  }
178
189
 
179
190
  /**