isaacscript-common 15.6.1 → 16.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +32 -13
- package/dist/isaacscript-common.lua +143 -134
- package/dist/lualib_bundle.lua +20 -21
- package/dist/src/callbacks.d.ts +1 -1
- package/dist/src/callbacks.d.ts.map +1 -1
- package/dist/src/classes/DefaultMap.d.ts +1 -1
- package/dist/src/classes/DefaultMap.d.ts.map +1 -1
- package/dist/src/classes/ModUpgradedBase.d.ts +5 -0
- package/dist/src/classes/ModUpgradedBase.d.ts.map +1 -1
- package/dist/src/classes/ModUpgradedBase.lua +5 -1
- package/dist/src/classes/callbacks/PostCollectibleEmpty.d.ts +1 -1
- package/dist/src/classes/callbacks/PostCollectibleEmpty.d.ts.map +1 -1
- package/dist/src/classes/callbacks/PostCustomRevive.d.ts +1 -1
- package/dist/src/classes/callbacks/PostCustomRevive.d.ts.map +1 -1
- package/dist/src/classes/callbacks/PostDiceRoomActivated.d.ts +1 -1
- package/dist/src/classes/callbacks/PostDiceRoomActivated.d.ts.map +1 -1
- package/dist/src/classes/callbacks/PostGridEntityCollision.d.ts +1 -1
- package/dist/src/classes/callbacks/PostGridEntityCollision.d.ts.map +1 -1
- package/dist/src/classes/callbacks/PostGridEntityCustomCollision.d.ts +1 -1
- package/dist/src/classes/callbacks/PostGridEntityCustomCollision.d.ts.map +1 -1
- package/dist/src/classes/callbacks/PostGridEntityCustomRemove.d.ts +1 -1
- package/dist/src/classes/callbacks/PostGridEntityCustomRemove.d.ts.map +1 -1
- package/dist/src/classes/callbacks/PostGridEntityRemove.d.ts +1 -1
- package/dist/src/classes/callbacks/PostGridEntityRemove.d.ts.map +1 -1
- package/dist/src/classes/callbacks/PostItemDischarge.d.ts +3 -3
- package/dist/src/classes/callbacks/PostItemDischarge.d.ts.map +1 -1
- package/dist/src/classes/callbacks/PostPurchase.d.ts +1 -1
- package/dist/src/classes/callbacks/PostPurchase.d.ts.map +1 -1
- package/dist/src/classes/callbacks/PostRoomClearChanged.d.ts +1 -1
- package/dist/src/classes/callbacks/PostRoomClearChanged.d.ts.map +1 -1
- package/dist/src/classes/callbacks/PostTransformation.d.ts +1 -1
- package/dist/src/classes/callbacks/PostTransformation.d.ts.map +1 -1
- package/dist/src/classes/features/callbackLogic/CustomGridEntities.d.ts +1 -1
- package/dist/src/classes/features/callbackLogic/CustomGridEntities.d.ts.map +1 -1
- package/dist/src/classes/features/callbackLogic/CustomGridEntities.lua +30 -27
- package/dist/src/classes/features/callbackLogic/CustomRevive.d.ts +1 -1
- package/dist/src/classes/features/callbackLogic/CustomRevive.d.ts.map +1 -1
- package/dist/src/classes/features/callbackLogic/CustomRevive.lua +4 -4
- package/dist/src/classes/features/callbackLogic/GridEntityUpdateDetection.d.ts +2 -2
- package/dist/src/classes/features/callbackLogic/GridEntityUpdateDetection.d.ts.map +1 -1
- package/dist/src/classes/features/callbackLogic/GridEntityUpdateDetection.lua +5 -2
- package/dist/src/classes/features/other/CustomHotkeys.lua +2 -2
- package/dist/src/classes/features/other/CustomStages.lua +4 -4
- package/dist/src/classes/features/other/PickupIndexCreation.d.ts +2 -2
- package/dist/src/classes/features/other/PickupIndexCreation.d.ts.map +1 -1
- package/dist/src/classes/features/other/PickupIndexCreation.lua +33 -48
- package/dist/src/classes/features/other/RoomHistory.d.ts +2 -2
- package/dist/src/classes/features/other/extraConsoleCommands/commands.d.ts.map +1 -1
- package/dist/src/classes/features/other/extraConsoleCommands/commands.lua +1 -1
- package/dist/src/classes/private/CustomCallback.d.ts +2 -2
- package/dist/src/classes/private/CustomCallback.d.ts.map +1 -1
- package/dist/src/core/upgradeMod.d.ts +11 -2
- package/dist/src/core/upgradeMod.d.ts.map +1 -1
- package/dist/src/core/upgradeMod.lua +19 -2
- package/dist/src/functions/bitSet128.d.ts +1 -1
- package/dist/src/functions/bitSet128.d.ts.map +1 -1
- package/dist/src/functions/color.d.ts +1 -1
- package/dist/src/functions/color.d.ts.map +1 -1
- package/dist/src/functions/flag.lua +5 -1
- package/dist/src/functions/gridIndex.lua +1 -1
- package/dist/src/functions/input.d.ts +1 -1
- package/dist/src/functions/input.d.ts.map +1 -1
- package/dist/src/functions/input.lua +0 -3
- package/dist/src/functions/kColor.d.ts +1 -1
- package/dist/src/functions/kColor.d.ts.map +1 -1
- package/dist/src/functions/logEntities.lua +9 -9
- package/dist/src/functions/logMisc.lua +1 -4
- package/dist/src/functions/pills.d.ts +3 -3
- package/dist/src/functions/pills.lua +3 -3
- package/dist/src/functions/rng.d.ts +1 -1
- package/dist/src/functions/rng.d.ts.map +1 -1
- package/dist/src/functions/roomShapeWalls.lua +2 -2
- package/dist/src/functions/run.lua +1 -1
- package/dist/src/functions/ui.d.ts +1 -1
- package/dist/src/functions/ui.lua +1 -1
- package/dist/src/functions/vector.d.ts +7 -1
- package/dist/src/functions/vector.d.ts.map +1 -1
- package/dist/src/functions/vector.lua +4 -0
- package/dist/src/interfaces/CustomStageTSConfig.d.ts +1 -1
- package/dist/src/interfaces/CustomStageTSConfig.d.ts.map +1 -1
- package/dist/src/interfaces/PlayerHealth.d.ts +1 -1
- package/dist/src/interfaces/PlayerHealth.d.ts.map +1 -1
- package/dist/src/interfaces/SaveData.d.ts +12 -12
- package/dist/src/interfaces/SaveData.d.ts.map +1 -1
- package/dist/src/interfaces/private/CustomStage.d.ts +3 -3
- package/dist/src/interfaces/private/CustomStage.d.ts.map +1 -1
- package/dist/src/objects/isaacAPIClassTypeToFunctions.d.ts +2 -2
- package/dist/src/objects/isaacAPIClassTypeToFunctions.d.ts.map +1 -1
- package/dist/src/types/AllButFirst.d.ts +1 -1
- package/dist/src/types/AllButFirst.d.ts.map +1 -1
- package/dist/src/types/AllButLast.d.ts +1 -1
- package/dist/src/types/AllButLast.d.ts.map +1 -1
- package/dist/src/types/AnyClass.d.ts +1 -1
- package/dist/src/types/AnyClass.d.ts.map +1 -1
- package/dist/src/types/AnyEntity.d.ts +1 -1
- package/dist/src/types/AnyEntity.d.ts.map +1 -1
- package/dist/src/types/AnyFunction.d.ts +1 -1
- package/dist/src/types/AnyFunction.d.ts.map +1 -1
- package/dist/src/types/AnyGridEntity.d.ts +1 -1
- package/dist/src/types/AnyGridEntity.d.ts.map +1 -1
- package/dist/src/types/CollectibleIndex.d.ts +1 -1
- package/dist/src/types/CollectibleIndex.d.ts.map +1 -1
- package/dist/src/types/ConversionHeartSubType.d.ts +1 -1
- package/dist/src/types/ConversionHeartSubType.d.ts.map +1 -1
- package/dist/src/types/EntityID.d.ts +1 -1
- package/dist/src/types/EntityID.d.ts.map +1 -1
- package/dist/src/types/FunctionTuple.d.ts +1 -1
- package/dist/src/types/FunctionTuple.d.ts.map +1 -1
- package/dist/src/types/GridEntityID.d.ts +1 -1
- package/dist/src/types/GridEntityID.d.ts.map +1 -1
- package/dist/src/types/HasAllEnumKeys.d.ts +1 -1
- package/dist/src/types/HasAllEnumKeys.d.ts.map +1 -1
- package/dist/src/types/HasFunction.d.ts +1 -1
- package/dist/src/types/HasFunction.d.ts.map +1 -1
- package/dist/src/types/Immutable.d.ts +6 -6
- package/dist/src/types/Immutable.d.ts.map +1 -1
- package/dist/src/types/LowercaseKeys.d.ts +1 -1
- package/dist/src/types/LowercaseKeys.d.ts.map +1 -1
- package/dist/src/types/ModUpgraded.d.ts +3 -3
- package/dist/src/types/ModUpgraded.d.ts.map +1 -1
- package/dist/src/types/PickingUpItem.d.ts +1 -1
- package/dist/src/types/PickingUpItem.d.ts.map +1 -1
- package/dist/src/types/PickupIndex.d.ts +1 -1
- package/dist/src/types/PickupIndex.d.ts.map +1 -1
- package/dist/src/types/PlayerIndex.d.ts +1 -1
- package/dist/src/types/PlayerIndex.d.ts.map +1 -1
- package/dist/src/types/PossibleStatType.d.ts +1 -1
- package/dist/src/types/PossibleStatType.d.ts.map +1 -1
- package/dist/src/types/PublicInterface.d.ts +1 -1
- package/dist/src/types/PublicInterface.d.ts.map +1 -1
- package/dist/src/types/StartsWithLowercase.d.ts +1 -1
- package/dist/src/types/StartsWithLowercase.d.ts.map +1 -1
- package/dist/src/types/StartsWithUppercase.d.ts +1 -1
- package/dist/src/types/StartsWithUppercase.d.ts.map +1 -1
- package/dist/src/types/TSTLClass.d.ts +1 -1
- package/dist/src/types/TSTLClass.d.ts.map +1 -1
- package/dist/src/types/TupleToIntersection.d.ts +1 -1
- package/dist/src/types/TupleToIntersection.d.ts.map +1 -1
- package/dist/src/types/TupleToUnion.d.ts +1 -1
- package/dist/src/types/TupleToUnion.d.ts.map +1 -1
- package/dist/src/types/UnionToIntersection.d.ts +1 -1
- package/dist/src/types/UnionToIntersection.d.ts.map +1 -1
- package/dist/src/types/UppercaseKeys.d.ts +1 -1
- package/dist/src/types/UppercaseKeys.d.ts.map +1 -1
- package/dist/src/types/WeightedArray.d.ts +1 -1
- package/dist/src/types/WeightedArray.d.ts.map +1 -1
- package/dist/src/types/Writable.d.ts +1 -1
- package/dist/src/types/Writable.d.ts.map +1 -1
- package/dist/src/types/private/AllButFirst.d.ts +1 -1
- package/dist/src/types/private/AllButFirst.d.ts.map +1 -1
- package/dist/src/types/private/CallbackTuple.d.ts +2 -2
- package/dist/src/types/private/CallbackTuple.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/classes/ModUpgradedBase.ts +9 -0
- package/src/classes/features/callbackLogic/CustomGridEntities.ts +36 -32
- package/src/classes/features/callbackLogic/CustomRevive.ts +3 -3
- package/src/classes/features/callbackLogic/GridEntityUpdateDetection.ts +7 -3
- package/src/classes/features/other/PickupIndexCreation.ts +43 -53
- package/src/classes/features/other/RoomHistory.ts +2 -2
- package/src/classes/features/other/extraConsoleCommands/commands.ts +2 -0
- package/src/core/upgradeMod.ts +23 -0
- package/src/functions/flag.ts +1 -1
- package/src/functions/input.ts +1 -5
- package/src/functions/pills.ts +3 -3
- package/src/functions/ui.ts +1 -1
- package/src/functions/vector.ts +6 -0
package/dist/index.d.ts
CHANGED
|
@@ -1363,7 +1363,7 @@ export declare function combineSets<T>(...sets: Array<Set<T> | ReadonlySet<T>>):
|
|
|
1363
1363
|
* Helper function to get the enum name for the specified `Controller` value. Note that this will
|
|
1364
1364
|
* trim off the "BUTTON_" prefix.
|
|
1365
1365
|
*/
|
|
1366
|
-
export declare function controllerToString(controller: Controller): string
|
|
1366
|
+
export declare function controllerToString(controller: Controller): string;
|
|
1367
1367
|
|
|
1368
1368
|
/**
|
|
1369
1369
|
* This is the type that is fed to `registerCharacterHealthConversion` helper function to signify
|
|
@@ -1501,8 +1501,8 @@ declare abstract class CustomCallback<T extends ModCallbackCustom> extends Featu
|
|
|
1501
1501
|
|
|
1502
1502
|
declare class CustomGridEntities extends Feature {
|
|
1503
1503
|
private runInNFrames;
|
|
1504
|
-
private postNewRoom;
|
|
1505
1504
|
private preUseItemWeNeedToGoDeeper;
|
|
1505
|
+
private postNewRoomReordered;
|
|
1506
1506
|
/**
|
|
1507
1507
|
* Helper function to spawn a custom grid entity. Custom grid entities are persistent in that they
|
|
1508
1508
|
* will reappear if the player leaves and re-enters the room. (It will be manually respawned in
|
|
@@ -1804,7 +1804,7 @@ declare class CustomRevive extends Feature {
|
|
|
1804
1804
|
private postRender;
|
|
1805
1805
|
private postPEffectUpdate;
|
|
1806
1806
|
private checkWaitingForItemAnimation;
|
|
1807
|
-
private
|
|
1807
|
+
private postNewRoomReordered;
|
|
1808
1808
|
private postPlayerFatalDamage;
|
|
1809
1809
|
private preBerserkDeath;
|
|
1810
1810
|
/**
|
|
@@ -4865,7 +4865,7 @@ export declare function getHearts(heartSubType?: HeartSubType): EntityPickupHear
|
|
|
4865
4865
|
/**
|
|
4866
4866
|
* Helper function to get the width of the first player's hearts on the UI. This is useful for
|
|
4867
4867
|
* drawing UI elements to the right of where the player's hearts are. Make sure to use this in
|
|
4868
|
-
* combination with the
|
|
4868
|
+
* combination with the `getHUDOffsetVector` helper function.
|
|
4869
4869
|
*/
|
|
4870
4870
|
export declare function getHeartsUIWidth(): int;
|
|
4871
4871
|
|
|
@@ -5268,9 +5268,9 @@ export declare function getPillEffectName(pillEffect: PillEffect): string;
|
|
|
5268
5268
|
|
|
5269
5269
|
/**
|
|
5270
5270
|
* Helper function to get a pill effect type from a PillEffect enum value. In this context, the type
|
|
5271
|
-
* is equal to positive, negative, or neutral. This is derived from the suffix of the
|
|
5272
|
-
*
|
|
5273
|
-
*
|
|
5271
|
+
* is equal to positive, negative, or neutral. This is derived from the suffix of the "class" tag in
|
|
5272
|
+
* the "pocketitems.xml" file. Use the `getPillEffectClass` helper function to determine the "power"
|
|
5273
|
+
* of the pill.
|
|
5274
5274
|
*
|
|
5275
5275
|
* Due to limitations in the API, this function will not work properly for modded pill effects, and
|
|
5276
5276
|
* will always return `DEFAULT_PILL_EFFECT_TYPE` in those cases.
|
|
@@ -6613,7 +6613,7 @@ declare class GridEntityUpdateDetection extends Feature {
|
|
|
6613
6613
|
private checkGridEntityStateChanged;
|
|
6614
6614
|
private checkNewGridEntity;
|
|
6615
6615
|
private updateTupleInMap;
|
|
6616
|
-
private
|
|
6616
|
+
private postNewRoomReordered;
|
|
6617
6617
|
}
|
|
6618
6618
|
|
|
6619
6619
|
/**
|
|
@@ -10974,6 +10974,11 @@ export declare class ModUpgradedBase implements Mod {
|
|
|
10974
10974
|
* don't have access to it..
|
|
10975
10975
|
*/
|
|
10976
10976
|
private initOptionalFeature;
|
|
10977
|
+
/**
|
|
10978
|
+
* This is mostly the same as the `AddCustomCallback` method, but we initialize the custom
|
|
10979
|
+
* callback without actually registering a subscription.
|
|
10980
|
+
*/
|
|
10981
|
+
private initCustomCallbackEarly;
|
|
10977
10982
|
}
|
|
10978
10983
|
|
|
10979
10984
|
export declare const MOVEMENT_ACTIONS_SET: ReadonlySet<ButtonAction>;
|
|
@@ -11322,7 +11327,8 @@ export declare type PickupIndex = int & {
|
|
|
11322
11327
|
declare class PickupIndexCreation extends Feature {
|
|
11323
11328
|
private roomHistory;
|
|
11324
11329
|
private postPickupInit;
|
|
11325
|
-
private
|
|
11330
|
+
private setPickupIndex;
|
|
11331
|
+
private getPickupIndexFromPreviousData;
|
|
11326
11332
|
private postEntityRemovePickup;
|
|
11327
11333
|
private checkDespawningFromPlayerLeavingRoom;
|
|
11328
11334
|
/**
|
|
@@ -11330,7 +11336,6 @@ declare class PickupIndexCreation extends Feature {
|
|
|
11330
11336
|
* Keep track of the metadata for later.
|
|
11331
11337
|
*/
|
|
11332
11338
|
private trackDespawningPickupMetadata;
|
|
11333
|
-
private postNewRoomReordered;
|
|
11334
11339
|
private getPostAscentPickupIndex;
|
|
11335
11340
|
/**
|
|
11336
11341
|
* Mods often have to track variables relating to a pickups. Finding an index for these kinds of
|
|
@@ -12561,8 +12566,8 @@ declare class RoomHistory extends Feature {
|
|
|
12561
12566
|
/**
|
|
12562
12567
|
* Helper function to detect if the game is in the state where the room index has changed to a new
|
|
12563
12568
|
* room, but the entities from the previous room are currently in the process of despawning. (At
|
|
12564
|
-
* this point, the `POST_NEW_ROOM` callback
|
|
12565
|
-
* entry in the room history array for the current room.)
|
|
12569
|
+
* this point, the `POST_NEW_ROOM` callback and the `POST_NEW_ROOM_EARLY` callback will not have
|
|
12570
|
+
* fired yet, and there will not be an entry in the room history array for the current room.)
|
|
12566
12571
|
*
|
|
12567
12572
|
* This function is intended to be used in the `POST_ENTITY_REMOVE` callback to detect when an
|
|
12568
12573
|
* entity is despawning.
|
|
@@ -14434,6 +14439,14 @@ export declare type UnionToIntersection<U> = (U extends U ? (u: U) => 0 : never)
|
|
|
14434
14439
|
* @param modVanilla The mod object returned by the `RegisterMod` function.
|
|
14435
14440
|
* @param features Optional. An array containing the optional standard library features that you
|
|
14436
14441
|
* want to enable, if any. Default is an empty array.
|
|
14442
|
+
* @param customCallbacksUsed Optional. An array containing the custom callbacks that you will be
|
|
14443
|
+
* subscribing to after you upgrade your mod. Specifying this will
|
|
14444
|
+
* immediately initialize the callbacks (as opposed to lazy-initializing
|
|
14445
|
+
* them when you first subscribe to the callback). This is only necessary
|
|
14446
|
+
* if you the order of callback firing is important for your mod. (For
|
|
14447
|
+
* example, you may want the `POST_NEW_ROOM` part of the
|
|
14448
|
+
* `POST_GRID_ENTITY_INIT` callback to fire before your own
|
|
14449
|
+
* `POST_NEW_ROOM` callbacks.)
|
|
14437
14450
|
* @param debug Optional. Whether to log additional output when a callback is fired. Default is
|
|
14438
14451
|
* false.
|
|
14439
14452
|
* @param timeThreshold Optional. If provided, will only log callbacks that take longer than the
|
|
@@ -14441,7 +14454,7 @@ export declare type UnionToIntersection<U> = (U extends U ? (u: U) => 0 : never)
|
|
|
14441
14454
|
* or milliseconds (if the "--luadebug" launch flag is turned off).
|
|
14442
14455
|
* @returns The upgraded mod object.
|
|
14443
14456
|
*/
|
|
14444
|
-
export declare function upgradeMod<T extends readonly ISCFeature[] = never[]>(modVanilla: Mod, features?: ISCFeatureTuple<T>, debug?: boolean, timeThreshold?: float): ModUpgraded<T>;
|
|
14457
|
+
export declare function upgradeMod<T extends readonly ISCFeature[] = never[]>(modVanilla: Mod, features?: ISCFeatureTuple<T>, customCallbacksUsed?: ModCallbackCustom[] | readonly ModCallbackCustom[], debug?: boolean, timeThreshold?: float): ModUpgraded<T>;
|
|
14445
14458
|
|
|
14446
14459
|
/** Helper type to match all of the uppercase keys of an object. */
|
|
14447
14460
|
export declare type UppercaseKeys<T> = StartsWithUppercase<keyof T>;
|
|
@@ -14505,6 +14518,12 @@ export declare function validateEnumContiguous<T>(transpiledEnumName: string, tr
|
|
|
14505
14518
|
*/
|
|
14506
14519
|
export declare function validateInterfaceMatchesEnum<T extends Record<Enum, unknown>, Enum extends string | number>(): void;
|
|
14507
14520
|
|
|
14521
|
+
/**
|
|
14522
|
+
* Helper function to compare two vectors for equality.
|
|
14523
|
+
*
|
|
14524
|
+
* This function is useful because vectors are not directly comparable. In other words, `Vector(1.2)
|
|
14525
|
+
* === Vector(1.2)` will be equal to false.
|
|
14526
|
+
*/
|
|
14508
14527
|
export declare function vectorEquals(vector1: Vector, vector2: Vector): boolean;
|
|
14509
14528
|
|
|
14510
14529
|
/**
|