isaacscript-common 21.4.0 → 21.5.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.
Files changed (72) hide show
  1. package/dist/index.d.ts +186 -3766
  2. package/dist/isaacscript-common.lua +1055 -973
  3. package/dist/src/classes/ModFeature.d.ts +2 -2
  4. package/dist/src/classes/ModFeature.d.ts.map +1 -1
  5. package/dist/src/classes/{ModUpgradedBase.d.ts → ModUpgraded.d.ts} +20 -32
  6. package/dist/src/classes/ModUpgraded.d.ts.map +1 -0
  7. package/dist/src/classes/{ModUpgradedBase.lua → ModUpgraded.lua} +30 -29
  8. package/dist/src/classes/features/other/DebugDisplay.lua +2 -2
  9. package/dist/src/classes/features/other/ExtraConsoleCommands.lua +2 -2
  10. package/dist/src/classes/features/other/extraConsoleCommands/commands.d.ts.map +1 -1
  11. package/dist/src/classes/features/other/extraConsoleCommands/commands.lua +2 -1
  12. package/dist/src/classes/private/CustomCallback.d.ts +3 -1
  13. package/dist/src/classes/private/CustomCallback.d.ts.map +1 -1
  14. package/dist/src/classes/private/CustomCallback.lua +12 -4
  15. package/dist/src/core/upgradeMod.d.ts +0 -42
  16. package/dist/src/core/upgradeMod.d.ts.map +1 -1
  17. package/dist/src/core/upgradeMod.lua +46 -21
  18. package/dist/src/features.lua +2 -2
  19. package/dist/src/functions/console.d.ts +8 -0
  20. package/dist/src/functions/console.d.ts.map +1 -0
  21. package/dist/src/functions/console.lua +14 -0
  22. package/dist/src/functions/deepCopy.d.ts.map +1 -1
  23. package/dist/src/functions/deepCopy.lua +3 -2
  24. package/dist/src/functions/enums.d.ts +28 -0
  25. package/dist/src/functions/enums.d.ts.map +1 -1
  26. package/dist/src/functions/enums.lua +27 -0
  27. package/dist/src/functions/globals.lua +3 -3
  28. package/dist/src/functions/log.d.ts +5 -0
  29. package/dist/src/functions/log.d.ts.map +1 -1
  30. package/dist/src/functions/log.lua +6 -0
  31. package/dist/src/functions/mergeTests.lua +2 -2
  32. package/dist/src/functions/modFeatures.d.ts +1 -1
  33. package/dist/src/functions/modFeatures.d.ts.map +1 -1
  34. package/dist/src/functions/sort.d.ts +38 -0
  35. package/dist/src/functions/sort.d.ts.map +1 -0
  36. package/dist/src/functions/sort.lua +95 -0
  37. package/dist/src/functions/utils.d.ts +0 -54
  38. package/dist/src/functions/utils.d.ts.map +1 -1
  39. package/dist/src/functions/utils.lua +0 -91
  40. package/dist/src/index.d.ts +3 -2
  41. package/dist/src/index.d.ts.map +1 -1
  42. package/dist/src/index.lua +17 -1
  43. package/dist/src/interfaces/private/AddCallbackParametersCustom.lua +2 -2
  44. package/dist/src/interfaces/private/ModUpgradedInterface.d.ts +4 -2
  45. package/dist/src/interfaces/private/ModUpgradedInterface.d.ts.map +1 -1
  46. package/dist/src/types/{ModUpgraded.d.ts → private/ModUpgradedWithFeatures.d.ts} +13 -9
  47. package/dist/src/types/private/ModUpgradedWithFeatures.d.ts.map +1 -0
  48. package/dist/src/types/{ModUpgraded.lua → private/ModUpgradedWithFeatures.lua} +0 -0
  49. package/package.json +1 -1
  50. package/src/classes/ModFeature.ts +5 -5
  51. package/src/classes/{ModUpgradedBase.ts → ModUpgraded.ts} +33 -37
  52. package/src/classes/features/other/DebugDisplay.ts +1 -1
  53. package/src/classes/features/other/ExtraConsoleCommands.ts +1 -1
  54. package/src/classes/features/other/extraConsoleCommands/commands.ts +2 -1
  55. package/src/classes/private/CustomCallback.ts +17 -7
  56. package/src/core/upgradeMod.ts +55 -29
  57. package/src/features.ts +1 -1
  58. package/src/functions/console.ts +15 -0
  59. package/src/functions/deepCopy.ts +3 -2
  60. package/src/functions/enums.ts +33 -0
  61. package/src/functions/globals.ts +2 -2
  62. package/src/functions/log.ts +9 -0
  63. package/src/functions/mergeTests.ts +1 -1
  64. package/src/functions/modFeatures.ts +1 -1
  65. package/src/functions/sort.ts +128 -0
  66. package/src/functions/utils.ts +0 -124
  67. package/src/index.ts +3 -2
  68. package/src/interfaces/private/AddCallbackParametersCustom.ts +1 -1
  69. package/src/interfaces/private/ModUpgradedInterface.ts +4 -2
  70. package/src/types/{ModUpgraded.ts → private/ModUpgradedWithFeatures.ts} +13 -9
  71. package/dist/src/classes/ModUpgradedBase.d.ts.map +0 -1
  72. package/dist/src/types/ModUpgraded.d.ts.map +0 -1
package/dist/index.d.ts CHANGED
@@ -1144,22 +1144,6 @@ export declare function characterCanTakeFreeDevilDeals(character: PlayerType): b
1144
1144
  */
1145
1145
  export declare function characterGetsBlackHeartFromEternalHeart(character: PlayerType): boolean;
1146
1146
 
1147
- declare class CharacterHealthConversion extends Feature {
1148
- private characterHealthReplacementMap;
1149
- private prePickupCollisionHeart;
1150
- private postPEffectUpdateReordered;
1151
- /**
1152
- * Helper function to make a character that has the same health mechanic as Blue Baby (red heart
1153
- * containers --> soul hearts) or Dark Judas (red heart containers --> black hearts).
1154
- *
1155
- * Call this function once at the beginning of your mod to declare the health conversion type.
1156
- *
1157
- * In order to use this function, you must upgrade your mod with
1158
- * `ISCFeature.CHARACTER_HEALTH_CONVERSION`.
1159
- */
1160
- registerCharacterHealthConversion(playerType: PlayerType, conversionHeartSubType: ConversionHeartSubType): void;
1161
- }
1162
-
1163
1147
  /**
1164
1148
  * Helper function to determine if the specified character starts with an active item.
1165
1149
  *
@@ -1168,32 +1152,6 @@ declare class CharacterHealthConversion extends Feature {
1168
1152
  */
1169
1153
  export declare function characterStartsWithActiveItem(character: PlayerType): boolean;
1170
1154
 
1171
- /** Easily create custom characters that have base stats different from that of Isaac. */
1172
- declare class CharacterStats extends Feature {
1173
- private charactersStatMap;
1174
- private evaluateCache;
1175
- /**
1176
- * Helper function to manage the stats for a vanilla or custom character. Call this function once
1177
- * at the beginning of your mod to declare the starting stats.
1178
- *
1179
- * You must provide this function with a map of CacheFlag to the default stat amount. For example,
1180
- * the default amount of damage is 3.5. To make a custom character start with 4.5 damage:
1181
- *
1182
- * ```ts
1183
- * const fooDefaultStats = new Map<CacheFlag, number>([
1184
- * [CacheFlag.DAMAGE, 4.5],
1185
- * ])
1186
- * registerCharacterStats(PlayerTypeCustom.FOO, fooDefaultStats);
1187
- * ```
1188
- *
1189
- * Note that the format for the `CacheFlag.FIRE_DELAY` value should be in the tears stat format,
1190
- * not the `MaxFireDelay` format.
1191
- *
1192
- * In order to use this function, you must upgrade your mod with `ISCFeature.CHARACTER_STATS`.
1193
- */
1194
- registerCharacterStats(playerType: PlayerType, statMap: Map<CacheFlag, number> | ReadonlyMap<CacheFlag, number>): void;
1195
- }
1196
-
1197
1155
  /**
1198
1156
  * A collection of the four sprites necessary in order to render a charge bar.
1199
1157
  *
@@ -1345,21 +1303,6 @@ export declare type CollectibleIndex = string & {
1345
1303
  readonly __collectibleIndexBrand: symbol;
1346
1304
  };
1347
1305
 
1348
- declare class CollectibleItemPoolType extends Feature {
1349
- private pickupIndexCreation;
1350
- private postPickupInitCollectible;
1351
- /**
1352
- * Helper function to get the item pool type that a given collectible came from. Since there is no
1353
- * native method in the API to get this, we listen in the `POST_PICKUP_INIT` callback for
1354
- * collectibles, use the `ItemPool.GetLastPool` method, and then assume that the collectible
1355
- * matches.
1356
- *
1357
- * In order to use this function, you must upgrade your mod with
1358
- * `ISCFeature.COLLECTIBLE_ITEM_POOL_TYPE`.
1359
- */
1360
- getCollectibleItemPoolType(collectible: EntityPickup): ItemPoolType;
1361
- }
1362
-
1363
1306
  /** Helper function to check if two collectible sprites have the same sprite sheet loaded. */
1364
1307
  export declare function collectibleSpriteEquals(sprite1: Sprite, sprite2: Sprite): boolean;
1365
1308
 
@@ -1537,356 +1480,6 @@ export declare function countEntities(entityType?: EntityType, variant?: number,
1537
1480
  */
1538
1481
  export declare function countSetBits(n: int): int;
1539
1482
 
1540
- /**
1541
- * The base class for a custom callback. Individual custom callbacks (and validation callbacks) will
1542
- * extend from this class.
1543
- */
1544
- declare abstract class CustomCallback<T extends ModCallbackCustom> extends Feature {
1545
- private subscriptions;
1546
- addSubscriber(callbackFunc: AddCallbackParametersCustom[T][0], ...optionalArgs: AllButFirst<AddCallbackParametersCustom[T]>): void;
1547
- /**
1548
- * If the submitted function does not match any of the existing subscriptions, this method will do
1549
- * nothing.
1550
- */
1551
- removeSubscriber(callback: AddCallbackParametersCustom[T][0]): void;
1552
- fire: (...fireArgs: FireArgs<T>) => ReturnType<AddCallbackParametersCustom[T][0]>;
1553
- /**
1554
- * This method needs to be overwritten for any callback that has optional filtration arguments.
1555
- * See "shouldFire.ts" for methods tailored to specific kinds of callbacks.
1556
- */
1557
- protected shouldFire: (fireArgs: FireArgs<T>, optionalArgs: OptionalArgs<T>) => boolean;
1558
- }
1559
-
1560
- declare class CustomGridEntities extends Feature {
1561
- private runInNFrames;
1562
- private preUseItemWeNeedToGoDeeper;
1563
- private postNewRoomReordered;
1564
- /**
1565
- * Helper function to spawn a custom grid entity. Custom grid entities are persistent in that they
1566
- * will reappear if the player leaves and re-enters the room. (It will be manually respawned in
1567
- * the `POST_NEW_ROOM` callback.)
1568
- *
1569
- * In order to use this function, you must upgrade your mod with
1570
- * `ISCFeature.CUSTOM_GRID_ENTITIES`.
1571
- *
1572
- * Custom grid entities are built on top of real grid entities. You can use any existing grid
1573
- * entity type as a base. For example, if you want to create a custom rock that would be breakable
1574
- * like a normal rock, then you should specify `GridEntityType.ROCK` as the base grid entity type.
1575
- *
1576
- * Once a custom grid entity is spawned, you can take advantage of the custom grid callbacks such
1577
- * as `POST_GRID_ENTITY_CUSTOM_UPDATE`. Note that the "normal" grid entities callbacks will not
1578
- * fire for custom entities. For example, if you had a custom grid entity based on
1579
- * `GridEntityType.ROCK`, and you also had a subscription to the `POST_GRID_ENTITY_UPDATE`
1580
- * callback, the callback would only fire for normal rocks and not the custom entity.
1581
- *
1582
- * Custom grid entities are an IsaacScript feature because the vanilla game does not support any
1583
- * custom grid entities.
1584
- *
1585
- * For example, this would be code to create a custom rock called a "Silver Rock" that produces a
1586
- * dime when destroyed:
1587
- *
1588
- * ```ts
1589
- * // This is local to the mod and can safely overlap with the values of `GridEntityType` (or
1590
- * // values chosen by other mods).
1591
- * const GridEntityTypeCustom = {
1592
- * SILVER_ROCK: 0 as GridEntityType,
1593
- * } as const;
1594
- *
1595
- * // This is copied from "gfx/grid/grid_rock.anm2" with some tweaks to make it look special.
1596
- * const SILVER_ROCK_ANM2_PATH = "gfx/grid/grid_rock_silver.anm2";
1597
- *
1598
- * export function silverRockInit(mod: ModUpgraded): void {
1599
- * mod.AddCallbackCustom(
1600
- * ModCallbackCustom.POST_GRID_ENTITY_CUSTOM_BROKEN,
1601
- * postGridEntityCustomBrokenSilverRock,
1602
- * GridEntityTypeCustom.SILVER_ROCK,
1603
- * );
1604
- * }
1605
- *
1606
- * function postGridEntityCustomBrokenSilverRock(gridEntity: GridEntity) {
1607
- * spawnCoin(CoinSubType.DIME, gridEntity.Position);
1608
- * }
1609
- *
1610
- * export function spawnSilverRock(mod: ModUpgraded, gridIndex: int): GridEntity {
1611
- * return mod.spawnCustomGridEntity(
1612
- * GridEntityTypeCustom.SILVER_ROCK,
1613
- * gridIndex,
1614
- * undefined,
1615
- * SILVER_ROCK_ANM2_PATH,
1616
- * undefined,
1617
- * GridEntityType.ROCK,
1618
- * );
1619
- * }
1620
- * ```
1621
- *
1622
- * @param gridEntityTypeCustom An integer that identifies what kind of grid entity you are
1623
- * creating. It should correspond to a local enum value created in
1624
- * your mod. The integer can be any unique value and will not
1625
- * correspond to the actual grid entity type used. (This integer is
1626
- * used in the various custom grid entity callbacks.)
1627
- * @param gridIndexOrPosition The grid index or position in the room that you want to spawn the
1628
- * grid entity at. If a position is specified, the closest grid index
1629
- * will be used.
1630
- * @param gridCollisionClass Optional. The collision class that you want the custom grid entity to
1631
- * have. If not specified, the grid collision class from the base grid
1632
- * entity will be used.
1633
- * @param anm2Path Optional. The path to the ANM2 file to use for the sprite. If not specified,
1634
- * the normal sprite from the base grid entity will be used.
1635
- * @param defaultAnimation Optional. The name of the animation to play after the sprite is
1636
- * initialized and after the player re-enters a room with this grid entity
1637
- * in it. If not specified, the default animation in the anm2 will be
1638
- * used.
1639
- * @param baseGridEntityType Optional. The type of the grid entity to use as a "base" for this
1640
- * custom grid entity. Default is `GridEntityType.DECORATION`.
1641
- * @param baseGridEntityVariant Optional. The variant of the grid entity to use as a "base" for
1642
- * this custom grid entity. Default is 0.
1643
- */
1644
- spawnCustomGridEntity(gridEntityTypeCustom: GridEntityType, gridIndexOrPosition: int | Vector, gridCollisionClass?: GridCollisionClass, anm2Path?: string, defaultAnimation?: string, baseGridEntityType?: GridEntityType, baseGridEntityVariant?: number): GridEntity;
1645
- /**
1646
- * Helper function to remove a custom grid entity created by the `spawnCustomGrid` function.
1647
- *
1648
- * In order to use this function, you must upgrade your mod with
1649
- * `ISCFeature.CUSTOM_GRID_ENTITIES`.
1650
- *
1651
- * @param gridIndexOrPositionOrGridEntity You can specify the custom grid entity to remove by
1652
- * providing the grid index, the room position, or the grid entity
1653
- * itself.
1654
- * @param updateRoom Optional. Whether or not to update the room after the grid entity is removed.
1655
- * Default is true. This is generally a good idea because if the room is not
1656
- * updated, you will be unable to spawn another grid entity on the same tile
1657
- * until a frame has passed. However, doing this is expensive, since it involves
1658
- * a call to `Isaac.GetRoomEntities`, so set it to false if you need to run this
1659
- * function multiple times.
1660
- * @returns The grid entity that was removed. Returns undefined if no grid entity was found at the
1661
- * given location or if the given grid entity was not a custom grid entity.
1662
- */
1663
- removeCustomGridEntity(gridIndexOrPositionOrGridEntity: int | Vector | GridEntity, updateRoom?: boolean): GridEntity | undefined;
1664
- /**
1665
- * Helper function to get the custom grid entities in the current room. Returns an array of tuples
1666
- * containing the raw decoration grid entity and the associated entity data.
1667
- *
1668
- * In order to use this function, you must upgrade your mod with
1669
- * `ISCFeature.CUSTOM_GRID_ENTITIES`.
1670
- */
1671
- getCustomGridEntities(): Array<[
1672
- gridEntity: GridEntity,
1673
- data: GridEntityCustomData
1674
- ]>;
1675
- /**
1676
- * Helper function to get the custom `GridEntityType` from a `GridEntity` or grid index. Returns
1677
- * undefined if the provided `GridEntity` is not a custom grid entity, or if there was not a grid
1678
- * entity on the provided grid index.
1679
- *
1680
- * In order to use this function, you must upgrade your mod with
1681
- * `ISCFeature.CUSTOM_GRID_ENTITIES`.
1682
- */
1683
- getCustomGridEntityType(gridEntityOrGridIndex: GridEntity | int): GridEntityType | undefined;
1684
- /**
1685
- * Helper function to check if a `GridEntity` is a custom grid entity or if a grid index has a
1686
- * custom grid entity.
1687
- *
1688
- * In order to use this function, you must upgrade your mod with
1689
- * `ISCFeature.CUSTOM_GRID_ENTITIES`.
1690
- */
1691
- isCustomGridEntity(gridEntityOrGridIndex: GridEntity | int): boolean;
1692
- }
1693
-
1694
- declare class CustomHotkeys extends Feature {
1695
- /**
1696
- * The keys are the keyboard keys that trigger the hotkey. The values are the functions that
1697
- * contain the arbitrary code to run.
1698
- */
1699
- private staticHotkeyFunctionMap;
1700
- /**
1701
- * The keys are the functions that determine what the hotkey key is. The values are the functions
1702
- * that contain the arbitrary code to run.
1703
- */
1704
- private dynamicHotkeyFunctionMap;
1705
- private keyPressedMap;
1706
- private postRender;
1707
- private checkIfTriggered;
1708
- /**
1709
- * Helper function to run arbitrary code when you press and release a specific keyboard key.
1710
- *
1711
- * This can be used to easily set up custom hotkeys to facilitate custom game features or to
1712
- * assist in debugging.
1713
- *
1714
- * Inputs are checked for in the `POST_RENDER` callback.
1715
- *
1716
- * This is different from the `setHotkey` function in that the keyboard activation key is not
1717
- * hardcoded and is instead the return value of a provided function. This is useful for situations
1718
- * where the key can change (like if end-users can specify a custom hotkey using Mod Config Menu).
1719
- *
1720
- * In order to use this function, you must upgrade your mod with `ISCFeature.CUSTOM_HOTKEYS`.
1721
- *
1722
- * @param getKeyFunc The function that returns the key that will trigger the hotkey.
1723
- * @param triggerFunc A function containing the arbitrary code that you want to execute when the
1724
- * hotkey is triggered.
1725
- */
1726
- setConditionalHotkey(getKeyFunc: () => Keyboard | undefined, triggerFunc: () => void): void;
1727
- /**
1728
- * Helper function to run arbitrary code when you press and release a specific keyboard key.
1729
- *
1730
- * This can be used to easily set up custom hotkeys to facilitate custom game features or to
1731
- * assist in debugging.
1732
- *
1733
- * Inputs are checked for in the `POST_RENDER` callback.
1734
- *
1735
- * In order to use this function, you must upgrade your mod with `ISCFeature.CUSTOM_HOTKEYS`.
1736
- *
1737
- * @param keyboard The key that you want to trigger the hotkey.
1738
- * @param triggerFunc A function containing the arbitrary code that you want to execute when the
1739
- * hotkey is triggered.
1740
- */
1741
- setHotkey(keyboard: Keyboard, triggerFunc: () => void): void;
1742
- /**
1743
- * Helper function to remove a hotkey created with the `setConditionalHotkey` function.
1744
- *
1745
- * In order to use this function, you must upgrade your mod with `ISCFeature.CUSTOM_HOTKEYS`.
1746
- *
1747
- * @param getKeyFunc Equal to the `getKeyFunc` that you passed when initially registering the
1748
- * hotkey.
1749
- */
1750
- unsetConditionalHotkey(getKeyFunc: () => Keyboard | undefined): void;
1751
- /**
1752
- * Helper function to remove a hotkey created with the `setHotkey` function.
1753
- *
1754
- * In order to use this function, you must upgrade your mod with `ISCFeature.CUSTOM_HOTKEYS`.
1755
- *
1756
- * @param keyboard Equal to the keyboard value that you passed when initially registering the
1757
- * hotkey.
1758
- */
1759
- unsetHotkey(keyboard: Keyboard): void;
1760
- }
1761
-
1762
- declare class CustomItemPools extends Feature {
1763
- private customItemPoolMap;
1764
- private postGameStartedReordered;
1765
- /**
1766
- * Helper function to register a custom item pool. Use this function once when your mod first
1767
- * loads to declare the items that you want to be in the item pools. Then, in the middle of a run,
1768
- * you can use `getCustomItemPoolCollectible`.
1769
- *
1770
- * For example:
1771
- *
1772
- * ```ts
1773
- * const ItemPoolTypeCustom = {
1774
- * FOO = 0 as ItemPoolType,
1775
- * } as const;
1776
- *
1777
- * const FOO_ITEM_POOL = [
1778
- * [CollectibleType.SAD_ONION, 1],
1779
- * [CollectibleType.INNER_EYE, 0.5],
1780
- * ];
1781
- *
1782
- * registerCustomItemPool(ItemPoolTypeCustom.FOO, FOO_ITEM_POOL);
1783
- * ```
1784
- *
1785
- * Note that custom item pools do not currently support partial weight decrementation on sight.
1786
- *
1787
- * In order to use this function, you must upgrade your mod with `ISCFeature.CUSTOM_ITEM_POOLS`.
1788
- *
1789
- * @param itemPoolTypeCustom An integer that identifies what kind of item pool you are creating.
1790
- * It should correspond to a local `ItemPoolTypeCustom` enum in your
1791
- * mod. The integer can be any unique value and can safely overlap with
1792
- * the vanilla item pool type values (or values chosen by other mods).
1793
- * @param collectibles An array of weighted collectible tuples that represent the item pool that
1794
- * you are creating. The first element in he tuple is the `CollectibleType`,
1795
- * and the second element in the tuple is the float that represents the weight
1796
- * of the collectible.
1797
- */
1798
- registerCustomItemPool(itemPoolTypeCustom: ItemPoolType, collectibles: WeightedArray<CollectibleType>): void;
1799
- /**
1800
- * Helper function to get a new collectible from a custom item pool created with the
1801
- * `registerCustomItemPool` function. This function has the same format as the
1802
- * `ItemPool.GetCollectible` method.
1803
- *
1804
- * By default, a collectible will not be removed from the pool once it is selected, unless the
1805
- * `decrease` argument is set to true (similar to how a vanilla item pool works).
1806
- *
1807
- * In order to use this function, you must upgrade your mod with `ISCFeature.CUSTOM_ITEM_POOLS`.
1808
- *
1809
- * @param itemPoolTypeCustom An integer representing the custom item pool to use.
1810
- * @param decrease Optional. Whether or not to remove the selected collectible from the item pool.
1811
- * Default is true.
1812
- * @param seedOrRNG Optional. The `Seed` or `RNG` object to use. If an `RNG` object is provided,
1813
- * the `RNG.Next` method will be called. Default is `getRandomSeed()`.
1814
- * @param defaultItem Optional. The collectible to return if the item pool is depleted. Default is
1815
- * `CollectibleType.NULL`.
1816
- */
1817
- getCustomItemPoolCollectible(itemPoolTypeCustom: ItemPoolType, decrease?: boolean, seedOrRNG?: Seed | RNG, defaultItem?: CollectibleType): CollectibleType;
1818
- }
1819
-
1820
- declare class CustomPickups extends Feature {
1821
- /** Indexed by entity ID. */
1822
- private customPickupFunctionsMap;
1823
- private prePickupCollision;
1824
- private postEffectRenderPickupEffect;
1825
- /**
1826
- * Helper function to register a custom pickup with the IsaacScript standard library. Use this
1827
- * feature for custom pickups that are intended to be picked up by the player, like bombs and
1828
- * keys.
1829
- *
1830
- * When IsaacScript detects that a player should be collecting the custom pickup, then the pickup
1831
- * will be immediately removed, and an effect showing the pickup's respective `Collect` animation
1832
- * will be spawned. (This emulates how a normal vanilla pickup would work.) After that, the
1833
- * provided `collectFunc` will be fired. In this function, you will probably want to play a sound
1834
- * corresponding to what kind of pickup it is (e.g. `SoundEffect.KEY_PICKUP_GAUNTLET`), as well as
1835
- * do things like adding something to the player's inventory.
1836
- *
1837
- * Note that when you specify your custom pickup in the "entities2.xml" file, it should have a
1838
- * type of "5" and be associated with an anm2 file that has a "Collect" animation.
1839
- *
1840
- * In order to use this function, you must upgrade your mod with `ISCFeature.CUSTOM_PICKUPS`.
1841
- *
1842
- * @param pickupVariantCustom The variant for the corresponding custom pickup.
1843
- * @param subType The sub-type for the corresponding custom pickup.
1844
- * @param collectFunc The function to run when the player collects this pickup.
1845
- * @param collisionFunc Optional. The function to run when a player collides with the pickup.
1846
- * Default is a function that always returns true, meaning that the player
1847
- * will always immediately collect the pickup when they collide with it.
1848
- * Specify this function if your pickup should only be able to be collected
1849
- * under certain conditions.
1850
- */
1851
- registerCustomPickup(pickupVariantCustom: PickupVariant, subType: int, collectFunc: (this: void, player: EntityPlayer) => void, collisionFunc?: (this: void, player: EntityPlayer) => boolean): void;
1852
- }
1853
-
1854
- declare class CustomRevive extends Feature {
1855
- v: {
1856
- run: {
1857
- state: CustomReviveState;
1858
- revivalType: number | null;
1859
- dyingPlayerIndex: PlayerIndex | null;
1860
- };
1861
- };
1862
- private preCustomRevive;
1863
- private postCustomRevive;
1864
- private runInNFrames;
1865
- constructor(preCustomRevive: PreCustomRevive, postCustomRevive: PostCustomRevive, runInNFrames: RunInNFrames);
1866
- private postRender;
1867
- private postNewRoomReordered;
1868
- private postPEffectUpdateReordered;
1869
- private checkWaitingForItemAnimation;
1870
- private postPlayerFatalDamage;
1871
- private preBerserkDeath;
1872
- /**
1873
- * The player is about to die, which will immediately delete the save data for the run. To prevent
1874
- * this from happening, we grant the 1-Up item.
1875
- */
1876
- private playerIsAboutToDie;
1877
- private logStateChanged;
1878
- }
1879
-
1880
- declare enum CustomReviveState {
1881
- DISABLED = 0,
1882
- /**
1883
- * We can't immediately jump to waiting for an item animation because it is possible for a player
1884
- * to be holding an item above their head as they are dying (e.g. with Razor Blade).
1885
- */
1886
- WAITING_FOR_ROOM_TRANSITION = 1,
1887
- WAITING_FOR_ITEM_ANIMATION = 2
1888
- }
1889
-
1890
1483
  /**
1891
1484
  * An object that represents a possible boss for a custom stage. This can be for a vanilla boss or a
1892
1485
  * custom boss.
@@ -1971,56 +1564,6 @@ export declare interface CustomStageRoomMetadata {
1971
1564
  weight: number;
1972
1565
  }
1973
1566
 
1974
- declare class CustomStages extends Feature {
1975
- /** Indexed by custom stage name. */
1976
- private customStagesMap;
1977
- /** Indexed by room variant. */
1978
- private customStageCachedRoomData;
1979
- private customGridEntities;
1980
- private customTrapdoors;
1981
- private disableAllSound;
1982
- private gameReorderedCallbacks;
1983
- private pause;
1984
- private runInNFrames;
1985
- private initCustomStageMetadata;
1986
- private initRoomTypeMap;
1987
- private initCustomTrapdoorDestination;
1988
- private goToCustomStage;
1989
- private postRender;
1990
- private postCurseEval;
1991
- private getShaderParams;
1992
- private postGridEntityBrokenRockAlt;
1993
- private postGridEntityInit;
1994
- private postNewRoomReordered;
1995
- /** Pick a custom room for each vanilla room. */
1996
- private setStageRoomsData;
1997
- /**
1998
- * Helper function to warp to a custom stage/level.
1999
- *
2000
- * Custom stages/levels must first be defined in the "tsconfig.json" file. See the documentation
2001
- * for more details: https://isaacscript.github.io/main/custom-stages/
2002
- *
2003
- * In order to use this function, you must upgrade your mod with `ISCFeature.CUSTOM_STAGES`.
2004
- *
2005
- * @param name The name of the custom stage, corresponding to what is in the "tsconfig.json" file.
2006
- * @param firstFloor Optional. Whether to go to the first floor or the second floor. For example,
2007
- * if you have a custom stage emulating Caves, then the first floor would be
2008
- * Caves 1, and the second floor would be Caves 2. Default is true.
2009
- * @param streakText Optional. Whether to show the streak text at the top of the screen that
2010
- * announces the name of the level. Default is true.
2011
- * @param verbose Optional. Whether to log additional information about the rooms that are chosen.
2012
- * Default is false.
2013
- */
2014
- setCustomStage(name: string, firstFloor?: boolean, streakText?: boolean, verbose?: boolean): void;
2015
- /**
2016
- * Helper function to disable the custom stage. This is typically called before taking the player
2017
- * to a vanilla floor.
2018
- *
2019
- * In order to use this function, you must upgrade your mod with `ISCFeature.CUSTOM_STAGES`.
2020
- */
2021
- disableCustomStage(): void;
2022
- }
2023
-
2024
1567
  /**
2025
1568
  * A description of a custom stage shadow. (In this context, "shadows" are the outlines from things
2026
1569
  * on the roof. For example, in Basement, a shadow of a sideways V is used, among others.)
@@ -2472,454 +2015,6 @@ export declare interface CustomStageTSConfig {
2472
2015
  };
2473
2016
  }
2474
2017
 
2475
- declare class CustomTrapdoors extends Feature {
2476
- /** Indexed by custom trapdoor ID. */
2477
- private destinationFuncMap;
2478
- /**
2479
- * In order to represent a black sprite, we just use the first frame of the boss versus screen
2480
- * animation. However, we must lazy load the sprite in order to prevent issues with mods that
2481
- * replace the vanilla files. (For some reason, loading the sprites will cause the overwrite to no
2482
- * longer apply on the second and subsequent runs.)
2483
- */
2484
- private blackSprite;
2485
- private customGridEntities;
2486
- private disableInputs;
2487
- private ponyDetection;
2488
- private roomClearFrame;
2489
- private runInNFrames;
2490
- private runNextRoom;
2491
- private stageHistory;
2492
- private postRender;
2493
- private checkAllPlayersJumpComplete;
2494
- private checkPixelationToBlackComplete;
2495
- private goToCustomTrapdoorDestination;
2496
- private getDestinationFunc;
2497
- private checkSecondPixelationHalfWay;
2498
- private checkAllPlayersLayingDownComplete;
2499
- private drawBlackSprite;
2500
- private postGridEntityCustomUpdateTrapdoor;
2501
- private checkCustomTrapdoorOpenClose;
2502
- private shouldTrapdoorOpen;
2503
- private isPlayerCloseAfterBoss;
2504
- private checkCustomTrapdoorPlayerTouched;
2505
- private playerTouchedCustomTrapdoor;
2506
- private startDelayedJump;
2507
- private adjustPlayerPositionToTrapdoor;
2508
- private postPEffectUpdateReordered;
2509
- private checkJumpComplete;
2510
- private shouldTrapdoorSpawnOpen;
2511
- private logStateChanged;
2512
- /**
2513
- * Helper function to specify where your custom trapdoor should take the player. Call this once at
2514
- * the beginning of your mod for each kind of custom trapdoor that you want to have. The provided
2515
- * `destinationFunc` will be executed when the player jumps into the trapdoor and the pixelation
2516
- * effect fades to black.
2517
- *
2518
- * Registration is needed so that custom trapdoors can be serializable when the player saves and
2519
- * quits.
2520
- *
2521
- * In order to use this function, you must upgrade your mod with `ISCFeature.CUSTOM_TRAPDOORS`.
2522
- *
2523
- * @param destinationName The integer that identifies the type of custom trapdoor. It should
2524
- * correspond to a local `CustomTrapdoorType` enum in your mod. The integer
2525
- * can be any unique value and can safely overlap with values chosen by
2526
- * other mods.
2527
- * @param destinationFunc A function that takes the player to the destination that you want.
2528
- * Inside this function, use the `setStage` or `setCustomStage` helper
2529
- * functions, or do something completely custom.
2530
- */
2531
- registerCustomTrapdoorDestination(destinationName: string, destinationFunc: (destinationName: string | undefined, destinationStage: LevelStage, destinationStageType: StageType) => void): void;
2532
- /**
2533
- * Helper function to spawn a trapdoor grid entity that will take a player to a vanilla stage or
2534
- * custom location.
2535
- *
2536
- * - If you want to create a custom trapdoor that goes to a vanilla stage, pass `undefined` for
2537
- * the `destinationName` parameter.
2538
- * - If you want to create a custom trapdoor that takes the player to a custom location, you must
2539
- * have registered the corresponding `destinationName` at the beginning of your mod with the
2540
- * `registerCustomTrapdoorDestination` function. (This is necessary so that custom trapdoors can
2541
- * be serializable when the player saves and quits.)
2542
- *
2543
- * Under the hood, the custom trapdoor is represented by a decoration grid entity and is manually
2544
- * respawned every time the player re-enters the room.
2545
- *
2546
- * In order to use this function, you must upgrade your mod with `ISCFeature.CUSTOM_TRAPDOORS`.
2547
- *
2548
- * @param gridIndexOrPosition The location in the room to spawn the trapdoor.
2549
- * @param destinationName Optional. A string representing the name of the of destination that the
2550
- * custom trapdoor will take the player to. Default is undefined, which
2551
- * will take the player to a vanilla stage.
2552
- * @param destinationStage Optional. The first argument that will be passed to the
2553
- * `destinationFunc` corresponding to this custom trapdoor. This is
2554
- * essentially metadata for the custom trapdoor. Leave this undefined if
2555
- * your corresponding custom trapdoor function does not care what the
2556
- * destination stage should be. Default is the "normal" next vanilla
2557
- * stage.
2558
- * @param destinationStageType Optional. The second argument that will be passed to the
2559
- * `destinationFunc` corresponding to this custom trapdoor. This is
2560
- * essentially metadata for the custom trapdoor. Leave this undefined
2561
- * if your corresponding custom trapdoor function does not care what
2562
- * the destination stage type should be. Default is the "normal" next
2563
- * vanilla stage type.
2564
- * @param anm2Path Optional. The path to the anm2 file to use. By default, the vanilla trapdoor
2565
- * anm2 of "gfx/grid/door_11_trapdoor.anm2" will be used. The specified anm2 file
2566
- * must have animations called "Opened", "Closed", and "Open Animation".
2567
- * @param spawnOpen Optional. Whether or not to spawn the trapdoor in an open state. By default,
2568
- * behavior will be used that emulates a vanilla trapdoor.
2569
- */
2570
- spawnCustomTrapdoor(gridIndexOrPosition: int | Vector, destinationName?: string, destinationStage?: LevelStage, destinationStageType?: StageType, anm2Path?: string, spawnOpen?: boolean): GridEntity;
2571
- }
2572
-
2573
- declare class DebugDisplay extends Feature {
2574
- private mod;
2575
- private player;
2576
- private tear;
2577
- private familiar;
2578
- private bomb;
2579
- private pickup;
2580
- private slot;
2581
- private laser;
2582
- private knife;
2583
- private projectile;
2584
- private effect;
2585
- private npc;
2586
- private rock;
2587
- private pit;
2588
- private spikes;
2589
- private tnt;
2590
- private poop;
2591
- private door;
2592
- private pressurePlate;
2593
- /**
2594
- * If the "togglePlayerDisplay" function is called, text will be drawn on the screen next to each
2595
- * player. Use this function to specify a callback function that returns the string that should be
2596
- * drawn.
2597
- *
2598
- * In order to use this function, you must upgrade your mod with `ISCFeature.DEBUG_DISPLAY`.
2599
- */
2600
- setPlayerDisplay(textCallback: (player: EntityPlayer) => string): void;
2601
- /**
2602
- * If the "toggleTearDisplay" function is called, text will be drawn on the screen next to each
2603
- * tear. Use this function to specify a callback function that returns the string that should be
2604
- * drawn.
2605
- *
2606
- * In order to use this function, you must upgrade your mod with `ISCFeature.DEBUG_DISPLAY`.
2607
- */
2608
- setTearDisplay(textCallback: (tear: EntityTear) => string): void;
2609
- /**
2610
- * If the "toggleFamiliarDisplay" function is called, text will be drawn on the screen next to
2611
- * each familiar. Use this function to specify a callback function that returns the string that
2612
- * should be drawn.
2613
- *
2614
- * In order to use this function, you must upgrade your mod with `ISCFeature.DEBUG_DISPLAY`.
2615
- */
2616
- setFamiliarDisplay(textCallback: (familiar: EntityFamiliar) => string): void;
2617
- /**
2618
- * If the "toggleBombDisplay" function is called, text will be drawn on the screen next to each
2619
- * bomb. Use this function to specify a callback function that returns the string that should be
2620
- * drawn.
2621
- *
2622
- * In order to use this function, you must upgrade your mod with `ISCFeature.DEBUG_DISPLAY`.
2623
- */
2624
- setBombDisplay(textCallback: (bomb: EntityBomb) => string): void;
2625
- /**
2626
- * If the "togglePickupDisplay" function is called, text will be drawn on the screen next to each
2627
- * pickup. Use this function to specify a callback function that returns the string that should be
2628
- * drawn.
2629
- *
2630
- * In order to use this function, you must upgrade your mod with `ISCFeature.DEBUG_DISPLAY`.
2631
- */
2632
- setPickupDisplay(textCallback: (pickup: EntityPickup) => string): void;
2633
- /**
2634
- * If the "toggleSlotDisplay" function is called, text will be drawn on the screen next to each
2635
- * slot. Use this function to specify a callback function that returns the string that should be
2636
- * drawn.
2637
- *
2638
- * In order to use this function, you must upgrade your mod with `ISCFeature.DEBUG_DISPLAY`.
2639
- */
2640
- setSlotDisplay(textCallback: (slot: Entity) => string): void;
2641
- /**
2642
- * If the "toggleLaserDisplay" function is called, text will be drawn on the screen next to each
2643
- * laser. Use this function to specify a callback function that returns the string that should be
2644
- * drawn.
2645
- *
2646
- * In order to use this function, you must upgrade your mod with `ISCFeature.DEBUG_DISPLAY`.
2647
- */
2648
- setLaserDisplay(textCallback: (laser: EntityLaser) => string): void;
2649
- /**
2650
- * If the "toggleKnifeDisplay" function is called, text will be drawn on the screen next to each
2651
- * knife. Use this function to specify a callback function that returns the string that should be
2652
- * drawn.
2653
- *
2654
- * In order to use this function, you must upgrade your mod with `ISCFeature.DEBUG_DISPLAY`.
2655
- */
2656
- setKnifeDisplay(textCallback: (knife: EntityKnife) => string): void;
2657
- /**
2658
- * If the "toggleProjectileDisplay" function is called, text will be drawn on the screen next to
2659
- * each projectile. Use this function to specify a callback function that returns the string that
2660
- * should be drawn.
2661
- *
2662
- * In order to use this function, you must upgrade your mod with `ISCFeature.DEBUG_DISPLAY`.
2663
- */
2664
- setProjectileDisplay(textCallback: (projectile: EntityProjectile) => string): void;
2665
- /**
2666
- * If the "extra console commands" feature is specified, the "effectDisplay" console command will
2667
- * draw text on the screen next to each effect. Use this function to specify a callback function
2668
- * that returns the string that should be drawn.
2669
- *
2670
- * In order to use this function, you must upgrade your mod with `ISCFeature.DEBUG_DISPLAY`.
2671
- */
2672
- setEffectDisplay(textCallback: (effect: EntityEffect) => string): void;
2673
- /**
2674
- * If the "toggleNPCDisplay" function is called, text will be drawn on the screen next to each
2675
- * NPC. Use this function to specify a callback function that returns the string that should be
2676
- * drawn.
2677
- *
2678
- * In order to use this function, you must upgrade your mod with `ISCFeature.DEBUG_DISPLAY`.
2679
- */
2680
- setNPCDisplay(textCallback: (npc: EntityNPC) => string): void;
2681
- /**
2682
- * If the "toggleRockDisplay" function is called, text will be drawn on the screen next to each
2683
- * rock. Use this function to specify a callback function that returns the string that should be
2684
- * drawn.
2685
- *
2686
- * In order to use this function, you must upgrade your mod with `ISCFeature.DEBUG_DISPLAY`.
2687
- */
2688
- setRockDisplay(textCallback: (rock: GridEntityRock) => string): void;
2689
- /**
2690
- * If the "togglePitDisplay" function is called, text will be drawn on the screen next to each
2691
- * pit. Use this function to specify a callback function that returns the string that should be
2692
- * drawn.
2693
- *
2694
- * In order to use this function, you must upgrade your mod with `ISCFeature.DEBUG_DISPLAY`.
2695
- */
2696
- setPitDisplay(textCallback: (pit: GridEntityPit) => string): void;
2697
- /**
2698
- * If the "toggleSpikesDisplay" function is called, text will be drawn on the screen next to each
2699
- * spikes. Use this function to specify a callback function that returns the string that should be
2700
- * drawn.
2701
- *
2702
- * In order to use this function, you must upgrade your mod with `ISCFeature.DEBUG_DISPLAY`.
2703
- */
2704
- setSpikesDisplay(textCallback: (spikes: GridEntitySpikes) => string): void;
2705
- /**
2706
- * If the "toggleTNTDisplay" function is called, text will be drawn on the screen next to each
2707
- * TNT. Use this function to specify a callback function that returns the string that should be
2708
- * drawn.
2709
- *
2710
- * In order to use this function, you must upgrade your mod with `ISCFeature.DEBUG_DISPLAY`.
2711
- */
2712
- setTNTDisplay(textCallback: (tnt: GridEntityTNT) => string): void;
2713
- /**
2714
- * If the "togglePoopDisplay" function is called, text will be drawn on the screen next to each
2715
- * poop. Use this function to specify a callback function that returns the string that should be
2716
- * drawn.
2717
- *
2718
- * In order to use this function, you must upgrade your mod with `ISCFeature.DEBUG_DISPLAY`.
2719
- */
2720
- setPoopDisplay(textCallback: (poop: GridEntityPoop) => string): void;
2721
- /**
2722
- * If the "toggleDoorDisplay" function is called, text will be drawn on the screen next to each
2723
- * door. Use this function to specify a callback function that returns the string that should be
2724
- * drawn.
2725
- *
2726
- * In order to use this function, you must upgrade your mod with `ISCFeature.DEBUG_DISPLAY`.
2727
- */
2728
- setDoorDisplay(textCallback: (door: GridEntityDoor) => string): void;
2729
- /**
2730
- * If the "togglePressurePlateDisplay" function is called, text will be drawn on the screen next
2731
- * to each pressure plate. Use this function to specify a callback function that returns the
2732
- * string that should be drawn.
2733
- *
2734
- * In order to use this function, you must upgrade your mod with `ISCFeature.DEBUG_DISPLAY`.
2735
- */
2736
- setPressurePlateDisplay(textCallback: (pressurePlate: GridEntityPressurePlate) => string): void;
2737
- private toggleFeature;
2738
- /**
2739
- * Toggles the debug display for players, which will draw text on the screen next to each player.
2740
- *
2741
- * In order to use this function, you must upgrade your mod with `ISCFeature.DEBUG_DISPLAY`.
2742
- *
2743
- * @param force Optional. A boolean that represents the value to force the display to. For
2744
- * example, you can specify true to always make the display turn on, regardless of
2745
- * whether or not it is already on.
2746
- */
2747
- togglePlayerDisplay(force?: boolean): void;
2748
- /**
2749
- * Toggles the debug display for tears, which will draw text on the screen next to each tear.
2750
- *
2751
- * In order to use this function, you must upgrade your mod with `ISCFeature.DEBUG_DISPLAY`. *
2752
- *
2753
- * @param force Optional. A boolean that represents the value to force the display to. For
2754
- * example, you can specify true to always make the display turn on, regardless of
2755
- * whether or not it is already on.
2756
- */
2757
- toggleTearDisplay(force?: boolean): void;
2758
- /**
2759
- * Toggles the debug display for familiars, which will draw text on the screen next to each
2760
- * familiar.
2761
- *
2762
- * In order to use this function, you must upgrade your mod with `ISCFeature.DEBUG_DISPLAY`.
2763
- *
2764
- * @param force Optional. A boolean that represents the value to force the display to. For
2765
- * example, you can specify true to always make the display turn on, regardless of
2766
- * whether or not it is already on.
2767
- */
2768
- toggleFamiliarDisplay(force?: boolean): void;
2769
- /**
2770
- * Toggles the debug display for bombs, which will draw text on the screen next to each bomb.
2771
- *
2772
- * In order to use this function, you must upgrade your mod with `ISCFeature.DEBUG_DISPLAY`.
2773
- *
2774
- * @param force Optional. A boolean that represents the value to force the display to. For
2775
- * example, you can specify true to always make the display turn on, regardless of
2776
- * whether or not it is already on.
2777
- */
2778
- toggleBombDisplay(force?: boolean): void;
2779
- /**
2780
- * Toggles the debug display for pickups, which will draw text on the screen next to each pickup.
2781
- *
2782
- * In order to use this function, you must upgrade your mod with `ISCFeature.DEBUG_DISPLAY`.
2783
- *
2784
- * @param force Optional. A boolean that represents the value to force the display to. For
2785
- * example, you can specify true to always make the display turn on, regardless of
2786
- * whether or not it is already on.
2787
- */
2788
- togglePickupDisplay(force?: boolean): void;
2789
- /**
2790
- * Toggles the debug display for slots, which will draw text on the screen next to each slot.
2791
- *
2792
- * In order to use this function, you must upgrade your mod with `ISCFeature.DEBUG_DISPLAY`.
2793
- *
2794
- * @param force Optional. A boolean that represents the value to force the display to. For
2795
- * example, you can specify true to always make the display turn on, regardless of
2796
- * whether or not it is already on.
2797
- */
2798
- toggleSlotDisplay(force?: boolean): void;
2799
- /**
2800
- * Toggles the debug display for lasers, which will draw text on the screen next to each laser.
2801
- *
2802
- * In order to use this function, you must upgrade your mod with `ISCFeature.DEBUG_DISPLAY`.
2803
- *
2804
- * @param force Optional. A boolean that represents the value to force the display to. For
2805
- * example, you can specify true to always make the display turn on, regardless of
2806
- * whether or not it is already on.
2807
- */
2808
- toggleLaserDisplay(force?: boolean): void;
2809
- /**
2810
- * Toggles the debug display for knives, which will draw text on the screen next to each knife.
2811
- *
2812
- * In order to use this function, you must upgrade your mod with `ISCFeature.DEBUG_DISPLAY`.
2813
- *
2814
- * @param force Optional. A boolean that represents the value to force the display to. For
2815
- * example, you can specify true to always make the display turn on, regardless of
2816
- * whether or not it is already on.
2817
- */
2818
- toggleKnifeDisplay(force?: boolean): void;
2819
- /**
2820
- * Toggles the debug display for projectiles, which will draw text on the screen next to each
2821
- * projectile.
2822
- *
2823
- * In order to use this function, you must upgrade your mod with `ISCFeature.DEBUG_DISPLAY`.
2824
- *
2825
- * @param force Optional. A boolean that represents the value to force the display to. For
2826
- * example, you can specify true to always make the display turn on, regardless of
2827
- * whether or not it is already on.
2828
- */
2829
- toggleProjectileDisplay(force?: boolean): void;
2830
- /**
2831
- * Toggles the debug display for effects, which will draw text on the screen next to each effect.
2832
- *
2833
- * In order to use this function, you must upgrade your mod with `ISCFeature.DEBUG_DISPLAY`.
2834
- *
2835
- * @param force Optional. A boolean that represents the value to force the display to. For
2836
- * example, you can specify true to always make the display turn on, regardless of
2837
- * whether or not it is already on.
2838
- */
2839
- toggleEffectDisplay(force?: boolean): void;
2840
- /**
2841
- * Toggles the debug display for NPCs, which will draw text on the screen next to each NPC.
2842
- *
2843
- * In order to use this function, you must upgrade your mod with `ISCFeature.DEBUG_DISPLAY`.
2844
- *
2845
- * @param force Optional. A boolean that represents the value to force the display to. For
2846
- * example, you can specify true to always make the display turn on, regardless of
2847
- * whether or not it is already on.
2848
- */
2849
- toggleNPCDisplay(force?: boolean): void;
2850
- /**
2851
- * Toggles the debug display for rocks, which will draw text on the screen next to each rock.
2852
- *
2853
- * In order to use this function, you must upgrade your mod with `ISCFeature.DEBUG_DISPLAY`.
2854
- *
2855
- * @param force Optional. A boolean that represents the value to force the display to. For
2856
- * example, you can specify true to always make the display turn on, regardless of
2857
- * whether or not it is already on.
2858
- */
2859
- toggleRockDisplay(force?: boolean): void;
2860
- /**
2861
- * Toggles the debug display for pits, which will draw text on the screen next to each pit.
2862
- *
2863
- * In order to use this function, you must upgrade your mod with `ISCFeature.DEBUG_DISPLAY`.
2864
- *
2865
- * @param force Optional. A boolean that represents the value to force the display to. For
2866
- * example, you can specify true to always make the display turn on, regardless of
2867
- * whether or not it is already on.
2868
- */
2869
- togglePitDisplay(force?: boolean): void;
2870
- /**
2871
- * Toggles the debug display for spikes, which will draw text on the screen next to each spike.
2872
- *
2873
- * In order to use this function, you must upgrade your mod with `ISCFeature.DEBUG_DISPLAY`.
2874
- *
2875
- * @param force Optional. A boolean that represents the value to force the display to. For
2876
- * example, you can specify true to always make the display turn on, regardless of
2877
- * whether or not it is already on.
2878
- */
2879
- toggleSpikesDisplay(force?: boolean): void;
2880
- /**
2881
- * Toggles the debug display for TNT, which will draw text on the screen next to each TNT.
2882
- *
2883
- * In order to use this function, you must upgrade your mod with `ISCFeature.DEBUG_DISPLAY`.
2884
- *
2885
- * @param force Optional. A boolean that represents the value to force the display to. For
2886
- * example, you can specify true to always make the display turn on, regardless of
2887
- * whether or not it is already on.
2888
- */
2889
- toggleTNTDisplay(force?: boolean): void;
2890
- /**
2891
- * Toggles the debug display for poops, which will draw text on the screen next to each poop.
2892
- *
2893
- * In order to use this function, you must upgrade your mod with `ISCFeature.DEBUG_DISPLAY`.
2894
- *
2895
- * @param force Optional. A boolean that represents the value to force the display to. For
2896
- * example, you can specify true to always make the display turn on, regardless of
2897
- * whether or not it is already on.
2898
- */
2899
- togglePoopDisplay(force?: boolean): void;
2900
- /**
2901
- * Toggles the debug display for doors, which will draw text on the screen next to each door.
2902
- *
2903
- * In order to use this function, you must upgrade your mod with `ISCFeature.DEBUG_DISPLAY`.
2904
- *
2905
- * @param force Optional. A boolean that represents the value to force the display to. For
2906
- * example, you can specify true to always make the display turn on, regardless of
2907
- * whether or not it is already on.
2908
- */
2909
- toggleDoorDisplay(force?: boolean): void;
2910
- /**
2911
- * Toggles the debug display for pressure plates, which will draw text on the screen next to each
2912
- * pressure plate.
2913
- *
2914
- * In order to use this function, you must upgrade your mod with `ISCFeature.DEBUG_DISPLAY`.
2915
- *
2916
- * @param force Optional. A boolean that represents the value to force the display to. For
2917
- * example, you can specify true to always make the display turn on, regardless of
2918
- * whether or not it is already on.
2919
- */
2920
- togglePressurePlateDisplay(force?: boolean): void;
2921
- }
2922
-
2923
2018
  /**
2924
2019
  * `deepCopy` is a semi-generic deep cloner. It will recursively copy all of the values so that none
2925
2020
  * of the nested references remain.
@@ -3123,45 +2218,6 @@ export declare function defaultMapSetPlayer<V>(map: Map<PlayerIndex, V>, player:
3123
2218
  */
3124
2219
  export declare function deleteSetsFromSet<T>(mainSet: Set<T>, ...setsToRemove: Array<Set<T> | ReadonlySet<T>>): void;
3125
2220
 
3126
- declare class DeployJSONRoom extends Feature {
3127
- private preventGridEntityRespawn;
3128
- private spawnCollectible;
3129
- private spawnAllEntities;
3130
- private spawnNormalEntityForJSONRoom;
3131
- /**
3132
- * Helper function to deconstruct a vanilla room and set up a custom room in its place.
3133
- * Specifically, this will clear the current room of all entities and grid entities, and then
3134
- * spawn all of the entries and grid entities in the provided JSON room.
3135
- *
3136
- * A JSON room is simply an XML file converted to JSON. You can create JSON rooms by using the
3137
- * Basement Renovator room editor to create an XML file, and then convert it to JSON using the
3138
- * `convert-xml-to-json` tool (e.g. `npx convert-xml-to-json my-rooms.xml`).
3139
- *
3140
- * This function is meant to be used in the `POST_NEW_ROOM` callback.
3141
- *
3142
- * For example:
3143
- *
3144
- * ```ts
3145
- *
3146
- * import customRooms from "./customRooms.json";
3147
- *
3148
- * export function postNewRoom(): void {
3149
- * const firstJSONRoom = customRooms.rooms.room[0];
3150
- * deployJSONRoom(firstJSONRoom);
3151
- * }
3152
- * ```
3153
- *
3154
- * In order to use this function, you must upgrade your mod with `ISCFeature.DEPLOY_JSON_ROOM`.
3155
- *
3156
- * @param jsonRoom The JSON room to deploy.
3157
- * @param seedOrRNG Optional. The `Seed` or `RNG` object to use. If an `RNG` object is provided,
3158
- * the `RNG.Next` method will be called. Default is `getRandomSeed()`.
3159
- * @param verbose Optional. If specified, will write entries to the "log.txt" file that describe
3160
- * what the function is doing. Default is false.
3161
- */
3162
- deployJSONRoom(jsonRoom: JSONRoom | Readonly<JSONRoom>, seedOrRNG?: Seed | RNG, verbose?: boolean): void;
3163
- }
3164
-
3165
2221
  /**
3166
2222
  * Helper function to remove a collectible or trinket that is currently queued to go into a player's
3167
2223
  * inventory (i.e. the item is being held over their head).
@@ -3222,130 +2278,8 @@ export declare function directionToShootAction(direction: Direction): ButtonActi
3222
2278
 
3223
2279
  export declare function directionToVector(direction: Direction): Readonly<Vector>;
3224
2280
 
3225
- declare class DisableAllSound extends Feature {
3226
- private musicWasEnabled;
3227
- private postRender;
3228
- /**
3229
- * Helper function to stop muting all sound effects and music.
3230
- *
3231
- * Use this function to set things back to normal after having used `disableAllSounds`.
3232
- *
3233
- * In order to use this function, you must upgrade your mod with `ISCFeature.DISABLE_ALL_SOUND`.
3234
- *
3235
- * @param key The name of the mod feature that is requesting the enable/disable. This is needed so
3236
- * that multiple mod features can work in tandem.
3237
- */
3238
- enableAllSound(key: string): void;
3239
- /**
3240
- * Helper function to disable all sound effects and music (by constantly musting them).
3241
- *
3242
- * Use the `enableAllSounds` helper function to set things back to normal.
3243
- *
3244
- * In order to use this function, you must upgrade your mod with `ISCFeature.DISABLE_ALL_SOUND`.
3245
- *
3246
- * @param key The name of the mod feature that is requesting the enable/disable. This is needed so
3247
- * that multiple mod features can work in tandem.
3248
- */
3249
- disableAllSound(key: string): void;
3250
- }
3251
-
3252
- declare class DisableInputs extends Feature {
3253
- private isActionPressed;
3254
- private isActionTriggered;
3255
- private getActionValue;
3256
- private getReturnValue;
3257
- /**
3258
- * Helper function to enable all inputs. Use this function to set things back to normal after
3259
- * having used one of the other helper functions to disable inputs.
3260
- *
3261
- * In order to use this function, you must upgrade your mod with `ISCFeature.DISABLE_INPUTS`.
3262
- *
3263
- * @param key The name of the mod feature that is requesting the enable/disable. This is needed so
3264
- * that multiple mod features can work in tandem.
3265
- */
3266
- enableAllInputs(key: string): void;
3267
- /**
3268
- * Helper function to disable specific inputs, like opening the console.
3269
- *
3270
- * This function is variadic, meaning that you can pass as many inputs as you want to disable. (To
3271
- * disable all inputs, see the `disableAllInputs` function.
3272
- *
3273
- * Use the `enableAllInputs` helper function to set things back to normal.
3274
- *
3275
- * In order to use this function, you must upgrade your mod with `ISCFeature.DISABLE_INPUTS`.
3276
- *
3277
- * @param key The name of the mod feature that is requesting the enable/disable. This is needed so
3278
- * that multiple mod features can work in tandem.
3279
- * @param buttonActions An array of the actions to action.
3280
- */
3281
- disableInputs(key: string, ...buttonActions: ButtonAction[]): void;
3282
- /**
3283
- * Helper function to disable all inputs. This is useful because `EntityPlayer.ControlsEnabled`
3284
- * can be changed by the game under certain conditions.
3285
- *
3286
- * Use the `enableAllInputs` helper function to set things back to normal.
3287
- *
3288
- * In order to use this function, you must upgrade your mod with `ISCFeature.DISABLE_INPUTS`.
3289
- *
3290
- * @param key The name of the mod feature that is requesting the enable/disable. This is needed so
3291
- * that multiple mod features can work in tandem.
3292
- */
3293
- disableAllInputs(key: string): void;
3294
- /**
3295
- * Helper function to enable all inputs besides the ones provided. This is useful because
3296
- * `EntityPlayer.ControlsEnabled` can be changed by the game under certain conditions.
3297
- *
3298
- * Use the `enableAllInputs` helper function to set things back to normal.
3299
- *
3300
- * In order to use this function, you must upgrade your mod with `ISCFeature.DISABLE_INPUTS`.
3301
- *
3302
- * @param key The name of the mod feature that is requesting the enable/disable. This is needed so
3303
- * that multiple mod features can work in tandem.
3304
- * @param blacklist A set of ButtonActions to disallow.
3305
- */
3306
- enableAllInputsExceptFor(key: string, blacklist: Set<ButtonAction> | ReadonlySet<ButtonAction>): void;
3307
- /**
3308
- * Helper function to disable all inputs besides the ones provided. This is useful because
3309
- * `EntityPlayer.ControlsEnabled` can be changed by the game under certain conditions.
3310
- *
3311
- * Use the `enableAllInputs` helper function to set things back to normal.
3312
- *
3313
- * In order to use this function, you must upgrade your mod with `ISCFeature.DISABLE_INPUTS`.
3314
- *
3315
- * @param key The name of the mod feature that is requesting the enable/disable. This is needed so
3316
- * that multiple mod features can work in tandem.
3317
- * @param whitelist A set of ButtonActions to allow.
3318
- */
3319
- disableAllInputsExceptFor(key: string, whitelist: Set<ButtonAction> | ReadonlySet<ButtonAction>): void;
3320
- /**
3321
- * Helper function to disable only the inputs used for moving the character (or moving the cursor
3322
- * in the UI). This is useful because `EntityPlayer.ControlsEnabled` can be changed by the game
3323
- * under certain conditions.
3324
- *
3325
- * Use the `enableAllInputs` helper function to set things back to normal.
3326
- *
3327
- * In order to use this function, you must upgrade your mod with `ISCFeature.DISABLE_INPUTS`.
3328
- *
3329
- * @param key The name of the mod feature that is requesting the enable/disable. This is needed so
3330
- * that multiple mod features can work in tandem.
3331
- */
3332
- disableMovementInputs(key: string): void;
3333
- /**
3334
- * Helper function to disable only the inputs used for shooting tears. This is useful because
3335
- * `EntityPlayer.ControlsEnabled` can be changed by the game under certain conditions.
3336
- *
3337
- * Use the `enableAllInputs` helper function to set things back to normal.
3338
- *
3339
- * In order to use this function, you must upgrade your mod with `ISCFeature.DISABLE_INPUTS`.
3340
- *
3341
- * @param key The name of the mod feature that is requesting the enable/disable. This is needed so
3342
- * that multiple mod features can work in tandem.
3343
- */
3344
- disableShootingInputs(key: string): void;
3345
- }
3346
-
3347
- /** This is also the distance that a player spawns from the door that they enter a room from. */
3348
- export declare const DISTANCE_OF_GRID_TILE = 40;
2281
+ /** This is also the distance that a player spawns from the door that they enter a room from. */
2282
+ export declare const DISTANCE_OF_GRID_TILE = 40;
3349
2283
 
3350
2284
  /**
3351
2285
  * Helper function to check if one or more matching entities exist in the current room. It uses the
@@ -3691,21 +2625,6 @@ export declare function eRange(start: int, end?: int, increment?: number): int[]
3691
2625
 
3692
2626
  declare type ErrorIsaacAPIClassIsNotSerializable = "Error: Isaac API classes (such as e.g. `Entity` or `RoomConfig`) are not serializable. For more information, see: https://isaacscript.github.io/main/gotchas#isaac-api-classes-are-not-serializable";
3693
2627
 
3694
- declare class EsauJrDetection extends Feature {
3695
- v: {
3696
- run: {
3697
- usedEsauJrFrame: number | null;
3698
- usedEsauJrControllerIndex: ControllerIndex | null;
3699
- usedEsauJrAtLeastOnce: boolean;
3700
- };
3701
- };
3702
- private postEsauJr;
3703
- private postFirstEsauJr;
3704
- constructor(postEsauJr: PostEsauJr, postFirstEsauJr: PostFirstEsauJr);
3705
- private postUpdate;
3706
- private useItemEsauJr;
3707
- }
3708
-
3709
2628
  /**
3710
2629
  * These are a collection of functions for non-TypeScript users so that they can access some of
3711
2630
  * useful methods offered on the `Array` class in the JavaScript standard library.
@@ -3723,110 +2642,12 @@ declare class EsauJrDetection extends Feature {
3723
2642
  */
3724
2643
  export declare function every<T>(array: T[], func: (value: T, index: number, array: T[]) => boolean): boolean;
3725
2644
 
3726
- declare class ExtraConsoleCommands extends Feature {
3727
- private commandFunctionMap;
3728
- private postUpdate;
3729
- private evaluateCacheDamage;
3730
- private evaluateCacheFireDelay;
3731
- private evaluateCacheSpeed;
3732
- private evaluateCacheFlying;
3733
- private postCurseEval;
3734
- private executeCmd;
3735
- private postFireTear;
3736
- private entityTakeDmgPlayer;
3737
- /**
3738
- * Helper function to add a custom console command.
3739
- *
3740
- * The standard library comes with many existing console commands that are useful for debugging,
3741
- * but you can also add your own commands that are useful for your particular mod. It's easier to
3742
- * add commands to the existing command system than to add your own logic manually to the
3743
- * `EXECUTE_CMD` callback.
3744
- *
3745
- * In order to use this function, you must upgrade your mod with
3746
- * `ISCFeature.EXTRA_CONSOLE_COMMANDS`.
3747
- */
3748
- addConsoleCommand(commandName: string, commandFunction: (params: string) => void): void;
3749
- /**
3750
- * Helper function to remove a custom console command.
3751
- *
3752
- * The standard library comes with many existing console commands that are useful for debugging.
3753
- * If you want to disable one of them, use this function.
3754
- *
3755
- * In order to use this function, you must upgrade your mod with
3756
- * `ISCFeature.EXTRA_CONSOLE_COMMANDS`.
3757
- */
3758
- removeConsoleCommand(commandName: string): void;
3759
- }
3760
-
3761
2645
  /**
3762
2646
  * A function that creates the default value for your `DefaultMap`. For example, if it was a
3763
2647
  * `DefaultMap` containing maps, the factory function would be: `() => new Map()`
3764
2648
  */
3765
2649
  export declare type FactoryFunction<V, Args extends unknown[]> = (...args: Args) => V;
3766
2650
 
3767
- declare class FadeInRemover extends Feature {
3768
- private enabled;
3769
- private postGameStarted;
3770
- /**
3771
- * Removes the fade-in that occurs at the beginning of a run. If this behavior is desired, call
3772
- * this function once at the beginning of your mod.
3773
- *
3774
- * This is useful for debugging, when you are resetting the game often.
3775
- *
3776
- * You can restore the vanilla behavior with the `restoreFadeIn` function.
3777
- *
3778
- * In order to use this function, you must upgrade your mod with `ISCFeature.FADE_IN_REMOVER`.
3779
- */
3780
- removeFadeIn(): void;
3781
- /**
3782
- * Disables the fade-in remover. Only useful if you have previously called the `removeFadeIn`
3783
- * function.
3784
- *
3785
- * In order to use this function, you must upgrade your mod with `ISCFeature.FADE_IN_REMOVER`.
3786
- */
3787
- restoreFadeIn(): void;
3788
- }
3789
-
3790
- declare class FastReset extends Feature {
3791
- private enabled;
3792
- private postRender;
3793
- /**
3794
- * Enables the fast-reset feature, which allows you to restart the game instantaneously. If this
3795
- * behavior is desired, call this function once at the beginning of your mod.
3796
- *
3797
- * This is useful for debugging, when you are resetting the game often.
3798
- *
3799
- * You can disable the fast-reset feature with the `disableFastReset` function.
3800
- *
3801
- * In order to use this function, you must upgrade your mod with `ISCFeature.FAST_RESET`.
3802
- */
3803
- enableFastReset(): void;
3804
- /**
3805
- * Disables the fast-reset feature. Only useful if you have previously called the
3806
- * `enableFastReset` function.
3807
- *
3808
- * In order to use this function, you must upgrade your mod with `ISCFeature.FAST_RESET`.
3809
- */
3810
- disableFastReset(): void;
3811
- }
3812
-
3813
- /**
3814
- * The IsaacScript standard library contains many optional features, such as the ability to create
3815
- * custom pickups. All features are optional and are only initialized when needed. This class
3816
- * contains elements to facilitate that.
3817
- *
3818
- * Additionally, all custom callbacks extend from this class.
3819
- */
3820
- declare abstract class Feature {
3821
- /**
3822
- * All features should only be instantiated once and are passed around to other features using
3823
- * dependency injection. We provide a run-time check in order to prevent the bug of any feature
3824
- * accidentally being instantiated twice.
3825
- */
3826
- private static constructedClassNames;
3827
- constructor();
3828
- }
3829
-
3830
2651
  export declare function fillLevelWithRedRooms(): void;
3831
2652
 
3832
2653
  /**
@@ -3859,8 +2680,6 @@ export declare function find<T>(array: T[], func: (value: T, index: number, arra
3859
2680
  */
3860
2681
  export declare function findFreePosition(startingPosition: Vector, avoidActiveEntities?: boolean, minimumDistance?: float): Vector;
3861
2682
 
3862
- declare type FireArgs<T extends ModCallbackCustom> = Parameters<AddCallbackParametersCustom[T][0]>;
3863
-
3864
2683
  /**
3865
2684
  * Helper function to make an NPC fire one or more projectiles. Returns the fired projectile(s).
3866
2685
  *
@@ -3927,30 +2746,6 @@ export declare const FIRST_STAGE = LevelStage.BASEMENT_1;
3927
2746
  /** Equal to `TrinketType.SWALLOWED_PENNY`. */
3928
2747
  export declare const FIRST_TRINKET_TYPE = TrinketType.SWALLOWED_PENNY;
3929
2748
 
3930
- declare class FlipDetection extends Feature {
3931
- v: {
3932
- run: {
3933
- /** We don't consider the case of a multiplayer game with more than one Tainted Lazarus. */
3934
- usedFlipAtLeastOnce: boolean;
3935
- };
3936
- };
3937
- private postFlip;
3938
- private postFirstFlip;
3939
- constructor(postFlip: PostFlip, postFirstFlip: PostFirstFlip);
3940
- private useItemFlip;
3941
- }
3942
-
3943
- declare class FlyingDetection extends Feature {
3944
- private moddedElementSets;
3945
- /**
3946
- * Helper function to see if the player currently has flying from a temporary effect such as
3947
- * Hanged Man, Bat Wing, and so on.
3948
- *
3949
- * In order to use this function, you must upgrade your mod with `ISCFeature.FLYING_DETECTION`.
3950
- */
3951
- hasFlyingTemporaryEffect(player: EntityPlayer): boolean;
3952
- }
3953
-
3954
2749
  /**
3955
2750
  * An object containing all 7 vanilla fonts that are pre-loaded and ready to use.
3956
2751
  *
@@ -3974,17 +2769,6 @@ export declare const fonts: {
3974
2769
  */
3975
2770
  export declare function forEach<T>(array: T[], func: (value: T, index: number, array: T[]) => void): void;
3976
2771
 
3977
- declare class ForgottenSwitch extends Feature {
3978
- private pressInput;
3979
- /**
3980
- * When used on The Forgotten, switches to The Soul. When used on The Soul, switches to The
3981
- * Forgotten. This takes 1 game frame to take effect.
3982
- *
3983
- * In order to use this function, you must upgrade your mod with `ISCFeature.FORGOTTEN_SWITCH`.
3984
- */
3985
- forgottenSwitch(player: EntityPlayer): void;
3986
- }
3987
-
3988
2772
  declare type FunctionIsNotSerializable = "Error: Functions are not serializable. For more information, see: https://isaacscript.github.io/main/gotchas#functions-are-not-serializable";
3989
2773
 
3990
2774
  /** Helper type to represent a tuple containing the name of a function and the function itself. */
@@ -4006,77 +2790,6 @@ export declare const GAME_FRAMES_PER_MINUTE: number;
4006
2790
  /** Game frames are what is returned by the `Game.GetFrameCount` method. */
4007
2791
  export declare const GAME_FRAMES_PER_SECOND = 30;
4008
2792
 
4009
- /**
4010
- * By default, callbacks fire in the following order:
4011
- * - `POST_NEW_ROOM` --> `POST_NEW_LEVEL` --> `POST_GAME_STARTED`
4012
- *
4013
- * It is easier to write mod code if the callbacks run in a more logical order:
4014
- * - `POST_GAME_STARTED` --> `POST_NEW_LEVEL` --> `POST_NEW_ROOM`
4015
- *
4016
- * `isaacscript-common` provides three new callbacks that change the order to this:
4017
- * - `POST_GAME_STARTED_REORDERED`
4018
- * - `POST_NEW_LEVEL_REORDERED`
4019
- * - `POST_NEW_ROOM_REORDERED`
4020
- *
4021
- * Additionally, there are some helper functions listed below that can deal with some edge cases
4022
- * that you may run into with these callbacks.
4023
- */
4024
- declare class GameReorderedCallbacks extends Feature {
4025
- private currentStage;
4026
- private currentStageType;
4027
- private usedGlowingHourGlass;
4028
- private forceNewLevel;
4029
- private forceNewRoom;
4030
- private postGameStartedReordered;
4031
- private postNewLevelReordered;
4032
- private postNewRoomReordered;
4033
- private postGameStartedReorderedLast;
4034
- private useItemGlowingHourGlass;
4035
- private postGameStarted;
4036
- private postNewLevel;
4037
- private postNewRoom;
4038
- private recordCurrentStage;
4039
- /**
4040
- * Helper function to tell the `POST_NEW_LEVEL_REORDERED` callback that it should always fire on
4041
- * the next `POST_NEW_LEVEL`.
4042
- *
4043
- * If some specific cases, mods can change the current level during run initialization on the 0th
4044
- * frame. (For example, if you had a mod that made the player start the run in Caves instead of
4045
- * Basement.) However, due to how the callback reordering works, the `POST_NEW_LEVEL_REORDERED`
4046
- * callback will never fire on the 0th frame. To get around this, call this function before
4047
- * changing levels to temporarily force the callback to fire.
4048
- *
4049
- * In order to use this function, you must upgrade your mod with
4050
- * `ISCFeature.GAME_REORDERED_CALLBACKS`.
4051
- */
4052
- forceNewLevelCallback(): void;
4053
- /**
4054
- * Helper function to tell the `POST_NEW_ROOM_REORDERED` callback that it should always fire on
4055
- * the next `POST_NEW_ROOM`.
4056
- *
4057
- * If some specific cases, mods can change the current room during run initialization on the 0th
4058
- * frame. (For example, if you had a mod that made the player start the Treasure Room of Basement
4059
- * 1 instead of the normal starting room.) However, due to how the callback reordering works, the
4060
- * `POST_NEW_ROOM_REORDERED` callback will never fire on the 0th frame. To get around this, call
4061
- * this function before changing rooms to temporarily force the callback to fire.
4062
- *
4063
- * In order to use this function, you must upgrade your mod with
4064
- * `ISCFeature.GAME_REORDERED_CALLBACKS`.
4065
- */
4066
- forceNewRoomCallback(): void;
4067
- /**
4068
- * Helper function to manually set the variables that the reordered callback logic uses to track
4069
- * the current stage and stage type.
4070
- *
4071
- * This is useful because if the stage is changed with the `Game.SetStage` method (or the
4072
- * `setStage` helper function), the reordered callbacks will stop working.
4073
- *
4074
- * In order to use this function, you must upgrade your mod with
4075
- * `ISCFeature.GAME_REORDERED_CALLBACKS`.
4076
- */
4077
- reorderedCallbacksSetStage(stage: LevelStage, stageType: StageType): void;
4078
- }
4079
-
4080
2793
  /**
4081
2794
  * Helper function to find the active slot that the player has the corresponding collectible type
4082
2795
  * in. Returns undefined if the player does not have the collectible in any active slot.
@@ -6768,20 +5481,6 @@ export declare const GRID_INDEX_CENTER_OF_1X1_ROOM = 67;
6768
5481
  */
6769
5482
  export declare function gridCoordinatesToWorldPosition(x: int, y: int): Vector;
6770
5483
 
6771
- declare class GridEntityCollisionDetection extends Feature {
6772
- v: {
6773
- room: {
6774
- /** Indexed by grid entity pointer hash. */
6775
- collidingEntitiesMap: DefaultMap<PtrHash, Set<PtrHash>, []>;
6776
- };
6777
- };
6778
- private postGridEntityCollision;
6779
- private postGridEntityCustomCollision;
6780
- private customGridEntities;
6781
- constructor(postGridEntityCollision: PostGridEntityCollision, postGridEntityCustomCollision: PostGridEntityCustomCollision, customGridEntities: CustomGridEntities);
6782
- private postUpdate;
6783
- }
6784
-
6785
5484
  /**
6786
5485
  * This is meta-data that describes a custom grid entity.
6787
5486
  *
@@ -6811,47 +5510,6 @@ export declare type GridEntityID = string & {
6811
5510
  readonly __gridEntityIDBrand: symbol;
6812
5511
  };
6813
5512
 
6814
- declare class GridEntityRenderDetection extends Feature {
6815
- private postGridEntityRender;
6816
- private postGridEntityCustomRender;
6817
- private customGridEntities;
6818
- constructor(postGridEntityRender: PostGridEntityRender, postGridEntityCustomRender: PostGridEntityCustomRender, customGridEntities: CustomGridEntities);
6819
- private postRender;
6820
- }
6821
-
6822
- declare type GridEntityTuple = [
6823
- gridEntityType: GridEntityType,
6824
- variant: int,
6825
- state: int
6826
- ];
6827
-
6828
- declare class GridEntityUpdateDetection extends Feature {
6829
- v: {
6830
- room: {
6831
- /** Indexed by grid index. */
6832
- initializedGridEntities: Map<number, GridEntityTuple>;
6833
- };
6834
- };
6835
- private postGridEntityInit;
6836
- private postGridEntityCustomInit;
6837
- private postGridEntityUpdate;
6838
- private postGridEntityCustomUpdate;
6839
- private postGridEntityRemove;
6840
- private postGridEntityCustomRemove;
6841
- private postGridEntityStateChanged;
6842
- private postGridEntityCustomStateChanged;
6843
- private postGridEntityBroken;
6844
- private postGridEntityCustomBroken;
6845
- private customGridEntities;
6846
- constructor(postGridEntityInit: PostGridEntityInit, postGridEntityCustomInit: PostGridEntityCustomInit, postGridEntityUpdate: PostGridEntityUpdate, postGridEntityCustomUpdate: PostGridEntityCustomUpdate, postGridEntityRemove: PostGridEntityRemove, postGridEntityCustomRemove: PostGridEntityCustomRemove, postGridEntityStateChanged: PostGridEntityStateChanged, postGridEntityCustomStateChanged: PostGridEntityCustomStateChanged, postGridEntityBroken: PostGridEntityBroken, postGridEntityCustomBroken: PostGridEntityCustomBroken, customGridEntities: CustomGridEntities);
6847
- private postUpdate;
6848
- private checkGridEntitiesRemoved;
6849
- private checkGridEntityStateChanged;
6850
- private checkNewGridEntity;
6851
- private updateTupleInMap;
6852
- private postNewRoomReordered;
6853
- }
6854
-
6855
5513
  /**
6856
5514
  * Helper function to convert a grid index to a grid position.
6857
5515
  *
@@ -7418,79 +6076,6 @@ export declare enum ISCFeature {
7418
6076
  TAINTED_LAZARUS_PLAYERS = 53
7419
6077
  }
7420
6078
 
7421
- /**
7422
- * We want to only extract the class public methods, so we omit the keys of the `Feature` base
7423
- * class.
7424
- */
7425
- declare type ISCFeaturesToKeys<T extends readonly ISCFeature[]> = Omit<TupleToIntersection<ISCFeatureTupleToClassTuple<Writeable<T>>>, keyof Feature>;
7426
-
7427
- declare interface ISCFeatureToClass {
7428
- [ISCFeature.CUSTOM_REVIVE]: CustomRevive;
7429
- [ISCFeature.ESAU_JR_DETECTION]: EsauJrDetection;
7430
- [ISCFeature.FLIP_DETECTION]: FlipDetection;
7431
- [ISCFeature.GRID_ENTITY_COLLISION_DETECTION]: GridEntityCollisionDetection;
7432
- [ISCFeature.GRID_ENTITY_RENDER_DETECTION]: GridEntityRenderDetection;
7433
- [ISCFeature.GRID_ENTITY_UPDATE_DETECTION]: GridEntityUpdateDetection;
7434
- [ISCFeature.GAME_REORDERED_CALLBACKS]: GameReorderedCallbacks;
7435
- [ISCFeature.ITEM_PICKUP_DETECTION]: ItemPickupDetection;
7436
- [ISCFeature.PLAYER_COLLECTIBLE_DETECTION]: PlayerCollectibleDetection;
7437
- [ISCFeature.PLAYER_REORDERED_CALLBACKS]: PlayerReorderedCallbacks;
7438
- [ISCFeature.SLOT_DESTROYED_DETECTION]: SlotDestroyedDetection;
7439
- [ISCFeature.SLOT_RENDER_DETECTION]: SlotRenderDetection;
7440
- [ISCFeature.SLOT_UPDATE_DETECTION]: SlotUpdateDetection;
7441
- [ISCFeature.CHARACTER_HEALTH_CONVERSION]: CharacterHealthConversion;
7442
- [ISCFeature.CHARACTER_STATS]: CharacterStats;
7443
- [ISCFeature.COLLECTIBLE_ITEM_POOL_TYPE]: CollectibleItemPoolType;
7444
- [ISCFeature.CUSTOM_GRID_ENTITIES]: CustomGridEntities;
7445
- [ISCFeature.CUSTOM_ITEM_POOLS]: CustomItemPools;
7446
- [ISCFeature.CUSTOM_HOTKEYS]: CustomHotkeys;
7447
- [ISCFeature.CUSTOM_PICKUPS]: CustomPickups;
7448
- [ISCFeature.CUSTOM_STAGES]: CustomStages;
7449
- [ISCFeature.CUSTOM_TRAPDOORS]: CustomTrapdoors;
7450
- [ISCFeature.DEBUG_DISPLAY]: DebugDisplay;
7451
- [ISCFeature.DEPLOY_JSON_ROOM]: DeployJSONRoom;
7452
- [ISCFeature.DISABLE_ALL_SOUND]: DisableAllSound;
7453
- [ISCFeature.DISABLE_INPUTS]: DisableInputs;
7454
- [ISCFeature.FADE_IN_REMOVER]: FadeInRemover;
7455
- [ISCFeature.FAST_RESET]: FastReset;
7456
- [ISCFeature.FLYING_DETECTION]: FlyingDetection;
7457
- [ISCFeature.FORGOTTEN_SWITCH]: ForgottenSwitch;
7458
- [ISCFeature.EXTRA_CONSOLE_COMMANDS]: ExtraConsoleCommands;
7459
- [ISCFeature.ITEM_POOL_DETECTION]: ItemPoolDetection;
7460
- [ISCFeature.MODDED_ELEMENT_DETECTION]: ModdedElementDetection;
7461
- [ISCFeature.MODDED_ELEMENT_SETS]: ModdedElementSets;
7462
- [ISCFeature.NO_SIREN_STEAL]: NoSirenSteal;
7463
- [ISCFeature.PAUSE]: Pause;
7464
- [ISCFeature.PERSISTENT_ENTITIES]: PersistentEntities;
7465
- [ISCFeature.PICKUP_INDEX_CREATION]: PickupIndexCreation;
7466
- [ISCFeature.PLAYER_INVENTORY]: PlayerInventory;
7467
- [ISCFeature.PONY_DETECTION]: PonyDetection;
7468
- [ISCFeature.PRESS_INPUT]: PressInput;
7469
- [ISCFeature.PREVENT_CHILD_ENTITIES]: PreventChildEntities;
7470
- [ISCFeature.PREVENT_COLLECTIBLE_ROTATION]: PreventCollectibleRotation;
7471
- [ISCFeature.PREVENT_GRID_ENTITY_RESPAWN]: PreventGridEntityRespawn;
7472
- [ISCFeature.ROOM_CLEAR_FRAME]: RoomClearFrame;
7473
- [ISCFeature.ROOM_HISTORY]: RoomHistory;
7474
- [ISCFeature.RUN_IN_N_FRAMES]: RunInNFrames;
7475
- [ISCFeature.RUN_NEXT_ROOM]: RunNextRoom;
7476
- [ISCFeature.SAVE_DATA_MANAGER]: SaveDataManager;
7477
- [ISCFeature.SPAWN_ALT_ROCK_REWARDS]: SpawnRockAltRewards;
7478
- [ISCFeature.SPAWN_COLLECTIBLE]: SpawnCollectible;
7479
- [ISCFeature.STAGE_HISTORY]: StageHistory;
7480
- [ISCFeature.START_AMBUSH]: StartAmbush;
7481
- [ISCFeature.TAINTED_LAZARUS_PLAYERS]: TaintedLazarusPlayers;
7482
- }
7483
-
7484
- declare type ISCFeatureTuple<T extends readonly ISCFeature[]> = ISCFeature extends T["length"] ? 'The list of features must be a tuple. Use the "as const" assertion when declaring the array.' : T;
7485
-
7486
- /**
7487
- * We need to use the `PublicInterface` helper type because an intersection of two classes with the
7488
- * same private fields will cause a `never` type.
7489
- */
7490
- declare type ISCFeatureTupleToClassTuple<T extends ISCFeature[]> = {
7491
- [Key in keyof T]: PublicInterface<ISCFeatureToClass[T[Key]]>;
7492
- };
7493
-
7494
6079
  /**
7495
6080
  * Helper function to check if a player is a specific character (i.e. `PlayerType`).
7496
6081
  *
@@ -8228,61 +6813,6 @@ export declare function isVector(object: unknown): object is Vector;
8228
6813
  */
8229
6814
  export declare const itemConfig: ItemConfig;
8230
6815
 
8231
- declare class ItemPickupDetection extends Feature {
8232
- v: {
8233
- run: {
8234
- playersPickingUpItemMap: DefaultMap<PlayerIndex, PickingUpItem, []>;
8235
- };
8236
- };
8237
- private postItemPickup;
8238
- private preItemPickup;
8239
- constructor(postItemPickup: PostItemPickup, preItemPickup: PreItemPickup);
8240
- private postPEffectUpdateReordered;
8241
- private queueEmpty;
8242
- private queueNotEmpty;
8243
- }
8244
-
8245
- declare class ItemPoolDetection extends Feature {
8246
- private moddedElementSets;
8247
- /**
8248
- * Helper function to get the remaining collectibles in a given item pool. This function is
8249
- * expensive, so only use it in situations where the lag is acceptable.
8250
- *
8251
- * In order to use this function, you must upgrade your mod with `ISCFeature.ITEM_POOL_DETECTION`.
8252
- */
8253
- getCollectiblesInItemPool(itemPoolType: ItemPoolType): CollectibleType[];
8254
- /**
8255
- * Helper function to see if the given collectible is still present in the given item pool.
8256
- *
8257
- * If the collectible is non-offensive, any Tainted Losts will be temporarily changed to Isaac and
8258
- * then changed back. (This is because Tainted Lost is not able to retrieve non-offensive
8259
- * collectibles from item pools).
8260
- *
8261
- * Under the hood, this function works by using the `ItemPool.AddRoomBlacklist` method to
8262
- * blacklist every collectible except for the one provided.
8263
- *
8264
- * In order to use this function, you must upgrade your mod with `ISCFeature.ITEM_POOL_DETECTION`.
8265
- */
8266
- isCollectibleInItemPool(collectibleType: CollectibleType, itemPoolType: ItemPoolType): boolean;
8267
- /**
8268
- * Helper function to see if the given collectible is unlocked on the current save file. This
8269
- * requires providing the corresponding item pool that the collectible is normally located in.
8270
- *
8271
- * - If any player currently has the collectible, then it is assumed to be unlocked. (This is
8272
- * because in almost all cases, when a collectible is added to a player's inventory, it is
8273
- * subsequently removed from all pools.)
8274
- * - If the collectible is located in more than one item pool, then any item pool can be provided.
8275
- * - If the collectible is not located in any item pools, then this function will always return
8276
- * false.
8277
- * - If the collectible is non-offensive, any Tainted Losts will be temporarily changed to Isaac
8278
- * and then changed back. (This is because Tainted Lost is not able to retrieve non-offensive
8279
- * collectibles from item pools).
8280
- *
8281
- * In order to use this function, you must upgrade your mod with `ISCFeature.ITEM_POOL_DETECTION`.
8282
- */
8283
- isCollectibleUnlocked(collectibleType: CollectibleType, itemPoolType: ItemPoolType): boolean;
8284
- }
8285
-
8286
6816
  /**
8287
6817
  * Helper function to iterate over a table deterministically. This is useful because by default, the
8288
6818
  * `pairs` function will return the keys of a Lua table in a random order.
@@ -10808,943 +9338,138 @@ export declare enum ModCallbackCustom {
10808
9338
  }
10809
9339
 
10810
9340
  /**
10811
- * Mods can add extra things to the game (e.g. collectibles, trinkets, and so on). Since mods load
10812
- * in alphabetical order, the total number of things can't be properly be known until at least one
10813
- * callback fires (which indicates that all mods have been loaded).
9341
+ * Helper class for mods that want to represent their individual features as classes. Extend your
9342
+ * mod features from this class in order to enable the `@Callback` and `@CustomCallback` decorators
9343
+ * that automatically subscribe to callbacks.
9344
+ *
9345
+ * When instantiating a mod feature class, you must pass your upgraded mod as the first argument to
9346
+ * the constructor.
9347
+ *
9348
+ * If your feature has variables that are managed by the save data manager, you need to explicitly
9349
+ * register them with the save data manager yourself in your class constructor. (It can't be
9350
+ * automatically done because parent classes don't have access to child class properties.)
9351
+ *
9352
+ * In almost all cases, you will want the callback functions to be immediately subscribed after
9353
+ * instantiating the class. However, if this is not the case, you can pass `false` as the optional
9354
+ * second argument to the constructor.
10814
9355
  *
10815
- * This feature gates all such functions behind a callback check. Subsequently, these functions will
10816
- * throw a runtime error if they are called in the menu, before any callbacks have occurred. This
10817
- * ensures that the proper values are always returned and allows you to get immediate feedback if
10818
- * you accidentally access them from the menu.
9356
+ * If your mod feature has a property called `v`, it will be assumed that these are variables that
9357
+ * should be managed by the save data manager. Subsequently, they will automatically be registered
9358
+ * with the save data manager upon initialization. Unfortunately, due to technical limitations with
9359
+ * classes, this registration will only occur if you initialize the class with the `init` boolean
9360
+ * argument set to false, and then explicitly call the `ModFeature.init` method yourself after the
9361
+ * class is constructed. (This is because the parent class does not have access to the child's
9362
+ * properties upon first construction.)
10819
9363
  */
10820
- declare class ModdedElementDetection extends Feature {
10821
- private atLeastOneCallbackFired;
10822
- private postPlayerInit;
10823
- private errorIfNoCallbacksFired;
9364
+ export declare class ModFeature {
9365
+ private mod;
10824
9366
  /**
10825
- * Returns the first modded collectible type, or undefined if there are no modded collectibles.
9367
+ * An optional method that allows for conditional callback execution. If specified, any class
9368
+ * method that is annotated with a `@Callback` or `@CallbackCustom` decorator will only be fired
9369
+ * if the executed conditional function returns true.
10826
9370
  *
10827
- * This function can only be called if at least one callback has been executed. This is because
10828
- * not all collectibles will necessarily be present when a mod first loads (due to mod load
10829
- * order).
9371
+ * This property is used to easily turn entire mod features on and off (rather than repeating
9372
+ * conditional logic and early returning at the beginning of every callback function).
10830
9373
  *
10831
- * In order to use this function, you must upgrade your mod with
10832
- * `ISCFeature.MODDED_ELEMENT_DETECTION`.
10833
- */
10834
- getFirstModdedCollectibleType(): CollectibleType | undefined;
10835
- /**
10836
- * Will change depending on how many modded collectibles there are.
9374
+ * Since the specific information for the firing callback is passed as arguments into the
9375
+ * conditional method, you can also write logic that would only apply to a specific type of
9376
+ * callback.
10837
9377
  *
10838
- * Equal to `itemConfig.GetCollectibles().Size - 1`. (`Size` includes invalid collectibles, like
10839
- * 666. We subtract one to account for `CollectibleType.NULL`.)
9378
+ * By default, this is set to null, which means that all callback methods will fire
9379
+ * unconditionally. Override this property in your class if you need to use it.
10840
9380
  *
10841
- * This function can only be called if at least one callback has been executed. This is because
10842
- * not all collectibles will necessarily be present when a mod first loads (due to mod load
10843
- * order).
9381
+ * The function has the following signature:
10844
9382
  *
10845
- * In order to use this function, you must upgrade your mod with
10846
- * `ISCFeature.MODDED_ELEMENT_DETECTION`.
9383
+ * ```ts
9384
+ * <T extends boolean>(
9385
+ * vanilla: T, // Whether or not this is a vanilla or custom callback.
9386
+ * modCallback: T extends true ? ModCallback : ModCallbackCustom,
9387
+ * ...callbackArgs: unknown[] // This would be e.g. `pickup: EntityPickup` for the `POST_PICKUP_INIT` callback.
9388
+ * ) => boolean;
9389
+ * ```
10847
9390
  */
10848
- getLastCollectibleType(): CollectibleType;
9391
+ protected shouldCallbackMethodsFire: (<T extends boolean>(vanilla: T, modCallback: T extends true ? ModCallback : ModCallbackCustom, ...callbackArgs: unknown[]) => boolean) | null;
10849
9392
  /**
10850
- * Helper function to get an array that represents the all modded collectible types.
10851
- *
10852
- * Returns an empty array if there are no modded collectible types.
10853
- *
10854
- * This function is only useful when building collectible type objects. For most purposes, you
10855
- * should use the `getModdedCollectibleArray` or `getModdedCollectibleSet` helper function
10856
- * instead.
10857
- *
10858
- * (This function is named differently from the `getVanillaCollectibleTypeRange` function because
10859
- * all modded collectible types are contiguous. Thus, each value represents a real
10860
- * `CollectibleType`.)
10861
- *
10862
- * This function can only be called if at least one callback has been executed. This is because
10863
- * not all collectibles will necessarily be present when a mod first loads (due to mod load
10864
- * order).
9393
+ * Whether or not the feature has registered its callbacks yet.
10865
9394
  *
10866
- * In order to use this function, you must upgrade your mod with
10867
- * `ISCFeature.MODDED_ELEMENT_DETECTION`.
9395
+ * This will almost always be equal to true unless you explicitly passed `false` to the second
9396
+ * argument of the constructor.
10868
9397
  */
10869
- getModdedCollectibleTypes(): CollectibleType[];
9398
+ initialized: boolean;
9399
+ constructor(mod: ModUpgraded, init?: boolean);
10870
9400
  /**
10871
- * This function can only be called if at least one callback has been executed. This is because
10872
- * not all collectibles will necessarily be present when a mod first loads (due to mod load
10873
- * order).
9401
+ * Runs the `Mod.AddCallback` and `ModUpgraded.AddCallbackCustom` methods for all of the decorated
9402
+ * callbacks.
10874
9403
  *
10875
- * In order to use this function, you must upgrade your mod with
10876
- * `ISCFeature.MODDED_ELEMENT_DETECTION`.
9404
+ * @param init Optional. Whether to initialize or uninitialize. Default is true.
10877
9405
  */
10878
- getNumCollectibleTypes(): int;
9406
+ init(init?: boolean): void;
10879
9407
  /**
10880
- * Unlike vanilla collectible types, modded collectible types are always contiguous.
10881
- *
10882
- * This function can only be called if at least one callback has been executed. This is because
10883
- * not all collectibles will necessarily be present when a mod first loads (due to mod load
10884
- * order).
9408
+ * Runs the `Mod.RemoveCallback` and `ModUpgraded.RemoveCallbackCustom` methods for all of the
9409
+ * decorated callbacks.
10885
9410
  *
10886
- * In order to use this function, you must upgrade your mod with
10887
- * `ISCFeature.MODDED_ELEMENT_DETECTION`.
9411
+ * This is just an alias for `ModFeature.init(false)`.
10888
9412
  */
10889
- getNumModdedCollectibleTypes(): int;
9413
+ uninit(): void;
9414
+ }
9415
+
9416
+ /**
9417
+ * `isaacscript-common` has many custom callbacks that you can use in your mods. Instead of
9418
+ * hijacking the vanilla `Mod` object, we provide a `ModUpgraded` object for you to use, which
9419
+ * extends the base class and adds a new method of `AddCallbackCustom`.
9420
+ *
9421
+ * To upgrade your mod, use the `upgradeMod` helper function.
9422
+ *
9423
+ * By specifying one or more optional features when upgrading your mod, you will get a version of
9424
+ * `ModUpgraded` that has extra methods corresponding to the features that were specified. (This
9425
+ * corresponds to the internal-type `ModUpgradedWithFeatures` type, which extends `ModUpgraded`.)
9426
+ */
9427
+ export declare class ModUpgraded implements Mod {
9428
+ Name: string;
9429
+ /** We store a copy of the original mod object so that we can re-implement its functions. */
9430
+ private mod;
9431
+ private debug;
9432
+ private timeThreshold;
9433
+ private callbacks;
9434
+ private features;
9435
+ constructor(mod: Mod, debug: boolean, timeThreshold?: float);
9436
+ AddCallback<T extends ModCallback | string>(modCallback: T, ...args: T extends ModCallback ? AddCallbackParameters[T] : unknown[]): void;
9437
+ AddPriorityCallback<T extends ModCallback | string>(modCallback: T, priority: CallbackPriority | int, ...args: T extends ModCallback ? AddCallbackParameters[T] : unknown[]): void;
9438
+ HasData(): boolean;
9439
+ LoadData(): string;
9440
+ RemoveCallback<T extends ModCallback>(modCallback: T, callback: AddCallbackParameters[T][0]): void;
9441
+ RemoveData(): void;
9442
+ SaveData(data: string): void;
10890
9443
  /**
10891
- * Returns the first modded trinket type, or undefined if there are no modded trinkets.
10892
- *
10893
- * This function can only be called if at least one callback has been executed. This is because
10894
- * not all trinkets will necessarily be present when a mod first loads (due to mod load order).
9444
+ * Registers a function to be executed when an in-game event happens.
10895
9445
  *
10896
- * In order to use this function, you must upgrade your mod with
10897
- * `ISCFeature.MODDED_ELEMENT_DETECTION`.
9446
+ * This method is specifically for events that are provided by the IsaacScript standard library.
9447
+ * For example, the `ModCallbackCustom.POST_BOMB_EXPLODE` event corresponds to when a bomb
9448
+ * explodes.
10898
9449
  */
10899
- getFirstModdedTrinketType(): TrinketType | undefined;
9450
+ AddCallbackCustom<T extends ModCallbackCustom>(modCallbackCustom: T, ...args: AddCallbackParametersCustom[T]): void;
10900
9451
  /**
10901
- * Will change depending on how many modded trinkets there are.
10902
- *
10903
- * This is equal to the number of trinket types, since all trinket types are contiguous (unlike
10904
- * collectibles).
10905
- *
10906
- * This function can only be called if at least one callback has been executed. This is because
10907
- * not all trinkets will necessarily be present when a mod first loads (due to mod load order).
10908
- *
10909
- * In order to use this function, you must upgrade your mod with
10910
- * `ISCFeature.MODDED_ELEMENT_DETECTION`.
9452
+ * The same as the `ModUpgraded.AddCallbackCustom` method, but allows setting a custom priority.
9453
+ * By default, callbacks are added with a priority of 0, so this allows you to add early or late
9454
+ * callbacks as necessary. See the `CallbackPriority` enum.
10911
9455
  */
10912
- getLastTrinketType(): TrinketType;
9456
+ AddPriorityCallbackCustom<T extends ModCallbackCustom>(modCallbackCustom: T, priority: CallbackPriority | int, ...args: AddCallbackParametersCustom[T]): void;
10913
9457
  /**
10914
- * Helper function to get an array that represents every modded trinket type.
10915
- *
10916
- * Returns an empty array if there are no modded trinket types.
10917
- *
10918
- * This function is only useful when building collectible type objects. For most purposes, you
10919
- * should use the `getModdedCollectibleArray` or `getModdedCollectibleSet` helper function
10920
- * instead.
9458
+ * Unregisters a function that was previously registered with the `AddCallbackCustom` method.
10921
9459
  *
10922
- * This function can only be called if at least one callback has been executed. This is because
10923
- * not all trinkets will necessarily be present when a mod first loads (due to mod load order).
9460
+ * This method is specifically for events that are provided by the IsaacScript standard library.
9461
+ * For example, the `ModCallbackCustom.POST_BOMB_EXPLODE` event corresponds to when a bomb
9462
+ * explodes.
10924
9463
  *
10925
- * In order to use this function, you must upgrade your mod with
10926
- * `ISCFeature.MODDED_ELEMENT_DETECTION`.
9464
+ * This method does not care about the tertiary argument. In other words, regardless of the
9465
+ * conditions of how you registered the callback, it will be removed.
10927
9466
  */
10928
- getModdedTrinketTypes(): TrinketType[];
9467
+ RemoveCallbackCustom<T extends ModCallbackCustom>(modCallbackCustom: T, callback: AddCallbackParametersCustom[T][0]): void;
10929
9468
  /**
10930
- * Will change depending on how many modded trinkets there are.
10931
- *
10932
- * Equal to `itemConfig.GetTrinkets().Size - 1`. (We subtract one to account for
10933
- * `TrinketType.NULL`.)
10934
- *
10935
- * This function can only be called if at least one callback has been executed. This is because
10936
- * not all trinkets will necessarily be present when a mod first loads (due to mod load order).
10937
- *
10938
- * In order to use this function, you must upgrade your mod with
10939
- * `ISCFeature.MODDED_ELEMENT_DETECTION`.
9469
+ * Logs every custom callback or extra feature that is currently enabled. Useful for debugging or
9470
+ * profiling.
10940
9471
  */
10941
- getNumTrinketTypes(): int;
10942
- /**
10943
- * This function can only be called if at least one callback has been executed. This is because
10944
- * not all trinkets will necessarily be present when a mod first loads (due to mod load order).
10945
- *
10946
- * In order to use this function, you must upgrade your mod with
10947
- * `ISCFeature.MODDED_ELEMENT_DETECTION`.
10948
- */
10949
- getNumModdedTrinketTypes(): int;
10950
- /**
10951
- * Helper function to get an array that contains every trinket type.
10952
- *
10953
- * This function can only be called if at least one callback has been executed. This is because
10954
- * not all trinkets will necessarily be present when a mod first loads (due to mod load order).
10955
- *
10956
- * In order to use this function, you must upgrade your mod with
10957
- * `ISCFeature.MODDED_ELEMENT_DETECTION`.
10958
- */
10959
- getTrinketTypes(): TrinketType[];
10960
- /**
10961
- * Helper function to get an array with every valid card sub-type. This includes modded cards.
10962
- *
10963
- * This function can only be called if at least one callback has been executed. This is because
10964
- * not all cards will necessarily be present when a mod first loads (due to mod load order).
10965
- *
10966
- * In order to use this function, you must upgrade your mod with
10967
- * `ISCFeature.MODDED_ELEMENT_DETECTION`.
10968
- */
10969
- getAllCardTypes(): CardType[];
10970
- /**
10971
- * Returns the first modded card sub-type, or undefined if there are no modded cards.
10972
- *
10973
- * This function can only be called if at least one callback has been executed. This is because
10974
- * not all cards will necessarily be present when a mod first loads (due to mod load order).
10975
- *
10976
- * In order to use this function, you must upgrade your mod with
10977
- * `ISCFeature.MODDED_ELEMENT_DETECTION`.
10978
- */
10979
- getFirstModdedCardType(): CardType | undefined;
10980
- /**
10981
- * Will change depending on how many modded cards there are.
10982
- *
10983
- * This is equal to the number of cards, since all card sub-types are contiguous (unlike
10984
- * collectibles).
10985
- *
10986
- * This function can only be called if at least one callback has been executed. This is because
10987
- * not all cards will necessarily be present when a mod first loads (due to mod load order).
10988
- *
10989
- * In order to use this function, you must upgrade your mod with
10990
- * `ISCFeature.MODDED_ELEMENT_DETECTION`.
10991
- */
10992
- getLastCardType(): CardType;
10993
- /**
10994
- * Helper function to get an array with every modded card sub-type.
10995
- *
10996
- * Returns an empty array if there are no modded cards.
10997
- *
10998
- * This function can only be called if at least one callback has been executed. This is because
10999
- * not all cards will necessarily be present when a mod first loads (due to mod load order).
11000
- *
11001
- * In order to use this function, you must upgrade your mod with
11002
- * `ISCFeature.MODDED_ELEMENT_DETECTION`.
11003
- */
11004
- getModdedCardTypes(): CardType[];
11005
- /**
11006
- * Will change depending on how many modded cards there are.
11007
- *
11008
- * Equal to `itemConfig.GetCards().Size - 1`. (We subtract one to account for `Card.NULL`.)
11009
- *
11010
- * This function can only be called if at least one callback has been executed. This is because
11011
- * not all cards will necessarily be present when a mod first loads (due to mod load order).
11012
- *
11013
- * In order to use this function, you must upgrade your mod with
11014
- * `ISCFeature.MODDED_ELEMENT_DETECTION`.
11015
- */
11016
- getNumCardTypes(): int;
11017
- /**
11018
- * This function can only be called if at least one callback has been executed. This is because
11019
- * not all trinkets will necessarily be present when a mod first loads (due to mod load order).
11020
- *
11021
- * In order to use this function, you must upgrade your mod with
11022
- * `ISCFeature.MODDED_ELEMENT_DETECTION`.
11023
- */
11024
- getNumModdedCardTypes(): int;
11025
- /**
11026
- * Helper function to get an array with every valid pill effect. This includes modded pill
11027
- * effects.
11028
- *
11029
- * This function can only be called if at least one callback has been executed. This is because
11030
- * not all pill effects will necessarily be present when a mod first loads (due to mod load
11031
- * order).
11032
- *
11033
- * In order to use this function, you must upgrade your mod with
11034
- * `ISCFeature.MODDED_ELEMENT_DETECTION`.
11035
- */
11036
- getAllPillEffects(): PillEffect[];
11037
- /**
11038
- * Returns the first modded pill effect, or undefined if there are no modded pill effects.
11039
- *
11040
- * This function can only be called if at least one callback has been executed. This is because
11041
- * not all pill effects will necessarily be present when a mod first loads (due to mod load
11042
- * order).
11043
- *
11044
- * In order to use this function, you must upgrade your mod with
11045
- * `ISCFeature.MODDED_ELEMENT_DETECTION`.
11046
- */
11047
- getFirstModdedPillEffect(): PillEffect | undefined;
11048
- /**
11049
- * Will change depending on how many modded pill effects there are.
11050
- *
11051
- * This is equal to the number of pill effects, since all pill effects are contiguous (unlike
11052
- * collectibles).
11053
- *
11054
- * This function can only be called if at least one callback has been executed. This is because
11055
- * not all pill effects will necessarily be present when a mod first loads (due to mod load
11056
- * order).
11057
- *
11058
- * In order to use this function, you must upgrade your mod with
11059
- * `ISCFeature.MODDED_ELEMENT_DETECTION`.
11060
- */
11061
- getLastPillEffect(): PillEffect;
11062
- /**
11063
- * Helper function to get an array with every modded pill effect.
11064
- *
11065
- * Returns an empty array if there are no modded pill effects.
11066
- *
11067
- * This function can only be called if at least one callback has been executed. This is because
11068
- * not all pill effects will necessarily be present when a mod first loads (due to mod load
11069
- * order).
11070
- *
11071
- * In order to use this function, you must upgrade your mod with
11072
- * `ISCFeature.MODDED_ELEMENT_DETECTION`.
11073
- */
11074
- getModdedPillEffects(): PillEffect[];
11075
- /**
11076
- * Will change depending on how many modded pill effects there are.
11077
- *
11078
- * Equal to `itemConfig.GetPillEffects().Size`. (We do not have to subtract one, because the first
11079
- * pill effect has an ID of 0 and there is no `PillEffect.NULL`.)
11080
- *
11081
- * This function can only be called if at least one callback has been executed. This is because
11082
- * not all pill effects will necessarily be present when a mod first loads (due to mod load
11083
- * order).
11084
- *
11085
- * In order to use this function, you must upgrade your mod with
11086
- * `ISCFeature.MODDED_ELEMENT_DETECTION`.
11087
- */
11088
- getNumPillEffects(): int;
11089
- /**
11090
- * This function can only be called if at least one callback has been executed. This is because
11091
- * not all pill effects will necessarily be present when a mod first loads (due to mod load
11092
- * order).
11093
- *
11094
- * In order to use this function, you must upgrade your mod with
11095
- * `ISCFeature.MODDED_ELEMENT_DETECTION`.
11096
- */
11097
- getNumModdedPillEffects(): int;
11098
- }
11099
-
11100
- declare class ModdedElementSets extends Feature {
11101
- private allCollectibleTypesArray;
11102
- private allCollectibleTypesSet;
11103
- private vanillaCollectibleTypesArray;
11104
- private vanillaCollectibleTypesSet;
11105
- private moddedCollectibleTypesArray;
11106
- private moddedCollectibleTypesSet;
11107
- private allTrinketTypesArray;
11108
- private allTrinketTypesSet;
11109
- private vanillaTrinketTypesArray;
11110
- private vanillaTrinketTypesSet;
11111
- private moddedTrinketTypesArray;
11112
- private moddedTrinketTypesSet;
11113
- private allCardTypesArray;
11114
- private allCardTypesSet;
11115
- private vanillaCardTypesArray;
11116
- private vanillaCardTypesSet;
11117
- private moddedCardTypesArray;
11118
- private moddedCardTypesSet;
11119
- private tagToCollectibleTypesMap;
11120
- private cacheFlagToCollectibleTypesMap;
11121
- private cacheFlagToTrinketTypesMap;
11122
- private flyingCollectibleTypesSet;
11123
- private permanentFlyingCollectibleTypesSet;
11124
- private flyingTrinketTypesSet;
11125
- private edenActiveCollectibleTypesSet;
11126
- private edenPassiveCollectibleTypesSet;
11127
- private itemConfigCardTypeToCardTypeMap;
11128
- /**
11129
- * The set of cards that are not:
11130
- *
11131
- * - ItemConfigCardType.RUNE
11132
- * - ItemConfigCardType.SPECIAL_OBJECT
11133
- */
11134
- private cardSet;
11135
- private moddedElementDetection;
11136
- private lazyInitVanillaCollectibleTypes;
11137
- private lazyInitModdedCollectibleTypes;
11138
- private lazyInitVanillaTrinketTypes;
11139
- private lazyInitModdedTrinketTypes;
11140
- private lazyInitVanillaCardTypes;
11141
- private lazyInitModdedCardTypes;
11142
- private lazyInitTagToCollectibleTypesMap;
11143
- private lazyInitCacheFlagToCollectibleTypesMap;
11144
- private lazyInitCacheFlagToTrinketTypesMap;
11145
- private lazyInitFlyingCollectibleTypesSet;
11146
- private lazyInitFlyingTrinketTypesSet;
11147
- private lazyInitEdenCollectibleTypesSet;
11148
- private lazyInitCardTypes;
11149
- /**
11150
- * Returns an array containing every valid card type in the game, including modded cards.
11151
- *
11152
- * Use this if you need to iterate over the cards in order. If you need to do O(1) lookups, then
11153
- * use the `getCardSet` helper function instead.
11154
- *
11155
- * This function can only be called if at least one callback has been executed. This is because
11156
- * not all cards will necessarily be present when a mod first loads (due to mod load order).
11157
- *
11158
- * In order to use this function, you must upgrade your mod with `ISCFeature.MODDED_ELEMENT_SETS`.
11159
- */
11160
- getCardArray(): readonly CardType[];
11161
- /**
11162
- * Returns a set containing every valid card type in the game, including modded cards.
11163
- *
11164
- * Use this if you need to do O(1) lookups. If you need to iterate over the cards in order, then
11165
- * use the `getCardArray` helper function instead.
11166
- *
11167
- * This function can only be called if at least one callback has been executed. This is because
11168
- * not all cards will necessarily be present when a mod first loads (due to mod load order).
11169
- *
11170
- * In order to use this function, you must upgrade your mod with `ISCFeature.MODDED_ELEMENT_SETS`.
11171
- */
11172
- getCardSet(): ReadonlySet<CardType>;
11173
- /**
11174
- * Helper function to get a set of card types matching the `ItemConfigCardType`.
11175
- *
11176
- * This function is variadic, meaning that you can you can specify N card types to get a set
11177
- * containing cards that match any of the specified types.
11178
- *
11179
- * This function can only be called if at least one callback has been executed. This is because
11180
- * not all cards will necessarily be present when a mod first loads (due to mod load order).
11181
- *
11182
- * In order to use this function, you must upgrade your mod with `ISCFeature.MODDED_ELEMENT_SETS`.
11183
- */
11184
- getCardTypesOfType(...itemConfigCardTypes: ItemConfigCardType[]): Set<CardType>;
11185
- /**
11186
- * Returns an array containing every valid collectible type in the game, including modded
11187
- * collectibles.
11188
- *
11189
- * Use this if you need to iterate over the collectibles in order. If you need to do O(1) lookups,
11190
- * then use the `getCollectibleSet` helper function instead.
11191
- *
11192
- * This function can only be called if at least one callback has been executed. This is because
11193
- * not all collectibles will necessarily be present when a mod first loads (due to mod load
11194
- * order).
11195
- *
11196
- * In order to use this function, you must upgrade your mod with `ISCFeature.MODDED_ELEMENT_SETS`.
11197
- */
11198
- getCollectibleArray(): readonly CollectibleType[];
11199
- /**
11200
- * Returns a set containing every valid collectible type in the game, including modded
11201
- * collectibles.
11202
- *
11203
- * Use this if you need to do O(1) lookups. If you need to iterate over the collectibles in order,
11204
- * then use the `getCollectibleArray` helper function instead.
11205
- *
11206
- * This function can only be called if at least one callback has been executed. This is because
11207
- * not all collectibles will necessarily be present when a mod first loads (due to mod load
11208
- * order).
11209
- *
11210
- * In order to use this function, you must upgrade your mod with `ISCFeature.MODDED_ELEMENT_SETS`.
11211
- */
11212
- getCollectibleSet(): ReadonlySet<CollectibleType>;
11213
- /**
11214
- * Helper function to get all of the collectible types in the game that count towards a particular
11215
- * transformation.
11216
- *
11217
- * For example, to get all of the collectible types that count towards Guppy:
11218
- *
11219
- * ```ts
11220
- * const guppyCollectibleTypes = getCollectiblesForTransformation(PlayerForm.GUPPY);
11221
- * ```
11222
- *
11223
- * This function can only be called if at least one callback has been executed. This is because
11224
- * not all collectibles will necessarily be present when a mod first loads (due to mod load
11225
- * order).
11226
- *
11227
- * In order to use this function, you must upgrade your mod with `ISCFeature.MODDED_ELEMENT_SETS`.
11228
- */
11229
- getCollectiblesForTransformation(playerForm: PlayerForm): ReadonlySet<CollectibleType>;
11230
- /**
11231
- * Returns a set containing every collectible type with the given cache flag, including modded
11232
- * collectibles.
11233
- *
11234
- * This function can only be called if at least one callback has been executed. This is because
11235
- * not all collectibles will necessarily be present when a mod first loads (due to mod load
11236
- * order).
11237
- *
11238
- * This function can only be called if at least one callback has been executed. This is because
11239
- * not all collectibles will necessarily be present when a mod first loads (due to mod load
11240
- * order).
11241
- *
11242
- * In order to use this function, you must upgrade your mod with `ISCFeature.MODDED_ELEMENT_SETS`.
11243
- */
11244
- getCollectiblesWithCacheFlag(cacheFlag: CacheFlag): ReadonlySet<CollectibleType>;
11245
- /**
11246
- * Returns a set containing every collectible type with the given tag.
11247
- *
11248
- * For example, to get all of the collectible types that count as offensive for the purposes of
11249
- * Tainted Lost:
11250
- *
11251
- * ```ts
11252
- * const offensiveCollectibleTypes = getCollectibleTypesWithTag(ItemConfigTag.OFFENSIVE);
11253
- * ```
11254
- *
11255
- * This function can only be called if at least one callback has been executed. This is because
11256
- * not all collectibles will necessarily be present when a mod first loads (due to mod load
11257
- * order).
11258
- *
11259
- * In order to use this function, you must upgrade your mod with `ISCFeature.MODDED_ELEMENT_SETS`.
11260
- */
11261
- getCollectiblesWithTag(itemConfigTag: ItemConfigTag): ReadonlySet<CollectibleType>;
11262
- /**
11263
- * Returns a set containing every valid passive item that can be randomly granted to Eden as a
11264
- * starting item.
11265
- *
11266
- * This function can only be called if at least one callback has been executed. This is because
11267
- * not all collectibles will necessarily be present when a mod first loads (due to mod load
11268
- * order).
11269
- *
11270
- * In order to use this function, you must upgrade your mod with `ISCFeature.MODDED_ELEMENT_SETS`.
11271
- */
11272
- getEdenActiveCollectibles(): ReadonlySet<CollectibleType>;
11273
- /**
11274
- * Returns a set containing every valid passive item that can be randomly granted to Eden as a
11275
- * starting item.
11276
- *
11277
- * This function can only be called if at least one callback has been executed. This is because
11278
- * not all collectibles will necessarily be present when a mod first loads (due to mod load
11279
- * order).
11280
- *
11281
- * In order to use this function, you must upgrade your mod with `ISCFeature.MODDED_ELEMENT_SETS`.
11282
- */
11283
- getEdenPassiveCollectibles(): ReadonlySet<CollectibleType>;
11284
- /**
11285
- * Returns a set of all of the collectibles that grant flight. This is derived from collectibles
11286
- * that have `CacheFlag.FLYING` set in the "items.xml" file.
11287
- *
11288
- * Collectibles that only grant flight conditionally are manually pruned. Collectibles such as
11289
- * Empty Vessel should be checked for via the `hasFlyingTemporaryEffect` function.
11290
- *
11291
- * This function can only be called if at least one callback has been executed. This is because
11292
- * not all collectibles will necessarily be present when a mod first loads (due to mod load
11293
- * order).
11294
- *
11295
- * In order to use this function, you must upgrade your mod with `ISCFeature.MODDED_ELEMENT_SETS`.
11296
- *
11297
- * @param pruneConditionalItems Whether or not collectibles that only grant flight conditionally
11298
- * should be included in the set (like Empty Vessel).
11299
- */
11300
- getFlyingCollectibles(pruneConditionalItems: boolean): ReadonlySet<CollectibleType>;
11301
- /**
11302
- * Returns a set of all of the trinkets that grant flight. (All trinkets that grant flight do so
11303
- * conditionally, like Bat Wing and Azazel's Stump.)
11304
- *
11305
- * This function can only be called if at least one callback has been executed. This is because
11306
- * not all trinkets will necessarily be present when a mod first loads (due to mod load order).
11307
- *
11308
- * In order to use this function, you must upgrade your mod with `ISCFeature.MODDED_ELEMENT_SETS`.
11309
- */
11310
- getFlyingTrinkets(): ReadonlySet<TrinketType>;
11311
- /**
11312
- * Returns an array containing every modded card type in the game.
11313
- *
11314
- * Use this if you need to iterate over the cards in order. If you need to do O(1) lookups, then
11315
- * use the `getModdedCardSet` helper function instead.
11316
- *
11317
- * This function can only be called if at least one callback has been executed. This is because
11318
- * not all cards will necessarily be present when a mod first loads (due to mod load order).
11319
- *
11320
- * In order to use this function, you must upgrade your mod with `ISCFeature.MODDED_ELEMENT_SETS`.
11321
- */
11322
- getModdedCardArray(): readonly CardType[];
11323
- /**
11324
- * Returns a set containing every modded card type in the game.
11325
- *
11326
- * Use this if you need to do O(1) lookups. If you need to iterate over the cards in order, then
11327
- * use the `getModdedCardArray` helper function instead.
11328
- *
11329
- * This function can only be called if at least one callback has been executed. This is because
11330
- * not all cards will necessarily be present when a mod first loads (due to mod load order).
11331
- *
11332
- * In order to use this function, you must upgrade your mod with `ISCFeature.MODDED_ELEMENT_SETS`.
11333
- */
11334
- getModdedCardSet(): ReadonlySet<CardType>;
11335
- /**
11336
- * Returns an array containing every modded collectible type in the game.
11337
- *
11338
- * Use this if you need to iterate over the collectibles in order. If you need to do O(1) lookups,
11339
- * then use the `getModdedCollectibleSet` helper function instead.
11340
- *
11341
- * This function can only be called if at least one callback has been executed. This is because
11342
- * not all collectibles will necessarily be present when a mod first loads (due to mod load
11343
- * order).
11344
- *
11345
- * In order to use this function, you must upgrade your mod with `ISCFeature.MODDED_ELEMENT_SETS`.
11346
- */
11347
- getModdedCollectibleArray(): readonly CollectibleType[];
11348
- /**
11349
- * Returns a set containing every modded collectible type in the game.
11350
- *
11351
- * Use this if you need to do O(1) lookups. If you need to iterate over the collectibles in order,
11352
- * then use the `getModdedCollectibleArray` helper function instead.
11353
- *
11354
- * This function can only be called if at least one callback has been executed. This is because
11355
- * not all collectibles will necessarily be present when a mod first loads (due to mod load
11356
- * order).
11357
- *
11358
- * In order to use this function, you must upgrade your mod with `ISCFeature.MODDED_ELEMENT_SETS`.
11359
- */
11360
- getModdedCollectibleSet(): ReadonlySet<CollectibleType>;
11361
- /**
11362
- * Returns an array containing every modded trinket type in the game.
11363
- *
11364
- * Use this if you need to iterate over the trinkets in order. If you need to do O(1) lookups,
11365
- * then use the `getModdedTrinketSet` helper function instead.
11366
- *
11367
- * This function can only be called if at least one callback has been executed. This is because
11368
- * not all trinkets will necessarily be present when a mod first loads (due to mod load order).
11369
- *
11370
- * In order to use this function, you must upgrade your mod with `ISCFeature.MODDED_ELEMENT_SETS`.
11371
- */
11372
- getModdedTrinketArray(): readonly TrinketType[];
11373
- /**
11374
- * Returns a set containing every modded trinket type in the game.
11375
- *
11376
- * Use this if you need to do O(1) lookups. If you need to iterate over the trinkets in order,
11377
- * then use the `getModdedTrinketArray` helper function instead.
11378
- *
11379
- * This function can only be called if at least one callback has been executed. This is because
11380
- * not all trinkets will necessarily be present when a mod first loads (due to mod load order).
11381
- *
11382
- * In order to use this function, you must upgrade your mod with `ISCFeature.MODDED_ELEMENT_SETS`.
11383
- */
11384
- getModdedTrinketSet(): ReadonlySet<TrinketType>;
11385
- /**
11386
- * Iterates over every item in the game and returns a map containing the number of each item that
11387
- * the player has.
11388
- *
11389
- * Note that this will filter out non-real collectibles like Lilith's Incubus.
11390
- *
11391
- * In order to use this function, you must upgrade your mod with `ISCFeature.MODDED_ELEMENT_SETS`.
11392
- */
11393
- getPlayerCollectibleMap(player: EntityPlayer): Map<CollectibleType, int>;
11394
- /**
11395
- * Returns an array containing every collectible type that the player has that matches the
11396
- * provided `CacheFlag`.
11397
- *
11398
- * For example, if the cache flag is `CacheFlag.FLYING`, and the player has one Lord of the Pit
11399
- * and two Dead Doves, then this function would return:
11400
- *
11401
- * ```ts
11402
- * [
11403
- * CollectibleType.LORD_OF_THE_PIT,
11404
- * CollectibleType.DEAD_DOVE,
11405
- * CollectibleType.DEAD_DOVE,
11406
- * ]
11407
- * ```
11408
- *
11409
- * Note that this array will not include collectibles that the player does not really have, like
11410
- * Lilith's Incubus.
11411
- *
11412
- * This function can only be called if at least one callback has been executed. This is because
11413
- * not all collectibles will necessarily be present when a mod first loads (due to mod load
11414
- * order).
11415
- *
11416
- * In order to use this function, you must upgrade your mod with `ISCFeature.MODDED_ELEMENT_SETS`.
11417
- */
11418
- getPlayerCollectiblesWithCacheFlag(player: EntityPlayer, cacheFlag: CacheFlag): CollectibleType[];
11419
- /**
11420
- * Returns the number of items that a player has towards a particular transformation.
11421
- *
11422
- * In order to use this function, you must upgrade your mod with `ISCFeature.MODDED_ELEMENT_SETS`.
11423
- */
11424
- getPlayerCollectiblesWithTag(player: EntityPlayer, itemConfigTag: ItemConfigTag): CollectibleType[];
11425
- /**
11426
- * Returns the number of items that a player has towards a particular transformation.
11427
- *
11428
- * In order to use this function, you must upgrade your mod with `ISCFeature.MODDED_ELEMENT_SETS`.
11429
- */
11430
- getPlayerCollectiblesForTransformation(player: EntityPlayer, playerForm: PlayerForm): CollectibleType[];
11431
- /**
11432
- * Returns a map containing every trinket type that the player has that matches the provided
11433
- * `CacheFlag`. The values of the map correspond to the multiplier for that trinket.
11434
- *
11435
- * This function can only be called if at least one callback has been executed. This is because
11436
- * not all trinkets will necessarily be present when a mod first loads (due to mod load order).
11437
- *
11438
- * In order to use this function, you must upgrade your mod with `ISCFeature.MODDED_ELEMENT_SETS`.
11439
- */
11440
- getPlayerTrinketsWithCacheFlag(player: EntityPlayer, cacheFlag: CacheFlag): Map<TrinketType, int>;
11441
- /**
11442
- * Has an equal chance of returning any card (e.g. Fool, Reverse Fool, Wild Card, etc.).
11443
- *
11444
- * This will not return:
11445
- * - any runes
11446
- * - any objects like Dice Shard
11447
- *
11448
- * In order to use this function, you must upgrade your mod with `ISCFeature.MODDED_ELEMENT_SETS`.
11449
- *
11450
- * @param seedOrRNG Optional. The `Seed` or `RNG` object to use. If an `RNG` object is provided,
11451
- * the `RNG.Next` method will be called. Default is `getRandomSeed()`.
11452
- * @param exceptions Optional. An array of cards to not select.
11453
- */
11454
- getRandomCard(seedOrRNG?: Seed | RNG, exceptions?: CardType[]): CardType;
11455
- /**
11456
- * Helper function to get a random card type that matches the provided `ItemConfigCardType`.
11457
- *
11458
- * In order to use this function, you must upgrade your mod with `ISCFeature.MODDED_ELEMENT_SETS`.
11459
- *
11460
- * @param itemConfigCardType The item config card type that represents the pool of cards to select
11461
- * from.
11462
- * @param seedOrRNG Optional. The `Seed` or `RNG` object to use. If an `RNG` object is provided,
11463
- * the `RNG.Next` method will be called. Default is `getRandomSeed()`.
11464
- * @param exceptions Optional. An array of cards to not select.
11465
- */
11466
- getRandomCardTypeOfType(itemConfigCardType: ItemConfigCardType, seedOrRNG?: Seed | RNG, exceptions?: CardType[]): CardType;
11467
- /**
11468
- * Has an equal chance of returning any rune (e.g. Rune of Hagalaz, Blank Rune, Black Rune, Soul
11469
- * of Isaac, etc.). This will never return a Rune Shard.
11470
- *
11471
- * In order to use this function, you must upgrade your mod with `ISCFeature.MODDED_ELEMENT_SETS`.
11472
- *
11473
- * @param seedOrRNG Optional. The `Seed` or `RNG` object to use. If an `RNG` object is provided,
11474
- * the `RNG.Next` method will be called. Default is `getRandomSeed()`.
11475
- * @param exceptions Optional. An array of runes to not select.
11476
- */
11477
- getRandomRune(seedOrRNG?: Seed | RNG, exceptions?: CardType[]): CardType;
11478
- /**
11479
- * Returns a random active collectible type that that is a valid starting item for Eden.
11480
- *
11481
- * This function can only be called if at least one callback has been executed. This is because
11482
- * not all collectibles will necessarily be present when a mod first loads (due to mod load
11483
- * order).
11484
- *
11485
- * In order to use this function, you must upgrade your mod with `ISCFeature.MODDED_ELEMENT_SETS`.
11486
- *
11487
- * @param seedOrRNG Optional. The `Seed` or `RNG` object to use. If an `RNG` object is provided,
11488
- * the `RNG.Next` method will be called. Default is `getRandomSeed()`.
11489
- * @param exceptions Optional. An array of runes to not select.
11490
- */
11491
- getRandomEdenActiveCollectible(seedOrRNG?: Seed | RNG, exceptions?: CollectibleType[] | readonly CollectibleType[]): CollectibleType;
11492
- /**
11493
- * Returns a random passive collectible type that that is a valid starting item for Eden.
11494
- *
11495
- * This function can only be called if at least one callback has been executed. This is because
11496
- * not all collectibles will necessarily be present when a mod first loads (due to mod load
11497
- * order).
11498
- *
11499
- * In order to use this function, you must upgrade your mod with `ISCFeature.MODDED_ELEMENT_SETS`.
11500
- *
11501
- * @param seedOrRNG Optional. The `Seed` or `RNG` object to use. If an `RNG` object is provided,
11502
- * the `RNG.Next` method will be called. Default is `getRandomSeed()`.
11503
- * @param exceptions Optional. An array of runes to not select.
11504
- */
11505
- getRandomEdenPassiveCollectible(seedOrRNG?: Seed | RNG, exceptions?: CollectibleType[] | readonly CollectibleType[]): CollectibleType;
11506
- /**
11507
- * Returns an array containing every modded trinket type in the game.
11508
- *
11509
- * Use this if you need to iterate over the trinkets in order. If you need to do O(1) lookups,
11510
- * then use the `getModdedTrinketSet` helper function instead.
11511
- *
11512
- * This function can only be called if at least one callback has been executed. This is because
11513
- * not all trinkets will necessarily be present when a mod first loads (due to mod load order).
11514
- *
11515
- * In order to use this function, you must upgrade your mod with `ISCFeature.MODDED_ELEMENT_SETS`.
11516
- */
11517
- getTrinketArray(): readonly TrinketType[];
11518
- /**
11519
- * Returns a set containing every modded trinket type in the game.
11520
- *
11521
- * Use this if you need to do O(1) lookups. If you need to iterate over the trinkets in order,
11522
- * then use the `getModdedTrinketArray` helper function instead.
11523
- *
11524
- * This function can only be called if at least one callback has been executed. This is because
11525
- * not all trinkets will necessarily be present when a mod first loads (due to mod load order).
11526
- *
11527
- * In order to use this function, you must upgrade your mod with `ISCFeature.MODDED_ELEMENT_SETS`.
11528
- */
11529
- getTrinketSet(): ReadonlySet<TrinketType>;
11530
- /**
11531
- * Returns a set containing every trinket type with the given cache flag, including modded
11532
- * trinkets.
11533
- *
11534
- * This function can only be called if at least one callback has been executed. This is because
11535
- * not all trinkets will necessarily be present when a mod first loads (due to mod load order).
11536
- *
11537
- * In order to use this function, you must upgrade your mod with `ISCFeature.MODDED_ELEMENT_SETS`.
11538
- */
11539
- getTrinketsWithCacheFlag(cacheFlag: CacheFlag): ReadonlySet<TrinketType>;
11540
- /**
11541
- * Returns an array containing every valid vanilla card type in the game.
11542
- *
11543
- * Use this if you need to iterate over the cards in order. If you need to do O(1) lookups, then
11544
- * use the `getVanillaCardSet` helper function instead.
11545
- *
11546
- * In order to use this function, you must upgrade your mod with `ISCFeature.MODDED_ELEMENT_SETS`.
11547
- */
11548
- getVanillaCardArray(): readonly CardType[];
11549
- /**
11550
- * Returns a set containing every valid vanilla card type in the game.
11551
- *
11552
- * Use this if you need to do O(1) lookups. If you need to iterate over the cards in order, then
11553
- * use the `getVanillaCardArray` helper function instead.
11554
- *
11555
- * In order to use this function, you must upgrade your mod with `ISCFeature.MODDED_ELEMENT_SETS`.
11556
- */
11557
- getVanillaCardSet(): ReadonlySet<CardType>;
11558
- /**
11559
- * Returns an array containing every valid vanilla collectible type in the game.
11560
- *
11561
- * Use this if you need to iterate over the collectibles in order. If you need to do O(1) lookups,
11562
- * then use the `getVanillaCollectibleSet` helper function instead.
11563
- *
11564
- * In order to use this function, you must upgrade your mod with `ISCFeature.MODDED_ELEMENT_SETS`.
11565
- */
11566
- getVanillaCollectibleArray(): readonly CollectibleType[];
11567
- /**
11568
- * Returns a set containing every valid vanilla collectible type in the game.
11569
- *
11570
- * Use this if you need to do O(1) lookups. If you need to iterate over the collectibles in order,
11571
- * then use the `getVanillaCollectibleArray` helper function instead.
11572
- *
11573
- * In order to use this function, you must upgrade your mod with `ISCFeature.MODDED_ELEMENT_SETS`.
11574
- */
11575
- getVanillaCollectibleSet(): ReadonlySet<CollectibleType>;
11576
- /**
11577
- * Returns an array containing every valid vanilla trinket type in the game.
11578
- *
11579
- * Use this if you need to iterate over the trinkets in order. If you need to do O(1) lookups,
11580
- * then use the `getVanillaTrinketSet` helper function instead.
11581
- *
11582
- * In order to use this function, you must upgrade your mod with `ISCFeature.MODDED_ELEMENT_SETS`.
11583
- */
11584
- getVanillaTrinketArray(): readonly TrinketType[];
11585
- /**
11586
- * Returns a set containing every valid vanilla trinket type in the game.
11587
- *
11588
- * Use this if you need to do O(1) lookups. If you need to iterate over the trinkets in order,
11589
- * then use the `getVanillaTrinketArray` helper function instead.
11590
- *
11591
- * In order to use this function, you must upgrade your mod with `ISCFeature.MODDED_ELEMENT_SETS`.
11592
- */
11593
- getVanillaTrinketSet(): ReadonlySet<TrinketType>;
11594
- }
11595
-
11596
- /**
11597
- * Helper class for mods that want to represent their individual features as classes. Extend your
11598
- * mod features from this class in order to enable the `@Callback` and `@CustomCallback` decorators
11599
- * that automatically subscribe to callbacks.
11600
- *
11601
- * When instantiating a mod feature class, you must pass your upgraded mod as the first argument to
11602
- * the constructor.
11603
- *
11604
- * If your feature has variables that are managed by the save data manager, you need to explicitly
11605
- * register them with the save data manager yourself in your class constructor. (It can't be
11606
- * automatically done because parent classes don't have access to child class properties.)
11607
- *
11608
- * In almost all cases, you will want the callback functions to be immediately subscribed after
11609
- * instantiating the class. However, if this is not the case, you can pass `false` as the optional
11610
- * second argument to the constructor.
11611
- *
11612
- * If your mod feature has a property called `v`, it will be assumed that these are variables that
11613
- * should be managed by the save data manager. Subsequently, they will automatically be registered
11614
- * with the save data manager upon initialization. Unfortunately, due to technical limitations with
11615
- * classes, this registration will only occur if you initialize the class with the `init` boolean
11616
- * argument set to false, and then explicitly call the `ModFeature.init` method yourself after the
11617
- * class is constructed. (This is because the parent class does not have access to the child's
11618
- * properties upon first construction.)
11619
- */
11620
- export declare class ModFeature {
11621
- private mod;
11622
- /**
11623
- * An optional method that allows for conditional callback execution. If specified, any class
11624
- * method that is annotated with a `@Callback` or `@CallbackCustom` decorator will only be fired
11625
- * if the executed conditional function returns true.
11626
- *
11627
- * This property is used to easily turn entire mod features on and off (rather than repeating
11628
- * conditional logic and early returning at the beginning of every callback function).
11629
- *
11630
- * Since the specific information for the firing callback is passed as arguments into the
11631
- * conditional method, you can also write logic that would only apply to a specific type of
11632
- * callback.
11633
- *
11634
- * By default, this is set to null, which means that all callback methods will fire
11635
- * unconditionally. Override this property in your class if you need to use it.
11636
- *
11637
- * The function has the following signature:
11638
- *
11639
- * ```ts
11640
- * <T extends boolean>(
11641
- * vanilla: T, // Whether or not this is a vanilla or custom callback.
11642
- * modCallback: T extends true ? ModCallback : ModCallbackCustom,
11643
- * ...callbackArgs: unknown[] // This would be e.g. `pickup: EntityPickup` for the `POST_PICKUP_INIT` callback.
11644
- * ) => boolean;
11645
- * ```
11646
- */
11647
- protected shouldCallbackMethodsFire: (<T extends boolean>(vanilla: T, modCallback: T extends true ? ModCallback : ModCallbackCustom, ...callbackArgs: unknown[]) => boolean) | null;
11648
- /**
11649
- * Whether or not the feature has registered its callbacks yet.
11650
- *
11651
- * This will almost always be equal to true unless you explicitly passed `false` to the second
11652
- * argument of the constructor.
11653
- */
11654
- initialized: boolean;
11655
- constructor(mod: ModUpgradedBase, init?: boolean);
11656
- /**
11657
- * Runs the `Mod.AddCallback` and `ModUpgraded.AddCallbackCustom` methods for all of the decorated
11658
- * callbacks.
11659
- *
11660
- * @param init Optional. Whether to initialize or uninitialize. Default is true.
11661
- */
11662
- init(init?: boolean): void;
11663
- /**
11664
- * Runs the `Mod.RemoveCallback` and `ModUpgraded.RemoveCallbackCustom` methods for all of the
11665
- * decorated callbacks.
11666
- *
11667
- * This is just an alias for `ModFeature.init(false)`.
11668
- */
11669
- uninit(): void;
11670
- }
11671
-
11672
- /**
11673
- * `isaacscript-common` has many custom callbacks that you can use in your mods. Instead of
11674
- * hijacking the vanilla `Mod` object, we provide a `ModUpgraded` object for you to use, which
11675
- * extends the base class and adds a new method of `AddCallbackCustom`.
11676
- *
11677
- * To upgrade your mod, use the `upgradeMod` helper function.
11678
- *
11679
- * By specifying one or more optional features, end-users will get a version of `ModUpgraded` that
11680
- * has extra methods corresponding to the features that were specified.
11681
- */
11682
- export declare type ModUpgraded<T extends readonly ISCFeature[] = []> = ModUpgradedBase & ISCFeaturesToKeys<T>;
11683
-
11684
- /**
11685
- * `isaacscript-common` has many custom callbacks that you can use in your mods. Instead of
11686
- * hijacking the vanilla `Mod` object, we provide a `ModUpgraded` object for you to use, which
11687
- * extends the base class and adds a new method of `AddCallbackCustom`.
11688
- *
11689
- * To upgrade your mod, use the `upgradeMod` helper function.
11690
- *
11691
- * `ModUpgradedBase` provides the core functionality of the `ModUpgraded` class. (It does not
11692
- * include the methods for the individual ISC features.)
11693
- */
11694
- export declare class ModUpgradedBase implements Mod {
11695
- Name: string;
11696
- /** We store a copy of the original mod object so that we can re-implement its functions. */
11697
- private mod;
11698
- private debug;
11699
- private timeThreshold;
11700
- private callbacks;
11701
- private features;
11702
- constructor(mod: Mod, debug: boolean, timeThreshold?: float);
11703
- /**
11704
- * Registers a function to be executed when an in-game event happens. For example, the
11705
- * `ModCallback.POST_UPDATE` event corresponds to being executed once at the end of every game
11706
- * logic frame.
11707
- */
11708
- AddCallback<T extends ModCallback | string>(modCallback: T, ...args: T extends ModCallback ? AddCallbackParameters[T] : unknown[]): void;
11709
- AddPriorityCallback<T extends ModCallback | string>(modCallback: T, priority: CallbackPriority | int, ...args: T extends ModCallback ? AddCallbackParameters[T] : unknown[]): void;
11710
- /** Returns whether or not a corresponding "save#.dat" file exists for the current mod. */
11711
- HasData(): boolean;
11712
- /**
11713
- * Returns a string containing all of the data inside of the corresponding "save#.dat" file for
11714
- * this mod.
11715
- */
11716
- LoadData(): string;
11717
- /**
11718
- * Unregisters a function that was previously registered with the `AddCallback` method.
11719
- *
11720
- * This method does not care about the tertiary argument. In other words, regardless of the
11721
- * conditions of how you registered the callback, it will be removed.
11722
- */
11723
- RemoveCallback<T extends ModCallback>(modCallback: T, callback: AddCallbackParameters[T][0]): void;
11724
- /** Deletes the corresponding "save#.dat" file for this mod, if it exists. */
11725
- RemoveData(): void;
11726
- /**
11727
- * Creates or updates the corresponding "save#.dat" file for this mod with the provided string.
11728
- */
11729
- SaveData(data: string): void;
11730
- /**
11731
- * Registers a function to be executed when an in-game event happens. This method is specifically
11732
- * for events that are provided by the IsaacScript standard library. For example, the
11733
- * `ModCallbackCustom.POST_BOMB_EXPLODE` event corresponds to when a bomb explodes.
11734
- */
11735
- AddCallbackCustom<T extends ModCallbackCustom>(modCallbackCustom: T, ...args: AddCallbackParametersCustom[T]): void;
11736
- /**
11737
- * Unregisters a function that was previously registered with the `AddCallbackCustom` method.
11738
- *
11739
- * This method does not care about the tertiary argument. In other words, regardless of the
11740
- * conditions of how you registered the callback, it will be removed.
11741
- */
11742
- RemoveCallbackCustom<T extends ModCallbackCustom>(modCallbackCustom: T, callback: AddCallbackParametersCustom[T][0]): void;
11743
- /**
11744
- * Logs every custom callback or extra feature that is currently enabled. Useful for debugging or
11745
- * profiling.
11746
- */
11747
- logUsedFeatures(): void;
9472
+ logUsedFeatures(): void;
11748
9473
  /**
11749
9474
  * This is used to initialize both custom callbacks and "extra features".
11750
9475
  *
@@ -11763,11 +9488,6 @@ export declare class ModUpgradedBase implements Mod {
11763
9488
  * don't have access to it.
11764
9489
  */
11765
9490
  private initOptionalFeature;
11766
- /**
11767
- * This is mostly the same as the `AddCustomCallback` method, but we initialize the custom
11768
- * callback without actually registering a subscription.
11769
- */
11770
- private initCustomCallbackEarly;
11771
9491
  }
11772
9492
 
11773
9493
  export declare const MOVEMENT_ACTIONS_SET: ReadonlySet<ButtonAction>;
@@ -11884,23 +9604,6 @@ export declare function newTSTLClass(oldClass: TSTLClass): TSTLClass;
11884
9604
  */
11885
9605
  export declare function nextSeed(seed: Seed): Seed;
11886
9606
 
11887
- declare class NoSirenSteal extends Feature {
11888
- private postNPCInitSirenHelper;
11889
- private checkReturnFamiliarToPlayer;
11890
- private blacklistEntryExists;
11891
- /**
11892
- * Blacklists a familiar from being stolen by The Siren boss. This should be called once at the
11893
- * beginning of every run.
11894
- *
11895
- * In order to use this function, you must upgrade your mod with `ISCFeature.NO_SIREN_STEAL`.
11896
- *
11897
- * @param familiarVariant The familiar variant to blacklist.
11898
- * @param familiarSubType The sub-type to blacklist. Optional. The default is to blacklist all
11899
- * sub-types of the given variant.
11900
- */
11901
- setFamiliarNoSirenSteal(familiarVariant: FamiliarVariant, familiarSubType?: int): void;
11902
- }
11903
-
11904
9607
  export declare const NUM_DIMENSIONS: number;
11905
9608
 
11906
9609
  export declare const NUM_NORMAL_PILL_COLORS: number;
@@ -11988,8 +9691,6 @@ export declare function openAllDoors(): void;
11988
9691
  */
11989
9692
  export declare function openDoorFast(door: GridEntityDoor): void;
11990
9693
 
11991
- declare type OptionalArgs<T extends ModCallbackCustom> = AllButFirst<AddCallbackParametersCustom[T]>;
11992
-
11993
9694
  /**
11994
9695
  * Helper function to parse a string that contains an entity type, a variant, and a sub-type,
11995
9696
  * separated by periods.
@@ -12003,82 +9704,12 @@ export declare function parseEntityID(entityID: string): [entityType: EntityType
12003
9704
  /**
12004
9705
  * Helper function to parse a string that contains an entity type and a variant separated by a
12005
9706
  * period.
12006
- *
12007
- * For example, passing "45.0" would return an array of [45, 0].
12008
- *
12009
- * Returns undefined if the string cannot be parsed.
12010
- */
12011
- export declare function parseEntityTypeVariantString(entityTypeVariantString: string): [entityType: EntityType, variant: int] | undefined;
12012
-
12013
- declare class Pause extends Feature {
12014
- private disableInputs;
12015
- private postUpdate;
12016
- private stopTearsAndProjectilesFromMoving;
12017
- private inputActionGetActionValue;
12018
- isPaused(): boolean;
12019
- /**
12020
- * Helper function to emulate what happens when the player pauses the game. Use the `unpause`
12021
- * function to return things back to normal.
12022
- *
12023
- * Under the hood, this function:
12024
- * - uses the Pause collectible on every game frame
12025
- * - disables any player inputs (except for `ButtonAction.MENU_CONFIRM` and
12026
- * `ButtonAction.CONSOLE`)
12027
- *
12028
- * In order to use this function, you must upgrade your mod with `ISCFeature.PAUSE`.
12029
- */
12030
- pause(): void;
12031
- /**
12032
- * Helper function to put things back to normal after the `pause` function was used.
12033
- *
12034
- * In order to use this function, you must upgrade your mod with `ISCFeature.PAUSE`.
12035
- */
12036
- unpause(): void;
12037
- }
12038
-
12039
- declare class PersistentEntities extends Feature {
12040
- private roomHistory;
12041
- private postEntityRemove;
12042
- /**
12043
- * The persistent entity is despawning because the player is in the process of leaving the room.
12044
- * Keep track of the position for later.
12045
- */
12046
- private trackDespawningPickupPosition;
12047
- private postNewRoomReordered;
12048
- private spawnAndTrack;
12049
- /**
12050
- * Helper function to stop an entity spawned with the `spawnPersistentEntity` helper function from
12051
- * respawning.
12052
- *
12053
- * In order to use this function, you must upgrade your mod with `ISCFeature.PERSISTENT_ENTITIES`.
12054
- *
12055
- * @param persistentEntityIndex The index that was returned by the `spawnPersistentEntity`
12056
- * function.
12057
- * @param removeEntity Optional. True by default. Set to false if you want to stop an entity from
12058
- * being persistent but you don't want to actually remove the
12059
- * currently-spawned entity from the room.
12060
- */
12061
- removePersistentEntity(persistentEntityIndex: int, removeEntity?: boolean): void;
12062
- /**
12063
- * Helper function to spawn an entity that will have persistence similar to a pickup.
12064
- *
12065
- * By default, as soon as you leave a room, any spawned entities will be despawned and will not
12066
- * return if the player revisits the room. This means that if you want to have an entity like a
12067
- * pickup, you have to manually respawn it when the player re-enters the room. Use this helper
12068
- * function to avoid having to do any tracking on your own.
12069
- *
12070
- * Conventionally, the word "persistent" refers to `EntityFlag.FLAG_PERSISTENT`, which is used on
12071
- * e.g. familiars to make them appear in every room. On the other hand, pickups are also
12072
- * persistent, but they are not present in every room, only one specific room. This function
12073
- * spawns entities like pickups, not familiars.
12074
- *
12075
- * In order to use this function, you must upgrade your mod with `ISCFeature.PERSISTENT_ENTITIES`.
12076
- *
12077
- * @returns A tuple containing the entity and the persistent entity index. You can use the index
12078
- * with the `removePersistentEntity` function.
12079
- */
12080
- spawnPersistentEntity(entityType: EntityType, variant: int, subType: int, position: Vector): [Entity, int];
12081
- }
9707
+ *
9708
+ * For example, passing "45.0" would return an array of [45, 0].
9709
+ *
9710
+ * Returns undefined if the string cannot be parsed.
9711
+ */
9712
+ export declare function parseEntityTypeVariantString(entityTypeVariantString: string): [entityType: EntityType, variant: int] | undefined;
12082
9713
 
12083
9714
  export declare type PickingUpItem = PickingUpItemNull | PickingUpItemCollectible | PickingUpItemTrinket;
12084
9715
 
@@ -12124,45 +9755,6 @@ export declare type PickupIndex = int & {
12124
9755
  readonly __pickupIndexBrand: symbol;
12125
9756
  };
12126
9757
 
12127
- declare class PickupIndexCreation extends Feature {
12128
- private roomHistory;
12129
- private saveDataManager;
12130
- private postPickupInit;
12131
- private setPickupIndex;
12132
- private getPickupIndexFromPreviousData;
12133
- private postEntityRemovePickup;
12134
- private checkDespawningFromPlayerLeavingRoom;
12135
- /**
12136
- * This is a pickup that is despawning because the player is in the process of leaving the room.
12137
- * Keep track of the metadata for later.
12138
- */
12139
- private trackDespawningPickupMetadata;
12140
- /**
12141
- * If the despawning pickup was in a Treasure Room or Boss Room, then it is possible that the
12142
- * pickup could re-appear during The Ascent. If this is the case, we store the metadata on a
12143
- * separate map to reference later.
12144
- */
12145
- private getPickupDataMapForCurrentRoom;
12146
- private getPostAscentPickupIndex;
12147
- /**
12148
- * Mods often have to track variables relating to a pickups. Finding an index for these kinds of
12149
- * data structures is difficult, since pickups are respawned every time a player re-enters a room,
12150
- * so the `PtrHash` will change.
12151
- *
12152
- * Use this function to get a unique index for a pickup to use in these data structures.
12153
- *
12154
- * Specifically, `PickupIndex` is a number that represents the spawn order of the pickup on the
12155
- * current run. For example, the first pickup spawned will have an index of 1, the second one will
12156
- * have an index of 2, and so on.
12157
- *
12158
- * Tracking pickups requires stateful tracking, so using pickup indexes requires an upgraded mod.
12159
- *
12160
- * In order to use this function, you must upgrade your mod with
12161
- * `ISCFeature.PICKUP_INDEX_CREATION`.
12162
- */
12163
- getPickupIndex(pickup: EntityPickup): PickupIndex;
12164
- }
12165
-
12166
9758
  /** Maps pill effect names to the values of the `PillEffect` enum. */
12167
9759
  export declare const PILL_NAME_TO_EFFECT_MAP: ReadonlyMap<string, PillEffect>;
12168
9760
 
@@ -12184,53 +9776,6 @@ export declare function playChargeSoundEffect(player: EntityPlayer, activeSlot?:
12184
9776
  */
12185
9777
  export declare function playerAddCollectible(player: EntityPlayer, ...collectibleTypes: CollectibleType[]): void;
12186
9778
 
12187
- declare class PlayerCollectibleDetection extends Feature {
12188
- v: {
12189
- run: {
12190
- playersCollectibleCount: DefaultMap<PlayerIndex, number, []>;
12191
- playersCollectibleMap: DefaultMap<PlayerIndex, Map<CollectibleType, number>, []>;
12192
- playersActiveItemMap: DefaultMap<PlayerIndex, Map<ActiveSlot, CollectibleType>, []>;
12193
- };
12194
- };
12195
- private postPlayerCollectibleAdded;
12196
- private postPlayerCollectibleRemoved;
12197
- private moddedElementSets;
12198
- private runInNFrames;
12199
- constructor(postPlayerCollectibleAdded: PostPlayerCollectibleAdded, postPlayerCollectibleRemoved: PostPlayerCollectibleRemoved, moddedElementSets: ModdedElementSets, runInNFrames: RunInNFrames);
12200
- /**
12201
- * This is called when the collectible count changes and in situations where the entire build is
12202
- * rerolled.
12203
- *
12204
- * Since getting a new player collectible map is expensive, we want to only run this function when
12205
- * necessary, and not on e.g. every frame. Unfortunately, this has the side effect of missing out
12206
- * on collectible changes from mods that add and remove a collectible on the same frame.
12207
- *
12208
- * @param player The player to update.
12209
- * @param numCollectiblesChanged Pass undefined for situations where the entire build was
12210
- * rerolled.
12211
- */
12212
- private updateCollectibleMapAndFire;
12213
- private useItemD4;
12214
- /** We need to handle the case of Tainted Eden taking damage. */
12215
- private entityTakeDmgPlayer;
12216
- /**
12217
- * We need to handle TMTRAINER collectibles, since they do not cause the player's collectible
12218
- * count to change.
12219
- */
12220
- private postItemPickup;
12221
- private postPEffectUpdateReordered;
12222
- /**
12223
- * Checking for collectible count will work to detect when a player swaps their active item for
12224
- * another active item. This is because the collectible count will decrement by 1 when the item is
12225
- * swapped onto the pedestal and the hold animation begins, and increment by 1 when the item is
12226
- * dequeued and the hold animation ends.
12227
- *
12228
- * However, we also want to explicitly check for the case where a mod swaps in a custom active
12229
- * collectible on the same frame, since doing so is cheap.
12230
- */
12231
- private checkActiveItemsChanged;
12232
- }
12233
-
12234
9779
  export declare function playerConvertBlackHeartsToSoulHearts(player: EntityPlayer): void;
12235
9780
 
12236
9781
  export declare function playerConvertSoulHeartsToBlackHearts(player: EntityPlayer): void;
@@ -12294,62 +9839,6 @@ export declare type PlayerIndex = int & {
12294
9839
  readonly __playerIndexBrand: symbol;
12295
9840
  };
12296
9841
 
12297
- declare class PlayerInventory extends Feature {
12298
- private postCollectibleAdded;
12299
- private postCollectibleRemoved;
12300
- /**
12301
- * Helper function to get all of the collectibles that the player has gotten so far on this run,
12302
- * in order.
12303
- *
12304
- * In the case of inventory initialization or the case where the player rerolls their build in the
12305
- * middle of the run (e.g. with D4), the order of the inventory will not correspond to the order
12306
- * that the items were actually given to the player. In this case, the inventory will be in the
12307
- * order of the lowest `CollectibleType` to the highest.
12308
- *
12309
- * Under the hood, the inventory tracking works by tracking the number of collectibles that a
12310
- * player has on every frame. Thus, in a situation where a collectible was both added and removed
12311
- * to the player on the same frame, the amount of total collectibles would stay the same, and the
12312
- * inventory would not be updated. In vanilla, this situation would never happen, but another mod
12313
- * might do this for some reason. (With that said, the next time that a collectible is normally
12314
- * added or removed, it would trigger a re-scan, and the previous changes would be picked up.)
12315
- *
12316
- * In order to use this function, you must upgrade your mod with `ISCFeature.PLAYER_INVENTORY`.
12317
- *
12318
- * @param player The player to get the inventory for.
12319
- * @param includeActiveCollectibles Optional. If true, will include all active collectibles.
12320
- * Default is true.
12321
- */
12322
- getPlayerInventory(player: EntityPlayer, includeActiveCollectibles?: boolean): CollectibleType[];
12323
- /**
12324
- * Helper function to get the last passive collectible that the player picked up. In most cases,
12325
- * this will be the passive that is removed when the player would use Clicker.
12326
- *
12327
- * Returns undefined if the player does not have any passive collectibles.
12328
- *
12329
- * In order to use this function, you must upgrade your mod with `ISCFeature.PLAYER_INVENTORY`.
12330
- */
12331
- getPlayerLastPassiveCollectible(player: EntityPlayer): CollectibleType | undefined;
12332
- }
12333
-
12334
- declare class PlayerReorderedCallbacks extends Feature {
12335
- v: {
12336
- run: {
12337
- postGameStartedFiredOnThisRun: boolean;
12338
- postPEffectUpdateQueue: PlayerIndex[];
12339
- postPlayerUpdateQueue: PlayerIndex[];
12340
- postPlayerRenderQueue: PlayerIndex[];
12341
- };
12342
- };
12343
- private postPEffectUpdateReordered;
12344
- private postPlayerRenderReordered;
12345
- private postPlayerUpdateReordered;
12346
- constructor(postPEffectUpdateReordered: PostPEffectUpdateReordered, postPlayerRenderReordered: PostPlayerRenderReordered, postPlayerUpdateReordered: PostPlayerUpdateReordered);
12347
- private postPEffectUpdate;
12348
- private postPlayerUpdate;
12349
- private postPlayerRender;
12350
- private postGameStartedReorderedLast;
12351
- }
12352
-
12353
9842
  /** This is used by the `getPocketItems` and related helper functions. */
12354
9843
  export declare interface PocketItemDescription {
12355
9844
  slot: PocketItemSlot;
@@ -12367,268 +9856,12 @@ export declare enum PocketItemType {
12367
9856
  UNDETERMINABLE = 5
12368
9857
  }
12369
9858
 
12370
- declare class PonyDetection extends Feature {
12371
- private postPEffectUpdateReordered;
12372
- /**
12373
- * Helper function to see if the player is under the effects of A Pony or White Pony charge.
12374
- * Detecting this is difficult, as the temporary effect will disappear upon entering a new room.
12375
- *
12376
- * In order to use this function, you must upgrade your mod with `ISCFeature.PONY_DETECTION`.
12377
- */
12378
- isPlayerUsingPony(player: EntityPlayer): boolean;
12379
- /**
12380
- * Helper function to see if any player is under the effects of A Pony or White Pony charge.
12381
- * Detecting this is difficult, as the temporary effect will disappear upon entering a new room.
12382
- *
12383
- * In order to use this function, you must upgrade your mod with `ISCFeature.PONY_DETECTION`.
12384
- */
12385
- anyPlayerUsingPony(): boolean;
12386
- }
12387
-
12388
9859
  /**
12389
9860
  * These are the possible types that player stats can be. For example, `EntityPlayer.Damage` is of
12390
9861
  * type `float`, `EntityPlayer.CanFly` is of type `boolean`, and so on.
12391
9862
  */
12392
9863
  export declare type PossibleStatType = number | boolean | BitFlags<TearFlag> | Color | Vector;
12393
9864
 
12394
- declare class PostCustomRevive extends CustomCallback<ModCallbackCustom.POST_CUSTOM_REVIVE> {
12395
- constructor();
12396
- protected shouldFire: (fireArgs: [player: EntityPlayer, revivalType: number], optionalArgs: OptionalArgs<T>) => boolean;
12397
- }
12398
-
12399
- declare class PostEsauJr extends CustomCallback<ModCallbackCustom.POST_ESAU_JR> {
12400
- constructor();
12401
- }
12402
-
12403
- declare class PostFirstEsauJr extends CustomCallback<ModCallbackCustom.POST_FIRST_ESAU_JR> {
12404
- constructor();
12405
- }
12406
-
12407
- declare class PostFirstFlip extends CustomCallback<ModCallbackCustom.POST_FIRST_FLIP> {
12408
- constructor();
12409
- }
12410
-
12411
- declare class PostFlip extends CustomCallback<ModCallbackCustom.POST_FLIP> {
12412
- constructor();
12413
- }
12414
-
12415
- declare class PostGridEntityBroken extends CustomCallback<ModCallbackCustom.POST_GRID_ENTITY_BROKEN> {
12416
- constructor();
12417
- protected shouldFire: typeof shouldFireGridEntity;
12418
- }
12419
-
12420
- declare class PostGridEntityCollision extends CustomCallback<T_2> {
12421
- constructor();
12422
- protected shouldFire: (fireArgs: [gridEntity: GridEntity, entity: Entity], optionalArgs: [gridEntityType?: GridEntityType | undefined, gridEntityVariant?: number | undefined, entityType?: EntityType | undefined, entityVariant?: number | undefined, entitySubType?: number | undefined]) => boolean;
12423
- }
12424
-
12425
- declare class PostGridEntityCustomBroken extends CustomCallback<ModCallbackCustom.POST_GRID_ENTITY_CUSTOM_BROKEN> {
12426
- constructor();
12427
- protected shouldFire: typeof shouldFireGridEntityCustom;
12428
- }
12429
-
12430
- declare class PostGridEntityCustomCollision extends CustomCallback<T_3> {
12431
- constructor();
12432
- protected shouldFire: (fireArgs: [gridEntity: GridEntity, gridEntityTypeCustom: GridEntityType, entity: Entity], optionalArgs: [gridEntityTypeCustom?: GridEntityType | undefined, entityType?: EntityType | undefined, entityVariant?: number | undefined, entitySubType?: number | undefined]) => boolean;
12433
- }
12434
-
12435
- declare class PostGridEntityCustomInit extends CustomCallback<ModCallbackCustom.POST_GRID_ENTITY_CUSTOM_INIT> {
12436
- constructor();
12437
- protected shouldFire: typeof shouldFireGridEntityCustom;
12438
- }
12439
-
12440
- declare class PostGridEntityCustomRemove extends CustomCallback<T_5> {
12441
- constructor();
12442
- protected shouldFire: (fireArgs: [gridIndex: number, gridEntityTypeCustom: GridEntityType], optionalArgs: OptionalArgs<T_5>) => boolean;
12443
- }
12444
-
12445
- declare class PostGridEntityCustomRender extends CustomCallback<ModCallbackCustom.POST_GRID_ENTITY_CUSTOM_RENDER> {
12446
- constructor();
12447
- protected shouldFire: typeof shouldFireGridEntityCustom;
12448
- }
12449
-
12450
- declare class PostGridEntityCustomStateChanged extends CustomCallback<ModCallbackCustom.POST_GRID_ENTITY_CUSTOM_STATE_CHANGED> {
12451
- constructor();
12452
- protected shouldFire: typeof shouldFireGridEntityCustom;
12453
- }
12454
-
12455
- declare class PostGridEntityCustomUpdate extends CustomCallback<ModCallbackCustom.POST_GRID_ENTITY_CUSTOM_UPDATE> {
12456
- constructor();
12457
- protected shouldFire: typeof shouldFireGridEntityCustom;
12458
- }
12459
-
12460
- declare class PostGridEntityInit extends CustomCallback<ModCallbackCustom.POST_GRID_ENTITY_INIT> {
12461
- constructor();
12462
- protected shouldFire: typeof shouldFireGridEntity;
12463
- }
12464
-
12465
- declare class PostGridEntityRemove extends CustomCallback<T_4> {
12466
- constructor();
12467
- protected shouldFire: (fireArgs: [gridIndex: number, gridEntityType: GridEntityType, variant: number], optionalArgs: [gridEntityType?: GridEntityType | undefined, variant?: number | undefined]) => boolean;
12468
- }
12469
-
12470
- declare class PostGridEntityRender extends CustomCallback<ModCallbackCustom.POST_GRID_ENTITY_RENDER> {
12471
- constructor();
12472
- protected shouldFire: typeof shouldFireGridEntity;
12473
- }
12474
-
12475
- declare class PostGridEntityStateChanged extends CustomCallback<ModCallbackCustom.POST_GRID_ENTITY_STATE_CHANGED> {
12476
- constructor();
12477
- protected shouldFire: typeof shouldFireGridEntity;
12478
- }
12479
-
12480
- declare class PostGridEntityUpdate extends CustomCallback<ModCallbackCustom.POST_GRID_ENTITY_UPDATE> {
12481
- constructor();
12482
- protected shouldFire: typeof shouldFireGridEntity;
12483
- }
12484
-
12485
- declare class PostItemPickup extends CustomCallback<ModCallbackCustom.POST_ITEM_PICKUP> {
12486
- constructor();
12487
- protected shouldFire: typeof shouldFireItemPickup;
12488
- }
12489
-
12490
- declare class PostPEffectUpdateReordered extends CustomCallback<ModCallbackCustom.POST_PEFFECT_UPDATE_REORDERED> {
12491
- constructor();
12492
- protected shouldFire: typeof shouldFirePlayer;
12493
- }
12494
-
12495
- declare class PostPlayerCollectibleAdded extends CustomCallback<ModCallbackCustom.POST_PLAYER_COLLECTIBLE_ADDED> {
12496
- constructor();
12497
- protected shouldFire: typeof shouldFireCollectibleType;
12498
- }
12499
-
12500
- declare class PostPlayerCollectibleRemoved extends CustomCallback<ModCallbackCustom.POST_PLAYER_COLLECTIBLE_REMOVED> {
12501
- constructor();
12502
- protected shouldFire: typeof shouldFireCollectibleType;
12503
- }
12504
-
12505
- declare class PostPlayerRenderReordered extends CustomCallback<ModCallbackCustom.POST_PLAYER_RENDER_REORDERED> {
12506
- constructor();
12507
- protected shouldFire: typeof shouldFirePlayer;
12508
- }
12509
-
12510
- declare class PostPlayerUpdateReordered extends CustomCallback<ModCallbackCustom.POST_PLAYER_UPDATE_REORDERED> {
12511
- constructor();
12512
- protected shouldFire: typeof shouldFirePlayer;
12513
- }
12514
-
12515
- declare class PostSlotAnimationChanged extends CustomCallback<ModCallbackCustom.POST_SLOT_ANIMATION_CHANGED> {
12516
- constructor();
12517
- protected shouldFire: typeof shouldFireSlot;
12518
- }
12519
-
12520
- declare class PostSlotDestroyed extends CustomCallback<ModCallbackCustom.POST_SLOT_DESTROYED> {
12521
- constructor();
12522
- protected shouldFire: typeof shouldFireSlot;
12523
- }
12524
-
12525
- declare class PostSlotInit extends CustomCallback<ModCallbackCustom.POST_SLOT_INIT> {
12526
- constructor();
12527
- protected shouldFire: typeof shouldFireSlot;
12528
- }
12529
-
12530
- declare class PostSlotRender extends CustomCallback<ModCallbackCustom.POST_SLOT_RENDER> {
12531
- constructor();
12532
- protected shouldFire: typeof shouldFireSlot;
12533
- }
12534
-
12535
- declare class PostSlotUpdate extends CustomCallback<ModCallbackCustom.POST_SLOT_UPDATE> {
12536
- constructor();
12537
- protected shouldFire: typeof shouldFireSlot;
12538
- }
12539
-
12540
- declare class PreCustomRevive extends CustomCallback<ModCallbackCustom.PRE_CUSTOM_REVIVE> {
12541
- constructor();
12542
- protected shouldFire: typeof shouldFirePlayer;
12543
- }
12544
-
12545
- declare class PreItemPickup extends CustomCallback<ModCallbackCustom.PRE_ITEM_PICKUP> {
12546
- constructor();
12547
- protected shouldFire: typeof shouldFireItemPickup;
12548
- }
12549
-
12550
- declare class PressInput extends Feature {
12551
- private isActionTriggered;
12552
- /**
12553
- * Helper function to press an arbitrary `ButtonAction` on the next possible input poll. In most
12554
- * cases, this will be equivalent to if the first player pressed the corresponding input. It
12555
- * usually takes 1 frame for the input to take effect.
12556
- *
12557
- * In order to use this function, you must upgrade your mod with `ISCFeature.PRESS_INPUT`.
12558
- */
12559
- pressInput(player: EntityPlayer, buttonAction: ButtonAction): void;
12560
- }
12561
-
12562
- declare class PreventChildEntities extends Feature {
12563
- private postNPCInit;
12564
- /**
12565
- * Helper function to prevent an entity from spawning any other entities. Meant to be used on NPCs
12566
- * like Squirts. This behavior will only last for the current room.
12567
- *
12568
- * Under the hood, this function will remove any new NPCs spawned that have a
12569
- * `Entity.SpawnerEntity` or `Entity.Parent` value that matches the provided entity. (They are
12570
- * removed during the `POST_NPC_INIT` callback specifically.)
12571
- *
12572
- * In order to use this function, you must upgrade your mod with
12573
- * `ISCFeature.PREVENT_CHILD_ENTITIES`.
12574
- */
12575
- preventChildEntities(entity: Entity): void;
12576
- }
12577
-
12578
- declare class PreventCollectibleRotation extends Feature {
12579
- private useCardSoulOfIsaac;
12580
- private postPickupUpdateCollectible;
12581
- private checkCollectibleRotated;
12582
- /**
12583
- * Helper function to prevent a collectible from being affected by Tainted Isaac's rotation
12584
- * mechanic. (This mechanic also happens from Glitched Crown and Binge Eater.) This is useful
12585
- * because quest items that are manually spawned by mods will be automatically be affected by this
12586
- * mechanic.
12587
- *
12588
- * It is required to pass the intended collectible type to this function since it is possible for
12589
- * collectibles to rotate on the first frame that they are spawned.
12590
- *
12591
- * In order to use this function, you must upgrade your mod with
12592
- * `ISCFeature.PREVENT_COLLECTIBLE_ROTATION`.
12593
- */
12594
- preventCollectibleRotation(collectible: EntityPickup, collectibleType: CollectibleType): void;
12595
- }
12596
-
12597
- declare class PreventGridEntityRespawn extends Feature {
12598
- private runInNFrames;
12599
- private preUseItemWeNeedToGoDeeper;
12600
- private postNewRoomReordered;
12601
- /**
12602
- * Every time we re-enter the room, the sprites for all of the decorations will come back, so we
12603
- * have to remove them again.
12604
- */
12605
- private setDecorationsInvisible;
12606
- /**
12607
- * Helper function to prevent any removed grid entities from respawning if the player re-enters
12608
- * the current room.
12609
- *
12610
- * This is accomplished by spawning a new grid entity on every tile that does not already have a
12611
- * grid entity. This will force the game to spawn the new grid entity instead of the old one. The
12612
- * natural grid entity to choose for this purpose is a decoration, since it is non-interacting.
12613
- * Then, the decorations are made invisible and any shovel uses are intercepted to avoid creating
12614
- * a crawl space (instead of a trapdoor).
12615
- *
12616
- * Another option besides decorations would be to use a pressure plates with a state of 1, which
12617
- * is a state that is normally unused by the game and makes it invisible & persistent. However,
12618
- * pickups will not be able to spawn on pressure plates, which lead to various bugs (e.g. pickups
12619
- * spawning on top of pits). Thus, using a decoration is preferable.
12620
- *
12621
- * Yet another option to accomplish this would be to replace the room data with that of an empty
12622
- * room. However, the room data must exactly match the room type, the room shape, and the doors,
12623
- * so this is not possible to do in a robust way without adding empty rooms to the mod's `content`
12624
- * folder to draw the data from.
12625
- *
12626
- * In order to use this function, you must upgrade your mod with
12627
- * `ISCFeature.PREVENT_GRID_ENTITY_RESPAWN`.
12628
- */
12629
- preventGridEntityRespawn(): void;
12630
- }
12631
-
12632
9865
  /** Helper function to print whether something was enabled or disabled to the in-game console. */
12633
9866
  export declare function printEnabled(enabled: boolean, description: string): void;
12634
9867
 
@@ -13330,24 +10563,6 @@ export declare enum RockAltType {
13330
10563
  /** Maps room names to the values of the `RoomType` enum. */
13331
10564
  export declare const ROOM_NAME_TO_TYPE_MAP: ReadonlyMap<string, RoomType>;
13332
10565
 
13333
- declare class RoomClearFrame extends Feature {
13334
- private postRoomClearChangedTrue;
13335
- /**
13336
- * Helper function to get the game frame (i.e. `Game.GetFrameCount`) of the last time that this
13337
- * room was cleared. Returns undefined if the room has never been cleared.
13338
- *
13339
- * In order to use this function, you must upgrade your mod with `ISCFeature.ROOM_CLEAR_FRAME`.
13340
- */
13341
- getRoomClearGameFrame(): int | undefined;
13342
- /**
13343
- * Helper function to get the room frame (i.e. `Room.GetFrameCount`) of the last time that this
13344
- * room was cleared. Returns undefined if the room has never been cleared.
13345
- *
13346
- * In order to use this function, you must upgrade your mod with `ISCFeature.ROOM_CLEAR_FRAME`.
13347
- */
13348
- getRoomClearRoomFrame(): int | undefined;
13349
- }
13350
-
13351
10566
  /** This is used by the room history feature of the standard library. */
13352
10567
  export declare interface RoomDescription {
13353
10568
  startSeedString: string;
@@ -13370,238 +10585,42 @@ export declare interface RoomDescription {
13370
10585
  */
13371
10586
  export declare function roomExists(roomGridIndex: int): boolean;
13372
10587
 
13373
- /**
13374
- * Helper function to get the coordinates of a given grid index. The floor is represented by a 13x13
13375
- * grid.
13376
- *
13377
- * - Since the starting room is in the center, the starting room grid index of 84 is equal to
13378
- * coordinates of (6, 6).
13379
- * - The top-left grid index of 0 is equal to coordinates of: (12, 0)
13380
- * - The top-right grid index of 12 is equal to coordinates of: (0, 0)
13381
- * - The bottom-left grid index of 156 is equal to coordinates of: (0, 12)
13382
- * - The bottom-right grid index of 168 is equal to coordinates of: (12, 12)
13383
- */
13384
- export declare function roomGridIndexToXY(roomGridIndex: int): [x: int, y: int];
13385
-
13386
- declare class RoomHistory extends Feature {
13387
- private postNewRoomEarly;
13388
- /**
13389
- * Helper function to get the total number of rooms that the player has entered thus far on the
13390
- * run. (Re-entering the same room will increment the number returned.)
13391
- *
13392
- * In order to use this function, you must upgrade your mod with `ISCFeature.ROOM_HISTORY`.
13393
- */
13394
- getNumRoomsEntered(): int;
13395
- /**
13396
- * Helper function to get information about all of the rooms that a player has visited thus far on
13397
- * this run.
13398
- *
13399
- * In order to use this function, you must upgrade your mod with `ISCFeature.ROOM_HISTORY`.
13400
- */
13401
- getRoomHistory(): ReadonlyArray<Readonly<RoomDescription>>;
13402
- /**
13403
- * Helper function to get information about the room that was previously visited.
13404
- *
13405
- * In the special case of only one room having been visited thus far (i.e. the starting room of
13406
- * the run), the starting room will be returned.
13407
- *
13408
- * In order to use this function, you must upgrade your mod with `ISCFeature.ROOM_HISTORY`.
13409
- */
13410
- getPreviousRoomDescription(): Readonly<RoomDescription>;
13411
- /**
13412
- * Helper function to get information about the most recent room that is stored in the room
13413
- * history array.
13414
- *
13415
- * This is useful in the `POST_ENTITY_REMOVE` callback; see the `isLeavingRoom` function.
13416
- *
13417
- * Note that this function can return undefined in the case where it is called on the first room
13418
- * of the run.
13419
- *
13420
- * In order to use this function, you must upgrade your mod with `ISCFeature.ROOM_HISTORY`.
13421
- */
13422
- getLatestRoomDescription(): Readonly<RoomDescription> | undefined;
13423
- /**
13424
- * Helper function to detect if the game is in the state where the room index has changed to a new
13425
- * room, but the entities from the previous room are currently in the process of despawning. (At
13426
- * this point, the `POST_NEW_ROOM` callback and the `POST_NEW_ROOM_EARLY` callback will not have
13427
- * fired yet, and there will not be an entry in the room history array for the current room.)
13428
- *
13429
- * This function is intended to be used in the `POST_ENTITY_REMOVE` callback to detect when an
13430
- * entity is despawning.
13431
- *
13432
- * In order to use this function, you must upgrade your mod with `ISCFeature.ROOM_HISTORY`.
13433
- */
13434
- isLeavingRoom(): boolean;
13435
- }
13436
-
13437
- /**
13438
- * If the `Room.Update` method is called in a `POST_NEW_ROOM` callback, then some entities will
13439
- * slide around (such as the player). Since those entity velocities are already at zero, setting
13440
- * them to zero will have no effect. Thus, a generic solution is to record all of the entity
13441
- * positions/velocities before updating the room, and then restore those positions/velocities.
13442
- */
13443
- export declare function roomUpdateSafe(): void;
13444
-
13445
- /**
13446
- * If rounding fails, this function returns 0.
13447
- * From: http://lua-users.org/wiki/SimpleRound
13448
- *
13449
- * @param num The number to round.
13450
- * @param numDecimalPlaces Optional. Default is 0.
13451
- */
13452
- export declare function round(num: float, numDecimalPlaces?: number): float;
13453
-
13454
- /**
13455
- * Run the suite of tests that prove that the "deepCopy" helper function works properly.
13456
- *
13457
- * This function is only useful if you are troubleshooting the "deepCopy" function.
13458
- */
13459
- export declare function runDeepCopyTests(): void;
13460
-
13461
- declare class RunInNFrames extends Feature {
13462
- vConditionalFunc: () => boolean;
13463
- private roomHistory;
13464
- private postUpdate;
13465
- private postRender;
13466
- /**
13467
- * Helper function to restart on the next render frame. Useful because it is impossible to restart
13468
- * the game inside of the `POST_NEW_ROOM`, `POST_NEW_LEVEL`, or `POST_GAME_STARTED` callbacks when
13469
- * a run is first starting.
13470
- *
13471
- * You can optionally specify a `PlayerType` to restart the game as that character.
13472
- *
13473
- * In order to use this function, you must upgrade your mod with `ISCFeature.RUN_IN_N_FRAMES`.
13474
- */
13475
- restartNextRenderFrame(character?: PlayerType): void;
13476
- /**
13477
- * Supply a function to run N game frames from now in the `POST_UPDATE` callback.
13478
- *
13479
- * For a usage example, see the documentation for the `runNextGameFrame`, which is used in a
13480
- * similar way.
13481
- *
13482
- * Note that this function will not handle saving and quitting. If a player saving and quitting
13483
- * before the deferred function fires would cause a bug in your mod, then you should handle
13484
- * deferred functions manually using serializable data.
13485
- *
13486
- * In order to use this function, you must upgrade your mod with `ISCFeature.RUN_IN_N_FRAMES`.
13487
- *
13488
- * @param func The function to run.
13489
- * @param gameFrames The amount of game frames to wait before running the function.
13490
- * @param cancelIfRoomChanges Optional. Whether or not to cancel running the function if a new
13491
- * room is loaded in the interim. Default is false.
13492
- */
13493
- runInNGameFrames(func: () => void, gameFrames: int, cancelIfRoomChanges?: boolean): void;
13494
- /**
13495
- * Supply a function to run N render frames from now in the `POST_RENDER` callback.
13496
- *
13497
- * For a usage example, see the documentation for the `runNextGameFrame`, which is used in a
13498
- * similar way.
13499
- *
13500
- * Note that this function will not handle saving and quitting. If a player saving and quitting
13501
- * before the deferred function fires would cause a bug in your mod, then you should handle
13502
- * deferred functions manually using serializable data.
13503
- *
13504
- * In order to use this function, you must upgrade your mod with `ISCFeature.RUN_IN_N_FRAMES`.
13505
- *
13506
- * @param func The function to run.
13507
- * @param renderFrames The amount of render frames to wait before running the function.
13508
- * @param cancelIfRoomChanges Optional. Whether or not to cancel running the function if a new
13509
- * room is loaded in the interim. Default is false.
13510
- */
13511
- runInNRenderFrames(func: () => void, renderFrames: int, cancelIfRoomChanges?: boolean): void;
13512
- /**
13513
- * Supply a function to run on the next `POST_UPDATE` callback.
13514
- *
13515
- * For example:
13516
- *
13517
- * ```ts
13518
- * const NUM_EXPLODER_EXPLOSIONS = 5;
13519
- *
13520
- * function useItemExploder(player: EntityPlayer) {
13521
- * playSound("exploderBegin");
13522
- * explode(player, NUM_EXPLODER_EXPLOSIONS);
13523
- * }
13524
- *
13525
- * function explode(player: EntityPlayer, numFramesLeft: int) {
13526
- * Isaac.Explode(player, undefined, 1);
13527
- * numFramesLeft -= 1;
13528
- * if (numFramesLeft === 0) {
13529
- * runNextFrame(() => {
13530
- * explode(player, numFramesLeft);
13531
- * });
13532
- * }
13533
- * }
13534
- * ```
13535
- *
13536
- * Note that this function will not handle saving and quitting. If a player saving and quitting
13537
- * before the deferred function fires would cause a bug in your mod, then you should handle
13538
- * deferred functions manually using serializable data.
13539
- *
13540
- * In order to use this function, you must upgrade your mod with `ISCFeature.RUN_IN_N_FRAMES`.
13541
- *
13542
- * @param func The function to run.
13543
- * @param cancelIfRoomChanges Optional. Whether or not to cancel running the function if a new
13544
- * room is loaded in the interim. Default is false.
13545
- */
13546
- runNextGameFrame(func: () => void, cancelIfRoomChanges?: boolean): void;
13547
- /**
13548
- * Supply a function to run on the next `POST_RENDER` callback.
13549
- *
13550
- * For a usage example, see the documentation for the `runNextGameFrame`, which is used in a
13551
- * similar way.
13552
- *
13553
- * Note that this function will not handle saving and quitting.
13554
- *
13555
- * In order to use this function, you must upgrade your mod with `ISCFeature.RUN_IN_N_FRAMES`.
13556
- *
13557
- * @param func The function to run.
13558
- * @param cancelIfRoomChanges Optional. Whether or not to cancel running the function if a new
13559
- * room is loaded in the interim. Default is false.
13560
- */
13561
- runNextRenderFrame(func: () => void, cancelIfRoomChanges?: boolean): void;
13562
- /**
13563
- * Supply a function to be repeatedly run on an interval of N game frames in the `POST_UPDATE`
13564
- * callback. The function will continue to be fired until `false` is returned from the function.
13565
- *
13566
- * This is similar to the `setInterval` vanilla JavaScript function, except there is no
13567
- * corresponding `clearInterval` function. (Instead, the return value from the supplied function
13568
- * is used to stop the interval.)
13569
- *
13570
- * Note that this function will not handle saving and quitting. You must manually restart any
13571
- * intervals if the player saves and quits in the middle of a run.
13572
- *
13573
- * In order to use this function, you must upgrade your mod with `ISCFeature.RUN_IN_N_FRAMES`.
13574
- *
13575
- * @param func The function to repeatedly run on an interval.
13576
- * @param gameFrames The amount of game frames to wait between each run.
13577
- * @param runImmediately Whether or not to execute the function right now before waiting for the
13578
- * interval.
13579
- * @param cancelIfRoomChanges Optional. Whether or not to cancel running the function if a new
13580
- * room is loaded in the interim. Default is false.
13581
- */
13582
- setIntervalGameFrames(func: () => boolean, gameFrames: int, runImmediately: boolean, cancelIfRoomChanges?: boolean): void;
13583
- /**
13584
- * Supply a function to be repeatedly run on an interval of N render frames in the `POST_RENDER`
13585
- * callback. The function will continue to be fired until `false` is returned from the function.
13586
- *
13587
- * This is similar to the `setInterval` vanilla JavaScript function, except there is no
13588
- * corresponding `clearInterval` function. (Instead, the return value from the supplied function
13589
- * is used to stop the interval.)
13590
- *
13591
- * Note that this function will not handle saving and quitting. You must manually restart any
13592
- * intervals if the player saves and quits in the middle of a run.
13593
- *
13594
- * In order to use this function, you must upgrade your mod with `ISCFeature.RUN_IN_N_FRAMES`.
13595
- *
13596
- * @param func The function to repeatedly run on an interval.
13597
- * @param renderFrames The amount of game frames to wait between each run.
13598
- * @param runImmediately Whether or not to execute the function right now before waiting for the
13599
- * interval.
13600
- * @param cancelIfRoomChanges Optional. Whether or not to cancel running the function if a new
13601
- * room is loaded in the interim. Default is false.
13602
- */
13603
- setIntervalRenderFrames(func: () => boolean, renderFrames: int, runImmediately: boolean, cancelIfRoomChanges?: boolean): void;
13604
- }
10588
+ /**
10589
+ * Helper function to get the coordinates of a given grid index. The floor is represented by a 13x13
10590
+ * grid.
10591
+ *
10592
+ * - Since the starting room is in the center, the starting room grid index of 84 is equal to
10593
+ * coordinates of (6, 6).
10594
+ * - The top-left grid index of 0 is equal to coordinates of: (12, 0)
10595
+ * - The top-right grid index of 12 is equal to coordinates of: (0, 0)
10596
+ * - The bottom-left grid index of 156 is equal to coordinates of: (0, 12)
10597
+ * - The bottom-right grid index of 168 is equal to coordinates of: (12, 12)
10598
+ */
10599
+ export declare function roomGridIndexToXY(roomGridIndex: int): [x: int, y: int];
10600
+
10601
+ /**
10602
+ * If the `Room.Update` method is called in a `POST_NEW_ROOM` callback, then some entities will
10603
+ * slide around (such as the player). Since those entity velocities are already at zero, setting
10604
+ * them to zero will have no effect. Thus, a generic solution is to record all of the entity
10605
+ * positions/velocities before updating the room, and then restore those positions/velocities.
10606
+ */
10607
+ export declare function roomUpdateSafe(): void;
10608
+
10609
+ /**
10610
+ * If rounding fails, this function returns 0.
10611
+ * From: http://lua-users.org/wiki/SimpleRound
10612
+ *
10613
+ * @param num The number to round.
10614
+ * @param numDecimalPlaces Optional. Default is 0.
10615
+ */
10616
+ export declare function round(num: float, numDecimalPlaces?: number): float;
10617
+
10618
+ /**
10619
+ * Run the suite of tests that prove that the "deepCopy" helper function works properly.
10620
+ *
10621
+ * This function is only useful if you are troubleshooting the "deepCopy" function.
10622
+ */
10623
+ export declare function runDeepCopyTests(): void;
13605
10624
 
13606
10625
  /**
13607
10626
  * Run the suite of tests that prove that the "merge" function works properly.
@@ -13610,21 +10629,6 @@ declare class RunInNFrames extends Feature {
13610
10629
  */
13611
10630
  export declare function runMergeTests(): void;
13612
10631
 
13613
- declare class RunNextRoom extends Feature {
13614
- vConditionalFunc: () => boolean;
13615
- private postNewRoomReordered;
13616
- /**
13617
- * Supply a function to run on the next `POST_NEW_ROOM` callback.
13618
- *
13619
- * Note that this function will not handle saving and quitting. If a player saving and quitting
13620
- * before the deferred function fires would cause a bug in your mod, then you should handle
13621
- * deferred functions manually using serializable data.
13622
- *
13623
- * In order to use this function, you must upgrade your mod with `ISCFeature.RUN_NEXT_ROOM`.
13624
- */
13625
- runNextRoom(func: () => void): void;
13626
- }
13627
-
13628
10632
  /**
13629
10633
  * This is the format of the object that you give to the save data manager. It will contains all of
13630
10634
  * the variables for the particular mod feature.
@@ -13664,241 +10668,6 @@ export declare enum SaveDataKey {
13664
10668
  ROOM = "room"
13665
10669
  }
13666
10670
 
13667
- declare class SaveDataManager extends Feature {
13668
- /**
13669
- * We store a local reference to the mod object so that we can access the corresponding methods
13670
- * that read and write to the "save#.dat" file.
13671
- */
13672
- private mod;
13673
- /**
13674
- * The save data map is indexed by subscriber name. We use Lua tables instead of TypeScriptToLua
13675
- * Maps for the master map so that we can access the variables via the in-game console when
13676
- * debugging. (TSTL Maps don't expose the map keys as normal keys.)
13677
- */
13678
- private saveDataMap;
13679
- /**
13680
- * When mod feature data is initialized, we copy the initial values into a separate map so that we
13681
- * can restore them later on.
13682
- */
13683
- private saveDataDefaultsMap;
13684
- /**
13685
- * Each mod feature can optionally provide a function that can control whether or not the save
13686
- * data is written to disk.
13687
- */
13688
- private saveDataConditionalFuncMap;
13689
- /**
13690
- * We backup some save data keys on every new room for the purposes of restoring it when Glowing
13691
- * Hour Glass is used.
13692
- *
13693
- * Note that the save data is backed up in serialized form so that we can use the `merge` function
13694
- * to restore it.
13695
- */
13696
- private saveDataGlowingHourGlassMap;
13697
- /**
13698
- * End-users can register their classes with the save data manager for proper serialization when
13699
- * contained in nested maps, sets, and arrays.
13700
- */
13701
- private classConstructors;
13702
- private loadedDataOnThisRun;
13703
- private restoreGlowingHourGlassDataOnNextRoom;
13704
- private postUseItemGlowingHourGlass;
13705
- private postPlayerInit;
13706
- private preGameExit;
13707
- private postNewLevel;
13708
- private postNewRoomEarly;
13709
- /**
13710
- * This is the entry point to the save data manager, a system which provides two major features:
13711
- *
13712
- * 1. Automatic resetting of variables on a new run, on a new level, or on a new room (as
13713
- * desired).
13714
- * 2. Automatic saving and loading of all tracked data to the "save#.dat" file.
13715
- *
13716
- * You feed this function with an object containing your variables, and then it will automatically
13717
- * manage them for you. (See below for an example.)
13718
- *
13719
- * In order to use this function, you must upgrade your mod with `ISCFeature.SAVE_DATA_MANAGER`.
13720
- * (Upgrade your mod before registering any of your own callbacks so that the save data manager
13721
- * will run before any of your code does.)
13722
- *
13723
- * The save data manager is meant to be called once for each feature of your mod. In other words,
13724
- * you should not put all of the data for your mod on the same object. Instead, scope your
13725
- * variables locally to a single file that contains a mod feature, and then call this function to
13726
- * register them. For example:
13727
- *
13728
- * ```ts
13729
- * // In file: feature1.ts
13730
- * import { saveDataManager } from "isaacscript-common";
13731
- *
13732
- * // Declare local variables for this file or feature.
13733
- * const v = {
13734
- * // These variables are never reset; manage them yourself at will.
13735
- * persistent: {
13736
- * foo1: 0,
13737
- * },
13738
- *
13739
- * // These variables are reset at the beginning of every run.
13740
- * run: {
13741
- * foo2: 0,
13742
- * },
13743
- *
13744
- * // These variables are reset at the beginning of every level.
13745
- * level: {
13746
- * foo3: 0,
13747
- * },
13748
- *
13749
- * // These variables are reset at the beginning of every room.
13750
- * room: {
13751
- * foo4: 0,
13752
- * },
13753
- * };
13754
- * // Every child object is optional; only create the ones that you need.
13755
- *
13756
- * // Register the variables with the save data manager. (We need to provide a string key that
13757
- * // matches the name of this file.)
13758
- * function feature1Init() {
13759
- * saveDataManager("feature1", v);
13760
- * }
13761
- *
13762
- * // Elsewhere in the file, use your variables.
13763
- * function feature1Function() {
13764
- * if (v.run.foo1 > 0) {
13765
- * // Insert code here.
13766
- * }
13767
- * }
13768
- * ```
13769
- *
13770
- * - Save data is loaded from disk in the `POST_PLAYER_INIT` callback (i.e. the first callback
13771
- * that can possibly run).
13772
- * - Save data is recorded to disk in the `PRE_GAME_EXIT` callback.
13773
- *
13774
- * You can use many different variable types on your variable object, but not everything is
13775
- * supported. For the specific things that are supported, see the documentation for the `deepCopy`
13776
- * helper function.
13777
- *
13778
- * If you want the save data manager to load data before the `POST_PLAYER_INIT` callback (i.e. in
13779
- * the main menu), then you should explicitly call the `saveDataManagerLoad` function. (The save
13780
- * data manager cannot do this on its own because it cannot know when your mod features are
13781
- * finished initializing.)
13782
- *
13783
- * Some features may have variables that need to be automatically reset per run/level, but not
13784
- * saved to disk on game exit. (For example, if they contain functions or other non-serializable
13785
- * data.) For these cases, set the second argument to `false`.
13786
- *
13787
- * Note that when the player uses Glowing Hourglass, the save data manager will automatically
13788
- * restore any variables on a "run" or "level" object with a backup that was created when the room
13789
- * was entered. Thus, you should not have to explicitly program support for Glowing Hourglass into
13790
- * your mod features that use the save data manager. If this is undesired for your specific
13791
- * use-case, then add a key of `__ignoreGlowingHourGlass: true` to your "run" or "level" object.
13792
- *
13793
- * @param key The name of the file or feature that is submitting data to be managed by the save
13794
- * data manager. The save data manager will throw an error if the key is already
13795
- * registered. Note that you can also pass a TSTL class instead of a string and the
13796
- * save data manager will use the name of the class as the key.
13797
- * @param v An object that corresponds to the `SaveData` interface. The object is conventionally
13798
- * called "v" for brevity. ("v" is short for "local variables").
13799
- * @param conditionalFunc Optional. A function to run to check if this save data should be written
13800
- * to disk. Default is `() => true`, meaning that this save data will
13801
- * always be written to disk. Use a conditional function for the situations
13802
- * when the local variables are for a feature that the end-user can
13803
- * disable. (If the feature is disabled, then there would be no point in
13804
- * writing any of the variables to the "save#.dat" file.) You can also
13805
- * specify `false` to this argument in order to completely disable saving
13806
- * data. (Specifying `false` will allow you to use non-serializable objects
13807
- * in your save data, such as `EntityPtr`.
13808
- */
13809
- saveDataManager<Persistent, Run, Level>(key: string | object, v: SaveData<Persistent, Run, Level>, conditionalFunc?: () => boolean): void;
13810
- saveDataManager(key: string | object, v: SaveData, conditionalFunc: false): void;
13811
- /**
13812
- * Recursively traverses an object, collecting all of the class constructors that it encounters.
13813
- */
13814
- private storeClassConstructorsFromObject;
13815
- /**
13816
- * The save data manager will automatically load variables from disk at the appropriate times
13817
- * (i.e. when a new run is started). Use this function to explicitly force the save data manager
13818
- * to load all of its variables from disk immediately.
13819
- *
13820
- * Obviously, doing this will overwrite the current data, so using this function can potentially
13821
- * result in lost state.
13822
- *
13823
- * In order to use this function, you must upgrade your mod with `ISCFeature.SAVE_DATA_MANAGER`.
13824
- */
13825
- saveDataManagerLoad(): void;
13826
- /**
13827
- * The save data manager will automatically save variables to disk at the appropriate times (i.e.
13828
- * when the run is exited). Use this function to explicitly force the save data manager to write
13829
- * all of its variables to disk immediately.
13830
- *
13831
- * In order to use this function, you must upgrade your mod with `ISCFeature.SAVE_DATA_MANAGER`.
13832
- */
13833
- saveDataManagerSave(): void;
13834
- /**
13835
- * Sets the global variable of "g" equal to all of the save data variables for this mod.
13836
- *
13837
- * This can make debugging easier, as you can access the variables from the game's debug console.
13838
- * e.g. `l print(g.feature1.run.foo)`
13839
- *
13840
- * In order to use this function, you must upgrade your mod with `ISCFeature.SAVE_DATA_MANAGER`.
13841
- */
13842
- saveDataManagerSetGlobal(): void;
13843
- /**
13844
- * By default, the save data manager will not be able to serialize/deserialize classes that are
13845
- * nested inside of maps, sets, and arrays, because it does not have access to the corresponding
13846
- * class constructor. If you want to use nested classes in this way, then use this function to
13847
- * register the class constructor with the save data manager. Once registered, the save data
13848
- * manager will automatically run the constructor when deserializing (in addition to copying over
13849
- * the data fields).
13850
- *
13851
- * This function is variadic, which means you can pass as many classes as you want to register.
13852
- *
13853
- * In order to use this function, you must upgrade your mod with `ISCFeature.SAVE_DATA_MANAGER`.
13854
- */
13855
- saveDataManagerRegisterClass(...tstlClasses: AnyClass[]): void;
13856
- /**
13857
- * Removes a previously registered key from the save data manager. This is the opposite of the
13858
- * "saveDataManager" method.
13859
- *
13860
- * In order to use this function, you must upgrade your mod with `ISCFeature.SAVE_DATA_MANAGER`.
13861
- */
13862
- saveDataManagerRemove(key: string): void;
13863
- /**
13864
- * The save data manager will automatically reset variables at the appropriate times, like when a
13865
- * player enters a new room. Use this function to explicitly force the save data manager to reset
13866
- * a specific variable group.
13867
- *
13868
- * For example:
13869
- *
13870
- * ```ts
13871
- * const v = {
13872
- * room: {
13873
- * foo: 123,
13874
- * },
13875
- * };
13876
- *
13877
- * mod.saveDataManager("file1", v);
13878
- *
13879
- * // Then, later on, to explicit reset all of the "room" variables:
13880
- * mod.saveDataManagerReset("file1", "room");
13881
- * ```
13882
- *
13883
- * In order to use this function, you must upgrade your mod with `ISCFeature.SAVE_DATA_MANAGER`.
13884
- */
13885
- saveDataManagerReset(key: string, childObjectKey: SaveDataKey): void;
13886
- /**
13887
- * Helper function to check to see if the game is in the menu, as far as the save data manager is
13888
- * concerned. This function will return true when the game is first opened until the
13889
- * `POST_PLAYER_INIT` callback fires. It will also return true in between the `PRE_GAME_EXIT`
13890
- * callback firing and the `POST_PLAYER_INIT` callback firing.
13891
- *
13892
- * This function is useful because the `POST_ENTITY_REMOVE` callback fires after the
13893
- * `PRE_GAME_EXIT` callback. Thus, if save data needs to be updated from the `POST_ENTITY_REMOVE`
13894
- * callback and the player is in the process of saving and quitting, the feature will have to
13895
- * explicitly call the `saveDataManagerSave` function.
13896
- *
13897
- * In order to use this function, you must upgrade your mod with `ISCFeature.SAVE_DATA_MANAGER`.
13898
- */
13899
- saveDataManagerInMenu(): boolean;
13900
- }
13901
-
13902
10671
  export declare const SECOND_IN_MILLISECONDS = 1000;
13903
10672
 
13904
10673
  /**
@@ -14364,41 +11133,6 @@ export declare const sfxManager: SFXManager;
14364
11133
 
14365
11134
  export declare const SHOOTING_ACTIONS_SET: ReadonlySet<ButtonAction>;
14366
11135
 
14367
- declare function shouldFireCollectibleType(fireArgs: [player: EntityPlayer, collectibleType: CollectibleType], optionalArgs: [collectibleType?: CollectibleType]): boolean;
14368
-
14369
- declare function shouldFireGridEntity(fireArgs: [gridEntity: GridEntity] | [gridEntity: GridEntity, oldState: int, newState: int], optionalArgs: [gridEntityType?: GridEntityType, variant?: int]): boolean;
14370
-
14371
- declare function shouldFireGridEntityCustom(fireArgs: [gridEntity: GridEntity, gridEntityTypeCustom: GridEntityType] | [
14372
- gridEntity: GridEntity,
14373
- gridEntityTypeCustom: GridEntityType,
14374
- oldState: int,
14375
- newState: int
14376
- ], optionalArgs: [gridEntityTypeCustom?: GridEntityType]): boolean;
14377
-
14378
- declare function shouldFireItemPickup(fireArgs: [player: EntityPlayer, pickingUpItem: PickingUpItem], optionalArgs: [itemType?: ItemType, subType?: int]): boolean;
14379
-
14380
- declare function shouldFirePlayer(fireArgs: [player: EntityPlayer] | [player: EntityPlayer, numSacrifices: int] | [player: EntityPlayer, collectible: EntityPickupCollectible] | [player: EntityPlayer, oldCharacter: PlayerType, newCharacter: PlayerType] | [
14381
- player: EntityPlayer,
14382
- healthType: HealthType,
14383
- difference: int,
14384
- oldValue: int,
14385
- newValue: int
14386
- ] | [
14387
- player: EntityPlayer,
14388
- amount: float,
14389
- damageFlags: BitFlags<DamageFlag>,
14390
- source: EntityRef,
14391
- countdownFrames: int
14392
- ] | [
14393
- player: EntityPlayer,
14394
- statType: StatType,
14395
- difference: int,
14396
- oldValue: PossibleStatType,
14397
- newValue: PossibleStatType
14398
- ], optionalArgs: [playerVariant?: PlayerVariant, character?: PlayerType]): boolean;
14399
-
14400
- declare function shouldFireSlot(fireArgs: [slot: EntitySlot] | [slot: EntitySlot, player: EntityPlayer] | [slot: EntitySlot, slotDestructionType: SlotDestructionType] | [slot: EntitySlot, previousAnimation: string, currentAnimation: string], optionalArgs: [slotVariant?: SlotVariant, subType?: int]): boolean;
14401
-
14402
11136
  /**
14403
11137
  * Shallow copies and shuffles the array using the Fisher-Yates algorithm. Returns the copied array.
14404
11138
  *
@@ -14424,28 +11158,6 @@ export declare function shuffleArrayInPlace<T>(array: T[], seedOrRNG?: Seed | RN
14424
11158
  /** @returns 1 if n is positive, -1 if n is negative, or 0 if n is 0. */
14425
11159
  export declare function sign(n: number): int;
14426
11160
 
14427
- declare class SlotDestroyedDetection extends Feature {
14428
- v: {
14429
- room: {
14430
- destroyedSlotSet: Set<PtrHash>;
14431
- };
14432
- };
14433
- private postSlotDestroyed;
14434
- private roomHistory;
14435
- constructor(postSlotDestroyed: PostSlotDestroyed, roomHistory: RoomHistory);
14436
- private postEntityRemoveSlot;
14437
- private postEntityRemoveSlotMachine;
14438
- private postEntityRemoveBeggar;
14439
- private postSlotUpdate;
14440
- /**
14441
- * Slots normally have an entity collision class of `EntityCollisionClass.ALL` (4) and a grid
14442
- * collision class of `EntityGridCollisionClass.NONE` (0). When they are destroyed with a bomb,
14443
- * the entity collision class stays the same, but the grid collision class switches to
14444
- * `EntityGridCollisionClass.GROUND` (5).
14445
- */
14446
- private checkDestroyedFromCollisionClass;
14447
- }
14448
-
14449
11161
  /** This is used in the `POST_SLOT_DESTROYED` custom callback. */
14450
11162
  export declare enum SlotDestructionType {
14451
11163
  /**
@@ -14465,34 +11177,6 @@ export declare enum SlotDestructionType {
14465
11177
  COLLECTIBLE_PAYOUT = 1
14466
11178
  }
14467
11179
 
14468
- declare class SlotRenderDetection extends Feature {
14469
- v: {
14470
- room: {
14471
- slotAnimations: DefaultMap<PtrHash, string, [slot: Entity]>;
14472
- brokenSlots: Set<PtrHash>;
14473
- };
14474
- };
14475
- private postSlotRender;
14476
- private postSlotAnimationChanged;
14477
- constructor(postSlotRender: PostSlotRender, postSlotAnimationChanged: PostSlotAnimationChanged);
14478
- private postRender;
14479
- private checkSlotAnimationChanged;
14480
- }
14481
-
14482
- declare class SlotUpdateDetection extends Feature {
14483
- v: {
14484
- room: {
14485
- initializedSlots: Set<PtrHash>;
14486
- };
14487
- };
14488
- private postSlotInit;
14489
- private postSlotUpdate;
14490
- constructor(postSlotInit: PostSlotInit, postSlotUpdate: PostSlotUpdate);
14491
- private postUpdate;
14492
- private postNewRoomReordered;
14493
- private checkNewEntity;
14494
- }
14495
-
14496
11180
  /**
14497
11181
  * Helper function to smelt a trinket. Before smelting, this function will automatically remove the
14498
11182
  * trinkets that the player is holding, if any, and then give them back after the new trinket is
@@ -14527,6 +11211,45 @@ export declare function smeltTrinkets(player: EntityPlayer, ...trinketTypes: Tri
14527
11211
  */
14528
11212
  export declare function some<T>(array: T[], func: (value: T, index: number, array: T[]) => boolean): boolean;
14529
11213
 
11214
+ /**
11215
+ * Helper function to sort an array of objects by one of the object keys.
11216
+ *
11217
+ * For example:
11218
+ *
11219
+ * ```ts
11220
+ * const myArray = [
11221
+ * {
11222
+ * name: "alice",
11223
+ * age: 30,
11224
+ * },
11225
+ * {
11226
+ * name: "bob",
11227
+ * age: 20,
11228
+ * },
11229
+ * ];
11230
+ * myArray.sort(sortObjectArrayByKey("age"));
11231
+ * ```
11232
+ */
11233
+ export declare function sortObjectArrayByKey(key: string): (a: unknown, b: unknown) => -1 | 0 | 1;
11234
+
11235
+ /**
11236
+ * Helper function to sort a two-dimensional array by the first element.
11237
+ *
11238
+ * For example:
11239
+ *
11240
+ * ```ts
11241
+ * const myArray = [[1, 2], [2, 3], [3, 4]];
11242
+ * myArray.sort(twoDimensionalSort);
11243
+ * ```
11244
+ *
11245
+ * This function also properly handles when the array elements are strings or numbers (instead of
11246
+ * another array).
11247
+ *
11248
+ * From:
11249
+ * https://stackoverflow.com/questions/16096872/how-to-sort-2-dimensional-array-by-column-value
11250
+ */
11251
+ export declare function sortTwoDimensionalArray<T>(a: T[], b: T[]): -1 | 0 | 1;
11252
+
14530
11253
  export declare type SoulHeartType = HeartSubType.SOUL | HeartSubType.BLACK | HeartSubType.BONE;
14531
11254
 
14532
11255
  /**
@@ -14612,54 +11335,6 @@ export declare function spawnCoin(coinSubType: CoinSubType, positionOrGridIndex:
14612
11335
  */
14613
11336
  export declare function spawnCoinWithSeed(coinSubType: CoinSubType, positionOrGridIndex: Vector | int, seedOrRNG: Seed | RNG, velocity?: Vector, spawner?: Entity | undefined): EntityPickupCoin;
14614
11337
 
14615
- declare class SpawnCollectible extends Feature {
14616
- private preventCollectibleRotation;
14617
- /**
14618
- * Helper function to spawn a collectible.
14619
- *
14620
- * Use this instead of the `Game.Spawn` method because it handles the cases of Tainted Keeper
14621
- * collectibles costing coins and preventing quest items from being rotated by Tainted Isaac's
14622
- * rotation mechanic.
14623
- *
14624
- * If you do not need to handle quest items being rotated (i.e. the collectible is guaranteed not
14625
- * to be a quest item), then you can use the `spawnCollectibleUnsafe` helper function instead
14626
- * (which does not require an upgraded mod).
14627
- *
14628
- * In order to use this function, you must upgrade your mod with `ISCFeature.SPAWN_COLLECTIBLE`.
14629
- *
14630
- * @param collectibleType The collectible type to spawn.
14631
- * @param positionOrGridIndex The position or grid index to spawn the collectible at.
14632
- * @param seedOrRNG Optional. The `Seed` or `RNG` object to use. If an `RNG` object is provided,
14633
- * the `RNG.Next` method will be called. Default is `getRandomSeed()`.
14634
- * @param options Optional. Set to true to make the collectible a "There's Options" style
14635
- * collectible. Default is false.
14636
- * @param forceFreeItem Optional. Set to true to disable the logic that gives the item a price for
14637
- * Tainted Keeper. Default is false.
14638
- * @param spawner Optional.
14639
- */
14640
- spawnCollectible(collectibleType: CollectibleType, positionOrGridIndex: Vector | int, seedOrRNG?: Seed | RNG, options?: boolean, forceFreeItem?: boolean, spawner?: Entity): EntityPickupCollectible;
14641
- /**
14642
- * Helper function to spawn a collectible from a specific item pool.
14643
- *
14644
- * Use this instead of the `Game.Spawn` method because it handles the cases of Tainted Keeper
14645
- * collectibles costing coins and preventing quest items from being rotated by Tainted Isaac's
14646
- * rotation mechanic.
14647
- *
14648
- * In order to use this function, you must upgrade your mod with `ISCFeature.SPAWN_COLLECTIBLE`.
14649
- *
14650
- * @param itemPoolType The item pool to draw the collectible type from.
14651
- * @param positionOrGridIndex The position or grid index to spawn the collectible at.
14652
- * @param seedOrRNG Optional. The `Seed` or `RNG` object to use. If an `RNG` object is provided,
14653
- * the `RNG.Next` method will be called. Default is `getRandomSeed()`.
14654
- * @param options Optional. Set to true to make the collectible a "There's Options" style
14655
- * collectible. Default is false.
14656
- * @param forceFreeItem Optional. Set to true to disable the logic that gives the item a price for
14657
- * Tainted Keeper. Default is false.
14658
- * @param spawner Optional.
14659
- */
14660
- spawnCollectibleFromPool(itemPoolType: ItemPoolType, positionOrGridIndex: Vector | int, seedOrRNG?: Seed | RNG, options?: boolean, forceFreeItem?: boolean, spawner?: Entity): EntityPickupCollectible;
14661
- }
14662
-
14663
11338
  /**
14664
11339
  * Helper function to spawn a collectible.
14665
11340
  *
@@ -14851,103 +11526,6 @@ export declare function spawnProjectileWithSeed(projectileVariant: ProjectileVar
14851
11526
  /** Helper function to spawn a `GridEntityType.ROCK` (2). */
14852
11527
  export declare function spawnRock(gridIndexOrPosition: int | Vector): GridEntityRock | undefined;
14853
11528
 
14854
- declare class SpawnRockAltRewards extends Feature {
14855
- private itemPoolDetection;
14856
- /**
14857
- * Helper function for emulating what happens when a vanilla `GridEntityType.ROCK_ALT` grid entity
14858
- * breaks.
14859
- *
14860
- * Most of the time, this function will do nothing, similar to how most of the time, when an
14861
- * individual urn is destroyed, nothing will spawn.
14862
- *
14863
- * Note that in vanilla, trinkets will not spawn if they have already been removed from the
14864
- * trinket pool. This function cannot replicate that behavior because there is no way to check to
14865
- * see if a trinket is still in the pool. Thus, it will always have a chance to spawn the
14866
- * respective trinket
14867
- * (e.g. Swallowed Penny from urns).
14868
- *
14869
- * When filled buckets are destroyed, 6 projectiles will always spawn in a random pattern (in
14870
- * addition to any other rewards that are spawned). This function does not account for this, so if
14871
- * you want to specifically emulate destroying a filled bucket, you have to account for the
14872
- * projectiles yourself.
14873
- *
14874
- * The logic in this function is based on the rewards listed on the wiki:
14875
- * https://bindingofisaacrebirth.fandom.com/wiki/Rocks
14876
- *
14877
- * In order to use this function, you must upgrade your mod with
14878
- * `ISCFeature.SPAWN_ALT_ROCK_REWARDS`.
14879
- *
14880
- * @param positionOrGridIndex The position or grid index to spawn the reward.
14881
- * @param rockAltType The type of reward to spawn. For example, `RockAltType.URN` will have a
14882
- * chance at spawning coins and spiders.
14883
- * @param seedOrRNG Optional. The `Seed` or `RNG` object to use. If an `RNG` object is provided,
14884
- * the `RNG.Next` method will be called. Default is `getRandomSeed()`. Normally,
14885
- * you should pass the `InitSeed` of the grid entity that was broken.
14886
- * @returns Whether or not this function spawned something.
14887
- */
14888
- spawnRockAltReward(positionOrGridIndex: Vector | int, rockAltType: RockAltType, seedOrRNG?: Seed | RNG): boolean;
14889
- /**
14890
- * Helper function for emulating what happens when a vanilla `GridEntityType.ROCK_ALT` grid entity
14891
- * breaks of `RockAltType.URN`.
14892
- *
14893
- * For more information, see the documentation for the `spawnRockAltReward` function.
14894
- *
14895
- * In order to use this function, you must upgrade your mod with
14896
- * `ISCFeature.SPAWN_ALT_ROCK_REWARDS`.
14897
- */
14898
- spawnRockAltRewardUrn(position: Vector, rng: RNG): boolean;
14899
- /**
14900
- * Helper function for emulating what happens when a vanilla `GridEntityType.ROCK_ALT` grid entity
14901
- * breaks of `RockAltType.MUSHROOM`.
14902
- *
14903
- * For more information, see the documentation for the `spawnRockAltReward` function.
14904
- *
14905
- * In order to use this function, you must upgrade your mod with
14906
- * `ISCFeature.SPAWN_ALT_ROCK_REWARDS`.
14907
- */
14908
- spawnRockAltRewardMushroom(position: Vector, rng: RNG): boolean;
14909
- /**
14910
- * Helper function for emulating what happens when a vanilla `GridEntityType.ROCK_ALT` grid entity
14911
- * breaks of `RockAltType.SKULL`.
14912
- *
14913
- * For more information, see the documentation for the `spawnRockAltReward` function.
14914
- *
14915
- * In order to use this function, you must upgrade your mod with
14916
- * `ISCFeature.SPAWN_ALT_ROCK_REWARDS`.
14917
- */
14918
- spawnRockAltRewardSkull(position: Vector, rng: RNG): boolean;
14919
- /**
14920
- * Helper function for emulating what happens when a vanilla `GridEntityType.ROCK_ALT` grid entity
14921
- * breaks of `RockAltType.POLYP`.
14922
- *
14923
- * For more information, see the documentation for the `spawnRockAltReward` function.
14924
- *
14925
- * In order to use this function, you must upgrade your mod with
14926
- * `ISCFeature.SPAWN_ALT_ROCK_REWARDS`.
14927
- */
14928
- spawnRockAltRewardPolyp(position: Vector, rng: RNG): boolean;
14929
- /**
14930
- * Helper function for emulating what happens when a vanilla `GridEntityType.ROCK_ALT` grid entity
14931
- * breaks of `RockAltType.BUCKET_DOWNPOUR`.
14932
- *
14933
- * For more information, see the documentation for the `spawnRockAltReward` function.
14934
- *
14935
- * In order to use this function, you must upgrade your mod with
14936
- * `ISCFeature.SPAWN_ALT_ROCK_REWARDS`.
14937
- */
14938
- spawnRockAltRewardBucketDownpour(position: Vector, rng: RNG): boolean;
14939
- /**
14940
- * Helper function for emulating what happens when a vanilla `GridEntityType.ROCK_ALT` grid entity
14941
- * breaks of `RockAltType.BUCKET_DROSS`.
14942
- *
14943
- * For more information, see the documentation for the `spawnRockAltReward` function.
14944
- *
14945
- * In order to use this function, you must upgrade your mod with
14946
- * `ISCFeature.SPAWN_ALT_ROCK_REWARDS`.
14947
- */
14948
- spawnRockAltRewardBucketDross(position: Vector, rng: RNG): boolean;
14949
- }
14950
-
14951
11529
  /** Helper function to spawn a `GridEntityType.ROCK` (2) with a specific variant. */
14952
11530
  export declare function spawnRockWithVariant(rockVariant: RockVariant, gridIndexOrPosition: int | Vector): GridEntityRock | undefined;
14953
11531
 
@@ -15028,55 +11606,6 @@ export declare function spawnWithSeed(entityType: EntityType, variant: int, subT
15028
11606
  */
15029
11607
  export declare function spriteEquals(sprite1: Sprite, sprite2: Sprite, layerID: int, xStart: int, xFinish: int, xIncrement: int, yStart: int, yFinish: int, yIncrement: int): boolean;
15030
11608
 
15031
- declare class StageHistory extends Feature {
15032
- private postNewLevelReordered;
15033
- /**
15034
- * Helper function to get the stage type that a trapdoor or heaven door would take the player to,
15035
- * based on the current stage, room, and game state flags.
15036
- *
15037
- * This function accounts for the previous floors that a player has visited thus far on the run so
15038
- * that the next stage type can be properly calculated on The Ascent (which makes it unlike the
15039
- * `getNextStageType` function).
15040
- *
15041
- * In order to use this function, you must upgrade your mod with `ISCFeature.STAGE_HISTORY`.
15042
- *
15043
- * @param upwards Whether or not the player should go up to Cathedral in the case of being on Womb
15044
- * 2. Default is false.
15045
- */
15046
- getNextStageTypeWithHistory(upwards?: boolean): StageType;
15047
- /**
15048
- * Helper function to get the stage that a trapdoor or heaven door would take the player to, based
15049
- * on the current stage, room, and game state flags.
15050
- *
15051
- * This function accounts for the previous floors that a player has visited thus far on the run so
15052
- * that the next stage can be properly calculated on The Ascent (which makes it unlike the
15053
- * `getNextStage` function).
15054
- *
15055
- * In order to use this function, you must upgrade your mod with `ISCFeature.STAGE_HISTORY`.
15056
- */
15057
- getNextStageWithHistory(): LevelStage;
15058
- /**
15059
- * Helper function to get all of the stages that a player has visited thus far on this run.
15060
- *
15061
- * In order to use this function, you must upgrade your mod with `ISCFeature.STAGE_HISTORY`.
15062
- */
15063
- getStageHistory(): ReadonlyArray<[
15064
- stage: LevelStage,
15065
- stageType: StageType
15066
- ]>;
15067
- /**
15068
- * Helper function to check if a player has previous visited a particular stage (or stage + stage
15069
- * type combination) on this run.
15070
- *
15071
- * In order to use this function, you must upgrade your mod with `ISCFeature.STAGE_HISTORY`.
15072
- *
15073
- * @param stage The stage to check for.
15074
- * @param stageType Optional. If provided, will check for a specific stage and stage type
15075
- * combination.
15076
- */
15077
- hasVisitedStage(stage: LevelStage, stageType?: StageType): boolean;
15078
- }
15079
-
15080
11609
  /**
15081
11610
  * Helper function to convert a numerical `StageType` into the letter suffix supplied to the "stage"
15082
11611
  * console command. For example, `StageType.REPENTANCE` is the stage type for Downpour, and the
@@ -15085,19 +11614,6 @@ declare class StageHistory extends Feature {
15085
11614
  */
15086
11615
  export declare function stageTypeToLetter(stageType: StageType): string;
15087
11616
 
15088
- declare class StartAmbush extends Feature {
15089
- private runInNFrames;
15090
- /**
15091
- * Helper function to start a Challenge Room or the Boss Rush.
15092
- *
15093
- * Specifically, this is performed by spawning a sack on top of the player, waiting a game frame,
15094
- * and then removing the sack and the pickups that the sack dropped.
15095
- *
15096
- * In order to use this function, you must upgrade your mod with `ISCFeature.START_AMBUSH`.
15097
- */
15098
- startAmbush(): void;
15099
- }
15100
-
15101
11617
  /** Helper type to ensure that the given string starts with an lowercase letter. */
15102
11618
  export declare type StartsWithLowercase<S> = S extends string ? Extract<S, Uncapitalize<S>> : never;
15103
11619
 
@@ -15177,16 +11693,6 @@ export declare function sumSet(set: Set<number> | ReadonlySet<number>): number;
15177
11693
  */
15178
11694
  export declare function swapArrayElements<T>(array: T[], i: number, j: number): void;
15179
11695
 
15180
- declare type T = ModCallbackCustom.POST_CUSTOM_REVIVE;
15181
-
15182
- declare type T_2 = ModCallbackCustom.POST_GRID_ENTITY_COLLISION;
15183
-
15184
- declare type T_3 = ModCallbackCustom.POST_GRID_ENTITY_CUSTOM_COLLISION;
15185
-
15186
- declare type T_4 = ModCallbackCustom.POST_GRID_ENTITY_REMOVE;
15187
-
15188
- declare type T_5 = ModCallbackCustom.POST_GRID_ENTITY_CUSTOM_REMOVE;
15189
-
15190
11696
  /**
15191
11697
  * Helper function to check if a Lua table has all of the provided keys.
15192
11698
  *
@@ -15198,40 +11704,6 @@ export declare function tableHasKeys(luaMap: LuaMap<AnyNotNil, unknown>, ...keys
15198
11704
  /** After taking damage, `EntityPlayer.SamsonBerserkCharge` is incremented by this amount. */
15199
11705
  export declare const TAINTED_SAMSON_BERSERK_CHARGE_FROM_TAKING_DAMAGE = 10000;
15200
11706
 
15201
- /**
15202
- * This feature provides a way for end-users to get the `EntityPlayer` object for the other Tainted
15203
- * Lazarus.
15204
- */
15205
- declare class TaintedLazarusPlayers extends Feature {
15206
- vConditionalFunc: () => boolean;
15207
- private postPlayerInit;
15208
- /**
15209
- * Indexes are the `PtrHash`, values are the `EntityPtr` of the *other* Lazarus.
15210
- *
15211
- * When starting a run, the `POST_PLAYER_INIT` callback will fire first for Dead Tainted Lazarus,
15212
- * then for Tainted Lazarus. When continuing a run, the `POST_PLAYER_INIT` callback will fire
15213
- * first for the character that is currently active. Thus, since the order of the characters is
15214
- * not certain, we insert each of their pointers into a queue, and then only populate the map when
15215
- * we have one Tainted Lazarus and one Dead Tainted Lazarus.
15216
- */
15217
- private checkDequeue;
15218
- /**
15219
- * Helper function to get the other version of Tainted Lazarus.
15220
- *
15221
- * - On Tainted Lazarus, returns the player object for Dead Tainted Lazarus.
15222
- * - On Dead Tainted Lazarus, returns the player object for Tainted Lazarus.
15223
- * - Returns undefined if player object retrieval failed for any reason.
15224
- *
15225
- * If you call the `EntityPlayer.Exists` method on the returned object, it will return false.
15226
- * However, you can still call the other methods like you normally would (e.g.
15227
- * `EntityPlayer.AddCollectible`).
15228
- *
15229
- * In order to use this function, you must upgrade your mod with
15230
- * `ISCFeature.CHARACTER_HEALTH_CONVERSION`.
15231
- */
15232
- getTaintedLazarusSubPlayer(player: EntityPlayer): EntityPlayer | undefined;
15233
- }
15234
-
15235
11707
  export declare function tanh(x: number): number;
15236
11708
 
15237
11709
  /**
@@ -15353,21 +11825,6 @@ infer F,
15353
11825
  /** Helper type to convert a tuple to a union. */
15354
11826
  export declare type TupleToUnion<T extends unknown[]> = T[number];
15355
11827
 
15356
- /**
15357
- * Helper function to sort a two-dimensional array by the first element.
15358
- *
15359
- * For example:
15360
- *
15361
- * ```ts
15362
- * const myArray = [[1, 2], [2, 3], [3, 4]];
15363
- * myArray.sort(twoDimensionalSort);
15364
- * ```
15365
- *
15366
- * From:
15367
- * https://stackoverflow.com/questions/16096872/how-to-sort-2-dimensional-array-by-column-value
15368
- */
15369
- export declare function twoDimensionalSort<T>(array1: T[], array2: T[]): -1 | 0 | 1;
15370
-
15371
11828
  /**
15372
11829
  * This is the number of draw coordinates that each heart spans on the UI in the upper left hand
15373
11830
  * corner.
@@ -15377,43 +11834,6 @@ export declare const UI_HEART_WIDTH = 12;
15377
11834
  /** Helper type to convert a union to an intersection. */
15378
11835
  export declare type UnionToIntersection<U> = (U extends U ? (u: U) => 0 : never) extends (i: infer I) => 0 ? Extract<I, U> : never;
15379
11836
 
15380
- /**
15381
- * Use this function to enable the custom callbacks and other optional features provided by
15382
- * `isaacscript-common`.
15383
- *
15384
- * For example:
15385
- *
15386
- * ```ts
15387
- * const modVanilla = RegisterMod("My Mod", 1);
15388
- * const mod = upgradeMod(modVanilla);
15389
- *
15390
- * // Subscribe to vanilla callbacks.
15391
- * mod.AddCallback(ModCallback.POST_UPDATE, postUpdate);
15392
- *
15393
- * // Subscribe to custom callbacks.
15394
- * mod.AddCallbackCustom(ModCallbackCustom.POST_ITEM_PICKUP, postItemPickup);
15395
- * ```
15396
- *
15397
- * @param modVanilla The mod object returned by the `RegisterMod` function.
15398
- * @param features Optional. An array containing the optional standard library features that you
15399
- * want to enable, if any. Default is an empty array.
15400
- * @param customCallbacksUsed Optional. An array containing the custom callbacks that you will be
15401
- * subscribing to after you upgrade your mod. Specifying this will
15402
- * immediately initialize the callbacks (as opposed to lazy-initializing
15403
- * them when you first subscribe to the callback). This is only necessary
15404
- * if you the order of callback firing is important for your mod. (For
15405
- * example, you may want the `POST_NEW_ROOM` part of the
15406
- * `POST_GRID_ENTITY_INIT` callback to fire before your own
15407
- * `POST_NEW_ROOM` callbacks.)
15408
- * @param debug Optional. Whether to log additional output when a callback is fired. Default is
15409
- * false.
15410
- * @param timeThreshold Optional. If provided, will only log callbacks that take longer than the
15411
- * specified number of seconds (if the "--luadebug" launch flag is turned on)
15412
- * or milliseconds (if the "--luadebug" launch flag is turned off).
15413
- * @returns The upgraded mod object.
15414
- */
15415
- export declare function upgradeMod<T extends readonly ISCFeature[] = never[]>(modVanilla: Mod, features?: ISCFeatureTuple<T>, customCallbacksUsed?: ModCallbackCustom[] | readonly ModCallbackCustom[], debug?: boolean, timeThreshold?: float): ModUpgraded<T>;
15416
-
15417
11837
  /** Helper type to match all of the uppercase keys of an object. */
15418
11838
  export declare type UppercaseKeys<T> = StartsWithUppercase<keyof T>;
15419
11839