isaacscript-common 20.3.1 → 20.4.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 +111 -53
- package/dist/isaacscript-common.lua +414 -389
- package/dist/src/classes/callbacks/PostSlotDestroyed.d.ts +0 -8
- package/dist/src/classes/callbacks/PostSlotDestroyed.d.ts.map +1 -1
- package/dist/src/classes/callbacks/PostSlotDestroyed.lua +3 -51
- package/dist/src/classes/features/callbackLogic/SlotDestroyedDetection.d.ts +36 -0
- package/dist/src/classes/features/callbackLogic/SlotDestroyedDetection.d.ts.map +1 -0
- package/dist/src/classes/features/callbackLogic/SlotDestroyedDetection.lua +91 -0
- package/dist/src/classes/features/other/ExtraConsoleCommands.d.ts.map +1 -1
- package/dist/src/classes/features/other/ExtraConsoleCommands.lua +2 -3
- package/dist/src/classes/features/other/RoomHistory.d.ts.map +1 -1
- package/dist/src/classes/features/other/RoomHistory.lua +6 -1
- package/dist/src/classes/features/other/SaveDataManager.d.ts +3 -2
- package/dist/src/classes/features/other/SaveDataManager.d.ts.map +1 -1
- package/dist/src/classes/features/other/extraConsoleCommands/commands.d.ts.map +1 -1
- package/dist/src/classes/features/other/extraConsoleCommands/commands.lua +69 -127
- package/dist/src/classes/features/other/extraConsoleCommands/subroutines.d.ts.map +1 -1
- package/dist/src/classes/features/other/extraConsoleCommands/subroutines.lua +11 -22
- package/dist/src/enums/ISCFeature.d.ts +44 -43
- package/dist/src/enums/ISCFeature.d.ts.map +1 -1
- package/dist/src/enums/ISCFeature.lua +45 -43
- package/dist/src/enums/ModCallbackCustom.d.ts +5 -1
- package/dist/src/enums/ModCallbackCustom.d.ts.map +1 -1
- package/dist/src/enums/SlotDestructionType.d.ts +13 -0
- package/dist/src/enums/SlotDestructionType.d.ts.map +1 -1
- package/dist/src/features.d.ts +46 -43
- package/dist/src/features.d.ts.map +1 -1
- package/dist/src/features.lua +3 -0
- package/dist/src/functions/deepCopyTests.d.ts.map +1 -1
- package/dist/src/functions/deepCopyTests.lua +1 -3
- package/dist/src/functions/logMisc.d.ts.map +1 -1
- package/dist/src/functions/logMisc.lua +1 -3
- package/dist/src/functions/mergeTests.d.ts.map +1 -1
- package/dist/src/functions/mergeTests.lua +2 -5
- package/dist/src/functions/slots.d.ts +4 -0
- package/dist/src/functions/slots.d.ts.map +1 -0
- package/dist/src/functions/slots.lua +27 -0
- package/dist/src/functions/utils.d.ts +3 -4
- package/dist/src/functions/utils.d.ts.map +1 -1
- package/dist/src/functions/utils.lua +8 -6
- package/dist/src/index.d.ts +1 -0
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.lua +8 -0
- package/dist/src/interfaces/RoomDescription.d.ts +1 -0
- package/dist/src/interfaces/RoomDescription.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/classes/callbacks/PostSlotDestroyed.ts +2 -72
- package/src/classes/features/callbackLogic/SlotDestroyedDetection.ts +163 -0
- package/src/classes/features/other/ExtraConsoleCommands.ts +3 -6
- package/src/classes/features/other/RoomHistory.ts +6 -0
- package/src/classes/features/other/SaveDataManager.ts +3 -2
- package/src/classes/features/other/extraConsoleCommands/commands.ts +70 -78
- package/src/classes/features/other/extraConsoleCommands/subroutines.ts +11 -12
- package/src/enums/ISCFeature.ts +1 -0
- package/src/enums/ModCallbackCustom.ts +5 -1
- package/src/enums/SlotDestructionType.ts +14 -0
- package/src/features.ts +6 -0
- package/src/functions/deepCopyTests.ts +1 -2
- package/src/functions/logMisc.ts +1 -2
- package/src/functions/mergeTests.ts +2 -4
- package/src/functions/slots.ts +23 -0
- package/src/functions/utils.ts +7 -6
- package/src/index.ts +1 -0
- package/src/interfaces/RoomDescription.ts +1 -0
package/dist/index.d.ts
CHANGED
|
@@ -3123,6 +3123,12 @@ export declare function deserializeRNG(rng: SerializedRNG): RNG;
|
|
|
3123
3123
|
*/
|
|
3124
3124
|
export declare function deserializeVector(vector: SerializedVector): Vector;
|
|
3125
3125
|
|
|
3126
|
+
declare type DespawnedSlotTuple = [
|
|
3127
|
+
gameFrame: int,
|
|
3128
|
+
position: Vector,
|
|
3129
|
+
entityPtr: EntityPtr
|
|
3130
|
+
];
|
|
3131
|
+
|
|
3126
3132
|
/** For `EntityType.EFFECT` (1000), `EffectVariant.DICE_FLOOR` (76). */
|
|
3127
3133
|
export declare const DICE_FLOOR_TRIGGER_SQUARE_SIZE = 75;
|
|
3128
3134
|
|
|
@@ -7204,49 +7210,50 @@ export declare enum ISCFeature {
|
|
|
7204
7210
|
ITEM_PICKUP_DETECTION = 7,
|
|
7205
7211
|
PLAYER_COLLECTIBLE_DETECTION = 8,
|
|
7206
7212
|
PLAYER_REORDERED_CALLBACKS = 9,
|
|
7207
|
-
|
|
7208
|
-
|
|
7209
|
-
|
|
7210
|
-
|
|
7211
|
-
|
|
7212
|
-
|
|
7213
|
-
|
|
7214
|
-
|
|
7215
|
-
|
|
7216
|
-
|
|
7217
|
-
|
|
7218
|
-
|
|
7219
|
-
|
|
7220
|
-
|
|
7221
|
-
|
|
7222
|
-
|
|
7223
|
-
|
|
7224
|
-
|
|
7225
|
-
|
|
7226
|
-
|
|
7227
|
-
|
|
7228
|
-
|
|
7229
|
-
|
|
7230
|
-
|
|
7231
|
-
|
|
7232
|
-
|
|
7233
|
-
|
|
7234
|
-
|
|
7235
|
-
|
|
7236
|
-
|
|
7237
|
-
|
|
7238
|
-
|
|
7239
|
-
|
|
7240
|
-
|
|
7241
|
-
|
|
7242
|
-
|
|
7243
|
-
|
|
7244
|
-
|
|
7245
|
-
|
|
7246
|
-
|
|
7247
|
-
|
|
7248
|
-
|
|
7249
|
-
|
|
7213
|
+
SLOT_DESTROYED_DETECTION = 10,
|
|
7214
|
+
SLOT_RENDER_DETECTION = 11,
|
|
7215
|
+
SLOT_UPDATE_DETECTION = 12,
|
|
7216
|
+
CHARACTER_HEALTH_CONVERSION = 13,
|
|
7217
|
+
CHARACTER_STATS = 14,
|
|
7218
|
+
COLLECTIBLE_ITEM_POOL_TYPE = 15,
|
|
7219
|
+
CUSTOM_GRID_ENTITIES = 16,
|
|
7220
|
+
CUSTOM_ITEM_POOLS = 17,
|
|
7221
|
+
CUSTOM_HOTKEYS = 18,
|
|
7222
|
+
CUSTOM_PICKUPS = 19,
|
|
7223
|
+
CUSTOM_STAGES = 20,
|
|
7224
|
+
CUSTOM_TRAPDOORS = 21,
|
|
7225
|
+
DEBUG_DISPLAY = 22,
|
|
7226
|
+
DEPLOY_JSON_ROOM = 23,
|
|
7227
|
+
DISABLE_ALL_SOUND = 24,
|
|
7228
|
+
DISABLE_INPUTS = 25,
|
|
7229
|
+
FADE_IN_REMOVER = 26,
|
|
7230
|
+
FAST_RESET = 27,
|
|
7231
|
+
FLYING_DETECTION = 28,
|
|
7232
|
+
FORGOTTEN_SWITCH = 29,
|
|
7233
|
+
EXTRA_CONSOLE_COMMANDS = 30,
|
|
7234
|
+
ITEM_POOL_DETECTION = 31,
|
|
7235
|
+
MODDED_ELEMENT_DETECTION = 32,
|
|
7236
|
+
MODDED_ELEMENT_SETS = 33,
|
|
7237
|
+
NO_SIREN_STEAL = 34,
|
|
7238
|
+
PAUSE = 35,
|
|
7239
|
+
PERSISTENT_ENTITIES = 36,
|
|
7240
|
+
PICKUP_INDEX_CREATION = 37,
|
|
7241
|
+
PLAYER_INVENTORY = 38,
|
|
7242
|
+
PONY_DETECTION = 39,
|
|
7243
|
+
PRESS_INPUT = 40,
|
|
7244
|
+
PREVENT_CHILD_ENTITIES = 41,
|
|
7245
|
+
PREVENT_COLLECTIBLE_ROTATION = 42,
|
|
7246
|
+
PREVENT_GRID_ENTITY_RESPAWN = 43,
|
|
7247
|
+
ROOM_CLEAR_FRAME = 44,
|
|
7248
|
+
ROOM_HISTORY = 45,
|
|
7249
|
+
RUN_IN_N_FRAMES = 46,
|
|
7250
|
+
RUN_NEXT_ROOM = 47,
|
|
7251
|
+
SAVE_DATA_MANAGER = 48,
|
|
7252
|
+
SPAWN_ALT_ROCK_REWARDS = 49,
|
|
7253
|
+
SPAWN_COLLECTIBLE = 50,
|
|
7254
|
+
STAGE_HISTORY = 51,
|
|
7255
|
+
START_AMBUSH = 52,
|
|
7256
|
+
TAINTED_LAZARUS_PLAYERS = 53
|
|
7250
7257
|
}
|
|
7251
7258
|
|
|
7252
7259
|
/**
|
|
@@ -7266,6 +7273,7 @@ declare interface ISCFeatureToClass {
|
|
|
7266
7273
|
[ISCFeature.ITEM_PICKUP_DETECTION]: ItemPickupDetection;
|
|
7267
7274
|
[ISCFeature.PLAYER_COLLECTIBLE_DETECTION]: PlayerCollectibleDetection;
|
|
7268
7275
|
[ISCFeature.PLAYER_REORDERED_CALLBACKS]: PlayerReorderedCallbacks;
|
|
7276
|
+
[ISCFeature.SLOT_DESTROYED_DETECTION]: SlotDestroyedDetection;
|
|
7269
7277
|
[ISCFeature.SLOT_RENDER_DETECTION]: SlotRenderDetection;
|
|
7270
7278
|
[ISCFeature.SLOT_UPDATE_DETECTION]: SlotUpdateDetection;
|
|
7271
7279
|
[ISCFeature.CHARACTER_HEALTH_CONVERSION]: CharacterHealthConversion;
|
|
@@ -7883,6 +7891,9 @@ export declare function isSingleUseCollectible(collectibleType: CollectibleType)
|
|
|
7883
7891
|
/** For `EntityType.SLOT` (6). */
|
|
7884
7892
|
export declare function isSlot(entity: Entity): entity is EntitySlot;
|
|
7885
7893
|
|
|
7894
|
+
/** Returns true for the specific variants of `EntityType.SLOT` that are machines. */
|
|
7895
|
+
export declare function isSlotMachine(entity: Entity): boolean;
|
|
7896
|
+
|
|
7886
7897
|
/** Returns true for cards that have `CardType.SPECIAL`. */
|
|
7887
7898
|
export declare function isSpecialCard(cardType: CardType): boolean;
|
|
7888
7899
|
|
|
@@ -8374,6 +8385,12 @@ export declare function logAllEntities(includeBackgroundEffects: boolean, entity
|
|
|
8374
8385
|
*/
|
|
8375
8386
|
export declare function logAllGridEntities(includeWalls?: boolean, gridEntityTypeFilter?: GridEntityType): void;
|
|
8376
8387
|
|
|
8388
|
+
/**
|
|
8389
|
+
* Helper function to log a message to the "log.txt" file and to print it to the screen at the same
|
|
8390
|
+
* time.
|
|
8391
|
+
*/
|
|
8392
|
+
export declare function logAndPrint(msg: string): void;
|
|
8393
|
+
|
|
8377
8394
|
/** Helper function to enumerate all of the values in an array. */
|
|
8378
8395
|
export declare function logArray<T>(array: T[] | readonly T[]): void;
|
|
8379
8396
|
|
|
@@ -10161,7 +10178,11 @@ export declare enum ModCallbackCustom {
|
|
|
10161
10178
|
* matches the sub-type provided.
|
|
10162
10179
|
*
|
|
10163
10180
|
* ```ts
|
|
10164
|
-
* function postSlotAnimationChanged(
|
|
10181
|
+
* function postSlotAnimationChanged(
|
|
10182
|
+
* slot: Entity,
|
|
10183
|
+
* previousAnimation: string,
|
|
10184
|
+
* currentAnimation: string,
|
|
10185
|
+
* ): void {}
|
|
10165
10186
|
* ```
|
|
10166
10187
|
*/
|
|
10167
10188
|
POST_SLOT_ANIMATION_CHANGED = 86,
|
|
@@ -12253,6 +12274,11 @@ declare class PostSlotAnimationChanged extends CustomCallback<ModCallbackCustom.
|
|
|
12253
12274
|
protected shouldFire: typeof shouldFireSlot;
|
|
12254
12275
|
}
|
|
12255
12276
|
|
|
12277
|
+
declare class PostSlotDestroyed extends CustomCallback<ModCallbackCustom.POST_SLOT_DESTROYED> {
|
|
12278
|
+
constructor();
|
|
12279
|
+
protected shouldFire: typeof shouldFireSlot;
|
|
12280
|
+
}
|
|
12281
|
+
|
|
12256
12282
|
declare class PostSlotInit extends CustomCallback<ModCallbackCustom.POST_SLOT_INIT> {
|
|
12257
12283
|
constructor();
|
|
12258
12284
|
protected shouldFire: typeof shouldFireSlot;
|
|
@@ -12360,13 +12386,6 @@ declare class PreventGridEntityRespawn extends Feature {
|
|
|
12360
12386
|
preventGridEntityRespawn(): void;
|
|
12361
12387
|
}
|
|
12362
12388
|
|
|
12363
|
-
/**
|
|
12364
|
-
* Helper function to print something to the in-game console. Use this instead of invoking the
|
|
12365
|
-
* `Isaac.ConsoleOutput` method directly because it will automatically insert a newline at the end
|
|
12366
|
-
* of the message (which `Isaac.ConsoleOutput` does not do by default).
|
|
12367
|
-
*/
|
|
12368
|
-
export declare function printConsole(msg: string): void;
|
|
12369
|
-
|
|
12370
12389
|
/** Helper function to print whether something was enabled or disabled to the in-game console. */
|
|
12371
12390
|
export declare function printEnabled(enabled: boolean, description: string): void;
|
|
12372
12391
|
|
|
@@ -13069,6 +13088,7 @@ declare class RoomClearFrame extends Feature {
|
|
|
13069
13088
|
|
|
13070
13089
|
/** This is used by the room history feature of the standard library. */
|
|
13071
13090
|
export declare interface RoomDescription {
|
|
13091
|
+
startSeedString: string;
|
|
13072
13092
|
stage: LevelStage;
|
|
13073
13093
|
stageType: StageType;
|
|
13074
13094
|
stageID: StageID;
|
|
@@ -13401,8 +13421,9 @@ declare class SaveDataManager extends Feature {
|
|
|
13401
13421
|
/**
|
|
13402
13422
|
* This is the entry point to the save data manager, a system which provides two major features:
|
|
13403
13423
|
*
|
|
13404
|
-
* 1.
|
|
13405
|
-
*
|
|
13424
|
+
* 1. Automatic resetting of variables on a new run, on a new level, or on a new room (as
|
|
13425
|
+
* desired).
|
|
13426
|
+
* 2. Automatic saving and loading of all tracked data to the "save#.dat" file.
|
|
13406
13427
|
*
|
|
13407
13428
|
* You feed this function with an object containing your variables, and then it will automatically
|
|
13408
13429
|
* manage them for you. (See below for an example.)
|
|
@@ -14096,9 +14117,46 @@ export declare function shuffleArrayInPlace<T>(array: T[], seedOrRNG?: Seed | RN
|
|
|
14096
14117
|
*/
|
|
14097
14118
|
export declare function sign(n: number): int;
|
|
14098
14119
|
|
|
14120
|
+
declare class SlotDestroyedDetection extends Feature {
|
|
14121
|
+
v: {
|
|
14122
|
+
room: {
|
|
14123
|
+
destroyedSlotSet: Set<PtrHash>;
|
|
14124
|
+
despawnedSlots: DespawnedSlotTuple[];
|
|
14125
|
+
};
|
|
14126
|
+
};
|
|
14127
|
+
private postSlotDestroyed;
|
|
14128
|
+
private roomHistory;
|
|
14129
|
+
constructor(postSlotDestroyed: PostSlotDestroyed, roomHistory: RoomHistory);
|
|
14130
|
+
private postPickupInitCollectible;
|
|
14131
|
+
private postEntityRemoveSlot;
|
|
14132
|
+
private postEntityRemoveSlotMachine;
|
|
14133
|
+
private postEntityRemoveBeggar;
|
|
14134
|
+
private postSlotUpdate;
|
|
14135
|
+
/**
|
|
14136
|
+
* Slots normally have an entity collision class of `EntityCollisionClass.ALL` (4) and a grid
|
|
14137
|
+
* collision class of `EntityGridCollisionClass.NONE` (0). When they are destroyed with a bomb,
|
|
14138
|
+
* the entity collision class stays the same, but the grid collision class switches to
|
|
14139
|
+
* `EntityGridCollisionClass.GROUND` (5).
|
|
14140
|
+
*/
|
|
14141
|
+
private checkDestroyedFromCollisionClass;
|
|
14142
|
+
}
|
|
14143
|
+
|
|
14099
14144
|
/** This is used in the `POST_SLOT_DESTROYED` custom callback. */
|
|
14100
14145
|
export declare enum SlotDestructionType {
|
|
14146
|
+
/**
|
|
14147
|
+
* When a machine or a beggar is blown up by a bomb or is otherwise removed without spawning a
|
|
14148
|
+
* collectible.
|
|
14149
|
+
*
|
|
14150
|
+
* Note that the destruction type for a Crane Game will be `SlotDestructionType.NORMAL`, even if
|
|
14151
|
+
* it destroyed via spawning three separate collectibles.
|
|
14152
|
+
*/
|
|
14101
14153
|
NORMAL = 0,
|
|
14154
|
+
/**
|
|
14155
|
+
* When a machine or a beggar is removed while spawning a collectible reward.
|
|
14156
|
+
*
|
|
14157
|
+
* Note that the destruction type for a Crane Game will be `SlotDestructionType.NORMAL`, even if
|
|
14158
|
+
* it destroyed via spawning three separate collectibles.
|
|
14159
|
+
*/
|
|
14102
14160
|
COLLECTIBLE_PAYOUT = 1
|
|
14103
14161
|
}
|
|
14104
14162
|
|