isaacscript-common 2.0.11 → 2.0.14

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 (103) hide show
  1. package/dist/callbacks/subscriptions/postBombInitLate.d.ts +1 -1
  2. package/dist/callbacks/subscriptions/postCollectibleInitFirst.d.ts +1 -1
  3. package/dist/callbacks/subscriptions/postEffectInitLate.d.ts +1 -1
  4. package/dist/callbacks/subscriptions/postFamiliarInitLate.d.ts +1 -1
  5. package/dist/callbacks/subscriptions/postHolyMantleRemoved.d.ts +2 -2
  6. package/dist/callbacks/subscriptions/postItemDischarged.d.ts +2 -2
  7. package/dist/callbacks/subscriptions/postItemPickup.d.ts +1 -1
  8. package/dist/callbacks/subscriptions/postKnifeInitLate.d.ts +1 -1
  9. package/dist/callbacks/subscriptions/postLaserInitLate.d.ts +1 -1
  10. package/dist/callbacks/subscriptions/postNPCInitLate.d.ts +1 -1
  11. package/dist/callbacks/subscriptions/postNPCStateChanged.d.ts +1 -1
  12. package/dist/callbacks/subscriptions/postPEffectUpdateReordered.d.ts +2 -2
  13. package/dist/callbacks/subscriptions/postPickupCollect.d.ts +1 -1
  14. package/dist/callbacks/subscriptions/postPickupInitLate.d.ts +1 -1
  15. package/dist/callbacks/subscriptions/postPlayerChangeType.d.ts +1 -1
  16. package/dist/callbacks/subscriptions/postProjectileInitLate.d.ts +1 -1
  17. package/dist/callbacks/subscriptions/postPurchase.d.ts +1 -1
  18. package/dist/callbacks/subscriptions/postTearInitLate.d.ts +1 -1
  19. package/dist/callbacks/subscriptions/postTearInitVeryLate.d.ts +1 -1
  20. package/dist/callbacks/subscriptions/postTrinketBreak.d.ts +2 -2
  21. package/dist/callbacks/subscriptions/preItemPickup.d.ts +1 -1
  22. package/dist/classes/DefaultMap.d.ts +2 -1
  23. package/dist/constants.d.ts +16 -7
  24. package/dist/constants.lua +2 -2
  25. package/dist/enums/ModCallbackCustom.d.ts +0 -3
  26. package/dist/features/characterHealthConversion.d.ts +1 -1
  27. package/dist/features/characterStats.d.ts +1 -1
  28. package/dist/features/deployJSONRoom.d.ts +16 -9
  29. package/dist/features/deployJSONRoom.lua +2 -2
  30. package/dist/features/disableInputs.d.ts +6 -6
  31. package/dist/features/disableSound.d.ts +2 -2
  32. package/dist/features/extraConsoleCommands/commands.d.ts +12 -9
  33. package/dist/features/extraConsoleCommands/commands.lua +14 -0
  34. package/dist/features/extraConsoleCommands/init.lua +1 -0
  35. package/dist/features/preventCollectibleRotate.d.ts +1 -1
  36. package/dist/features/runInNFrames.d.ts +2 -1
  37. package/dist/features/saveDataManager/exports.d.ts +8 -6
  38. package/dist/features/sirenHelpers.d.ts +2 -2
  39. package/dist/functions/array.d.ts +10 -9
  40. package/dist/functions/benchmark.d.ts +1 -1
  41. package/dist/functions/boss.d.ts +3 -3
  42. package/dist/functions/cards.d.ts +10 -8
  43. package/dist/functions/character.d.ts +10 -10
  44. package/dist/functions/charge.d.ts +6 -3
  45. package/dist/functions/collectibleCacheFlag.d.ts +2 -2
  46. package/dist/functions/collectibleSet.d.ts +1 -1
  47. package/dist/functions/collectibleTag.d.ts +3 -3
  48. package/dist/functions/collectibles.d.ts +22 -19
  49. package/dist/functions/collectibles.lua +2 -1
  50. package/dist/functions/color.d.ts +1 -1
  51. package/dist/functions/deepCopy.d.ts +2 -1
  52. package/dist/functions/entity.d.ts +16 -13
  53. package/dist/functions/entity.lua +1 -1
  54. package/dist/functions/entitySpecific.d.ts +58 -49
  55. package/dist/functions/enums.d.ts +6 -5
  56. package/dist/functions/enums.lua +1 -1
  57. package/dist/functions/familiars.d.ts +5 -5
  58. package/dist/functions/familiars.lua +1 -1
  59. package/dist/functions/flag.d.ts +6 -2
  60. package/dist/functions/flying.d.ts +4 -4
  61. package/dist/functions/gridEntity.d.ts +15 -10
  62. package/dist/functions/gridEntity.lua +0 -4
  63. package/dist/functions/kColor.d.ts +1 -1
  64. package/dist/functions/level.d.ts +1 -0
  65. package/dist/functions/level.lua +29 -0
  66. package/dist/functions/log.d.ts +2 -2
  67. package/dist/functions/map.d.ts +2 -1
  68. package/dist/functions/math.d.ts +8 -1
  69. package/dist/functions/math.lua +6 -0
  70. package/dist/functions/npc.d.ts +3 -3
  71. package/dist/functions/pickups.d.ts +26 -26
  72. package/dist/functions/pills.d.ts +5 -4
  73. package/dist/functions/player.d.ts +19 -19
  74. package/dist/functions/playerIndex.d.ts +2 -1
  75. package/dist/functions/positionVelocity.d.ts +9 -5
  76. package/dist/functions/random.d.ts +7 -5
  77. package/dist/functions/rng.d.ts +1 -1
  78. package/dist/functions/rooms.d.ts +29 -5
  79. package/dist/functions/rooms.lua +56 -21
  80. package/dist/functions/run.d.ts +1 -1
  81. package/dist/functions/set.d.ts +1 -1
  82. package/dist/functions/spawnCollectible.d.ts +5 -5
  83. package/dist/functions/transformations.d.ts +4 -3
  84. package/dist/functions/trinketCacheFlag.d.ts +2 -2
  85. package/dist/functions/trinketGive.d.ts +3 -3
  86. package/dist/functions/trinketSet.d.ts +1 -1
  87. package/dist/functions/trinkets.d.ts +12 -9
  88. package/dist/functions/trinkets.lua +2 -2
  89. package/dist/functions/ui.d.ts +2 -2
  90. package/dist/functions/utils.d.ts +4 -2
  91. package/dist/functions/vector.d.ts +1 -1
  92. package/dist/index.d.ts +1 -0
  93. package/dist/index.lua +8 -0
  94. package/dist/objects/roomShapeToDoorSlots.d.ts +1 -1
  95. package/dist/objects/roomShapeToDoorSlotsToGridIndexDelta.lua +3 -3
  96. package/dist/sets/mineShaftRoomSubTypesSet.d.ts +2 -0
  97. package/dist/sets/mineShaftRoomSubTypesSet.lua +14 -0
  98. package/dist/types/CollectibleIndex.d.ts +2 -1
  99. package/dist/types/PickingUpItem.d.ts +1 -1
  100. package/dist/types/PlayerIndex.d.ts +2 -1
  101. package/dist/types/TrinketSituation.d.ts +3 -3
  102. package/dist/upgradeMod.d.ts +2 -4
  103. package/package.json +4 -3
@@ -33,7 +33,7 @@ export declare function isRedHeart(pickup: EntityPickup): boolean;
33
33
  * @param cap Optional. If specified, will only remove the given amount of cards.
34
34
  * @returns True if one or more cards were removed, false otherwise.
35
35
  */
36
- export declare function removeAllBatteries(batterySubType?: BatterySubType | int, cap?: int): boolean;
36
+ export declare function removeAllBatteries(batterySubType?: BatterySubType, cap?: int): boolean;
37
37
  /**
38
38
  * Helper function to remove all of the cards in the room.
39
39
  *
@@ -41,7 +41,7 @@ export declare function removeAllBatteries(batterySubType?: BatterySubType | int
41
41
  * @param cap Optional. If specified, will only remove the given amount of cards.
42
42
  * @returns True if one or more cards were removed, false otherwise.
43
43
  */
44
- export declare function removeAllCards(card?: Card | int, cap?: int): boolean;
44
+ export declare function removeAllCards(card?: Card, cap?: int): boolean;
45
45
  /**
46
46
  * Helper function to remove all of the coins in the room.
47
47
  *
@@ -49,16 +49,16 @@ export declare function removeAllCards(card?: Card | int, cap?: int): boolean;
49
49
  * @param cap Optional. If specified, will only remove the given amount of coins.
50
50
  * @returns True if one or more coins were removed, false otherwise.
51
51
  */
52
- export declare function removeAllCoins(coinSubType?: CoinSubType | int, cap?: int): boolean;
52
+ export declare function removeAllCoins(coinSubType?: CoinSubType, cap?: int): boolean;
53
53
  /**
54
54
  * Helper function to remove all of the collectibles in the room.
55
55
  *
56
56
  * @param collectibleType Optional. If specified, will only remove collectibles that match this
57
- * collectible type.
57
+ * collectible type.
58
58
  * @param cap Optional. If specified, will only remove the given amount of collectibles.
59
59
  * @returns True if one or more collectibles were removed, false otherwise.
60
60
  */
61
- export declare function removeAllCollectibles(collectibleType?: CollectibleType | int, cap?: int): boolean;
61
+ export declare function removeAllCollectibles(collectibleType?: CollectibleType, cap?: int): boolean;
62
62
  /**
63
63
  * Helper function to remove all of the hearts in the room.
64
64
  *
@@ -66,7 +66,7 @@ export declare function removeAllCollectibles(collectibleType?: CollectibleType
66
66
  * @param cap Optional. If specified, will only remove the given amount of hearts.
67
67
  * @returns True if one or more hearts were removed, false otherwise.
68
68
  */
69
- export declare function removeAllHearts(heartSubType?: HeartSubType | int, cap?: int): boolean;
69
+ export declare function removeAllHearts(heartSubType?: HeartSubType, cap?: int): boolean;
70
70
  /**
71
71
  * Helper function to remove all of the keys in the room.
72
72
  *
@@ -74,7 +74,7 @@ export declare function removeAllHearts(heartSubType?: HeartSubType | int, cap?:
74
74
  * @param cap Optional. If specified, will only remove the given amount of keys.
75
75
  * @returns True if one or more keys were removed, false otherwise.
76
76
  */
77
- export declare function removeAllKeys(keySubType?: KeySubType | int, cap?: int): boolean;
77
+ export declare function removeAllKeys(keySubType?: KeySubType, cap?: int): boolean;
78
78
  /**
79
79
  * Helper function to remove all of the pills in the room.
80
80
  *
@@ -90,45 +90,45 @@ export declare function removeAllPills(pillColor?: PillColor, cap?: int): boolea
90
90
  * @param cap Optional. If specified, will only remove the given amount of trinkets.
91
91
  * @returns True if one or more trinkets were removed, false otherwise.
92
92
  */
93
- export declare function removeAllSacks(sackSubType?: SackSubType | int, cap?: int): boolean;
93
+ export declare function removeAllSacks(sackSubType?: SackSubType, cap?: int): boolean;
94
94
  /**
95
95
  * Helper function to remove all of the trinkets in the room.
96
96
  *
97
97
  * @param trinketType Optional. If specified, will only remove trinkets that match this trinket
98
- * type.
98
+ * type.
99
99
  * @param cap Optional. If specified, will only remove the given amount of trinkets.
100
100
  * @returns True if one or more trinkets were removed, false otherwise.
101
101
  */
102
- export declare function removeAllTrinkets(trinketType?: TrinketType | int, cap?: int): boolean;
102
+ export declare function removeAllTrinkets(trinketType?: TrinketType, cap?: int): boolean;
103
103
  /**
104
104
  * Helper function to spawn a `EntityType.PICKUP` (5) with variant `PickupVariant.LIL_BATTERY` (90).
105
105
  */
106
- export declare function spawnBattery(subType: BatterySubType | int, position: Vector, velocity?: Readonly<Vector>, spawner?: Entity | undefined, seed?: Seed | undefined): EntityPickup;
107
- export declare function spawnBatteryWithSeed(subType: BatterySubType | int, position: Vector, seed: Seed, velocity?: Readonly<Vector>, spawner?: Entity | undefined): EntityPickup;
106
+ export declare function spawnBattery(subType: BatterySubType, position: Vector, velocity?: Readonly<Vector>, spawner?: Entity | undefined, seed?: Seed | undefined): EntityPickup;
107
+ export declare function spawnBatteryWithSeed(subType: BatterySubType, position: Vector, seed: Seed, velocity?: Readonly<Vector>, spawner?: Entity | undefined): EntityPickup;
108
108
  /**
109
109
  * Helper function to spawn a `EntityType.PICKUP` (5) with variant `PickupVariant.TAROT_CARD` (300).
110
110
  */
111
- export declare function spawnCard(subType: Card | int, position: Vector, velocity?: Readonly<Vector>, spawner?: Entity | undefined, seed?: Seed | undefined): EntityPickup;
112
- export declare function spawnCardWithSeed(subType: Card | int, position: Vector, seed: Seed, velocity?: Readonly<Vector>, spawner?: Entity | undefined): EntityPickup;
111
+ export declare function spawnCard(subType: Card, position: Vector, velocity?: Readonly<Vector>, spawner?: Entity | undefined, seed?: Seed | undefined): EntityPickup;
112
+ export declare function spawnCardWithSeed(subType: Card, position: Vector, seed: Seed, velocity?: Readonly<Vector>, spawner?: Entity | undefined): EntityPickup;
113
113
  /** Helper function to spawn a `EntityType.PICKUP` (5) with variant `PickupVariant.COIN` (20). */
114
- export declare function spawnCoin(subType: CoinSubType | int, position: Vector, velocity?: Readonly<Vector>, spawner?: Entity | undefined, seed?: Seed | undefined): EntityPickup;
115
- export declare function spawnCoinWithSeed(subType: CoinSubType | int, position: Vector, seed: Seed, velocity?: Readonly<Vector>, spawner?: Entity | undefined): EntityPickup;
114
+ export declare function spawnCoin(subType: CoinSubType, position: Vector, velocity?: Readonly<Vector>, spawner?: Entity | undefined, seed?: Seed | undefined): EntityPickup;
115
+ export declare function spawnCoinWithSeed(subType: CoinSubType, position: Vector, seed: Seed, velocity?: Readonly<Vector>, spawner?: Entity | undefined): EntityPickup;
116
116
  /** Helper function to spawn a `EntityType.PICKUP` (5) with variant `PickupVariant.HEART` (10). */
117
- export declare function spawnHeart(subType: HeartSubType | int, position: Vector, velocity?: Readonly<Vector>, spawner?: Entity | undefined, seed?: Seed | undefined): EntityPickup;
118
- export declare function spawnHeartWithSeed(subType: HeartSubType | int, position: Vector, seed: Seed, velocity?: Readonly<Vector>, spawner?: Entity | undefined): EntityPickup;
117
+ export declare function spawnHeart(subType: HeartSubType, position: Vector, velocity?: Readonly<Vector>, spawner?: Entity | undefined, seed?: Seed | undefined): EntityPickup;
118
+ export declare function spawnHeartWithSeed(subType: HeartSubType, position: Vector, seed: Seed, velocity?: Readonly<Vector>, spawner?: Entity | undefined): EntityPickup;
119
119
  /** Helper function to spawn a `EntityType.PICKUP` (5) with variant `PickupVariant.KEY` (30). */
120
- export declare function spawnKey(subType: KeySubType | int, position: Vector, velocity?: Readonly<Vector>, spawner?: Entity | undefined, seed?: Seed | undefined): EntityPickup;
121
- export declare function spawnKeyWithSeed(subType: KeySubType | int, position: Vector, seed: Seed, velocity?: Readonly<Vector>, spawner?: Entity | undefined): EntityPickup;
120
+ export declare function spawnKey(subType: KeySubType, position: Vector, velocity?: Readonly<Vector>, spawner?: Entity | undefined, seed?: Seed | undefined): EntityPickup;
121
+ export declare function spawnKeyWithSeed(subType: KeySubType, position: Vector, seed: Seed, velocity?: Readonly<Vector>, spawner?: Entity | undefined): EntityPickup;
122
122
  /** Helper function to spawn a `EntityType.PICKUP` (5) with variant `PickupVariant.PILL` (70). */
123
- export declare function spawnPill(pillColor: PillColor | int, position: Vector, velocity?: Readonly<Vector>, spawner?: Entity | undefined, seed?: Seed | undefined): EntityPickup;
124
- export declare function spawnPillWithSeed(subType: PillColor | int, position: Vector, seed: Seed, velocity?: Readonly<Vector>, spawner?: Entity | undefined): EntityPickup;
123
+ export declare function spawnPill(pillColor: PillColor, position: Vector, velocity?: Readonly<Vector>, spawner?: Entity | undefined, seed?: Seed | undefined): EntityPickup;
124
+ export declare function spawnPillWithSeed(subType: PillColor, position: Vector, seed: Seed, velocity?: Readonly<Vector>, spawner?: Entity | undefined): EntityPickup;
125
125
  /**
126
126
  * Helper function to spawn a `EntityType.PICKUP` (5) with variant `PickupVariant.GRAB_BAG` (69).
127
127
  */
128
- export declare function spawnSack(subType: SackSubType | int, position: Vector, velocity?: Readonly<Vector>, spawner?: Entity | undefined, seed?: Seed | undefined): EntityPickup;
129
- export declare function spawnSackWithSeed(subType: SackSubType | int, position: Vector, seed: Seed, velocity?: Readonly<Vector>, spawner?: Entity | undefined): EntityPickup;
128
+ export declare function spawnSack(subType: SackSubType, position: Vector, velocity?: Readonly<Vector>, spawner?: Entity | undefined, seed?: Seed | undefined): EntityPickup;
129
+ export declare function spawnSackWithSeed(subType: SackSubType, position: Vector, seed: Seed, velocity?: Readonly<Vector>, spawner?: Entity | undefined): EntityPickup;
130
130
  /**
131
131
  * Helper function to spawn a `EntityType.PICKUP` (5) with variant `PickupVariant.TRINKET` (350).
132
132
  */
133
- export declare function spawnTrinket(subType: TrinketType | int, position: Vector, velocity?: Readonly<Vector>, spawner?: Entity | undefined, seed?: Seed | undefined): EntityPickup;
134
- export declare function spawnTrinketWithSeed(subType: TrinketType | int, position: Vector, seed: Seed, velocity?: Readonly<Vector>, spawner?: Entity | undefined): EntityPickup;
133
+ export declare function spawnTrinket(subType: TrinketType, position: Vector, velocity?: Readonly<Vector>, spawner?: Entity | undefined, seed?: Seed | undefined): EntityPickup;
134
+ export declare function spawnTrinketWithSeed(subType: TrinketType, position: Vector, seed: Seed, velocity?: Readonly<Vector>, spawner?: Entity | undefined): EntityPickup;
@@ -23,17 +23,18 @@ export declare function getNormalPillColorFromHorse(pillColor: PillColor): PillC
23
23
  * Due to limitations in the API, this function will not work properly for modded pill effects, and
24
24
  * will always return `DEFAULT_PILL_EFFECT_CLASS` in those cases.
25
25
  */
26
- export declare function getPillEffectClass(pillEffect: PillEffect | int): ItemConfigPillEffectClass;
26
+ export declare function getPillEffectClass(pillEffect: PillEffect): ItemConfigPillEffectClass;
27
27
  /**
28
28
  * Helper function to get a pill effect name from a PillEffect enum value.
29
29
  *
30
- * Example:
30
+ * For example:
31
+ *
31
32
  * ```ts
32
33
  * const pillEffect = PillEffect.BAD_GAS;
33
34
  * const pillEffectName = getPillEffectName(pillEffect); // trinketName is "Bad Gas"
34
35
  * ```
35
36
  */
36
- export declare function getPillEffectName(pillEffect: PillEffect | int): string;
37
+ export declare function getPillEffectName(pillEffect: PillEffect): string;
37
38
  /**
38
39
  * Helper function to get a pill effect type from a PillEffect enum value. In this context, the type
39
40
  * is equal to positive, negative, or neutral. This is derived from the suffix of the the "class"
@@ -43,5 +44,5 @@ export declare function getPillEffectName(pillEffect: PillEffect | int): string;
43
44
  * Due to limitations in the API, this function will not work properly for modded pill effects, and
44
45
  * will always return `DEFAULT_PILL_EFFECT_TYPE` in those cases.
45
46
  */
46
- export declare function getPillEffectType(pillEffect: PillEffect | int): ItemConfigPillEffectType;
47
+ export declare function getPillEffectType(pillEffect: PillEffect): ItemConfigPillEffectType;
47
48
  export declare function isHorsePill(pillColor: PillColor): boolean;
@@ -1,6 +1,6 @@
1
1
  import { ActiveSlot, CacheFlag, CollectibleType, PlayerType, TrinketType } from "isaac-typescript-definitions";
2
2
  import { HealthType } from "../enums/HealthType";
3
- export declare function addCollectibleCostume(player: EntityPlayer, collectibleType: CollectibleType | int): void;
3
+ export declare function addCollectibleCostume(player: EntityPlayer, collectibleType: CollectibleType): void;
4
4
  /**
5
5
  * Helper function to add a stat to a player based on the `CacheFlag` provided. Call this function
6
6
  * from the EvaluateCache callback.
@@ -17,18 +17,18 @@ export declare function addCollectibleCostume(player: EntityPlayer, collectibleT
17
17
  * - CacheFlag.LUCK (1 << 10)
18
18
  */
19
19
  export declare function addStat(player: EntityPlayer, cacheFlag: CacheFlag, amount: number): void;
20
- export declare function addTrinketCostume(player: EntityPlayer, trinketType: TrinketType | int): void;
21
- export declare function anyPlayerHasCollectible(collectibleType: CollectibleType | int): boolean;
22
- export declare function anyPlayerHasTrinket(trinketType: TrinketType | int): boolean;
20
+ export declare function addTrinketCostume(player: EntityPlayer, trinketType: TrinketType): void;
21
+ export declare function anyPlayerHasCollectible(collectibleType: CollectibleType): boolean;
22
+ export declare function anyPlayerHasTrinket(trinketType: TrinketType): boolean;
23
23
  /**
24
24
  * Helper function to determine if the given character is present.
25
25
  *
26
26
  * This function is variadic, meaning that you can supply as many characters as you want to check
27
27
  * for. Returns true if any of the characters supplied are present.
28
28
  */
29
- export declare function anyPlayerIs(...matchingCharacters: Array<PlayerType | int>): boolean;
29
+ export declare function anyPlayerIs(...matchingCharacters: PlayerType[]): boolean;
30
30
  /**
31
- * Helper function to determine if a player will destroy a rock/pot/skull/etc. if they walk over it.
31
+ * Helper function to determine if a player will destroy a rock/pot/skull if they walk over it.
32
32
  *
33
33
  * The following situations allow for this to be true:
34
34
  * - the player has Leo (collectible 302)
@@ -41,7 +41,7 @@ export declare function canPlayerCrushRocks(player: EntityPlayer): boolean;
41
41
  * Helper function to find the active slot that the player has the corresponding collectible type
42
42
  * in. Returns undefined if the player does not have the collectible in any active slot.
43
43
  */
44
- export declare function getActiveItemSlot(player: EntityPlayer, collectibleType: CollectibleType | int): ActiveSlot | undefined;
44
+ export declare function getActiveItemSlot(player: EntityPlayer, collectibleType: CollectibleType): ActiveSlot | undefined;
45
45
  /**
46
46
  * Helper function to get how long Azazel's Brimstone laser should be. You can pass either an
47
47
  * `EntityPlayer` object or a tear height stat.
@@ -94,12 +94,12 @@ export declare function getPlayerCloserThan(position: Vector, distance: float):
94
94
  *
95
95
  * This function is variadic, meaning that you can specify N collectible types.
96
96
  */
97
- export declare function getPlayerCollectibleCount(player: EntityPlayer, ...collectibleTypes: Array<CollectibleType | int>): int;
97
+ export declare function getPlayerCollectibleCount(player: EntityPlayer, ...collectibleTypes: CollectibleType[]): int;
98
98
  /**
99
99
  * Iterates over every item in the game and returns a map containing the number of each item that
100
100
  * the player has.
101
101
  */
102
- export declare function getPlayerCollectibleMap(player: EntityPlayer): Map<CollectibleType | int, int>;
102
+ export declare function getPlayerCollectibleMap(player: EntityPlayer): Map<CollectibleType, int>;
103
103
  /**
104
104
  * Returns the number of red hearts that the player has, excluding any rotten hearts. For example,
105
105
  * if the player has one full black heart, one full soul heart, and one half black heart, this
@@ -152,14 +152,14 @@ export declare function getPlayerSoulHearts(player: EntityPlayer): int;
152
152
  * This function is variadic, meaning that you can supply as many characters as you want to check
153
153
  * for. Returns true if any of the characters supplied are present.
154
154
  */
155
- export declare function getPlayersOfType(...characters: Array<PlayerType | int>): EntityPlayer[];
155
+ export declare function getPlayersOfType(...characters: PlayerType[]): EntityPlayer[];
156
156
  /**
157
157
  * Helper function to get only the players that have a certain collectible.
158
158
  *
159
159
  * This function is variadic, meaning that you can supply as many collectible types as you want to
160
160
  * check for. It only returns the players that have all of the collectibles.
161
161
  */
162
- export declare function getPlayersWithCollectible(...collectibleTypes: Array<CollectibleType | int>): EntityPlayer[];
162
+ export declare function getPlayersWithCollectible(...collectibleTypes: CollectibleType[]): EntityPlayer[];
163
163
  /**
164
164
  * Helper function to determine how many heart containers that Tainted Magdalene has that will not
165
165
  * be automatically depleted over time. By default, this is 2, but this function will return 4 so
@@ -175,7 +175,7 @@ export declare function getTaintedMagdaleneNonTemporaryMaxHearts(player: EntityP
175
175
  * Returns the total number of collectibles amongst all players. For example, if player 1 has 1 Sad
176
176
  * Onion and player 2 has 2 Sad Onions, then this function would return 3.
177
177
  */
178
- export declare function getTotalPlayerCollectibles(collectibleType: CollectibleType | int): int;
178
+ export declare function getTotalPlayerCollectibles(collectibleType: CollectibleType): int;
179
179
  /** After touching a white fire, a player will turn into The Lost until they clear a room. */
180
180
  export declare function hasLostCurse(player: EntityPlayer): boolean;
181
181
  /**
@@ -199,7 +199,7 @@ export declare function isBethany(player: EntityPlayer): boolean;
199
199
  * This function is variadic, meaning that you can supply as many characters as you want to check
200
200
  * for. Returns true if the player is any of the supplied characters.
201
201
  */
202
- export declare function isCharacter(player: EntityPlayer, ...characters: Array<PlayerType | int>): boolean;
202
+ export declare function isCharacter(player: EntityPlayer, ...characters: PlayerType[]): boolean;
203
203
  /**
204
204
  * Helper function for detecting when a player is Eden or Tainted Eden. Useful for situations where
205
205
  * you want to know if the starting stats were randomized, for example.
@@ -230,19 +230,19 @@ export declare function isVanillaPlayer(player: EntityPlayer): boolean;
230
230
  * This function is variadic, meaning that you can supply as many collectible types as you want to
231
231
  * add.
232
232
  */
233
- export declare function playerAddCollectible(player: EntityPlayer, ...collectibleTypes: Array<CollectibleType | int>): void;
233
+ export declare function playerAddCollectible(player: EntityPlayer, ...collectibleTypes: CollectibleType[]): void;
234
234
  /**
235
235
  * Helper function to check to see if a player has one or more collectibles.
236
236
  *
237
237
  * This function is variadic, meaning that you can supply as many collectible types as you want to
238
238
  * check for. Returns true if the player has any of the supplied collectible types.
239
239
  */
240
- export declare function playerHasCollectible(player: EntityPlayer, ...collectibleTypes: Array<CollectibleType | int>): boolean;
240
+ export declare function playerHasCollectible(player: EntityPlayer, ...collectibleTypes: CollectibleType[]): boolean;
241
241
  /**
242
242
  * Helper function to remove a collectible costume from a player. Use this helper function to avoid
243
243
  * having to request the collectible from the item config.
244
244
  */
245
- export declare function removeCollectibleCostume(player: EntityPlayer, collectibleType: CollectibleType | int): void;
245
+ export declare function removeCollectibleCostume(player: EntityPlayer, collectibleType: CollectibleType): void;
246
246
  /**
247
247
  * Helper function to remove the Dead Eye multiplier from a player.
248
248
  *
@@ -254,7 +254,7 @@ export declare function removeDeadEyeMultiplier(player: EntityPlayer): void;
254
254
  * Helper function to remove a trinket costume from a player. Use this helper function to avoid
255
255
  * having to request the trinket from the item config.
256
256
  */
257
- export declare function removeTrinketCostume(player: EntityPlayer, trinketType: TrinketType | int): void;
257
+ export declare function removeTrinketCostume(player: EntityPlayer, trinketType: TrinketType): void;
258
258
  /**
259
259
  * Helper function to set an active collectible to a particular slot. This has different behavior
260
260
  * than calling the `player.AddCollectible` method with the `activeSlot` argument, because this
@@ -268,7 +268,7 @@ export declare function removeTrinketCostume(player: EntityPlayer, trinketType:
268
268
  * @param collectibleType The collectible type of the item to give.
269
269
  * @param activeSlot The slot to set.
270
270
  * @param charge Optional. The argument of charges to set. If not specified, the item will be set
271
- * with maximum charges.
271
+ * with maximum charges.
272
272
  * @param keepInPools Optional. Whether or not to remove the item from pools. Default is false.
273
273
  */
274
274
  export declare function setActiveItem(player: EntityPlayer, collectibleType: CollectibleType, activeSlot: ActiveSlot, charge?: int, keepInPools?: boolean): void;
@@ -286,4 +286,4 @@ export declare function setBlindfold(player: EntityPlayer, enabled: boolean, mod
286
286
  * Helper function to use an active item without showing an animation, keeping the item, or adding
287
287
  * any costumes.
288
288
  */
289
- export declare function useActiveItemTemp(player: EntityPlayer, collectibleType: CollectibleType | int): void;
289
+ export declare function useActiveItemTemp(player: EntityPlayer, collectibleType: CollectibleType): void;
@@ -51,7 +51,8 @@ export declare function getPlayerIndexVanilla(playerToFind: EntityPlayer): int |
51
51
  * If this is not desired, use the `getAllPlayers` helper function instead.
52
52
  *
53
53
  * @param performCharacterExclusions Whether or not to exclude characters that are not directly
54
- * controlled by the player (i.e. Esau & Tainted Soul). Default is false.
54
+ * controlled by the player (i.e. Esau & Tainted Soul). Default is
55
+ * false.
55
56
  */
56
57
  export declare function getPlayers(performCharacterExclusions?: boolean): EntityPlayer[];
57
58
  /**
@@ -10,7 +10,7 @@ export declare function anyPlayerCloserThan(position: Vector, distance: float):
10
10
  * specific situations.
11
11
  *
12
12
  * @param startingPosition The position to start searching from. If this position is not overlapping
13
- * with anything, then it will be returned.
13
+ * with anything, then it will be returned.
14
14
  * @param avoidActiveEntities Optional. Default is false.
15
15
  */
16
16
  export declare function findFreePosition(startingPosition: Vector, avoidActiveEntities?: boolean): Vector;
@@ -20,7 +20,8 @@ export declare function findFreePosition(startingPosition: Vector, avoidActiveEn
20
20
  * This is useful for rewinding entity positions at a later time. Also see `setEntityPositions`.
21
21
  *
22
22
  * @param entities Optional. If provided, will only get the positions of the provided entities. Use
23
- * this with cached entities to avoid invoking the `Isaac.GetRoomEntities` method multiple times.
23
+ * this with cached entities to avoid invoking the `Isaac.GetRoomEntities` method
24
+ * multiple times.
24
25
  */
25
26
  export declare function getEntityPositions(entities?: Entity[]): Map<PtrHash, Vector>;
26
27
  /**
@@ -29,7 +30,8 @@ export declare function getEntityPositions(entities?: Entity[]): Map<PtrHash, Ve
29
30
  * This is useful for rewinding entity velocities at a later time. Also see `setEntityVelocities`.
30
31
  *
31
32
  * @param entities Optional. If provided, will only get the velocities of the provided entities. Use
32
- * this with cached entities to avoid invoking the `Isaac.GetRoomEntities` method multiple times.
33
+ * this with cached entities to avoid invoking the `Isaac.GetRoomEntities` method
34
+ * multiple times.
33
35
  */
34
36
  export declare function getEntityVelocities(entities?: Entity[]): Map<PtrHash, Vector>;
35
37
  /**
@@ -42,7 +44,8 @@ export declare function getEntityVelocities(entities?: Entity[]): Map<PtrHash, V
42
44
  *
43
45
  * @param entityPositions The map providing the positions for every entity.
44
46
  * @param entities Optional. If provided, will only set the positions of the provided entities. Use
45
- * this with cached entities to avoid invoking the `Isaac.GetRoomEntities` method multiple times.
47
+ * this with cached entities to avoid invoking the `Isaac.GetRoomEntities` method
48
+ * multiple times.
46
49
  */
47
50
  export declare function setEntityPositions(entityPositions: Map<PtrHash, Vector>, entities?: Entity[]): void;
48
51
  /**
@@ -55,6 +58,7 @@ export declare function setEntityPositions(entityPositions: Map<PtrHash, Vector>
55
58
  *
56
59
  * @param entityVelocities The map providing the velocities for every entity.
57
60
  * @param entities Optional. If provided, will only set the velocities of the provided entities. Use
58
- * this with cached entities to avoid invoking the `Isaac.GetRoomEntities` method multiple times.
61
+ * this with cached entities to avoid invoking the `Isaac.GetRoomEntities` method
62
+ * multiple times.
59
63
  */
60
64
  export declare function setEntityVelocities(entityVelocities: Map<PtrHash, Vector>, entities?: Entity[]): void;
@@ -4,13 +4,14 @@
4
4
  * high end. (This is because the `RNG.RandomFloat` method will never return a value of exactly 1.)
5
5
  *
6
6
  * @param seedOrRNG Optional. The `Seed` or `RNG` object to use. If an `RNG` object is provided, the
7
- * `RNG.Next` method will be called. Default is `getRandomSeed()`.
7
+ * `RNG.Next` method will be called. Default is `getRandomSeed()`.
8
8
  */
9
9
  export declare function getRandom(seedOrRNG?: Seed | RNG): float;
10
10
  /**
11
11
  * This returns a random float between min and max.
12
12
  *
13
- * Example:
13
+ * For example:
14
+ *
14
15
  * ```ts
15
16
  * const realNumberBetweenOneAndThree = getRandomFloat(1, 3);
16
17
  * ```
@@ -18,7 +19,7 @@ export declare function getRandom(seedOrRNG?: Seed | RNG): float;
18
19
  * @param min The lower bound for the random number (inclusive).
19
20
  * @param max The upper bound for the random number (exclusive).
20
21
  * @param seedOrRNG Optional. The `Seed` or `RNG` object to use. If an `RNG` object is provided, the
21
- * `RNG.Next` method will be called. Default is `getRandomSeed()`.
22
+ * `RNG.Next` method will be called. Default is `getRandomSeed()`.
22
23
  */
23
24
  export declare function getRandomFloat(min: int, max: int, seedOrRNG?: Seed | RNG): float;
24
25
  /**
@@ -27,7 +28,8 @@ export declare function getRandomFloat(min: int, max: int, seedOrRNG?: Seed | RN
27
28
  * Note that this function will invoke the `Next` method on the `RNG` object before returning the
28
29
  * random number.
29
30
  *
30
- * Example:
31
+ * For example:
32
+ *
31
33
  * ```ts
32
34
  * const oneTwoOrThree = getRandomInt(1, 3);
33
35
  * ```
@@ -35,6 +37,6 @@ export declare function getRandomFloat(min: int, max: int, seedOrRNG?: Seed | RN
35
37
  * @param min The lower bound for the random number (inclusive).
36
38
  * @param max The upper bound for the random number (inclusive).
37
39
  * @param seedOrRNG Optional. The `Seed` or `RNG` object to use. If an `RNG` object is provided, the
38
- * `RNG.Next` method will be called. Default is `getRandomSeed()`.
40
+ * `RNG.Next` method will be called. Default is `getRandomSeed()`.
39
41
  */
40
42
  export declare function getRandomInt(min: int, max: int, seedOrRNG?: Seed | RNG): int;
@@ -13,7 +13,7 @@ interface CopyRNGReturn {
13
13
  * Helper function to copy an `RNG` object.
14
14
  *
15
15
  * @param rng The RNG object to copy. In the case of deserialization, this will actually be a Lua
16
- * table instead of an instantiated RNG class.
16
+ * table instead of an instantiated RNG class.
17
17
  * @param serializationType Default is `SerializationType.NONE`.
18
18
  */
19
19
  export declare function copyRNG<R extends RNG | SerializedRNG, S extends SerializationType>(rng: R, serializationType: S): CopyRNGReturn[S];
@@ -1,4 +1,4 @@
1
- import { BossID, Dimension, Direction, DoorSlot, ItemPoolType, MinibossID, RoomTransitionAnim, RoomType } from "isaac-typescript-definitions";
1
+ import { BossID, Dimension, Direction, DoorSlot, ItemPoolType, MinibossID, RoomShape, RoomTransitionAnim, RoomType } from "isaac-typescript-definitions";
2
2
  /**
3
3
  * Helper function for quickly switching to a new room without playing a particular animation. Use
4
4
  * this helper function over invoking the `Game.ChangeRoom` method directly to ensure that you do
@@ -14,6 +14,11 @@ export declare function getAllRoomGridIndexes(): int[];
14
14
  * tricky to properly detect.
15
15
  */
16
16
  export declare function getCurrentDimension(): Dimension;
17
+ /**
18
+ * Helper function to get the number of rooms that are currently on the floor layout. This does not
19
+ * include off-grid rooms, like the Devil Room.
20
+ */
21
+ export declare function getNumRooms(): int;
17
22
  /**
18
23
  * Helper function to get an array of all of the safe grid indexes for rooms that match the
19
24
  * specified room type.
@@ -29,6 +34,13 @@ export declare function getRoomGridIndexesForType(...roomTypes: RoomType[]): int
29
34
  * `ItemPoolType.ItemPoolType.POOL_ANGEL` if you are in an Angel Room.
30
35
  */
31
36
  export declare function getRoomItemPoolType(): ItemPoolType;
37
+ /**
38
+ * Helper function to get the grid indexes of all the rooms connected to the given room index.
39
+ *
40
+ * @param roomGridIndex Optional. Default is the current room index.
41
+ */
42
+ export declare function getRoomNeighbors(roomGridIndex?: int): int[];
43
+ export declare function getRoomShapeNeighborGridIndexDeltas(roomShape: RoomShape): int[];
32
44
  /**
33
45
  * Helper function to get the proper name of a room type.
34
46
  *
@@ -41,8 +53,9 @@ export declare function getRoomTypeName(roomType: RoomType): string;
41
53
  * the list.
42
54
  *
43
55
  * @param includeExtraDimensionalRooms Optional. On some floors (e.g. Downpour 2, Mines 2),
44
- * extra-dimensional rooms are automatically be generated and can be seen when you iterate over the
45
- * `RoomList`. Default is false.
56
+ * extra-dimensional rooms are automatically be generated and
57
+ * can be seen when you iterate over the `RoomList`. Default is
58
+ * false.
46
59
  */
47
60
  export declare function getRooms(includeExtraDimensionalRooms?: boolean): RoomDescriptor[];
48
61
  /**
@@ -88,6 +101,11 @@ export declare function inGenesisRoom(): boolean;
88
101
  /** Helper function to determine if the current room shape is one of the four L room shapes. */
89
102
  export declare function inLRoom(): boolean;
90
103
  export declare function inMegaSatanRoom(): boolean;
104
+ /**
105
+ * Helper function to determine if the current room is part of the Repentance "escape sequence" in
106
+ * the Mines/Ashpit.
107
+ */
108
+ export declare function inMineShaft(): boolean;
91
109
  /**
92
110
  * Helper function to check if the current room is a miniboss room for a particular miniboss. This
93
111
  * will only work for mini-bosses that have dedicated boss rooms in the "00.special rooms.stb" file.
@@ -113,8 +131,8 @@ export declare function inStartingRoom(): boolean;
113
131
  * This function will only check rooms in the current dimension.
114
132
  *
115
133
  * @param onlyCheckRoomTypes Optional. A whitelist of room types. If specified, room types not in
116
- * the array will be ignored. If not specified, then all rooms will be checked. Undefined by
117
- * default.
134
+ * the array will be ignored. If not specified, then all rooms will be
135
+ * checked. Undefined by default.
118
136
  */
119
137
  export declare function isAllRoomsClear(onlyCheckRoomTypes?: RoomType[]): boolean;
120
138
  export declare function isDoorSlotValidAtGridIndex(doorSlot: DoorSlot, roomGridIndex: int): boolean;
@@ -135,6 +153,12 @@ export declare function isRedKeyRoom(roomGridIndex?: int): boolean;
135
153
  export declare function isRoomInsideMap(roomGridIndex?: int): boolean;
136
154
  /** Helper function to check if a room exists at the given room grid index. */
137
155
  export declare function roomExists(roomGridIndex: int): boolean;
156
+ /**
157
+ * Helper function to get the coordinates of a given grid index. The floor is represented by a 13x13
158
+ * grid. For example, since the starting room is in the center, the starting room grid index of 84
159
+ * be equal to coordinates of (?, ?).
160
+ */
161
+ export declare function roomGridIndexToXY(roomGridIndex: int): [x: int, y: int];
138
162
  /**
139
163
  * If the `Room.Update` method is called in a PostNewRoom callback, then some entities will slide
140
164
  * around (such as the player). Since those entity velocities are already at zero, setting them to
@@ -3,8 +3,8 @@ local __TS__ArrayMap = ____lualib.__TS__ArrayMap
3
3
  local Set = ____lualib.Set
4
4
  local __TS__New = ____lualib.__TS__New
5
5
  local __TS__ArrayFilter = ____lualib.__TS__ArrayFilter
6
- local Map = ____lualib.Map
7
6
  local __TS__Spread = ____lualib.__TS__Spread
7
+ local Map = ____lualib.Map
8
8
  local __TS__StringIncludes = ____lualib.__TS__StringIncludes
9
9
  local __TS__ArrayEvery = ____lualib.__TS__ArrayEvery
10
10
  local ____exports = {}
@@ -25,11 +25,16 @@ local ____cachedClasses = require("cachedClasses")
25
25
  local game = ____cachedClasses.game
26
26
  local sfxManager = ____cachedClasses.sfxManager
27
27
  local ____constants = require("constants")
28
- local MAX_ROOM_INDEX = ____constants.MAX_ROOM_INDEX
28
+ local LEVEL_GRID_ROW_WIDTH = ____constants.LEVEL_GRID_ROW_WIDTH
29
+ local MAX_LEVEL_GRID_INDEX = ____constants.MAX_LEVEL_GRID_INDEX
29
30
  local NUM_DIMENSIONS = ____constants.NUM_DIMENSIONS
31
+ local ____roomShapeToDoorSlotsToGridIndexDelta = require("objects.roomShapeToDoorSlotsToGridIndexDelta")
32
+ local ROOM_SHAPE_TO_DOOR_SLOTS_TO_GRID_INDEX_DELTA = ____roomShapeToDoorSlotsToGridIndexDelta.ROOM_SHAPE_TO_DOOR_SLOTS_TO_GRID_INDEX_DELTA
30
33
  local ____roomTypeNames = require("objects.roomTypeNames")
31
34
  local DEFAULT_ROOM_TYPE_NAME = ____roomTypeNames.DEFAULT_ROOM_TYPE_NAME
32
35
  local ROOM_TYPE_NAMES = ____roomTypeNames.ROOM_TYPE_NAMES
36
+ local ____mineShaftRoomSubTypesSet = require("sets.mineShaftRoomSubTypesSet")
37
+ local MINE_SHAFT_ROOM_SUB_TYPE_SET = ____mineShaftRoomSubTypesSet.MINE_SHAFT_ROOM_SUB_TYPE_SET
33
38
  local ____doors = require("functions.doors")
34
39
  local closeAllDoors = ____doors.closeAllDoors
35
40
  local getDoors = ____doors.getDoors
@@ -58,6 +63,10 @@ local ____roomShape = require("functions.roomShape")
58
63
  local getGridIndexDelta = ____roomShape.getGridIndexDelta
59
64
  local ____utils = require("functions.utils")
60
65
  local erange = ____utils.erange
66
+ local irange = ____utils.irange
67
+ function ____exports.getRoomShapeNeighborGridIndexDeltas(self, roomShape)
68
+ return {__TS__Spread(ROOM_SHAPE_TO_DOOR_SLOTS_TO_GRID_INDEX_DELTA[roomShape]:values())}
69
+ end
61
70
  function ____exports.getRooms(self, includeExtraDimensionalRooms)
62
71
  if includeExtraDimensionalRooms == nil then
63
72
  includeExtraDimensionalRooms = false
@@ -77,14 +86,10 @@ function ____exports.getRooms(self, includeExtraDimensionalRooms)
77
86
  end
78
87
  end
79
88
  else
80
- do
81
- local i = 0
82
- while i <= MAX_ROOM_INDEX do
83
- local roomDescriptor = level:GetRoomByIdx(i)
84
- if roomDescriptor.Data ~= nil then
85
- roomsMap:set(roomDescriptor.ListIndex, roomDescriptor)
86
- end
87
- i = i + 1
89
+ for ____, roomGridIndex in ipairs(irange(nil, MAX_LEVEL_GRID_INDEX)) do
90
+ local roomDescriptor = level:GetRoomByIdx(roomGridIndex)
91
+ if roomDescriptor.Data ~= nil then
92
+ roomsMap:set(roomDescriptor.ListIndex, roomDescriptor)
88
93
  end
89
94
  end
90
95
  end
@@ -132,6 +137,10 @@ function ____exports.getCurrentDimension(self)
132
137
  end
133
138
  return error("Failed to get the current dimension using the starting room index of: " .. tostring(startingRoomGridIndex))
134
139
  end
140
+ function ____exports.getNumRooms(self)
141
+ local rooms = ____exports.getRooms(nil)
142
+ return #rooms
143
+ end
135
144
  function ____exports.getRoomGridIndexesForType(self, ...)
136
145
  local roomTypesSet = __TS__New(Set, {...})
137
146
  local rooms = ____exports.getRooms(nil)
@@ -151,6 +160,26 @@ function ____exports.getRoomItemPoolType(self)
151
160
  local roomSeed = room:GetSpawnSeed()
152
161
  return itemPool:GetPoolForRoom(roomType, roomSeed)
153
162
  end
163
+ function ____exports.getRoomNeighbors(self, roomGridIndex)
164
+ local roomDescriptor = getRoomDescriptor(nil, roomGridIndex)
165
+ if roomDescriptor.SafeGridIndex < 0 or roomDescriptor.SafeGridIndex > MAX_LEVEL_GRID_INDEX then
166
+ return {}
167
+ end
168
+ local roomData = roomDescriptor.Data
169
+ if roomData == nil then
170
+ return {}
171
+ end
172
+ local roomShape = roomData.Shape
173
+ local gridIndexDeltas = ____exports.getRoomShapeNeighborGridIndexDeltas(nil, roomShape)
174
+ local gridIndexes = __TS__ArrayMap(
175
+ gridIndexDeltas,
176
+ function(____, gridIndexDelta) return roomDescriptor.SafeGridIndex + gridIndexDelta end
177
+ )
178
+ return __TS__ArrayFilter(
179
+ gridIndexes,
180
+ function(____, gridIndex) return ____exports.roomExists(nil, gridIndex) end
181
+ )
182
+ end
154
183
  function ____exports.getRoomTypeName(self, roomType)
155
184
  local roomTypeName = ROOM_TYPE_NAMES[roomType]
156
185
  return roomTypeName == nil and DEFAULT_ROOM_TYPE_NAME or roomTypeName
@@ -158,14 +187,10 @@ end
158
187
  function ____exports.getRoomsOfDimension(self, dimension)
159
188
  local level = game:GetLevel()
160
189
  local roomsMap = __TS__New(Map)
161
- do
162
- local i = 0
163
- while i <= MAX_ROOM_INDEX do
164
- local roomDescriptor = level:GetRoomByIdx(i, dimension)
165
- if roomDescriptor.Data ~= nil then
166
- roomsMap:set(roomDescriptor.ListIndex, roomDescriptor)
167
- end
168
- i = i + 1
190
+ for ____, roomGridIndex in ipairs(irange(nil, MAX_LEVEL_GRID_INDEX)) do
191
+ local roomDescriptor = level:GetRoomByIdx(roomGridIndex, dimension)
192
+ if roomDescriptor.Data ~= nil then
193
+ roomsMap:set(roomDescriptor.ListIndex, roomDescriptor)
169
194
  end
170
195
  end
171
196
  return {__TS__Spread(roomsMap:values())}
@@ -226,6 +251,11 @@ function ____exports.inMegaSatanRoom(self)
226
251
  local roomGridIndex = getRoomGridIndex(nil)
227
252
  return roomGridIndex == GridRoom.MEGA_SATAN
228
253
  end
254
+ function ____exports.inMineShaft(self)
255
+ local roomStageID = getRoomStageID(nil)
256
+ local roomSubType = getRoomSubType(nil)
257
+ return (roomStageID == StageID.MINES or roomStageID == StageID.ASHPIT) and MINE_SHAFT_ROOM_SUB_TYPE_SET:has(roomSubType)
258
+ end
229
259
  function ____exports.inMinibossRoomOf(self, minibossID)
230
260
  local room = game:GetRoom()
231
261
  local roomType = room:GetType()
@@ -279,7 +309,7 @@ function ____exports.isDoorSlotValidAtGridIndexForRedRoom(self, doorSlot, roomGr
279
309
  return false
280
310
  end
281
311
  local redRoomGridIndex = roomGridIndex + delta
282
- return not ____exports.roomExists(nil, redRoomGridIndex)
312
+ return not ____exports.roomExists(nil, redRoomGridIndex) and redRoomGridIndex >= 0 and redRoomGridIndex <= MAX_LEVEL_GRID_INDEX
283
313
  end
284
314
  function ____exports.isRedKeyRoom(self, roomGridIndex)
285
315
  local roomDescriptor = getRoomDescriptor(nil, roomGridIndex)
@@ -291,6 +321,11 @@ function ____exports.isRoomInsideMap(self, roomGridIndex)
291
321
  end
292
322
  return roomGridIndex >= 0
293
323
  end
324
+ function ____exports.roomGridIndexToXY(self, roomGridIndex)
325
+ local x = roomGridIndex % LEVEL_GRID_ROW_WIDTH
326
+ local y = math.floor(roomGridIndex / LEVEL_GRID_ROW_WIDTH)
327
+ return {x, y}
328
+ end
294
329
  function ____exports.roomUpdateSafe(self)
295
330
  local room = game:GetRoom()
296
331
  local entities = getEntities(nil)
@@ -310,12 +345,12 @@ function ____exports.setRoomCleared(self)
310
345
  for ____, door in ipairs(getDoors(nil)) do
311
346
  do
312
347
  if isHiddenSecretRoomDoor(nil, door) then
313
- goto __continue56
348
+ goto __continue67
314
349
  end
315
350
  openDoorFast(nil, door)
316
351
  door.ExtraVisible = false
317
352
  end
318
- ::__continue56::
353
+ ::__continue67::
319
354
  end
320
355
  sfxManager:Stop(SoundEffect.DOOR_HEAVY_OPEN)
321
356
  game:ShakeScreen(0)
@@ -9,4 +9,4 @@ export declare function onSetSeed(): boolean;
9
9
  * Helper function to restart the game using the console command of "restart". You can optionally
10
10
  * specify a `PlayerType` to restart the game as that character.
11
11
  */
12
- export declare function restart(character?: PlayerType | int): void;
12
+ export declare function restart(character?: PlayerType): void;