isaacscript-common 21.5.0 → 21.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{index.d.ts → index.rollup.d.ts} +3683 -94
- package/dist/isaacscript-common.lua +2 -16
- package/dist/src/core/upgradeMod.d.ts +34 -0
- package/dist/src/core/upgradeMod.d.ts.map +1 -1
- package/dist/src/core/upgradeMod.lua +2 -43
- package/package.json +2 -2
- package/src/core/upgradeMod.ts +1 -49
|
@@ -1144,6 +1144,22 @@ 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
|
+
|
|
1147
1163
|
/**
|
|
1148
1164
|
* Helper function to determine if the specified character starts with an active item.
|
|
1149
1165
|
*
|
|
@@ -1152,6 +1168,32 @@ export declare function characterGetsBlackHeartFromEternalHeart(character: Playe
|
|
|
1152
1168
|
*/
|
|
1153
1169
|
export declare function characterStartsWithActiveItem(character: PlayerType): boolean;
|
|
1154
1170
|
|
|
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
|
+
|
|
1155
1197
|
/**
|
|
1156
1198
|
* A collection of the four sprites necessary in order to render a charge bar.
|
|
1157
1199
|
*
|
|
@@ -1303,6 +1345,21 @@ export declare type CollectibleIndex = string & {
|
|
|
1303
1345
|
readonly __collectibleIndexBrand: symbol;
|
|
1304
1346
|
};
|
|
1305
1347
|
|
|
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
|
+
|
|
1306
1363
|
/** Helper function to check if two collectible sprites have the same sprite sheet loaded. */
|
|
1307
1364
|
export declare function collectibleSpriteEquals(sprite1: Sprite, sprite2: Sprite): boolean;
|
|
1308
1365
|
|
|
@@ -1480,6 +1537,356 @@ export declare function countEntities(entityType?: EntityType, variant?: number,
|
|
|
1480
1537
|
*/
|
|
1481
1538
|
export declare function countSetBits(n: int): int;
|
|
1482
1539
|
|
|
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(priority: CallbackPriority | int, 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
|
+
|
|
1483
1890
|
/**
|
|
1484
1891
|
* An object that represents a possible boss for a custom stage. This can be for a vanilla boss or a
|
|
1485
1892
|
* custom boss.
|
|
@@ -1564,6 +1971,56 @@ export declare interface CustomStageRoomMetadata {
|
|
|
1564
1971
|
weight: number;
|
|
1565
1972
|
}
|
|
1566
1973
|
|
|
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
|
+
|
|
1567
2024
|
/**
|
|
1568
2025
|
* A description of a custom stage shadow. (In this context, "shadows" are the outlines from things
|
|
1569
2026
|
* on the roof. For example, in Basement, a shadow of a sideways V is used, among others.)
|
|
@@ -2015,6 +2472,454 @@ export declare interface CustomStageTSConfig {
|
|
|
2015
2472
|
};
|
|
2016
2473
|
}
|
|
2017
2474
|
|
|
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
|
+
|
|
2018
2923
|
/**
|
|
2019
2924
|
* `deepCopy` is a semi-generic deep cloner. It will recursively copy all of the values so that none
|
|
2020
2925
|
* of the nested references remain.
|
|
@@ -2218,6 +3123,45 @@ export declare function defaultMapSetPlayer<V>(map: Map<PlayerIndex, V>, player:
|
|
|
2218
3123
|
*/
|
|
2219
3124
|
export declare function deleteSetsFromSet<T>(mainSet: Set<T>, ...setsToRemove: Array<Set<T> | ReadonlySet<T>>): void;
|
|
2220
3125
|
|
|
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
|
+
|
|
2221
3165
|
/**
|
|
2222
3166
|
* Helper function to remove a collectible or trinket that is currently queued to go into a player's
|
|
2223
3167
|
* inventory (i.e. the item is being held over their head).
|
|
@@ -2278,8 +3222,130 @@ export declare function directionToShootAction(direction: Direction): ButtonActi
|
|
|
2278
3222
|
|
|
2279
3223
|
export declare function directionToVector(direction: Direction): Readonly<Vector>;
|
|
2280
3224
|
|
|
2281
|
-
|
|
2282
|
-
|
|
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;
|
|
2283
3349
|
|
|
2284
3350
|
/**
|
|
2285
3351
|
* Helper function to check if one or more matching entities exist in the current room. It uses the
|
|
@@ -2625,6 +3691,21 @@ export declare function eRange(start: int, end?: int, increment?: number): int[]
|
|
|
2625
3691
|
|
|
2626
3692
|
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";
|
|
2627
3693
|
|
|
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
|
+
|
|
2628
3709
|
/**
|
|
2629
3710
|
* These are a collection of functions for non-TypeScript users so that they can access some of
|
|
2630
3711
|
* useful methods offered on the `Array` class in the JavaScript standard library.
|
|
@@ -2642,12 +3723,110 @@ declare type ErrorIsaacAPIClassIsNotSerializable = "Error: Isaac API classes (su
|
|
|
2642
3723
|
*/
|
|
2643
3724
|
export declare function every<T>(array: T[], func: (value: T, index: number, array: T[]) => boolean): boolean;
|
|
2644
3725
|
|
|
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
|
+
|
|
2645
3761
|
/**
|
|
2646
3762
|
* A function that creates the default value for your `DefaultMap`. For example, if it was a
|
|
2647
3763
|
* `DefaultMap` containing maps, the factory function would be: `() => new Map()`
|
|
2648
3764
|
*/
|
|
2649
3765
|
export declare type FactoryFunction<V, Args extends unknown[]> = (...args: Args) => V;
|
|
2650
3766
|
|
|
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
|
+
|
|
2651
3830
|
export declare function fillLevelWithRedRooms(): void;
|
|
2652
3831
|
|
|
2653
3832
|
/**
|
|
@@ -2680,6 +3859,8 @@ export declare function find<T>(array: T[], func: (value: T, index: number, arra
|
|
|
2680
3859
|
*/
|
|
2681
3860
|
export declare function findFreePosition(startingPosition: Vector, avoidActiveEntities?: boolean, minimumDistance?: float): Vector;
|
|
2682
3861
|
|
|
3862
|
+
declare type FireArgs<T extends ModCallbackCustom> = Parameters<AddCallbackParametersCustom[T][0]>;
|
|
3863
|
+
|
|
2683
3864
|
/**
|
|
2684
3865
|
* Helper function to make an NPC fire one or more projectiles. Returns the fired projectile(s).
|
|
2685
3866
|
*
|
|
@@ -2746,6 +3927,30 @@ export declare const FIRST_STAGE = LevelStage.BASEMENT_1;
|
|
|
2746
3927
|
/** Equal to `TrinketType.SWALLOWED_PENNY`. */
|
|
2747
3928
|
export declare const FIRST_TRINKET_TYPE = TrinketType.SWALLOWED_PENNY;
|
|
2748
3929
|
|
|
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
|
+
|
|
2749
3954
|
/**
|
|
2750
3955
|
* An object containing all 7 vanilla fonts that are pre-loaded and ready to use.
|
|
2751
3956
|
*
|
|
@@ -2769,6 +3974,17 @@ export declare const fonts: {
|
|
|
2769
3974
|
*/
|
|
2770
3975
|
export declare function forEach<T>(array: T[], func: (value: T, index: number, array: T[]) => void): void;
|
|
2771
3976
|
|
|
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
|
+
|
|
2772
3988
|
declare type FunctionIsNotSerializable = "Error: Functions are not serializable. For more information, see: https://isaacscript.github.io/main/gotchas#functions-are-not-serializable";
|
|
2773
3989
|
|
|
2774
3990
|
/** Helper type to represent a tuple containing the name of a function and the function itself. */
|
|
@@ -2790,6 +4006,77 @@ export declare const GAME_FRAMES_PER_MINUTE: number;
|
|
|
2790
4006
|
/** Game frames are what is returned by the `Game.GetFrameCount` method. */
|
|
2791
4007
|
export declare const GAME_FRAMES_PER_SECOND = 30;
|
|
2792
4008
|
|
|
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
|
+
|
|
2793
4080
|
/**
|
|
2794
4081
|
* Helper function to find the active slot that the player has the corresponding collectible type
|
|
2795
4082
|
* in. Returns undefined if the player does not have the collectible in any active slot.
|
|
@@ -5481,6 +6768,20 @@ export declare const GRID_INDEX_CENTER_OF_1X1_ROOM = 67;
|
|
|
5481
6768
|
*/
|
|
5482
6769
|
export declare function gridCoordinatesToWorldPosition(x: int, y: int): Vector;
|
|
5483
6770
|
|
|
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
|
+
|
|
5484
6785
|
/**
|
|
5485
6786
|
* This is meta-data that describes a custom grid entity.
|
|
5486
6787
|
*
|
|
@@ -5510,6 +6811,47 @@ export declare type GridEntityID = string & {
|
|
|
5510
6811
|
readonly __gridEntityIDBrand: symbol;
|
|
5511
6812
|
};
|
|
5512
6813
|
|
|
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
|
+
|
|
5513
6855
|
/**
|
|
5514
6856
|
* Helper function to convert a grid index to a grid position.
|
|
5515
6857
|
*
|
|
@@ -6076,6 +7418,79 @@ export declare enum ISCFeature {
|
|
|
6076
7418
|
TAINTED_LAZARUS_PLAYERS = 53
|
|
6077
7419
|
}
|
|
6078
7420
|
|
|
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
|
+
|
|
6079
7494
|
/**
|
|
6080
7495
|
* Helper function to check if a player is a specific character (i.e. `PlayerType`).
|
|
6081
7496
|
*
|
|
@@ -6813,6 +8228,61 @@ export declare function isVector(object: unknown): object is Vector;
|
|
|
6813
8228
|
*/
|
|
6814
8229
|
export declare const itemConfig: ItemConfig;
|
|
6815
8230
|
|
|
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
|
+
|
|
6816
8286
|
/**
|
|
6817
8287
|
* Helper function to iterate over a table deterministically. This is useful because by default, the
|
|
6818
8288
|
* `pairs` function will return the keys of a Lua table in a random order.
|
|
@@ -9338,120 +10808,906 @@ export declare enum ModCallbackCustom {
|
|
|
9338
10808
|
}
|
|
9339
10809
|
|
|
9340
10810
|
/**
|
|
9341
|
-
*
|
|
9342
|
-
*
|
|
9343
|
-
* that
|
|
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.
|
|
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).
|
|
9355
10814
|
*
|
|
9356
|
-
*
|
|
9357
|
-
*
|
|
9358
|
-
*
|
|
9359
|
-
*
|
|
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.)
|
|
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.
|
|
9363
10819
|
*/
|
|
9364
|
-
|
|
9365
|
-
private
|
|
10820
|
+
declare class ModdedElementDetection extends Feature {
|
|
10821
|
+
private atLeastOneCallbackFired;
|
|
10822
|
+
private postPlayerInit;
|
|
10823
|
+
private errorIfNoCallbacksFired;
|
|
9366
10824
|
/**
|
|
9367
|
-
*
|
|
9368
|
-
* method that is annotated with a `@Callback` or `@CallbackCustom` decorator will only be fired
|
|
9369
|
-
* if the executed conditional function returns true.
|
|
10825
|
+
* Returns the first modded collectible type, or undefined if there are no modded collectibles.
|
|
9370
10826
|
*
|
|
9371
|
-
* This
|
|
9372
|
-
*
|
|
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).
|
|
9373
10830
|
*
|
|
9374
|
-
*
|
|
9375
|
-
*
|
|
9376
|
-
|
|
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.
|
|
9377
10837
|
*
|
|
9378
|
-
*
|
|
9379
|
-
*
|
|
10838
|
+
* Equal to `itemConfig.GetCollectibles().Size - 1`. (`Size` includes invalid collectibles, like
|
|
10839
|
+
* 666. We subtract one to account for `CollectibleType.NULL`.)
|
|
9380
10840
|
*
|
|
9381
|
-
*
|
|
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).
|
|
9382
10844
|
*
|
|
9383
|
-
*
|
|
9384
|
-
*
|
|
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
|
-
* ```
|
|
10845
|
+
* In order to use this function, you must upgrade your mod with
|
|
10846
|
+
* `ISCFeature.MODDED_ELEMENT_DETECTION`.
|
|
9390
10847
|
*/
|
|
9391
|
-
|
|
10848
|
+
getLastCollectibleType(): CollectibleType;
|
|
9392
10849
|
/**
|
|
9393
|
-
*
|
|
10850
|
+
* Helper function to get an array that represents the all modded collectible types.
|
|
9394
10851
|
*
|
|
9395
|
-
*
|
|
9396
|
-
*
|
|
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).
|
|
10865
|
+
*
|
|
10866
|
+
* In order to use this function, you must upgrade your mod with
|
|
10867
|
+
* `ISCFeature.MODDED_ELEMENT_DETECTION`.
|
|
9397
10868
|
*/
|
|
9398
|
-
|
|
9399
|
-
constructor(mod: ModUpgraded, init?: boolean);
|
|
10869
|
+
getModdedCollectibleTypes(): CollectibleType[];
|
|
9400
10870
|
/**
|
|
9401
|
-
*
|
|
9402
|
-
*
|
|
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).
|
|
9403
10874
|
*
|
|
9404
|
-
*
|
|
10875
|
+
* In order to use this function, you must upgrade your mod with
|
|
10876
|
+
* `ISCFeature.MODDED_ELEMENT_DETECTION`.
|
|
9405
10877
|
*/
|
|
9406
|
-
|
|
10878
|
+
getNumCollectibleTypes(): int;
|
|
9407
10879
|
/**
|
|
9408
|
-
*
|
|
9409
|
-
* decorated callbacks.
|
|
10880
|
+
* Unlike vanilla collectible types, modded collectible types are always contiguous.
|
|
9410
10881
|
*
|
|
9411
|
-
* This
|
|
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).
|
|
10885
|
+
*
|
|
10886
|
+
* In order to use this function, you must upgrade your mod with
|
|
10887
|
+
* `ISCFeature.MODDED_ELEMENT_DETECTION`.
|
|
9412
10888
|
*/
|
|
9413
|
-
|
|
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;
|
|
10889
|
+
getNumModdedCollectibleTypes(): int;
|
|
9443
10890
|
/**
|
|
9444
|
-
*
|
|
10891
|
+
* Returns the first modded trinket type, or undefined if there are no modded trinkets.
|
|
9445
10892
|
*
|
|
9446
|
-
* This
|
|
9447
|
-
*
|
|
9448
|
-
*
|
|
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).
|
|
10895
|
+
*
|
|
10896
|
+
* In order to use this function, you must upgrade your mod with
|
|
10897
|
+
* `ISCFeature.MODDED_ELEMENT_DETECTION`.
|
|
9449
10898
|
*/
|
|
9450
|
-
|
|
10899
|
+
getFirstModdedTrinketType(): TrinketType | undefined;
|
|
9451
10900
|
/**
|
|
9452
|
-
*
|
|
9453
|
-
*
|
|
9454
|
-
*
|
|
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`.
|
|
10911
|
+
*/
|
|
10912
|
+
getLastTrinketType(): TrinketType;
|
|
10913
|
+
/**
|
|
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.
|
|
10921
|
+
*
|
|
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).
|
|
10924
|
+
*
|
|
10925
|
+
* In order to use this function, you must upgrade your mod with
|
|
10926
|
+
* `ISCFeature.MODDED_ELEMENT_DETECTION`.
|
|
10927
|
+
*/
|
|
10928
|
+
getModdedTrinketTypes(): TrinketType[];
|
|
10929
|
+
/**
|
|
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`.
|
|
10940
|
+
*/
|
|
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: ModUpgraded, 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 when upgrading your mod, you will get a version of
|
|
11680
|
+
* `ModUpgraded` that has extra methods corresponding to the features that were specified. (This
|
|
11681
|
+
* corresponds to the internal-type `ModUpgradedWithFeatures` type, which extends `ModUpgraded`.)
|
|
11682
|
+
*/
|
|
11683
|
+
export declare class ModUpgraded implements Mod {
|
|
11684
|
+
Name: string;
|
|
11685
|
+
/** We store a copy of the original mod object so that we can re-implement its functions. */
|
|
11686
|
+
private mod;
|
|
11687
|
+
private debug;
|
|
11688
|
+
private timeThreshold;
|
|
11689
|
+
private callbacks;
|
|
11690
|
+
private features;
|
|
11691
|
+
constructor(mod: Mod, debug: boolean, timeThreshold?: float);
|
|
11692
|
+
AddCallback<T extends ModCallback | string>(modCallback: T, ...args: T extends ModCallback ? AddCallbackParameters[T] : unknown[]): void;
|
|
11693
|
+
AddPriorityCallback<T extends ModCallback | string>(modCallback: T, priority: CallbackPriority | int, ...args: T extends ModCallback ? AddCallbackParameters[T] : unknown[]): void;
|
|
11694
|
+
HasData(): boolean;
|
|
11695
|
+
LoadData(): string;
|
|
11696
|
+
RemoveCallback<T extends ModCallback>(modCallback: T, callback: AddCallbackParameters[T][0]): void;
|
|
11697
|
+
RemoveData(): void;
|
|
11698
|
+
SaveData(data: string): void;
|
|
11699
|
+
/**
|
|
11700
|
+
* Registers a function to be executed when an in-game event happens.
|
|
11701
|
+
*
|
|
11702
|
+
* This method is specifically for events that are provided by the IsaacScript standard library.
|
|
11703
|
+
* For example, the `ModCallbackCustom.POST_BOMB_EXPLODE` event corresponds to when a bomb
|
|
11704
|
+
* explodes.
|
|
11705
|
+
*/
|
|
11706
|
+
AddCallbackCustom<T extends ModCallbackCustom>(modCallbackCustom: T, ...args: AddCallbackParametersCustom[T]): void;
|
|
11707
|
+
/**
|
|
11708
|
+
* The same as the `ModUpgraded.AddCallbackCustom` method, but allows setting a custom priority.
|
|
11709
|
+
* By default, callbacks are added with a priority of 0, so this allows you to add early or late
|
|
11710
|
+
* callbacks as necessary. See the `CallbackPriority` enum.
|
|
9455
11711
|
*/
|
|
9456
11712
|
AddPriorityCallbackCustom<T extends ModCallbackCustom>(modCallbackCustom: T, priority: CallbackPriority | int, ...args: AddCallbackParametersCustom[T]): void;
|
|
9457
11713
|
/**
|
|
@@ -9490,6 +11746,22 @@ export declare class ModUpgraded implements Mod {
|
|
|
9490
11746
|
private initOptionalFeature;
|
|
9491
11747
|
}
|
|
9492
11748
|
|
|
11749
|
+
/**
|
|
11750
|
+
* `isaacscript-common` has many custom callbacks that you can use in your mods. Instead of
|
|
11751
|
+
* hijacking the vanilla `Mod` object, we provide a `ModUpgraded` object for you to use, which
|
|
11752
|
+
* extends the base class and adds a new method of `AddCallbackCustom`.
|
|
11753
|
+
*
|
|
11754
|
+
* To upgrade your mod, use the `upgradeMod` helper function.
|
|
11755
|
+
*
|
|
11756
|
+
* By specifying one or more optional features, end-users will get a version of `ModUpgraded` that
|
|
11757
|
+
* has extra methods corresponding to the features that were specified.
|
|
11758
|
+
*
|
|
11759
|
+
* This type is in the private directory because if it was exported, it would cause all of the
|
|
11760
|
+
* internal feature classes to populate the auto-complete of end-user mods (which should never be
|
|
11761
|
+
* directly imported by end-users).
|
|
11762
|
+
*/
|
|
11763
|
+
declare type ModUpgradedWithFeatures<T extends readonly ISCFeature[] = []> = ModUpgraded & ISCFeaturesToKeys<T>;
|
|
11764
|
+
|
|
9493
11765
|
export declare const MOVEMENT_ACTIONS_SET: ReadonlySet<ButtonAction>;
|
|
9494
11766
|
|
|
9495
11767
|
/**
|
|
@@ -9604,6 +11876,23 @@ export declare function newTSTLClass(oldClass: TSTLClass): TSTLClass;
|
|
|
9604
11876
|
*/
|
|
9605
11877
|
export declare function nextSeed(seed: Seed): Seed;
|
|
9606
11878
|
|
|
11879
|
+
declare class NoSirenSteal extends Feature {
|
|
11880
|
+
private postNPCInitSirenHelper;
|
|
11881
|
+
private checkReturnFamiliarToPlayer;
|
|
11882
|
+
private blacklistEntryExists;
|
|
11883
|
+
/**
|
|
11884
|
+
* Blacklists a familiar from being stolen by The Siren boss. This should be called once at the
|
|
11885
|
+
* beginning of every run.
|
|
11886
|
+
*
|
|
11887
|
+
* In order to use this function, you must upgrade your mod with `ISCFeature.NO_SIREN_STEAL`.
|
|
11888
|
+
*
|
|
11889
|
+
* @param familiarVariant The familiar variant to blacklist.
|
|
11890
|
+
* @param familiarSubType The sub-type to blacklist. Optional. The default is to blacklist all
|
|
11891
|
+
* sub-types of the given variant.
|
|
11892
|
+
*/
|
|
11893
|
+
setFamiliarNoSirenSteal(familiarVariant: FamiliarVariant, familiarSubType?: int): void;
|
|
11894
|
+
}
|
|
11895
|
+
|
|
9607
11896
|
export declare const NUM_DIMENSIONS: number;
|
|
9608
11897
|
|
|
9609
11898
|
export declare const NUM_NORMAL_PILL_COLORS: number;
|
|
@@ -9691,6 +11980,8 @@ export declare function openAllDoors(): void;
|
|
|
9691
11980
|
*/
|
|
9692
11981
|
export declare function openDoorFast(door: GridEntityDoor): void;
|
|
9693
11982
|
|
|
11983
|
+
declare type OptionalArgs<T extends ModCallbackCustom> = AllButFirst<AddCallbackParametersCustom[T]>;
|
|
11984
|
+
|
|
9694
11985
|
/**
|
|
9695
11986
|
* Helper function to parse a string that contains an entity type, a variant, and a sub-type,
|
|
9696
11987
|
* separated by periods.
|
|
@@ -9711,6 +12002,76 @@ export declare function parseEntityID(entityID: string): [entityType: EntityType
|
|
|
9711
12002
|
*/
|
|
9712
12003
|
export declare function parseEntityTypeVariantString(entityTypeVariantString: string): [entityType: EntityType, variant: int] | undefined;
|
|
9713
12004
|
|
|
12005
|
+
declare class Pause extends Feature {
|
|
12006
|
+
private disableInputs;
|
|
12007
|
+
private postUpdate;
|
|
12008
|
+
private stopTearsAndProjectilesFromMoving;
|
|
12009
|
+
private inputActionGetActionValue;
|
|
12010
|
+
isPaused(): boolean;
|
|
12011
|
+
/**
|
|
12012
|
+
* Helper function to emulate what happens when the player pauses the game. Use the `unpause`
|
|
12013
|
+
* function to return things back to normal.
|
|
12014
|
+
*
|
|
12015
|
+
* Under the hood, this function:
|
|
12016
|
+
* - uses the Pause collectible on every game frame
|
|
12017
|
+
* - disables any player inputs (except for `ButtonAction.MENU_CONFIRM` and
|
|
12018
|
+
* `ButtonAction.CONSOLE`)
|
|
12019
|
+
*
|
|
12020
|
+
* In order to use this function, you must upgrade your mod with `ISCFeature.PAUSE`.
|
|
12021
|
+
*/
|
|
12022
|
+
pause(): void;
|
|
12023
|
+
/**
|
|
12024
|
+
* Helper function to put things back to normal after the `pause` function was used.
|
|
12025
|
+
*
|
|
12026
|
+
* In order to use this function, you must upgrade your mod with `ISCFeature.PAUSE`.
|
|
12027
|
+
*/
|
|
12028
|
+
unpause(): void;
|
|
12029
|
+
}
|
|
12030
|
+
|
|
12031
|
+
declare class PersistentEntities extends Feature {
|
|
12032
|
+
private roomHistory;
|
|
12033
|
+
private postEntityRemove;
|
|
12034
|
+
/**
|
|
12035
|
+
* The persistent entity is despawning because the player is in the process of leaving the room.
|
|
12036
|
+
* Keep track of the position for later.
|
|
12037
|
+
*/
|
|
12038
|
+
private trackDespawningPickupPosition;
|
|
12039
|
+
private postNewRoomReordered;
|
|
12040
|
+
private spawnAndTrack;
|
|
12041
|
+
/**
|
|
12042
|
+
* Helper function to stop an entity spawned with the `spawnPersistentEntity` helper function from
|
|
12043
|
+
* respawning.
|
|
12044
|
+
*
|
|
12045
|
+
* In order to use this function, you must upgrade your mod with `ISCFeature.PERSISTENT_ENTITIES`.
|
|
12046
|
+
*
|
|
12047
|
+
* @param persistentEntityIndex The index that was returned by the `spawnPersistentEntity`
|
|
12048
|
+
* function.
|
|
12049
|
+
* @param removeEntity Optional. True by default. Set to false if you want to stop an entity from
|
|
12050
|
+
* being persistent but you don't want to actually remove the
|
|
12051
|
+
* currently-spawned entity from the room.
|
|
12052
|
+
*/
|
|
12053
|
+
removePersistentEntity(persistentEntityIndex: int, removeEntity?: boolean): void;
|
|
12054
|
+
/**
|
|
12055
|
+
* Helper function to spawn an entity that will have persistence similar to a pickup.
|
|
12056
|
+
*
|
|
12057
|
+
* By default, as soon as you leave a room, any spawned entities will be despawned and will not
|
|
12058
|
+
* return if the player revisits the room. This means that if you want to have an entity like a
|
|
12059
|
+
* pickup, you have to manually respawn it when the player re-enters the room. Use this helper
|
|
12060
|
+
* function to avoid having to do any tracking on your own.
|
|
12061
|
+
*
|
|
12062
|
+
* Conventionally, the word "persistent" refers to `EntityFlag.FLAG_PERSISTENT`, which is used on
|
|
12063
|
+
* e.g. familiars to make them appear in every room. On the other hand, pickups are also
|
|
12064
|
+
* persistent, but they are not present in every room, only one specific room. This function
|
|
12065
|
+
* spawns entities like pickups, not familiars.
|
|
12066
|
+
*
|
|
12067
|
+
* In order to use this function, you must upgrade your mod with `ISCFeature.PERSISTENT_ENTITIES`.
|
|
12068
|
+
*
|
|
12069
|
+
* @returns A tuple containing the entity and the persistent entity index. You can use the index
|
|
12070
|
+
* with the `removePersistentEntity` function.
|
|
12071
|
+
*/
|
|
12072
|
+
spawnPersistentEntity(entityType: EntityType, variant: int, subType: int, position: Vector): [Entity, int];
|
|
12073
|
+
}
|
|
12074
|
+
|
|
9714
12075
|
export declare type PickingUpItem = PickingUpItemNull | PickingUpItemCollectible | PickingUpItemTrinket;
|
|
9715
12076
|
|
|
9716
12077
|
/** Part of `PickingUpItem`. */
|
|
@@ -9755,6 +12116,45 @@ export declare type PickupIndex = int & {
|
|
|
9755
12116
|
readonly __pickupIndexBrand: symbol;
|
|
9756
12117
|
};
|
|
9757
12118
|
|
|
12119
|
+
declare class PickupIndexCreation extends Feature {
|
|
12120
|
+
private roomHistory;
|
|
12121
|
+
private saveDataManager;
|
|
12122
|
+
private postPickupInit;
|
|
12123
|
+
private setPickupIndex;
|
|
12124
|
+
private getPickupIndexFromPreviousData;
|
|
12125
|
+
private postEntityRemovePickup;
|
|
12126
|
+
private checkDespawningFromPlayerLeavingRoom;
|
|
12127
|
+
/**
|
|
12128
|
+
* This is a pickup that is despawning because the player is in the process of leaving the room.
|
|
12129
|
+
* Keep track of the metadata for later.
|
|
12130
|
+
*/
|
|
12131
|
+
private trackDespawningPickupMetadata;
|
|
12132
|
+
/**
|
|
12133
|
+
* If the despawning pickup was in a Treasure Room or Boss Room, then it is possible that the
|
|
12134
|
+
* pickup could re-appear during The Ascent. If this is the case, we store the metadata on a
|
|
12135
|
+
* separate map to reference later.
|
|
12136
|
+
*/
|
|
12137
|
+
private getPickupDataMapForCurrentRoom;
|
|
12138
|
+
private getPostAscentPickupIndex;
|
|
12139
|
+
/**
|
|
12140
|
+
* Mods often have to track variables relating to a pickups. Finding an index for these kinds of
|
|
12141
|
+
* data structures is difficult, since pickups are respawned every time a player re-enters a room,
|
|
12142
|
+
* so the `PtrHash` will change.
|
|
12143
|
+
*
|
|
12144
|
+
* Use this function to get a unique index for a pickup to use in these data structures.
|
|
12145
|
+
*
|
|
12146
|
+
* Specifically, `PickupIndex` is a number that represents the spawn order of the pickup on the
|
|
12147
|
+
* current run. For example, the first pickup spawned will have an index of 1, the second one will
|
|
12148
|
+
* have an index of 2, and so on.
|
|
12149
|
+
*
|
|
12150
|
+
* Tracking pickups requires stateful tracking, so using pickup indexes requires an upgraded mod.
|
|
12151
|
+
*
|
|
12152
|
+
* In order to use this function, you must upgrade your mod with
|
|
12153
|
+
* `ISCFeature.PICKUP_INDEX_CREATION`.
|
|
12154
|
+
*/
|
|
12155
|
+
getPickupIndex(pickup: EntityPickup): PickupIndex;
|
|
12156
|
+
}
|
|
12157
|
+
|
|
9758
12158
|
/** Maps pill effect names to the values of the `PillEffect` enum. */
|
|
9759
12159
|
export declare const PILL_NAME_TO_EFFECT_MAP: ReadonlyMap<string, PillEffect>;
|
|
9760
12160
|
|
|
@@ -9776,6 +12176,53 @@ export declare function playChargeSoundEffect(player: EntityPlayer, activeSlot?:
|
|
|
9776
12176
|
*/
|
|
9777
12177
|
export declare function playerAddCollectible(player: EntityPlayer, ...collectibleTypes: CollectibleType[]): void;
|
|
9778
12178
|
|
|
12179
|
+
declare class PlayerCollectibleDetection extends Feature {
|
|
12180
|
+
v: {
|
|
12181
|
+
run: {
|
|
12182
|
+
playersCollectibleCount: DefaultMap<PlayerIndex, number, []>;
|
|
12183
|
+
playersCollectibleMap: DefaultMap<PlayerIndex, Map<CollectibleType, number>, []>;
|
|
12184
|
+
playersActiveItemMap: DefaultMap<PlayerIndex, Map<ActiveSlot, CollectibleType>, []>;
|
|
12185
|
+
};
|
|
12186
|
+
};
|
|
12187
|
+
private postPlayerCollectibleAdded;
|
|
12188
|
+
private postPlayerCollectibleRemoved;
|
|
12189
|
+
private moddedElementSets;
|
|
12190
|
+
private runInNFrames;
|
|
12191
|
+
constructor(postPlayerCollectibleAdded: PostPlayerCollectibleAdded, postPlayerCollectibleRemoved: PostPlayerCollectibleRemoved, moddedElementSets: ModdedElementSets, runInNFrames: RunInNFrames);
|
|
12192
|
+
/**
|
|
12193
|
+
* This is called when the collectible count changes and in situations where the entire build is
|
|
12194
|
+
* rerolled.
|
|
12195
|
+
*
|
|
12196
|
+
* Since getting a new player collectible map is expensive, we want to only run this function when
|
|
12197
|
+
* necessary, and not on e.g. every frame. Unfortunately, this has the side effect of missing out
|
|
12198
|
+
* on collectible changes from mods that add and remove a collectible on the same frame.
|
|
12199
|
+
*
|
|
12200
|
+
* @param player The player to update.
|
|
12201
|
+
* @param numCollectiblesChanged Pass undefined for situations where the entire build was
|
|
12202
|
+
* rerolled.
|
|
12203
|
+
*/
|
|
12204
|
+
private updateCollectibleMapAndFire;
|
|
12205
|
+
private useItemD4;
|
|
12206
|
+
/** We need to handle the case of Tainted Eden taking damage. */
|
|
12207
|
+
private entityTakeDmgPlayer;
|
|
12208
|
+
/**
|
|
12209
|
+
* We need to handle TMTRAINER collectibles, since they do not cause the player's collectible
|
|
12210
|
+
* count to change.
|
|
12211
|
+
*/
|
|
12212
|
+
private postItemPickup;
|
|
12213
|
+
private postPEffectUpdateReordered;
|
|
12214
|
+
/**
|
|
12215
|
+
* Checking for collectible count will work to detect when a player swaps their active item for
|
|
12216
|
+
* another active item. This is because the collectible count will decrement by 1 when the item is
|
|
12217
|
+
* swapped onto the pedestal and the hold animation begins, and increment by 1 when the item is
|
|
12218
|
+
* dequeued and the hold animation ends.
|
|
12219
|
+
*
|
|
12220
|
+
* However, we also want to explicitly check for the case where a mod swaps in a custom active
|
|
12221
|
+
* collectible on the same frame, since doing so is cheap.
|
|
12222
|
+
*/
|
|
12223
|
+
private checkActiveItemsChanged;
|
|
12224
|
+
}
|
|
12225
|
+
|
|
9779
12226
|
export declare function playerConvertBlackHeartsToSoulHearts(player: EntityPlayer): void;
|
|
9780
12227
|
|
|
9781
12228
|
export declare function playerConvertSoulHeartsToBlackHearts(player: EntityPlayer): void;
|
|
@@ -9839,6 +12286,62 @@ export declare type PlayerIndex = int & {
|
|
|
9839
12286
|
readonly __playerIndexBrand: symbol;
|
|
9840
12287
|
};
|
|
9841
12288
|
|
|
12289
|
+
declare class PlayerInventory extends Feature {
|
|
12290
|
+
private postCollectibleAdded;
|
|
12291
|
+
private postCollectibleRemoved;
|
|
12292
|
+
/**
|
|
12293
|
+
* Helper function to get all of the collectibles that the player has gotten so far on this run,
|
|
12294
|
+
* in order.
|
|
12295
|
+
*
|
|
12296
|
+
* In the case of inventory initialization or the case where the player rerolls their build in the
|
|
12297
|
+
* middle of the run (e.g. with D4), the order of the inventory will not correspond to the order
|
|
12298
|
+
* that the items were actually given to the player. In this case, the inventory will be in the
|
|
12299
|
+
* order of the lowest `CollectibleType` to the highest.
|
|
12300
|
+
*
|
|
12301
|
+
* Under the hood, the inventory tracking works by tracking the number of collectibles that a
|
|
12302
|
+
* player has on every frame. Thus, in a situation where a collectible was both added and removed
|
|
12303
|
+
* to the player on the same frame, the amount of total collectibles would stay the same, and the
|
|
12304
|
+
* inventory would not be updated. In vanilla, this situation would never happen, but another mod
|
|
12305
|
+
* might do this for some reason. (With that said, the next time that a collectible is normally
|
|
12306
|
+
* added or removed, it would trigger a re-scan, and the previous changes would be picked up.)
|
|
12307
|
+
*
|
|
12308
|
+
* In order to use this function, you must upgrade your mod with `ISCFeature.PLAYER_INVENTORY`.
|
|
12309
|
+
*
|
|
12310
|
+
* @param player The player to get the inventory for.
|
|
12311
|
+
* @param includeActiveCollectibles Optional. If true, will include all active collectibles.
|
|
12312
|
+
* Default is true.
|
|
12313
|
+
*/
|
|
12314
|
+
getPlayerInventory(player: EntityPlayer, includeActiveCollectibles?: boolean): CollectibleType[];
|
|
12315
|
+
/**
|
|
12316
|
+
* Helper function to get the last passive collectible that the player picked up. In most cases,
|
|
12317
|
+
* this will be the passive that is removed when the player would use Clicker.
|
|
12318
|
+
*
|
|
12319
|
+
* Returns undefined if the player does not have any passive collectibles.
|
|
12320
|
+
*
|
|
12321
|
+
* In order to use this function, you must upgrade your mod with `ISCFeature.PLAYER_INVENTORY`.
|
|
12322
|
+
*/
|
|
12323
|
+
getPlayerLastPassiveCollectible(player: EntityPlayer): CollectibleType | undefined;
|
|
12324
|
+
}
|
|
12325
|
+
|
|
12326
|
+
declare class PlayerReorderedCallbacks extends Feature {
|
|
12327
|
+
v: {
|
|
12328
|
+
run: {
|
|
12329
|
+
postGameStartedFiredOnThisRun: boolean;
|
|
12330
|
+
postPEffectUpdateQueue: PlayerIndex[];
|
|
12331
|
+
postPlayerUpdateQueue: PlayerIndex[];
|
|
12332
|
+
postPlayerRenderQueue: PlayerIndex[];
|
|
12333
|
+
};
|
|
12334
|
+
};
|
|
12335
|
+
private postPEffectUpdateReordered;
|
|
12336
|
+
private postPlayerRenderReordered;
|
|
12337
|
+
private postPlayerUpdateReordered;
|
|
12338
|
+
constructor(postPEffectUpdateReordered: PostPEffectUpdateReordered, postPlayerRenderReordered: PostPlayerRenderReordered, postPlayerUpdateReordered: PostPlayerUpdateReordered);
|
|
12339
|
+
private postPEffectUpdate;
|
|
12340
|
+
private postPlayerUpdate;
|
|
12341
|
+
private postPlayerRender;
|
|
12342
|
+
private postGameStartedReorderedLast;
|
|
12343
|
+
}
|
|
12344
|
+
|
|
9842
12345
|
/** This is used by the `getPocketItems` and related helper functions. */
|
|
9843
12346
|
export declare interface PocketItemDescription {
|
|
9844
12347
|
slot: PocketItemSlot;
|
|
@@ -9856,12 +12359,268 @@ export declare enum PocketItemType {
|
|
|
9856
12359
|
UNDETERMINABLE = 5
|
|
9857
12360
|
}
|
|
9858
12361
|
|
|
12362
|
+
declare class PonyDetection extends Feature {
|
|
12363
|
+
private postPEffectUpdateReordered;
|
|
12364
|
+
/**
|
|
12365
|
+
* Helper function to see if the player is under the effects of A Pony or White Pony charge.
|
|
12366
|
+
* Detecting this is difficult, as the temporary effect will disappear upon entering a new room.
|
|
12367
|
+
*
|
|
12368
|
+
* In order to use this function, you must upgrade your mod with `ISCFeature.PONY_DETECTION`.
|
|
12369
|
+
*/
|
|
12370
|
+
isPlayerUsingPony(player: EntityPlayer): boolean;
|
|
12371
|
+
/**
|
|
12372
|
+
* Helper function to see if any player is under the effects of A Pony or White Pony charge.
|
|
12373
|
+
* Detecting this is difficult, as the temporary effect will disappear upon entering a new room.
|
|
12374
|
+
*
|
|
12375
|
+
* In order to use this function, you must upgrade your mod with `ISCFeature.PONY_DETECTION`.
|
|
12376
|
+
*/
|
|
12377
|
+
anyPlayerUsingPony(): boolean;
|
|
12378
|
+
}
|
|
12379
|
+
|
|
9859
12380
|
/**
|
|
9860
12381
|
* These are the possible types that player stats can be. For example, `EntityPlayer.Damage` is of
|
|
9861
12382
|
* type `float`, `EntityPlayer.CanFly` is of type `boolean`, and so on.
|
|
9862
12383
|
*/
|
|
9863
12384
|
export declare type PossibleStatType = number | boolean | BitFlags<TearFlag> | Color | Vector;
|
|
9864
12385
|
|
|
12386
|
+
declare class PostCustomRevive extends CustomCallback<ModCallbackCustom.POST_CUSTOM_REVIVE> {
|
|
12387
|
+
constructor();
|
|
12388
|
+
protected shouldFire: (fireArgs: [player: EntityPlayer, revivalType: number], optionalArgs: OptionalArgs<T>) => boolean;
|
|
12389
|
+
}
|
|
12390
|
+
|
|
12391
|
+
declare class PostEsauJr extends CustomCallback<ModCallbackCustom.POST_ESAU_JR> {
|
|
12392
|
+
constructor();
|
|
12393
|
+
}
|
|
12394
|
+
|
|
12395
|
+
declare class PostFirstEsauJr extends CustomCallback<ModCallbackCustom.POST_FIRST_ESAU_JR> {
|
|
12396
|
+
constructor();
|
|
12397
|
+
}
|
|
12398
|
+
|
|
12399
|
+
declare class PostFirstFlip extends CustomCallback<ModCallbackCustom.POST_FIRST_FLIP> {
|
|
12400
|
+
constructor();
|
|
12401
|
+
}
|
|
12402
|
+
|
|
12403
|
+
declare class PostFlip extends CustomCallback<ModCallbackCustom.POST_FLIP> {
|
|
12404
|
+
constructor();
|
|
12405
|
+
}
|
|
12406
|
+
|
|
12407
|
+
declare class PostGridEntityBroken extends CustomCallback<ModCallbackCustom.POST_GRID_ENTITY_BROKEN> {
|
|
12408
|
+
constructor();
|
|
12409
|
+
protected shouldFire: typeof shouldFireGridEntity;
|
|
12410
|
+
}
|
|
12411
|
+
|
|
12412
|
+
declare class PostGridEntityCollision extends CustomCallback<T_2> {
|
|
12413
|
+
constructor();
|
|
12414
|
+
protected shouldFire: (fireArgs: [gridEntity: GridEntity, entity: Entity], optionalArgs: [gridEntityType?: GridEntityType | undefined, gridEntityVariant?: number | undefined, entityType?: EntityType | undefined, entityVariant?: number | undefined, entitySubType?: number | undefined]) => boolean;
|
|
12415
|
+
}
|
|
12416
|
+
|
|
12417
|
+
declare class PostGridEntityCustomBroken extends CustomCallback<ModCallbackCustom.POST_GRID_ENTITY_CUSTOM_BROKEN> {
|
|
12418
|
+
constructor();
|
|
12419
|
+
protected shouldFire: typeof shouldFireGridEntityCustom;
|
|
12420
|
+
}
|
|
12421
|
+
|
|
12422
|
+
declare class PostGridEntityCustomCollision extends CustomCallback<T_3> {
|
|
12423
|
+
constructor();
|
|
12424
|
+
protected shouldFire: (fireArgs: [gridEntity: GridEntity, gridEntityTypeCustom: GridEntityType, entity: Entity], optionalArgs: [gridEntityTypeCustom?: GridEntityType | undefined, entityType?: EntityType | undefined, entityVariant?: number | undefined, entitySubType?: number | undefined]) => boolean;
|
|
12425
|
+
}
|
|
12426
|
+
|
|
12427
|
+
declare class PostGridEntityCustomInit extends CustomCallback<ModCallbackCustom.POST_GRID_ENTITY_CUSTOM_INIT> {
|
|
12428
|
+
constructor();
|
|
12429
|
+
protected shouldFire: typeof shouldFireGridEntityCustom;
|
|
12430
|
+
}
|
|
12431
|
+
|
|
12432
|
+
declare class PostGridEntityCustomRemove extends CustomCallback<T_5> {
|
|
12433
|
+
constructor();
|
|
12434
|
+
protected shouldFire: (fireArgs: [gridIndex: number, gridEntityTypeCustom: GridEntityType], optionalArgs: OptionalArgs<T_5>) => boolean;
|
|
12435
|
+
}
|
|
12436
|
+
|
|
12437
|
+
declare class PostGridEntityCustomRender extends CustomCallback<ModCallbackCustom.POST_GRID_ENTITY_CUSTOM_RENDER> {
|
|
12438
|
+
constructor();
|
|
12439
|
+
protected shouldFire: typeof shouldFireGridEntityCustom;
|
|
12440
|
+
}
|
|
12441
|
+
|
|
12442
|
+
declare class PostGridEntityCustomStateChanged extends CustomCallback<ModCallbackCustom.POST_GRID_ENTITY_CUSTOM_STATE_CHANGED> {
|
|
12443
|
+
constructor();
|
|
12444
|
+
protected shouldFire: typeof shouldFireGridEntityCustom;
|
|
12445
|
+
}
|
|
12446
|
+
|
|
12447
|
+
declare class PostGridEntityCustomUpdate extends CustomCallback<ModCallbackCustom.POST_GRID_ENTITY_CUSTOM_UPDATE> {
|
|
12448
|
+
constructor();
|
|
12449
|
+
protected shouldFire: typeof shouldFireGridEntityCustom;
|
|
12450
|
+
}
|
|
12451
|
+
|
|
12452
|
+
declare class PostGridEntityInit extends CustomCallback<ModCallbackCustom.POST_GRID_ENTITY_INIT> {
|
|
12453
|
+
constructor();
|
|
12454
|
+
protected shouldFire: typeof shouldFireGridEntity;
|
|
12455
|
+
}
|
|
12456
|
+
|
|
12457
|
+
declare class PostGridEntityRemove extends CustomCallback<T_4> {
|
|
12458
|
+
constructor();
|
|
12459
|
+
protected shouldFire: (fireArgs: [gridIndex: number, gridEntityType: GridEntityType, variant: number], optionalArgs: [gridEntityType?: GridEntityType | undefined, variant?: number | undefined]) => boolean;
|
|
12460
|
+
}
|
|
12461
|
+
|
|
12462
|
+
declare class PostGridEntityRender extends CustomCallback<ModCallbackCustom.POST_GRID_ENTITY_RENDER> {
|
|
12463
|
+
constructor();
|
|
12464
|
+
protected shouldFire: typeof shouldFireGridEntity;
|
|
12465
|
+
}
|
|
12466
|
+
|
|
12467
|
+
declare class PostGridEntityStateChanged extends CustomCallback<ModCallbackCustom.POST_GRID_ENTITY_STATE_CHANGED> {
|
|
12468
|
+
constructor();
|
|
12469
|
+
protected shouldFire: typeof shouldFireGridEntity;
|
|
12470
|
+
}
|
|
12471
|
+
|
|
12472
|
+
declare class PostGridEntityUpdate extends CustomCallback<ModCallbackCustom.POST_GRID_ENTITY_UPDATE> {
|
|
12473
|
+
constructor();
|
|
12474
|
+
protected shouldFire: typeof shouldFireGridEntity;
|
|
12475
|
+
}
|
|
12476
|
+
|
|
12477
|
+
declare class PostItemPickup extends CustomCallback<ModCallbackCustom.POST_ITEM_PICKUP> {
|
|
12478
|
+
constructor();
|
|
12479
|
+
protected shouldFire: typeof shouldFireItemPickup;
|
|
12480
|
+
}
|
|
12481
|
+
|
|
12482
|
+
declare class PostPEffectUpdateReordered extends CustomCallback<ModCallbackCustom.POST_PEFFECT_UPDATE_REORDERED> {
|
|
12483
|
+
constructor();
|
|
12484
|
+
protected shouldFire: typeof shouldFirePlayer;
|
|
12485
|
+
}
|
|
12486
|
+
|
|
12487
|
+
declare class PostPlayerCollectibleAdded extends CustomCallback<ModCallbackCustom.POST_PLAYER_COLLECTIBLE_ADDED> {
|
|
12488
|
+
constructor();
|
|
12489
|
+
protected shouldFire: typeof shouldFireCollectibleType;
|
|
12490
|
+
}
|
|
12491
|
+
|
|
12492
|
+
declare class PostPlayerCollectibleRemoved extends CustomCallback<ModCallbackCustom.POST_PLAYER_COLLECTIBLE_REMOVED> {
|
|
12493
|
+
constructor();
|
|
12494
|
+
protected shouldFire: typeof shouldFireCollectibleType;
|
|
12495
|
+
}
|
|
12496
|
+
|
|
12497
|
+
declare class PostPlayerRenderReordered extends CustomCallback<ModCallbackCustom.POST_PLAYER_RENDER_REORDERED> {
|
|
12498
|
+
constructor();
|
|
12499
|
+
protected shouldFire: typeof shouldFirePlayer;
|
|
12500
|
+
}
|
|
12501
|
+
|
|
12502
|
+
declare class PostPlayerUpdateReordered extends CustomCallback<ModCallbackCustom.POST_PLAYER_UPDATE_REORDERED> {
|
|
12503
|
+
constructor();
|
|
12504
|
+
protected shouldFire: typeof shouldFirePlayer;
|
|
12505
|
+
}
|
|
12506
|
+
|
|
12507
|
+
declare class PostSlotAnimationChanged extends CustomCallback<ModCallbackCustom.POST_SLOT_ANIMATION_CHANGED> {
|
|
12508
|
+
constructor();
|
|
12509
|
+
protected shouldFire: typeof shouldFireSlot;
|
|
12510
|
+
}
|
|
12511
|
+
|
|
12512
|
+
declare class PostSlotDestroyed extends CustomCallback<ModCallbackCustom.POST_SLOT_DESTROYED> {
|
|
12513
|
+
constructor();
|
|
12514
|
+
protected shouldFire: typeof shouldFireSlot;
|
|
12515
|
+
}
|
|
12516
|
+
|
|
12517
|
+
declare class PostSlotInit extends CustomCallback<ModCallbackCustom.POST_SLOT_INIT> {
|
|
12518
|
+
constructor();
|
|
12519
|
+
protected shouldFire: typeof shouldFireSlot;
|
|
12520
|
+
}
|
|
12521
|
+
|
|
12522
|
+
declare class PostSlotRender extends CustomCallback<ModCallbackCustom.POST_SLOT_RENDER> {
|
|
12523
|
+
constructor();
|
|
12524
|
+
protected shouldFire: typeof shouldFireSlot;
|
|
12525
|
+
}
|
|
12526
|
+
|
|
12527
|
+
declare class PostSlotUpdate extends CustomCallback<ModCallbackCustom.POST_SLOT_UPDATE> {
|
|
12528
|
+
constructor();
|
|
12529
|
+
protected shouldFire: typeof shouldFireSlot;
|
|
12530
|
+
}
|
|
12531
|
+
|
|
12532
|
+
declare class PreCustomRevive extends CustomCallback<ModCallbackCustom.PRE_CUSTOM_REVIVE> {
|
|
12533
|
+
constructor();
|
|
12534
|
+
protected shouldFire: typeof shouldFirePlayer;
|
|
12535
|
+
}
|
|
12536
|
+
|
|
12537
|
+
declare class PreItemPickup extends CustomCallback<ModCallbackCustom.PRE_ITEM_PICKUP> {
|
|
12538
|
+
constructor();
|
|
12539
|
+
protected shouldFire: typeof shouldFireItemPickup;
|
|
12540
|
+
}
|
|
12541
|
+
|
|
12542
|
+
declare class PressInput extends Feature {
|
|
12543
|
+
private isActionTriggered;
|
|
12544
|
+
/**
|
|
12545
|
+
* Helper function to press an arbitrary `ButtonAction` on the next possible input poll. In most
|
|
12546
|
+
* cases, this will be equivalent to if the first player pressed the corresponding input. It
|
|
12547
|
+
* usually takes 1 frame for the input to take effect.
|
|
12548
|
+
*
|
|
12549
|
+
* In order to use this function, you must upgrade your mod with `ISCFeature.PRESS_INPUT`.
|
|
12550
|
+
*/
|
|
12551
|
+
pressInput(player: EntityPlayer, buttonAction: ButtonAction): void;
|
|
12552
|
+
}
|
|
12553
|
+
|
|
12554
|
+
declare class PreventChildEntities extends Feature {
|
|
12555
|
+
private postNPCInit;
|
|
12556
|
+
/**
|
|
12557
|
+
* Helper function to prevent an entity from spawning any other entities. Meant to be used on NPCs
|
|
12558
|
+
* like Squirts. This behavior will only last for the current room.
|
|
12559
|
+
*
|
|
12560
|
+
* Under the hood, this function will remove any new NPCs spawned that have a
|
|
12561
|
+
* `Entity.SpawnerEntity` or `Entity.Parent` value that matches the provided entity. (They are
|
|
12562
|
+
* removed during the `POST_NPC_INIT` callback specifically.)
|
|
12563
|
+
*
|
|
12564
|
+
* In order to use this function, you must upgrade your mod with
|
|
12565
|
+
* `ISCFeature.PREVENT_CHILD_ENTITIES`.
|
|
12566
|
+
*/
|
|
12567
|
+
preventChildEntities(entity: Entity): void;
|
|
12568
|
+
}
|
|
12569
|
+
|
|
12570
|
+
declare class PreventCollectibleRotation extends Feature {
|
|
12571
|
+
private useCardSoulOfIsaac;
|
|
12572
|
+
private postPickupUpdateCollectible;
|
|
12573
|
+
private checkCollectibleRotated;
|
|
12574
|
+
/**
|
|
12575
|
+
* Helper function to prevent a collectible from being affected by Tainted Isaac's rotation
|
|
12576
|
+
* mechanic. (This mechanic also happens from Glitched Crown and Binge Eater.) This is useful
|
|
12577
|
+
* because quest items that are manually spawned by mods will be automatically be affected by this
|
|
12578
|
+
* mechanic.
|
|
12579
|
+
*
|
|
12580
|
+
* It is required to pass the intended collectible type to this function since it is possible for
|
|
12581
|
+
* collectibles to rotate on the first frame that they are spawned.
|
|
12582
|
+
*
|
|
12583
|
+
* In order to use this function, you must upgrade your mod with
|
|
12584
|
+
* `ISCFeature.PREVENT_COLLECTIBLE_ROTATION`.
|
|
12585
|
+
*/
|
|
12586
|
+
preventCollectibleRotation(collectible: EntityPickup, collectibleType: CollectibleType): void;
|
|
12587
|
+
}
|
|
12588
|
+
|
|
12589
|
+
declare class PreventGridEntityRespawn extends Feature {
|
|
12590
|
+
private runInNFrames;
|
|
12591
|
+
private preUseItemWeNeedToGoDeeper;
|
|
12592
|
+
private postNewRoomReordered;
|
|
12593
|
+
/**
|
|
12594
|
+
* Every time we re-enter the room, the sprites for all of the decorations will come back, so we
|
|
12595
|
+
* have to remove them again.
|
|
12596
|
+
*/
|
|
12597
|
+
private setDecorationsInvisible;
|
|
12598
|
+
/**
|
|
12599
|
+
* Helper function to prevent any removed grid entities from respawning if the player re-enters
|
|
12600
|
+
* the current room.
|
|
12601
|
+
*
|
|
12602
|
+
* This is accomplished by spawning a new grid entity on every tile that does not already have a
|
|
12603
|
+
* grid entity. This will force the game to spawn the new grid entity instead of the old one. The
|
|
12604
|
+
* natural grid entity to choose for this purpose is a decoration, since it is non-interacting.
|
|
12605
|
+
* Then, the decorations are made invisible and any shovel uses are intercepted to avoid creating
|
|
12606
|
+
* a crawl space (instead of a trapdoor).
|
|
12607
|
+
*
|
|
12608
|
+
* Another option besides decorations would be to use a pressure plates with a state of 1, which
|
|
12609
|
+
* is a state that is normally unused by the game and makes it invisible & persistent. However,
|
|
12610
|
+
* pickups will not be able to spawn on pressure plates, which lead to various bugs (e.g. pickups
|
|
12611
|
+
* spawning on top of pits). Thus, using a decoration is preferable.
|
|
12612
|
+
*
|
|
12613
|
+
* Yet another option to accomplish this would be to replace the room data with that of an empty
|
|
12614
|
+
* room. However, the room data must exactly match the room type, the room shape, and the doors,
|
|
12615
|
+
* so this is not possible to do in a robust way without adding empty rooms to the mod's `content`
|
|
12616
|
+
* folder to draw the data from.
|
|
12617
|
+
*
|
|
12618
|
+
* In order to use this function, you must upgrade your mod with
|
|
12619
|
+
* `ISCFeature.PREVENT_GRID_ENTITY_RESPAWN`.
|
|
12620
|
+
*/
|
|
12621
|
+
preventGridEntityRespawn(): void;
|
|
12622
|
+
}
|
|
12623
|
+
|
|
9865
12624
|
/** Helper function to print whether something was enabled or disabled to the in-game console. */
|
|
9866
12625
|
export declare function printEnabled(enabled: boolean, description: string): void;
|
|
9867
12626
|
|
|
@@ -10563,6 +13322,24 @@ export declare enum RockAltType {
|
|
|
10563
13322
|
/** Maps room names to the values of the `RoomType` enum. */
|
|
10564
13323
|
export declare const ROOM_NAME_TO_TYPE_MAP: ReadonlyMap<string, RoomType>;
|
|
10565
13324
|
|
|
13325
|
+
declare class RoomClearFrame extends Feature {
|
|
13326
|
+
private postRoomClearChangedTrue;
|
|
13327
|
+
/**
|
|
13328
|
+
* Helper function to get the game frame (i.e. `Game.GetFrameCount`) of the last time that this
|
|
13329
|
+
* room was cleared. Returns undefined if the room has never been cleared.
|
|
13330
|
+
*
|
|
13331
|
+
* In order to use this function, you must upgrade your mod with `ISCFeature.ROOM_CLEAR_FRAME`.
|
|
13332
|
+
*/
|
|
13333
|
+
getRoomClearGameFrame(): int | undefined;
|
|
13334
|
+
/**
|
|
13335
|
+
* Helper function to get the room frame (i.e. `Room.GetFrameCount`) of the last time that this
|
|
13336
|
+
* room was cleared. Returns undefined if the room has never been cleared.
|
|
13337
|
+
*
|
|
13338
|
+
* In order to use this function, you must upgrade your mod with `ISCFeature.ROOM_CLEAR_FRAME`.
|
|
13339
|
+
*/
|
|
13340
|
+
getRoomClearRoomFrame(): int | undefined;
|
|
13341
|
+
}
|
|
13342
|
+
|
|
10566
13343
|
/** This is used by the room history feature of the standard library. */
|
|
10567
13344
|
export declare interface RoomDescription {
|
|
10568
13345
|
startSeedString: string;
|
|
@@ -10598,6 +13375,57 @@ export declare function roomExists(roomGridIndex: int): boolean;
|
|
|
10598
13375
|
*/
|
|
10599
13376
|
export declare function roomGridIndexToXY(roomGridIndex: int): [x: int, y: int];
|
|
10600
13377
|
|
|
13378
|
+
declare class RoomHistory extends Feature {
|
|
13379
|
+
private postNewRoomEarly;
|
|
13380
|
+
/**
|
|
13381
|
+
* Helper function to get the total number of rooms that the player has entered thus far on the
|
|
13382
|
+
* run. (Re-entering the same room will increment the number returned.)
|
|
13383
|
+
*
|
|
13384
|
+
* In order to use this function, you must upgrade your mod with `ISCFeature.ROOM_HISTORY`.
|
|
13385
|
+
*/
|
|
13386
|
+
getNumRoomsEntered(): int;
|
|
13387
|
+
/**
|
|
13388
|
+
* Helper function to get information about all of the rooms that a player has visited thus far on
|
|
13389
|
+
* this run.
|
|
13390
|
+
*
|
|
13391
|
+
* In order to use this function, you must upgrade your mod with `ISCFeature.ROOM_HISTORY`.
|
|
13392
|
+
*/
|
|
13393
|
+
getRoomHistory(): ReadonlyArray<Readonly<RoomDescription>>;
|
|
13394
|
+
/**
|
|
13395
|
+
* Helper function to get information about the room that was previously visited.
|
|
13396
|
+
*
|
|
13397
|
+
* In the special case of only one room having been visited thus far (i.e. the starting room of
|
|
13398
|
+
* the run), the starting room will be returned.
|
|
13399
|
+
*
|
|
13400
|
+
* In order to use this function, you must upgrade your mod with `ISCFeature.ROOM_HISTORY`.
|
|
13401
|
+
*/
|
|
13402
|
+
getPreviousRoomDescription(): Readonly<RoomDescription>;
|
|
13403
|
+
/**
|
|
13404
|
+
* Helper function to get information about the most recent room that is stored in the room
|
|
13405
|
+
* history array.
|
|
13406
|
+
*
|
|
13407
|
+
* This is useful in the `POST_ENTITY_REMOVE` callback; see the `isLeavingRoom` function.
|
|
13408
|
+
*
|
|
13409
|
+
* Note that this function can return undefined in the case where it is called on the first room
|
|
13410
|
+
* of the run.
|
|
13411
|
+
*
|
|
13412
|
+
* In order to use this function, you must upgrade your mod with `ISCFeature.ROOM_HISTORY`.
|
|
13413
|
+
*/
|
|
13414
|
+
getLatestRoomDescription(): Readonly<RoomDescription> | undefined;
|
|
13415
|
+
/**
|
|
13416
|
+
* Helper function to detect if the game is in the state where the room index has changed to a new
|
|
13417
|
+
* room, but the entities from the previous room are currently in the process of despawning. (At
|
|
13418
|
+
* this point, the `POST_NEW_ROOM` callback and the `POST_NEW_ROOM_EARLY` callback will not have
|
|
13419
|
+
* fired yet, and there will not be an entry in the room history array for the current room.)
|
|
13420
|
+
*
|
|
13421
|
+
* This function is intended to be used in the `POST_ENTITY_REMOVE` callback to detect when an
|
|
13422
|
+
* entity is despawning.
|
|
13423
|
+
*
|
|
13424
|
+
* In order to use this function, you must upgrade your mod with `ISCFeature.ROOM_HISTORY`.
|
|
13425
|
+
*/
|
|
13426
|
+
isLeavingRoom(): boolean;
|
|
13427
|
+
}
|
|
13428
|
+
|
|
10601
13429
|
/**
|
|
10602
13430
|
* If the `Room.Update` method is called in a `POST_NEW_ROOM` callback, then some entities will
|
|
10603
13431
|
* slide around (such as the player). Since those entity velocities are already at zero, setting
|
|
@@ -10622,6 +13450,151 @@ export declare function round(num: float, numDecimalPlaces?: number): float;
|
|
|
10622
13450
|
*/
|
|
10623
13451
|
export declare function runDeepCopyTests(): void;
|
|
10624
13452
|
|
|
13453
|
+
declare class RunInNFrames extends Feature {
|
|
13454
|
+
vConditionalFunc: () => boolean;
|
|
13455
|
+
private roomHistory;
|
|
13456
|
+
private postUpdate;
|
|
13457
|
+
private postRender;
|
|
13458
|
+
/**
|
|
13459
|
+
* Helper function to restart on the next render frame. Useful because it is impossible to restart
|
|
13460
|
+
* the game inside of the `POST_NEW_ROOM`, `POST_NEW_LEVEL`, or `POST_GAME_STARTED` callbacks when
|
|
13461
|
+
* a run is first starting.
|
|
13462
|
+
*
|
|
13463
|
+
* You can optionally specify a `PlayerType` to restart the game as that character.
|
|
13464
|
+
*
|
|
13465
|
+
* In order to use this function, you must upgrade your mod with `ISCFeature.RUN_IN_N_FRAMES`.
|
|
13466
|
+
*/
|
|
13467
|
+
restartNextRenderFrame(character?: PlayerType): void;
|
|
13468
|
+
/**
|
|
13469
|
+
* Supply a function to run N game frames from now in the `POST_UPDATE` callback.
|
|
13470
|
+
*
|
|
13471
|
+
* For a usage example, see the documentation for the `runNextGameFrame`, which is used in a
|
|
13472
|
+
* similar way.
|
|
13473
|
+
*
|
|
13474
|
+
* Note that this function will not handle saving and quitting. If a player saving and quitting
|
|
13475
|
+
* before the deferred function fires would cause a bug in your mod, then you should handle
|
|
13476
|
+
* deferred functions manually using serializable data.
|
|
13477
|
+
*
|
|
13478
|
+
* In order to use this function, you must upgrade your mod with `ISCFeature.RUN_IN_N_FRAMES`.
|
|
13479
|
+
*
|
|
13480
|
+
* @param func The function to run.
|
|
13481
|
+
* @param gameFrames The amount of game frames to wait before running the function.
|
|
13482
|
+
* @param cancelIfRoomChanges Optional. Whether or not to cancel running the function if a new
|
|
13483
|
+
* room is loaded in the interim. Default is false.
|
|
13484
|
+
*/
|
|
13485
|
+
runInNGameFrames(func: () => void, gameFrames: int, cancelIfRoomChanges?: boolean): void;
|
|
13486
|
+
/**
|
|
13487
|
+
* Supply a function to run N render frames from now in the `POST_RENDER` callback.
|
|
13488
|
+
*
|
|
13489
|
+
* For a usage example, see the documentation for the `runNextGameFrame`, which is used in a
|
|
13490
|
+
* similar way.
|
|
13491
|
+
*
|
|
13492
|
+
* Note that this function will not handle saving and quitting. If a player saving and quitting
|
|
13493
|
+
* before the deferred function fires would cause a bug in your mod, then you should handle
|
|
13494
|
+
* deferred functions manually using serializable data.
|
|
13495
|
+
*
|
|
13496
|
+
* In order to use this function, you must upgrade your mod with `ISCFeature.RUN_IN_N_FRAMES`.
|
|
13497
|
+
*
|
|
13498
|
+
* @param func The function to run.
|
|
13499
|
+
* @param renderFrames The amount of render frames to wait before running the function.
|
|
13500
|
+
* @param cancelIfRoomChanges Optional. Whether or not to cancel running the function if a new
|
|
13501
|
+
* room is loaded in the interim. Default is false.
|
|
13502
|
+
*/
|
|
13503
|
+
runInNRenderFrames(func: () => void, renderFrames: int, cancelIfRoomChanges?: boolean): void;
|
|
13504
|
+
/**
|
|
13505
|
+
* Supply a function to run on the next `POST_UPDATE` callback.
|
|
13506
|
+
*
|
|
13507
|
+
* For example:
|
|
13508
|
+
*
|
|
13509
|
+
* ```ts
|
|
13510
|
+
* const NUM_EXPLODER_EXPLOSIONS = 5;
|
|
13511
|
+
*
|
|
13512
|
+
* function useItemExploder(player: EntityPlayer) {
|
|
13513
|
+
* playSound("exploderBegin");
|
|
13514
|
+
* explode(player, NUM_EXPLODER_EXPLOSIONS);
|
|
13515
|
+
* }
|
|
13516
|
+
*
|
|
13517
|
+
* function explode(player: EntityPlayer, numFramesLeft: int) {
|
|
13518
|
+
* Isaac.Explode(player, undefined, 1);
|
|
13519
|
+
* numFramesLeft -= 1;
|
|
13520
|
+
* if (numFramesLeft === 0) {
|
|
13521
|
+
* runNextFrame(() => {
|
|
13522
|
+
* explode(player, numFramesLeft);
|
|
13523
|
+
* });
|
|
13524
|
+
* }
|
|
13525
|
+
* }
|
|
13526
|
+
* ```
|
|
13527
|
+
*
|
|
13528
|
+
* Note that this function will not handle saving and quitting. If a player saving and quitting
|
|
13529
|
+
* before the deferred function fires would cause a bug in your mod, then you should handle
|
|
13530
|
+
* deferred functions manually using serializable data.
|
|
13531
|
+
*
|
|
13532
|
+
* In order to use this function, you must upgrade your mod with `ISCFeature.RUN_IN_N_FRAMES`.
|
|
13533
|
+
*
|
|
13534
|
+
* @param func The function to run.
|
|
13535
|
+
* @param cancelIfRoomChanges Optional. Whether or not to cancel running the function if a new
|
|
13536
|
+
* room is loaded in the interim. Default is false.
|
|
13537
|
+
*/
|
|
13538
|
+
runNextGameFrame(func: () => void, cancelIfRoomChanges?: boolean): void;
|
|
13539
|
+
/**
|
|
13540
|
+
* Supply a function to run on the next `POST_RENDER` callback.
|
|
13541
|
+
*
|
|
13542
|
+
* For a usage example, see the documentation for the `runNextGameFrame`, which is used in a
|
|
13543
|
+
* similar way.
|
|
13544
|
+
*
|
|
13545
|
+
* Note that this function will not handle saving and quitting.
|
|
13546
|
+
*
|
|
13547
|
+
* In order to use this function, you must upgrade your mod with `ISCFeature.RUN_IN_N_FRAMES`.
|
|
13548
|
+
*
|
|
13549
|
+
* @param func The function to run.
|
|
13550
|
+
* @param cancelIfRoomChanges Optional. Whether or not to cancel running the function if a new
|
|
13551
|
+
* room is loaded in the interim. Default is false.
|
|
13552
|
+
*/
|
|
13553
|
+
runNextRenderFrame(func: () => void, cancelIfRoomChanges?: boolean): void;
|
|
13554
|
+
/**
|
|
13555
|
+
* Supply a function to be repeatedly run on an interval of N game frames in the `POST_UPDATE`
|
|
13556
|
+
* callback. The function will continue to be fired until `false` is returned from the function.
|
|
13557
|
+
*
|
|
13558
|
+
* This is similar to the `setInterval` vanilla JavaScript function, except there is no
|
|
13559
|
+
* corresponding `clearInterval` function. (Instead, the return value from the supplied function
|
|
13560
|
+
* is used to stop the interval.)
|
|
13561
|
+
*
|
|
13562
|
+
* Note that this function will not handle saving and quitting. You must manually restart any
|
|
13563
|
+
* intervals if the player saves and quits in the middle of a run.
|
|
13564
|
+
*
|
|
13565
|
+
* In order to use this function, you must upgrade your mod with `ISCFeature.RUN_IN_N_FRAMES`.
|
|
13566
|
+
*
|
|
13567
|
+
* @param func The function to repeatedly run on an interval.
|
|
13568
|
+
* @param gameFrames The amount of game frames to wait between each run.
|
|
13569
|
+
* @param runImmediately Whether or not to execute the function right now before waiting for the
|
|
13570
|
+
* interval.
|
|
13571
|
+
* @param cancelIfRoomChanges Optional. Whether or not to cancel running the function if a new
|
|
13572
|
+
* room is loaded in the interim. Default is false.
|
|
13573
|
+
*/
|
|
13574
|
+
setIntervalGameFrames(func: () => boolean, gameFrames: int, runImmediately: boolean, cancelIfRoomChanges?: boolean): void;
|
|
13575
|
+
/**
|
|
13576
|
+
* Supply a function to be repeatedly run on an interval of N render frames in the `POST_RENDER`
|
|
13577
|
+
* callback. The function will continue to be fired until `false` is returned from the function.
|
|
13578
|
+
*
|
|
13579
|
+
* This is similar to the `setInterval` vanilla JavaScript function, except there is no
|
|
13580
|
+
* corresponding `clearInterval` function. (Instead, the return value from the supplied function
|
|
13581
|
+
* is used to stop the interval.)
|
|
13582
|
+
*
|
|
13583
|
+
* Note that this function will not handle saving and quitting. You must manually restart any
|
|
13584
|
+
* intervals if the player saves and quits in the middle of a run.
|
|
13585
|
+
*
|
|
13586
|
+
* In order to use this function, you must upgrade your mod with `ISCFeature.RUN_IN_N_FRAMES`.
|
|
13587
|
+
*
|
|
13588
|
+
* @param func The function to repeatedly run on an interval.
|
|
13589
|
+
* @param renderFrames The amount of game frames to wait between each run.
|
|
13590
|
+
* @param runImmediately Whether or not to execute the function right now before waiting for the
|
|
13591
|
+
* interval.
|
|
13592
|
+
* @param cancelIfRoomChanges Optional. Whether or not to cancel running the function if a new
|
|
13593
|
+
* room is loaded in the interim. Default is false.
|
|
13594
|
+
*/
|
|
13595
|
+
setIntervalRenderFrames(func: () => boolean, renderFrames: int, runImmediately: boolean, cancelIfRoomChanges?: boolean): void;
|
|
13596
|
+
}
|
|
13597
|
+
|
|
10625
13598
|
/**
|
|
10626
13599
|
* Run the suite of tests that prove that the "merge" function works properly.
|
|
10627
13600
|
*
|
|
@@ -10629,6 +13602,21 @@ export declare function runDeepCopyTests(): void;
|
|
|
10629
13602
|
*/
|
|
10630
13603
|
export declare function runMergeTests(): void;
|
|
10631
13604
|
|
|
13605
|
+
declare class RunNextRoom extends Feature {
|
|
13606
|
+
vConditionalFunc: () => boolean;
|
|
13607
|
+
private postNewRoomReordered;
|
|
13608
|
+
/**
|
|
13609
|
+
* Supply a function to run on the next `POST_NEW_ROOM` callback.
|
|
13610
|
+
*
|
|
13611
|
+
* Note that this function will not handle saving and quitting. If a player saving and quitting
|
|
13612
|
+
* before the deferred function fires would cause a bug in your mod, then you should handle
|
|
13613
|
+
* deferred functions manually using serializable data.
|
|
13614
|
+
*
|
|
13615
|
+
* In order to use this function, you must upgrade your mod with `ISCFeature.RUN_NEXT_ROOM`.
|
|
13616
|
+
*/
|
|
13617
|
+
runNextRoom(func: () => void): void;
|
|
13618
|
+
}
|
|
13619
|
+
|
|
10632
13620
|
/**
|
|
10633
13621
|
* This is the format of the object that you give to the save data manager. It will contains all of
|
|
10634
13622
|
* the variables for the particular mod feature.
|
|
@@ -10668,6 +13656,241 @@ export declare enum SaveDataKey {
|
|
|
10668
13656
|
ROOM = "room"
|
|
10669
13657
|
}
|
|
10670
13658
|
|
|
13659
|
+
declare class SaveDataManager extends Feature {
|
|
13660
|
+
/**
|
|
13661
|
+
* We store a local reference to the mod object so that we can access the corresponding methods
|
|
13662
|
+
* that read and write to the "save#.dat" file.
|
|
13663
|
+
*/
|
|
13664
|
+
private mod;
|
|
13665
|
+
/**
|
|
13666
|
+
* The save data map is indexed by subscriber name. We use Lua tables instead of TypeScriptToLua
|
|
13667
|
+
* Maps for the master map so that we can access the variables via the in-game console when
|
|
13668
|
+
* debugging. (TSTL Maps don't expose the map keys as normal keys.)
|
|
13669
|
+
*/
|
|
13670
|
+
private saveDataMap;
|
|
13671
|
+
/**
|
|
13672
|
+
* When mod feature data is initialized, we copy the initial values into a separate map so that we
|
|
13673
|
+
* can restore them later on.
|
|
13674
|
+
*/
|
|
13675
|
+
private saveDataDefaultsMap;
|
|
13676
|
+
/**
|
|
13677
|
+
* Each mod feature can optionally provide a function that can control whether or not the save
|
|
13678
|
+
* data is written to disk.
|
|
13679
|
+
*/
|
|
13680
|
+
private saveDataConditionalFuncMap;
|
|
13681
|
+
/**
|
|
13682
|
+
* We backup some save data keys on every new room for the purposes of restoring it when Glowing
|
|
13683
|
+
* Hour Glass is used.
|
|
13684
|
+
*
|
|
13685
|
+
* Note that the save data is backed up in serialized form so that we can use the `merge` function
|
|
13686
|
+
* to restore it.
|
|
13687
|
+
*/
|
|
13688
|
+
private saveDataGlowingHourGlassMap;
|
|
13689
|
+
/**
|
|
13690
|
+
* End-users can register their classes with the save data manager for proper serialization when
|
|
13691
|
+
* contained in nested maps, sets, and arrays.
|
|
13692
|
+
*/
|
|
13693
|
+
private classConstructors;
|
|
13694
|
+
private loadedDataOnThisRun;
|
|
13695
|
+
private restoreGlowingHourGlassDataOnNextRoom;
|
|
13696
|
+
private postUseItemGlowingHourGlass;
|
|
13697
|
+
private postPlayerInit;
|
|
13698
|
+
private preGameExit;
|
|
13699
|
+
private postNewLevel;
|
|
13700
|
+
private postNewRoomEarly;
|
|
13701
|
+
/**
|
|
13702
|
+
* This is the entry point to the save data manager, a system which provides two major features:
|
|
13703
|
+
*
|
|
13704
|
+
* 1. Automatic resetting of variables on a new run, on a new level, or on a new room (as
|
|
13705
|
+
* desired).
|
|
13706
|
+
* 2. Automatic saving and loading of all tracked data to the "save#.dat" file.
|
|
13707
|
+
*
|
|
13708
|
+
* You feed this function with an object containing your variables, and then it will automatically
|
|
13709
|
+
* manage them for you. (See below for an example.)
|
|
13710
|
+
*
|
|
13711
|
+
* In order to use this function, you must upgrade your mod with `ISCFeature.SAVE_DATA_MANAGER`.
|
|
13712
|
+
* (Upgrade your mod before registering any of your own callbacks so that the save data manager
|
|
13713
|
+
* will run before any of your code does.)
|
|
13714
|
+
*
|
|
13715
|
+
* The save data manager is meant to be called once for each feature of your mod. In other words,
|
|
13716
|
+
* you should not put all of the data for your mod on the same object. Instead, scope your
|
|
13717
|
+
* variables locally to a single file that contains a mod feature, and then call this function to
|
|
13718
|
+
* register them. For example:
|
|
13719
|
+
*
|
|
13720
|
+
* ```ts
|
|
13721
|
+
* // In file: feature1.ts
|
|
13722
|
+
* import { saveDataManager } from "isaacscript-common";
|
|
13723
|
+
*
|
|
13724
|
+
* // Declare local variables for this file or feature.
|
|
13725
|
+
* const v = {
|
|
13726
|
+
* // These variables are never reset; manage them yourself at will.
|
|
13727
|
+
* persistent: {
|
|
13728
|
+
* foo1: 0,
|
|
13729
|
+
* },
|
|
13730
|
+
*
|
|
13731
|
+
* // These variables are reset at the beginning of every run.
|
|
13732
|
+
* run: {
|
|
13733
|
+
* foo2: 0,
|
|
13734
|
+
* },
|
|
13735
|
+
*
|
|
13736
|
+
* // These variables are reset at the beginning of every level.
|
|
13737
|
+
* level: {
|
|
13738
|
+
* foo3: 0,
|
|
13739
|
+
* },
|
|
13740
|
+
*
|
|
13741
|
+
* // These variables are reset at the beginning of every room.
|
|
13742
|
+
* room: {
|
|
13743
|
+
* foo4: 0,
|
|
13744
|
+
* },
|
|
13745
|
+
* };
|
|
13746
|
+
* // Every child object is optional; only create the ones that you need.
|
|
13747
|
+
*
|
|
13748
|
+
* // Register the variables with the save data manager. (We need to provide a string key that
|
|
13749
|
+
* // matches the name of this file.)
|
|
13750
|
+
* function feature1Init() {
|
|
13751
|
+
* saveDataManager("feature1", v);
|
|
13752
|
+
* }
|
|
13753
|
+
*
|
|
13754
|
+
* // Elsewhere in the file, use your variables.
|
|
13755
|
+
* function feature1Function() {
|
|
13756
|
+
* if (v.run.foo1 > 0) {
|
|
13757
|
+
* // Insert code here.
|
|
13758
|
+
* }
|
|
13759
|
+
* }
|
|
13760
|
+
* ```
|
|
13761
|
+
*
|
|
13762
|
+
* - Save data is loaded from disk in the `POST_PLAYER_INIT` callback (i.e. the first callback
|
|
13763
|
+
* that can possibly run).
|
|
13764
|
+
* - Save data is recorded to disk in the `PRE_GAME_EXIT` callback.
|
|
13765
|
+
*
|
|
13766
|
+
* You can use many different variable types on your variable object, but not everything is
|
|
13767
|
+
* supported. For the specific things that are supported, see the documentation for the `deepCopy`
|
|
13768
|
+
* helper function.
|
|
13769
|
+
*
|
|
13770
|
+
* If you want the save data manager to load data before the `POST_PLAYER_INIT` callback (i.e. in
|
|
13771
|
+
* the main menu), then you should explicitly call the `saveDataManagerLoad` function. (The save
|
|
13772
|
+
* data manager cannot do this on its own because it cannot know when your mod features are
|
|
13773
|
+
* finished initializing.)
|
|
13774
|
+
*
|
|
13775
|
+
* Some features may have variables that need to be automatically reset per run/level, but not
|
|
13776
|
+
* saved to disk on game exit. (For example, if they contain functions or other non-serializable
|
|
13777
|
+
* data.) For these cases, set the second argument to `false`.
|
|
13778
|
+
*
|
|
13779
|
+
* Note that when the player uses Glowing Hourglass, the save data manager will automatically
|
|
13780
|
+
* restore any variables on a "run" or "level" object with a backup that was created when the room
|
|
13781
|
+
* was entered. Thus, you should not have to explicitly program support for Glowing Hourglass into
|
|
13782
|
+
* your mod features that use the save data manager. If this is undesired for your specific
|
|
13783
|
+
* use-case, then add a key of `__ignoreGlowingHourGlass: true` to your "run" or "level" object.
|
|
13784
|
+
*
|
|
13785
|
+
* @param key The name of the file or feature that is submitting data to be managed by the save
|
|
13786
|
+
* data manager. The save data manager will throw an error if the key is already
|
|
13787
|
+
* registered. Note that you can also pass a TSTL class instead of a string and the
|
|
13788
|
+
* save data manager will use the name of the class as the key.
|
|
13789
|
+
* @param v An object that corresponds to the `SaveData` interface. The object is conventionally
|
|
13790
|
+
* called "v" for brevity. ("v" is short for "local variables").
|
|
13791
|
+
* @param conditionalFunc Optional. A function to run to check if this save data should be written
|
|
13792
|
+
* to disk. Default is `() => true`, meaning that this save data will
|
|
13793
|
+
* always be written to disk. Use a conditional function for the situations
|
|
13794
|
+
* when the local variables are for a feature that the end-user can
|
|
13795
|
+
* disable. (If the feature is disabled, then there would be no point in
|
|
13796
|
+
* writing any of the variables to the "save#.dat" file.) You can also
|
|
13797
|
+
* specify `false` to this argument in order to completely disable saving
|
|
13798
|
+
* data. (Specifying `false` will allow you to use non-serializable objects
|
|
13799
|
+
* in your save data, such as `EntityPtr`.
|
|
13800
|
+
*/
|
|
13801
|
+
saveDataManager<Persistent, Run, Level>(key: string | object, v: SaveData<Persistent, Run, Level>, conditionalFunc?: () => boolean): void;
|
|
13802
|
+
saveDataManager(key: string | object, v: SaveData, conditionalFunc: false): void;
|
|
13803
|
+
/**
|
|
13804
|
+
* Recursively traverses an object, collecting all of the class constructors that it encounters.
|
|
13805
|
+
*/
|
|
13806
|
+
private storeClassConstructorsFromObject;
|
|
13807
|
+
/**
|
|
13808
|
+
* The save data manager will automatically load variables from disk at the appropriate times
|
|
13809
|
+
* (i.e. when a new run is started). Use this function to explicitly force the save data manager
|
|
13810
|
+
* to load all of its variables from disk immediately.
|
|
13811
|
+
*
|
|
13812
|
+
* Obviously, doing this will overwrite the current data, so using this function can potentially
|
|
13813
|
+
* result in lost state.
|
|
13814
|
+
*
|
|
13815
|
+
* In order to use this function, you must upgrade your mod with `ISCFeature.SAVE_DATA_MANAGER`.
|
|
13816
|
+
*/
|
|
13817
|
+
saveDataManagerLoad(): void;
|
|
13818
|
+
/**
|
|
13819
|
+
* The save data manager will automatically save variables to disk at the appropriate times (i.e.
|
|
13820
|
+
* when the run is exited). Use this function to explicitly force the save data manager to write
|
|
13821
|
+
* all of its variables to disk immediately.
|
|
13822
|
+
*
|
|
13823
|
+
* In order to use this function, you must upgrade your mod with `ISCFeature.SAVE_DATA_MANAGER`.
|
|
13824
|
+
*/
|
|
13825
|
+
saveDataManagerSave(): void;
|
|
13826
|
+
/**
|
|
13827
|
+
* Sets the global variable of "g" equal to all of the save data variables for this mod.
|
|
13828
|
+
*
|
|
13829
|
+
* This can make debugging easier, as you can access the variables from the game's debug console.
|
|
13830
|
+
* e.g. `l print(g.feature1.run.foo)`
|
|
13831
|
+
*
|
|
13832
|
+
* In order to use this function, you must upgrade your mod with `ISCFeature.SAVE_DATA_MANAGER`.
|
|
13833
|
+
*/
|
|
13834
|
+
saveDataManagerSetGlobal(): void;
|
|
13835
|
+
/**
|
|
13836
|
+
* By default, the save data manager will not be able to serialize/deserialize classes that are
|
|
13837
|
+
* nested inside of maps, sets, and arrays, because it does not have access to the corresponding
|
|
13838
|
+
* class constructor. If you want to use nested classes in this way, then use this function to
|
|
13839
|
+
* register the class constructor with the save data manager. Once registered, the save data
|
|
13840
|
+
* manager will automatically run the constructor when deserializing (in addition to copying over
|
|
13841
|
+
* the data fields).
|
|
13842
|
+
*
|
|
13843
|
+
* This function is variadic, which means you can pass as many classes as you want to register.
|
|
13844
|
+
*
|
|
13845
|
+
* In order to use this function, you must upgrade your mod with `ISCFeature.SAVE_DATA_MANAGER`.
|
|
13846
|
+
*/
|
|
13847
|
+
saveDataManagerRegisterClass(...tstlClasses: AnyClass[]): void;
|
|
13848
|
+
/**
|
|
13849
|
+
* Removes a previously registered key from the save data manager. This is the opposite of the
|
|
13850
|
+
* "saveDataManager" method.
|
|
13851
|
+
*
|
|
13852
|
+
* In order to use this function, you must upgrade your mod with `ISCFeature.SAVE_DATA_MANAGER`.
|
|
13853
|
+
*/
|
|
13854
|
+
saveDataManagerRemove(key: string): void;
|
|
13855
|
+
/**
|
|
13856
|
+
* The save data manager will automatically reset variables at the appropriate times, like when a
|
|
13857
|
+
* player enters a new room. Use this function to explicitly force the save data manager to reset
|
|
13858
|
+
* a specific variable group.
|
|
13859
|
+
*
|
|
13860
|
+
* For example:
|
|
13861
|
+
*
|
|
13862
|
+
* ```ts
|
|
13863
|
+
* const v = {
|
|
13864
|
+
* room: {
|
|
13865
|
+
* foo: 123,
|
|
13866
|
+
* },
|
|
13867
|
+
* };
|
|
13868
|
+
*
|
|
13869
|
+
* mod.saveDataManager("file1", v);
|
|
13870
|
+
*
|
|
13871
|
+
* // Then, later on, to explicit reset all of the "room" variables:
|
|
13872
|
+
* mod.saveDataManagerReset("file1", "room");
|
|
13873
|
+
* ```
|
|
13874
|
+
*
|
|
13875
|
+
* In order to use this function, you must upgrade your mod with `ISCFeature.SAVE_DATA_MANAGER`.
|
|
13876
|
+
*/
|
|
13877
|
+
saveDataManagerReset(key: string, childObjectKey: SaveDataKey): void;
|
|
13878
|
+
/**
|
|
13879
|
+
* Helper function to check to see if the game is in the menu, as far as the save data manager is
|
|
13880
|
+
* concerned. This function will return true when the game is first opened until the
|
|
13881
|
+
* `POST_PLAYER_INIT` callback fires. It will also return true in between the `PRE_GAME_EXIT`
|
|
13882
|
+
* callback firing and the `POST_PLAYER_INIT` callback firing.
|
|
13883
|
+
*
|
|
13884
|
+
* This function is useful because the `POST_ENTITY_REMOVE` callback fires after the
|
|
13885
|
+
* `PRE_GAME_EXIT` callback. Thus, if save data needs to be updated from the `POST_ENTITY_REMOVE`
|
|
13886
|
+
* callback and the player is in the process of saving and quitting, the feature will have to
|
|
13887
|
+
* explicitly call the `saveDataManagerSave` function.
|
|
13888
|
+
*
|
|
13889
|
+
* In order to use this function, you must upgrade your mod with `ISCFeature.SAVE_DATA_MANAGER`.
|
|
13890
|
+
*/
|
|
13891
|
+
saveDataManagerInMenu(): boolean;
|
|
13892
|
+
}
|
|
13893
|
+
|
|
10671
13894
|
export declare const SECOND_IN_MILLISECONDS = 1000;
|
|
10672
13895
|
|
|
10673
13896
|
/**
|
|
@@ -11133,6 +14356,41 @@ export declare const sfxManager: SFXManager;
|
|
|
11133
14356
|
|
|
11134
14357
|
export declare const SHOOTING_ACTIONS_SET: ReadonlySet<ButtonAction>;
|
|
11135
14358
|
|
|
14359
|
+
declare function shouldFireCollectibleType(fireArgs: [player: EntityPlayer, collectibleType: CollectibleType], optionalArgs: [collectibleType?: CollectibleType]): boolean;
|
|
14360
|
+
|
|
14361
|
+
declare function shouldFireGridEntity(fireArgs: [gridEntity: GridEntity] | [gridEntity: GridEntity, oldState: int, newState: int], optionalArgs: [gridEntityType?: GridEntityType, variant?: int]): boolean;
|
|
14362
|
+
|
|
14363
|
+
declare function shouldFireGridEntityCustom(fireArgs: [gridEntity: GridEntity, gridEntityTypeCustom: GridEntityType] | [
|
|
14364
|
+
gridEntity: GridEntity,
|
|
14365
|
+
gridEntityTypeCustom: GridEntityType,
|
|
14366
|
+
oldState: int,
|
|
14367
|
+
newState: int
|
|
14368
|
+
], optionalArgs: [gridEntityTypeCustom?: GridEntityType]): boolean;
|
|
14369
|
+
|
|
14370
|
+
declare function shouldFireItemPickup(fireArgs: [player: EntityPlayer, pickingUpItem: PickingUpItem], optionalArgs: [itemType?: ItemType, subType?: int]): boolean;
|
|
14371
|
+
|
|
14372
|
+
declare function shouldFirePlayer(fireArgs: [player: EntityPlayer] | [player: EntityPlayer, numSacrifices: int] | [player: EntityPlayer, collectible: EntityPickupCollectible] | [player: EntityPlayer, oldCharacter: PlayerType, newCharacter: PlayerType] | [
|
|
14373
|
+
player: EntityPlayer,
|
|
14374
|
+
healthType: HealthType,
|
|
14375
|
+
difference: int,
|
|
14376
|
+
oldValue: int,
|
|
14377
|
+
newValue: int
|
|
14378
|
+
] | [
|
|
14379
|
+
player: EntityPlayer,
|
|
14380
|
+
amount: float,
|
|
14381
|
+
damageFlags: BitFlags<DamageFlag>,
|
|
14382
|
+
source: EntityRef,
|
|
14383
|
+
countdownFrames: int
|
|
14384
|
+
] | [
|
|
14385
|
+
player: EntityPlayer,
|
|
14386
|
+
statType: StatType,
|
|
14387
|
+
difference: int,
|
|
14388
|
+
oldValue: PossibleStatType,
|
|
14389
|
+
newValue: PossibleStatType
|
|
14390
|
+
], optionalArgs: [playerVariant?: PlayerVariant, character?: PlayerType]): boolean;
|
|
14391
|
+
|
|
14392
|
+
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;
|
|
14393
|
+
|
|
11136
14394
|
/**
|
|
11137
14395
|
* Shallow copies and shuffles the array using the Fisher-Yates algorithm. Returns the copied array.
|
|
11138
14396
|
*
|
|
@@ -11158,6 +14416,28 @@ export declare function shuffleArrayInPlace<T>(array: T[], seedOrRNG?: Seed | RN
|
|
|
11158
14416
|
/** @returns 1 if n is positive, -1 if n is negative, or 0 if n is 0. */
|
|
11159
14417
|
export declare function sign(n: number): int;
|
|
11160
14418
|
|
|
14419
|
+
declare class SlotDestroyedDetection extends Feature {
|
|
14420
|
+
v: {
|
|
14421
|
+
room: {
|
|
14422
|
+
destroyedSlotSet: Set<PtrHash>;
|
|
14423
|
+
};
|
|
14424
|
+
};
|
|
14425
|
+
private postSlotDestroyed;
|
|
14426
|
+
private roomHistory;
|
|
14427
|
+
constructor(postSlotDestroyed: PostSlotDestroyed, roomHistory: RoomHistory);
|
|
14428
|
+
private postEntityRemoveSlot;
|
|
14429
|
+
private postEntityRemoveSlotMachine;
|
|
14430
|
+
private postEntityRemoveBeggar;
|
|
14431
|
+
private postSlotUpdate;
|
|
14432
|
+
/**
|
|
14433
|
+
* Slots normally have an entity collision class of `EntityCollisionClass.ALL` (4) and a grid
|
|
14434
|
+
* collision class of `EntityGridCollisionClass.NONE` (0). When they are destroyed with a bomb,
|
|
14435
|
+
* the entity collision class stays the same, but the grid collision class switches to
|
|
14436
|
+
* `EntityGridCollisionClass.GROUND` (5).
|
|
14437
|
+
*/
|
|
14438
|
+
private checkDestroyedFromCollisionClass;
|
|
14439
|
+
}
|
|
14440
|
+
|
|
11161
14441
|
/** This is used in the `POST_SLOT_DESTROYED` custom callback. */
|
|
11162
14442
|
export declare enum SlotDestructionType {
|
|
11163
14443
|
/**
|
|
@@ -11177,6 +14457,34 @@ export declare enum SlotDestructionType {
|
|
|
11177
14457
|
COLLECTIBLE_PAYOUT = 1
|
|
11178
14458
|
}
|
|
11179
14459
|
|
|
14460
|
+
declare class SlotRenderDetection extends Feature {
|
|
14461
|
+
v: {
|
|
14462
|
+
room: {
|
|
14463
|
+
slotAnimations: DefaultMap<PtrHash, string, [slot: Entity]>;
|
|
14464
|
+
brokenSlots: Set<PtrHash>;
|
|
14465
|
+
};
|
|
14466
|
+
};
|
|
14467
|
+
private postSlotRender;
|
|
14468
|
+
private postSlotAnimationChanged;
|
|
14469
|
+
constructor(postSlotRender: PostSlotRender, postSlotAnimationChanged: PostSlotAnimationChanged);
|
|
14470
|
+
private postRender;
|
|
14471
|
+
private checkSlotAnimationChanged;
|
|
14472
|
+
}
|
|
14473
|
+
|
|
14474
|
+
declare class SlotUpdateDetection extends Feature {
|
|
14475
|
+
v: {
|
|
14476
|
+
room: {
|
|
14477
|
+
initializedSlots: Set<PtrHash>;
|
|
14478
|
+
};
|
|
14479
|
+
};
|
|
14480
|
+
private postSlotInit;
|
|
14481
|
+
private postSlotUpdate;
|
|
14482
|
+
constructor(postSlotInit: PostSlotInit, postSlotUpdate: PostSlotUpdate);
|
|
14483
|
+
private postUpdate;
|
|
14484
|
+
private postNewRoomReordered;
|
|
14485
|
+
private checkNewEntity;
|
|
14486
|
+
}
|
|
14487
|
+
|
|
11180
14488
|
/**
|
|
11181
14489
|
* Helper function to smelt a trinket. Before smelting, this function will automatically remove the
|
|
11182
14490
|
* trinkets that the player is holding, if any, and then give them back after the new trinket is
|
|
@@ -11335,6 +14643,54 @@ export declare function spawnCoin(coinSubType: CoinSubType, positionOrGridIndex:
|
|
|
11335
14643
|
*/
|
|
11336
14644
|
export declare function spawnCoinWithSeed(coinSubType: CoinSubType, positionOrGridIndex: Vector | int, seedOrRNG: Seed | RNG, velocity?: Vector, spawner?: Entity | undefined): EntityPickupCoin;
|
|
11337
14645
|
|
|
14646
|
+
declare class SpawnCollectible extends Feature {
|
|
14647
|
+
private preventCollectibleRotation;
|
|
14648
|
+
/**
|
|
14649
|
+
* Helper function to spawn a collectible.
|
|
14650
|
+
*
|
|
14651
|
+
* Use this instead of the `Game.Spawn` method because it handles the cases of Tainted Keeper
|
|
14652
|
+
* collectibles costing coins and preventing quest items from being rotated by Tainted Isaac's
|
|
14653
|
+
* rotation mechanic.
|
|
14654
|
+
*
|
|
14655
|
+
* If you do not need to handle quest items being rotated (i.e. the collectible is guaranteed not
|
|
14656
|
+
* to be a quest item), then you can use the `spawnCollectibleUnsafe` helper function instead
|
|
14657
|
+
* (which does not require an upgraded mod).
|
|
14658
|
+
*
|
|
14659
|
+
* In order to use this function, you must upgrade your mod with `ISCFeature.SPAWN_COLLECTIBLE`.
|
|
14660
|
+
*
|
|
14661
|
+
* @param collectibleType The collectible type to spawn.
|
|
14662
|
+
* @param positionOrGridIndex The position or grid index to spawn the collectible at.
|
|
14663
|
+
* @param seedOrRNG Optional. The `Seed` or `RNG` object to use. If an `RNG` object is provided,
|
|
14664
|
+
* the `RNG.Next` method will be called. Default is `getRandomSeed()`.
|
|
14665
|
+
* @param options Optional. Set to true to make the collectible a "There's Options" style
|
|
14666
|
+
* collectible. Default is false.
|
|
14667
|
+
* @param forceFreeItem Optional. Set to true to disable the logic that gives the item a price for
|
|
14668
|
+
* Tainted Keeper. Default is false.
|
|
14669
|
+
* @param spawner Optional.
|
|
14670
|
+
*/
|
|
14671
|
+
spawnCollectible(collectibleType: CollectibleType, positionOrGridIndex: Vector | int, seedOrRNG?: Seed | RNG, options?: boolean, forceFreeItem?: boolean, spawner?: Entity): EntityPickupCollectible;
|
|
14672
|
+
/**
|
|
14673
|
+
* Helper function to spawn a collectible from a specific item pool.
|
|
14674
|
+
*
|
|
14675
|
+
* Use this instead of the `Game.Spawn` method because it handles the cases of Tainted Keeper
|
|
14676
|
+
* collectibles costing coins and preventing quest items from being rotated by Tainted Isaac's
|
|
14677
|
+
* rotation mechanic.
|
|
14678
|
+
*
|
|
14679
|
+
* In order to use this function, you must upgrade your mod with `ISCFeature.SPAWN_COLLECTIBLE`.
|
|
14680
|
+
*
|
|
14681
|
+
* @param itemPoolType The item pool to draw the collectible type from.
|
|
14682
|
+
* @param positionOrGridIndex The position or grid index to spawn the collectible at.
|
|
14683
|
+
* @param seedOrRNG Optional. The `Seed` or `RNG` object to use. If an `RNG` object is provided,
|
|
14684
|
+
* the `RNG.Next` method will be called. Default is `getRandomSeed()`.
|
|
14685
|
+
* @param options Optional. Set to true to make the collectible a "There's Options" style
|
|
14686
|
+
* collectible. Default is false.
|
|
14687
|
+
* @param forceFreeItem Optional. Set to true to disable the logic that gives the item a price for
|
|
14688
|
+
* Tainted Keeper. Default is false.
|
|
14689
|
+
* @param spawner Optional.
|
|
14690
|
+
*/
|
|
14691
|
+
spawnCollectibleFromPool(itemPoolType: ItemPoolType, positionOrGridIndex: Vector | int, seedOrRNG?: Seed | RNG, options?: boolean, forceFreeItem?: boolean, spawner?: Entity): EntityPickupCollectible;
|
|
14692
|
+
}
|
|
14693
|
+
|
|
11338
14694
|
/**
|
|
11339
14695
|
* Helper function to spawn a collectible.
|
|
11340
14696
|
*
|
|
@@ -11526,6 +14882,103 @@ export declare function spawnProjectileWithSeed(projectileVariant: ProjectileVar
|
|
|
11526
14882
|
/** Helper function to spawn a `GridEntityType.ROCK` (2). */
|
|
11527
14883
|
export declare function spawnRock(gridIndexOrPosition: int | Vector): GridEntityRock | undefined;
|
|
11528
14884
|
|
|
14885
|
+
declare class SpawnRockAltRewards extends Feature {
|
|
14886
|
+
private itemPoolDetection;
|
|
14887
|
+
/**
|
|
14888
|
+
* Helper function for emulating what happens when a vanilla `GridEntityType.ROCK_ALT` grid entity
|
|
14889
|
+
* breaks.
|
|
14890
|
+
*
|
|
14891
|
+
* Most of the time, this function will do nothing, similar to how most of the time, when an
|
|
14892
|
+
* individual urn is destroyed, nothing will spawn.
|
|
14893
|
+
*
|
|
14894
|
+
* Note that in vanilla, trinkets will not spawn if they have already been removed from the
|
|
14895
|
+
* trinket pool. This function cannot replicate that behavior because there is no way to check to
|
|
14896
|
+
* see if a trinket is still in the pool. Thus, it will always have a chance to spawn the
|
|
14897
|
+
* respective trinket
|
|
14898
|
+
* (e.g. Swallowed Penny from urns).
|
|
14899
|
+
*
|
|
14900
|
+
* When filled buckets are destroyed, 6 projectiles will always spawn in a random pattern (in
|
|
14901
|
+
* addition to any other rewards that are spawned). This function does not account for this, so if
|
|
14902
|
+
* you want to specifically emulate destroying a filled bucket, you have to account for the
|
|
14903
|
+
* projectiles yourself.
|
|
14904
|
+
*
|
|
14905
|
+
* The logic in this function is based on the rewards listed on the wiki:
|
|
14906
|
+
* https://bindingofisaacrebirth.fandom.com/wiki/Rocks
|
|
14907
|
+
*
|
|
14908
|
+
* In order to use this function, you must upgrade your mod with
|
|
14909
|
+
* `ISCFeature.SPAWN_ALT_ROCK_REWARDS`.
|
|
14910
|
+
*
|
|
14911
|
+
* @param positionOrGridIndex The position or grid index to spawn the reward.
|
|
14912
|
+
* @param rockAltType The type of reward to spawn. For example, `RockAltType.URN` will have a
|
|
14913
|
+
* chance at spawning coins and spiders.
|
|
14914
|
+
* @param seedOrRNG Optional. The `Seed` or `RNG` object to use. If an `RNG` object is provided,
|
|
14915
|
+
* the `RNG.Next` method will be called. Default is `getRandomSeed()`. Normally,
|
|
14916
|
+
* you should pass the `InitSeed` of the grid entity that was broken.
|
|
14917
|
+
* @returns Whether or not this function spawned something.
|
|
14918
|
+
*/
|
|
14919
|
+
spawnRockAltReward(positionOrGridIndex: Vector | int, rockAltType: RockAltType, seedOrRNG?: Seed | RNG): boolean;
|
|
14920
|
+
/**
|
|
14921
|
+
* Helper function for emulating what happens when a vanilla `GridEntityType.ROCK_ALT` grid entity
|
|
14922
|
+
* breaks of `RockAltType.URN`.
|
|
14923
|
+
*
|
|
14924
|
+
* For more information, see the documentation for the `spawnRockAltReward` function.
|
|
14925
|
+
*
|
|
14926
|
+
* In order to use this function, you must upgrade your mod with
|
|
14927
|
+
* `ISCFeature.SPAWN_ALT_ROCK_REWARDS`.
|
|
14928
|
+
*/
|
|
14929
|
+
spawnRockAltRewardUrn(position: Vector, rng: RNG): boolean;
|
|
14930
|
+
/**
|
|
14931
|
+
* Helper function for emulating what happens when a vanilla `GridEntityType.ROCK_ALT` grid entity
|
|
14932
|
+
* breaks of `RockAltType.MUSHROOM`.
|
|
14933
|
+
*
|
|
14934
|
+
* For more information, see the documentation for the `spawnRockAltReward` function.
|
|
14935
|
+
*
|
|
14936
|
+
* In order to use this function, you must upgrade your mod with
|
|
14937
|
+
* `ISCFeature.SPAWN_ALT_ROCK_REWARDS`.
|
|
14938
|
+
*/
|
|
14939
|
+
spawnRockAltRewardMushroom(position: Vector, rng: RNG): boolean;
|
|
14940
|
+
/**
|
|
14941
|
+
* Helper function for emulating what happens when a vanilla `GridEntityType.ROCK_ALT` grid entity
|
|
14942
|
+
* breaks of `RockAltType.SKULL`.
|
|
14943
|
+
*
|
|
14944
|
+
* For more information, see the documentation for the `spawnRockAltReward` function.
|
|
14945
|
+
*
|
|
14946
|
+
* In order to use this function, you must upgrade your mod with
|
|
14947
|
+
* `ISCFeature.SPAWN_ALT_ROCK_REWARDS`.
|
|
14948
|
+
*/
|
|
14949
|
+
spawnRockAltRewardSkull(position: Vector, rng: RNG): boolean;
|
|
14950
|
+
/**
|
|
14951
|
+
* Helper function for emulating what happens when a vanilla `GridEntityType.ROCK_ALT` grid entity
|
|
14952
|
+
* breaks of `RockAltType.POLYP`.
|
|
14953
|
+
*
|
|
14954
|
+
* For more information, see the documentation for the `spawnRockAltReward` function.
|
|
14955
|
+
*
|
|
14956
|
+
* In order to use this function, you must upgrade your mod with
|
|
14957
|
+
* `ISCFeature.SPAWN_ALT_ROCK_REWARDS`.
|
|
14958
|
+
*/
|
|
14959
|
+
spawnRockAltRewardPolyp(position: Vector, rng: RNG): boolean;
|
|
14960
|
+
/**
|
|
14961
|
+
* Helper function for emulating what happens when a vanilla `GridEntityType.ROCK_ALT` grid entity
|
|
14962
|
+
* breaks of `RockAltType.BUCKET_DOWNPOUR`.
|
|
14963
|
+
*
|
|
14964
|
+
* For more information, see the documentation for the `spawnRockAltReward` function.
|
|
14965
|
+
*
|
|
14966
|
+
* In order to use this function, you must upgrade your mod with
|
|
14967
|
+
* `ISCFeature.SPAWN_ALT_ROCK_REWARDS`.
|
|
14968
|
+
*/
|
|
14969
|
+
spawnRockAltRewardBucketDownpour(position: Vector, rng: RNG): boolean;
|
|
14970
|
+
/**
|
|
14971
|
+
* Helper function for emulating what happens when a vanilla `GridEntityType.ROCK_ALT` grid entity
|
|
14972
|
+
* breaks of `RockAltType.BUCKET_DROSS`.
|
|
14973
|
+
*
|
|
14974
|
+
* For more information, see the documentation for the `spawnRockAltReward` function.
|
|
14975
|
+
*
|
|
14976
|
+
* In order to use this function, you must upgrade your mod with
|
|
14977
|
+
* `ISCFeature.SPAWN_ALT_ROCK_REWARDS`.
|
|
14978
|
+
*/
|
|
14979
|
+
spawnRockAltRewardBucketDross(position: Vector, rng: RNG): boolean;
|
|
14980
|
+
}
|
|
14981
|
+
|
|
11529
14982
|
/** Helper function to spawn a `GridEntityType.ROCK` (2) with a specific variant. */
|
|
11530
14983
|
export declare function spawnRockWithVariant(rockVariant: RockVariant, gridIndexOrPosition: int | Vector): GridEntityRock | undefined;
|
|
11531
14984
|
|
|
@@ -11606,6 +15059,55 @@ export declare function spawnWithSeed(entityType: EntityType, variant: int, subT
|
|
|
11606
15059
|
*/
|
|
11607
15060
|
export declare function spriteEquals(sprite1: Sprite, sprite2: Sprite, layerID: int, xStart: int, xFinish: int, xIncrement: int, yStart: int, yFinish: int, yIncrement: int): boolean;
|
|
11608
15061
|
|
|
15062
|
+
declare class StageHistory extends Feature {
|
|
15063
|
+
private postNewLevelReordered;
|
|
15064
|
+
/**
|
|
15065
|
+
* Helper function to get the stage type that a trapdoor or heaven door would take the player to,
|
|
15066
|
+
* based on the current stage, room, and game state flags.
|
|
15067
|
+
*
|
|
15068
|
+
* This function accounts for the previous floors that a player has visited thus far on the run so
|
|
15069
|
+
* that the next stage type can be properly calculated on The Ascent (which makes it unlike the
|
|
15070
|
+
* `getNextStageType` function).
|
|
15071
|
+
*
|
|
15072
|
+
* In order to use this function, you must upgrade your mod with `ISCFeature.STAGE_HISTORY`.
|
|
15073
|
+
*
|
|
15074
|
+
* @param upwards Whether or not the player should go up to Cathedral in the case of being on Womb
|
|
15075
|
+
* 2. Default is false.
|
|
15076
|
+
*/
|
|
15077
|
+
getNextStageTypeWithHistory(upwards?: boolean): StageType;
|
|
15078
|
+
/**
|
|
15079
|
+
* Helper function to get the stage that a trapdoor or heaven door would take the player to, based
|
|
15080
|
+
* on the current stage, room, and game state flags.
|
|
15081
|
+
*
|
|
15082
|
+
* This function accounts for the previous floors that a player has visited thus far on the run so
|
|
15083
|
+
* that the next stage can be properly calculated on The Ascent (which makes it unlike the
|
|
15084
|
+
* `getNextStage` function).
|
|
15085
|
+
*
|
|
15086
|
+
* In order to use this function, you must upgrade your mod with `ISCFeature.STAGE_HISTORY`.
|
|
15087
|
+
*/
|
|
15088
|
+
getNextStageWithHistory(): LevelStage;
|
|
15089
|
+
/**
|
|
15090
|
+
* Helper function to get all of the stages that a player has visited thus far on this run.
|
|
15091
|
+
*
|
|
15092
|
+
* In order to use this function, you must upgrade your mod with `ISCFeature.STAGE_HISTORY`.
|
|
15093
|
+
*/
|
|
15094
|
+
getStageHistory(): ReadonlyArray<[
|
|
15095
|
+
stage: LevelStage,
|
|
15096
|
+
stageType: StageType
|
|
15097
|
+
]>;
|
|
15098
|
+
/**
|
|
15099
|
+
* Helper function to check if a player has previous visited a particular stage (or stage + stage
|
|
15100
|
+
* type combination) on this run.
|
|
15101
|
+
*
|
|
15102
|
+
* In order to use this function, you must upgrade your mod with `ISCFeature.STAGE_HISTORY`.
|
|
15103
|
+
*
|
|
15104
|
+
* @param stage The stage to check for.
|
|
15105
|
+
* @param stageType Optional. If provided, will check for a specific stage and stage type
|
|
15106
|
+
* combination.
|
|
15107
|
+
*/
|
|
15108
|
+
hasVisitedStage(stage: LevelStage, stageType?: StageType): boolean;
|
|
15109
|
+
}
|
|
15110
|
+
|
|
11609
15111
|
/**
|
|
11610
15112
|
* Helper function to convert a numerical `StageType` into the letter suffix supplied to the "stage"
|
|
11611
15113
|
* console command. For example, `StageType.REPENTANCE` is the stage type for Downpour, and the
|
|
@@ -11614,6 +15116,19 @@ export declare function spriteEquals(sprite1: Sprite, sprite2: Sprite, layerID:
|
|
|
11614
15116
|
*/
|
|
11615
15117
|
export declare function stageTypeToLetter(stageType: StageType): string;
|
|
11616
15118
|
|
|
15119
|
+
declare class StartAmbush extends Feature {
|
|
15120
|
+
private runInNFrames;
|
|
15121
|
+
/**
|
|
15122
|
+
* Helper function to start a Challenge Room or the Boss Rush.
|
|
15123
|
+
*
|
|
15124
|
+
* Specifically, this is performed by spawning a sack on top of the player, waiting a game frame,
|
|
15125
|
+
* and then removing the sack and the pickups that the sack dropped.
|
|
15126
|
+
*
|
|
15127
|
+
* In order to use this function, you must upgrade your mod with `ISCFeature.START_AMBUSH`.
|
|
15128
|
+
*/
|
|
15129
|
+
startAmbush(): void;
|
|
15130
|
+
}
|
|
15131
|
+
|
|
11617
15132
|
/** Helper type to ensure that the given string starts with an lowercase letter. */
|
|
11618
15133
|
export declare type StartsWithLowercase<S> = S extends string ? Extract<S, Uncapitalize<S>> : never;
|
|
11619
15134
|
|
|
@@ -11693,6 +15208,16 @@ export declare function sumSet(set: Set<number> | ReadonlySet<number>): number;
|
|
|
11693
15208
|
*/
|
|
11694
15209
|
export declare function swapArrayElements<T>(array: T[], i: number, j: number): void;
|
|
11695
15210
|
|
|
15211
|
+
declare type T = ModCallbackCustom.POST_CUSTOM_REVIVE;
|
|
15212
|
+
|
|
15213
|
+
declare type T_2 = ModCallbackCustom.POST_GRID_ENTITY_COLLISION;
|
|
15214
|
+
|
|
15215
|
+
declare type T_3 = ModCallbackCustom.POST_GRID_ENTITY_CUSTOM_COLLISION;
|
|
15216
|
+
|
|
15217
|
+
declare type T_4 = ModCallbackCustom.POST_GRID_ENTITY_REMOVE;
|
|
15218
|
+
|
|
15219
|
+
declare type T_5 = ModCallbackCustom.POST_GRID_ENTITY_CUSTOM_REMOVE;
|
|
15220
|
+
|
|
11696
15221
|
/**
|
|
11697
15222
|
* Helper function to check if a Lua table has all of the provided keys.
|
|
11698
15223
|
*
|
|
@@ -11704,6 +15229,40 @@ export declare function tableHasKeys(luaMap: LuaMap<AnyNotNil, unknown>, ...keys
|
|
|
11704
15229
|
/** After taking damage, `EntityPlayer.SamsonBerserkCharge` is incremented by this amount. */
|
|
11705
15230
|
export declare const TAINTED_SAMSON_BERSERK_CHARGE_FROM_TAKING_DAMAGE = 10000;
|
|
11706
15231
|
|
|
15232
|
+
/**
|
|
15233
|
+
* This feature provides a way for end-users to get the `EntityPlayer` object for the other Tainted
|
|
15234
|
+
* Lazarus.
|
|
15235
|
+
*/
|
|
15236
|
+
declare class TaintedLazarusPlayers extends Feature {
|
|
15237
|
+
vConditionalFunc: () => boolean;
|
|
15238
|
+
private postPlayerInit;
|
|
15239
|
+
/**
|
|
15240
|
+
* Indexes are the `PtrHash`, values are the `EntityPtr` of the *other* Lazarus.
|
|
15241
|
+
*
|
|
15242
|
+
* When starting a run, the `POST_PLAYER_INIT` callback will fire first for Dead Tainted Lazarus,
|
|
15243
|
+
* then for Tainted Lazarus. When continuing a run, the `POST_PLAYER_INIT` callback will fire
|
|
15244
|
+
* first for the character that is currently active. Thus, since the order of the characters is
|
|
15245
|
+
* not certain, we insert each of their pointers into a queue, and then only populate the map when
|
|
15246
|
+
* we have one Tainted Lazarus and one Dead Tainted Lazarus.
|
|
15247
|
+
*/
|
|
15248
|
+
private checkDequeue;
|
|
15249
|
+
/**
|
|
15250
|
+
* Helper function to get the other version of Tainted Lazarus.
|
|
15251
|
+
*
|
|
15252
|
+
* - On Tainted Lazarus, returns the player object for Dead Tainted Lazarus.
|
|
15253
|
+
* - On Dead Tainted Lazarus, returns the player object for Tainted Lazarus.
|
|
15254
|
+
* - Returns undefined if player object retrieval failed for any reason.
|
|
15255
|
+
*
|
|
15256
|
+
* If you call the `EntityPlayer.Exists` method on the returned object, it will return false.
|
|
15257
|
+
* However, you can still call the other methods like you normally would (e.g.
|
|
15258
|
+
* `EntityPlayer.AddCollectible`).
|
|
15259
|
+
*
|
|
15260
|
+
* In order to use this function, you must upgrade your mod with
|
|
15261
|
+
* `ISCFeature.CHARACTER_HEALTH_CONVERSION`.
|
|
15262
|
+
*/
|
|
15263
|
+
getTaintedLazarusSubPlayer(player: EntityPlayer): EntityPlayer | undefined;
|
|
15264
|
+
}
|
|
15265
|
+
|
|
11707
15266
|
export declare function tanh(x: number): number;
|
|
11708
15267
|
|
|
11709
15268
|
/**
|
|
@@ -11834,6 +15393,36 @@ export declare const UI_HEART_WIDTH = 12;
|
|
|
11834
15393
|
/** Helper type to convert a union to an intersection. */
|
|
11835
15394
|
export declare type UnionToIntersection<U> = (U extends U ? (u: U) => 0 : never) extends (i: infer I) => 0 ? Extract<I, U> : never;
|
|
11836
15395
|
|
|
15396
|
+
/**
|
|
15397
|
+
* Use this function to enable the custom callbacks and other optional features provided by
|
|
15398
|
+
* `isaacscript-common`.
|
|
15399
|
+
*
|
|
15400
|
+
* For example:
|
|
15401
|
+
*
|
|
15402
|
+
* ```ts
|
|
15403
|
+
* const modVanilla = RegisterMod("My Mod", 1);
|
|
15404
|
+
* const mod = upgradeMod(modVanilla);
|
|
15405
|
+
*
|
|
15406
|
+
* // Subscribe to vanilla callbacks.
|
|
15407
|
+
* mod.AddCallback(ModCallback.POST_UPDATE, postUpdate);
|
|
15408
|
+
*
|
|
15409
|
+
* // Subscribe to custom callbacks.
|
|
15410
|
+
* mod.AddCallbackCustom(ModCallbackCustom.POST_ITEM_PICKUP, postItemPickup);
|
|
15411
|
+
* ```
|
|
15412
|
+
*
|
|
15413
|
+
* @param modVanilla The mod object returned by the `RegisterMod` function.
|
|
15414
|
+
* @param features Optional. An array containing the optional standard library features that you
|
|
15415
|
+
* want to enable, if any. Default is an empty array.
|
|
15416
|
+
* @param debug Optional. Whether to log additional output when a callback is fired. Default is
|
|
15417
|
+
* false.
|
|
15418
|
+
* @param timeThreshold Optional. If provided, will only log callbacks that take longer than the
|
|
15419
|
+
* specified number of seconds (if the "--luadebug" launch flag is turned on)
|
|
15420
|
+
* or milliseconds (if the "--luadebug" launch flag is turned off).
|
|
15421
|
+
* @returns The upgraded mod object.
|
|
15422
|
+
* @beta A dummy field used to hide this function from `api-extractor`.
|
|
15423
|
+
*/
|
|
15424
|
+
export declare function upgradeMod<T extends readonly ISCFeature[] = never[]>(modVanilla: Mod, features?: ISCFeatureTuple<T>, debug?: boolean, timeThreshold?: float): ModUpgradedWithFeatures<T>;
|
|
15425
|
+
|
|
11837
15426
|
/** Helper type to match all of the uppercase keys of an object. */
|
|
11838
15427
|
export declare type UppercaseKeys<T> = StartsWithUppercase<keyof T>;
|
|
11839
15428
|
|