isaacscript-common 6.18.0 → 6.20.1

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.
Files changed (65) hide show
  1. package/dist/constants.d.ts +5 -0
  2. package/dist/constants.d.ts.map +1 -1
  3. package/dist/constants.lua +4 -0
  4. package/dist/features/customStage/exports.d.ts.map +1 -1
  5. package/dist/features/customStage/exports.lua +2 -7
  6. package/dist/features/customTrapdoor/init.d.ts.map +1 -1
  7. package/dist/features/customTrapdoor/init.lua +10 -2
  8. package/dist/features/extraConsoleCommands/commandsSubroutines.d.ts.map +1 -1
  9. package/dist/features/extraConsoleCommands/commandsSubroutines.lua +2 -1
  10. package/dist/features/extraConsoleCommands/listCommands.d.ts.map +1 -1
  11. package/dist/features/extraConsoleCommands/listCommands.lua +2 -1
  12. package/dist/features/playerInventory.d.ts.map +1 -1
  13. package/dist/features/playerInventory.lua +2 -4
  14. package/dist/functions/curses.d.ts +3 -0
  15. package/dist/functions/curses.d.ts.map +1 -0
  16. package/dist/functions/curses.lua +11 -0
  17. package/dist/functions/dimensions.d.ts +12 -0
  18. package/dist/functions/dimensions.d.ts.map +1 -0
  19. package/dist/functions/dimensions.lua +35 -0
  20. package/dist/functions/eden.d.ts.map +1 -1
  21. package/dist/functions/eden.lua +2 -4
  22. package/dist/functions/itemPool.d.ts +18 -0
  23. package/dist/functions/itemPool.d.ts.map +1 -0
  24. package/dist/functions/itemPool.lua +133 -0
  25. package/dist/functions/level.d.ts.map +1 -1
  26. package/dist/functions/level.lua +8 -7
  27. package/dist/functions/levelGrid.d.ts +155 -0
  28. package/dist/functions/levelGrid.d.ts.map +1 -0
  29. package/dist/functions/levelGrid.lua +349 -0
  30. package/dist/functions/rockAlt.d.ts +4 -4
  31. package/dist/functions/rockAlt.d.ts.map +1 -1
  32. package/dist/functions/rockAlt.lua +69 -20
  33. package/dist/functions/roomData.d.ts +5 -0
  34. package/dist/functions/roomData.d.ts.map +1 -1
  35. package/dist/functions/roomData.lua +6 -0
  36. package/dist/functions/roomGrid.d.ts +8 -0
  37. package/dist/functions/roomGrid.d.ts.map +1 -1
  38. package/dist/functions/rooms.d.ts +42 -61
  39. package/dist/functions/rooms.d.ts.map +1 -1
  40. package/dist/functions/rooms.lua +129 -200
  41. package/dist/functions/saveFile.d.ts +1 -6
  42. package/dist/functions/saveFile.d.ts.map +1 -1
  43. package/dist/functions/saveFile.lua +4 -113
  44. package/dist/index.d.ts +4 -0
  45. package/dist/index.d.ts.map +1 -1
  46. package/dist/index.lua +32 -0
  47. package/package.json +2 -2
  48. package/src/constants.ts +8 -0
  49. package/src/features/customStage/exports.ts +10 -11
  50. package/src/features/customTrapdoor/init.ts +7 -3
  51. package/src/features/extraConsoleCommands/commandsSubroutines.ts +2 -1
  52. package/src/features/extraConsoleCommands/listCommands.ts +2 -1
  53. package/src/features/playerInventory.ts +2 -3
  54. package/src/functions/curses.ts +9 -0
  55. package/src/functions/dimensions.ts +41 -0
  56. package/src/functions/eden.ts +2 -4
  57. package/src/functions/itemPool.ts +178 -0
  58. package/src/functions/level.ts +7 -10
  59. package/src/functions/levelGrid.ts +468 -0
  60. package/src/functions/rockAlt.ts +111 -29
  61. package/src/functions/roomData.ts +12 -0
  62. package/src/functions/roomGrid.ts +9 -0
  63. package/src/functions/rooms.ts +93 -206
  64. package/src/functions/saveFile.ts +5 -147
  65. package/src/index.ts +4 -0
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAChC,OAAO,EACL,cAAc,EACd,eAAe,GAChB,MAAM,iCAAiC,CAAC;AACzC,OAAO,EACL,qBAAqB,EACrB,oBAAoB,EACpB,0BAA0B,GAC3B,MAAM,gCAAgC,CAAC;AACxC,cAAc,sBAAsB,CAAC;AACrC,cAAc,uBAAuB,CAAC;AACtC,cAAc,aAAa,CAAC;AAC5B,cAAc,sBAAsB,CAAC;AACrC,cAAc,o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AAC;AAClC,cAAc,uBAAuB,CAAC;AACtC,cAAc,iBAAiB,CAAC;AAChC,cAAc,sBAAsB,CAAC;AACrC,cAAc,mBAAmB,CAAC;AAClC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,iBAAiB,CAAC;AAChC,cAAc,mBAAmB,CAAC;AAClC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,qBAAqB,CAAC;AACpC,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC;AAClC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,yBAAyB,CAAC;AACxC,cAAc,sBAAsB,CAAC;AACrC,cAAc,uBAAuB,CAAC;AACtC,cAAc,mBAAmB,CAAC;AAClC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,yCAAyC,CAAC;AACxD,cAAc,+BAA+B,CAAC;AAC9C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,oCAAoC,CAAC;AACnD,cAAc,uBAAuB,CAAC;AACtC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,gBAAgB,CAAC;AAC/B,cAAc,qBAAqB,CAAC;AACpC,cAAc,sBAAsB,CAAC;AACrC,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC;AACjC,cAAc,mBAAmB,CAAC;AAClC,cAAc,0BAA0B,CAAC;AACzC,cAAc,uBAAuB,CAAC;AACtC,cAAc,qBAAqB,CAAC;AACpC,cAAc,cAAc,CAAC"}
package/dist/index.lua CHANGED
@@ -430,6 +430,14 @@ do
430
430
  end
431
431
  end
432
432
  end
433
+ do
434
+ local ____export = require("functions.curses")
435
+ for ____exportKey, ____exportValue in pairs(____export) do
436
+ if ____exportKey ~= "default" then
437
+ ____exports[____exportKey] = ____exportValue
438
+ end
439
+ end
440
+ end
433
441
  do
434
442
  local ____export = require("functions.debug")
435
443
  for ____exportKey, ____exportValue in pairs(____export) do
@@ -454,6 +462,14 @@ do
454
462
  end
455
463
  end
456
464
  end
465
+ do
466
+ local ____export = require("functions.dimensions")
467
+ for ____exportKey, ____exportValue in pairs(____export) do
468
+ if ____exportKey ~= "default" then
469
+ ____exports[____exportKey] = ____exportValue
470
+ end
471
+ end
472
+ end
457
473
  do
458
474
  local ____export = require("functions.direction")
459
475
  for ____exportKey, ____exportValue in pairs(____export) do
@@ -590,6 +606,14 @@ do
590
606
  end
591
607
  end
592
608
  end
609
+ do
610
+ local ____export = require("functions.itemPool")
611
+ for ____exportKey, ____exportValue in pairs(____export) do
612
+ if ____exportKey ~= "default" then
613
+ ____exports[____exportKey] = ____exportValue
614
+ end
615
+ end
616
+ end
593
617
  do
594
618
  local ____export = require("functions.jsonHelpers")
595
619
  for ____exportKey, ____exportValue in pairs(____export) do
@@ -630,6 +654,14 @@ do
630
654
  end
631
655
  end
632
656
  end
657
+ do
658
+ local ____export = require("functions.levelGrid")
659
+ for ____exportKey, ____exportValue in pairs(____export) do
660
+ if ____exportKey ~= "default" then
661
+ ____exports[____exportKey] = ____exportValue
662
+ end
663
+ end
664
+ end
633
665
  do
634
666
  local ____export = require("functions.log")
635
667
  for ____exportKey, ____exportValue in pairs(____export) do
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "isaacscript-common",
3
- "version": "6.18.0",
3
+ "version": "6.20.1",
4
4
  "description": "Helper functions and features for IsaacScript mods.",
5
5
  "keywords": [
6
6
  "isaac",
@@ -22,6 +22,6 @@
22
22
  "main": "dist/index",
23
23
  "types": "dist/index.d.ts",
24
24
  "dependencies": {
25
- "isaac-typescript-definitions": "^3.1.0"
25
+ "isaac-typescript-definitions": "^3.1.1"
26
26
  }
27
27
  }
package/src/constants.ts CHANGED
@@ -1,11 +1,19 @@
1
1
  import {
2
2
  CollectibleType,
3
3
  Dimension,
4
+ DisplayFlag,
4
5
  ItemPoolType,
5
6
  TrinketSlot,
6
7
  } from "isaac-typescript-definitions";
7
8
  import { NUM_NORMAL_PILL_COLORS } from "./constantsFirstLast";
8
9
  import { getEnumLength } from "./functions/enums";
10
+ import { addFlag } from "./functions/flag";
11
+
12
+ export const ALL_DISPLAY_FLAGS = addFlag(
13
+ DisplayFlag.VISIBLE,
14
+ DisplayFlag.SHADOW,
15
+ DisplayFlag.SHOW_ICON,
16
+ );
9
17
 
10
18
  /**
11
19
  * The distance of the laser when Azazel does not have any range up items yet. For more info, see
@@ -1,6 +1,5 @@
1
1
  import {
2
2
  EntityType,
3
- GridRoom,
4
3
  LevelStage,
5
4
  RoomShape,
6
5
  RoomType,
@@ -11,9 +10,8 @@ import { reorderedCallbacksSetStage } from "../../callbacks/reorderedCallbacks";
11
10
  import { getEntityIDFromConstituents } from "../../functions/entities";
12
11
  import { log, logError } from "../../functions/log";
13
12
  import { newRNG } from "../../functions/rng";
14
- import { getRoomData } from "../../functions/roomData";
15
- import { getRooms } from "../../functions/rooms";
16
- import { getGotoCommand, setStage } from "../../functions/stage";
13
+ import { getRoomDataForTypeVariant, getRooms } from "../../functions/rooms";
14
+ import { setStage } from "../../functions/stage";
17
15
  import { getRandomCustomStageRoom } from "./customStageUtils";
18
16
  import { topStreakTextStart } from "./streakText";
19
17
  import v, {
@@ -103,18 +101,19 @@ export function setCustomStage(name: string, verbose = false): void {
103
101
 
104
102
  let newRoomData = customStageCachedRoomData.get(randomRoom.variant);
105
103
  if (newRoomData === undefined) {
106
- // We need the room data for this room. We can leverage the "goto" console command to load it
107
- // into the "debug" slot. This is convenient because we do not actually have to travel to the
108
- // room.
109
- const command = getGotoCommand(roomType, randomRoom.variant);
110
- Isaac.ExecuteCommand(command);
111
- newRoomData = getRoomData(GridRoom.DEBUG);
104
+ // We do not already have the room data for this room cached.
105
+ newRoomData = getRoomDataForTypeVariant(
106
+ roomType,
107
+ randomRoom.variant,
108
+ false,
109
+ );
112
110
  if (newRoomData === undefined) {
113
111
  logError(
114
112
  `Failed to get the room data for room variant ${randomRoom.variant} for custom stage: ${name}`,
115
113
  );
116
114
  continue;
117
115
  }
116
+
118
117
  customStageCachedRoomData.set(randomRoom.variant, newRoomData);
119
118
  }
120
119
 
@@ -134,7 +133,7 @@ export function setCustomStage(name: string, verbose = false): void {
134
133
  // Furthermore, we need to cancel the queued warp to the `GridRoom.DEBUG` room. We can accomplish
135
134
  // both of these things by initiating a room transition to an arbitrary room. However, we rely on
136
135
  // the parent function to do this, since for normal purposes, we need to initiate a room
137
- // transition for pixelation purposes.
136
+ // transition for the pixelation effect.
138
137
  }
139
138
 
140
139
  export function setCustomStageDebug(): void {
@@ -10,6 +10,7 @@ import { StageTravelState } from "../../enums/private/StageTravelState";
10
10
  import { movePlayersToCenter } from "../../functions/playerCenter";
11
11
  import { getAllPlayers } from "../../functions/playerIndex";
12
12
  import { getRoomGridIndex, getRoomListIndex } from "../../functions/roomData";
13
+ import { teleport } from "../../functions/rooms";
13
14
  import { setStage } from "../../functions/stage";
14
15
  import { isString } from "../../functions/types";
15
16
  import { setCustomStage } from "../customStage/exports";
@@ -65,8 +66,10 @@ function checkAllPlayersJumpComplete() {
65
66
  v.run.stateRenderFrame = renderFrameCount;
66
67
 
67
68
  // In order to display the pixelation effect that should happen when we go to a new floor, we need
68
- // to start a room transition. We arbitrarily pick the current room for this purpose.
69
- game.StartRoomTransition(
69
+ // to start a room transition. We arbitrarily pick the current room for this purpose. (We do not
70
+ // have to worry about Curse of the Maze here, because even if we are taken to a different room,
71
+ // it will not matter, since we will be traveling to a new floor after the screen fades to black.)
72
+ teleport(
70
73
  roomGridIndex,
71
74
  Direction.NO_DIRECTION,
72
75
  RoomTransitionAnim.PIXELATION,
@@ -99,10 +102,11 @@ function checkPixelationToBlackComplete() {
99
102
 
100
103
  // Start another pixelation effect. This time, we will keep the screen black with the sprite, and
101
104
  // then remove the black sprite once the pixelation effect is halfway complete.
102
- game.StartRoomTransition(
105
+ teleport(
103
106
  roomGridIndex,
104
107
  Direction.NO_DIRECTION,
105
108
  RoomTransitionAnim.PIXELATION,
109
+ true,
106
110
  );
107
111
  }
108
112
 
@@ -9,10 +9,11 @@ import { game } from "../../cachedClasses";
9
9
  import { HealthType } from "../../enums/HealthType";
10
10
  import { directionToVector } from "../../functions/direction";
11
11
  import { spawnGridEntityWithVariant } from "../../functions/gridEntities";
12
+ import { getRoomGridIndexesForType } from "../../functions/levelGrid";
12
13
  import { logAllEntities, logAllGridEntities } from "../../functions/log";
13
14
  import { addPlayerHealthType } from "../../functions/playerHealth";
14
15
  import { getRoomData, getRoomDescriptor } from "../../functions/roomData";
15
- import { changeRoom, getRoomGridIndexesForType } from "../../functions/rooms";
16
+ import { changeRoom } from "../../functions/rooms";
16
17
  import { printConsole } from "../../functions/utils";
17
18
  import {
18
19
  DEFAULT_ROOM_TYPE_NAME,
@@ -63,6 +63,7 @@ import { getNPCs } from "../../functions/entitiesSpecific";
63
63
  import { getEnumValues } from "../../functions/enums";
64
64
  import { addFlag } from "../../functions/flag";
65
65
  import { spawnGridEntity } from "../../functions/gridEntities";
66
+ import { getRoomGridIndexesForType } from "../../functions/levelGrid";
66
67
  import {
67
68
  logPlayerEffects,
68
69
  logRoom,
@@ -85,7 +86,7 @@ import {
85
86
  useActiveItemTemp,
86
87
  } from "../../functions/players";
87
88
  import { gridCoordinatesToWorldPosition } from "../../functions/roomGrid";
88
- import { changeRoom, getRoomGridIndexesForType } from "../../functions/rooms";
89
+ import { changeRoom } from "../../functions/rooms";
89
90
  import { onSetSeed, restart, setUnseeded } from "../../functions/run";
90
91
  import { getGoldenTrinketType } from "../../functions/trinkets";
91
92
  import { irange, printConsole, printEnabled } from "../../functions/utils";
@@ -5,7 +5,7 @@ import { ModCallbackCustom } from "../enums/ModCallbackCustom";
5
5
  import { errorIfFeaturesNotInitialized } from "../featuresInitialized";
6
6
  import { arrayRemoveInPlace, copyArray } from "../functions/array";
7
7
  import { isActiveCollectible } from "../functions/collectibles";
8
- import { getCollectibleSet } from "../functions/collectibleSet";
8
+ import { getCollectibleArray } from "../functions/collectibleSet";
9
9
  import {
10
10
  defaultMapGetPlayer,
11
11
  mapSetPlayer,
@@ -30,8 +30,7 @@ const v = {
30
30
  function newPlayerInventory(player: EntityPlayer) {
31
31
  const inventory: CollectibleType[] = [];
32
32
 
33
- const collectibleSet = getCollectibleSet();
34
- for (const collectibleType of collectibleSet.values()) {
33
+ for (const collectibleType of getCollectibleArray()) {
35
34
  const numCollectibles = player.GetCollectibleNum(collectibleType, true);
36
35
  repeat(numCollectibles, () => {
37
36
  inventory.push(collectibleType);
@@ -0,0 +1,9 @@
1
+ import { LevelCurse } from "isaac-typescript-definitions";
2
+ import { game } from "../cachedClasses";
3
+ import { hasFlag } from "./flag";
4
+
5
+ export function hasCurse(curse: LevelCurse): boolean {
6
+ const level = game.GetLevel();
7
+ const curses = level.GetCurses();
8
+ return hasFlag(curses, curse);
9
+ }
@@ -0,0 +1,41 @@
1
+ import { Dimension } from "isaac-typescript-definitions";
2
+ import { game } from "../cachedClasses";
3
+ import { NUM_DIMENSIONS } from "../constants";
4
+ import { getRoomGridIndex } from "./roomData";
5
+ import { erange } from "./utils";
6
+
7
+ /**
8
+ * Helper function to get an array with every valid `Dimension` (not including `Dimension.CURRENT`).
9
+ */
10
+ export function getAllDimensions(): Dimension[] {
11
+ return erange(NUM_DIMENSIONS) as Dimension[];
12
+ }
13
+
14
+ /**
15
+ * Helper function to get the current dimension. Most of the time, this will be `Dimension.MAIN`,
16
+ * but it can change if e.g. the player is in the mirror world of Downpour/Dross.
17
+ */
18
+ export function getDimension(): Dimension {
19
+ const level = game.GetLevel();
20
+ const roomGridIndex = getRoomGridIndex();
21
+ const roomDescription = level.GetRoomByIdx(roomGridIndex, Dimension.CURRENT);
22
+ const currentRoomHash = GetPtrHash(roomDescription);
23
+
24
+ for (const dimension of getAllDimensions()) {
25
+ const dimensionRoomDescription = level.GetRoomByIdx(
26
+ roomGridIndex,
27
+ dimension,
28
+ );
29
+ const dimensionRoomHash = GetPtrHash(dimensionRoomDescription);
30
+
31
+ if (dimensionRoomHash === currentRoomHash) {
32
+ return dimension;
33
+ }
34
+ }
35
+
36
+ error("Failed to get the current dimension.");
37
+ }
38
+
39
+ export function inDimension(dimension: Dimension): boolean {
40
+ return dimension === getDimension();
41
+ }
@@ -1,6 +1,6 @@
1
1
  import { CollectibleType, ItemConfigTag } from "isaac-typescript-definitions";
2
2
  import { isHiddenCollectible, isPassiveCollectible } from "./collectibles";
3
- import { getCollectibleSet } from "./collectibleSet";
3
+ import { getCollectibleArray } from "./collectibleSet";
4
4
  import { collectibleHasTag } from "./collectibleTag";
5
5
  import { getRandomSeed } from "./rng";
6
6
  import { copySet, getRandomSetElement } from "./set";
@@ -8,9 +8,7 @@ import { copySet, getRandomSetElement } from "./set";
8
8
  const EDEN_PASSIVE_COLLECTIBLES_SET = new Set<CollectibleType>();
9
9
 
10
10
  function initCollectibleSet() {
11
- const collectibleSet = getCollectibleSet();
12
-
13
- for (const collectibleType of collectibleSet.values()) {
11
+ for (const collectibleType of getCollectibleArray()) {
14
12
  if (
15
13
  isPassiveCollectible(collectibleType) &&
16
14
  !isHiddenCollectible(collectibleType) &&
@@ -0,0 +1,178 @@
1
+ import {
2
+ CollectibleType,
3
+ ItemConfigTag,
4
+ ItemPoolType,
5
+ PlayerType,
6
+ TrinketType,
7
+ } from "isaac-typescript-definitions";
8
+ import { game } from "../cachedClasses";
9
+ import { PlayerIndex } from "../types/PlayerIndex";
10
+ import { getCollectibleArray } from "./collectibleSet";
11
+ import { collectibleHasTag } from "./collectibleTag";
12
+ import { mapGetPlayer, mapSetPlayer } from "./playerDataStructures";
13
+ import { getPlayers } from "./playerIndex";
14
+ import { getPlayersOfType } from "./players";
15
+ import { repeat } from "./utils";
16
+
17
+ const COLLECTIBLES_THAT_AFFECT_ITEM_POOLS: readonly CollectibleType[] = [
18
+ CollectibleType.CHAOS, // 402
19
+ CollectibleType.SACRED_ORB, // 691
20
+ CollectibleType.TMTRAINER, // 721
21
+ ];
22
+
23
+ const TRINKETS_THAT_AFFECT_ITEM_POOLS: readonly TrinketType[] = [
24
+ TrinketType.NO,
25
+ ];
26
+
27
+ const COLLECTIBLE_TYPE_THAT_IS_NOT_IN_ANY_POOLS = CollectibleType.KEY_PIECE_1;
28
+
29
+ /**
30
+ * Helper function to get the remaining collectibles in a given item pool. This function is
31
+ * expensive, so only use it in situations where the lag is acceptable.
32
+ */
33
+ export function getCollectiblesInItemPool(
34
+ itemPoolType: ItemPoolType,
35
+ ): CollectibleType[] {
36
+ const collectibleArray = getCollectibleArray();
37
+ return collectibleArray.filter((collectibleType) =>
38
+ isCollectibleInItemPool(collectibleType, itemPoolType),
39
+ );
40
+ }
41
+
42
+ /**
43
+ * Helper function to see if the given collectible is still present in the given item pool.
44
+ *
45
+ * If the collectible is non-offensive, any Tainted Losts will be temporarily changed to Isaac and
46
+ * then changed back. (This is because Tainted Lost is not able to retrieve non-offensive
47
+ * collectibles from item pools).
48
+ *
49
+ * Under the hood, this function works by using the `ItemPool.AddRoomBlacklist` method to blacklist
50
+ * every collectible except for the one provided.
51
+ */
52
+ export function isCollectibleInItemPool(
53
+ collectibleType: CollectibleType,
54
+ itemPoolType: ItemPoolType,
55
+ ): boolean {
56
+ // We use a specific collectible which is known to not be in any pools as a default value. Thus,
57
+ // we must explicitly handle this case.
58
+ if (collectibleType === COLLECTIBLE_TYPE_THAT_IS_NOT_IN_ANY_POOLS) {
59
+ return false;
60
+ }
61
+
62
+ // On Tainted Lost, it is impossible to retrieve non-offensive collectibles from pools, so we
63
+ // temporarily change the character to Isaac.
64
+ const taintedLosts = getPlayersOfType(PlayerType.THE_LOST_B);
65
+ const isOffensive = collectibleHasTag(
66
+ collectibleType,
67
+ ItemConfigTag.OFFENSIVE,
68
+ );
69
+ let changedPlayerTypes = false;
70
+ if (!isOffensive) {
71
+ changedPlayerTypes = true;
72
+ for (const player of taintedLosts) {
73
+ player.ChangePlayerType(PlayerType.ISAAC);
74
+ }
75
+ }
76
+
77
+ const [removedItemsMap, removedTrinketsMap] =
78
+ removeItemsAndTrinketsThatAffectItemPools();
79
+
80
+ // Blacklist every collectible in the game except for the provided collectible.
81
+ const itemPool = game.GetItemPool();
82
+ itemPool.ResetRoomBlacklist();
83
+ for (const collectibleTypeInSet of getCollectibleArray()) {
84
+ if (collectibleTypeInSet !== collectibleType) {
85
+ itemPool.AddRoomBlacklist(collectibleTypeInSet);
86
+ }
87
+ }
88
+
89
+ // Get a collectible from the pool and see if it is the intended collectible. (We can use any
90
+ // arbitrary value as the seed since it should not influence the result.)
91
+ const seed = 1 as Seed;
92
+ const retrievedCollectibleType = itemPool.GetCollectible(
93
+ itemPoolType,
94
+ false,
95
+ seed,
96
+ COLLECTIBLE_TYPE_THAT_IS_NOT_IN_ANY_POOLS,
97
+ );
98
+ const collectibleUnlocked = retrievedCollectibleType === collectibleType;
99
+
100
+ // Reset the blacklist
101
+ itemPool.ResetRoomBlacklist();
102
+
103
+ restoreItemsAndTrinketsThatAffectItemPools(
104
+ removedItemsMap,
105
+ removedTrinketsMap,
106
+ );
107
+
108
+ // Change any players back to Tainted Lost, if necessary.
109
+ if (changedPlayerTypes) {
110
+ for (const player of taintedLosts) {
111
+ player.ChangePlayerType(PlayerType.THE_LOST_B);
112
+ }
113
+ }
114
+
115
+ return collectibleUnlocked;
116
+ }
117
+
118
+ /**
119
+ * Before checking the item pools, remove any collectibles or trinkets that would affect the
120
+ * retrieved collectible types.
121
+ */
122
+ function removeItemsAndTrinketsThatAffectItemPools(): [
123
+ removedItemsMap: Map<PlayerIndex, CollectibleType[]>,
124
+ removedTrinketsMap: Map<PlayerIndex, TrinketType[]>,
125
+ ] {
126
+ const removedItemsMap = new Map<PlayerIndex, CollectibleType[]>();
127
+ const removedTrinketsMap = new Map<PlayerIndex, TrinketType[]>();
128
+ for (const player of getPlayers()) {
129
+ const removedItems: CollectibleType[] = [];
130
+ for (const itemToRemove of COLLECTIBLES_THAT_AFFECT_ITEM_POOLS) {
131
+ if (player.HasCollectible(itemToRemove)) {
132
+ const numCollectibles = player.GetCollectibleNum(itemToRemove);
133
+ repeat(numCollectibles, () => {
134
+ player.RemoveCollectible(itemToRemove);
135
+ removedItems.push(itemToRemove);
136
+ });
137
+ }
138
+ }
139
+
140
+ mapSetPlayer(removedItemsMap, player, removedItems);
141
+
142
+ const removedTrinkets: TrinketType[] = [];
143
+ for (const trinketToRemove of TRINKETS_THAT_AFFECT_ITEM_POOLS) {
144
+ if (player.HasTrinket(trinketToRemove)) {
145
+ const numTrinkets = player.GetTrinketMultiplier(trinketToRemove);
146
+ repeat(numTrinkets, () => {
147
+ player.TryRemoveTrinket(trinketToRemove);
148
+ removedTrinkets.push(trinketToRemove);
149
+ });
150
+ }
151
+ }
152
+
153
+ mapSetPlayer(removedTrinketsMap, player, removedTrinkets);
154
+ }
155
+
156
+ return [removedItemsMap, removedTrinketsMap];
157
+ }
158
+
159
+ function restoreItemsAndTrinketsThatAffectItemPools(
160
+ removedItemsMap: Map<PlayerIndex, CollectibleType[]>,
161
+ removedTrinketsMap: Map<PlayerIndex, TrinketType[]>,
162
+ ) {
163
+ for (const player of getPlayers()) {
164
+ const removedItems = mapGetPlayer(removedItemsMap, player);
165
+ if (removedItems !== undefined) {
166
+ for (const collectibleType of removedItems) {
167
+ player.AddCollectible(collectibleType, 0, false); // Prevent Chaos from spawning pickups
168
+ }
169
+ }
170
+
171
+ const removedTrinkets = mapGetPlayer(removedTrinketsMap, player);
172
+ if (removedTrinkets !== undefined) {
173
+ for (const trinketType of removedTrinkets) {
174
+ player.AddTrinket(trinketType, false);
175
+ }
176
+ }
177
+ }
178
+ }
@@ -1,21 +1,18 @@
1
1
  import { DoorSlot } from "isaac-typescript-definitions";
2
2
  import { game } from "../cachedClasses";
3
3
  import { getEnumValues } from "./enums";
4
- import {
5
- getNumRooms,
6
- getRooms,
7
- isDoorSlotValidAtGridIndexForRedRoom,
8
- } from "./rooms";
4
+ import { isDoorSlotValidAtGridIndexForRedRoom } from "./levelGrid";
5
+ import { getNumRooms, getRoomsInGrid } from "./rooms";
9
6
 
10
7
  export function fillLevelWithRedRooms(): void {
11
8
  const level = game.GetLevel();
12
9
 
13
- let numRooms: int;
10
+ let numRoomsInGrid: int;
14
11
  do {
15
- const rooms = getRooms();
16
- numRooms = rooms.length;
12
+ const roomsInGrid = getRoomsInGrid();
13
+ numRoomsInGrid = roomsInGrid.length;
17
14
 
18
- for (const roomDescriptor of rooms) {
15
+ for (const roomDescriptor of roomsInGrid) {
19
16
  for (const doorSlot of getEnumValues(DoorSlot)) {
20
17
  if (
21
18
  isDoorSlotValidAtGridIndexForRedRoom(
@@ -27,5 +24,5 @@ export function fillLevelWithRedRooms(): void {
27
24
  }
28
25
  }
29
26
  }
30
- } while (numRooms !== getNumRooms());
27
+ } while (numRoomsInGrid !== getNumRooms());
31
28
  }